diff --git a/MAINTAINERS b/MAINTAINERS index 0483d469f1f2..e77e3037e91a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -86,7 +86,7 @@ sh(1) jilles Pre-commit review requested. This also applies compiled in as builtins. share/mk imp, bapt, bdrewery, emaste, sjg Make is hard. share/mk/*.test.mk freebsd-testing,ngie (same list as share/mk too) Pre-commit review requested. -sys/boot/forth dteske Pre-commit review requested. +stand/forth dteske Pre-commit review requested. sys/compat/linuxkpi hselasky If in doubt, ask. sys/dev/e1000 erj Pre-commit phabricator review requested. sys/dev/ixgbe erj Pre-commit phabricator review requested. diff --git a/Makefile b/Makefile index 7bd234bd65d5..7674e608b6bd 100644 --- a/Makefile +++ b/Makefile @@ -130,7 +130,7 @@ TGTS= all all-man buildenv buildenvvars buildkernel buildworld \ installkernel.debug packagekernel packageworld \ reinstallkernel reinstallkernel.debug \ installworld kernel-toolchain libraries lint maninstall \ - obj objlink rerelease showconfig tags toolchain update \ + obj objlink showconfig tags toolchain update \ _worldtmp _legacy _bootstrap-tools _cleanobj _obj \ _build-tools _build-metadata _cross-tools _includes _libraries \ build32 distribute32 install32 buildsoft distributesoft installsoft \ @@ -167,6 +167,18 @@ META_TGT_WHITELIST+= \ tinderbox toolchain \ toolchains universe world worlds xdev xdev-build +# Likewise for AUTO_OBJ. Many targets do not need object directories created +# for each visited directory. Only when things are being built are they +# needed. Having AUTO_OBJ disabled in a build target is fine as it should +# fallback to running 'make obj' as needed. If a target is not in this list +# then it is ran with MK_AUTO_OBJ=no in environment. +# 'showconfig' is in the list to avoid forcing MK_AUTO_OBJ=no for it. +AUTO_OBJ_TGT_WHITELIST+= \ + _* all all-man build* depend everything *toolchain* includes \ + libraries obj objlink showconfig tags xdev xdev-build native-xtools \ + stage* create-packages* real-packages sign-packages package-pkg \ + tinderbox universe* kernel kernels world worlds bmake + .ORDER: buildworld installworld .ORDER: buildworld distrib-dirs .ORDER: buildworld distribution @@ -235,8 +247,11 @@ SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk _MAKE= PATH=${PATH} MAKE_CMD="${MAKE}" ${SUB_MAKE} -f Makefile.inc1 \ TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} +.if defined(MK_META_MODE) && ${MK_META_MODE} == "yes" # Only allow meta mode for the whitelisted targets. See META_TGT_WHITELIST -# above. +# above. If overridden as a make argument then don't bother trying to +# disable it. +.if empty(.MAKEOVERRIDES:MMK_META_MODE) .for _tgt in ${META_TGT_WHITELIST} .if make(${_tgt}) _CAN_USE_META_MODE?= yes @@ -244,17 +259,37 @@ _CAN_USE_META_MODE?= yes .endfor .if !defined(_CAN_USE_META_MODE) _MAKE+= MK_META_MODE=no +MK_META_MODE= no .if defined(.PARSEDIR) .unexport META_MODE .endif -.elif defined(MK_META_MODE) && ${MK_META_MODE} == "yes" +.endif # !defined(_CAN_USE_META_MODE) +.endif # empty(.MAKEOVERRIDES:MMK_META_MODE) + +.if ${MK_META_MODE} == "yes" .if !exists(/dev/filemon) && !defined(NO_FILEMON) && !make(showconfig) # Require filemon be loaded to provide a working incremental build .error ${.newline}ERROR: The filemon module (/dev/filemon) is not loaded. \ ${.newline}ERROR: WITH_META_MODE is enabled but requires filemon for an incremental build. \ ${.newline}ERROR: 'kldload filemon' or pass -DNO_FILEMON to suppress this error. .endif # !exists(/dev/filemon) && !defined(NO_FILEMON) -.endif # !defined(_CAN_USE_META_MODE) +.endif # ${MK_META_MODE} == yes +.endif # defined(MK_META_MODE) && ${MK_META_MODE} == yes + +# Only allow AUTO_OBJ for the whitelisted targets. See AUTO_OBJ_TGT_WHITELIST +# above. MK_AUTO_OBJ not checked here for "yes" as it may not yet be enabled +# since it is opportunistic. +.if empty(.MAKEOVERRIDES:MMK_AUTO_OBJ) +.for _tgt in ${AUTO_OBJ_TGT_WHITELIST} +.if make(${_tgt}) +_CAN_USE_AUTO_OBJ?= yes +.endif +.endfor +.if !defined(_CAN_USE_AUTO_OBJ) +_MAKE+= MK_AUTO_OBJ=no +MK_AUTO_OBJ= no +.endif +.endif # empty(.MAKEOVERRIDES:MMK_AUTO_OBJ) # Guess target architecture from target type, and vice versa, based on # historic FreeBSD practice of tending to have TARGET == TARGET_ARCH @@ -290,6 +325,15 @@ ${XTGTS}: _assert_target _TARGET?= ${MACHINE} _TARGET_ARCH?= ${MACHINE_ARCH} +.if make(native-xtools*) +NXB_TARGET:= ${_TARGET} +NXB_TARGET_ARCH:= ${_TARGET_ARCH} +_TARGET= ${MACHINE} +_TARGET_ARCH= ${MACHINE_ARCH} +_MAKE+= NXB_TARGET=${NXB_TARGET} \ + NXB_TARGET_ARCH=${NXB_TARGET_ARCH} +.endif + .if make(print-dir) .SILENT: .endif @@ -554,7 +598,7 @@ universe_${target}_kernels: universe_${target}_worlds .PHONY universe_${target}_kernels: universe_${target}_prologue .MAKE .PHONY .if exists(${KERNSRCDIR}/${target}/conf/NOTES) @(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \ - ${SUB_MAKE} -DNO_OBJ LINT \ + ${SUB_MAKE} LINT \ > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ (echo "${target} 'make LINT' failed," \ "check _.${target}.makeLINT for details"| ${MAKEFAIL})) diff --git a/Makefile.inc1 b/Makefile.inc1 index 45b8fe174394..8c5ba9407c24 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -251,6 +251,9 @@ SUBDIR+=secure .if !defined(NO_SHARE) SUBDIR+=share .endif +.if ${MK_BOOT} != "no" +SUBDIR+=stand +.endif SUBDIR+=sys usr.bin usr.sbin .if ${MK_TESTS} != "no" SUBDIR+= tests @@ -1986,6 +1989,9 @@ _rescue=rescue/rescue .if ${MK_TCSH} != "no" _tcsh=bin/csh .endif +.if ${MK_FILE} != "no" +_libmagic=lib/libmagic +.endif # kernel-toolchain skips _cleanobj, so handle cleaning up previous # build-tools directories if needed. @@ -2002,7 +2008,7 @@ _bt_clean= ${CLEANDIR} ${_rescue} \ ${_share} \ usr.bin/awk \ - lib/libmagic \ + ${_libmagic} \ usr.bin/mkesdb_static \ usr.bin/mkcsmapper_static \ usr.bin/vi/catalog \ @@ -2079,7 +2085,7 @@ _clang_libs= lib/clang _gcc= gnu/usr.bin/cc .endif .if ${MK_USB} != "no" -_usb_tools= sys/boot/usb/tools +_usb_tools= stand/usb/tools .endif cross-tools: .MAKE .PHONY @@ -2110,7 +2116,7 @@ cross-tools: .MAKE .PHONY # to pickup. # NXBOBJROOT= ${OBJROOT}${MACHINE}.${MACHINE_ARCH}/nxb/ -NXBOBJTOP= ${NXBOBJROOT}${TARGET}.${TARGET_ARCH} +NXBOBJTOP= ${NXBOBJROOT}${NXB_TARGET}.${NXB_TARGET_ARCH} NXTP?= /nxb-bin .if ${NXTP:N/*} .error NXTP variable should be an absolute path @@ -2180,20 +2186,27 @@ NXBDIRS+= \ usr.bin/yacc \ usr.sbin/chown +SUBDIR_DEPEND_usr.bin/clang= lib/clang .if ${MK_CLANG} != "no" NXBDIRS+= lib/clang -SUBDIR_DEPEND_usr.bin/clang= lib/clang NXBDIRS+= usr.bin/clang -.elif ${MK_GCC} != "no" +.endif +.if ${MK_GCC} != "no" NXBDIRS+= gnu/usr.bin/cc .endif .if ${MK_BINUTILS} != "no" NXBDIRS+= gnu/usr.bin/binutils .endif +# XXX: native-xtools passes along ${NXBDIRS} in SUBDIR_OVERRIDE that needs +# to be evaluated after NXBDIRS is set. +.if make(install) && !empty(SUBDIR_OVERRIDE) +SUBDIR= ${SUBDIR_OVERRIDE} +.endif NXBMAKEARGS+= \ OBJTOP=${NXBOBJTOP:Q} \ OBJROOT=${NXBOBJROOT:Q} \ + MAKEOBJDIRPREFIX= \ -DNO_SHARED \ -DNO_CPU_CFLAGS \ -DNO_PIC \ @@ -2216,7 +2229,10 @@ NXBMAKEARGS+= \ MK_WARNS=no \ MK_ZFS=no - +.if make(native-xtools*) && \ + (!defined(NXB_TARGET) || !defined(NXB_TARGET_ARCH)) +.error Missing NXB_TARGET / NXB_TARGET_ARCH +.endif # For 'toolchain' we want to produce native binaries that themselves generate # native binaries. NXBTMAKE= ${NXBMAKEENV} ${MAKE} ${NXBMAKEARGS:N-DNO_PIC:N-DNO_SHARED} \ @@ -2224,11 +2240,32 @@ NXBTMAKE= ${NXBMAKEENV} ${MAKE} ${NXBMAKEARGS:N-DNO_PIC:N-DNO_SHARED} \ # For 'everything' we want to produce native binaries (hence -target to # be MACHINE) that themselves generate TARGET.TARGET_ARCH binaries. # TARGET/TARGET_ARCH are still passed along from user. -NXBMAKE= ${NXBMAKEENV} ${MAKE} ${NXBMAKEARGS} \ +# +# Use the toolchain we create as an external toolchain. +.if ${USING_SYSTEM_COMPILER} == "yes" || ${XCC:N${CCACHE_BIN}:M/*} +NXBMAKE+= XCC="${XCC}" \ + XCXX="${XCXX}" \ + XCPP="${XCPP}" +.else +NXBMAKE+= XCC="${NXBOBJTOP}/tmp/usr/bin/cc" \ + XCXX="${NXBOBJTOP}/tmp/usr/bin/c++" \ + XCPP="${NXBOBJTOP}/tmp/usr/bin/cpp" +.endif +NXBMAKE+= ${NXBMAKEENV} ${MAKE} -f Makefile.inc1 ${NXBMAKEARGS} \ + TARGET=${NXB_TARGET} TARGET_ARCH=${NXB_TARGET_ARCH} \ TARGET_TRIPLE=${MACHINE_TRIPLE:Q} +# NXBDIRS is improperly based on MACHINE rather than NXB_TARGET. Need to +# invoke a sub-make to reevaluate MK_GCC, etc, for NXBDIRS. +NXBMAKE+= SUBDIR_OVERRIDE='$${NXBDIRS:M*}' +# Need to avoid the -isystem logic when using clang as an external toolchain +# even if the TARGET being built for wants GCC. +NXBMAKE+= WANT_COMPILER_TYPE='$${X_COMPILER_TYPE}' native-xtools: .PHONY + ${_+_}cd ${.CURDIR}; ${NXBTMAKE} _cleanobj # Build the bootstrap/host/cross tools that produce native binaries - ${_+_}cd ${.CURDIR}; ${NXBTMAKE} kernel-toolchain + # Pass along MK_GCC=yes to ensure GCC-needed build tools are built. + # We don't quite know what the NXB_TARGET wants so just build it. + ${_+_}cd ${.CURDIR}; ${NXBTMAKE} kernel-toolchain MK_GCC=yes # Populate includes/libraries sysroot that produce native binaries. # This is split out from 'toolchain' above mostly so that target LLVM # libraries have a proper LLVM_DEFAULT_TARGET_TRIPLE without @@ -2238,10 +2275,9 @@ native-xtools: .PHONY ${_+_}cd ${.CURDIR}; ${NXBTMAKE} _includes MK_CLANG=no MK_GCC=no ${_+_}cd ${.CURDIR}; ${NXBTMAKE} _libraries MK_CLANG=no MK_GCC=no .if !defined(NO_OBJWALK) - ${_+_}cd ${.CURDIR}; ${NXBMAKE} SUBDIR_OVERRIDE="${NXBDIRS:M*}" _obj + ${_+_}cd ${.CURDIR}; ${NXBMAKE} _obj .endif - ${_+_}cd ${.CURDIR}; ${NXBMAKE} SUBDIR_OVERRIDE="${NXBDIRS:M*}" \ - everything + ${_+_}cd ${.CURDIR}; ${NXBMAKE} everything @echo ">> native-xtools done. Use 'make native-xtools-install' to install to a given DESTDIR" native-xtools-install: .PHONY @@ -2250,9 +2286,8 @@ native-xtools-install: .PHONY -p ${NXBDESTDIR}/usr >/dev/null mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ -p ${NXBDESTDIR}/usr/include >/dev/null - ${_+_}cd ${.CURDIR}; ${NXBMAKE} -f Makefile.inc1 \ + ${_+_}cd ${.CURDIR}; ${NXBMAKE} \ DESTDIR=${NXBDESTDIR} \ - SUBDIR_OVERRIDE="${NXBDIRS:M*}" \ -DNO_ROOT \ install @@ -2785,7 +2820,8 @@ cleanworld cleanuniverse: .PHONY -chflags -R 0 ${BW_CANONICALOBJDIR} rm -rf ${BW_CANONICALOBJDIR}* .endif -.if make(cleanworld) && ${MK_AUTO_OBJ} == "no" +.if make(cleanworld) && ${MK_AUTO_OBJ} == "no" && \ + (empty(BW_CANONICALOBJDIR) || ${.CURDIR:tA} == ${BW_CANONICALOBJDIR:tA}) .if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR} # To be safe in this case, fall back to a 'make cleandir' ${_+_}@cd ${.CURDIR}; ${MAKE} cleandir diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 94c685458f9a..e4f42a0d3388 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -38,6 +38,25 @@ # xargs -n1 | sort | uniq -d; # done +# 20171114: Removal of all fortune datfiles other than freebsd-tips +OLD_FILES+=usr/share/games/fortune/fortunes +OLD_FILES+=usr/share/games/fortune/fortunes.dat +OLD_FILES+=usr/share/games/fortune/gerrold.limerick +OLD_FILES+=usr/share/games/fortune/gerrold.limerick.dat +OLD_FILES+=usr/share/games/fortune/limerick +OLD_FILES+=usr/share/games/fortune/limerick.dat +OLD_FILES+=usr/share/games/fortune/murphy +OLD_FILES+=usr/share/games/fortune/murphy-o +OLD_FILES+=usr/share/games/fortune/murphy-o.dat +OLD_FILES+=usr/share/games/fortune/murphy.dat +OLD_FILES+=usr/share/games/fortune/startrek +OLD_FILES+=usr/share/games/fortune/startrek.dat +OLD_FILES+=usr/share/games/fortune/zippy +OLD_FILES+=usr/share/games/fortune/zippy.dat +# 20171112: Removal of eqnchar definition +OLD_FILES+=usr/share/misc/eqnchar +# 20171110: Removal of mailaddr man page +OLD_FILES+=usr/share/man/man7/mailaddr.7.gz # 20171108: badsect(8) removal OLD_FILES+=sbin/badsect OLD_FILES+=rescue/badsect @@ -71,7 +90,7 @@ OLD_FILES+=usr/lib/libcap_random.a OLD_FILES+=usr/lib/libcap_random_p.a OLD_FILES+=usr/lib/libcap_sysctl.a OLD_FILES+=usr/lib/libcap_sysctl_p.a -# 20171031: Removal of obsolete man files +# 20171031: Removal of adding_user man page OLD_FILES+=usr/share/man/man7/adding_user.7.gz # 20171031: Disconnected libpathconv tests OLD_DIRS+=usr/tests/lib/libpathconv diff --git a/UPDATING b/UPDATING index 2a8946c7786a..6f852439bc7d 100644 --- a/UPDATING +++ b/UPDATING @@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +201711xx: + The LOADER_FIREWIRE_SUPPORT build variable as been renamed to + WITH/OUT_LOADER_FIREWIRE. LOADER_{NO_,}GELI_SUPPORT has been renamed + to WITH/OUT_LOADER_GELI. + 20171106: The naive and non-compliant support of posix_fallocate(2) in ZFS has been removed as of r325320. The system call now returns EINVAL diff --git a/bin/freebsd-version/freebsd-version.1 b/bin/freebsd-version/freebsd-version.1 index a4247ff59f82..710bb23ac4c3 100644 --- a/bin/freebsd-version/freebsd-version.1 +++ b/bin/freebsd-version/freebsd-version.1 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2013 +.Dd November 14, 2017 .Dt FREEBSD-VERSION 1 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd print the version and patch level of the installed system .Sh SYNOPSIS .Nm -.Op Fl ku +.Op Fl kru .Sh DESCRIPTION The .Nm @@ -50,6 +50,11 @@ if a new kernel has been installed but the system has not yet rebooted, .Nm will print the version and patch level of the new kernel. +.It Fl r +Print the version and patch level of the running kernel. +Unlike +.Xr uname 1 , +this is unaffected by environment variables. .It Fl u Print the version and patch level of the installed userland. These are hardcoded into @@ -57,14 +62,10 @@ These are hardcoded into during the build. .El .Pp -If both -.Fl k -and -.Fl u -are specified, +If several of the above options are specified, .Nm -will print the kernel version first, then the userland version, on -separate lines. +will print the installed kernel version first, then the running kernel +version, and finally the userland version, on separate lines. If neither is specified, it will print the userland version only. .Sh IMPLEMENTATION NOTES The diff --git a/bin/freebsd-version/freebsd-version.sh.in b/bin/freebsd-version/freebsd-version.sh.in index 16034104d5cf..9541b86a2636 100644 --- a/bin/freebsd-version/freebsd-version.sh.in +++ b/bin/freebsd-version/freebsd-version.sh.in @@ -38,7 +38,7 @@ LOADER_RE1='^\([A-Z_a-z][0-9A-Z_a-z]*=[-./0-9A-Z_a-z]\{1,\}\).*$' LOADER_RE2='^\([A-Z_a-z][0-9A-Z_a-z]*="[-./0-9A-Z_a-z]\{1,\}"\).*$' KERNEL_RE='^@@TYPE@@ \([-.0-9A-Za-z]\{1,\}\) .*$' -progname=$(basename $0) +progname=${0##*/} # # Print an error message and exit. @@ -70,6 +70,13 @@ kernel_version() { what -qs "$kernfile" | sed -n "s/$KERNEL_RE/\\1/p" } +# +# Print the version of the currently running kernel. +# +running_version() { + sysctl -n kern.osrelease +} + # # Print the hardcoded userland version. # @@ -81,7 +88,7 @@ userland_version() { # Print a usage string and exit. # usage() { - echo "usage: $progname [-ku]" >&2 + echo "usage: $progname [-kru]" >&2 exit 1 } @@ -90,11 +97,14 @@ usage() { # main() { # parse command-line arguments - while getopts "ku" option ; do + while getopts "kru" option ; do case $option in k) opt_k=1 ;; + r) + opt_r=1 + ;; u) opt_u=1 ;; @@ -108,15 +118,20 @@ main() { fi # default is -u - if [ $((opt_k + opt_u)) -eq 0 ] ; then + if [ $((opt_k + opt_r + opt_u)) -eq 0 ] ; then opt_u=1 fi - # print kernel version + # print installed kernel version if [ $opt_k ] ; then kernel_version fi + # print running kernel version + if [ $opt_r ] ; then + running_version + fi + # print userland version if [ $opt_u ] ; then userland_version diff --git a/contrib/zstd/LICENSE-examples b/contrib/zstd/LICENSE-examples deleted file mode 100644 index 1de781305490..000000000000 --- a/contrib/zstd/LICENSE-examples +++ /dev/null @@ -1,11 +0,0 @@ -Copyright (c) 2016-present, Facebook, Inc. All rights reserved. - -The examples provided by Facebook are for non-commercial testing and evaluation -purposes only. Facebook reserves all rights not expressly granted. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/contrib/zstd/lib/README.md b/contrib/zstd/lib/README.md deleted file mode 100644 index 79b6fd50014d..000000000000 --- a/contrib/zstd/lib/README.md +++ /dev/null @@ -1,85 +0,0 @@ -Zstandard library files -================================ - -The __lib__ directory contains several directories. -Depending on target use case, it's enough to include only files from relevant directories. - - -#### API - -Zstandard's stable API is exposed within [zstd.h](zstd.h), -at the root of `lib` directory. - - -#### Advanced API - -Some additional API may be useful if you're looking into advanced features : -- common/error_public.h : transforms `size_t` function results into an `enum`, - for precise error handling. -- ZSTD_STATIC_LINKING_ONLY : if you define this macro _before_ including `zstd.h`, - it will give access to advanced and experimental API. - These APIs shall ___never be used with dynamic library___ ! - They are not "stable", their definition may change in the future. - Only static linking is allowed. - -#### ZSTDMT API - -To enable multithreaded compression within the library, invoke `make lib-mt` target. -Prototypes are defined in header file `compress/zstdmt_compress.h`. -When linking a program that uses ZSTDMT API against libzstd.a on a POSIX system, -`-pthread` flag must be provided to the compiler and linker. -Note : ZSTDMT prototypes can still be used with a library built without multithread support, -but in this case, they will be single threaded only. - -#### Modular build - -Directory `common/` is required in all circumstances. -You can select to support compression only, by just adding files from the `compress/` directory, -In a similar way, you can build a decompressor-only library with the `decompress/` directory. - -Other optional functionalities provided are : - -- `dictBuilder/` : source files to create dictionaries. - The API can be consulted in `dictBuilder/zdict.h`. - This module also depends on `common/` and `compress/` . - -- `legacy/` : source code to decompress previous versions of zstd, starting from `v0.1`. - This module also depends on `common/` and `decompress/` . - Library compilation must include directive `ZSTD_LEGACY_SUPPORT = 1` . - The main API can be consulted in `legacy/zstd_legacy.h`. - Advanced API from each version can be found in their relevant header file. - For example, advanced API for version `v0.4` is in `legacy/zstd_v04.h` . - - -#### Using MinGW+MSYS to create DLL - -DLL can be created using MinGW+MSYS with the `make libzstd` command. -This command creates `dll\libzstd.dll` and the import library `dll\libzstd.lib`. -The import library is only required with Visual C++. -The header file `zstd.h` and the dynamic library `dll\libzstd.dll` are required to -compile a project using gcc/MinGW. -The dynamic library has to be added to linking options. -It means that if a project that uses ZSTD consists of a single `test-dll.c` -file it should be linked with `dll\libzstd.dll`. For example: -``` - gcc $(CFLAGS) -Iinclude/ test-dll.c -o test-dll dll\libzstd.dll -``` -The compiled executable will require ZSTD DLL which is available at `dll\libzstd.dll`. - - -#### Obsolete streaming API - -Streaming is now provided within `zstd.h`. -Older streaming API is still available within `deprecated/zbuff.h`. -It will be removed in a future version. -Consider migrating code towards newer streaming API in `zstd.h`. - - -#### Miscellaneous - -The other files are not source code. There are : - - - LICENSE : contains the BSD license text - - Makefile : script to compile or install zstd library (static and dynamic) - - libzstd.pc.in : for pkg-config (`make install`) - - README.md : this file diff --git a/contrib/zstd/lib/common/threading.h b/contrib/zstd/lib/common/threading.h deleted file mode 100644 index ab09977a86dc..000000000000 --- a/contrib/zstd/lib/common/threading.h +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Copyright (c) 2016 Tino Reichardt - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * You can contact the author at: - * - zstdmt source repository: https://github.com/mcmilk/zstdmt - */ - -#ifndef THREADING_H_938743 -#define THREADING_H_938743 - -#if defined (__cplusplus) -extern "C" { -#endif - -#if defined(ZSTD_MULTITHREAD) && defined(_WIN32) - -/** - * Windows minimalist Pthread Wrapper, based on : - * http://www.cse.wustl.edu/~schmidt/win32-cv-1.html - */ -#ifdef WINVER -# undef WINVER -#endif -#define WINVER 0x0600 - -#ifdef _WIN32_WINNT -# undef _WIN32_WINNT -#endif -#define _WIN32_WINNT 0x0600 - -#ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -#endif - -#include - -/* mutex */ -#define pthread_mutex_t CRITICAL_SECTION -#define pthread_mutex_init(a,b) (InitializeCriticalSection((a)), 0) -#define pthread_mutex_destroy(a) DeleteCriticalSection((a)) -#define pthread_mutex_lock(a) EnterCriticalSection((a)) -#define pthread_mutex_unlock(a) LeaveCriticalSection((a)) - -/* condition variable */ -#define pthread_cond_t CONDITION_VARIABLE -#define pthread_cond_init(a, b) (InitializeConditionVariable((a)), 0) -#define pthread_cond_destroy(a) /* No delete */ -#define pthread_cond_wait(a, b) SleepConditionVariableCS((a), (b), INFINITE) -#define pthread_cond_signal(a) WakeConditionVariable((a)) -#define pthread_cond_broadcast(a) WakeAllConditionVariable((a)) - -/* pthread_create() and pthread_join() */ -typedef struct { - HANDLE handle; - void* (*start_routine)(void*); - void* arg; -} pthread_t; - -int pthread_create(pthread_t* thread, const void* unused, - void* (*start_routine) (void*), void* arg); - -#define pthread_join(a, b) _pthread_join(&(a), (b)) -int _pthread_join(pthread_t* thread, void** value_ptr); - -/** - * add here more wrappers as required - */ - - -#elif defined(ZSTD_MULTITHREAD) /* posix assumed ; need a better detection method */ -/* === POSIX Systems === */ -# include - -#else /* ZSTD_MULTITHREAD not defined */ -/* No multithreading support */ - -#define pthread_mutex_t int /* #define rather than typedef, because sometimes pthread support is implicit, resulting in duplicated symbols */ -#define pthread_mutex_init(a,b) ((void)a, 0) -#define pthread_mutex_destroy(a) -#define pthread_mutex_lock(a) -#define pthread_mutex_unlock(a) - -#define pthread_cond_t int -#define pthread_cond_init(a,b) ((void)a, 0) -#define pthread_cond_destroy(a) -#define pthread_cond_wait(a,b) -#define pthread_cond_signal(a) -#define pthread_cond_broadcast(a) - -/* do not use pthread_t */ - -#endif /* ZSTD_MULTITHREAD */ - -#if defined (__cplusplus) -} -#endif - -#endif /* THREADING_H_938743 */ diff --git a/contrib/zstd/tests/fuzz/Makefile b/contrib/zstd/tests/fuzz/Makefile deleted file mode 100644 index da22ed0d0baa..000000000000 --- a/contrib/zstd/tests/fuzz/Makefile +++ /dev/null @@ -1,108 +0,0 @@ -# ########################################################################## -# Copyright (c) 2016-present, Facebook, Inc. -# All rights reserved. -# -# This Makefile is validated for Linux, and macOS targets -# -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. An additional grant -# of patent rights can be found in the PATENTS file in the same directory. -# ########################################################################## - -CFLAGS ?= -O3 -CXXFLAGS ?= -O3 - -ZSTDDIR = ../../lib -PRGDIR = ../../programs - -FUZZ_CPPFLAGS := -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \ - -I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR) \ - -DZSTD_DEBUG=1 -DMEM_FORCE_MEMORY_ACCESS=0 \ - -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION $(CPPFLAGS) -FUZZ_CFLAGS := -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ - -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \ - -Wstrict-prototypes -Wundef -Wformat-security \ - -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \ - -Wredundant-decls \ - -g -fno-omit-frame-pointer $(CFLAGS) -FUZZ_CXXFLAGS := -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ - -Wstrict-aliasing=1 -Wswitch-enum \ - -Wdeclaration-after-statement -Wstrict-prototypes -Wundef \ - -Wformat-security -Wvla -Wformat=2 -Winit-self -Wfloat-equal \ - -Wwrite-strings -Wredundant-decls \ - -g -fno-omit-frame-pointer -std=c++11 $(CXXFLAGS) -FUZZ_LDFLAGS := $(LDFLAGS) -FUZZ_ARFLAGS := $(ARFLAGS) -FUZZ_TARGET_FLAGS = $(FUZZ_CPPFLAGS) $(FUZZ_CXXFLAGS) $(FUZZ_LDFLAGS) - -FUZZ_HEADERS := fuzz_helpers.h fuzz.h - -ZSTDCOMMON_FILES := $(ZSTDDIR)/common/*.c -ZSTDCOMP_FILES := $(ZSTDDIR)/compress/*.c -ZSTDDECOMP_FILES := $(ZSTDDIR)/decompress/*.c -ZSTD_FILES := $(ZSTDDECOMP_FILES) $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES) - -ZSTD_OBJ := $(patsubst %.c,%.o, $(wildcard $(ZSTD_FILES))) - -LIBFUZZER ?= -lFuzzer - -.PHONY: default all clean - -default: all - -all: round_trip simple_decompress - -%.o: %.c - $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_CFLAGS) $^ -c -o $@ - -simple_round_trip: $(FUZZ_HEADERS) $(ZSTD_OBJ) simple_round_trip.o - $(CXX) $(FUZZ_TARGET_FLAGS) $(ZSTD_OBJ) simple_round_trip.o $(LIBFUZZER) -o $@ - -stream_round_trip: $(FUZZ_HEADERS) $(ZSTD_OBJ) stream_round_trip.o - $(CXX) $(FUZZ_TARGET_FLAGS) $(ZSTD_OBJ) stream_round_trip.o $(LIBFUZZER) -o $@ - -simple_decompress: $(FUZZ_HEADERS) $(ZSTD_OBJ) simple_decompress.o - $(CXX) $(FUZZ_TARGET_FLAGS) $(ZSTD_OBJ) simple_decompress.o $(LIBFUZZER) -o $@ - -stream_decompress: $(FUZZ_HEADERS) $(ZSTD_OBJ) stream_decompress.o - $(CXX) $(FUZZ_TARGET_FLAGS) $(ZSTD_OBJ) stream_decompress.o $(LIBFUZZER) -o $@ - -libregression.a: $(FUZZ_HEADERS) $(PRGDIR)/util.h regression_driver.o - $(AR) $(FUZZ_ARFLAGS) $@ regression_driver.o - -%-regression: libregression.a - $(RM) $* - $(MAKE) $* LDFLAGS="$(FUZZ_LDFLAGS) -L." LIBFUZZER=-lregression - -%-regression-test: %-regression - ./$* corpora/$* - -regression-test: \ - simple_round_trip-regression-test \ - stream_round_trip-regression-test \ - simple_decompress-regression-test \ - stream_decompress-regression-test - -%-msan: clean - $(MAKE) $* CFLAGS="-fsanitize=memory $(FUZZ_CFLAGS)" \ - CXXFLAGS="-fsanitize=memory $(FUZZ_CXXFLAGS)" - -UASAN_FLAGS := -fsanitize=address,undefined -fno-sanitize-recover=undefined \ - -fno-sanitize=pointer-overflow -%-uasan: clean - $(MAKE) $* CFLAGS="$(FUZZ_CFLAGS) $(UASAN_FLAGS)" \ - CXXFLAGS="$(FUZZ_CXXFLAGS) $(UASAN_FLAGS)" - -# Install libfuzzer (not usable for MSAN testing) -# Provided for convienence. To use this library run make libFuzzer and -# set LDFLAGS=-L. -.PHONY: libFuzzer -libFuzzer: - @$(RM) -rf Fuzzer - @git clone https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer - @./Fuzzer/build.sh - -clean: - @$(MAKE) -C $(ZSTDDIR) clean - @$(RM) -f *.a *.o - @$(RM) -f simple_round_trip stream_round_trip simple_decompress stream_decompress diff --git a/contrib/zstd/tests/fuzz/README.md b/contrib/zstd/tests/fuzz/README.md deleted file mode 100644 index 38a4f3d1ab02..000000000000 --- a/contrib/zstd/tests/fuzz/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# Fuzzing - -Each fuzzing target can be built with multiple engines. - -## LibFuzzer - -You can install `libFuzzer` with `make libFuzzer`. Then you can make each target -with `make target LDFLAGS=-L. CC=clang CXX=clang++`. - -## AFL - -The regression driver also serves as a binary for `afl-fuzz`. You can make each -target with one of these commands: - -``` -make target-regression CC=afl-clang CXX=afl-clang++ -AFL_MSAN=1 make target-regression-msan CC=afl-clang CXX=afl-clang++ -AFL_ASAN=1 make target-regression-uasan CC=afl-clang CXX=afl-clang++ -``` - -Then run as `./target @@`. - -## Regression Testing - -Each fuzz target has a corpus checked into the repo under `fuzz/corpora/`. -You can run regression tests on the corpora to ensure that inputs which -previously exposed bugs still pass. You can make these targets to run the -regression tests with different sanitizers. - -``` -make regression-test -make regression-test-msan -make regression-test-uasan -``` diff --git a/contrib/zstd/tests/fuzz/stream_round_trip.c b/contrib/zstd/tests/fuzz/stream_round_trip.c deleted file mode 100644 index 17c7dfdd29a7..000000000000 --- a/contrib/zstd/tests/fuzz/stream_round_trip.c +++ /dev/null @@ -1,153 +0,0 @@ -/** - * Copyright (c) 2016-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -/** - * This fuzz target performs a zstd round-trip test (compress & decompress), - * compares the result with the original, and calls abort() on corruption. - */ - -#include -#include -#include -#include -#include "fuzz_helpers.h" -#include "zstd.h" - -static const int kMaxClevel = 19; - -static ZSTD_CStream *cstream = NULL; -static ZSTD_DCtx *dctx = NULL; -static uint8_t* cBuf = NULL; -static uint8_t* rBuf = NULL; -static size_t bufSize = 0; -static uint32_t seed; - -static ZSTD_outBuffer makeOutBuffer(uint8_t *dst, size_t capacity) -{ - ZSTD_outBuffer buffer = { dst, 0, 0 }; - - FUZZ_ASSERT(capacity > 0); - buffer.size = (FUZZ_rand(&seed) % capacity) + 1; - FUZZ_ASSERT(buffer.size <= capacity); - - return buffer; -} - -static ZSTD_inBuffer makeInBuffer(const uint8_t **src, size_t *size) -{ - ZSTD_inBuffer buffer = { *src, 0, 0 }; - - FUZZ_ASSERT(*size > 0); - buffer.size = (FUZZ_rand(&seed) % *size) + 1; - FUZZ_ASSERT(buffer.size <= *size); - *src += buffer.size; - *size -= buffer.size; - - return buffer; -} - -static size_t compress(uint8_t *dst, size_t capacity, - const uint8_t *src, size_t srcSize) -{ - int cLevel = FUZZ_rand(&seed) % kMaxClevel; - size_t dstSize = 0; - FUZZ_ASSERT(!ZSTD_isError(ZSTD_initCStream(cstream, cLevel))); - - while (srcSize > 0) { - ZSTD_inBuffer in = makeInBuffer(&src, &srcSize); - /* Mode controls the action. If mode == -1 we pick a new mode */ - int mode = -1; - while (in.pos < in.size) { - ZSTD_outBuffer out = makeOutBuffer(dst, capacity); - /* Previous action finished, pick a new mode. */ - if (mode == -1) mode = FUZZ_rand(&seed) % 10; - switch (mode) { - case 0: /* fall-though */ - case 1: /* fall-though */ - case 2: { - size_t const ret = ZSTD_flushStream(cstream, &out); - FUZZ_ASSERT_MSG(!ZSTD_isError(ret), ZSTD_getErrorName(ret)); - if (ret == 0) mode = -1; - break; - } - case 3: { - size_t ret = ZSTD_endStream(cstream, &out); - FUZZ_ASSERT_MSG(!ZSTD_isError(ret), ZSTD_getErrorName(ret)); - /* Reset the compressor when the frame is finished */ - if (ret == 0) { - cLevel = FUZZ_rand(&seed) % kMaxClevel; - ret = ZSTD_initCStream(cstream, cLevel); - FUZZ_ASSERT(!ZSTD_isError(ret)); - mode = -1; - } - break; - } - default: { - size_t const ret = ZSTD_compressStream(cstream, &out, &in); - FUZZ_ASSERT_MSG(!ZSTD_isError(ret), ZSTD_getErrorName(ret)); - mode = -1; - } - } - dst += out.pos; - dstSize += out.pos; - capacity -= out.pos; - } - } - for (;;) { - ZSTD_outBuffer out = makeOutBuffer(dst, capacity); - size_t const ret = ZSTD_endStream(cstream, &out); - FUZZ_ASSERT_MSG(!ZSTD_isError(ret), ZSTD_getErrorName(ret)); - - dst += out.pos; - dstSize += out.pos; - capacity -= out.pos; - if (ret == 0) break; - } - return dstSize; -} - -int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size) -{ - size_t const neededBufSize = ZSTD_compressBound(size) * 2; - - seed = FUZZ_seed(src, size); - - /* Allocate all buffers and contexts if not already allocated */ - if (neededBufSize > bufSize) { - free(cBuf); - free(rBuf); - cBuf = (uint8_t*)malloc(neededBufSize); - rBuf = (uint8_t*)malloc(neededBufSize); - bufSize = neededBufSize; - FUZZ_ASSERT(cBuf && rBuf); - } - if (!cstream) { - cstream = ZSTD_createCStream(); - FUZZ_ASSERT(cstream); - } - if (!dctx) { - dctx = ZSTD_createDCtx(); - FUZZ_ASSERT(dctx); - } - - { - size_t const cSize = compress(cBuf, neededBufSize, src, size); - size_t const rSize = - ZSTD_decompressDCtx(dctx, rBuf, neededBufSize, cBuf, cSize); - FUZZ_ASSERT_MSG(!ZSTD_isError(rSize), ZSTD_getErrorName(rSize)); - FUZZ_ASSERT_MSG(rSize == size, "Incorrect regenerated size"); - FUZZ_ASSERT_MSG(!memcmp(src, rBuf, size), "Corruption!"); - } - -#ifndef STATEFULL_FUZZING - ZSTD_freeCStream(cstream); cstream = NULL; - ZSTD_freeDCtx(dctx); dctx = NULL; -#endif - return 0; -} diff --git a/etc/Makefile b/etc/Makefile index 7e7e28542544..17b34b791183 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -152,8 +152,6 @@ BIN1+= regdomain.xml # -rwxr-xr-x root:wheel, for the new cron root:wheel BIN2= netstart pccard_ether rc.suspend rc.resume -PPPCNF= ppp.conf - .if ${MK_SENDMAIL} == "no" ETCMAIL=mailer.conf aliases .else diff --git a/etc/devd.conf b/etc/devd.conf index b09ecf1fbe2a..af4bbd3f623e 100644 --- a/etc/devd.conf +++ b/etc/devd.conf @@ -20,7 +20,8 @@ options { #XXX Yes, these are gross -- imp set scsi-controller-regex "(aac|adv|adw|aha|ahc|ahd|aic|amr|bt|ciss|dpt|\ - esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm)\ + esp|ida|iir|ips|isp|mlx|mly|mpr|mps|mpt|ncr|ncv|nsp|stg|sym|\ + trm)\ [0-9]+"; set wifi-driver-regex "(ath|bwi|bwn|ipw|iwi|iwm|iwn|malo|mwl|ral|rsu|rtwn|rum|run|\ diff --git a/lib/clang/libclang/Makefile b/lib/clang/libclang/Makefile index 544f7d4596ce..6a0d1dfc049d 100644 --- a/lib/clang/libclang/Makefile +++ b/lib/clang/libclang/Makefile @@ -790,16 +790,7 @@ clang/StaticAnalyzer/Checkers/Checkers.inc: \ ${CLANG_SRCS}/include/clang/StaticAnalyzer/Checkers/Checkers.td TGHDRS+= clang/StaticAnalyzer/Checkers/Checkers.inc -.for dep in ${TGHDRS:C/$/.d/} -. if ${MAKE_VERSION} < 20160220 -. if !make(depend) -. sinclude "${dep}" -. endif -. else -. dinclude "${dep}" -. endif -.endfor - +DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile index aa1a3f313b43..e7d9541c60bf 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -1412,16 +1412,7 @@ TGHDRS+= X86GenRegisterBank.inc TGHDRS+= X86GenRegisterInfo.inc TGHDRS+= X86GenSubtargetInfo.inc -.for dep in ${TGHDRS:C/$/.d/} -. if ${MAKE_VERSION} < 20160220 -. if !make(depend) -. sinclude "${dep}" -. endif -. else -. dinclude "${dep}" -. endif -.endfor - +DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} diff --git a/lib/libc/string/memcpy.3 b/lib/libc/string/memcpy.3 index 25a6c359f1da..febc0fa34dd9 100644 --- a/lib/libc/string/memcpy.3 +++ b/lib/libc/string/memcpy.3 @@ -54,6 +54,11 @@ bytes from string .Fa src to string .Fa dst . +If +.Fa src +and +.Fa dst +overlap, the results are not defined. .Sh RETURN VALUES The .Fn memcpy diff --git a/lib/libc/string/strcat.3 b/lib/libc/string/strcat.3 index 802226980d27..a6d0fcef61f0 100644 --- a/lib/libc/string/strcat.3 +++ b/lib/libc/string/strcat.3 @@ -62,6 +62,11 @@ then add a terminating The string .Fa s must have sufficient space to hold the result. +If +.Fa s +and +.Fa append +overlap, the results are undefined. .Pp The .Fn strncat @@ -72,6 +77,11 @@ characters from .Fa append , and then adds a terminating .Ql \e0 . +If +.Fa s +and +.Fa append +overlap, the results are undefined. .Sh RETURN VALUES The .Fn strcat diff --git a/lib/libc/string/strcpy.3 b/lib/libc/string/strcpy.3 index 4d4a1ee7b3ce..bc555411dde1 100644 --- a/lib/libc/string/strcpy.3 +++ b/lib/libc/string/strcpy.3 @@ -63,6 +63,11 @@ to (including the terminating .Ql \e0 character.) +If +.Fa src +and +.Fa dst +overlap, the results are undefined. .Pp The .Fn stpncpy @@ -89,6 +94,11 @@ Otherwise, is .Em not terminated. +If +.Fa src +and +.Fa dst +overlap, the results are undefined. .Sh RETURN VALUES The .Fn strcpy diff --git a/lib/libc/sys/_umtx_op.2 b/lib/libc/sys/_umtx_op.2 index 4682b3426cf8..e0b16486d552 100644 --- a/lib/libc/sys/_umtx_op.2 +++ b/lib/libc/sys/_umtx_op.2 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 23, 2017 +.Dd November 13, 2017 .Dt _UMTX_OP 2 .Os .Sh NAME @@ -61,7 +61,7 @@ All objects require ABI-mandated alignment, but this is not currently enforced consistently on all architectures. .Pp The following flags are defined for flag fields of all structures: -.Bl -tag -width "Dv USYNC_PROCESS_SHARED" +.Bl -tag -width indent .It Dv USYNC_PROCESS_SHARED Allow selection of the process-shared sleep queue for the thread sleep container, when the lock ownership cannot be granted immediately, @@ -77,7 +77,6 @@ See the .Sx SLEEP QUEUES subsection below for more details on sleep queues. .El -.Pp .Bl -hang -offset indent .It Sy Mutex .Bd -literal @@ -96,7 +95,7 @@ It contains either the thread identifier of the lock owner in the locked state, or zero when the lock is unowned. The highest bit set indicates that there is contention on the lock. The constants are defined for special values: -.Bl -tag -width "Dv UMUTEX_RB_OWNERDEAD" +.Bl -tag -width indent .It Dv UMUTEX_UNOWNED Zero, the value stored in the unowned lock. .It Dv UMUTEX_CONTESTED @@ -113,7 +112,7 @@ The .Dv m_flags field may contain the following umutex-specific flags, in addition to the common flags: -.Bl -tag -width "Dv UMUTEX_NONCONSISTENT" +.Bl -tag -width indent .It Dv UMUTEX_PRIO_INHERIT Mutex implements .Em Priority Inheritance @@ -136,8 +135,9 @@ In the manual page, mutexes not having and .Dv UMUTEX_PRIO_PROTECT flags set, are called normal mutexes. -Each type of mutex, i.e. normal mutexes, priority-inherited mutexes, -and priority-protected mutexes, have a separate sleep queue associated +Each type of mutex +.Pq normal, priority-inherited, and priority-protected +has a separate sleep queue associated with the given key. .Pp For priority protected mutexes, the @@ -182,8 +182,8 @@ request. The .Dv c_flags field contains flags. -Only the common flags, i.e. -.Dv USYNC_PROCESS_SHARED , +Only the common flags +.Pq Dv USYNC_PROCESS_SHARED are defined for ucond. .Pp The @@ -193,23 +193,34 @@ member provides the clock identifier to use for timeout, when the request has both the .Dv CVWAIT_CLOCKID flag and the timeout specified. -Valid clock identifiers are subset of the valid clock ids for the -.Xr clock_gettime 2 -syscall, namely, -.Dv CLOCK_REALTIME , -.Dv CLOCK_VIRTUAL , -.Dv CLOCK_PROF , -.Dv CLOCK_MONOTONIC , -.Dv CLOCK_UPTIME , -.Dv CLOCK_UPTIME_PRECISE , -.Dv CLOCK_UPTIME_FAST , -.Dv CLOCK_REALTIME_PRECISE , -.Dv CLOCK_REALTIME_FAST , -.Dv CLOCK_MONOTONIC_PRECISE , -.Dv CLOCK_MONOTONIC_FAST , -and +Valid clock identifiers are a subset of those for +.Xr clock_gettime 2 : +.Bl -bullet -compact +.It +.Dv CLOCK_MONOTONIC +.It +.Dv CLOCK_MONOTONIC_FAST +.It +.Dv CLOCK_MONOTONIC_PRECISE +.It +.Dv CLOCK_PROF +.It +.Dv CLOCK_REALTIME +.It +.Dv CLOCK_REALTIME_FAST +.It +.Dv CLOCK_REALTIME_PRECISE +.It .Dv CLOCK_SECOND -are allowed. +.It +.Dv CLOCK_UPTIME +.It +.Dv CLOCK_UPTIME_FAST +.It +.Dv CLOCK_UPTIME_PRECISE +.It +.Dv CLOCK_VIRTUAL +.El .It Sy Reader/writer lock .Bd -literal struct urwlock { @@ -228,7 +239,7 @@ granted. Names of the .Dv rw_state bits are following: -.Bl -tag -width "Dv URWLOCK_WRITE_WAITERS" +.Bl -tag -width indent .It Dv URWLOCK_WRITE_OWNER Write lock was granted. .It Dv URWLOCK_WRITE_WAITERS @@ -253,7 +264,7 @@ The following flags for the member of .Vt struct urwlock are defined, in addition to the common flags: -.Bl -tag -width "Dv URWLOCK_PREFER_READER" +.Bl -tag -width indent .It Dv URWLOCK_PREFER_READER If specified, immediately grant read lock requests when .Dv urwlock @@ -302,7 +313,7 @@ The .Dv USEM_COUNT() macro, applied to the .Dv _count -word, returns the current semaphore counter, i.e. the number of posts +word, returns the current semaphore counter, which is the number of posts issued on the semaphore. .Pp The following bits for the @@ -310,7 +321,7 @@ The following bits for the member of .Vt struct _usem2 are defined, in addition to the common flags: -.Bl -tag -width "Dv USEM_NAMED" +.Bl -tag -width indent .It Dv USEM_NAMED Flag is ignored by kernel. .El @@ -359,7 +370,7 @@ Interval counting is always performed by the monotonic wall clock. The .Dv _flags argument allows the following flags to further define the timeout behaviour: -.Bl -tag -width "It Dv UMTX_ABSTIME" +.Bl -tag -width indent .It Dv UMTX_ABSTIME The .Dv _timeout @@ -374,7 +385,6 @@ start. .El .El .Ss SLEEP QUEUES -.Pp When a locking request cannot be immediately satisfied, the thread is typically put to .Em sleep , @@ -416,7 +426,7 @@ regardless of the kind of backing memory. .Pp Only the address of the start byte of the variable specified as key is important for determining corresponding sleep queue. -The size of the variable does not matter, so e.g. sleep on the same +The size of the variable does not matter, so, for example, sleep on the same address interpeted as .Vt uint32_t and @@ -505,11 +515,11 @@ error for lock attempts, without granting the lock. The following operations, requested by the .Fa op argument to the function, are implemented: -.Bl -tag -width "It Dv UMTX_OP_WAIT_UINT_PRIVATE" +.Bl -tag -width indent .It Dv UMTX_OP_WAIT Wait. The arguments for the request are: -.Bl -tag -width "It Fa obj" +.Bl -tag -width "obj" .It Fa obj Pointer to a variable of type .Vt long . @@ -558,7 +568,7 @@ Optionally, a timeout for the request may be specified. Wake the threads possibly sleeping due to .Dv UMTX_OP_WAIT . The arguments for the request are: -.Bl -tag -width "It Fa obj" +.Bl -tag -width "obj" .It Fa obj Pointer to a variable, used as a key to find sleeping threads. .It Fa val @@ -572,7 +582,7 @@ to wake up all waiters. .It Dv UMTX_OP_MUTEX_TRYLOCK Try to lock umutex. The arguments to the request are: -.Bl -tag -width "It Fa obj" +.Bl -tag -width "obj" .It Fa obj Pointer to the umutex. .El @@ -585,7 +595,7 @@ instead of sleeping if the lock cannot be obtained immediately. .It Dv UMTX_OP_MUTEX_LOCK Lock umutex. The arguments to the request are: -.Bl -tag -width "It Fa obj" +.Bl -tag -width "obj" .It Fa obj Pointer to the umutex. .El @@ -624,7 +634,7 @@ from a signal handler. .It Dv UMTX_OP_MUTEX_UNLOCK Unlock umutex. The arguments to the request are: -.Bl -tag -width "It Fa obj" +.Bl -tag -width "obj" .It Fa obj Pointer to the umutex. .El @@ -661,7 +671,7 @@ priority protected protocol mutex. .It Dv UMTX_OP_SET_CEILING Set ceiling for the priority protected umutex. The arguments to the request are: -.Bl -tag -width "It Fa obj" +.Bl -tag -width "uaddr" .It Fa obj Pointer to the umutex. .It Fa val @@ -696,7 +706,7 @@ interface. .It Dv UMTX_OP_CV_WAIT Wait for a condition. The arguments to the request are: -.Bl -tag -width "It Fa uaddr2" +.Bl -tag -width "uaddr2" .It Fa obj Pointer to the .Vt struct ucond . @@ -743,7 +753,7 @@ After wakeup, the umutex is not relocked. .Pp The following flags are defined: -.Bl -tag -width "Dv CVWAIT_CLOCKID" +.Bl -tag -width "CVWAIT_CLOCKID" .It Dv CVWAIT_ABSTIME Timeout is absolute. .It Dv CVWAIT_CLOCKID @@ -782,7 +792,7 @@ error. .It Dv UMTX_OP_CV_SIGNAL Wake up one condition waiter. The arguments to the request are: -.Bl -tag -width "It Fa obj" +.Bl -tag -width "obj" .It Fa obj Pointer to .Vt struct ucond . @@ -800,7 +810,7 @@ is cleared. .It Dv UMTX_OP_CV_BROADCAST Wake up all condition waiters. The arguments to the request are: -.Bl -tag -width "It Fa obj" +.Bl -tag -width "obj" .It Fa obj Pointer to .Vt struct ucond . @@ -820,14 +830,14 @@ Same as but the type of the variable pointed to by .Fa obj is -.Vt u_int , -i.e. 32-bit integer. +.Vt u_int +.Pq a 32-bit integer . .It Dv UMTX_OP_RW_RDLOCK Read-lock a .Vt struct rwlock lock. The arguments to the request are: -.Bl -tag -width "It Fa obj" +.Bl -tag -width "obj" .It Fa obj Pointer to the lock (of type .Vt struct rwlock ) @@ -837,7 +847,7 @@ Additional flags to augment locking behaviour. The valid flags in the .Fa val argument are: -.Bl -tag -width "It Dv URWLOCK_PREFER_READER" +.Bl -tag -width indent .It Dv URWLOCK_PREFER_READER .El .El @@ -889,7 +899,7 @@ Write-lock a .Vt struct rwlock lock. The arguments to the request are: -.Bl -tag -width "It Fa obj" +.Bl -tag -width "obj" .It Fa obj Pointer to the lock (of type .Vt struct rwlock ) @@ -925,7 +935,7 @@ error. .It Dv UMTX_OP_RW_UNLOCK Unlock rwlock. The arguments to the request are: -.Bl -tag -width "It Fa obj" +.Bl -tag -width "obj" .It Fa obj Pointer to the lock (of type .Vt struct rwlock ) @@ -967,7 +977,7 @@ but unconditionally select the process-private sleep queue. .It Dv UMTX_OP_MUTEX_WAIT Wait for mutex availability. The arguments to the request are: -.Bl -tag -width "It Fa obj" +.Bl -tag -width "obj" .It Fa obj Address of the mutex. .El @@ -991,7 +1001,6 @@ priority inherited protocol mutexes. .Pp Optionally, a timeout for the request may be specified. .Pp -.Pp A request with a timeout specified is not restartable. An unblocked signal delivered during the wait always results in sleep interruption and @@ -1007,7 +1016,7 @@ member .It Dv UMTX_OP_NWAKE_PRIVATE Wake up a batch of sleeping threads. The arguments to the request are: -.Bl -tag -width "It Fa obj" +.Bl -tag -width "obj" .It Fa obj Pointer to the array of pointers. .It Fa val @@ -1024,7 +1033,7 @@ being the byte addressed by the array element. .It Dv UMTX_OP_MUTEX_WAKE Check if a normal umutex is unlocked and wake up a waiter. The arguments for the request are: -.Bl -tag -width "It Fa obj" +.Bl -tag -width "obj" .It Fa obj Pointer to the umutex. .El @@ -1058,7 +1067,7 @@ bit may then modify freed memory. .It Dv UMTX_OP_MUTEX_WAKE2 Check if a umutex is unlocked and wake up a waiter. The arguments for the request are: -.Bl -tag -width "It Fa obj" +.Bl -tag -width "obj" .It Fa obj Pointer to the umutex. .It Fa val @@ -1088,11 +1097,12 @@ word of the .It Dv UMTX_OP_SEM2_WAIT Wait until semaphore is available. The arguments to the request are: -.Bl -tag -width "It Fa obj" +.Bl -tag -width "obj" .It Fa obj Pointer to the semaphore (of type .Vt struct _usem2 ) . .El +.Pp Put the requesting thread onto a sleep queue if the semaphore counter is zero. If the thread is put to sleep, the @@ -1117,7 +1127,7 @@ error. .It Dv UMTX_OP_SEM2_WAKE Wake up waiters on semaphore lock. The arguments to the request are: -.Bl -tag -width "It Fa obj" +.Bl -tag -width "obj" .It Fa obj Pointer to the semaphore (of type .Vt struct _usem2 ) . @@ -1145,7 +1155,7 @@ The argument specifies the sub-request of the .Dv UMTX_OP_SHM request: -.Bl -tag -width "Dv UMTX_SHM_DESTROY" +.Bl -tag -width indent .It Dv UMTX_SHM_CREAT Creates the anonymous shared memory object, which can be looked up with the specified key @@ -1191,7 +1201,7 @@ creation or lookup. .It Dv UMTX_OP_ROBUST_LISTS Register the list heads for the current thread's robust mutex lists. The arguments to the request are: -.Bl -tag -width "It Fa obj" +.Bl -tag -width "uaddr" .It Fa val Size of the structure passed in the .Fa uaddr @@ -1261,8 +1271,8 @@ variable is set to indicate the error. .Sh ERRORS The .Fn _umtx_op -operations will return the following errors: -.Bl -tag -width "Bq Er ENOTRECOVERABLE" +operations can fail with the following errors: +.Bl -tag -width "[ETIMEDOUT]" .It Bq Er EFAULT One of the arguments point to invalid memory. .It Bq Er EINVAL diff --git a/lib/libcasper/libcasper/libcasper.h b/lib/libcasper/libcasper/libcasper.h index a49561bcbd81..8ad15bc65109 100644 --- a/lib/libcasper/libcasper/libcasper.h +++ b/lib/libcasper/libcasper/libcasper.h @@ -56,11 +56,13 @@ typedef struct nvlist nvlist_t; struct cap_channel; typedef struct cap_channel cap_channel_t; +#define CASPER_SUPPORT (1) #else struct cap_channel { int cch_fd; }; typedef struct cap_channel cap_channel_t; +#define CASPER_SUPPORT (0) #endif /* ! WITH_CASPER */ #endif /* ! _CAP_CHANNEL_T_DECLARED */ diff --git a/lib/libcasper/services/Makefile b/lib/libcasper/services/Makefile index d14f34d5a3c3..c735063d4050 100644 --- a/lib/libcasper/services/Makefile +++ b/lib/libcasper/services/Makefile @@ -7,6 +7,7 @@ SUBDIR+= cap_grp SUBDIR+= cap_pwd SUBDIR+= cap_random SUBDIR+= cap_sysctl +SUBDIR+= cap_syslog SUBDIR.${MK_TESTS}+= tests diff --git a/lib/libcasper/services/cap_syslog/Makefile b/lib/libcasper/services/cap_syslog/Makefile new file mode 100644 index 000000000000..70eb65734ad8 --- /dev/null +++ b/lib/libcasper/services/cap_syslog/Makefile @@ -0,0 +1,24 @@ +# $FreeBSD$ + +SHLIBDIR?= /lib/casper + +.include + +PACKAGE=libcasper + +SHLIB_MAJOR= 0 +INCSDIR?= ${INCLUDEDIR}/casper + +.if ${MK_CASPER} != "no" +SHLIB= cap_syslog + +SRCS= cap_syslog.c +.endif + +INCS= cap_syslog.h + +LIBADD= nv + +CFLAGS+=-I${.CURDIR} + +.include diff --git a/lib/libcasper/services/cap_syslog/cap_syslog.c b/lib/libcasper/services/cap_syslog/cap_syslog.c new file mode 100644 index 000000000000..3bd9ce5b0c35 --- /dev/null +++ b/lib/libcasper/services/cap_syslog/cap_syslog.c @@ -0,0 +1,199 @@ +/*- + * Copyright (c) 2017 Mariusz Zaborski + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "cap_syslog.h" + +#define CAP_SYSLOG_LIMIT 2048 + +void +cap_syslog(cap_channel_t *chan, int pri, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + cap_vsyslog(chan, pri, fmt, ap); + va_end(ap); +} + +void +cap_vsyslog(cap_channel_t *chan, int priority, const char *fmt, va_list ap) +{ + nvlist_t *nvl; + char message[CAP_SYSLOG_LIMIT]; + + (void)vsnprintf(message, sizeof(message), fmt, ap); + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "vsyslog"); + nvlist_add_number(nvl, "priority", priority); + nvlist_add_string(nvl, "message", message); + nvl = cap_xfer_nvlist(chan, nvl, 0); + if (nvl == NULL) { + return; + } + nvlist_destroy(nvl); +} + +void +cap_openlog(cap_channel_t *chan, const char *ident, int logopt, int facility) +{ + nvlist_t *nvl; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "openlog"); + if (ident != NULL) { + nvlist_add_string(nvl, "ident", ident); + } + nvlist_add_number(nvl, "logopt", logopt); + nvlist_add_number(nvl, "facility", facility); + nvl = cap_xfer_nvlist(chan, nvl, 0); + if (nvl == NULL) { + return; + } + nvlist_destroy(nvl); +} + +void +cap_closelog(cap_channel_t *chan) +{ + nvlist_t *nvl; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "closelog"); + nvl = cap_xfer_nvlist(chan, nvl, 0); + if (nvl == NULL) { + return; + } + nvlist_destroy(nvl); +} + +int +cap_setlogmask(cap_channel_t *chan, int maskpri) +{ + nvlist_t *nvl; + int omask; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "setlogmask"); + nvlist_add_number(nvl, "maskpri", maskpri); + nvl = cap_xfer_nvlist(chan, nvl, 0); + omask = nvlist_get_number(nvl, "omask"); + + nvlist_destroy(nvl); + + return (omask); +} + +/* + * Service functions. + */ + +static char *LogTag; + +static void +slog_vsyslog(const nvlist_t *limits __unused, const nvlist_t *nvlin, + nvlist_t *nvlout __unused) +{ + + syslog(nvlist_get_number(nvlin, "priority"), "%s", + nvlist_get_string(nvlin, "message")); +} + +static void +slog_openlog(const nvlist_t *limits __unused, const nvlist_t *nvlin, + nvlist_t *nvlout __unused) +{ + const char *ident; + + ident = dnvlist_get_string(nvlin, "ident", NULL); + if (ident != NULL) { + free(LogTag); + LogTag = strdup(ident); + } + + openlog(LogTag, nvlist_get_number(nvlin, "logopt"), + nvlist_get_number(nvlin, "facility")); +} + +static void +slog_closelog(const nvlist_t *limits __unused, const nvlist_t *nvlin __unused, + nvlist_t *nvlout __unused) +{ + + closelog(); + + free(LogTag); + LogTag = NULL; +} + +static void +slog_setlogmask(const nvlist_t *limits __unused, const nvlist_t *nvlin, + nvlist_t *nvlout) +{ + int omask; + + omask = setlogmask(nvlist_get_number(nvlin, "maskpri")); + nvlist_add_number(nvlout, "omask", omask); +} + +static int +syslog_command(const char *cmd, const nvlist_t *limits, nvlist_t *nvlin, + nvlist_t *nvlout) +{ + + if (strcmp(cmd, "vsyslog") == 0) { + slog_vsyslog(limits, nvlin, nvlout); + } else if (strcmp(cmd, "openlog") == 0) { + slog_openlog(limits, nvlin, nvlout); + } else if (strcmp(cmd, "closelog") == 0) { + slog_closelog(limits, nvlin, nvlout); + } else if (strcmp(cmd, "setlogmask") == 0) { + slog_setlogmask(limits, nvlin, nvlout); + } else { + return (EINVAL); + } + + return (0); +} + +CREATE_SERVICE("system.syslog", NULL, syslog_command, 0); diff --git a/lib/libcasper/services/cap_syslog/cap_syslog.h b/lib/libcasper/services/cap_syslog/cap_syslog.h new file mode 100644 index 000000000000..55ca4b355e16 --- /dev/null +++ b/lib/libcasper/services/cap_syslog/cap_syslog.h @@ -0,0 +1,54 @@ +/*- + * Copyright (c) 2017 Mariusz Zaborski + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _CAP_SYSLOG_H_ +#define _CAP_SYSLOG_H_ + +#ifdef WITH_CASPER +void cap_syslog(cap_channel_t *chan, int pri, + const char *fmt, ...) __printflike(3, 4); +void cap_vsyslog(cap_channel_t *chan, int priority, const char *fmt, + va_list ap) __printflike(3, 0); + +void cap_openlog(cap_channel_t *chan, const char *ident, int logopt, + int facility); +void cap_closelog(cap_channel_t *chan); + +int cap_setlogmask(cap_channel_t *chan, int maskpri); +#else +#define cap_syslog(chan, pri, ...) syslog(pri, __VA_ARGS__) +#define cap_vsyslog(chan, pri, fmt, ap) vsyslog(pri, fmt, ap) + +#define cap_openlog(chan, ident, logopt, facility) \ + openlog(ident, logopt, facility) +#define cap_closelog(chan) closelog() + +#define cap_setlogmask(chan, maskpri) setlogmask(maskpri) +#endif /* !WITH_CASPER */ + +#endif /* !_CAP_SYSLOG_H_ */ diff --git a/lib/libefivar/Makefile b/lib/libefivar/Makefile index b4368ce9e97c..66dd52ca2994 100644 --- a/lib/libefivar/Makefile +++ b/lib/libefivar/Makefile @@ -26,7 +26,7 @@ .include -EFIBOOT=${SRCTOP}/sys/boot/efi +EFIBOOT=${SRCTOP}/stand/efi EDK2INC=${SRCTOP}/sys/contrib/edk2/Include .PATH: ${EFIBOOT}/libefi diff --git a/lib/libefivar/efivar.c b/lib/libefivar/efivar.c index 4e02eb80caef..a825d9e9f9bf 100644 --- a/lib/libefivar/efivar.c +++ b/lib/libefivar/efivar.c @@ -150,7 +150,7 @@ efi_append_variable(efi_guid_t guid, const char *name, { return efi_set_variable(guid, name, data, data_size, - attributes | EFI_VARIABLE_APPEND_WRITE, 0); + attributes | EFI_VARIABLE_APPEND_WRITE); } int @@ -158,7 +158,7 @@ efi_del_variable(efi_guid_t guid, const char *name) { /* data_size of 0 deletes the variable */ - return efi_set_variable(guid, name, NULL, 0, 0, 0); + return efi_set_variable(guid, name, NULL, 0, 0); } int @@ -358,7 +358,7 @@ efi_name_to_guid(const char *name, efi_guid_t *guid) int efi_set_variable(efi_guid_t guid, const char *name, - uint8_t *data, size_t data_size, uint32_t attributes, mode_t mode __unused) + uint8_t *data, size_t data_size, uint32_t attributes) { struct efi_var_ioc var; int rv; diff --git a/lib/libefivar/efivar.h b/lib/libefivar/efivar.h index cba8a8e61849..5725bb029d7c 100644 --- a/lib/libefivar/efivar.h +++ b/lib/libefivar/efivar.h @@ -83,7 +83,7 @@ int efi_guid_to_symbol(efi_guid_t *guid, char **symbol); int efi_guid_to_str(const efi_guid_t *guid, char **sp); int efi_name_to_guid(const char *name, efi_guid_t *guid); int efi_set_variable(efi_guid_t guid, const char *name, - uint8_t *data, size_t data_size, uint32_t attributes, mode_t mode); + uint8_t *data, size_t data_size, uint32_t attributes); int efi_str_to_guid(const char *s, efi_guid_t *guid); int efi_variables_supported(void); @@ -99,37 +99,4 @@ int efi_known_guid(struct uuid_table **); extern const efi_guid_t efi_guid_empty; -/* Stubs that are expected, but aren't really used */ -static inline int -efi_error_get(unsigned int n __unused, char ** const fn __unused, - char ** const func __unused, int *line __unused, - char ** const msg __unused, int *err __unused) -{ - return 0; -} - -static inline int -efi_error_set(const char *fn __unused, const char *func __unused, - int line __unused, int err __unused, const char *fmt __unused, ...) -{ - return 0; -} - -static inline void -efi_error_clear(void) -{ -} - -static inline int -efi_error(const char *fmt __unused, ...) -{ - return 0; -} - -static inline int -efi_error_val(int val __unused, const char *fmt __unused, ...) -{ - return 0; -} - #endif /* _EFIVAR_H_ */ diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c index a43b6a72a62e..de30165d6ee9 100644 --- a/lib/libkvm/kvm.c +++ b/lib/libkvm/kvm.c @@ -49,6 +49,7 @@ static char sccsid[] = "@(#)kvm.c 8.2 (Berkeley) 2/13/94"; #include #include #include +#include #include @@ -299,6 +300,10 @@ kvm_close(kvm_t *kd) free((void *)kd->argv); if (kd->pt_map != NULL) free(kd->pt_map); + if (kd->page_map != NULL) + free(kd->page_map); + if (kd->sparse_map != MAP_FAILED) + munmap(kd->sparse_map, kd->pt_sparse_size); free((void *)kd); return (error); @@ -487,3 +492,13 @@ kvm_native(kvm_t *kd) return (1); return (kd->arch->ka_native(kd)); } + +int +kvm_walk_pages(kvm_t *kd, kvm_walk_pages_cb_t *cb, void *closure) +{ + + if (kd->arch->ka_walk_pages == NULL) + return (0); + + return (kd->arch->ka_walk_pages(kd, cb, closure)); +} diff --git a/lib/libkvm/kvm.h b/lib/libkvm/kvm.h index 77b118cf3c05..5cb76efe82c6 100644 --- a/lib/libkvm/kvm.h +++ b/lib/libkvm/kvm.h @@ -37,6 +37,14 @@ #include #include +/* + * Including vm/vm.h causes namespace pollution issues. For the + * most part, only things using kvm_walk_pages() need to #include it. + */ +#ifndef VM_H +typedef u_char vm_prot_t; +#endif + /* Default version symbol. */ #define VRS_SYM "_version" #define VRS_KEY "VERSION" @@ -73,7 +81,19 @@ struct kvm_swap { u_int ksw_reserved2; }; +struct kvm_page { + unsigned int version; + u_long paddr; + u_long kmap_vaddr; + u_long dmap_vaddr; + vm_prot_t prot; + u_long offset; + size_t len; + /* end of version 1 */ +}; + #define SWIF_DEV_PREFIX 0x0002 +#define LIBKVM_WALK_PAGES_VERSION 1 __BEGIN_DECLS int kvm_close(kvm_t *); @@ -104,6 +124,9 @@ ssize_t kvm_read(kvm_t *, unsigned long, void *, size_t); ssize_t kvm_read_zpcpu(kvm_t *, unsigned long, void *, size_t, int); ssize_t kvm_read2(kvm_t *, kvaddr_t, void *, size_t); ssize_t kvm_write(kvm_t *, unsigned long, const void *, size_t); + +typedef int kvm_walk_pages_cb_t(struct kvm_page *, void *); +int kvm_walk_pages(kvm_t *, kvm_walk_pages_cb_t *, void *); __END_DECLS #endif /* !_KVM_H_ */ diff --git a/lib/libkvm/kvm_aarch64.h b/lib/libkvm/kvm_aarch64.h index c125d3c109d3..807fd610111f 100644 --- a/lib/libkvm/kvm_aarch64.h +++ b/lib/libkvm/kvm_aarch64.h @@ -40,7 +40,13 @@ typedef uint64_t aarch64_pte_t; #define AARCH64_PAGE_SIZE (1 << AARCH64_PAGE_SHIFT) #define AARCH64_PAGE_MASK (AARCH64_PAGE_SIZE - 1) +/* Source: arm64/include/pte.h */ #define AARCH64_ATTR_MASK 0xfff0000000000fff +#define AARCH64_ATTR_UXN (1ULL << 54) +#define AARCH64_ATTR_PXN (1ULL << 53) +#define AARCH64_ATTR_XN (AARCH64_ATTR_PXN | AARCH64_ATTR_UXN) +#define AARCH64_ATTR_AP(x) ((x) << 6) +#define AARCH64_ATTR_AP_RO (1 << 1) #define AARCH64_ATTR_DESCR_MASK 3 diff --git a/lib/libkvm/kvm_amd64.c b/lib/libkvm/kvm_amd64.c index 235348367903..d568416783d8 100644 --- a/lib/libkvm/kvm_amd64.c +++ b/lib/libkvm/kvm_amd64.c @@ -51,6 +51,7 @@ static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93"; #include #include #include +#include #include #include diff --git a/lib/libkvm/kvm_amd64.h b/lib/libkvm/kvm_amd64.h index 49a72e497c20..a8511e645a66 100644 --- a/lib/libkvm/kvm_amd64.h +++ b/lib/libkvm/kvm_amd64.h @@ -55,7 +55,9 @@ typedef uint64_t amd64_pml4e_t; #define AMD64_NPML4EPG (AMD64_PAGE_SIZE / sizeof(amd64_pml4e_t)) #define AMD64_PML4SHIFT 39 +#define AMD64_PG_NX (1ULL << 63) #define AMD64_PG_V 0x001 +#define AMD64_PG_RW 0x002 #define AMD64_PG_PS 0x080 #define AMD64_PG_FRAME (0x000ffffffffff000) #define AMD64_PG_PS_FRAME (0x000fffffffe00000) diff --git a/lib/libkvm/kvm_arm.h b/lib/libkvm/kvm_arm.h index 38d05cd1441a..035b70e78513 100644 --- a/lib/libkvm/kvm_arm.h +++ b/lib/libkvm/kvm_arm.h @@ -53,6 +53,19 @@ typedef uint32_t arm_pt_entry_t; #define ARM_L2_S_OFFSET (ARM_L2_S_SIZE - 1) #define ARM_L2_S_FRAME (~ARM_L2_S_OFFSET) #define ARM_L2_S_SHIFT 12 +#define ARM_L2_TEX1 0x00000080 +#define ARM_PTE2_RO ARM_L2_TEX1 +#define ARM_L2_NX 0x00000001 +#define ARM_PTE2_NX ARM_L2_NX + +/* + * Note: L2_S_PROT_W differs depending on whether the system is generic or + * xscale. This isn't easily accessible in this context, so use an + * approximation of 'xscale' which is a subset of 'generic'. + */ +#define ARM_L2_AP0(x) ((x) << 4) +#define ARM_AP_W 0x01 +#define ARM_L2_S_PROT_W (ARM_L2_AP0(ARM_AP_W)) #define ARM_L1_TYPE_INV 0x00 /* Invalid (fault) */ #define ARM_L1_TYPE_C 0x01 /* Coarse L2 */ diff --git a/lib/libkvm/kvm_i386.c b/lib/libkvm/kvm_i386.c index 37f5cad25316..6e66a342e5c7 100644 --- a/lib/libkvm/kvm_i386.c +++ b/lib/libkvm/kvm_i386.c @@ -51,6 +51,7 @@ static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93"; #include #include #include +#include #include #ifdef __i386__ diff --git a/lib/libkvm/kvm_i386.h b/lib/libkvm/kvm_i386.h index 51eb6f8f7f70..5440db2adc69 100644 --- a/lib/libkvm/kvm_i386.h +++ b/lib/libkvm/kvm_i386.h @@ -53,8 +53,11 @@ typedef uint64_t i386_pde_pae_t; #define I386_NBPDR_PAE (1 << I386_PDRSHIFT_PAE) #define I386_PAGE_PS_MASK_PAE (I386_NBPDR_PAE - 1) +/* Source: i386/include/pmap.h */ #define I386_PG_V 0x001 +#define I386_PG_RW 0x002 #define I386_PG_PS 0x080 +#define I386_PG_NX (1ULL << 63) #define I386_PG_FRAME_PAE (0x000ffffffffff000ull) #define I386_PG_PS_FRAME_PAE (0x000fffffffe00000ull) #define I386_PG_FRAME (0xfffff000) diff --git a/lib/libkvm/kvm_minidump_aarch64.c b/lib/libkvm/kvm_minidump_aarch64.c index 7081809faca2..48fa877fdc2c 100644 --- a/lib/libkvm/kvm_minidump_aarch64.c +++ b/lib/libkvm/kvm_minidump_aarch64.c @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "../../sys/arm64/include/minidump.h" @@ -50,9 +51,16 @@ __FBSDID("$FreeBSD$"); struct vmstate { struct minidumphdr hdr; - uint64_t *page_map; }; +static aarch64_pte_t +_aarch64_pte_get(kvm_t *kd, u_long pteindex) +{ + aarch64_pte_t *pte = _kvm_pmap_get(kd, pteindex, sizeof(*pte)); + + return le64toh(*pte); +} + static int _aarch64_minidump_probe(kvm_t *kd) { @@ -66,7 +74,6 @@ _aarch64_minidump_freevtop(kvm_t *kd) { struct vmstate *vm = kd->vmst; - free(vm->page_map); free(vm); kd->vmst = NULL; } @@ -116,28 +123,11 @@ _aarch64_minidump_initvtop(kvm_t *kd) aarch64_round_page(vmst->hdr.pmapsize); if (_kvm_pt_init(kd, vmst->hdr.bitmapsize, off, sparse_off, AARCH64_PAGE_SIZE, sizeof(uint64_t)) == -1) { - _kvm_err(kd, kd->program, "cannot load core bitmap"); return (-1); } off += aarch64_round_page(vmst->hdr.bitmapsize); - vmst->page_map = _kvm_malloc(kd, vmst->hdr.pmapsize); - if (vmst->page_map == NULL) { - _kvm_err(kd, kd->program, - "cannot allocate %d bytes for page_map", - vmst->hdr.pmapsize); - return (-1); - } - /* This is the end of the dump, savecore may have truncated it. */ - /* - * XXX: This doesn't make sense. The pmap is not at the end, - * and if it is truncated we don't have any actual data (it's - * all stored after the bitmap and pmap. -- jhb - */ - if (pread(kd->pmfd, vmst->page_map, vmst->hdr.pmapsize, off) < - AARCH64_PAGE_SIZE) { - _kvm_err(kd, kd->program, "cannot read %d bytes for page_map", - vmst->hdr.pmapsize); + if (_kvm_pmap_init(kd, vmst->hdr.pmapsize, off) == -1) { return (-1); } off += aarch64_round_page(vmst->hdr.pmapsize); @@ -161,7 +151,7 @@ _aarch64_minidump_vatop(kvm_t *kd, kvaddr_t va, off_t *pa) if (va >= vm->hdr.dmapbase && va < vm->hdr.dmapend) { a = (va - vm->hdr.dmapbase + vm->hdr.dmapphys) & ~AARCH64_PAGE_MASK; - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, AARCH64_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "_aarch64_minidump_vatop: " "direct map address 0x%jx not in minidump", @@ -172,16 +162,16 @@ _aarch64_minidump_vatop(kvm_t *kd, kvaddr_t va, off_t *pa) return (AARCH64_PAGE_SIZE - offset); } else if (va >= vm->hdr.kernbase) { l3_index = (va - vm->hdr.kernbase) >> AARCH64_L3_SHIFT; - if (l3_index >= vm->hdr.pmapsize / sizeof(*vm->page_map)) + if (l3_index >= vm->hdr.pmapsize / sizeof(l3)) goto invalid; - l3 = le64toh(vm->page_map[l3_index]); + l3 = _aarch64_pte_get(kd, l3_index); if ((l3 & AARCH64_ATTR_DESCR_MASK) != AARCH64_L3_PAGE) { _kvm_err(kd, kd->program, "_aarch64_minidump_vatop: pde not valid"); goto invalid; } a = l3 & ~AARCH64_ATTR_MASK; - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, AARCH64_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "_aarch64_minidump_vatop: " "physical address 0x%jx not in minidump", @@ -225,12 +215,73 @@ _aarch64_native(kvm_t *kd __unused) #endif } +static vm_prot_t +_aarch64_entry_to_prot(aarch64_pte_t pte) +{ + vm_prot_t prot = VM_PROT_READ; + + /* Source: arm64/arm64/pmap.c:pmap_protect() */ + if ((pte & AARCH64_ATTR_AP(AARCH64_ATTR_AP_RO)) == 0) + prot |= VM_PROT_WRITE; + if ((pte & AARCH64_ATTR_XN) == 0) + prot |= VM_PROT_EXECUTE; + return prot; +} + +static int +_aarch64_minidump_walk_pages(kvm_t *kd, kvm_walk_pages_cb_t *cb, void *arg) +{ + struct vmstate *vm = kd->vmst; + u_long nptes = vm->hdr.pmapsize / sizeof(aarch64_pte_t); + u_long bmindex, dva, pa, pteindex, va; + struct kvm_bitmap bm; + vm_prot_t prot; + int ret = 0; + + if (!_kvm_bitmap_init(&bm, vm->hdr.bitmapsize, &bmindex)) + return (0); + + for (pteindex = 0; pteindex < nptes; pteindex++) { + aarch64_pte_t pte = _aarch64_pte_get(kd, pteindex); + + if ((pte & AARCH64_ATTR_DESCR_MASK) != AARCH64_L3_PAGE) + continue; + + va = vm->hdr.kernbase + (pteindex << AARCH64_L3_SHIFT); + pa = pte & ~AARCH64_ATTR_MASK; + dva = vm->hdr.dmapbase + pa; + if (!_kvm_visit_cb(kd, cb, arg, pa, va, dva, + _aarch64_entry_to_prot(pte), AARCH64_PAGE_SIZE, 0)) { + goto out; + } + } + + while (_kvm_bitmap_next(&bm, &bmindex)) { + pa = bmindex * AARCH64_PAGE_SIZE; + dva = vm->hdr.dmapbase + pa; + if (vm->hdr.dmapend < (dva + AARCH64_PAGE_SIZE)) + break; + va = 0; + prot = VM_PROT_READ | VM_PROT_WRITE; + if (!_kvm_visit_cb(kd, cb, arg, pa, va, dva, + prot, AARCH64_PAGE_SIZE, 0)) { + goto out; + } + } + ret = 1; + +out: + _kvm_bitmap_deinit(&bm); + return (ret); +} + static struct kvm_arch kvm_aarch64_minidump = { .ka_probe = _aarch64_minidump_probe, .ka_initvtop = _aarch64_minidump_initvtop, .ka_freevtop = _aarch64_minidump_freevtop, .ka_kvatop = _aarch64_minidump_kvatop, .ka_native = _aarch64_native, + .ka_walk_pages = _aarch64_minidump_walk_pages, }; KVM_ARCH(kvm_aarch64_minidump); diff --git a/lib/libkvm/kvm_minidump_amd64.c b/lib/libkvm/kvm_minidump_amd64.c index 1baca96d71f6..f22ef7ca6547 100644 --- a/lib/libkvm/kvm_minidump_amd64.c +++ b/lib/libkvm/kvm_minidump_amd64.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "../../sys/amd64/include/minidump.h" @@ -46,12 +47,59 @@ __FBSDID("$FreeBSD$"); #include "kvm_amd64.h" #define amd64_round_page(x) roundup2((kvaddr_t)(x), AMD64_PAGE_SIZE) +#define VM_IS_V1(vm) (vm->hdr.version == 1) +#define VA_OFF(vm, va) \ + (VM_IS_V1(vm) ? ((va) & (AMD64_PAGE_SIZE - 1)) : ((va) & AMD64_PAGE_MASK)) struct vmstate { struct minidumphdr hdr; - amd64_pte_t *page_map; }; +static vm_prot_t +_amd64_entry_to_prot(uint64_t entry) +{ + vm_prot_t prot = VM_PROT_READ; + + if ((entry & AMD64_PG_RW) != 0) + prot |= VM_PROT_WRITE; + if ((entry & AMD64_PG_NX) == 0) + prot |= VM_PROT_EXECUTE; + return prot; +} + +/* + * Version 2 minidumps use page directory entries, while version 1 use page + * table entries. + */ + +static amd64_pde_t +_amd64_pde_get(kvm_t *kd, u_long pdeindex) +{ + amd64_pde_t *pde = _kvm_pmap_get(kd, pdeindex, sizeof(*pde)); + + return le64toh(*pde); +} + +static amd64_pte_t +_amd64_pte_get(kvm_t *kd, u_long pteindex) +{ + amd64_pte_t *pte = _kvm_pmap_get(kd, pteindex, sizeof(*pte)); + + return le64toh(*pte); +} + +/* Get the first page table entry for a given page directory index. */ +static amd64_pte_t * +_amd64_pde_first_pte(kvm_t *kd, u_long pdeindex) +{ + u_long *pa; + + pa = _kvm_pmap_get(kd, pdeindex, sizeof(amd64_pde_t)); + if (pa == NULL) + return NULL; + return _kvm_map_get(kd, *pa & AMD64_PG_FRAME, AMD64_PAGE_SIZE); +} + static int _amd64_minidump_probe(kvm_t *kd) { @@ -65,7 +113,6 @@ _amd64_minidump_freevtop(kvm_t *kd) { struct vmstate *vm = kd->vmst; - free(vm->page_map); free(vm); kd->vmst = NULL; } @@ -116,21 +163,11 @@ _amd64_minidump_initvtop(kvm_t *kd) amd64_round_page(vmst->hdr.pmapsize); if (_kvm_pt_init(kd, vmst->hdr.bitmapsize, off, sparse_off, AMD64_PAGE_SIZE, sizeof(uint64_t)) == -1) { - _kvm_err(kd, kd->program, "cannot load core bitmap"); return (-1); } off += amd64_round_page(vmst->hdr.bitmapsize); - vmst->page_map = _kvm_malloc(kd, vmst->hdr.pmapsize); - if (vmst->page_map == NULL) { - _kvm_err(kd, kd->program, "cannot allocate %d bytes for page_map", - vmst->hdr.pmapsize); - return (-1); - } - if (pread(kd->pmfd, vmst->page_map, vmst->hdr.pmapsize, off) != - (ssize_t)vmst->hdr.pmapsize) { - _kvm_err(kd, kd->program, "cannot read %d bytes for page_map", - vmst->hdr.pmapsize); + if (_kvm_pmap_init(kd, vmst->hdr.pmapsize, off) == -1) { return (-1); } off += amd64_round_page(vmst->hdr.pmapsize); @@ -153,16 +190,16 @@ _amd64_minidump_vatop_v1(kvm_t *kd, kvaddr_t va, off_t *pa) if (va >= vm->hdr.kernbase) { pteindex = (va - vm->hdr.kernbase) >> AMD64_PAGE_SHIFT; - if (pteindex >= vm->hdr.pmapsize / sizeof(*vm->page_map)) + if (pteindex >= vm->hdr.pmapsize / sizeof(pte)) goto invalid; - pte = le64toh(vm->page_map[pteindex]); + pte = _amd64_pte_get(kd, pteindex); if ((pte & AMD64_PG_V) == 0) { _kvm_err(kd, kd->program, "_amd64_minidump_vatop_v1: pte not valid"); goto invalid; } a = pte & AMD64_PG_FRAME; - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, AMD64_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "_amd64_minidump_vatop_v1: physical address 0x%jx not in minidump", @@ -173,7 +210,7 @@ _amd64_minidump_vatop_v1(kvm_t *kd, kvaddr_t va, off_t *pa) return (AMD64_PAGE_SIZE - offset); } else if (va >= vm->hdr.dmapbase && va < vm->hdr.dmapend) { a = (va - vm->hdr.dmapbase) & ~AMD64_PAGE_MASK; - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, AMD64_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "_amd64_minidump_vatop_v1: direct map address 0x%jx not in minidump", @@ -212,9 +249,9 @@ _amd64_minidump_vatop(kvm_t *kd, kvaddr_t va, off_t *pa) if (va >= vm->hdr.kernbase) { pdeindex = (va - vm->hdr.kernbase) >> AMD64_PDRSHIFT; - if (pdeindex >= vm->hdr.pmapsize / sizeof(*vm->page_map)) + if (pdeindex >= vm->hdr.pmapsize / sizeof(pde)) goto invalid; - pde = le64toh(vm->page_map[pdeindex]); + pde = _amd64_pde_get(kd, pdeindex); if ((pde & AMD64_PG_V) == 0) { _kvm_err(kd, kd->program, "_amd64_minidump_vatop: pde not valid"); @@ -223,7 +260,7 @@ _amd64_minidump_vatop(kvm_t *kd, kvaddr_t va, off_t *pa) if ((pde & AMD64_PG_PS) == 0) { a = pde & AMD64_PG_FRAME; /* TODO: Just read the single PTE */ - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, AMD64_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "cannot find page table entry for %ju", @@ -250,7 +287,7 @@ _amd64_minidump_vatop(kvm_t *kd, kvaddr_t va, off_t *pa) a = pde & AMD64_PG_PS_FRAME; a += (va & AMD64_PDRMASK) ^ offset; } - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, AMD64_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "_amd64_minidump_vatop: physical address 0x%jx not in minidump", @@ -261,7 +298,7 @@ _amd64_minidump_vatop(kvm_t *kd, kvaddr_t va, off_t *pa) return (AMD64_PAGE_SIZE - offset); } else if (va >= vm->hdr.dmapbase && va < vm->hdr.dmapend) { a = (va - vm->hdr.dmapbase) & ~AMD64_PAGE_MASK; - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, AMD64_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "_amd64_minidump_vatop: direct map address 0x%jx not in minidump", @@ -297,12 +334,99 @@ _amd64_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa) return (_amd64_minidump_vatop(kd, va, pa)); } +static int +_amd64_minidump_walk_pages(kvm_t *kd, kvm_walk_pages_cb_t *cb, void *arg) +{ + struct vmstate *vm = kd->vmst; + u_long npdes = vm->hdr.pmapsize / sizeof(amd64_pde_t); + u_long bmindex, dva, pa, pdeindex, va; + struct kvm_bitmap bm; + int ret = 0; + vm_prot_t prot; + unsigned int pgsz = AMD64_PAGE_SIZE; + + if (vm->hdr.version < 2) + return (0); + + if (!_kvm_bitmap_init(&bm, vm->hdr.bitmapsize, &bmindex)) + return (0); + + for (pdeindex = 0; pdeindex < npdes; pdeindex++) { + amd64_pde_t pde = _amd64_pde_get(kd, pdeindex); + amd64_pte_t *ptes; + u_long i; + + va = vm->hdr.kernbase + (pdeindex << AMD64_PDRSHIFT); + if ((pde & AMD64_PG_V) == 0) + continue; + + if ((pde & AMD64_PG_PS) != 0) { + /* + * Large page. Iterate on each 4K page section + * within this page. This differs from 4K pages in + * that every page here uses the same PDE to + * generate permissions. + */ + pa = (pde & AMD64_PG_PS_FRAME) + + ((va & AMD64_PDRMASK) ^ VA_OFF(vm, va)); + dva = vm->hdr.dmapbase + pa; + _kvm_bitmap_set(&bm, pa, AMD64_PAGE_SIZE); + if (!_kvm_visit_cb(kd, cb, arg, pa, va, dva, + _amd64_entry_to_prot(pde), AMD64_NBPDR, pgsz)) { + goto out; + } + continue; + } + + /* 4K pages: pde references another page of entries. */ + ptes = _amd64_pde_first_pte(kd, pdeindex); + /* Ignore page directory pages that were not dumped. */ + if (ptes == NULL) + continue; + + for (i = 0; i < AMD64_NPTEPG; i++) { + amd64_pte_t pte = (u_long)ptes[i]; + + pa = pte & AMD64_PG_FRAME; + dva = vm->hdr.dmapbase + pa; + if ((pte & AMD64_PG_V) != 0) { + _kvm_bitmap_set(&bm, pa, AMD64_PAGE_SIZE); + if (!_kvm_visit_cb(kd, cb, arg, pa, va, dva, + _amd64_entry_to_prot(pte), pgsz, 0)) { + goto out; + } + } + va += AMD64_PAGE_SIZE; + } + } + + while (_kvm_bitmap_next(&bm, &bmindex)) { + pa = bmindex * AMD64_PAGE_SIZE; + dva = vm->hdr.dmapbase + pa; + if (vm->hdr.dmapend < (dva + pgsz)) + break; + va = 0; + /* amd64/pmap.c: create_pagetables(): dmap always R|W. */ + prot = VM_PROT_READ | VM_PROT_WRITE; + if (!_kvm_visit_cb(kd, cb, arg, pa, va, dva, prot, pgsz, 0)) { + goto out; + } + } + + ret = 1; + +out: + _kvm_bitmap_deinit(&bm); + return (ret); +} + static struct kvm_arch kvm_amd64_minidump = { .ka_probe = _amd64_minidump_probe, .ka_initvtop = _amd64_minidump_initvtop, .ka_freevtop = _amd64_minidump_freevtop, .ka_kvatop = _amd64_minidump_kvatop, .ka_native = _amd64_native, + .ka_walk_pages = _amd64_minidump_walk_pages, }; KVM_ARCH(kvm_amd64_minidump); diff --git a/lib/libkvm/kvm_minidump_arm.c b/lib/libkvm/kvm_minidump_arm.c index 41b99505f86d..915f00335480 100644 --- a/lib/libkvm/kvm_minidump_arm.c +++ b/lib/libkvm/kvm_minidump_arm.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -51,10 +52,17 @@ __FBSDID("$FreeBSD$"); struct vmstate { struct minidumphdr hdr; - void *ptemap; unsigned char ei_data; }; +static arm_pt_entry_t +_arm_pte_get(kvm_t *kd, u_long pteindex) +{ + arm_pt_entry_t *pte = _kvm_pmap_get(kd, pteindex, sizeof(*pte)); + + return _kvm32toh(kd, *pte); +} + static int _arm_minidump_probe(kvm_t *kd) { @@ -68,7 +76,6 @@ _arm_minidump_freevtop(kvm_t *kd) { struct vmstate *vm = kd->vmst; - free(vm->ptemap); free(vm); kd->vmst = NULL; } @@ -122,22 +129,11 @@ _arm_minidump_initvtop(kvm_t *kd) arm_round_page(vmst->hdr.ptesize); if (_kvm_pt_init(kd, vmst->hdr.bitmapsize, off, sparse_off, ARM_PAGE_SIZE, sizeof(uint32_t)) == -1) { - _kvm_err(kd, kd->program, "cannot load core bitmap"); return (-1); } off += arm_round_page(vmst->hdr.bitmapsize); - vmst->ptemap = _kvm_malloc(kd, vmst->hdr.ptesize); - if (vmst->ptemap == NULL) { - _kvm_err(kd, kd->program, "cannot allocate %d bytes for " - "ptemap", vmst->hdr.ptesize); - return (-1); - } - - if (pread(kd->pmfd, vmst->ptemap, vmst->hdr.ptesize, off) != - (ssize_t)vmst->hdr.ptesize) { - _kvm_err(kd, kd->program, "cannot read %d bytes for ptemap", - vmst->hdr.ptesize); + if (_kvm_pmap_init(kd, vmst->hdr.ptesize, off) == -1) { return (-1); } off += arm_round_page(vmst->hdr.ptesize); @@ -153,7 +149,6 @@ _arm_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa) arm_physaddr_t offset, a; kvaddr_t pteindex; off_t ofs; - arm_pt_entry_t *ptemap; if (ISALIVE(kd)) { _kvm_err(kd, 0, "_arm_minidump_kvatop called in live kernel!"); @@ -161,13 +156,12 @@ _arm_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa) } vm = kd->vmst; - ptemap = vm->ptemap; if (va >= vm->hdr.kernbase) { pteindex = (va - vm->hdr.kernbase) >> ARM_PAGE_SHIFT; - if (pteindex >= vm->hdr.ptesize / sizeof(*ptemap)) + if (pteindex >= vm->hdr.ptesize / sizeof(pte)) goto invalid; - pte = _kvm32toh(kd, ptemap[pteindex]); + pte = _arm_pte_get(kd, pteindex); if ((pte & ARM_L2_TYPE_MASK) == ARM_L2_TYPE_INV) { _kvm_err(kd, kd->program, "_arm_minidump_kvatop: pte not valid"); @@ -190,7 +184,7 @@ _arm_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa) a = pte & ARM_L2_S_FRAME; } - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, ARM_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "_arm_minidump_kvatop: " "physical address 0x%jx not in minidump", @@ -209,12 +203,69 @@ _arm_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa) return (0); } +static vm_prot_t +_arm_entry_to_prot(kvm_t *kd, arm_pt_entry_t pte) +{ + struct vmstate *vm = kd->vmst; + vm_prot_t prot = VM_PROT_READ; + + /* Source: arm/arm/pmap-v4.c:pmap_fault_fixup() */ + if (vm->hdr.mmuformat == MINIDUMP_MMU_FORMAT_V4) { + if (pte & ARM_L2_S_PROT_W) + prot |= VM_PROT_WRITE; + return prot; + } + + /* Source: arm/arm/pmap-v6.c:pmap_protect() */ + if ((pte & ARM_PTE2_RO) == 0) + prot |= VM_PROT_WRITE; + if ((pte & ARM_PTE2_NX) == 0) + prot |= VM_PROT_EXECUTE; + return prot; +} + +static int +_arm_minidump_walk_pages(kvm_t *kd, kvm_walk_pages_cb_t *cb, void *arg) +{ + struct vmstate *vm = kd->vmst; + u_long nptes = vm->hdr.ptesize / sizeof(arm_pt_entry_t); + u_long dva, pa, pteindex, va; + + for (pteindex = 0; pteindex < nptes; pteindex++) { + arm_pt_entry_t pte = _arm_pte_get(kd, pteindex); + + if ((pte & ARM_L2_TYPE_MASK) == ARM_L2_TYPE_INV) + continue; + + va = vm->hdr.kernbase + (pteindex << ARM_PAGE_SHIFT); + if ((pte & ARM_L2_TYPE_MASK) == ARM_L2_TYPE_L) { + /* 64K page */ + pa = (pte & ARM_L2_L_FRAME) + + (va & ARM_L2_L_OFFSET & ARM_L2_S_FRAME); + } else { + if (vm->hdr.mmuformat == MINIDUMP_MMU_FORMAT_V4 && + (pte & ARM_L2_TYPE_MASK) == ARM_L2_TYPE_T) { + continue; + } + /* 4K page */ + pa = pte & ARM_L2_S_FRAME; + } + + dva = 0; /* no direct map on this platform */ + if (!_kvm_visit_cb(kd, cb, arg, pa, va, dva, + _arm_entry_to_prot(kd, pte), ARM_PAGE_SIZE, 0)) + return (0); + } + return (1); +} + static struct kvm_arch kvm_arm_minidump = { .ka_probe = _arm_minidump_probe, .ka_initvtop = _arm_minidump_initvtop, .ka_freevtop = _arm_minidump_freevtop, .ka_kvatop = _arm_minidump_kvatop, .ka_native = _arm_native, + .ka_walk_pages = _arm_minidump_walk_pages, }; KVM_ARCH(kvm_arm_minidump); diff --git a/lib/libkvm/kvm_minidump_i386.c b/lib/libkvm/kvm_minidump_i386.c index 129a14b19d72..f17932913177 100644 --- a/lib/libkvm/kvm_minidump_i386.c +++ b/lib/libkvm/kvm_minidump_i386.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "../../sys/i386/include/minidump.h" @@ -49,9 +50,24 @@ __FBSDID("$FreeBSD$"); struct vmstate { struct minidumphdr hdr; - void *ptemap; }; +static i386_pte_pae_t +_i386_pte_pae_get(kvm_t *kd, u_long pteindex) +{ + i386_pte_pae_t *pte = _kvm_pmap_get(kd, pteindex, sizeof(*pte)); + + return le64toh(*pte); +} + +static i386_pte_t +_i386_pte_get(kvm_t *kd, u_long pteindex) +{ + i386_pte_t *pte = _kvm_pmap_get(kd, pteindex, sizeof(*pte)); + + return le32toh(*pte); +} + static int _i386_minidump_probe(kvm_t *kd) { @@ -65,7 +81,6 @@ _i386_minidump_freevtop(kvm_t *kd) { struct vmstate *vm = kd->vmst; - free(vm->ptemap); free(vm); kd->vmst = NULL; } @@ -110,19 +125,11 @@ _i386_minidump_initvtop(kvm_t *kd) i386_round_page(vmst->hdr.ptesize); if (_kvm_pt_init(kd, vmst->hdr.bitmapsize, off, sparse_off, I386_PAGE_SIZE, sizeof(uint32_t)) == -1) { - _kvm_err(kd, kd->program, "cannot load core bitmap"); return (-1); } off += i386_round_page(vmst->hdr.bitmapsize); - vmst->ptemap = _kvm_malloc(kd, vmst->hdr.ptesize); - if (vmst->ptemap == NULL) { - _kvm_err(kd, kd->program, "cannot allocate %d bytes for ptemap", vmst->hdr.ptesize); - return (-1); - } - if (pread(kd->pmfd, vmst->ptemap, vmst->hdr.ptesize, off) != - (ssize_t)vmst->hdr.ptesize) { - _kvm_err(kd, kd->program, "cannot read %d bytes for ptemap", vmst->hdr.ptesize); + if (_kvm_pmap_init(kd, vmst->hdr.ptesize, off) == -1) { return (-1); } off += i386_round_page(vmst->hdr.ptesize); @@ -139,24 +146,22 @@ _i386_minidump_vatop_pae(kvm_t *kd, kvaddr_t va, off_t *pa) kvaddr_t pteindex; i386_physaddr_pae_t a; off_t ofs; - i386_pte_pae_t *ptemap; vm = kd->vmst; - ptemap = vm->ptemap; offset = va & I386_PAGE_MASK; if (va >= vm->hdr.kernbase) { pteindex = (va - vm->hdr.kernbase) >> I386_PAGE_SHIFT; - if (pteindex >= vm->hdr.ptesize / sizeof(*ptemap)) + if (pteindex >= vm->hdr.ptesize / sizeof(pte)) goto invalid; - pte = le64toh(ptemap[pteindex]); + pte = _i386_pte_pae_get(kd, pteindex); if ((pte & I386_PG_V) == 0) { _kvm_err(kd, kd->program, "_i386_minidump_vatop_pae: pte not valid"); goto invalid; } a = pte & I386_PG_FRAME_PAE; - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, I386_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "_i386_minidump_vatop_pae: physical address 0x%jx not in minidump", @@ -186,24 +191,22 @@ _i386_minidump_vatop(kvm_t *kd, kvaddr_t va, off_t *pa) kvaddr_t pteindex; i386_physaddr_t a; off_t ofs; - i386_pte_t *ptemap; vm = kd->vmst; - ptemap = vm->ptemap; offset = va & I386_PAGE_MASK; if (va >= vm->hdr.kernbase) { pteindex = (va - vm->hdr.kernbase) >> I386_PAGE_SHIFT; - if (pteindex >= vm->hdr.ptesize / sizeof(*ptemap)) + if (pteindex >= vm->hdr.ptesize / sizeof(pte)) goto invalid; - pte = le32toh(ptemap[pteindex]); + pte = _i386_pte_get(kd, pteindex); if ((pte & I386_PG_V) == 0) { _kvm_err(kd, kd->program, "_i386_minidump_vatop: pte not valid"); goto invalid; } a = pte & I386_PG_FRAME; - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, I386_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "_i386_minidump_vatop: physical address 0x%jx not in minidump", @@ -238,12 +241,99 @@ _i386_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa) return (_i386_minidump_vatop(kd, va, pa)); } +static vm_prot_t +_i386_entry_to_prot(uint64_t pte) +{ + vm_prot_t prot = VM_PROT_READ; + + /* Source: i386/pmap.c:pmap_protect() */ + if (pte & I386_PG_RW) + prot |= VM_PROT_WRITE; + if ((pte & I386_PG_NX) == 0) + prot |= VM_PROT_EXECUTE; + + return prot; +} + +struct i386_iter { + kvm_t *kd; + u_long nptes; + u_long pteindex; +}; + +static void +_i386_iterator_init(struct i386_iter *it, kvm_t *kd) +{ + struct vmstate *vm = kd->vmst; + + it->kd = kd; + it->pteindex = 0; + if (vm->hdr.paemode) { + it->nptes = vm->hdr.ptesize / sizeof(i386_pte_pae_t); + } else { + it->nptes = vm->hdr.ptesize / sizeof(i386_pte_t); + } + return; +} + +static int +_i386_iterator_next(struct i386_iter *it, u_long *pa, u_long *va, u_long *dva, + vm_prot_t *prot) +{ + struct vmstate *vm = it->kd->vmst; + i386_pte_t pte32; + i386_pte_pae_t pte64; + int found = 0; + + *dva = 0; + *pa = 0; + *va = 0; + *dva = 0; + *prot = 0; + for (; it->pteindex < it->nptes && found == 0; it->pteindex++) { + if (vm->hdr.paemode) { + pte64 = _i386_pte_pae_get(it->kd, it->pteindex); + if ((pte64 & I386_PG_V) == 0) + continue; + *prot = _i386_entry_to_prot(pte64); + *pa = pte64 & I386_PG_FRAME_PAE; + } else { + pte32 = _i386_pte_get(it->kd, it->pteindex); + if ((pte32 & I386_PG_V) == 0) + continue; + *prot = _i386_entry_to_prot(pte32); + *pa = pte32 & I386_PG_FRAME; + } + *va = vm->hdr.kernbase + (it->pteindex << I386_PAGE_SHIFT); + found = 1; + } + return found; +} + +static int +_i386_minidump_walk_pages(kvm_t *kd, kvm_walk_pages_cb_t *cb, void *arg) +{ + struct i386_iter it; + u_long dva, pa, va; + vm_prot_t prot; + + _i386_iterator_init(&it, kd); + while (_i386_iterator_next(&it, &pa, &va, &dva, &prot)) { + if (!_kvm_visit_cb(kd, cb, arg, pa, va, dva, + prot, I386_PAGE_SIZE, 0)) { + return (0); + } + } + return (1); +} + static struct kvm_arch kvm_i386_minidump = { .ka_probe = _i386_minidump_probe, .ka_initvtop = _i386_minidump_initvtop, .ka_freevtop = _i386_minidump_freevtop, .ka_kvatop = _i386_minidump_kvatop, .ka_native = _i386_native, + .ka_walk_pages = _i386_minidump_walk_pages, }; KVM_ARCH(kvm_i386_minidump); diff --git a/lib/libkvm/kvm_minidump_mips.c b/lib/libkvm/kvm_minidump_mips.c index 96534e8d04f9..3b55202c0974 100644 --- a/lib/libkvm/kvm_minidump_mips.c +++ b/lib/libkvm/kvm_minidump_mips.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); */ #include +#include #include #include #include @@ -52,7 +53,6 @@ __FBSDID("$FreeBSD$"); struct vmstate { struct minidumphdr hdr; - void *ptemap; int pte_size; }; @@ -73,7 +73,6 @@ _mips_minidump_freevtop(kvm_t *kd) { struct vmstate *vm = kd->vmst; - free(vm->ptemap); free(vm); kd->vmst = NULL; } @@ -129,22 +128,11 @@ _mips_minidump_initvtop(kvm_t *kd) mips_round_page(vmst->hdr.ptesize); if (_kvm_pt_init(kd, vmst->hdr.bitmapsize, off, sparse_off, MIPS_PAGE_SIZE, sizeof(uint32_t)) == -1) { - _kvm_err(kd, kd->program, "cannot load core bitmap"); return (-1); } off += mips_round_page(vmst->hdr.bitmapsize); - vmst->ptemap = _kvm_malloc(kd, vmst->hdr.ptesize); - if (vmst->ptemap == NULL) { - _kvm_err(kd, kd->program, "cannot allocate %d bytes for " - "ptemap", vmst->hdr.ptesize); - return (-1); - } - - if (pread(kd->pmfd, vmst->ptemap, vmst->hdr.ptesize, off) != - (ssize_t)vmst->hdr.ptesize) { - _kvm_err(kd, kd->program, "cannot read %d bytes for ptemap", - vmst->hdr.ptesize); + if (_kvm_pmap_init(kd, vmst->hdr.ptesize, off) == -1) { return (-1); } off += mips_round_page(vmst->hdr.ptesize); @@ -156,12 +144,12 @@ static int _mips_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa) { struct vmstate *vm; - uint64_t pte; mips_physaddr_t offset, a; kvaddr_t pteindex; + u_long valid; off_t ofs; - uint32_t *ptemap32; - uint64_t *ptemap64; + mips32_pte_t pte32; + mips64_pte_t pte64; if (ISALIVE(kd)) { _kvm_err(kd, 0, "_mips_minidump_kvatop called in live kernel!"); @@ -173,9 +161,6 @@ _mips_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa) va &= ~MIPS_PAGE_MASK; vm = kd->vmst; - ptemap32 = vm->ptemap; - ptemap64 = vm->ptemap; - if (kd->nlehdr.e_ident[EI_CLASS] == ELFCLASS64) { if (va >= MIPS_XKPHYS_START && va < MIPS_XKPHYS_END) { a = va & MIPS_XKPHYS_PHYS_MASK; @@ -202,17 +187,22 @@ _mips_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa) if (va >= vm->hdr.kernbase) { pteindex = (va - vm->hdr.kernbase) >> MIPS_PAGE_SHIFT; if (vm->pte_size == 64) { - if (pteindex >= vm->hdr.ptesize / sizeof(*ptemap64)) + valid = pteindex < vm->hdr.ptesize / sizeof(pte64); + if (pteindex >= vm->hdr.ptesize / sizeof(pte64)) goto invalid; - pte = _kvm64toh(kd, ptemap64[pteindex]); - a = MIPS64_PTE_TO_PA(pte); + pte64 = _mips64_pte_get(kd, pteindex); + valid = pte64 & MIPS_PTE_V; + if (valid) + a = MIPS64_PTE_TO_PA(pte64); } else { - if (pteindex >= vm->hdr.ptesize / sizeof(*ptemap32)) + if (pteindex >= vm->hdr.ptesize / sizeof(pte32)) goto invalid; - pte = _kvm32toh(kd, ptemap32[pteindex]); - a = MIPS32_PTE_TO_PA(pte); + pte32 = _mips32_pte_get(kd, pteindex); + valid = pte32 & MIPS_PTE_V; + if (valid) + a = MIPS32_PTE_TO_PA(pte32); } - if (!pte) { + if (!valid) { _kvm_err(kd, kd->program, "_mips_minidump_kvatop: pte " "not valid"); goto invalid; @@ -224,7 +214,7 @@ _mips_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa) } found: - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, MIPS_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "_mips_minidump_kvatop: physical " "address 0x%jx not in minidump", (uintmax_t)a); @@ -273,12 +263,101 @@ _mips_native(kvm_t *kd __unused) #endif } +struct mips_iter { + kvm_t *kd; + u_long nptes; + u_long pteindex; +}; + +static void +_mips_iterator_init(struct mips_iter *it, kvm_t *kd) +{ + struct vmstate *vm = kd->vmst; + + it->kd = kd; + it->pteindex = 0; + if (vm->pte_size == 64) + it->nptes = vm->hdr.ptesize / sizeof(mips64_pte_t); + else + it->nptes = vm->hdr.ptesize / sizeof(mips32_pte_t); + return; +} + +static int +_mips_iterator_next(struct mips_iter *it, u_long *pa, u_long *va, u_long *dva, + vm_prot_t *prot) +{ + struct vmstate *vm = it->kd->vmst; + int found = 0; + mips64_pte_t pte64; + mips32_pte_t pte32; + + /* + * mips/mips/pmap.c: init_pte_prot / pmap_protect indicate that all + * pages are R|X at least. + */ + *prot = VM_PROT_READ | VM_PROT_EXECUTE; + *pa = 0; + *va = 0; + *dva = 0; + for (;it->pteindex < it->nptes && found == 0; it->pteindex++) { + if (vm->pte_size == 64) { + pte64 = _mips64_pte_get(it->kd, it->pteindex); + if ((pte64 & MIPS_PTE_V) == 0) + continue; + if ((pte64 & MIPS64_PTE_RO) == 0) + *prot |= VM_PROT_WRITE; + *pa = MIPS64_PTE_TO_PA(pte64); + } else { + pte32 = _mips32_pte_get(it->kd, it->pteindex); + if ((pte32 & MIPS_PTE_V) == 0) + continue; + if ((pte32 & MIPS32_PTE_RO) == 0) + *prot |= VM_PROT_WRITE; + *pa = MIPS32_PTE_TO_PA(pte32); + } + *va = vm->hdr.kernbase + (it->pteindex << MIPS_PAGE_SHIFT); + found = 1; + /* advance pteindex regardless */ + } + + return found; +} + +static int +_mips_minidump_walk_pages(kvm_t *kd, kvm_walk_pages_cb_t *cb, void *arg) +{ + struct mips_iter it; + u_long dva, pa, va; + vm_prot_t prot; + + /* Generate direct mapped entries; need page entries for prot etc? */ + if (kd->nlehdr.e_ident[EI_CLASS] == ELFCLASS64) { + /* MIPS_XKPHYS_START..MIPS_XKPHYS_END */ + /* MIPS64_KSEG0_START..MIPS64_KSEG0_END */ + /* MIPS64_KSEG1_START..MIPS64_KSEG1_START */ + } else { + /* MIPS32_KSEG0_START..MIPS32_KSEG0_END */ + /* MIPS32_KSEG1_START..MIPS32_KSEG1_END */ + } + + _mips_iterator_init(&it, kd); + while (_mips_iterator_next(&it, &pa, &va, &dva, &prot)) { + if (!_kvm_visit_cb(kd, cb, arg, pa, va, dva, + prot, MIPS_PAGE_SIZE, 0)) { + return (0); + } + } + return (1); +} + static struct kvm_arch kvm_mips_minidump = { .ka_probe = _mips_minidump_probe, .ka_initvtop = _mips_minidump_initvtop, .ka_freevtop = _mips_minidump_freevtop, .ka_kvatop = _mips_minidump_kvatop, .ka_native = _mips_native, + .ka_walk_pages = _mips_minidump_walk_pages, }; KVM_ARCH(kvm_mips_minidump); diff --git a/lib/libkvm/kvm_mips.h b/lib/libkvm/kvm_mips.h index 9fba6fb8e6e8..715117d59fb9 100644 --- a/lib/libkvm/kvm_mips.h +++ b/lib/libkvm/kvm_mips.h @@ -35,6 +35,9 @@ typedef uint64_t mips_physaddr_t; +typedef uint32_t mips32_pte_t; +typedef uint64_t mips64_pte_t; + #define MIPS_PAGE_SHIFT 12 #define MIPS_PAGE_SIZE (1 << MIPS_PAGE_SHIFT) #define MIPS_PAGE_MASK (MIPS_PAGE_SIZE - 1) @@ -58,6 +61,28 @@ typedef uint64_t mips_physaddr_t; #define MIPS64_PTE_TO_PFN(pte) ((pte) & MIPS64_PFN_MASK) #define MIPS64_PTE_TO_PA(pte) (MIPS_PFN_TO_PA(MIPS64_PTE_TO_PFN((pte)))) +#define MIPS32_SWBITS_SHIFT 29 +#define MIPS64_SWBITS_SHIFT 55 +#define MIPS_PTE_V 0x02 +#define MIPS32_PTE_RO ((mips32_pte_t)0x01 << MIPS32_SWBITS_SHIFT) +#define MIPS64_PTE_RO ((mips64_pte_t)0x01 << MIPS64_SWBITS_SHIFT) + +static inline mips32_pte_t +_mips32_pte_get(kvm_t *kd, u_long pteindex) +{ + mips32_pte_t *pte = _kvm_pmap_get(kd, pteindex, sizeof(*pte)); + + return _kvm32toh(kd, *pte); +} + +static inline mips64_pte_t +_mips64_pte_get(kvm_t *kd, u_long pteindex) +{ + mips64_pte_t *pte = _kvm_pmap_get(kd, pteindex, sizeof(*pte)); + + return _kvm64toh(kd, *pte); +} + #ifdef __mips__ _Static_assert(PAGE_SHIFT == MIPS_PAGE_SHIFT, "PAGE_SHIFT mismatch"); _Static_assert(PAGE_SIZE == MIPS_PAGE_SIZE, "PAGE_SIZE mismatch"); diff --git a/lib/libkvm/kvm_private.c b/lib/libkvm/kvm_private.c index 4f35fa09bcd2..467ac036c84f 100644 --- a/lib/libkvm/kvm_private.c +++ b/lib/libkvm/kvm_private.c @@ -43,11 +43,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include #include #include @@ -57,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "kvm_private.h" @@ -258,6 +261,32 @@ popcount_bytes(uint64_t *addr, uint32_t bit0, uint32_t bitN) return (count); } +void * +_kvm_pmap_get(kvm_t *kd, u_long idx, size_t len) +{ + uintptr_t off = idx * len; + + if ((off_t)off >= kd->pt_sparse_off) + return (NULL); + return (void *)((uintptr_t)kd->page_map + off); +} + +void * +_kvm_map_get(kvm_t *kd, u_long pa, unsigned int page_size) +{ + off_t off; + uintptr_t addr; + + off = _kvm_pt_find(kd, pa, page_size); + if (off == -1) + return NULL; + + addr = (uintptr_t)kd->page_map + off; + if (off >= kd->pt_sparse_off) + addr = (uintptr_t)kd->sparse_map + (off - kd->pt_sparse_off); + return (void *)addr; +} + int _kvm_pt_init(kvm_t *kd, size_t map_len, off_t map_off, off_t sparse_off, int page_size, int word_size) @@ -300,8 +329,10 @@ _kvm_pt_init(kvm_t *kd, size_t map_len, off_t map_off, off_t sparse_off, res = map_len; pc_bins = 1 + (res * NBBY + POPCOUNT_BITS / 2) / POPCOUNT_BITS; kd->pt_popcounts = calloc(pc_bins, sizeof(uint32_t)); - if (kd->pt_popcounts == NULL) + if (kd->pt_popcounts == NULL) { + _kvm_err(kd, kd->program, "cannot allocate popcount bins"); return (-1); + } for (popcount_bin = &kd->pt_popcounts[1]; res > 0; addr++, res -= sizeof(*addr)) { @@ -318,9 +349,46 @@ _kvm_pt_init(kvm_t *kd, size_t map_len, off_t map_off, off_t sparse_off, ((uintptr_t)popcount_bin - (uintptr_t)kd->pt_popcounts)); kd->pt_sparse_off = sparse_off; - kd->pt_sparse_size = (uint64_t)*popcount_bin * PAGE_SIZE; + kd->pt_sparse_size = (uint64_t)*popcount_bin * page_size; kd->pt_page_size = page_size; kd->pt_word_size = word_size; + + /* + * Map the sparse page array. This is useful for performing point + * lookups of specific pages, e.g. for kvm_walk_pages. Generally, + * this is much larger than is reasonable to read in up front, so + * mmap it in instead. + */ + kd->sparse_map = mmap(NULL, kd->pt_sparse_size, PROT_READ, + MAP_PRIVATE, kd->pmfd, kd->pt_sparse_off); + if (kd->sparse_map == MAP_FAILED) { + _kvm_err(kd, kd->program, "cannot map %" PRIu64 + " bytes from fd %d offset %jd for sparse map: %s", + kd->pt_sparse_size, kd->pmfd, + (intmax_t)kd->pt_sparse_off, strerror(errno)); + return (-1); + } + return (0); +} + +int +_kvm_pmap_init(kvm_t *kd, uint32_t pmap_size, off_t pmap_off) +{ + ssize_t exp_len = pmap_size; + + kd->page_map_size = pmap_size; + kd->page_map_off = pmap_off; + kd->page_map = _kvm_malloc(kd, pmap_size); + if (kd->page_map == NULL) { + _kvm_err(kd, kd->program, "cannot allocate %u bytes " + "for page map", pmap_size); + return (-1); + } + if (pread(kd->pmfd, kd->page_map, pmap_size, pmap_off) != exp_len) { + _kvm_err(kd, kd->program, "cannot read %d bytes from " + "offset %jd for page map", pmap_size, (intmax_t)pmap_off); + return (-1); + } return (0); } @@ -328,7 +396,7 @@ _kvm_pt_init(kvm_t *kd, size_t map_len, off_t map_off, off_t sparse_off, * Find the offset for the given physical page address; returns -1 otherwise. * * A page's offset is represented by the sparse page base offset plus the - * number of bits set before its bit multiplied by PAGE_SIZE. This means + * number of bits set before its bit multiplied by page size. This means * that if a page exists in the dump, it's necessary to know how many pages * in the dump precede it. Reduce this O(n) counting to O(1) by caching the * number of bits set at POPCOUNT_BITS intervals. @@ -339,10 +407,10 @@ _kvm_pt_init(kvm_t *kd, size_t map_len, off_t map_off, off_t sparse_off, * checked by also counting down from the next higher bin if it's closer. */ off_t -_kvm_pt_find(kvm_t *kd, uint64_t pa) +_kvm_pt_find(kvm_t *kd, uint64_t pa, unsigned int page_size) { uint64_t *bitmap = kd->pt_map; - uint64_t pte_bit_id = pa / PAGE_SIZE; + uint64_t pte_bit_id = pa / page_size; uint64_t pte_u64 = pte_bit_id / BITS_IN(*bitmap); uint64_t popcount_id = pte_bit_id / POPCOUNT_BITS; uint64_t pte_mask = 1ULL << (pte_bit_id % BITS_IN(*bitmap)); @@ -383,10 +451,10 @@ _kvm_pt_find(kvm_t *kd, uint64_t pa) * This can only happen if the core is truncated. Treat these * entries as if they don't exist, since their backing doesn't. */ - if (count >= (kd->pt_sparse_size / PAGE_SIZE)) + if (count >= (kd->pt_sparse_size / page_size)) return (-1); - return (kd->pt_sparse_off + (uint64_t)count * PAGE_SIZE); + return (kd->pt_sparse_off + (uint64_t)count * page_size); } static int @@ -630,3 +698,70 @@ _kvm_nlist(kvm_t *kd, struct kvm_nlist *nl, int initialize) _kvm_syserr(kd, kd->program, "kvm_nlist"); return (error); } + +int +_kvm_bitmap_init(struct kvm_bitmap *bm, u_long bitmapsize, u_long *idx) +{ + + *idx = ULONG_MAX; + bm->map = calloc(bitmapsize, sizeof *bm->map); + if (bm->map == NULL) + return (0); + bm->size = bitmapsize; + return (1); +} + +void +_kvm_bitmap_set(struct kvm_bitmap *bm, u_long pa, unsigned int page_size) +{ + u_long bm_index = pa / page_size; + uint8_t *byte = &bm->map[bm_index / 8]; + + *byte |= (1UL << (bm_index % 8)); +} + +int +_kvm_bitmap_next(struct kvm_bitmap *bm, u_long *idx) +{ + u_long first_invalid = bm->size * CHAR_BIT; + + if (*idx == ULONG_MAX) + *idx = 0; + else + (*idx)++; + + /* Find the next valid idx. */ + for (; *idx < first_invalid; (*idx)++) { + unsigned int mask = *idx % CHAR_BIT; + if ((bm->map[*idx * CHAR_BIT] & mask) == 0) + break; + } + + return (*idx < first_invalid); +} + +void +_kvm_bitmap_deinit(struct kvm_bitmap *bm) +{ + + free(bm->map); +} + +int +_kvm_visit_cb(kvm_t *kd, kvm_walk_pages_cb_t *cb, void *arg, u_long pa, + u_long kmap_vaddr, u_long dmap_vaddr, vm_prot_t prot, size_t len, + unsigned int page_size) +{ + unsigned int pgsz = page_size ? page_size : len; + struct kvm_page p = { + .version = LIBKVM_WALK_PAGES_VERSION, + .paddr = pa, + .kmap_vaddr = kmap_vaddr, + .dmap_vaddr = dmap_vaddr, + .prot = prot, + .offset = _kvm_pt_find(kd, pa, pgsz), + .len = len, + }; + + return cb(&p, arg); +} diff --git a/lib/libkvm/kvm_private.h b/lib/libkvm/kvm_private.h index 03ae4cefb815..03c7ee45a620 100644 --- a/lib/libkvm/kvm_private.h +++ b/lib/libkvm/kvm_private.h @@ -44,6 +44,7 @@ struct kvm_arch { void (*ka_freevtop)(kvm_t *); int (*ka_kvatop)(kvm_t *, kvaddr_t, off_t *); int (*ka_native)(kvm_t *); + int (*ka_walk_pages)(kvm_t *, kvm_walk_pages_cb_t *, void *); }; #define KVM_ARCH(ka) DATA_SET(kvm_arch, ka) @@ -107,6 +108,17 @@ struct __kvm { uint32_t *pt_popcounts; unsigned int pt_page_size; unsigned int pt_word_size; + + /* Page & sparse map structures. */ + void *page_map; + uint32_t page_map_size; + off_t page_map_off; + void *sparse_map; +}; + +struct kvm_bitmap { + uint8_t *map; + u_long size; }; /* Page table lookup constants. */ @@ -137,6 +149,11 @@ _kvm64toh(kvm_t *kd, uint64_t val) return (be64toh(val)); } +int _kvm_bitmap_init(struct kvm_bitmap *, u_long, u_long *); +void _kvm_bitmap_set(struct kvm_bitmap *, u_long, unsigned int); +int _kvm_bitmap_next(struct kvm_bitmap *, u_long *); +void _kvm_bitmap_deinit(struct kvm_bitmap *); + void _kvm_err(kvm_t *kd, const char *program, const char *fmt, ...) __printflike(3, 4); void _kvm_freeprocs(kvm_t *kd); @@ -154,4 +171,9 @@ int _kvm_probe_elf_kernel(kvm_t *, int, int); int _kvm_is_minidump(kvm_t *); int _kvm_read_core_phdrs(kvm_t *, size_t *, GElf_Phdr **); int _kvm_pt_init(kvm_t *, size_t, off_t, off_t, int, int); -off_t _kvm_pt_find(kvm_t *, uint64_t); +off_t _kvm_pt_find(kvm_t *, uint64_t, unsigned int); +int _kvm_visit_cb(kvm_t *, kvm_walk_pages_cb_t *, void *, u_long, + u_long, u_long, vm_prot_t, size_t, unsigned int); +int _kvm_pmap_init(kvm_t *, uint32_t, off_t); +void * _kvm_pmap_get(kvm_t *, u_long, size_t); +void * _kvm_map_get(kvm_t *, u_long, unsigned int); diff --git a/lib/libutil/hexdump.3 b/lib/libutil/hexdump.3 index 76db9894dcf2..ba23d2523651 100644 --- a/lib/libutil/hexdump.3 +++ b/lib/libutil/hexdump.3 @@ -42,14 +42,9 @@ The .Fn hexdump function prints an array of bytes to standard out in hexadecimal form, -along with the -.Tn ASCII -representation of the bytes, if possible. -By default, each line of -output will start with an offset count, followed by 16 hexadecimal values, -followed by 16 -.Tn ASCII -characters. +along with the ASCII representation of the bytes, if possible. +By default, each line of output will start with an offset count, followed by 16 +hexadecimal values, followed by 16 ASCII characters. .Bl -tag -width indent .It Fa ptr Pointer to the array of bytes to print. @@ -73,12 +68,10 @@ Flags for controlling the formatting of the output. Integer value of the number of bytes to display on each line. A value of 0 implies that the default value of 16 will be used. .It Bits 8-15 -Character -.Tn ASCII -value to use as the separator for the hexadecimal output. +Character ASCII value to use as the separator for the hexadecimal output. A value of 0 implies that the default value of 32 -.Tn ( ASCII -space) will be used. +.Pq ASCII space +will be used. .It Dv HD_OMIT_COUNT Do not print the offset column at the beginning of each line. .It Dv HD_OMIT_HEX diff --git a/lib/libzstd/Makefile b/lib/libzstd/Makefile index bb5ad0fdc5ed..4f290dd462ff 100644 --- a/lib/libzstd/Makefile +++ b/lib/libzstd/Makefile @@ -19,7 +19,12 @@ SRCS= entropy_common.c \ zbuff_decompress.c \ cover.c \ divsufsort.c \ - zdict.c + zdict.c \ + zstd_fast.c \ + zstd_lazy.c \ + zstd_ldm.c \ + zstd_opt.c \ + zstd_double_fast.c WARNS= 2 INCS= zstd.h CFLAGS+= -I${ZSTDDIR}/lib -I${ZSTDDIR}/lib/common -DXXH_NAMESPACE=ZSTD_ \ @@ -28,7 +33,7 @@ LIBADD= pthread PRIVATELIB= yes -ZSTDDIR= ${SRCTOP}/contrib/zstd +ZSTDDIR= ${SRCTOP}/sys/contrib/zstd .PATH: ${ZSTDDIR}/lib/common ${ZSTDDIR}/lib/compress \ ${ZSTDDIR}/lib/decompress ${ZSTDDIR}/lib/deprecated \ ${ZSTDDIR}/lib/dictBuilder ${ZSTDDIR}/lib diff --git a/libexec/rtld-elf/mips/rtld_start.S b/libexec/rtld-elf/mips/rtld_start.S index 10e2e571bbc9..242887e3cbb7 100644 --- a/libexec/rtld-elf/mips/rtld_start.S +++ b/libexec/rtld-elf/mips/rtld_start.S @@ -32,7 +32,9 @@ #include +#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ > 4) .cfi_sections .debug_frame +#endif .globl _C_LABEL(_rtld_relocate_nonplt_self) .globl _C_LABEL(_rtld) diff --git a/release/Makefile.mirrors b/release/Makefile.mirrors index 390aebfdb6c4..66635eff3346 100644 --- a/release/Makefile.mirrors +++ b/release/Makefile.mirrors @@ -57,7 +57,7 @@ TLD?= ${FTPDIR}/releases .endif .if defined(EMBEDDED) && !empty(EMBEDDED) -. if ${TARGET:Marm*} != "" && (${TARGET_ARCH:Marmv[67]} != "" || ${TARGET_ARCH} == "aarch64") +. if ${TARGET:Marm*} != "" && (${TARGET_ARCH:Marm*} != "" || ${TARGET_ARCH} == "aarch64") . if !defined(BOARDNAME) && empty(BOARDNAME) BOARDNAME:= ${KERNCONF} . else diff --git a/release/arm/GUMSTIX.conf b/release/arm/GUMSTIX.conf index ab099d0b8a3b..2763c3bca7c0 100644 --- a/release/arm/GUMSTIX.conf +++ b/release/arm/GUMSTIX.conf @@ -5,7 +5,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" -EMBEDDED_TARGET_ARCH="armv6" +EMBEDDED_TARGET_ARCH="arm" EMBEDDEDPORTS="sysutils/u-boot-duovero" KERNEL="GUMSTIX" IMAGE_SIZE="3072M" diff --git a/release/arm64/PINE64.conf b/release/arm64/PINE64.conf index cca7e0d000a2..a01e417426c1 100644 --- a/release/arm64/PINE64.conf +++ b/release/arm64/PINE64.conf @@ -26,12 +26,12 @@ arm_install_uboot() { of=/dev/${mddev} bs=1k seek=8 conv=sync chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} - chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} + chroot ${CHROOTDIR} mount /dev/${mddev}s2 ${UFSMOUNT} BOOTFILES="$(chroot ${CHROOTDIR} \ env TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ WITH_UNIFIED_OBJDIR=yes \ - make -C ${WORLDDIR}/sys/boot -V .OBJDIR)" + make -C ${WORLDDIR}/stand -V .OBJDIR)" BOOTFILES="$(realpath ${BOOTFILES})" chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/EFI/BOOT diff --git a/release/arm64/RPI3.conf b/release/arm64/RPI3.conf index 8636ddbfa8ba..216acae43a5a 100644 --- a/release/arm64/RPI3.conf +++ b/release/arm64/RPI3.conf @@ -45,7 +45,7 @@ arm_install_uboot() { BOOTFILES="$(chroot ${CHROOTDIR} \ env TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ WITH_UNIFIED_OBJDIR=yes \ - make -C ${WORLDDIR}/sys/boot -V .OBJDIR)" + make -C ${WORLDDIR}/stand -V .OBJDIR)" BOOTFILES="$(realpath ${BOOTFILES})" chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/EFI/BOOT diff --git a/release/powerpc/generate-hfs.sh b/release/powerpc/generate-hfs.sh index c445fea5df04..8883f9d40e21 100755 --- a/release/powerpc/generate-hfs.sh +++ b/release/powerpc/generate-hfs.sh @@ -32,7 +32,7 @@ cat > bootinfo.txt << EOF FreeBSD/powerpc bootloader FreeBSD - $FreeBSD: head/sys/boot/powerpc/boot1.chrp/bootinfo.txt 184490 2008-10 + $FreeBSD: head/stand/powerpc/boot1.chrp/bootinfo.txt 184490 2008-10 -31 00:52:31Z nwhitehorn $ diff --git a/release/release.sh b/release/release.sh index 18ec210b78f6..6a9a1fd7f2fe 100755 --- a/release/release.sh +++ b/release/release.sh @@ -148,7 +148,7 @@ env_check() { WITH_COMPRESSED_IMAGES= NODOC=yes case ${EMBEDDED_TARGET}:${EMBEDDED_TARGET_ARCH} in - arm:armv6|arm:armv7|arm64:aarch64) + arm:arm*|arm64:aarch64) chroot_build_release_cmd="chroot_arm_build_release" ;; *) diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index 78e7839d64e4..90adeed44d82 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -16,7 +16,7 @@ write_partition_layout() { BOOTFILES="$(env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ WITH_UNIFIED_OBJDIR=yes \ - make -C ${WORLDDIR}/sys/boot -V .OBJDIR)" + make -C ${WORLDDIR}/stand -V .OBJDIR)" BOOTFILES="$(realpath ${BOOTFILES})" case "${TARGET}:${TARGET_ARCH}" in diff --git a/sbin/dhclient/Makefile b/sbin/dhclient/Makefile index 98beb6e44634..75b578824bb3 100644 --- a/sbin/dhclient/Makefile +++ b/sbin/dhclient/Makefile @@ -44,6 +44,12 @@ MAN= dhclient.8 dhclient.conf.5 dhclient.leases.5 dhcp-options.5 \ dhclient-script.8 LIBADD= util +.if ${MK_CASPER} != "no" && !defined(RESCUE) +LIBADD+= casper +LIBADD+= cap_syslog +CFLAGS+=-DWITH_CASPER +.endif + WARNS?= 2 HAS_TESTS= diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index c9c74144c1b8..4f44303a0404 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -84,6 +84,8 @@ __FBSDID("$FreeBSD$"); #define CLIENT_PATH "PATH=/usr/bin:/usr/sbin:/bin:/sbin" +cap_channel_t *capsyslog; + time_t cur_time; time_t default_lease_time = 43200; /* 12 hours... */ @@ -345,6 +347,21 @@ routehandler(struct protocol *p) exit(1); } +static void +init_casper(void) +{ + cap_channel_t *casper; + + casper = cap_init(); + if (casper == NULL) + error("unable to start casper"); + + capsyslog = cap_service_open(casper, "system.syslog"); + cap_close(casper); + if (capsyslog == NULL) + error("unable to open system.syslog service"); +} + int main(int argc, char *argv[]) { @@ -356,9 +373,11 @@ main(int argc, char *argv[]) pid_t otherpid; cap_rights_t rights; + init_casper(); + /* Initially, log errors to stderr as well as to syslogd. */ - openlog(__progname, LOG_PID | LOG_NDELAY, DHCPD_LOG_FACILITY); - setlogmask(LOG_UPTO(LOG_DEBUG)); + cap_openlog(capsyslog, __progname, LOG_PID | LOG_NDELAY, DHCPD_LOG_FACILITY); + cap_setlogmask(capsyslog, LOG_UPTO(LOG_DEBUG)); while ((ch = getopt(argc, argv, "bc:dl:p:qu")) != -1) switch (ch) { @@ -518,7 +537,7 @@ main(int argc, char *argv[]) setproctitle("%s", ifi->name); - if (cap_enter() < 0 && errno != ENOSYS) + if (CASPER_SUPPORT && cap_enter() < 0 && errno != ENOSYS) error("can't enter capability mode: %m"); if (immediate_daemon) @@ -2404,7 +2423,7 @@ go_daemon(void) /* Stop logging to stderr... */ log_perror = 0; - if (daemon(1, 0) == -1) + if (daemon(1, 1) == -1) error("daemon"); cap_rights_init(&rights); diff --git a/sbin/dhclient/dhcpd.h b/sbin/dhclient/dhcpd.h index 9210cd422e1c..9d80fc253676 100644 --- a/sbin/dhclient/dhcpd.h +++ b/sbin/dhclient/dhcpd.h @@ -73,6 +73,9 @@ #include #include +#include +#include + #include "dhcp.h" #include "tree.h" @@ -352,6 +355,7 @@ int addr_eq(struct iaddr, struct iaddr); char *piaddr(struct iaddr); /* dhclient.c */ +extern cap_channel_t *capsyslog; extern char *path_dhclient_conf; extern char *path_dhclient_db; extern time_t cur_time; diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c index a2f5eef24603..51d5c7af04c5 100644 --- a/sbin/dhclient/dispatch.c +++ b/sbin/dhclient/dispatch.c @@ -298,7 +298,8 @@ interface_status(struct interface_info *ifinfo) memset(&ifr, 0, sizeof(ifr)); strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); if (ioctl(ifsock, SIOCGIFFLAGS, &ifr) < 0) { - syslog(LOG_ERR, "ioctl(SIOCGIFFLAGS) on %s: %m", ifname); + cap_syslog(capsyslog, LOG_ERR, "ioctl(SIOCGIFFLAGS) on %s: %m", + ifname); goto inactive; } @@ -316,9 +317,8 @@ interface_status(struct interface_info *ifinfo) strlcpy(ifmr.ifm_name, ifname, sizeof(ifmr.ifm_name)); if (ioctl(ifsock, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { if (errno != EINVAL) { - syslog(LOG_DEBUG, "ioctl(SIOCGIFMEDIA) on %s: %m", - ifname); - + cap_syslog(capsyslog, LOG_DEBUG, + "ioctl(SIOCGIFMEDIA) on %s: %m", ifname); ifinfo->noifmedia = 1; goto active; } @@ -479,8 +479,8 @@ interface_link_status(char *ifname) if (ioctl(sock, SIOCGIFMEDIA, (caddr_t)&ifmr) == -1) { /* EINVAL -> link state unknown. treat as active */ if (errno != EINVAL) - syslog(LOG_DEBUG, "ioctl(SIOCGIFMEDIA) on %s: %m", - ifname); + cap_syslog(capsyslog, LOG_DEBUG, + "ioctl(SIOCGIFMEDIA) on %s: %m", ifname); close(sock); return (1); } diff --git a/sbin/dhclient/errwarn.c b/sbin/dhclient/errwarn.c index 57207807902f..596505e21d55 100644 --- a/sbin/dhclient/errwarn.c +++ b/sbin/dhclient/errwarn.c @@ -69,7 +69,7 @@ error(char *fmt, ...) va_end(list); #ifndef DEBUG - syslog(log_priority | LOG_ERR, "%s", mbuf); + cap_syslog(capsyslog, log_priority | LOG_ERR, "%s", mbuf); #endif /* Also log it to stderr? */ @@ -78,7 +78,7 @@ error(char *fmt, ...) write(2, "\n", 1); } - syslog(LOG_CRIT, "exiting."); + cap_syslog(capsyslog, LOG_CRIT, "exiting."); if (log_perror) { fprintf(stderr, "exiting.\n"); fflush(stderr); @@ -103,7 +103,7 @@ warning(char *fmt, ...) va_end(list); #ifndef DEBUG - syslog(log_priority | LOG_ERR, "%s", mbuf); + cap_syslog(capsyslog, log_priority | LOG_ERR, "%s", mbuf); #endif if (log_perror) { @@ -129,7 +129,7 @@ note(char *fmt, ...) va_end(list); #ifndef DEBUG - syslog(log_priority | LOG_INFO, "%s", mbuf); + cap_syslog(capsyslog, log_priority | LOG_INFO, "%s", mbuf); #endif if (log_perror) { @@ -155,7 +155,7 @@ debug(char *fmt, ...) va_end(list); #ifndef DEBUG - syslog(log_priority | LOG_DEBUG, "%s", mbuf); + cap_syslog(capsyslog, log_priority | LOG_DEBUG, "%s", mbuf); #endif if (log_perror) { @@ -217,10 +217,10 @@ parse_warn(char *fmt, ...) va_end(list); #ifndef DEBUG - syslog(log_priority | LOG_ERR, "%s", mbuf); - syslog(log_priority | LOG_ERR, "%s", token_line); + cap_syslog(capsyslog, log_priority | LOG_ERR, "%s", mbuf); + cap_syslog(capsyslog, log_priority | LOG_ERR, "%s", token_line); if (lexline < 81) - syslog(log_priority | LOG_ERR, + cap_syslog(capsyslog, log_priority | LOG_ERR, "%s^", &spaces[sizeof(spaces) - lexchar]); #endif diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 0453ee0af3c6..032c911207a4 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -709,7 +709,7 @@ main(int argc, char *const *argv) if (options & F_NUMERIC) cansandbox = true; else if (capdns != NULL) - cansandbox = true; + cansandbox = CASPER_SUPPORT; else cansandbox = false; diff --git a/secure/Makefile b/secure/Makefile index 52830a50f126..c8d12502740d 100644 --- a/secure/Makefile +++ b/secure/Makefile @@ -11,7 +11,7 @@ SUBDIR.${MK_TESTS}+= tests # These are the programs which depend on crypto, but not Kerberos. SPROGS= lib/libfetch lib/libpam lib/libradius lib/libtelnet \ bin/ed libexec/telnetd usr.bin/fetch usr.bin/telnet \ - usr.sbin/pkg_install usr.sbin/ppp usr.sbin/tcpdump/tcpdump + usr.sbin/ppp usr.sbin/tcpdump/tcpdump .if ${MK_SENDMAIL} != "no" SPROGS+=usr.sbin/sendmail .endif diff --git a/share/examples/bootforth/README b/share/examples/bootforth/README index b8eb8a0f3a16..1ac13420c9ee 100644 --- a/share/examples/bootforth/README +++ b/share/examples/bootforth/README @@ -1,6 +1,6 @@ Here you can find some simple examples how to use BootFORTH (part of the new bootloader) together with terminal emulation code (available when -compiling /sys/boot/i386/libi386 with -DTERM_EMU). +compiling /stand/i386/libi386 with -DTERM_EMU). Normally, you can place the files in /boot as they are here, and they will be automatically loaded by /boot/loader. You must choose between boot.4th or diff --git a/share/examples/etc/make.conf b/share/examples/etc/make.conf index 900a77af2a22..a5772909f167 100644 --- a/share/examples/etc/make.conf +++ b/share/examples/etc/make.conf @@ -171,7 +171,7 @@ #BOOT_COMCONSOLE_SPEED= 115200 # # By default the 'pxeboot' loader retrieves the kernel via NFS. Defining -# this and recompiling /usr/src/sys/boot will cause it to retrieve the kernel +# this and recompiling /usr/src/stand will cause it to retrieve the kernel # via TFTP. This allows pxeboot to load a custom BOOTP diskless kernel yet # still mount the server's '/' (i.e. rather than load the server's kernel). # diff --git a/share/man/man4/fdt.4 b/share/man/man4/fdt.4 index 6b371a50e1a8..dc08be39c234 100644 --- a/share/man/man4/fdt.4 +++ b/share/man/man4/fdt.4 @@ -95,7 +95,7 @@ computer system in a human-readable form, with certain hierarchical structure The default location for DTS files in the .Fx source repository is -.Pa sys/boot/fdt/dts +.Pa sys/dts directory. .It Va Device tree blob (DTB) The textual device tree description (DTS file) is first converted (compiled) @@ -156,7 +156,7 @@ kernel. The indicated DTS file will be converted (compiled) into a binary form along with building the kernel itself. The DTS file name is relative to the default location of DTS sources i.e. -.Pa sys/boot/fdt/dts . +.Pa sys/dts . This makeoption is not mandatory unless FDT_DTB_STATIC is also defined (see below). .It Va options FDT_DTB_STATIC diff --git a/share/man/man4/gpioiic.4 b/share/man/man4/gpioiic.4 index 2a9c8efee54e..ff3b9210eb3f 100644 --- a/share/man/man4/gpioiic.4 +++ b/share/man/man4/gpioiic.4 @@ -137,7 +137,7 @@ on the GPIO IIC bit-banging bus. For more details about the .Va gpios property, please consult -.Pa /usr/src/sys/boot/fdt/dts/bindings-gpio.txt . +.Pa /usr/src/sys/dts/bindings-gpio.txt . .It Va scl The .Va scl diff --git a/share/man/man4/gpioled.4 b/share/man/man4/gpioled.4 index 3fb4c4d64e9d..b5a313919b33 100644 --- a/share/man/man4/gpioled.4 +++ b/share/man/man4/gpioled.4 @@ -134,7 +134,7 @@ The only restriction is that a GPIO pin cannot be mapped by two different For more details about the .Va gpios property, please consult -.Pa /usr/src/sys/boot/fdt/dts/bindings-gpio.txt . +.Pa /usr/src/sys/dts/bindings-gpio.txt . .Pp The property .Va name diff --git a/share/man/man4/owc.4 b/share/man/man4/owc.4 index 62e5caf65341..43d6cb776ae4 100644 --- a/share/man/man4/owc.4 +++ b/share/man/man4/owc.4 @@ -68,7 +68,7 @@ to. For more details about the .Va gpios property, please consult -.Pa /usr/src/sys/boot/fdt/dts/bindings-gpio.txt . +.Pa /usr/src/sys/dts/bindings-gpio.txt . .Sh SEE ALSO .Xr gpiobus 4 , .Xr ow 4 , diff --git a/share/man/man5/forward.5 b/share/man/man5/forward.5 index 2234ff359091..78fa61b02577 100644 --- a/share/man/man5/forward.5 +++ b/share/man/man5/forward.5 @@ -93,5 +93,4 @@ The user's forwarding instructions. .El .Sh SEE ALSO .Xr aliases 5 , -.Xr mailaddr 7 , .Xr sendmail 8 diff --git a/share/man/man5/make.conf.5 b/share/man/man5/make.conf.5 index 5278c66bd8f5..e2b5d0c1b07c 100644 --- a/share/man/man5/make.conf.5 +++ b/share/man/man5/make.conf.5 @@ -374,7 +374,7 @@ By default the .Xr pxeboot 8 loader retrieves the kernel via NFS. Defining this and recompiling -.Pa /usr/src/sys/boot +.Pa /usr/src/stand will cause it to retrieve the kernel via TFTP. This allows .Xr pxeboot 8 @@ -385,7 +385,7 @@ rather than load the server's kernel. .It Va LOADER_FIREWIRE_SUPPORT .Pq Vt bool Defining this and recompiling -.Pa /usr/src/sys/boot/i386 +.Pa /usr/src/stand/i386 will add .Xr dcons 4 console driver to diff --git a/share/man/man7/Makefile b/share/man/man7/Makefile index cc4826242341..c6d03fd60082 100644 --- a/share/man/man7/Makefile +++ b/share/man/man7/Makefile @@ -22,7 +22,6 @@ MAN= arch.7 \ hostname.7 \ intro.7 \ maclabel.7 \ - mailaddr.7 \ operator.7 \ ports.7 \ release.7 \ diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7 index 82228ccff4a5..4d15b8683280 100644 --- a/share/man/man7/arch.7 +++ b/share/man/man7/arch.7 @@ -340,6 +340,103 @@ Architecture-specific macros: .It riscv64sf Ta Dv __riscv, Dv __riscv_xlen == 64 .It sparc64 Ta Dv __sparc64__ .El +.Ss Important Xr make 1 variables +Most of the externally settable variables are defined in the +.Xr build 7 +man page. +These variables are not otherwise documented and are used extensively +in the build system. +.Bl -column -offset indent "Sy Variable" "Sy Meaning and usage" +.It Dv MACHINE Represent the hardware platform. +This is the same as the native platform's +.Xr uname 1 +.Fl m +output. +It defines both the userland / kernel interface, as well as the +bootloader / kernel interface. +It should only be used in these contexts. +Each CPU architecture may have multiple hardware platforms it supports +where +.Dv MACHINE +differs among them. +It is used to collect together all the files from +.Xr config 8 +to build the kernel. +It is often the same as +.Dv MACHINE_ARCH +just as one CPU architecture can be implemented by many different +hardware platforms, one hardware platform may support multiple CPU +architecture family members, though with different binaries. +For example, +.Dv MACHINE +of i386 supported the IBM-AT hardware platform while the +.Dv MACHINE +of pc98 supported the Japanese company NEC's PC-9801 and PC-9821 +hardware platforms. +Both of these hardware platforms supported only the +.Dv MACHINE_ARCH +of i386 where they shared a common ABI, except for certain kernel / +userland interfaces relating to underlying hardware platform +differences in bus architecture, device enumeration and boot interface. +Generally, +.Dv MACHINE +should only be used in src/sys and src/stand or in system imagers or +installers. +.It Dv MACHINE_ARCH Represents the CPU processor architecture. +This is the same as the native platforms +.Xr uname 1 +.Fl p +output. +It defines the CPU instruction family supported. +It may also encode a variation in the byte ordering of multi-byte +integers (endian). +It may also encode a variation in the size of the integer or pointer. +It may also encode a ISA revision. +It may also encode hard versus soft floating point ABI and usage. +It may also encode a variant ABI when there other factors don't +uniquely define the ABI (eg, MIPS' n32 ABI). +It, along with +.Dv MACHINE, define the ABI used by the system. +For example, the MIPS CPU processor family supports 9 different +combinations encoding pointer size, endian and hard vs soft float (for +8 combinations) as well as N32 (which only ever had one variation of +all these). +Generally, the plain CPU name specifies the most common (or at least +first) variant of the CPU. +This is why mips and mips64 imply 'big endian' while 'arm' and 'armv7' +imply little endian. +If we ever were to support the so-called x32 ABI (using 32-bit +pointers on the amd64 architecture), it would most likely be encoded +as amd64-x32. +It is unfortunate that amd64 speifies the 64-bit evolution of the x86 +platform (it matches the 'first rule') as everybody else uses x86_64. +There is no standard name for the processor: each OS selects its own +conventions. +.It Dv MACHINE_CPUARCH Represents the source location for a given +.Dv MACHINE_ARCH . +For example, +.Dv MACHINE_CPUARCH +is defined to be mips for all the flavors of mips that we support +since we support them all with a shared set of sources. +One might thing that it should be x86 for both amd64 and i386. +However, since we don't support these two architectures with the same +source base, that's not done despite it's logical appeal. +.It Dv CPUTYPE Sets the flavor of +.Dv MACHINE_ARCH +to build. +It is used to optimize the build for a specific CPU / core that the +binaries run on. +Generally, this doesn't change the ABI, though it can be a fine line +between optimization for specific cases. +.It Dv TARGET Used to set Dv MACHINE in the top level Makefile for cross building. +Unused outside of that scope. +It is not passed down to the rest of the build. +Makefiles outside of the top level shouldn't use it at all (though +some have their own private copy for hysterical raisons). +.It Dv TARGET_ARCH Used to set Dv MACHINE_ARCH by Fx's top level Makefile for cross building. +Like +.Dv TARGET , it is unused outside of that scope. +.El .Sh SEE ALSO .Xr src.conf 5 , .Xr build 7 diff --git a/share/man/man7/hostname.7 b/share/man/man7/hostname.7 index 2068b55b4f68..083968f0edc1 100644 --- a/share/man/man7/hostname.7 +++ b/share/man/man7/hostname.7 @@ -82,7 +82,6 @@ by a system-wide configuration file (see .Sh SEE ALSO .Xr gethostbyname 3 , .Xr resolver 5 , -.Xr mailaddr 7 .Sh HISTORY .Nm Hostname appeared in diff --git a/share/man/man7/mailaddr.7 b/share/man/man7/mailaddr.7 deleted file mode 100644 index 5956f3417f53..000000000000 --- a/share/man/man7/mailaddr.7 +++ /dev/null @@ -1,158 +0,0 @@ -.\" Copyright (c) 1983, 1987, 1990, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" @(#)mailaddr.7 8.1 (Berkeley) 6/16/93 -.\" $FreeBSD$ -.\" -.Dd June 16, 1993 -.Dt MAILADDR 7 -.Os -.Sh NAME -.Nm mailaddr -.Nd mail addressing description -.Sh DESCRIPTION -Mail addresses are based on the Internet protocol listed at the end of this -manual page. -These addresses are in the general format -.Pp -.Dl user@domain -.Pp -where a domain is a hierarchical dot separated list of subdomains. -For -example, a valid address is: -.Pp -.Dl eric@CS.Berkeley.EDU -.Pp -Unlike some other forms of addressing, domains do not imply any routing. -Thus, although this address is specified as an Internet address, it might -travel by an alternate route if that were more convenient or efficient. -For example, at Berkeley, the associated message would probably go directly -to CS over the Ethernet rather than going via the Berkeley Internet -gateway. -.Ss Abbreviation. -Under certain circumstances it may not be necessary to type the entire -domain name. -In general, anything following the first dot may be omitted -if it is the same as the domain from which you are sending the message. -For example, a user on ``calder.berkeley.edu'' could send to ``eric@CS'' -without adding the ``berkeley.edu'' since it is the same on both sending -and receiving hosts. -.Ss Compatibility. -Certain old address formats are converted to the new format to provide -compatibility with the previous mail system. -In particular, -.Pp -.Dl user@host -.Pp -and -.Dl user@host.domain -.Pp -are allowed; -.Pp -.Dl host.domain!user -.Pp -is converted to -.Pp -.Dl user@host.domain -.Pp -and -.Pp -.Dl host!user -.Pp -is converted to -.Pp -.Dl user@host.UUCP -.Pp -This is normally converted back to the ``host!user'' form before being sent -on for compatibility with older UUCP hosts. -.Ss Case Distinctions. -Domain names (i.e., anything after the ``@'' sign) may be given in any mixture -of upper and lower case with the exception of UUCP hostnames. -Most hosts -accept any combination of case in user names, with the notable exception of -MULTICS sites. -.Ss Route-addrs. -Under some circumstances it may be necessary to route a message through -several hosts to get it to the final destination. -Normally this routing -is done automatically, but sometimes it is desirable to route the message -manually. -Addresses which show these relays are termed ``route-addrs.'' -These use the syntax: -.Pp -.Dl <@hosta,@hostb:user@hostc> -.Pp -This specifies that the message should be sent to hosta, from there to hostb, -and finally to hostc. -This path is forced even if there is a more efficient -path to hostc. -.Pp -Route-addrs occur frequently on return addresses, since these are generally -augmented by the software at each host. -It is generally possible to ignore -all but the ``user@hostc'' part of the address to determine the actual -sender. -.Pp -[Note: the route-addr syntax is officially deprecated -in RFC 1123 and should not be used.] -.Pp -Many sites also support the ``percent hack'' for simplistic routing: -.Pp -.Dl user%hostc%hostb@hosta -.Pp -is routed as indicated in the previous example. -.Ss Postmaster. -Every site is required to have a user or user alias designated ``postmaster'' -to which problems with the mail system may be addressed. -.Ss Other Networks. -Some other networks can be reached by giving the name of the network as the -last component of the domain. -.Em This is not a standard feature -and may -not be supported at all sites. -For example, messages to CSNET or BITNET sites -can often be sent to ``user@host.CSNET'' or ``user@host.BITNET'' respectively. -.Sh SEE ALSO -.Xr mail 1 , -.Xr sendmail 8 -.Rs -.%A Crocker, D. H. -.%T Standard for the Format of Arpa Internet Text Messages -.%O RFC822 -.Re -.Sh HISTORY -.Nm Mailaddr -appeared in -.Bx 4.2 . -.Sh BUGS -The RFC822 group syntax (``group:user1,user2,user3;'') is not supported -except in the special case of ``group:;'' because of a conflict with old -berknet-style addresses. -.Pp -Route-Address syntax is grotty. -.Pp -UUCP- and Internet-style addresses do not coexist politely. diff --git a/share/man/man8/diskless.8 b/share/man/man8/diskless.8 index 3fcbc25c727f..668ba21fb169 100644 --- a/share/man/man8/diskless.8 +++ b/share/man/man8/diskless.8 @@ -124,7 +124,7 @@ the .Nm machine, which may not be what you want to have happen. .Bd -literal -offset indent -cd /usr/src/sys/boot/i386 +cd /usr/src/stand/i386 make clean; make; make install cp /boot/pxeboot /tftpdir/ .Ed diff --git a/share/misc/Makefile b/share/misc/Makefile index 04277aa2bdf9..68f8b4f0cb8a 100644 --- a/share/misc/Makefile +++ b/share/misc/Makefile @@ -6,7 +6,7 @@ .PATH: ${.CURDIR}/../../sys/dev/usb FILES= ascii birthtoken bsd-family-tree committers-doc.dot committers-ports.dot \ - committers-src.dot eqnchar flowers init.ee \ + committers-src.dot flowers init.ee \ iso3166 iso639 latin1 mdoc.template operator pci_vendors \ scsi_modes \ organization.dot diff --git a/share/misc/eqnchar b/share/misc/eqnchar deleted file mode 100644 index b9339746d1eb..000000000000 --- a/share/misc/eqnchar +++ /dev/null @@ -1,90 +0,0 @@ -.EQ -tdefine ciplus % "\o'\(pl\(ci'" % -ndefine ciplus % O+ % -tdefine citimes % "\o'\(mu\(ci'" % -ndefine citimes % Ox % -tdefine =wig % "\(eq\h'-\w'\(eq'u-\w'\s-2\(ap'u/2u'\v'-.4m'\s-2\z\(ap\(ap\s+2\v'.4m'\h'\w'\(eq'u-\w'\s-2\(ap'u/2u'" % -ndefine =wig % ="~" % -tdefine bigstar % "\o'\(pl\(mu'" % -ndefine bigstar % X|- % -tdefine =dot % "\z\(eq\v'-.6m'\h'.2m'\s+2.\s-2\v'.6m'\h'.1m'" % -ndefine =dot % = dot % -tdefine orsign % "\s-2\v'-.15m'\z\e\e\h'-.05m'\z\(sl\(sl\v'.15m'\s+2" % -ndefine orsign % \e/ % -tdefine andsign % "\s-2\v'-.15m'\z\(sl\(sl\h'-.05m'\z\e\e\v'.15m'\s+2" % -ndefine andsign % /\e % -tdefine =del % "\v'.3m'\z=\v'-.6m'\h'.3m'\s-1\(*D\s+1\v'.3m'" % -ndefine =del % = to DELTA % -tdefine oppA % "\s-2\v'-.15m'\z\e\e\h'-.05m'\z\(sl\(sl\v'-.15m'\h'-.75m'\z-\z-\h'.2m'\z-\z-\v'.3m'\h'.4m'\s+2" % -ndefine oppA % V- % -tdefine oppE %"\s-3\v'.2m'\z\(em\v'-.5m'\z\(em\v'-.5m'\z\(em\v'.55m'\h'.9m'\z\(br\z\(br\v'.25m'\s+3" % -ndefine oppE % E/ % -tdefine incl % "\s-1\z\(or\h'-.1m'\v'-.45m'\z\(em\v'.7m'\z\(em\v'.2m'\(em\v'-.45m'\s+1" % -ndefine incl % C_ % -tdefine nomem % "\o'\(mo\(sl'" % -ndefine nomem % C-/ % -tdefine angstrom % "\fR\zA\v'-.3m'\h'.2m'\(de\v'.3m'\fP\h'.2m'" % -ndefine angstrom % A to o % -tdefine star %{ roman "\v'.5m'\s+3*\s-3\v'-.5m'"}% -ndefine star % * % -tdefine || % \(or\(or % -tdefine wig % "\z>\v'.4m'\(ap\v'-.4m'" % -ndefine >wig %{ > from "~" }% -tdefine langle % "\s-3\b'\(sl\e'\s0" % -ndefine langle %<% -tdefine rangle % "\s-3\b'\e\(sl'\s0" % -ndefine rangle %>% -tdefine hbar % "\zh\v'-.6m'\h'.05m'\(ru\v'.6m'" % -ndefine hbar % h\u-\d % -ndefine ppd % _| % -tdefine ppd % "\o'\(ru\s-2\(or\s+2'" % -tdefine <-> % "\o'\(<-\(->'" % -ndefine <-> % "<-->" % -tdefine <=> % "\s-2\z<\v'.05m'\h'.2m'\z=\h'.55m'=\h'-.6m'\v'-.05m'>\s+2" % -ndefine <=> % "<=>" % -tdefine |< % "\o'<\(or'" % -ndefine |< % <| % -tdefine |> % "\o'>\(or'" % -ndefine |> % |> % -tdefine ang % "\v'-.15m'\z\s-2\(sl\s+2\v'.15m'\(ru" % -ndefine ang % /_ % -tdefine rang % "\z\(or\h'.15m'\(ru" % -ndefine rang % L % -tdefine 3dot % "\v'-.8m'\z.\v'.5m'\z.\v'.5m'.\v'-.2m'" % -ndefine 3dot % .\u.\u.\d\d % -tdefine thf % ".\v'-.5m'.\v'.5m'." % -ndefine thf % ..\u.\d % -tdefine quarter % roman \(14 % -ndefine quarter % 1/4 % -tdefine 3quarter % roman \(34 % -ndefine 3quarter % 3/4 % -tdefine degree % \(de % -ndefine degree % nothing sup o % -tdefine square % \(sq % -ndefine square % [] % -tdefine circle % \(ci % -ndefine circle % O % -tdefine blot % "\fB\(sq\fP" % -ndefine blot % HIX % -tdefine bullet % \(bu % -ndefine bullet % oxe % -tdefine -wig % "\(~=" % -ndefine -wig % - to "~" % -tdefine wig % \(ap % -ndefine wig % "~" % -tdefine prop % \(pt % -ndefine prop % oc % -tdefine empty % \(es % -ndefine empty % O/ % -tdefine member % \(mo % -ndefine member % C- % -tdefine cup % \(cu % -ndefine cup % U % -define cap % \(ca % -define subset % \(sb % -define supset % \(sp % -define !subset % \(ib % -define !supset % \(ip % -.EN diff --git a/share/misc/pci_vendors b/share/misc/pci_vendors index 83283e8b1ae7..e2ce2afd4444 100644 --- a/share/misc/pci_vendors +++ b/share/misc/pci_vendors @@ -3,8 +3,8 @@ # # List of PCI ID's # -# Version: 2017.09.01 -# Date: 2017-09-01 03:15:02 +# Version: 2017.10.21 +# Date: 2017-10-21 03:15:01 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -79,18 +79,18 @@ 0b0b Rhino Equipment Corp. 0105 R1T1 0205 R4FXO - 0206 RCB4FXO 4-channel FXO analog telphony card + 0206 RCB4FXO 4-channel FXO analog telephony card 0305 R4T1 0405 R8FXX - 0406 RCB8FXX 8-channel modular analog telphony card + 0406 RCB8FXX 8-channel modular analog telephony card 0505 R24FXX - 0506 RCB24FXS 24-Channel FXS analog telphony card + 0506 RCB24FXS 24-Channel FXS analog telephony card 0605 R2T1 0705 R24FXS - 0706 RCB24FXO 24-Channel FXO analog telphony card + 0706 RCB24FXO 24-Channel FXO analog telephony card 0905 R1T3 Single T3 Digital Telephony Card - 0906 RCB24FXX 24-channel modular analog telphony card - 0a06 RCB672FXX 672-channel modular analog telphony card + 0906 RCB24FXX 24-channel modular analog telephony card + 0a06 RCB672FXX 672-channel modular analog telephony card 0e11 Compaq Computer Corporation 0001 PCI to EISA Bridge 0002 PCI to ISA Bridge @@ -251,6 +251,9 @@ 1028 1fd4 PERC H745P MX 1d49 0602 ThinkSystem RAID 930-16i 4GB Flash PCIe 12Gb Adapter 1d49 0604 ThinkSystem RAID 930-8e 4GB Flash PCIe 12Gb Adapter + 8086 352d Integrated RAID Module RMSP3AD160F + 8086 9460 RAID Controller RSP3TD160F + 8086 9480 RAID Controller RSP3MD088F 0015 MegaRAID Tri-Mode SAS3416 0016 MegaRAID Tri-Mode SAS3508 1028 1fc9 PERC H840 Adapter @@ -260,9 +263,15 @@ 1d49 0601 ThinkSystem RAID 930-8i 2GB Flash PCIe 12Gb Adapter 1d49 0603 ThinkSystem RAID 930-24i 4GB Flash PCIe 12Gb Adapter 1d49 0604 ThinkSystem RAID 930-8e 4GB Flash PCIe 12Gb Adapter + 8086 352e Integrated RAID Module RMSP3CD080F + 8086 352f Integrated RAID Module RMSP3HD080E + 8086 9461 RAID Controller RSP3DD080F 0017 MegaRAID Tri-Mode SAS3408 1d49 0500 ThinkSystem RAID 530-8i PCIe 12Gb Adapter 1d49 0502 ThinkSystem RAID 530-8i Dense Adapter + 8086 3528 Integrated RAID RMSP3LD060 + 8086 3529 Integrated RAID RMSP3LD060 + 8086 9441 RAID Controller RSP3WD080E 001b MegaRAID Tri-Mode SAS3504 1d49 0605 ThinkSystem RAID 930-4i 2GB Flash Flex Adapter 001c MegaRAID Tri-Mode SAS3404 @@ -586,9 +595,12 @@ 1028 1fd3 HBA330 MMZ 1bd4 0011 Inspur 12Gb 8i-3008 IT SAS HBA 00ab SAS3516 Fusion-MPT Tri-Mode RAID On Chip (ROC) + 8086 3530 Integrated RAID Module RMSP3JD160J 00ac SAS3416 Fusion-MPT Tri-Mode I/O Controller Chip (IOC) 1d49 0201 ThinkSystem 430-16i SAS/SATA 12Gb HBA 1d49 0203 ThinkSystem 430-16e SAS/SATA 12Gb HBA + 8086 3000 RAID Controller RSP3QD160J + 8086 3020 RAID Controller RSP3GD016J 00ae SAS3508 Fusion-MPT Tri-Mode RAID On Chip (ROC) 00af SAS3408 Fusion-MPT Tri-Mode I/O Controller Chip (IOC) 1d49 0200 ThinkSystem 430-8i SAS/SATA 12Gb HBA @@ -614,6 +626,9 @@ 00d0 SAS3716 Fusion-MPT Tri-Mode RAID Controller Chip (ROC) 00d1 SAS3616 Fusion-MPT Tri-Mode I/O Controller Chip (IOC) 00d3 MegaRAID Tri-Mode SAS3716W + 02b0 Virtual Endpoint on PCIe Switch + 1d49 0001 ThinkSystem 1610-4P NVMe Switch Adapter + 1d49 0002 ThinkSystem 810-4P NVMe Switch Adapter 0407 MegaRAID 1000 0530 MegaRAID 530 SCSI 320-0X RAID Controller 1000 0531 MegaRAID 531 SCSI 320-4X RAID Controller @@ -904,6 +919,7 @@ 1043 836c M4A785TD Motherboard 1043 8410 M4A89GTD PRO/USB3 Motherboard 1043 841b M5A88-V EVO + 105b 0e13 N15235/A74MX mainboard / AMD SB700 1179 ff50 Satellite P305D-S8995E 1458 a022 GA-MA770-DS3rev2.0 Motherboard 17f2 5000 KI690-AM2 Motherboard @@ -914,6 +930,7 @@ 103c 280a DC5750 Microtower 1043 82ef M3A78-EH Motherboard 1043 8389 M4A785TD Motherboard + 105b 0e13 N15235/A74MX mainboard / AMD SB700 1179 ff50 Satellite P305D-S8995E 1458 4385 GA-MA770-DS3rev2.0 Motherboard 1462 7368 K9AG Neo2 @@ -965,14 +982,17 @@ 4390 SB7x0/SB8x0/SB9x0 SATA Controller [IDE mode] 1043 82ef M3A78-EH Motherboard 1043 8389 M4A785TD Motherboard + 105b 0e13 N15235/A74MX mainboard / AMD SB700 1458 b002 GA-MA770-DS3rev2.0 Motherboard 1849 4390 Motherboard (one of many) 4391 SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] 103c 1611 Pavilion DM1Z-3000 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO + 105b 0e13 N15235/A74MX mainboard / AMD SB700 174b 1001 PURE Fusion Mini 4392 SB7x0/SB8x0/SB9x0 SATA Controller [Non-RAID5 mode] + 105b 0e13 N15235/A74MX mainboard / AMD SB700 4393 SB7x0/SB8x0/SB9x0 SATA Controller [RAID5 mode] 4394 SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] 4395 SB8x0/SB9x0 SATA Controller [Storage mode] @@ -981,6 +1001,7 @@ 103c 1611 Pavilion DM1Z-3000 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO + 105b 0e13 N15235/A74MX mainboard / AMD SB700 15d9 a811 H8DGU 174b 1001 PURE Fusion Mini 4397 SB7x0/SB8x0/SB9x0 USB OHCI0 Controller @@ -988,25 +1009,30 @@ 103c 1611 Pavilion DM1Z-3000 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO + 105b 0e13 N15235/A74MX mainboard / AMD SB700 15d9 a811 H8DGU 174b 1001 PURE Fusion Mini 4398 SB7x0 USB OHCI1 Controller 1019 2120 A785GM-M 1043 82ef M3A78-EH Motherboard + 105b 0e13 N15235/A74MX mainboard / AMD SB700 15d9 a811 H8DGU 4399 SB7x0/SB8x0/SB9x0 USB OHCI2 Controller 1019 2120 A785GM-M 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO + 105b 0e13 N15235/A74MX mainboard / AMD SB700 174b 1001 PURE Fusion Mini 439c SB7x0/SB8x0/SB9x0 IDE Controller 1019 2120 A785GM-M 1043 82ef M3A78-EH Motherboard + 105b 0e13 N15235/A74MX mainboard / AMD SB700 439d SB7x0/SB8x0/SB9x0 LPC host controller 1019 2120 A785GM-M 103c 1611 Pavilion DM1Z-3000 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO + 105b 0e13 N15235/A74MX mainboard / AMD SB700 174b 1001 PURE Fusion Mini 43a0 SB700/SB800/SB900 PCI to PCI bridge (PCIE port 0) 43a1 SB700/SB800/SB900 PCI to PCI bridge (PCIE port 1) @@ -1574,6 +1600,7 @@ 103c 8006 FirePro M4170 17aa 3643 Radeon R7 A360 6605 Opal PRO [Radeon R7 M260] + 103c 2259 FirePro M4150 6606 Mars XTX [Radeon HD 8790M] 1028 0684 FirePro W4170M 6607 Mars LE [Radeon HD 8530M / R5 M240] @@ -1637,12 +1664,13 @@ 1462 2938 Radeon R9 360 OEM 1462 3271 Radeon R9 360 OEM 1682 7360 Radeon R7 360 - 6660 Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430] + 6660 Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / R7 M520] 1028 05ea Radeon HD 8670M 1028 06bf Radeon R5 M335 103c 1970 Radeon HD 8670M 103c 80be Radeon R5 M330 103c 8136 Radeon R5 M330 + 103c 8329 Radeon R7 M520 17aa 3804 Radeon R5 M330 17aa 3809 Radeon R5 M330 17aa 381a Radeon R5 M430 @@ -2164,6 +2192,7 @@ # GV-R928XOC-3GD 1458 3001 Tahiti XTL [Radeon R9 280X OC] 1462 2774 MSI R7970 TF 3GD5/OC BE + 1682 3001 Tahiti XTL [Radeon R9 280X] 1682 3211 Double D HD 7970 Black Edition # FX-797A-TNBC 1682 3213 HD 7970 Black Edition @@ -2271,7 +2300,13 @@ 67e8 Baffin [Polaris11] 67e9 Baffin [Polaris11] 67eb Baffin [Polaris11] - 67ef Baffin [Radeon RX 460] + 67ef Baffin [Radeon RX 460/560D / Pro 450/455/460/560] + 106b 0160 Radeon Pro 460 + 106b 0166 Radeon Pro 455 + 106b 0167 Radeon Pro 450 + 106b 0179 Radeon Pro 560 + 1642 1727 Polaris 21 XL [Radeon RX 560D] + 1682 956d Polaris 21 XL [Radeon RX 560D] 67ff Baffin [Radeon RX 560] 6800 Wimbledon XT [Radeon HD 7970M] 1002 0124 Radeon HD 7970M @@ -3120,8 +3155,9 @@ 7910 RS690 Host Bridge 1179 ff50 Satellite P305D-S8995E 17f2 5000 KI690-AM2 Motherboard - 7911 RS690 Host Bridge - 7912 RS690 PCI to PCI Bridge (Internal gfx) + 7911 RS690/RS740 Host Bridge + 1002 7910 RS690/RS740 Host Bridge + 7912 RS690/RS740 PCI to PCI Bridge (Internal gfx) 7913 RS690 PCI to PCI Bridge (PCI Express Graphics Port 0) 7915 RS690 PCI to PCI Bridge (PCI Express Port 1) 7916 RS690 PCI to PCI Bridge (PCI Express Port 2) @@ -3146,6 +3182,7 @@ 7941 RS600 [Radeon Xpress 1250] 7942 RS600M [Radeon Xpress 1250] 796e RS740 [Radeon 2100] + 105b 0e13 N15235/A74MX mainboard 9400 R600 [Radeon HD 2900 PRO/XT] 1002 2552 Radeon HD 2900 XT 1002 3000 Radeon HD 2900 PRO @@ -3363,6 +3400,7 @@ 9840 Kabini HDMI/DP Audio 9850 Mullins [Radeon R3 Graphics] 9851 Mullins [Radeon R4/R5 Graphics] + 1179 f928 Beema [Radeon R5 Graphics] 9852 Mullins [Radeon R2 Graphics] 9853 Mullins [Radeon R2 Graphics] 9854 Mullins [Radeon R3E Graphics] @@ -4004,8 +4042,23 @@ 1437 Liverpool I/O Memory Management Unit 1438 Liverpool Processor Root Port 1439 Family 16h Processor Functions 5:1 + 1450 Family 17h (Models 00h-0fh) Root Complex + 1451 Family 17h (Models 00h-0fh) I/O Memory Management Unit + 1452 Family 17h (Models 00h-0fh) PCIe Dummy Host Bridge + 1454 Family 17h (Models 00h-0fh) Internal PCIe GPP Bridge 0 to Bus B + 1456 Family 17h (Models 00h-0fh) Platform Security Processor + 1457 Family 17h (Models 00h-0fh) HD Audio Controller 145b Zeppelin Non-Transparent Bridge - 145c USB3 Host Controller + 145c Family 17h (Models 00h-0fh) USB 3.0 Host Controller + 145f USB 3.0 Host controller + 1460 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 0 + 1461 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 1 + 1462 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 2 + 1463 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 3 + 1464 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 4 + 1465 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 5 + 1466 Family 17h (Models 00h-0fh) Data Fabric Device 18h Function 6 + 1467 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 7 1510 Family 14h Processor Root Complex 174b 1001 PURE Fusion Mini 1512 Family 14h Processor Root Port @@ -4090,7 +4143,9 @@ 43a1 Hudson PCI to PCI bridge (PCIE port 1) 43a2 Hudson PCI to PCI bridge (PCIE port 2) 43a3 Hudson PCI to PCI bridge (PCIE port 3) - 43bb USB 3.1 XHCI Controller + 43b4 300 Series Chipset PCIe Port + 43b7 300 Series Chipset SATA Controller + 43bb 300 Series Chipset USB 3.1 xHCI Controller 7006 AMD-751 [Irongate] System Controller 7007 AMD-751 [Irongate] AGP Bridge 700a AMD-IGR4 AGP Host to PCI Bridge @@ -4545,6 +4600,7 @@ 0533 MGA G200EH 103c 3381 iLO4 0534 G200eR2 + 0536 Integrated Matrox G200eW3 Graphics Controller 0538 G200eH 1590 00e4 iLO5 VGA 0540 M91XX @@ -4585,7 +4641,7 @@ 102b 0f84 Millennium G550 Dual Head DDR 32Mb 102b 1e41 Millennium G550 102b 2300 Millennium G550 LP PCIE - 2537 Millenium P650/P750 + 2537 Millennium P650/P750 102b 1820 Millennium P750 64MB 102b 1830 Millennium P650 64MB 102b 1850 RAD2mp @@ -4593,7 +4649,7 @@ 102b 1880 Sono S10 102b 1c10 QID 128MB 102b 2811 Millennium P650 Low-profile PCI 64MB - 102b 2821 Millenium P650 Low-profile PCI + 102b 2821 Millennium P650 Low-profile PCI 102b 2841 RAD PCI 102b 2851 Spectrum PCI 102b 2871 EpicA TC2 @@ -4607,7 +4663,7 @@ 102b 3051 RG-400SL 102b 3061 Extio F1420 102b 3081 Extio F1240 - 2538 Millenium P650 PCIe + 2538 Millennium P650 PCIe 102b 0847 RAD PCIe 102b 08c7 Millennium P650 PCIe 128MB 102b 0907 Millennium P650 PCIe 64MB @@ -4615,23 +4671,23 @@ 102b 0987 ATC PCIe 4MP 102b 1047 Millennium P650 LP PCIe 128MB 102b 1087 Millennium P650 LP PCIe 64MB - 102b 1801 Millenium P650 PCIe x1 + 102b 1801 Millennium P650 PCIe x1 102b 2538 Parhelia APVe 102b 3007 QID Low-profile PCIe 102b 3087 Aurora VX3mp 102b 30c7 QID LP PCIe 2539 Millennium P690 - 102b 0040 Millenium P690 PCIe x16 + 102b 0040 Millennium P690 PCIe x16 102b 0042 ONYX 102b 0043 SPECTRA - 102b 0080 Millenium P690 Plus LP PCIe x16 - 102b 0081 Millenium P690 LP PCIe x16 + 102b 0080 Millennium P690 Plus LP PCIe x16 + 102b 0081 Millennium P690 LP PCIe x16 102b 0082 RAD LPX PCIe x16 - 102b 00c0 Millenium P690 Plus LP PCI - 102b 00c2 Millenium P690 LP PCI + 102b 00c0 Millennium P690 Plus LP PCI + 102b 00c2 Millennium P690 LP PCI 102b 00c3 RAD LPX PCI - 102b 0101 Millenium P690 PCI - 102b 0140 Millenium P690 LP PCIe x1 + 102b 0101 Millennium P690 PCI + 102b 0140 Millennium P690 LP PCIe x1 102b 0180 Display Wall IP Decode 128 MB 4164 Morphis QxT frame grabber 43b4 Morphis Qxt encoding engine @@ -5146,11 +5202,9 @@ 3308 Integrated Lights-Out Standard MS Watchdog Timer 103c 330e iLO3 103c 3381 iLO4 - 402f PCIe Root Port 4030 zx2 System Bus Adapter 4031 zx2 I/O Controller 4037 PCIe Local Bus Adapter - 403b PCIe Root Port 103e Solliday Engineering 103f Synopsys/Logic Modeling Group 1040 Accelgraphics Inc. @@ -5167,7 +5221,6 @@ 0675 1704 ISDN Adapter (PCI Bus, D, C) 0675 1707 ISDN Adapter (PCI Bus, DV, W) 10cf 105e ISDN Adapter (PCI Bus, DV, W) - 13a0 Transformer Book T101HA-GR030R # Should be 1022:9602 9602 AMD RS780/RS880 PCI to PCI bridge (int gfx) 1043 83a2 M4A785TD Motherboard @@ -6132,6 +6185,7 @@ 1077 015e QLE2564 PCI Express to 8Gb FC Quad Channel 1077 0167 QME2572 Dual Port FC8 HBA Mezzanine 1590 00fc StoreFabric 84Q 8Gb Quad Port Fibre Channel Host Bus Adapter + 2971 ISP2684 3022 ISP4022-based Ethernet NIC 3032 ISP4032-based Ethernet IPv6 NIC 4010 ISP4010-based iSCSI TOE HBA @@ -9234,19 +9288,19 @@ 0533 C67 [GeForce 7000M / nForce 610M] 053a C68 [GeForce 7050 PV / nForce 630a] 053b C68 [GeForce 7050 PV / nForce 630a] - 1043 8308 M2N68-AM Motherbord + 1043 8308 M2N68-AM Motherboard 053e C68 [GeForce 7025 / nForce 630a] 0541 MCP67 Memory Controller 0542 MCP67 SMBus - 1043 8308 M2N68-AM Motherbord + 1043 8308 M2N68-AM Motherboard 0543 MCP67 Co-processor 0547 MCP67 Memory Controller - 1043 8308 M2N68-AM Motherbord + 1043 8308 M2N68-AM Motherboard 1849 0547 ALiveNF7G-HDready 0548 MCP67 ISA Bridge 1043 8308 M2N68-AM Motherboard 054c MCP67 Ethernet - 1043 8308 M2N68-AM Motherbord + 1043 8308 M2N68-AM Motherboard 1849 054c ALiveNF7G-HDready, MCP67 Gigabit Ethernet 054d MCP67 Ethernet 054e MCP67 Ethernet @@ -9936,7 +9990,7 @@ 0dc0 GF106 [GeForce GT 440] 0dc4 GF106 [GeForce GTS 450] 0dc5 GF106 [GeForce GTS 450 OEM] - 0dc6 GF106 [GeForce GTS 450] + 0dc6 GF106 [GeForce GTS 450 OEM] 0dcd GF106M [GeForce GT 555M] 0dce GF106M [GeForce GT 555M] 0dd1 GF106M [GeForce GTX 460M] @@ -9956,7 +10010,7 @@ 0de5 GF108 [GeForce GT 530] 0de7 GF108 [GeForce GT 610] 0de8 GF108M [GeForce GT 620M] - 0de9 GF108M [GeForce GT 630M] + 0de9 GF108M [GeForce GT 620M/630M/635M/640M LE] 1025 0692 GeForce GT 620M 1025 0725 GeForce GT 620M 1025 0728 GeForce GT 620M @@ -10177,7 +10231,7 @@ 1086 GF110 [GeForce GTX 570 Rev. 2] 1087 GF110 [GeForce GTX 560 Ti 448 Cores] 1088 GF110 [GeForce GTX 590] - 1089 GF110 [GeForce GTX 580] + 1089 GF110 [GeForce GTX 580 Rev. 2] 108b GF110 [GeForce GTX 580] 108e GF110GL [Tesla C2090] 1091 GF110GL [Tesla M2090] @@ -10301,12 +10355,31 @@ 1028 065e GeForce 820M 1028 0662 GeForce 820M 1028 068d GeForce 820M + 1028 06ad GeForce 820M + 1028 06ae GeForce 820M + 1028 06af GeForce 820M + 1028 06b0 GeForce 820M + 1028 06c0 GeForce 820M 1028 06c1 GeForce 820M 103c 18ef GeForce GT 630M 103c 18f9 GeForce GT 630M 103c 18fb GeForce GT 630M 103c 18fd GeForce GT 630M 103c 18ff GeForce GT 630M + 103c 218a GeForce 820M + 103c 21bb GeForce 820M + 103c 21bc GeForce 820M + 103c 220e GeForce 820M + 103c 2210 GeForce 820M + 103c 2212 GeForce 820M + 103c 2214 GeForce 820M + 103c 2218 GeForce 820M + 103c 225b GeForce 820M + 103c 225d GeForce 820M + 103c 226d GeForce 820M + 103c 226f GeForce 820M + 103c 22d2 GeForce 820M + 103c 22d9 GeForce 820M 103c 2335 GeForce 820M 103c 2337 GeForce 820M 103c 2aef GeForce GT 720A @@ -10344,6 +10417,7 @@ 1043 228a GeForce 820M 1043 232a GeForce 820M 1043 233a GeForce 820M + 1043 235a GeForce 820M 1043 236a GeForce 820M 1043 238a GeForce 820M 1043 8595 GeForce GT 720M @@ -10359,6 +10433,8 @@ 1043 8643 GeForce 820M 1043 864c GeForce 820M 1043 8652 GeForce 820M + 1043 8660 GeForce 820M + 1043 8661 GeForce 820M 105b 0dac GeForce GT 720M 105b 0dad GeForce GT 720M 105b 0ef3 GeForce GT 720M @@ -10433,8 +10509,10 @@ 17aa 309c GeForce GT 720A 17aa 30b4 GeForce 820A 17aa 30b7 GeForce 720A + 17aa 30e4 GeForce 820A 17aa 361b GeForce 820A 17aa 361c GeForce 820A + 17aa 361d GeForce 820A 17aa 3656 GeForce GT 620M 17aa 365a GeForce 705M 17aa 365e GeForce 800M @@ -10644,10 +10722,10 @@ 1282 GK208 [GeForce GT 640 Rev. 2] 1284 GK208 [GeForce GT 630 Rev. 2] 1286 GK208 [GeForce GT 720] - 1287 GK208 [GeForce GT 730] - 1288 GK208 [GeForce GT 720] + 1287 GK208B [GeForce GT 730] + 1288 GK208B [GeForce GT 720] 1289 GK208 [GeForce GT 710] - 128b GK208 [GeForce GT 710B] + 128b GK208B [GeForce GT 710] 1290 GK208M [GeForce GT 730M] 103c 2afa GeForce GT 730A 103c 2b04 GeForce GT 730A @@ -10671,11 +10749,12 @@ 17aa 367c GeForce 710A 1296 GK208M [GeForce 825M] 1298 GK208M [GeForce GT 720M] - 1299 GK208M [GeForce 920M] + 1299 GK208BM [GeForce 920M] 17aa 30bb GeForce 920A + 17aa 30df GeForce 920A 17aa 36a7 GeForce 920A 17aa 36af GeForce 920M - 129a GK208M [GeForce 910M] + 129a GK208BM [GeForce 910M] 12a0 GK208 12b9 GK208GLM [Quadro K610M] 12ba GK208GLM [Quadro K510M] @@ -10692,6 +10771,7 @@ 1349 GM108M [GeForce 930M] 134b GM108M [GeForce 940MX] 134d GM108M [GeForce 940MX] + 17aa 2248 ThinkPad T570 134e GM108M [GeForce 930MX] 134f GM108M [GeForce 920MX] 137a GM108GLM [Quadro K620M / Quadro M500M] @@ -10741,7 +10821,7 @@ 13d7 GM204M [GeForce GTX 980M] 13d8 GM204M [GeForce GTX 970M] 13d9 GM204M [GeForce GTX 965M] - 13da GM204M [GeForce GTX 980] + 13da GM204M [GeForce GTX 980 Mobile] 13e7 GM204 [GeForce GTX 980 Engineering Sample] 13f0 GM204GL [Quadro M5000] 13f1 GM204GL [Quadro M4000] @@ -10754,7 +10834,7 @@ 13fb GM204GLM [Quadro M5500] 1401 GM206 [GeForce GTX 960] 1402 GM206 [GeForce GTX 950] - 1406 GM206 [GeForce GTX 960] + 1406 GM206 [GeForce GTX 960 OEM] 1407 GM206 [GeForce GTX 750 v2] 1427 GM206M [GeForce GTX 965M] 1430 GM206GL [Quadro M2000] @@ -10764,7 +10844,7 @@ 15f1 GP100GL 15f7 GP100GL [Tesla P100 PCIe 12GB] 15f8 GP100GL [Tesla P100 PCIe 16GB] - 15f9 GP100GL [Tesla P100 SMX2 16GB] + 15f9 GP100GL [Tesla P100 SXM2 16GB] 1617 GM204M [GeForce GTX 980M] 1618 GM204M [GeForce GTX 970M] 1619 GM204M [GeForce GTX 965M] @@ -10794,14 +10874,23 @@ 1b87 GP104 [P104-100] 1ba0 GP104M [GeForce GTX 1080 Mobile] 1ba1 GP104M [GeForce GTX 1070 Mobile] + 1458 1651 GeForce GTX 1070 Max-Q + 1462 11e8 GeForce GTX 1070 Max-Q + 1462 11e9 GeForce GTX 1070 Max-Q + 1558 9501 GeForce GTX 1070 Max-Q + 1bad GP104 [GeForce GTX 1070 Engineering Sample] 1bb0 GP104GL [Quadro P5000] 1bb1 GP104GL [Quadro P4000] 1bb3 GP104GL [Tesla P4] 1bb4 GP104GL + 1bb5 GP104GLM [Quadro P5200 Mobile] 1bb6 GP104GLM [Quadro P5000 Mobile] 1bb7 GP104GLM [Quadro P4000 Mobile] + 1462 11e9 Quadro P4000 Max-Q 1bb8 GP104GLM [Quadro P3000 Mobile] 1be0 GP104M [GeForce GTX 1080 Mobile] + 1028 07c0 GeForce GTX 1080 Max-Q + 1458 355b GeForce GTX 1080 Max-Q 1be1 GP104M [GeForce GTX 1070 Mobile] 1c00 GP106 1c01 GP106 @@ -10810,9 +10899,13 @@ 1c07 GP106 [P106-100] 1c09 GP106 [P106-090] 1c20 GP106M [GeForce GTX 1060 Mobile] + 17aa 39b9 GeForce GTX 1060 Max-Q 3GB + 1c21 GP106M [GeForce GTX 1050 Ti Mobile] + 1c22 GP106M [GeForce GTX 1050 Mobile] 1c30 GP106GL [Quadro P2000] 1c35 GP106 - 1c60 GP106M [GeForce GTX 1060 Mobile] + 1c60 GP106M [GeForce GTX 1060 Mobile 6GB] + 103c 8390 GeForce GTX 1060 Max-Q 6GB 1c61 GP106M [GeForce GTX 1050 Ti Mobile] 1c62 GP106M [GeForce GTX 1050 Mobile] 1c70 GP106GL @@ -10831,6 +10924,8 @@ 1d01 GP108 [GeForce GT 1030] 1d10 GP108M [GeForce MX150] 1d81 GV100 + 1db1 GV100 [Tesla V100 SXM2] + 1db4 GV100 [Tesla V100 PCIe] 10df Emulex Corporation 0720 OneConnect NIC (Skyhawk) 103c 1934 FlexFabric 20Gb 2-port 650M Adapter @@ -10888,6 +10983,9 @@ f111 Saturn-X LightPulse Fibre Channel Host Adapter f112 Saturn-X LightPulse Fibre Channel Host Adapter f180 LPSe12002 EmulexSecure Fibre Channel Adapter + f400 LPe36000 Fibre Channel Host Adapter [Prism] + 10df f401 LPe35000 Fibre Channel Host Adapter [Prism] + 10df f402 LPe35000 Fibre Channel Host Adapter [Prism] f700 LP7000 Fibre Channel Host Adapter f701 LP7000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2) f800 LP8000 Fibre Channel Host Adapter @@ -11026,8 +11124,8 @@ 8129 RTL-8129 10ec 8129 RT8129 Fast Ethernet Adapter 11ec 8129 RTL8111/8168 PCIe Gigabit Ethernet (misconfigured) - 8136 RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller - 103c 1985 Pavilion 17-e163sg Notebook PC + 8136 RTL8101/2/6E PCI Express Fast Ethernet controller + 103c 1985 RTL8106E on Pavilion 17-e163sg Notebook PC 103c 2a8c Compaq 500B Microtower 103c 2ab1 Pavilion p6774 103c 30cc Pavilion dv6700 @@ -11087,6 +11185,7 @@ 8e2e 7100 KF-230TX/2 a0a0 0007 ALN-325C 8167 RTL-8110SC/8169SC Gigabit Ethernet + 105b 0e10 RTL-8110SC-GR on a N15235/A74MX mainboard 1458 e000 GA-MA69G-S3H Motherboard 1462 235c P965 Neo MS-7235 mainboard 1462 236c 945P Neo3-F motherboard @@ -14864,6 +14963,7 @@ 12d7 Biotronic SRL 12d8 Pericom Semiconductor 01a7 7C21P100 2-port PCI-X to PCI-X Bridge + 2608 PI7C9X2G608GP PCIe2 6-Port/8-Lane Packet Switch 400a PI7C9X442SL PCI Express Bridge Port 400e PI7C9X442SL USB OHCI Controller 400f PI7C9X442SL USB EHCI Controller @@ -15218,7 +15318,7 @@ 0040 QSC-200/300 0050 ESC-100D 0060 ESC-100M - 00f0 MPAC-100 Syncronous Serial Card (Zilog 85230) + 00f0 MPAC-100 Synchronous Serial Card (Zilog 85230) 0170 QSCLP-100 0180 DSCLP-100 0190 SSCLP-100 @@ -15687,6 +15787,7 @@ 1043 838e Virtuoso 66 (Xonar DS) 1043 8428 Virtuoso 100 (Xonar Xense) 1043 8467 CMI8786 (Xonar DG) + 1043 8521 CMI8786 (Xonar DGX) 1043 85f4 Virtuoso 100 (Xonar Essence STX II) 13f6 8782 PCI 2.0 HD Audio 13f6 ffff CMI8787-HG2PCI @@ -16176,6 +16277,13 @@ 50a2 T580-50A2 Unified Wire Ethernet Controller 50a3 T580-50A3 Unified Wire Ethernet Controller 50a4 T540-50A4 Unified Wire Ethernet Controller + 50a5 T522-50A5 Unified Wire Ethernet Controller + 50a6 T522-50A6 Unified Wire Ethernet Controller + 50a7 T580-50A7 Unified Wire Ethernet Controller + 50a8 T580-50A8 Unified Wire Ethernet Controller + 50a9 T580-50A9 Unified Wire Ethernet Controller + 50aa T580-50AA Unified Wire Ethernet Controller + 50ab T520-50AB Unified Wire Ethernet Controller 5401 T520-CR Unified Wire Ethernet Controller 5402 T522-CR Unified Wire Ethernet Controller 5403 T540-CR Unified Wire Ethernet Controller @@ -16231,6 +16339,13 @@ 54a2 T580-50A2 Unified Wire Ethernet Controller 54a3 T580-50A3 Unified Wire Ethernet Controller 54a4 T540-50A4 Unified Wire Ethernet Controller + 54a5 T522-50A5 Unified Wire Ethernet Controller + 54a6 T522-50A6 Unified Wire Ethernet Controller + 54a7 T580-50A7 Unified Wire Ethernet Controller + 54a8 T580-50A8 Unified Wire Ethernet Controller + 54a9 T580-50A9 Unified Wire Ethernet Controller + 54aa T580-50AA Unified Wire Ethernet Controller + 54ab T520-50AB Unified Wire Ethernet Controller 5501 T520-CR Unified Wire Storage Controller 5502 T522-CR Unified Wire Storage Controller 5503 T540-CR Unified Wire Storage Controller @@ -16286,6 +16401,11 @@ 55a2 T580-50A2 Unified Wire Storage Controller 55a3 T580-50A3 Unified Wire Storage Controller 55a4 T540-50A4 Unified Wire Storage Controller + 55a5 T522-50A5 Unified Wire Storage Controller + 55a6 T522-50A6 Unified Wire Storage Controller + 55a7 T580-50A7 Unified Wire Storage Controller + 55a8 T580-50A8 Unified Wire Storage Controller + 55a9 T580-50A9 Unified Wire Storage Controller 5601 T520-CR Unified Wire Storage Controller 5602 T522-CR Unified Wire Storage Controller 5603 T540-CR Unified Wire Storage Controller @@ -16341,6 +16461,13 @@ 56a2 T580-50A2 Unified Wire Storage Controller 56a3 T580-50A3 Unified Wire Storage Controller 56a4 T540-50A4 Unified Wire Storage Controller + 56a5 T522-50A5 Unified Wire Storage Controller + 56a6 T522-50A6 Unified Wire Storage Controller + 56a7 T580-50A7 Unified Wire Storage Controller + 56a8 T580-50A8 Unified Wire Storage Controller + 56a9 T580-50A9 Unified Wire Storage Controller + 56aa T580-50AA Unified Wire Storage Controller + 56ab T520-50AB Unified Wire Storage Controller 5701 T520-CR Unified Wire Ethernet Controller 5702 T522-CR Unified Wire Ethernet Controller 5703 T540-CR Unified Wire Ethernet Controller @@ -16435,6 +16562,13 @@ 58a2 T580-50A2 Unified Wire Ethernet Controller [VF] 58a3 T580-50A3 Unified Wire Ethernet Controller [VF] 58a4 T540-50A4 Unified Wire Ethernet Controller [VF] + 58a5 T522-50A5 Unified Wire Ethernet Controller [VF] + 58a6 T522-50A6 Unified Wire Ethernet Controller [VF] + 58a7 T580-50A7 Unified Wire Ethernet Controller [VF] + 58a8 T580-50A8 Unified Wire Ethernet Controller [VF] + 58a9 T580-50A9 Unified Wire Ethernet Controller [VF] + 58aa T580-50AA Unified Wire Ethernet Controller [VF] + 58ab T520-50AB Unified Wire Ethernet Controller [VF] 6001 T6225-CR Unified Wire Ethernet Controller 6002 T6225-SO-CR Unified Wire Ethernet Controller 6003 T6425-CR Unified Wire Ethernet Controller @@ -16453,6 +16587,7 @@ 6082 T6225-6082 Unified Wire Ethernet Controller 6083 T62100-6083 Unified Wire Ethernet Controller 6084 T64100-6084 Unified Wire Ethernet Controller + 6085 T6240-6085 Unified Wire Ethernet Controller 6401 T6225-CR Unified Wire Ethernet Controller 6402 T6225-SO-CR Unified Wire Ethernet Controller 6403 T6425-CR Unified Wire Ethernet Controller @@ -16471,6 +16606,7 @@ 6482 T6225-6082 Unified Wire Ethernet Controller 6483 T62100-6083 Unified Wire Ethernet Controller 6484 T64100-6084 Unified Wire Ethernet Controller + 6485 T6240-6085 Unified Wire Ethernet Controller 6501 T6225-CR Unified Wire Storage Controller 6502 T6225-SO-CR Unified Wire Storage Controller 6503 T6425-CR Unified Wire Storage Controller @@ -16489,6 +16625,7 @@ 6582 T6225-6082 Unified Wire Storage Controller 6583 T62100-6083 Unified Wire Storage Controller 6584 T64100-6084 Unified Wire Storage Controller + 6585 T6240-6085 Unified Wire Storage Controller 6601 T6225-CR Unified Wire Storage Controller 6602 T6225-SO-CR Unified Wire Storage Controller 6603 T6425-CR Unified Wire Storage Controller @@ -16507,6 +16644,7 @@ 6682 T6225-6082 Unified Wire Storage Controller 6683 T62100-6083 Unified Wire Storage Controller 6684 T64100-6084 Unified Wire Storage Controller + 6685 T6240-6085 Unified Wire Storage Controller 6801 T6225-CR Unified Wire Ethernet Controller [VF] 6802 T6225-SO-CR Unified Wire Ethernet Controller [VF] 6803 T6425-CR Unified Wire Ethernet Controller [VF] @@ -16525,6 +16663,7 @@ 6882 T6225-6082 Unified Wire Ethernet Controller [VF] 6883 T62100-6083 Unified Wire Ethernet Controller [VF] 6884 T64100-6084 Unified Wire Ethernet Controller [VF] + 6885 T6240-6085 Unified Wire Ethernet Controller [VF] a000 PE10K Unified Wire Ethernet Controller 1426 Storage Technology Corp. 1427 Better On-Line Solutions @@ -17496,6 +17635,7 @@ 106b 0093 AirPort Extreme 106b 00d1 AirPort Extreme 106b 00e9 AirPort Extreme + 14e4 04d8 Pegatron UPWL6024 4357 BCM43225 802.11b/g/n 105b e021 T77H103.00 Wireless Half-size Mini PCIe Card 4358 BCM43227 802.11b/g/n @@ -18283,6 +18423,7 @@ 117c 0091 FastFrame NQ42 117c 0092 FastFrame NQ11 117c 0093 FastFrame NQ12 + 15b3 0006 Mellanox Technologies ConnectX-3 Pro Stand-up dual-port 40GbE MCX314A-BCCT 15b3 0078 ConnectX-3 Pro 10 GbE Dual Port KR Mezzanine Card 15b3 0079 ConnectX-3 Pro 40 GbE Dual Port QSFP+ Adapter 15b3 0080 ConnectX-3 Pro 10 GbE Dual Port SFP+ Adapter @@ -18297,6 +18438,8 @@ 1011 MT27600 [Connect-IB] 1012 MT27600 Family [Connect-IB Virtual Function] 1013 MT27700 Family [ConnectX-4] + 15b3 0003 Mellanox Technologies ConnectX-4 Stand-up single-port 40GbE MCX413A-BCAT + 15b3 0005 Mellanox Technologies ConnectX-4 Stand-up single-port 40GbE MCX415A-BCAT 15b3 0006 MCX416A-BCAT, ConnectX-4 EN, 40/56GbE 2P, PCIe3.0 x16 15b3 0008 ConnectX-4 Stand-up dual-port 100GbE MCX416A-CCAT 15b3 0033 ConnectX-4 VPI IB EDR/100 GbE Single Port QSFP28 Adapter @@ -18304,6 +18447,7 @@ 15b3 0050 ConnectX-4 100 GbE Dual Port QSFP28 Adapter 1014 MT27700 Family [ConnectX-4 Virtual Function] 1015 MT27710 Family [ConnectX-4 Lx] + 15b3 0005 Mellanox Technologies ConnectX-4 Lx Stand-up single-port 40GbE MCX4131A-BCAT 15b3 0016 ConnectX-4 Lx 25 GbE Dual Port SFP28 Adapter 15b3 0020 MCX4411A-ACQN, ConnectX-4 Lx EN OCP, 1x25Gb 15b3 0021 MCX4421A-ACQN ConnectX-4 Lx EN OCP,2x25G @@ -19037,12 +19181,14 @@ 7016 AP470 48-Channel TTL Level Digital Input/Output Module 7017 AP323 16-bit, 20 or 40 Channel Analog Input Module 7018 AP408: 32-Channel Digital I/O Module + 7019 AP341 14-bit, 16-Channel Simultaneous Conversion Analog Input Module 701a AP220-16 12-Bit, 16-Channel Analog Output Module 701b AP231-16 16-Bit, 16-Channel Analog Output Module 7021 APA7-201 Reconfigurable Artix-7 FPGA module 48 TTL channels 7022 APA7-202 Reconfigurable Artix-7 FPGA module 24 RS485 channels 7023 APA7-203 Reconfigurable Artix-7 FPGA module 24 TTL & 12 RS485 channels 7024 APA7-204 Reconfigurable Artix-7 FPGA module 24 LVDS channels + 7027 AP418 16-Channel High Voltage Digital Input/Output Module 7042 AP482 Counter Timer Module with TTL Level Input/Output 7043 AP483 Counter Timer Module with TTL Level and RS422 Input/Output 7044 AP484 Counter Timer Module with RS422 Input/Output @@ -19451,6 +19597,7 @@ 1803 ProdaSafe GmbH 1805 Euresys S.A. 1809 Lumanate, Inc. +180c IEI Integration Corp 1813 Ambient Technologies Inc 4000 HaM controllerless modem 16be 0001 V9x HAM Data Fax Modem @@ -19892,11 +20039,12 @@ 1924 8012 SFN8522-R1 8000 Series 10G Adapter 1924 8013 SFN8042-R1 8000 Series 10/40G Adapter 1924 8014 SFN8542-R1 8000 Series 10/40G Adapter - 1924 8016 SFN8022-R2 8000 Series 10G Adapte + 1924 8016 SFN8022-R2 8000 Series 10G Adapter 1924 8017 SFN8522-R2 8000 Series 10G Adapter 1924 8018 SFN8042-R2 8000 Series 10/40G Adapter 1924 8019 SFN8542-R2 8000 Series 10/40G Adapter 1924 801a SFN8722-R1 8000 Series OCP 10G Adapter + 1924 801b SFN8522-R3 8000 Series 10G Adapter 1803 SFC9020 10G Ethernet Controller (Virtual Function) 1813 SFL9021 10GBASE-T Ethernet Controller (Virtual Function) 1903 SFC9120 10G Ethernet Controller (Virtual Function) @@ -20082,6 +20230,7 @@ # E2200, E2201, E2205 e091 Killer E220x Gigabit Ethernet Controller e0a1 Killer E2400 Gigabit Ethernet Controller + e0b1 Killer E2500 Gigabit Ethernet Controller 196a Sensory Networks Inc. 0101 NodalCore C-1000 Content Classification Accelerator 0102 NodalCore C-2000 Content Classification Accelerator @@ -20365,7 +20514,7 @@ 3003 ioMemory Mezzanine 1aee Caustic Graphics Inc. # nee Qumranet, Inc. -1af4 Red Hat, Inc +1af4 Red Hat, Inc. 1000 Virtio network device 1001 Virtio block device 1002 Virtio memory balloon @@ -20642,6 +20791,8 @@ 1cc7 Radian Memory Systems Inc. 0200 RMS-200 0250 RMS-250 +1ccf Zoom Corporation + 0001 TAC-2 Thunderbolt Audio Converter 1cd2 SesKion GmbH 0301 Simulyzer-RT CompactPCI Serial DIO-1 card 0302 Simulyzer-RT CompactPCI Serial PSI5-ECU-1 card @@ -20659,6 +20810,7 @@ 0005 ExaNIC X40 0006 ExaNIC X10-HPT 0007 ExaNIC X40 + 0008 ExaNIC V5P 1cf7 Subspace Dynamics 1d00 Pure Storage 1d0f Amazon.com, Inc. @@ -20774,6 +20926,9 @@ 2020 DC-390 690c 690c dc29 DC290 +1de5 Eideticom, Inc + 1000 IO Memory Controller + 2000 NoLoad Hardware Development Kit # nee Tumsan Oy 1fc0 Ascom (Finland) Oy 0300 E2200 Dual E1/Rawpipe Card @@ -20808,6 +20963,7 @@ 0000 3014 10-Giga TOE Dual Port CX4 Low Profile SmartNIC 4010 TN4010 Clean SROM 4020 TN9030 10GbE CX4 Ethernet Adapter + 180c 2040 Mustang-200 10GbE Ethernet Adapter 4022 TN9310 10GbE SFP+ Ethernet Adapter 1043 8709 XG-C100F 10GbE SFP+ Ethernet Adapter 1186 4d00 DXE-810S 10GbE SFP+ Ethernet Adapter @@ -21616,6 +21772,7 @@ 17aa 21cf ThinkPad T520 0150 Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller 1043 84ca P8 series motherboard + 1458 d000 Ivy Bridge GT1 [HD Graphics] 15d9 0624 X9SCM-F Motherboard 1849 0150 Motherboard 0151 Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port @@ -22123,6 +22280,7 @@ 0960 80960RP (i960RP) Microprocessor/Bridge 0962 80960RM (i960RM) Bridge 0964 80960RP (i960RP) Microprocessor/Bridge + 0a03 Haswell-ULT Thermal Subsystem 0a04 Haswell-ULT DRAM Controller 17aa 2214 ThinkPad X240 0a06 Haswell-ULT Integrated Graphics Controller @@ -22135,6 +22293,17 @@ 0a2a Haswell-ULT Integrated Graphics Controller 0a2e Haswell-ULT Integrated Graphics Controller 0a53 DC P3520 SSD + 0a54 Express Flash NVMe P4500 + 1028 1fe1 Express Flash NVMe 1TB 2.5" U.2 (P4500) + 1028 1fe2 Express Flash NVMe 2TB 2.5" U.2 (P4500) + 1028 1fe3 Express Flash NVMe 4TB 2.5" U.2 (P4500) + 1028 1fe4 Express Flash NVMe 4TB HHHL AIC (P4500) + 0a55 Express Flash NVMe P4600 + 1028 1fe5 Express Flash NVMe 1.6TB 2.5" U.2 (P4600) + 1028 1fe6 Express Flash NVMe 2TB 2.5" U.2 (P4600) + 1028 1fe7 Express Flash NVMe 3.2TB 2.5" U.2 (P4600) + 1028 1fe8 Express Flash NVMe 2.0TB HHHL AIC (P4600) + 1028 1fe9 Express Flash NVMe 4.0TB HHHL AIC (P4600) 0be0 Atom Processor D2xxx/N2xxx Integrated Graphics Controller 0be1 Atom Processor D2xxx/N2xxx Integrated Graphics Controller 105b 0d7c D270S/D250S Motherboard @@ -23269,7 +23438,7 @@ 8086 011a Ethernet Converged Network Adapter X520-4 8086 011b Ethernet Converged Network Adapter X520-4 8086 011c Ethernet Converged Network Adapter X520-4 - 154c XL710/X710 Virtual Function + 154c Ethernet Virtual Function 700 Series 154d Ethernet 10G 2P X520 Adapter 8086 7b11 10GbE 2P X520 Adapter 1557 82599 10 Gigabit Network Connection @@ -23312,7 +23481,7 @@ 156d DSL5520 Thunderbolt 2 Bridge [Falcon Ridge 4C 2013] 156f Ethernet Connection I219-LM 1570 Ethernet Connection I219-V - 1571 XL710/X710 Virtual Function + 1571 Ethernet Virtual Function 700 Series 1572 Ethernet Controller X710 for 10GbE SFP+ 1028 0000 Ethernet 10G X710 rNDC 1028 1f99 Ethernet 10G 4P X710/I350 rNDC @@ -23403,6 +23572,7 @@ 8086 00a0 Ethernet Converged Network Adapter X710-T4 8086 1003 Ethernet Converged Network Adapter X710-T 158a Ethernet Controller XXV710 for 25GbE backplane + 8086 000a Ethernet 25G 2P XXV710 Mezz 158b Ethernet Controller XXV710 for 25GbE SFP28 8086 0000 Ethernet Network Adapter XXV710 8086 0001 Ethernet Network Adapter XXV710-2 @@ -23413,6 +23583,7 @@ 8086 0006 Ethernet Network Adapter OCP XXV710-2 8086 0007 Ethernet Network Adapter OCP XXV710-1 8086 0008 Ethernet Network Adapter OCP XXV710-1 + 8086 0009 Ethernet 25G 2P XXV710 Adapter 8086 4001 Ethernet Network Adapter XXV710-2 15a0 Ethernet Connection (2) I218-LM 15a1 Ethernet Connection (2) I218-V @@ -23464,6 +23635,7 @@ 15d6 Ethernet Connection (5) I219-V 15d7 Ethernet Connection (4) I219-LM 15d8 Ethernet Connection (4) I219-V + 17aa 2247 ThinkPad T570 17aa 224f ThinkPad X1 Carbon 5th Gen 15d9 JHL6340 Thunderbolt 3 NHI (C step) [Alpine Ridge 2C 2016] 15da JHL6340 Thunderbolt 3 Bridge (C step) [Alpine Ridge 2C 2016] @@ -23529,9 +23701,10 @@ 190f Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers 1910 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers 1911 Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model + 17aa 2247 ThinkPad T570 17aa 224f ThinkPad X1 Carbon 5th Gen 1912 HD Graphics 530 - 1916 HD Graphics 520 + 1916 Skylake GT2 [HD Graphics 520] 1028 06f3 Latitude 3570 1918 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers 1919 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Imaging Unit @@ -24017,6 +24190,7 @@ 2018 Sky Lake-E M2PCI Registers 201a Sky Lake-E Non-Transparent Bridge Registers 201c Sky Lake-E Non-Transparent Bridge Registers + 2020 Sky Lake-E DMI3 Registers 2021 Sky Lake-E CBDMA Registers 2024 Sky Lake-E MM/Vt-d Configuration Registers 2030 Sky Lake-E PCI Express Root Port A @@ -24662,7 +24836,7 @@ 8086 a000 D865PERL mainboard 8086 e000 D865PERL mainboard 8086 e001 Desktop Board D865GBF - 8086 e002 SoundMax Intergrated Digital Audio + 8086 e002 SoundMax Integrated Digital Audio 24d6 82801EB/ER (ICH5/ICH5R) AC'97 Modem Controller 103c 006a NX9500 24d7 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #3 @@ -25659,7 +25833,7 @@ 2822 SATA Controller [RAID mode] 1028 020d Inspiron 530 103c 2a6f Asus IPIBL-LB Motherboard - 1043 8277 P5K PRO Motherboard + 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] 2823 C610/X99 series chipset sSATA Controller [RAID mode] 2824 82801HB (ICH8) 4 port SATA Controller [AHCI mode] 1043 81ec P5B @@ -25834,7 +26008,7 @@ 284b 82801H (ICH8 Family) HD Audio Controller 1025 011f Realtek ALC268 audio codec 1025 0121 Aspire 5920G - 1025 0145 Realtek ALC889 (Aspire 8920G w. Dolby Theather) + 1025 0145 Realtek ALC889 (Aspire 8920G w. Dolby Theater) 1028 01da OptiPlex 745 1028 01f3 Inspiron 1420 1028 01f9 Latitude D630 @@ -25889,14 +26063,14 @@ 1028 0210 PowerEdge T300 onboard SATA Controller 1028 0211 Optiplex 755 1028 023c PowerEdge R200 onboard SATA Controller - 1043 8277 P5K PRO Motherboard + 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] 2921 82801IB (ICH9) 2 port SATA Controller [IDE mode] 1028 0235 PowerEdge R710 SATA IDE Controller 1028 0236 PowerEdge R610 SATA IDE Controller 1028 0237 PowerEdge T610 SATA IDE Controller 1462 7360 G33/P35 Neo 2922 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode] - 1043 8277 P5K PRO Motherboard + 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] 1af4 1100 QEMU Virtual Machine 8086 5044 Desktop Board DP35DP 2923 82801IB (ICH9) 4 port SATA Controller [AHCI mode] @@ -25908,7 +26082,7 @@ 1028 020f PowerEdge R300 onboard SATA Controller 1028 0210 PowerEdge T300 onboard SATA Controller 1028 0211 Optiplex 755 - 1043 8277 P5K PRO Motherboard + 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] 1462 7360 G33/P35 Neo 2928 82801IBM/IEM (ICH9M/ICH9M-E) 2 port SATA Controller [IDE mode] 2929 82801IBM/IEM (ICH9M/ICH9M-E) 4 port SATA Controller [AHCI mode] @@ -25922,7 +26096,7 @@ 1028 0211 Optiplex 755 103c 2a6f Asus IPIBL-LB Motherboard 103c 3628 dv6-1190en - 1043 8277 P5K PRO Motherboard + 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] 1462 7360 G33/P35 Neo 1af4 1100 QEMU Virtual Machine 8086 5044 Desktop Board DP35DP @@ -25942,7 +26116,7 @@ 1028 029c PowerEdge M710 USB UHCI Controller 1028 2011 Optiplex 755 103c 2a6f Asus IPIBL-LB Motherboard - 1043 8277 P5K PRO Motherboard + 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] 1462 7360 G33/P35 Neo 1af4 1100 QEMU Virtual Machine 8086 5044 Desktop Board DP35DP @@ -25959,7 +26133,7 @@ 1028 0287 PowerEdge M610 onboard UHCI 1028 029c PowerEdge M710 USB UHCI Controller 103c 2a6f Asus IPIBL-LB Motherboard - 1043 8277 P5K PRO Motherboard + 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] 1462 7360 G33/P35 Neo 1af4 1100 QEMU Virtual Machine 8086 5044 Desktop Board DP35DP @@ -25974,7 +26148,7 @@ 1028 0287 PowerEdge M610 onboard UHCI 1028 029c PowerEdge M710 USB UHCI Controller 103c 2a6f Asus IPIBL-LB Motherboard - 1043 8277 P5K PRO Motherboard + 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] 1462 7360 G33/P35 Neo 1af4 1100 QEMU Virtual Machine 8086 5044 Desktop Board DP35DP @@ -25989,7 +26163,7 @@ 1028 029c PowerEdge M710 USB UHCI Controller 1028 2011 Optiplex 755 103c 2a6f Asus IPIBL-LB Motherboard - 1043 8277 P5K PRO Motherboard + 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] 1462 7360 G33/P35 Neo 1af4 1100 QEMU Virtual Machine 8086 2937 Optiplex 755 @@ -26005,7 +26179,7 @@ 1028 0287 PowerEdge M610 onboard UHCI 1028 029c PowerEdge M710 USB UHCI Controller 103c 2a6f Asus IPIBL-LB Motherboard - 1043 8277 P5K PRO Motherboard + 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] 1462 7360 G33/P35 Neo 1af4 1100 QEMU Virtual Machine 8086 2938 Optiplex 755 @@ -26016,7 +26190,7 @@ 1028 0210 PowerEdge T300 onboard UHCI 1028 0237 PowerEdge T610 USB UHCI Controller 103c 2a6f Asus IPIBL-LB Motherboard - 1043 8277 P5K PRO Motherboard + 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] 1462 7360 G33/P35 Neo 1af4 1100 QEMU Virtual Machine 8086 5044 Desktop Board DP35DP @@ -26033,7 +26207,7 @@ 1028 0287 PowerEdge M610 onboard EHCI 1028 029c PowerEdge M710 USB EHCI Controller 103c 2a6f Asus IPIBL-LB Motherboard - 1043 8277 P5K PRO Motherboard + 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] 1462 7360 G33/P35 Neo 1af4 1100 QEMU Virtual Machine 8086 5044 Desktop Board DP35DP @@ -26047,7 +26221,7 @@ 1028 0287 PowerEdge M610 onboard EHCI 1028 029c PowerEdge M710 USB EHCI Controller 103c 2a6f Asus IPIBL-LB Motherboard - 1043 8277 P5K PRO Motherboard + 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] 1462 7360 G33/P35 Neo 1af4 1100 QEMU Virtual Machine 8086 293c Optiplex 755 @@ -26058,7 +26232,7 @@ 1028 0211 Optiplex 755 103c 2a6f Asus IPIBL-LB Motherboard 103c 3628 dv6-1190en - 1043 829f P5K PRO Motherboard + 1043 829f P5K PRO Motherboard: 82801IR [ICH9R] 1462 7360 G33/P35 Neo 1af4 1100 QEMU Virtual Machine 8086 293e Optiplex 755 @@ -26068,8 +26242,7 @@ 1028 020d Inspiron 530 1028 0211 Optiplex 755 103c 2a6f Asus IPIBL-LB Motherboard -# same ID possibly also on other ASUS boards - 1043 8277 P5K PRO Motherboard + 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] 8086 2940 Optiplex 755 2942 82801I (ICH9 Family) PCI Express Port 2 1028 020d Inspiron 530 @@ -26080,12 +26253,10 @@ 1028 020d Inspiron 530 2948 82801I (ICH9 Family) PCI Express Port 5 1028 020d Inspiron 530 -# same ID possibly also on other ASUS boards - 1043 8277 P5K PRO Motherboard + 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] 294a 82801I (ICH9 Family) PCI Express Port 6 1028 020d Inspiron 530 -# same ID possibly also on other ASUS boards - 1043 8277 P5K PRO Motherboard + 1043 8277 P5K PRO Motherboard: 82801IR [ICH9R] 294c 82566DC-2 Gigabit Network Connection 17aa 302e 82566DM-2 Gigabit Network Connection 2970 82946GZ/PL/GL Memory Controller Hub @@ -26139,16 +26310,14 @@ 29c0 82G33/G31/P35/P31 Express DRAM Controller 1028 020d Inspiron 530 103c 2a6f Asus IPIBL-LB Motherboard -# same ID possibly also on other ASUS boards - 1043 8276 P5K PRO Motherboard + 1043 8276 P5K PRO Motherboard: Intel 82P35 Northbridge 1043 82b0 P5KPL-VM Motherboard 1462 7360 G33/P35 Neo 1af4 1100 QEMU Virtual Machine 8086 5044 Desktop Board DP35DP 29c1 82G33/G31/P35/P31 Express PCI Express Root Port 1028 020d Inspiron 530 -# same ID possibly also on other ASUS boards - 1043 8276 P5K PRO Motherboard + 1043 8276 P5K PRO Motherboard: Intel 82P35 Northbridge 29c2 82G33/G31 Express Integrated Graphics Controller 1028 020d Inspiron 530 1043 82b0 P5KPL-VM Motherboard @@ -26914,7 +27083,7 @@ 372b Xeon C5500/C3500 Core 372c Xeon C5500/C3500 Reserved 373f Xeon C5500/C3500 IOxAPIC - 37cd X722 Virtual Function + 37cd Ethernet Virtual Function 700 Series 37ce Ethernet Connection X722 for 10GbE backplane 1590 0215 Ethernet 10Gb 2-port 568i Adapter 17aa 4023 Intel Ethernet Connection X722 for 10GbE backplane @@ -26928,9 +27097,9 @@ 1590 0216 Ethernet 1Gb 2-port 368i Adapter 1590 0217 Ethernet 1Gb 2-port 368FLR-MMT Adapter 1590 0247 Ethernet 1Gb 4-port 369i Adapter - 17aa 4020 Intel Ethernet Connection X722 for 1GbE - 17aa 4021 Intel Ethernet Connection X722 for 1GbE - 17aa 4022 Intel Ethernet Connection X722 for 1GbE + 17aa 4020 Ethernet Connection X722 for 1GbE + 17aa 4021 Ethernet Connection X722 for 1GbE + 17aa 4022 Ethernet Connection X722 for 1GbE 37d2 Ethernet Connection X722 for 10GBASE-T 14cd 0030 Ethernet OCP 2x10G RJ45 Phy Card [USI-X557-10GbaseT] 1590 0218 Ethernet 10Gb 2-port 568FLR-MMT Adapter @@ -27479,11 +27648,13 @@ 1af4 1100 QEMU Virtual Machine 5902 HD Graphics 610 5904 Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers + 17aa 2247 ThinkPad T570 17aa 224f ThinkPad X1 Carbon 5th Gen 590f Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers 5910 Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers 5912 HD Graphics 630 5916 HD Graphics 620 + 17aa 2248 ThinkPad T570 17aa 224f ThinkPad X1 Carbon 5th Gen 591d HD Graphics P630 591f Intel Kaby Lake Host Bridge @@ -28180,6 +28351,7 @@ 17aa 382a B51-80 Laptop 9d23 Sunrise Point-LP SMBus 1028 06f3 Latitude 3570 + 17aa 2247 ThinkPad T570 17aa 224f ThinkPad X1 Carbon 5th Gen 17aa 382a B51-80 Laptop 9d27 Sunrise Point-LP Serial IO UART Controller #0 @@ -28189,14 +28361,17 @@ 9d2d Sunrise Point-LP Secure Digital IO Controller 9d2f Sunrise Point-LP USB 3.0 xHCI Controller 1028 06f3 Latitude 3570 + 17aa 2247 ThinkPad T570 17aa 382a B51-80 Laptop 9d31 Sunrise Point-LP Thermal subsystem 1028 06f3 Latitude 3570 + 17aa 2247 ThinkPad T570 17aa 224f ThinkPad X1 Carbon 5th Gen 17aa 382a B51-80 Laptop 9d35 Sunrise Point-LP Integrated Sensor Hub 9d3a Sunrise Point-LP CSME HECI #1 1028 06f3 Latitude 3570 + 17aa 2247 ThinkPad T570 17aa 224f ThinkPad X1 Carbon 5th Gen 17aa 382a B51-80 Laptop 9d43 Sunrise Point-LP LPC Controller @@ -28205,6 +28380,7 @@ 1028 06f3 Latitude 3570 9d56 Sunrise Point-LP LPC Controller 9d58 Sunrise Point-LP LPC Controller + 17aa 2247 ThinkPad T570 17aa 224f ThinkPad X1 Carbon 5th Gen 9d60 Sunrise Point-LP Serial IO I2C Controller #0 1028 06f3 Latitude 3570 @@ -28343,6 +28519,7 @@ a1a3 Lewisburg SMBus a1a4 Lewisburg SPI Controller a1af Lewisburg USB 3.0 xHCI Controller + a1b1 Lewisburg Thermal Subsystem a1ba Lewisburg CSME: HECI #1 a1bb Lewisburg CSME: HECI #2 a1bc Lewisburg CSME: IDE-r @@ -28802,6 +28979,34 @@ 103c 0701 Smart Array P204i-b SR Gen10 103c 1100 Smart Array P816i-a SR Gen10 103c 1101 Smart Array P416ie-m SR G10 + 9005 0800 SmartRAID 3154-8i + 9005 0801 SmartRAID 3152-8i + 9005 0802 SmartRAID 3151-4i + 9005 0803 SmartRAID 3101-4i + 9005 0804 SmartRAID 3154-8e + 9005 0805 SmartRAID 3102-8i + 9005 0806 SmartRAID 3100 + 9005 0807 SmartRAID 3162-8i + 9005 0900 SmartHBA 2100-8i + 9005 0901 SmartHBA 2100-4i + 9005 0902 HBA 1100-8i + 9005 0903 HBA 1100-4i + 9005 0904 SmartHBA 2100-8e + 9005 0905 HBA 1100-8e + 9005 0906 SmartHBA 2100-4i4e + 9005 0907 HBA 1100 + 9005 0908 SmartHBA 2100 + 9005 090a SmartHBA 2100A-8i + 9005 1200 SmartRAID 3154-24i + 9005 1201 SmartRAID 3154-8i16e + 9005 1202 SmartRAID 3154-8i8e + 9005 1280 HBA 1100-16i + 9005 1281 HBA 1100-16e + 9005 1300 HBA 1100-8i8e + 9005 1301 HBA 1100-24i + 9005 1302 SmartHBA 2100-8i8e + 9005 1303 SmartHBA 2100-24i + 9005 1380 SmartRAID 3154-16i 0410 AIC-9410W SAS (Razor HBA RAID) 9005 0410 ASC-48300(Spirit RAID) 9005 0411 ASC-58300 (Oakmont RAID) diff --git a/share/mk/bsd.crunchgen.mk b/share/mk/bsd.crunchgen.mk index 2e7e0634bce2..1e60d81fffd4 100644 --- a/share/mk/bsd.crunchgen.mk +++ b/share/mk/bsd.crunchgen.mk @@ -122,7 +122,11 @@ ${OUTPUTS}: ${CONF} ${CRUNCHGEN} -fq -m ${OUTMK} -c ${OUTC} ${CONF} # Avoid redundantly calling 'make objs' which we've done by our # own dependencies. - sed -i '' -e "s/^\(${PROG}:.*\) \$$(SUBMAKE_TARGETS)/\1/" ${OUTMK} + # Also avoid unneeded 'make depend' call. + sed -i '' \ + -e "s/^\(${PROG}:.*\) \$$(SUBMAKE_TARGETS)/\1/" \ + -e '/$$(CRUNCHMAKE) $$(BUILDOPTS).* \ &&.*/d' \ + ${OUTMK} # These 2 targets cannot use .MAKE since they depend on the generated # ${OUTMK} above. @@ -154,14 +158,18 @@ build-tools: build-tools-${_tool} # Yes, this does seem to partly duplicate bsd.subdir.mk, but I can't # get that to cooperate with bsd.prog.mk. Besides, many of the standard # targets should NOT be propagated into the components. -.for __target in clean cleandepend cleandir obj objlink +.if ${MK_AUTO_OBJ} == "no" +_obj= obj +.endif +.for __target in clean cleandepend cleandir ${_obj} objlink .for D in ${CRUNCH_SRCDIRS} .for P in ${CRUNCH_PROGS_${D}} ${__target}_crunchdir_${P}: .PHONY .MAKE ${_+_}cd ${CRUNCH_SRCDIR_${P}} && \ ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ ${CRUNCHARGS} \ - DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${__target} + DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} \ + ${CRUNCH_BUILDOPTS_${P}} ${__target} ${__target}: ${__target}_crunchdir_${P} .endfor .endfor diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index 2ae1266318fe..26910e3ef1a3 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -182,7 +182,7 @@ DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} .if !empty(DEPENDSRCS) DEPENDOBJS+= ${DEPENDSRCS:${OBJS_SRCS_FILTER:ts:}:S,$,.o,} .endif -DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./} +DEPENDFILES+= ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./} .if defined(_SKIP_DEPEND) # Don't bother statting any .meta files for .depend* ${DEPENDOBJS}: .NOMETA @@ -190,7 +190,7 @@ ${DEPENDFILE}: .NOMETA # Unset these to avoid looping/statting on them later. .undef DEPENDSRCS .undef DEPENDOBJS -.undef DEPENDFILES_OBJS +.undef DEPENDFILES .endif # defined(_SKIP_DEPEND) DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} DEPEND_CFLAGS+= -MT${.TARGET} @@ -201,7 +201,7 @@ DEPEND_CFLAGS+= -MT${.TARGET} DEPEND_CFLAGS_CONDITION= "${DEPENDOBJS:${DEPEND_FILTER}:M${.TARGET:${DEPEND_FILTER}}}" != "" CFLAGS+= ${${DEPEND_CFLAGS_CONDITION}:?${DEPEND_CFLAGS}:} .endif -.for __depend_obj in ${DEPENDFILES_OBJS} +.for __depend_obj in ${DEPENDFILES} .if ${MAKE_VERSION} < 20160220 .sinclude "${.OBJDIR}/${__depend_obj}" .else @@ -273,7 +273,7 @@ beforebuild: depend depend: beforedepend ${DEPENDFILE} afterdepend # Tell bmake not to look for generated files via .PATH -.NOPATH: ${DEPENDFILE} ${DEPENDFILES_OBJS} +.NOPATH: ${DEPENDFILE} ${DEPENDFILES} DPSRCS+= ${SRCS} # A .depend file will only be generated if there are commands in diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index b3cb375e277e..b303ccc9b9c9 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -38,6 +38,7 @@ LIBCAP_GRP?= ${LIBDESTDIR}${LIBDIR_BASE}/libcap_grp.a LIBCAP_PWD?= ${LIBDESTDIR}${LIBDIR_BASE}/libcap_pwd.a LIBCAP_RANDOM?= ${LIBDESTDIR}${LIBDIR_BASE}/libcap_random.a LIBCAP_SYSCTL?= ${LIBDESTDIR}${LIBDIR_BASE}/libcap_sysctl.a +LIBCAP_SYSLOG?= ${LIBDESTDIR}${LIBDIR_BASE}/libcap_syslog.a LIBCASPER?= ${LIBDESTDIR}${LIBDIR_BASE}/libcasper.a LIBCOMPAT?= ${LIBDESTDIR}${LIBDIR_BASE}/libcompat.a LIBCOMPILER_RT?=${LIBDESTDIR}${LIBDIR_BASE}/libcompiler_rt.a diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index f3c5f246d992..2d172197ac53 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -78,6 +78,7 @@ _LIBRARIES= \ cap_pwd \ cap_random \ cap_sysctl \ + cap_syslog \ com_err \ compiler_rt \ crypt \ @@ -237,6 +238,7 @@ _DP_cap_grp= nv _DP_cap_pwd= nv _DP_cap_random= nv _DP_cap_sysctl= nv +_DP_cap_syslog= nv _DP_pjdlog= util _DP_opie= md _DP_usb= pthread @@ -534,6 +536,7 @@ LIBCAP_GRPDIR= ${OBJTOP}/lib/libcasper/services/cap_grp LIBCAP_PWDDIR= ${OBJTOP}/lib/libcasper/services/cap_pwd LIBCAP_RANDOMDIR= ${OBJTOP}/lib/libcasper/services/cap_random LIBCAP_SYSCTLDIR= ${OBJTOP}/lib/libcasper/services/cap_sysctl +LIBCAP_SYSLOGDIR= ${OBJTOP}/lib/libcasper/services/cap_syslog LIBBSDXMLDIR= ${OBJTOP}/lib/libexpat LIBKVMDIR= ${OBJTOP}/lib/libkvm LIBPTHREADDIR= ${OBJTOP}/lib/libthr diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 83eb875bcbe2..b8ba2586617b 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -119,6 +119,7 @@ __DEFAULT_YES_OPTIONS = \ LIB32 \ LIBPTHREAD \ LIBTHR \ + LOADER_GELI \ LOCALES \ LOCATE \ LPR \ @@ -180,6 +181,7 @@ __DEFAULT_NO_OPTIONS = \ GNU_GREP_COMPAT \ HESIOD \ LIBSOFT \ + LOADER_FIREWIRE \ LOADER_FORCE_LE \ NAND \ OFED \ diff --git a/share/mk/src.sys.obj.mk b/share/mk/src.sys.obj.mk index fc545a0e4a76..fe15717d4f05 100644 --- a/share/mk/src.sys.obj.mk +++ b/share/mk/src.sys.obj.mk @@ -26,7 +26,7 @@ _default_makeobjdir= $${.CURDIR:S,^$${SRCTOP},$${OBJTOP},} .include .if ${.MAKE.LEVEL} == 0 || empty(OBJROOT) -.if ${MK_UNIFIED_OBJDIR} == "no" +.if ${MK_UNIFIED_OBJDIR} == "no" && ${MK_DIRDEPS_BUILD} == "no" # Fall back to historical behavior. # We always want to set a default MAKEOBJDIRPREFIX... MAKEOBJDIRPREFIX?= ${_default_makeobjdirprefix} @@ -70,22 +70,32 @@ OBJROOT:= ${OBJROOT:H:tA}/${OBJROOT:T} .export OBJROOT SRCTOP .endif +.if ${MK_DIRDEPS_BUILD} == "no" +.if empty(OBJTOP) # SRCTOP == OBJROOT only happens with clever MAKEOBJDIRPREFIX=/. Don't # append TARGET.TARGET_ARCH for that case since the user wants to build # in the source tree. .if ${MK_UNIFIED_OBJDIR} == "yes" && ${SRCTOP} != ${OBJROOT:tA} -OBJTOP:= ${OBJROOT}${TARGET:D${TARGET}.${TARGET_ARCH}:U${MACHINE}.${MACHINE_ARCH}} +.if defined(TARGET) && defined(TARGET_ARCH) +OBJTOP:= ${OBJROOT}${TARGET}.${TARGET_ARCH} +.elif defined(TARGET) && ${.CURDIR} == ${SRCTOP} +# Not enough information, just use basic OBJDIR. This can happen with some +# 'make universe' targets or if TARGET is not being used as expected. +OBJTOP:= ${OBJROOT:H} +.else +OBJTOP:= ${OBJROOT}${MACHINE}.${MACHINE_ARCH} +.endif .else # TARGET.TARGET_ARCH handled in OBJROOT already. OBJTOP:= ${OBJROOT:H} .endif # ${MK_UNIFIED_OBJDIR} == "yes" +.endif # empty(OBJTOP) -# Fixup OBJROOT/OBJTOP if using MAKEOBJDIRPREFIX but leave it alone -# for DIRDEPS_BUILD which really wants to know the absolute top at -# all times. This intenionally comes after adding TARGET.TARGET_ARCH -# so that is truncated away for nested objdirs. This logic also -# will not trigger if the OBJROOT block above unsets MAKEOBJDIRPREFIX. -.if !empty(MAKEOBJDIRPREFIX) && ${MK_DIRDEPS_BUILD} == "no" +# Fixup OBJROOT/OBJTOP if using MAKEOBJDIRPREFIX. +# This intenionally comes after adding TARGET.TARGET_ARCH so that is truncated +# away for nested objdirs. This logic also will not trigger if the OBJROOT +# block above unsets MAKEOBJDIRPREFIX. +.if !empty(MAKEOBJDIRPREFIX) OBJTOP:= ${MAKEOBJDIRPREFIX}${SRCTOP} OBJROOT:= ${OBJTOP}/ .endif @@ -100,7 +110,12 @@ OBJROOT:= ${OBJTOP}/ # __objdir is the expected .OBJDIR we want to use and that auto.obj.mk will # try to create. .if !empty(MAKEOBJDIRPREFIX) +.if ${.CURDIR:M${MAKEOBJDIRPREFIX}/*} != "" +# we are already in obj tree! +__objdir= ${.CURDIR} +.else __objdir:= ${MAKEOBJDIRPREFIX}${.CURDIR} +.endif .elif !empty(MAKEOBJDIR) __objdir:= ${MAKEOBJDIR} .endif @@ -196,3 +211,5 @@ OBJROOT= ${SRCTOP}/ .OBJDIR: ${.CURDIR} .endif .endif # defined(NO_OBJ) + +.endif # ${MK_DIRDEPS_BUILD} == "no" diff --git a/share/mk/sys.mk b/share/mk/sys.mk index e59671f430f0..eace8fe306ec 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -118,7 +118,7 @@ NO_META_IGNORE_HOST_HEADERS= 1 # This needs to be done early - before .PATH is computed # Don't do this for 'make showconfig' as it enables all options where meta mode # is not expected. -.if !make(showconfig) && !make(print-dir) +.if !make(showconfig) && !make(print-dir) && empty(.MAKEFLAGS:M-[nN]) .sinclude .endif .endif # ${MK_AUTO_OBJ} == "yes" @@ -243,7 +243,7 @@ LFLAGS ?= # compiler driver flags (e.g. -mabi=*) that conflict with flags to LD. LD ?= ld LDFLAGS ?= -_LDFLAGS = ${LDFLAGS:S/-Wl,//g:N-mabi=*} +_LDFLAGS = ${LDFLAGS:S/-Wl,//g:N-mabi=*:N-fuse-ld=*} LINT ?= lint LINTFLAGS ?= -cghapbx diff --git a/sys/boot/Makefile b/stand/Makefile similarity index 100% rename from sys/boot/Makefile rename to stand/Makefile diff --git a/sys/boot/Makefile.amd64 b/stand/Makefile.amd64 similarity index 88% rename from sys/boot/Makefile.amd64 rename to stand/Makefile.amd64 index 08f9f50d88d4..abecaa685022 100644 --- a/sys/boot/Makefile.amd64 +++ b/stand/Makefile.amd64 @@ -1,7 +1,9 @@ # $FreeBSD$ SUBDIR+= libsa32 +.if ${MK_ZFS} != "no" SUBDIR+= zfs zfs32 +.endif .if ${MK_FORTH} != "no" SUBDIR+= ficl32 .endif diff --git a/sys/boot/Makefile.arm b/stand/Makefile.arm similarity index 100% rename from sys/boot/Makefile.arm rename to stand/Makefile.arm diff --git a/sys/boot/Makefile.arm64 b/stand/Makefile.arm64 similarity index 100% rename from sys/boot/Makefile.arm64 rename to stand/Makefile.arm64 diff --git a/sys/boot/Makefile.i386 b/stand/Makefile.i386 similarity index 78% rename from sys/boot/Makefile.i386 rename to stand/Makefile.i386 index a5c6f673477c..fb53744ab5ae 100644 --- a/sys/boot/Makefile.i386 +++ b/stand/Makefile.i386 @@ -1,9 +1,10 @@ # $FreeBSD$ -SUBDIR+= libsa32 .if ${LOADER_GELI_SUPPORT:Uyes} == "yes" SUBDIR+= geli .endif +.if ${MK_ZFS} != "no" SUBDIR+= zfs +.endif SUBDIR+= efi diff --git a/sys/boot/Makefile.inc b/stand/Makefile.inc similarity index 100% rename from sys/boot/Makefile.inc rename to stand/Makefile.inc diff --git a/sys/boot/Makefile.mips b/stand/Makefile.mips similarity index 100% rename from sys/boot/Makefile.mips rename to stand/Makefile.mips diff --git a/sys/boot/Makefile.powerpc b/stand/Makefile.powerpc similarity index 100% rename from sys/boot/Makefile.powerpc rename to stand/Makefile.powerpc diff --git a/sys/boot/Makefile.sparc64 b/stand/Makefile.sparc64 similarity index 58% rename from sys/boot/Makefile.sparc64 rename to stand/Makefile.sparc64 index 1064a267db4a..40b42e9c18e1 100644 --- a/sys/boot/Makefile.sparc64 +++ b/stand/Makefile.sparc64 @@ -1,4 +1,6 @@ # $FreeBSD$ SUBDIR+= ofw +.if ${MK_ZFS} != "no" SUBDIR+= zfs +.endif diff --git a/sys/boot/arm/Makefile b/stand/arm/Makefile similarity index 100% rename from sys/boot/arm/Makefile rename to stand/arm/Makefile diff --git a/sys/boot/arm/Makefile.inc b/stand/arm/Makefile.inc similarity index 100% rename from sys/boot/arm/Makefile.inc rename to stand/arm/Makefile.inc diff --git a/sys/boot/arm/uboot/loader.conf b/stand/arm/loader/loader.conf similarity index 100% rename from sys/boot/arm/uboot/loader.conf rename to stand/arm/loader/loader.conf diff --git a/sys/boot/arm/uboot/Makefile b/stand/arm/uboot/Makefile similarity index 78% rename from sys/boot/arm/uboot/Makefile rename to stand/arm/uboot/Makefile index 0db9f96d32d2..5bf7d533b942 100644 --- a/sys/boot/arm/uboot/Makefile +++ b/stand/arm/uboot/Makefile @@ -9,11 +9,10 @@ LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no -LOADER_FDT_SUPPORT= ${MK_FDT} .include -FILES= ubldr ubldr.bin +FILES+= ubldr ubldr.bin NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b @@ -29,11 +28,10 @@ SRCS= start.S conf.c self_reloc.c vers.c CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif +HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt + # Always add MI sources .include "${BOOTSRC}/loader.mk" -CFLAGS+= -I. - -CLEANFILES+= loader.help CFLAGS+= -ffreestanding -msoft-float @@ -50,10 +48,6 @@ LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} -loader.help: help.common help.uboot ${BOOTSRC}/fdt/help.fdt - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - ldscript.abs: echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} @@ -73,15 +67,4 @@ ubldr.bin: ubldr.pie CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin -.if !defined(LOADER_ONLY) -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -# Install loader.rc. -FILES+= loader.rc -# Put sample menu.rc on disk but don't enable it by default. -FILES+= menu.rc -FILESNAME_menu.rc= menu.rc.sample -.endif - .include diff --git a/sys/boot/arm/uboot/conf.c b/stand/arm/uboot/conf.c similarity index 100% rename from sys/boot/arm/uboot/conf.c rename to stand/arm/uboot/conf.c diff --git a/sys/boot/arm/uboot/help.uboot b/stand/arm/uboot/help.uboot similarity index 100% rename from sys/boot/arm/uboot/help.uboot rename to stand/arm/uboot/help.uboot diff --git a/sys/boot/arm/uboot/ldscript.arm b/stand/arm/uboot/ldscript.arm similarity index 100% rename from sys/boot/arm/uboot/ldscript.arm rename to stand/arm/uboot/ldscript.arm diff --git a/sys/boot/arm/uboot/start.S b/stand/arm/uboot/start.S similarity index 100% rename from sys/boot/arm/uboot/start.S rename to stand/arm/uboot/start.S diff --git a/sys/boot/arm/uboot/version b/stand/arm/uboot/version similarity index 100% rename from sys/boot/arm/uboot/version rename to stand/arm/uboot/version diff --git a/sys/boot/arm64/Makefile b/stand/arm64/Makefile similarity index 100% rename from sys/boot/arm64/Makefile rename to stand/arm64/Makefile diff --git a/sys/boot/arm64/libarm64/cache.c b/stand/arm64/libarm64/cache.c similarity index 100% rename from sys/boot/arm64/libarm64/cache.c rename to stand/arm64/libarm64/cache.c diff --git a/sys/boot/arm64/libarm64/cache.h b/stand/arm64/libarm64/cache.h similarity index 100% rename from sys/boot/arm64/libarm64/cache.h rename to stand/arm64/libarm64/cache.h diff --git a/sys/boot/common/Makefile.depend b/stand/common/Makefile.depend similarity index 100% rename from sys/boot/common/Makefile.depend rename to stand/common/Makefile.depend diff --git a/sys/boot/common/bcache.c b/stand/common/bcache.c similarity index 100% rename from sys/boot/common/bcache.c rename to stand/common/bcache.c diff --git a/sys/boot/common/boot.c b/stand/common/boot.c similarity index 100% rename from sys/boot/common/boot.c rename to stand/common/boot.c diff --git a/sys/boot/common/bootstrap.h b/stand/common/bootstrap.h similarity index 100% rename from sys/boot/common/bootstrap.h rename to stand/common/bootstrap.h diff --git a/sys/boot/common/commands.c b/stand/common/commands.c similarity index 100% rename from sys/boot/common/commands.c rename to stand/common/commands.c diff --git a/sys/boot/common/console.c b/stand/common/console.c similarity index 100% rename from sys/boot/common/console.c rename to stand/common/console.c diff --git a/sys/boot/common/dev_net.c b/stand/common/dev_net.c similarity index 100% rename from sys/boot/common/dev_net.c rename to stand/common/dev_net.c diff --git a/sys/boot/common/dev_net.h b/stand/common/dev_net.h similarity index 100% rename from sys/boot/common/dev_net.h rename to stand/common/dev_net.h diff --git a/sys/boot/common/devopen.c b/stand/common/devopen.c similarity index 100% rename from sys/boot/common/devopen.c rename to stand/common/devopen.c diff --git a/sys/boot/common/disk.c b/stand/common/disk.c similarity index 100% rename from sys/boot/common/disk.c rename to stand/common/disk.c diff --git a/sys/boot/common/disk.h b/stand/common/disk.h similarity index 100% rename from sys/boot/common/disk.h rename to stand/common/disk.h diff --git a/sys/boot/common/help.common b/stand/common/help.common similarity index 100% rename from sys/boot/common/help.common rename to stand/common/help.common diff --git a/sys/boot/common/install.c b/stand/common/install.c similarity index 100% rename from sys/boot/common/install.c rename to stand/common/install.c diff --git a/sys/boot/common/interp.c b/stand/common/interp.c similarity index 100% rename from sys/boot/common/interp.c rename to stand/common/interp.c diff --git a/sys/boot/common/interp_backslash.c b/stand/common/interp_backslash.c similarity index 100% rename from sys/boot/common/interp_backslash.c rename to stand/common/interp_backslash.c diff --git a/sys/boot/common/interp_forth.c b/stand/common/interp_forth.c similarity index 100% rename from sys/boot/common/interp_forth.c rename to stand/common/interp_forth.c diff --git a/sys/boot/common/interp_parse.c b/stand/common/interp_parse.c similarity index 100% rename from sys/boot/common/interp_parse.c rename to stand/common/interp_parse.c diff --git a/sys/boot/common/isapnp.c b/stand/common/isapnp.c similarity index 100% rename from sys/boot/common/isapnp.c rename to stand/common/isapnp.c diff --git a/sys/boot/common/isapnp.h b/stand/common/isapnp.h similarity index 100% rename from sys/boot/common/isapnp.h rename to stand/common/isapnp.h diff --git a/sys/boot/common/load_elf.c b/stand/common/load_elf.c similarity index 100% rename from sys/boot/common/load_elf.c rename to stand/common/load_elf.c diff --git a/sys/boot/common/load_elf32.c b/stand/common/load_elf32.c similarity index 100% rename from sys/boot/common/load_elf32.c rename to stand/common/load_elf32.c diff --git a/sys/boot/common/load_elf32_obj.c b/stand/common/load_elf32_obj.c similarity index 100% rename from sys/boot/common/load_elf32_obj.c rename to stand/common/load_elf32_obj.c diff --git a/sys/boot/common/load_elf64.c b/stand/common/load_elf64.c similarity index 100% rename from sys/boot/common/load_elf64.c rename to stand/common/load_elf64.c diff --git a/sys/boot/common/load_elf64_obj.c b/stand/common/load_elf64_obj.c similarity index 100% rename from sys/boot/common/load_elf64_obj.c rename to stand/common/load_elf64_obj.c diff --git a/sys/boot/common/load_elf_obj.c b/stand/common/load_elf_obj.c similarity index 100% rename from sys/boot/common/load_elf_obj.c rename to stand/common/load_elf_obj.c diff --git a/sys/boot/common/ls.c b/stand/common/ls.c similarity index 100% rename from sys/boot/common/ls.c rename to stand/common/ls.c diff --git a/sys/boot/common/md.c b/stand/common/md.c similarity index 100% rename from sys/boot/common/md.c rename to stand/common/md.c diff --git a/sys/boot/common/merge_help.awk b/stand/common/merge_help.awk similarity index 100% rename from sys/boot/common/merge_help.awk rename to stand/common/merge_help.awk diff --git a/sys/boot/common/misc.c b/stand/common/misc.c similarity index 100% rename from sys/boot/common/misc.c rename to stand/common/misc.c diff --git a/sys/boot/common/module.c b/stand/common/module.c similarity index 100% rename from sys/boot/common/module.c rename to stand/common/module.c diff --git a/sys/boot/common/newvers.sh b/stand/common/newvers.sh similarity index 100% rename from sys/boot/common/newvers.sh rename to stand/common/newvers.sh diff --git a/sys/boot/common/part.c b/stand/common/part.c similarity index 100% rename from sys/boot/common/part.c rename to stand/common/part.c diff --git a/sys/boot/common/part.h b/stand/common/part.h similarity index 100% rename from sys/boot/common/part.h rename to stand/common/part.h diff --git a/sys/boot/common/paths.h b/stand/common/paths.h similarity index 100% rename from sys/boot/common/paths.h rename to stand/common/paths.h diff --git a/sys/boot/common/pnp.c b/stand/common/pnp.c similarity index 100% rename from sys/boot/common/pnp.c rename to stand/common/pnp.c diff --git a/sys/boot/common/rbx.h b/stand/common/rbx.h similarity index 100% rename from sys/boot/common/rbx.h rename to stand/common/rbx.h diff --git a/sys/boot/common/reloc_elf.c b/stand/common/reloc_elf.c similarity index 100% rename from sys/boot/common/reloc_elf.c rename to stand/common/reloc_elf.c diff --git a/sys/boot/common/reloc_elf32.c b/stand/common/reloc_elf32.c similarity index 100% rename from sys/boot/common/reloc_elf32.c rename to stand/common/reloc_elf32.c diff --git a/sys/boot/common/reloc_elf64.c b/stand/common/reloc_elf64.c similarity index 100% rename from sys/boot/common/reloc_elf64.c rename to stand/common/reloc_elf64.c diff --git a/sys/boot/common/self_reloc.c b/stand/common/self_reloc.c similarity index 100% rename from sys/boot/common/self_reloc.c rename to stand/common/self_reloc.c diff --git a/sys/boot/defs.mk b/stand/defs.mk similarity index 81% rename from sys/boot/defs.mk rename to stand/defs.mk index 75c354c6254a..20e9a7786413 100644 --- a/sys/boot/defs.mk +++ b/stand/defs.mk @@ -5,7 +5,7 @@ .if !defined(__BOOT_DEFS_MK__) __BOOT_DEFS_MK__=${MFILE} -BOOTSRC= ${SRCTOP}/sys/boot +BOOTSRC= ${SRCTOP}/stand EFISRC= ${BOOTSRC}/efi EFIINC= ${EFISRC}/include EFIINCMD= ${EFIINC}/${MACHINE} @@ -17,7 +17,7 @@ SYSDIR= ${SRCTOP}/sys UBOOTSRC= ${BOOTSRC}/uboot ZFSSRC= ${BOOTSRC}/zfs -BOOTOBJ= ${OBJTOP}/sys/boot +BOOTOBJ= ${OBJTOP}/stand # BINDIR is where we install BINDIR?= /boot @@ -85,10 +85,26 @@ CFLAGS+= -DLOADER_GPT_SUPPORT .if ${LOADER_MBR_SUPPORT:Uyes} == "yes" CFLAGS+= -DLOADER_MBR_SUPPORT .endif -.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" -CFLAGS+= -DLOADER_GELI_SUPPORT + +# GELI Support, with backward compat hooks +.if defined(HAVE_GELI) +.if defined(LOADER_NO_GELI_SUPPORT) +MK_LOADER_GELI=no +.warning "Please move from LOADER_NO_GELI_SUPPORT to WITHOUT_LOADER_GELI" +.endif +.if defined(LOADER_GELI_SUPPORT) +MK_LOADER_GELI=yes +.warning "Please move from LOADER_GELI_SUPPORT to WITH_LOADER_GELI" +.endif +.if ${MK_LOADER_GELI} == "yes" +CFLAGS+= -DLOADER_GELI_SUPPORT +CFLAGS+= -I${BOOTSRC}/geli +LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a .endif .endif +.endif + +CFLAGS+= -I${SYSDIR} # All PowerPC builds are 32 bit. We have no 64-bit loaders on powerpc # or powerpc64. @@ -106,6 +122,9 @@ LD_FLAGS+= -m elf_i386_fbsd AFLAGS+= --32 .endif +# Make sure we use the machine link we're about to create +CFLAGS+=-I. + _ILINKS=machine .if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64" _ILINKS+=${MACHINE_CPUARCH} @@ -145,4 +164,8 @@ ${_ILINKS}: ${ECHO} ${.TARGET:T} "->" $$path ; \ ln -fhs $$path ${.TARGET:T} +# For loader implementations, we generate a loader.help file. This can be suppressed by +# setting HELP_FILES to nothing. +HELP_FILES= ${LDRSRC}/help.common + .endif # __BOOT_DEFS_MK__ diff --git a/sys/boot/efi/Makefile b/stand/efi/Makefile similarity index 100% rename from sys/boot/efi/Makefile rename to stand/efi/Makefile diff --git a/sys/boot/efi/Makefile.inc b/stand/efi/Makefile.inc similarity index 100% rename from sys/boot/efi/Makefile.inc rename to stand/efi/Makefile.inc diff --git a/sys/boot/efi/boot1/Makefile b/stand/efi/boot1/Makefile similarity index 98% rename from sys/boot/efi/boot1/Makefile rename to stand/efi/boot1/Makefile index 8f5aed50dce4..f2e69460593d 100644 --- a/sys/boot/efi/boot1/Makefile +++ b/stand/efi/boot1/Makefile @@ -41,11 +41,9 @@ LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif -CFLAGS+= -I. CFLAGS+= -I${EFIINC} CFLAGS+= -I${EFIINCMD} CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include -CFLAGS+= -I${SYSDIR} CFLAGS+= -DEFI_UFS_BOOT .ifdef(EFI_DEBUG) CFLAGS+= -DEFI_DEBUG @@ -126,6 +124,6 @@ boot1.efifat: boot1.efi xz -d -c ${.CURDIR}/fat-${MACHINE}.tmpl.xz > ${.TARGET} ${DD} if=${.ALLSRC} of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc -CLEANFILES= boot1.efi boot1.efifat +CLEANFILES+= boot1.efi boot1.efifat .include diff --git a/sys/boot/efi/boot1/Makefile.depend b/stand/efi/boot1/Makefile.depend similarity index 79% rename from sys/boot/efi/boot1/Makefile.depend rename to stand/efi/boot1/Makefile.depend index 813358d57274..ffc5430cceec 100644 --- a/sys/boot/efi/boot1/Makefile.depend +++ b/stand/efi/boot1/Makefile.depend @@ -5,9 +5,9 @@ DIRDEPS = \ include \ include/xlocale \ lib/libmd \ - sys/boot/efi/libefi \ - sys/boot/libsa \ - sys/boot/zfs \ + stand/efi/libefi \ + stand/libsa \ + stand/zfs \ .include diff --git a/sys/boot/efi/boot1/Makefile.fat b/stand/efi/boot1/Makefile.fat similarity index 100% rename from sys/boot/efi/boot1/Makefile.fat rename to stand/efi/boot1/Makefile.fat diff --git a/sys/boot/efi/boot1/boot1.c b/stand/efi/boot1/boot1.c similarity index 98% rename from sys/boot/efi/boot1/boot1.c rename to stand/efi/boot1/boot1.c index e2152f52bc0e..b7cb57f45530 100644 --- a/sys/boot/efi/boot1/boot1.c +++ b/stand/efi/boot1/boot1.c @@ -460,9 +460,11 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) imgpath = NULL; if (status == EFI_SUCCESS) { text = efi_devpath_name(img->FilePath); - printf(" Load Path: %S\n", text); - efi_setenv_freebsd_wcs("Boot1Path", text); - efi_free_devpath_name(text); + if (text != NULL) { + printf(" Load Path: %S\n", text); + efi_setenv_freebsd_wcs("Boot1Path", text); + efi_free_devpath_name(text); + } status = BS->HandleProtocol(img->DeviceHandle, &DevicePathGUID, (void **)&imgpath); @@ -471,11 +473,12 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) EFI_ERROR_CODE(status)); } else { text = efi_devpath_name(imgpath); - printf(" Load Device: %S\n", text); - efi_setenv_freebsd_wcs("Boot1Dev", text); - efi_free_devpath_name(text); + if (text != NULL) { + printf(" Load Device: %S\n", text); + efi_setenv_freebsd_wcs("Boot1Dev", text); + efi_free_devpath_name(text); + } } - } /* Get all the device handles */ diff --git a/sys/boot/efi/boot1/boot_module.h b/stand/efi/boot1/boot_module.h similarity index 100% rename from sys/boot/efi/boot1/boot_module.h rename to stand/efi/boot1/boot_module.h diff --git a/sys/boot/efi/boot1/fat-amd64.tmpl.xz b/stand/efi/boot1/fat-amd64.tmpl.xz similarity index 100% rename from sys/boot/efi/boot1/fat-amd64.tmpl.xz rename to stand/efi/boot1/fat-amd64.tmpl.xz diff --git a/sys/boot/efi/boot1/fat-arm.tmpl.xz b/stand/efi/boot1/fat-arm.tmpl.xz similarity index 100% rename from sys/boot/efi/boot1/fat-arm.tmpl.xz rename to stand/efi/boot1/fat-arm.tmpl.xz diff --git a/sys/boot/efi/boot1/fat-arm64.tmpl.xz b/stand/efi/boot1/fat-arm64.tmpl.xz similarity index 100% rename from sys/boot/efi/boot1/fat-arm64.tmpl.xz rename to stand/efi/boot1/fat-arm64.tmpl.xz diff --git a/sys/boot/efi/boot1/fat-i386.tmpl.xz b/stand/efi/boot1/fat-i386.tmpl.xz similarity index 100% rename from sys/boot/efi/boot1/fat-i386.tmpl.xz rename to stand/efi/boot1/fat-i386.tmpl.xz diff --git a/sys/boot/efi/boot1/generate-fat.sh b/stand/efi/boot1/generate-fat.sh similarity index 100% rename from sys/boot/efi/boot1/generate-fat.sh rename to stand/efi/boot1/generate-fat.sh diff --git a/sys/boot/efi/boot1/ufs_module.c b/stand/efi/boot1/ufs_module.c similarity index 100% rename from sys/boot/efi/boot1/ufs_module.c rename to stand/efi/boot1/ufs_module.c diff --git a/sys/boot/efi/boot1/zfs_module.c b/stand/efi/boot1/zfs_module.c similarity index 100% rename from sys/boot/efi/boot1/zfs_module.c rename to stand/efi/boot1/zfs_module.c diff --git a/sys/boot/efi/fdt/Makefile b/stand/efi/fdt/Makefile similarity index 92% rename from sys/boot/efi/fdt/Makefile rename to stand/efi/fdt/Makefile index 01dbeed05eaf..7308ce94e45e 100644 --- a/sys/boot/efi/fdt/Makefile +++ b/stand/efi/fdt/Makefile @@ -25,6 +25,6 @@ CFLAGS+= -I${EFISRC}/include/${MACHINE} CFLAGS+= -I${FDTSRC} # Pick up the bootstrap header for some interface items -CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. +CFLAGS+= -I${LDRSRC} .include diff --git a/sys/boot/efi/fdt/Makefile.depend b/stand/efi/fdt/Makefile.depend similarity index 100% rename from sys/boot/efi/fdt/Makefile.depend rename to stand/efi/fdt/Makefile.depend diff --git a/sys/boot/efi/fdt/efi_fdt.c b/stand/efi/fdt/efi_fdt.c similarity index 100% rename from sys/boot/efi/fdt/efi_fdt.c rename to stand/efi/fdt/efi_fdt.c diff --git a/sys/boot/efi/include/README b/stand/efi/include/README similarity index 100% rename from sys/boot/efi/include/README rename to stand/efi/include/README diff --git a/sys/boot/efi/include/amd64/efibind.h b/stand/efi/include/amd64/efibind.h similarity index 100% rename from sys/boot/efi/include/amd64/efibind.h rename to stand/efi/include/amd64/efibind.h diff --git a/sys/boot/efi/include/amd64/pe.h b/stand/efi/include/amd64/pe.h similarity index 100% rename from sys/boot/efi/include/amd64/pe.h rename to stand/efi/include/amd64/pe.h diff --git a/sys/boot/efi/include/arm/efibind.h b/stand/efi/include/arm/efibind.h similarity index 100% rename from sys/boot/efi/include/arm/efibind.h rename to stand/efi/include/arm/efibind.h diff --git a/sys/boot/efi/include/arm64/efibind.h b/stand/efi/include/arm64/efibind.h similarity index 100% rename from sys/boot/efi/include/arm64/efibind.h rename to stand/efi/include/arm64/efibind.h diff --git a/sys/boot/efi/include/efi.h b/stand/efi/include/efi.h similarity index 100% rename from sys/boot/efi/include/efi.h rename to stand/efi/include/efi.h diff --git a/sys/boot/efi/include/efi_driver_utils.h b/stand/efi/include/efi_driver_utils.h similarity index 100% rename from sys/boot/efi/include/efi_driver_utils.h rename to stand/efi/include/efi_driver_utils.h diff --git a/sys/boot/efi/include/efi_drivers.h b/stand/efi/include/efi_drivers.h similarity index 100% rename from sys/boot/efi/include/efi_drivers.h rename to stand/efi/include/efi_drivers.h diff --git a/sys/boot/efi/include/efi_nii.h b/stand/efi/include/efi_nii.h similarity index 100% rename from sys/boot/efi/include/efi_nii.h rename to stand/efi/include/efi_nii.h diff --git a/sys/boot/efi/include/efiapi.h b/stand/efi/include/efiapi.h similarity index 100% rename from sys/boot/efi/include/efiapi.h rename to stand/efi/include/efiapi.h diff --git a/sys/boot/efi/include/efichar.h b/stand/efi/include/efichar.h similarity index 100% rename from sys/boot/efi/include/efichar.h rename to stand/efi/include/efichar.h diff --git a/sys/boot/efi/include/eficon.h b/stand/efi/include/eficon.h similarity index 100% rename from sys/boot/efi/include/eficon.h rename to stand/efi/include/eficon.h diff --git a/sys/boot/efi/include/eficonsctl.h b/stand/efi/include/eficonsctl.h similarity index 100% rename from sys/boot/efi/include/eficonsctl.h rename to stand/efi/include/eficonsctl.h diff --git a/sys/boot/efi/include/efidebug.h b/stand/efi/include/efidebug.h similarity index 100% rename from sys/boot/efi/include/efidebug.h rename to stand/efi/include/efidebug.h diff --git a/sys/boot/efi/include/efidef.h b/stand/efi/include/efidef.h similarity index 100% rename from sys/boot/efi/include/efidef.h rename to stand/efi/include/efidef.h diff --git a/sys/boot/efi/include/efidevp.h b/stand/efi/include/efidevp.h similarity index 100% rename from sys/boot/efi/include/efidevp.h rename to stand/efi/include/efidevp.h diff --git a/sys/boot/efi/include/efierr.h b/stand/efi/include/efierr.h similarity index 100% rename from sys/boot/efi/include/efierr.h rename to stand/efi/include/efierr.h diff --git a/sys/boot/efi/include/efifpswa.h b/stand/efi/include/efifpswa.h similarity index 100% rename from sys/boot/efi/include/efifpswa.h rename to stand/efi/include/efifpswa.h diff --git a/sys/boot/efi/include/efifs.h b/stand/efi/include/efifs.h similarity index 100% rename from sys/boot/efi/include/efifs.h rename to stand/efi/include/efifs.h diff --git a/sys/boot/efi/include/efigop.h b/stand/efi/include/efigop.h similarity index 100% rename from sys/boot/efi/include/efigop.h rename to stand/efi/include/efigop.h diff --git a/sys/boot/efi/include/efilib.h b/stand/efi/include/efilib.h similarity index 100% rename from sys/boot/efi/include/efilib.h rename to stand/efi/include/efilib.h diff --git a/sys/boot/efi/include/efinet.h b/stand/efi/include/efinet.h similarity index 100% rename from sys/boot/efi/include/efinet.h rename to stand/efi/include/efinet.h diff --git a/sys/boot/efi/include/efipart.h b/stand/efi/include/efipart.h similarity index 100% rename from sys/boot/efi/include/efipart.h rename to stand/efi/include/efipart.h diff --git a/sys/boot/efi/include/efipciio.h b/stand/efi/include/efipciio.h similarity index 100% rename from sys/boot/efi/include/efipciio.h rename to stand/efi/include/efipciio.h diff --git a/sys/boot/efi/include/efiprot.h b/stand/efi/include/efiprot.h similarity index 100% rename from sys/boot/efi/include/efiprot.h rename to stand/efi/include/efiprot.h diff --git a/sys/boot/efi/include/efipxebc.h b/stand/efi/include/efipxebc.h similarity index 100% rename from sys/boot/efi/include/efipxebc.h rename to stand/efi/include/efipxebc.h diff --git a/sys/boot/efi/include/efiser.h b/stand/efi/include/efiser.h similarity index 100% rename from sys/boot/efi/include/efiser.h rename to stand/efi/include/efiser.h diff --git a/sys/boot/efi/include/efistdarg.h b/stand/efi/include/efistdarg.h similarity index 100% rename from sys/boot/efi/include/efistdarg.h rename to stand/efi/include/efistdarg.h diff --git a/sys/boot/efi/include/efiuga.h b/stand/efi/include/efiuga.h similarity index 100% rename from sys/boot/efi/include/efiuga.h rename to stand/efi/include/efiuga.h diff --git a/sys/boot/efi/include/efizfs.h b/stand/efi/include/efizfs.h similarity index 100% rename from sys/boot/efi/include/efizfs.h rename to stand/efi/include/efizfs.h diff --git a/sys/boot/efi/include/i386/efibind.h b/stand/efi/include/i386/efibind.h similarity index 100% rename from sys/boot/efi/include/i386/efibind.h rename to stand/efi/include/i386/efibind.h diff --git a/sys/boot/efi/include/i386/pe.h b/stand/efi/include/i386/pe.h similarity index 100% rename from sys/boot/efi/include/i386/pe.h rename to stand/efi/include/i386/pe.h diff --git a/sys/boot/efi/libefi/Makefile b/stand/efi/libefi/Makefile similarity index 98% rename from sys/boot/efi/libefi/Makefile rename to stand/efi/libefi/Makefile index 99fe2bde2f98..e0ffd7b80f62 100644 --- a/sys/boot/efi/libefi/Makefile +++ b/stand/efi/libefi/Makefile @@ -34,7 +34,6 @@ CFLAGS+= -mgeneral-regs-only .if ${MACHINE_ARCH} == "amd64" CFLAGS+= -fPIC -mno-red-zone .endif -CFLAGS+= -I${SYSDIR} CFLAGS+= -I${EFIINC} CFLAGS+= -I${EFIINCMD} .if ${MK_ZFS} != "no" diff --git a/sys/boot/efi/libefi/Makefile.depend b/stand/efi/libefi/Makefile.depend similarity index 100% rename from sys/boot/efi/libefi/Makefile.depend rename to stand/efi/libefi/Makefile.depend diff --git a/sys/boot/efi/libefi/delay.c b/stand/efi/libefi/delay.c similarity index 100% rename from sys/boot/efi/libefi/delay.c rename to stand/efi/libefi/delay.c diff --git a/sys/boot/efi/libefi/devicename.c b/stand/efi/libefi/devicename.c similarity index 100% rename from sys/boot/efi/libefi/devicename.c rename to stand/efi/libefi/devicename.c diff --git a/sys/boot/efi/libefi/devpath.c b/stand/efi/libefi/devpath.c similarity index 100% rename from sys/boot/efi/libefi/devpath.c rename to stand/efi/libefi/devpath.c diff --git a/sys/boot/efi/libefi/efi_console.c b/stand/efi/libefi/efi_console.c similarity index 100% rename from sys/boot/efi/libefi/efi_console.c rename to stand/efi/libefi/efi_console.c diff --git a/sys/boot/efi/libefi/efi_driver_utils.c b/stand/efi/libefi/efi_driver_utils.c similarity index 100% rename from sys/boot/efi/libefi/efi_driver_utils.c rename to stand/efi/libefi/efi_driver_utils.c diff --git a/sys/boot/efi/libefi/efichar.c b/stand/efi/libefi/efichar.c similarity index 100% rename from sys/boot/efi/libefi/efichar.c rename to stand/efi/libefi/efichar.c diff --git a/sys/boot/efi/libefi/efinet.c b/stand/efi/libefi/efinet.c similarity index 100% rename from sys/boot/efi/libefi/efinet.c rename to stand/efi/libefi/efinet.c diff --git a/sys/boot/efi/libefi/efipart.c b/stand/efi/libefi/efipart.c similarity index 100% rename from sys/boot/efi/libefi/efipart.c rename to stand/efi/libefi/efipart.c diff --git a/sys/boot/efi/libefi/efizfs.c b/stand/efi/libefi/efizfs.c similarity index 100% rename from sys/boot/efi/libefi/efizfs.c rename to stand/efi/libefi/efizfs.c diff --git a/sys/boot/efi/libefi/env.c b/stand/efi/libefi/env.c similarity index 100% rename from sys/boot/efi/libefi/env.c rename to stand/efi/libefi/env.c diff --git a/sys/boot/efi/libefi/errno.c b/stand/efi/libefi/errno.c similarity index 100% rename from sys/boot/efi/libefi/errno.c rename to stand/efi/libefi/errno.c diff --git a/sys/boot/efi/libefi/handles.c b/stand/efi/libefi/handles.c similarity index 100% rename from sys/boot/efi/libefi/handles.c rename to stand/efi/libefi/handles.c diff --git a/sys/boot/efi/libefi/libefi.c b/stand/efi/libefi/libefi.c similarity index 100% rename from sys/boot/efi/libefi/libefi.c rename to stand/efi/libefi/libefi.c diff --git a/sys/boot/efi/libefi/time.c b/stand/efi/libefi/time.c similarity index 100% rename from sys/boot/efi/libefi/time.c rename to stand/efi/libefi/time.c diff --git a/sys/boot/efi/libefi/time_event.c b/stand/efi/libefi/time_event.c similarity index 100% rename from sys/boot/efi/libefi/time_event.c rename to stand/efi/libefi/time_event.c diff --git a/sys/boot/efi/libefi/wchar.c b/stand/efi/libefi/wchar.c similarity index 100% rename from sys/boot/efi/libefi/wchar.c rename to stand/efi/libefi/wchar.c diff --git a/sys/boot/efi/loader/Makefile b/stand/efi/loader/Makefile similarity index 93% rename from sys/boot/efi/loader/Makefile rename to stand/efi/loader/Makefile index 82852da1733e..a3a23c87dfe7 100644 --- a/sys/boot/efi/loader/Makefile +++ b/stand/efi/loader/Makefile @@ -55,7 +55,6 @@ CFLAGS+= -I${.CURDIR}/arch/${MACHINE} CFLAGS+= -I${EFISRC}/include CFLAGS+= -I${EFISRC}/include/${MACHINE} CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include -CFLAGS+= -I${SYSDIR} CFLAGS+= -I${BOOTSRC}/i386/libi386 CFLAGS+= -DNO_PCI -DEFI @@ -71,13 +70,9 @@ CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID .endif .endif -LOADER_FDT_SUPPORT?= no -.if ${MK_FDT} != "no" && ${LOADER_FDT_SUPPORT} != "no" -CFLAGS+= -I${BOOTSRC}/fdt -CFLAGS+= -I${BOOTSRC}/fdt -CFLAGS+= -DLOADER_FDT_SUPPORT +.if defined(HAVE_FDT) && ${MK_FDT} != "no" +.include "${BOOTSRC}/fdt.mk" LIBEFI_FDT= ${BOOTOBJ}/efi/fdt/libefi_fdt.a -LIBFDT= ${BOOTOBJ}/fdt/libfdt.a .endif # Include bcache code. @@ -88,6 +83,7 @@ CFLAGS+= -DEFI_STAGING_SIZE=${EFI_STAGING_SIZE} .endif # Always add MI sources +HELP_FILES= .include "${BOOTSRC}/loader.mk" FILES+= loader.efi diff --git a/sys/boot/efi/loader/Makefile.depend b/stand/efi/loader/Makefile.depend similarity index 73% rename from sys/boot/efi/loader/Makefile.depend rename to stand/efi/loader/Makefile.depend index 6eec9589d9fa..657c40116b4d 100644 --- a/sys/boot/efi/loader/Makefile.depend +++ b/stand/efi/loader/Makefile.depend @@ -4,10 +4,10 @@ DIRDEPS = \ include \ include/xlocale \ - sys/boot/efi/libefi \ - sys/boot/ficl \ - sys/boot/libsa \ - sys/boot/zfs \ + stand/efi/libefi \ + stand/ficl \ + stand/libsa \ + stand/zfs \ .include diff --git a/sys/boot/efi/loader/arch/amd64/Makefile.inc b/stand/efi/loader/arch/amd64/Makefile.inc similarity index 100% rename from sys/boot/efi/loader/arch/amd64/Makefile.inc rename to stand/efi/loader/arch/amd64/Makefile.inc diff --git a/sys/boot/efi/loader/arch/amd64/amd64_tramp.S b/stand/efi/loader/arch/amd64/amd64_tramp.S similarity index 100% rename from sys/boot/efi/loader/arch/amd64/amd64_tramp.S rename to stand/efi/loader/arch/amd64/amd64_tramp.S diff --git a/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c b/stand/efi/loader/arch/amd64/elf64_freebsd.c similarity index 100% rename from sys/boot/efi/loader/arch/amd64/elf64_freebsd.c rename to stand/efi/loader/arch/amd64/elf64_freebsd.c diff --git a/sys/boot/efi/loader/arch/amd64/exc.S b/stand/efi/loader/arch/amd64/exc.S similarity index 100% rename from sys/boot/efi/loader/arch/amd64/exc.S rename to stand/efi/loader/arch/amd64/exc.S diff --git a/sys/boot/efi/loader/arch/amd64/ldscript.amd64 b/stand/efi/loader/arch/amd64/ldscript.amd64 similarity index 100% rename from sys/boot/efi/loader/arch/amd64/ldscript.amd64 rename to stand/efi/loader/arch/amd64/ldscript.amd64 diff --git a/sys/boot/efi/loader/arch/amd64/start.S b/stand/efi/loader/arch/amd64/start.S similarity index 100% rename from sys/boot/efi/loader/arch/amd64/start.S rename to stand/efi/loader/arch/amd64/start.S diff --git a/sys/boot/efi/loader/arch/amd64/trap.c b/stand/efi/loader/arch/amd64/trap.c similarity index 100% rename from sys/boot/efi/loader/arch/amd64/trap.c rename to stand/efi/loader/arch/amd64/trap.c diff --git a/sys/boot/efi/loader/arch/arm/Makefile.inc b/stand/efi/loader/arch/arm/Makefile.inc similarity index 62% rename from sys/boot/efi/loader/arch/arm/Makefile.inc rename to stand/efi/loader/arch/arm/Makefile.inc index b2876ca19518..74e6616e991b 100644 --- a/sys/boot/efi/loader/arch/arm/Makefile.inc +++ b/stand/efi/loader/arch/arm/Makefile.inc @@ -3,4 +3,4 @@ SRCS+= exec.c \ start.S -LOADER_FDT_SUPPORT=yes +HAVE_FDT=yes diff --git a/sys/boot/efi/loader/arch/arm/exec.c b/stand/efi/loader/arch/arm/exec.c similarity index 100% rename from sys/boot/efi/loader/arch/arm/exec.c rename to stand/efi/loader/arch/arm/exec.c diff --git a/sys/boot/efi/loader/arch/arm/ldscript.arm b/stand/efi/loader/arch/arm/ldscript.arm similarity index 100% rename from sys/boot/efi/loader/arch/arm/ldscript.arm rename to stand/efi/loader/arch/arm/ldscript.arm diff --git a/sys/boot/efi/loader/arch/arm/start.S b/stand/efi/loader/arch/arm/start.S similarity index 100% rename from sys/boot/efi/loader/arch/arm/start.S rename to stand/efi/loader/arch/arm/start.S diff --git a/stand/efi/loader/arch/arm64/Makefile.inc b/stand/efi/loader/arch/arm64/Makefile.inc new file mode 100644 index 000000000000..a71bcc2e1a1f --- /dev/null +++ b/stand/efi/loader/arch/arm64/Makefile.inc @@ -0,0 +1,12 @@ +# $FreeBSD$ + +HAVE_FDT=yes + +SRCS+= exec.c \ + start.S + +.PATH: ${BOOTSRC}/arm64/libarm64 +CFLAGS+=-I${BOOTSRC}/arm64/libarm64 +SRCS+= cache.c + +CFLAGS+= -mgeneral-regs-only diff --git a/sys/boot/efi/loader/arch/arm64/exec.c b/stand/efi/loader/arch/arm64/exec.c similarity index 100% rename from sys/boot/efi/loader/arch/arm64/exec.c rename to stand/efi/loader/arch/arm64/exec.c diff --git a/sys/boot/efi/loader/arch/arm64/ldscript.arm64 b/stand/efi/loader/arch/arm64/ldscript.arm64 similarity index 100% rename from sys/boot/efi/loader/arch/arm64/ldscript.arm64 rename to stand/efi/loader/arch/arm64/ldscript.arm64 diff --git a/sys/boot/efi/loader/arch/arm64/start.S b/stand/efi/loader/arch/arm64/start.S similarity index 100% rename from sys/boot/efi/loader/arch/arm64/start.S rename to stand/efi/loader/arch/arm64/start.S diff --git a/sys/boot/efi/loader/arch/i386/Makefile.inc b/stand/efi/loader/arch/i386/Makefile.inc similarity index 100% rename from sys/boot/efi/loader/arch/i386/Makefile.inc rename to stand/efi/loader/arch/i386/Makefile.inc diff --git a/sys/boot/efi/loader/arch/i386/bootinfo.c b/stand/efi/loader/arch/i386/bootinfo.c similarity index 100% rename from sys/boot/efi/loader/arch/i386/bootinfo.c rename to stand/efi/loader/arch/i386/bootinfo.c diff --git a/sys/boot/efi/loader/arch/i386/efimd.c b/stand/efi/loader/arch/i386/efimd.c similarity index 100% rename from sys/boot/efi/loader/arch/i386/efimd.c rename to stand/efi/loader/arch/i386/efimd.c diff --git a/sys/boot/efi/loader/arch/i386/elf32_freebsd.c b/stand/efi/loader/arch/i386/elf32_freebsd.c similarity index 100% rename from sys/boot/efi/loader/arch/i386/elf32_freebsd.c rename to stand/efi/loader/arch/i386/elf32_freebsd.c diff --git a/sys/boot/efi/loader/arch/i386/exec.c b/stand/efi/loader/arch/i386/exec.c similarity index 100% rename from sys/boot/efi/loader/arch/i386/exec.c rename to stand/efi/loader/arch/i386/exec.c diff --git a/sys/boot/efi/loader/arch/i386/i386_copy.c b/stand/efi/loader/arch/i386/i386_copy.c similarity index 100% rename from sys/boot/efi/loader/arch/i386/i386_copy.c rename to stand/efi/loader/arch/i386/i386_copy.c diff --git a/sys/boot/efi/loader/arch/i386/ldscript.i386 b/stand/efi/loader/arch/i386/ldscript.i386 similarity index 100% rename from sys/boot/efi/loader/arch/i386/ldscript.i386 rename to stand/efi/loader/arch/i386/ldscript.i386 diff --git a/sys/boot/efi/loader/arch/i386/start.S b/stand/efi/loader/arch/i386/start.S similarity index 100% rename from sys/boot/efi/loader/arch/i386/start.S rename to stand/efi/loader/arch/i386/start.S diff --git a/sys/boot/efi/loader/autoload.c b/stand/efi/loader/autoload.c similarity index 100% rename from sys/boot/efi/loader/autoload.c rename to stand/efi/loader/autoload.c diff --git a/sys/boot/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c similarity index 100% rename from sys/boot/efi/loader/bootinfo.c rename to stand/efi/loader/bootinfo.c diff --git a/sys/boot/efi/loader/conf.c b/stand/efi/loader/conf.c similarity index 100% rename from sys/boot/efi/loader/conf.c rename to stand/efi/loader/conf.c diff --git a/sys/boot/efi/loader/copy.c b/stand/efi/loader/copy.c similarity index 100% rename from sys/boot/efi/loader/copy.c rename to stand/efi/loader/copy.c diff --git a/sys/boot/efi/loader/efi_main.c b/stand/efi/loader/efi_main.c similarity index 100% rename from sys/boot/efi/loader/efi_main.c rename to stand/efi/loader/efi_main.c diff --git a/sys/boot/efi/loader/framebuffer.c b/stand/efi/loader/framebuffer.c similarity index 100% rename from sys/boot/efi/loader/framebuffer.c rename to stand/efi/loader/framebuffer.c diff --git a/sys/boot/efi/loader/framebuffer.h b/stand/efi/loader/framebuffer.h similarity index 100% rename from sys/boot/efi/loader/framebuffer.h rename to stand/efi/loader/framebuffer.h diff --git a/sys/boot/efi/loader/loader_efi.h b/stand/efi/loader/loader_efi.h similarity index 100% rename from sys/boot/efi/loader/loader_efi.h rename to stand/efi/loader/loader_efi.h diff --git a/sys/boot/efi/loader/main.c b/stand/efi/loader/main.c similarity index 100% rename from sys/boot/efi/loader/main.c rename to stand/efi/loader/main.c diff --git a/sys/boot/efi/loader/version b/stand/efi/loader/version similarity index 100% rename from sys/boot/efi/loader/version rename to stand/efi/loader/version diff --git a/stand/fdt.mk b/stand/fdt.mk new file mode 100644 index 000000000000..4d4794d980f2 --- /dev/null +++ b/stand/fdt.mk @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.if ${MK_FDT} == "yes" +CFLAGS+= -I${FDTSRC} +CFLAGS+= -I${BOOTOBJ}/fdt +CFLAGS+= -I${SYSDIR}/contrib/libfdt +CFLAGS+= -DLOADER_FDT_SUPPORT +LIBFDT= ${BOOTOBJ}/fdt/libfdt.a +.endif diff --git a/sys/boot/fdt/Makefile b/stand/fdt/Makefile similarity index 100% rename from sys/boot/fdt/Makefile rename to stand/fdt/Makefile diff --git a/sys/boot/fdt/Makefile.depend b/stand/fdt/Makefile.depend similarity index 100% rename from sys/boot/fdt/Makefile.depend rename to stand/fdt/Makefile.depend diff --git a/sys/boot/fdt/fdt_loader_cmd.c b/stand/fdt/fdt_loader_cmd.c similarity index 100% rename from sys/boot/fdt/fdt_loader_cmd.c rename to stand/fdt/fdt_loader_cmd.c diff --git a/sys/boot/fdt/fdt_overlay.c b/stand/fdt/fdt_overlay.c similarity index 100% rename from sys/boot/fdt/fdt_overlay.c rename to stand/fdt/fdt_overlay.c diff --git a/sys/boot/fdt/fdt_overlay.h b/stand/fdt/fdt_overlay.h similarity index 100% rename from sys/boot/fdt/fdt_overlay.h rename to stand/fdt/fdt_overlay.h diff --git a/sys/boot/fdt/fdt_platform.h b/stand/fdt/fdt_platform.h similarity index 100% rename from sys/boot/fdt/fdt_platform.h rename to stand/fdt/fdt_platform.h diff --git a/sys/boot/fdt/help.fdt b/stand/fdt/help.fdt similarity index 100% rename from sys/boot/fdt/help.fdt rename to stand/fdt/help.fdt diff --git a/sys/boot/ficl.mk b/stand/ficl.mk similarity index 100% rename from sys/boot/ficl.mk rename to stand/ficl.mk diff --git a/sys/boot/ficl/Makefile b/stand/ficl/Makefile similarity index 88% rename from sys/boot/ficl/Makefile rename to stand/ficl/Makefile index e32e3909687d..9a13614a7fea 100644 --- a/sys/boot/ficl/Makefile +++ b/stand/ficl/Makefile @@ -8,11 +8,8 @@ BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \ prefix.c search.c stack.c tools.c vm.c words.c SRCS= ${BASE_SRCS} sysdep.c softcore.c -CLEANFILES= softcore.c testmain testmain.o +CLEANFILES+= softcore.c testmain testmain.o -.if defined(HAVE_PNP) -CFLAGS+= -DHAVE_PNP -.endif .include .ifmake testmain CFLAGS+= -DTESTMAIN -D_TESTMAIN diff --git a/sys/boot/ficl/Makefile.depend b/stand/ficl/Makefile.depend similarity index 100% rename from sys/boot/ficl/Makefile.depend rename to stand/ficl/Makefile.depend diff --git a/sys/boot/ficl/aarch64/sysdep.c b/stand/ficl/aarch64/sysdep.c similarity index 100% rename from sys/boot/ficl/aarch64/sysdep.c rename to stand/ficl/aarch64/sysdep.c diff --git a/sys/boot/ficl/aarch64/sysdep.h b/stand/ficl/aarch64/sysdep.h similarity index 100% rename from sys/boot/ficl/aarch64/sysdep.h rename to stand/ficl/aarch64/sysdep.h diff --git a/sys/boot/ficl/amd64/sysdep.c b/stand/ficl/amd64/sysdep.c similarity index 100% rename from sys/boot/ficl/amd64/sysdep.c rename to stand/ficl/amd64/sysdep.c diff --git a/sys/boot/ficl/amd64/sysdep.h b/stand/ficl/amd64/sysdep.h similarity index 100% rename from sys/boot/ficl/amd64/sysdep.h rename to stand/ficl/amd64/sysdep.h diff --git a/sys/boot/ficl/arm/sysdep.c b/stand/ficl/arm/sysdep.c similarity index 100% rename from sys/boot/ficl/arm/sysdep.c rename to stand/ficl/arm/sysdep.c diff --git a/sys/boot/ficl/arm/sysdep.h b/stand/ficl/arm/sysdep.h similarity index 100% rename from sys/boot/ficl/arm/sysdep.h rename to stand/ficl/arm/sysdep.h diff --git a/sys/boot/ficl/dict.c b/stand/ficl/dict.c similarity index 100% rename from sys/boot/ficl/dict.c rename to stand/ficl/dict.c diff --git a/sys/boot/ficl/ficl.c b/stand/ficl/ficl.c similarity index 100% rename from sys/boot/ficl/ficl.c rename to stand/ficl/ficl.c diff --git a/sys/boot/ficl/ficl.h b/stand/ficl/ficl.h similarity index 100% rename from sys/boot/ficl/ficl.h rename to stand/ficl/ficl.h diff --git a/sys/boot/ficl/fileaccess.c b/stand/ficl/fileaccess.c similarity index 100% rename from sys/boot/ficl/fileaccess.c rename to stand/ficl/fileaccess.c diff --git a/sys/boot/ficl/float.c b/stand/ficl/float.c similarity index 100% rename from sys/boot/ficl/float.c rename to stand/ficl/float.c diff --git a/sys/boot/ficl/i386/sysdep.c b/stand/ficl/i386/sysdep.c similarity index 100% rename from sys/boot/ficl/i386/sysdep.c rename to stand/ficl/i386/sysdep.c diff --git a/sys/boot/ficl/i386/sysdep.h b/stand/ficl/i386/sysdep.h similarity index 100% rename from sys/boot/ficl/i386/sysdep.h rename to stand/ficl/i386/sysdep.h diff --git a/sys/boot/ficl/loader.c b/stand/ficl/loader.c similarity index 100% rename from sys/boot/ficl/loader.c rename to stand/ficl/loader.c diff --git a/sys/boot/ficl/math64.c b/stand/ficl/math64.c similarity index 100% rename from sys/boot/ficl/math64.c rename to stand/ficl/math64.c diff --git a/sys/boot/ficl/math64.h b/stand/ficl/math64.h similarity index 100% rename from sys/boot/ficl/math64.h rename to stand/ficl/math64.h diff --git a/sys/boot/ficl/mips/sysdep.c b/stand/ficl/mips/sysdep.c similarity index 100% rename from sys/boot/ficl/mips/sysdep.c rename to stand/ficl/mips/sysdep.c diff --git a/sys/boot/ficl/mips/sysdep.h b/stand/ficl/mips/sysdep.h similarity index 100% rename from sys/boot/ficl/mips/sysdep.h rename to stand/ficl/mips/sysdep.h diff --git a/sys/boot/ficl/mips64/sysdep.c b/stand/ficl/mips64/sysdep.c similarity index 100% rename from sys/boot/ficl/mips64/sysdep.c rename to stand/ficl/mips64/sysdep.c diff --git a/sys/boot/ficl/mips64/sysdep.h b/stand/ficl/mips64/sysdep.h similarity index 100% rename from sys/boot/ficl/mips64/sysdep.h rename to stand/ficl/mips64/sysdep.h diff --git a/sys/boot/ficl/powerpc/sysdep.c b/stand/ficl/powerpc/sysdep.c similarity index 100% rename from sys/boot/ficl/powerpc/sysdep.c rename to stand/ficl/powerpc/sysdep.c diff --git a/sys/boot/ficl/powerpc/sysdep.h b/stand/ficl/powerpc/sysdep.h similarity index 100% rename from sys/boot/ficl/powerpc/sysdep.h rename to stand/ficl/powerpc/sysdep.h diff --git a/sys/boot/ficl/prefix.c b/stand/ficl/prefix.c similarity index 100% rename from sys/boot/ficl/prefix.c rename to stand/ficl/prefix.c diff --git a/sys/boot/ficl/riscv/sysdep.c b/stand/ficl/riscv/sysdep.c similarity index 100% rename from sys/boot/ficl/riscv/sysdep.c rename to stand/ficl/riscv/sysdep.c diff --git a/sys/boot/ficl/riscv/sysdep.h b/stand/ficl/riscv/sysdep.h similarity index 100% rename from sys/boot/ficl/riscv/sysdep.h rename to stand/ficl/riscv/sysdep.h diff --git a/sys/boot/ficl/search.c b/stand/ficl/search.c similarity index 100% rename from sys/boot/ficl/search.c rename to stand/ficl/search.c diff --git a/sys/boot/ficl/softwords/classes.fr b/stand/ficl/softwords/classes.fr similarity index 100% rename from sys/boot/ficl/softwords/classes.fr rename to stand/ficl/softwords/classes.fr diff --git a/sys/boot/ficl/softwords/ficlclass.fr b/stand/ficl/softwords/ficlclass.fr similarity index 100% rename from sys/boot/ficl/softwords/ficlclass.fr rename to stand/ficl/softwords/ficlclass.fr diff --git a/sys/boot/ficl/softwords/ficllocal.fr b/stand/ficl/softwords/ficllocal.fr similarity index 100% rename from sys/boot/ficl/softwords/ficllocal.fr rename to stand/ficl/softwords/ficllocal.fr diff --git a/sys/boot/ficl/softwords/fileaccess.fr b/stand/ficl/softwords/fileaccess.fr similarity index 100% rename from sys/boot/ficl/softwords/fileaccess.fr rename to stand/ficl/softwords/fileaccess.fr diff --git a/sys/boot/ficl/softwords/forml.fr b/stand/ficl/softwords/forml.fr similarity index 100% rename from sys/boot/ficl/softwords/forml.fr rename to stand/ficl/softwords/forml.fr diff --git a/sys/boot/ficl/softwords/freebsd.fr b/stand/ficl/softwords/freebsd.fr similarity index 100% rename from sys/boot/ficl/softwords/freebsd.fr rename to stand/ficl/softwords/freebsd.fr diff --git a/sys/boot/ficl/softwords/ifbrack.fr b/stand/ficl/softwords/ifbrack.fr similarity index 100% rename from sys/boot/ficl/softwords/ifbrack.fr rename to stand/ficl/softwords/ifbrack.fr diff --git a/sys/boot/ficl/softwords/jhlocal.fr b/stand/ficl/softwords/jhlocal.fr similarity index 100% rename from sys/boot/ficl/softwords/jhlocal.fr rename to stand/ficl/softwords/jhlocal.fr diff --git a/sys/boot/ficl/softwords/marker.fr b/stand/ficl/softwords/marker.fr similarity index 100% rename from sys/boot/ficl/softwords/marker.fr rename to stand/ficl/softwords/marker.fr diff --git a/sys/boot/ficl/softwords/oo.fr b/stand/ficl/softwords/oo.fr similarity index 100% rename from sys/boot/ficl/softwords/oo.fr rename to stand/ficl/softwords/oo.fr diff --git a/sys/boot/ficl/softwords/prefix.fr b/stand/ficl/softwords/prefix.fr similarity index 100% rename from sys/boot/ficl/softwords/prefix.fr rename to stand/ficl/softwords/prefix.fr diff --git a/sys/boot/ficl/softwords/softcore.awk b/stand/ficl/softwords/softcore.awk similarity index 100% rename from sys/boot/ficl/softwords/softcore.awk rename to stand/ficl/softwords/softcore.awk diff --git a/sys/boot/ficl/softwords/softcore.fr b/stand/ficl/softwords/softcore.fr similarity index 100% rename from sys/boot/ficl/softwords/softcore.fr rename to stand/ficl/softwords/softcore.fr diff --git a/sys/boot/ficl/softwords/string.fr b/stand/ficl/softwords/string.fr similarity index 100% rename from sys/boot/ficl/softwords/string.fr rename to stand/ficl/softwords/string.fr diff --git a/sys/boot/ficl/sparc64/sysdep.c b/stand/ficl/sparc64/sysdep.c similarity index 100% rename from sys/boot/ficl/sparc64/sysdep.c rename to stand/ficl/sparc64/sysdep.c diff --git a/sys/boot/ficl/sparc64/sysdep.h b/stand/ficl/sparc64/sysdep.h similarity index 100% rename from sys/boot/ficl/sparc64/sysdep.h rename to stand/ficl/sparc64/sysdep.h diff --git a/sys/boot/ficl/stack.c b/stand/ficl/stack.c similarity index 100% rename from sys/boot/ficl/stack.c rename to stand/ficl/stack.c diff --git a/sys/boot/ficl/testmain.c b/stand/ficl/testmain.c similarity index 100% rename from sys/boot/ficl/testmain.c rename to stand/ficl/testmain.c diff --git a/sys/boot/ficl/tools.c b/stand/ficl/tools.c similarity index 100% rename from sys/boot/ficl/tools.c rename to stand/ficl/tools.c diff --git a/sys/boot/ficl/unix.c b/stand/ficl/unix.c similarity index 100% rename from sys/boot/ficl/unix.c rename to stand/ficl/unix.c diff --git a/sys/boot/ficl/vm.c b/stand/ficl/vm.c similarity index 100% rename from sys/boot/ficl/vm.c rename to stand/ficl/vm.c diff --git a/sys/boot/ficl/words.c b/stand/ficl/words.c similarity index 100% rename from sys/boot/ficl/words.c rename to stand/ficl/words.c diff --git a/sys/boot/ficl32/Makefile b/stand/ficl32/Makefile similarity index 100% rename from sys/boot/ficl32/Makefile rename to stand/ficl32/Makefile diff --git a/sys/boot/ficl32/Makefile.depend b/stand/ficl32/Makefile.depend similarity index 100% rename from sys/boot/ficl32/Makefile.depend rename to stand/ficl32/Makefile.depend diff --git a/sys/boot/forth/Makefile.inc b/stand/forth/Makefile similarity index 50% rename from sys/boot/forth/Makefile.inc rename to stand/forth/Makefile index d31ff3f26291..74d9ed744322 100644 --- a/sys/boot/forth/Makefile.inc +++ b/stand/forth/Makefile @@ -1,5 +1,18 @@ # $FreeBSD$ +.include + +MAN+= beastie.4th.8 \ + brand.4th.8 \ + check-password.4th.8 \ + color.4th.8 \ + delay.4th.8 \ + loader.conf.5 \ + loader.4th.8 \ + menu.4th.8 \ + menusets.4th.8 \ + version.4th.8 + FILES+= beastie.4th FILES+= brand.4th FILES+= brand-fbsd.4th @@ -9,8 +22,6 @@ FILES+= delay.4th FILES+= efi.4th FILES+= frames.4th FILES+= loader.4th -FILES+= loader.conf -FILES+= loader.help FILES+= logo-beastie.4th FILES+= logo-beastiebw.4th FILES+= logo-fbsdbw.4th @@ -19,8 +30,20 @@ FILES+= logo-orbbw.4th FILES+= menu.4th FILES+= menu-commands.4th FILES+= menusets.4th +FILES+= pcibios.4th FILES+= screen.4th FILES+= shortcuts.4th FILES+= support.4th FILES+= version.4th FILESDIR_loader.conf= /boot/defaults + +# Allow machine specific loader.rc to be installed. +.for f in loader.rc menu.rc loader.conf +.if exists(${BOOTSRC}/${MACHINE:C/amd64/i386/}/loader/${f}) +FILES+= ${BOOTSRC}/${MACHINE:C/amd64/i386/}/loader/${f} +.else +FILES+= ${f} +.endif +.endfor + +.include diff --git a/sys/boot/forth/Makefile.depend b/stand/forth/Makefile.depend similarity index 100% rename from sys/boot/forth/Makefile.depend rename to stand/forth/Makefile.depend diff --git a/sys/boot/forth/beastie.4th b/stand/forth/beastie.4th similarity index 100% rename from sys/boot/forth/beastie.4th rename to stand/forth/beastie.4th diff --git a/sys/boot/forth/beastie.4th.8 b/stand/forth/beastie.4th.8 similarity index 100% rename from sys/boot/forth/beastie.4th.8 rename to stand/forth/beastie.4th.8 diff --git a/sys/boot/forth/brand-fbsd.4th b/stand/forth/brand-fbsd.4th similarity index 100% rename from sys/boot/forth/brand-fbsd.4th rename to stand/forth/brand-fbsd.4th diff --git a/sys/boot/forth/brand.4th b/stand/forth/brand.4th similarity index 100% rename from sys/boot/forth/brand.4th rename to stand/forth/brand.4th diff --git a/sys/boot/forth/brand.4th.8 b/stand/forth/brand.4th.8 similarity index 100% rename from sys/boot/forth/brand.4th.8 rename to stand/forth/brand.4th.8 diff --git a/sys/boot/forth/check-password.4th b/stand/forth/check-password.4th similarity index 100% rename from sys/boot/forth/check-password.4th rename to stand/forth/check-password.4th diff --git a/sys/boot/forth/check-password.4th.8 b/stand/forth/check-password.4th.8 similarity index 100% rename from sys/boot/forth/check-password.4th.8 rename to stand/forth/check-password.4th.8 diff --git a/sys/boot/forth/color.4th b/stand/forth/color.4th similarity index 100% rename from sys/boot/forth/color.4th rename to stand/forth/color.4th diff --git a/sys/boot/forth/color.4th.8 b/stand/forth/color.4th.8 similarity index 100% rename from sys/boot/forth/color.4th.8 rename to stand/forth/color.4th.8 diff --git a/sys/boot/forth/delay.4th b/stand/forth/delay.4th similarity index 100% rename from sys/boot/forth/delay.4th rename to stand/forth/delay.4th diff --git a/sys/boot/forth/delay.4th.8 b/stand/forth/delay.4th.8 similarity index 100% rename from sys/boot/forth/delay.4th.8 rename to stand/forth/delay.4th.8 diff --git a/sys/boot/forth/efi.4th b/stand/forth/efi.4th similarity index 100% rename from sys/boot/forth/efi.4th rename to stand/forth/efi.4th diff --git a/sys/boot/forth/frames.4th b/stand/forth/frames.4th similarity index 100% rename from sys/boot/forth/frames.4th rename to stand/forth/frames.4th diff --git a/sys/boot/forth/loader.4th b/stand/forth/loader.4th similarity index 100% rename from sys/boot/forth/loader.4th rename to stand/forth/loader.4th diff --git a/sys/boot/forth/loader.4th.8 b/stand/forth/loader.4th.8 similarity index 100% rename from sys/boot/forth/loader.4th.8 rename to stand/forth/loader.4th.8 diff --git a/sys/boot/forth/loader.conf b/stand/forth/loader.conf similarity index 99% rename from sys/boot/forth/loader.conf rename to stand/forth/loader.conf index 29b3465f080d..8fe533fd2deb 100644 --- a/sys/boot/forth/loader.conf +++ b/stand/forth/loader.conf @@ -97,7 +97,7 @@ bootenv_autolist="YES" # Auto populate the list of ZFS Boot Environments #comconsole_speed="9600" # Set the current serial console speed #console="vidconsole" # A comma separated list of console(s) #currdev="disk1s1a" # Set the current device -module_path="/boot/modules" # Set the module search path +module_path="/boot/modules;/boot/dtb" # Set the module search path #prompt="\\${interpret}" # Set the command prompt #root_disk_unit="0" # Force the root disk unit number #rootdev="disk1s1a" # Set the root filesystem diff --git a/sys/boot/forth/loader.conf.5 b/stand/forth/loader.conf.5 similarity index 100% rename from sys/boot/forth/loader.conf.5 rename to stand/forth/loader.conf.5 diff --git a/sys/boot/forth/loader.rc b/stand/forth/loader.rc similarity index 100% rename from sys/boot/forth/loader.rc rename to stand/forth/loader.rc diff --git a/sys/boot/forth/logo-beastie.4th b/stand/forth/logo-beastie.4th similarity index 100% rename from sys/boot/forth/logo-beastie.4th rename to stand/forth/logo-beastie.4th diff --git a/sys/boot/forth/logo-beastiebw.4th b/stand/forth/logo-beastiebw.4th similarity index 100% rename from sys/boot/forth/logo-beastiebw.4th rename to stand/forth/logo-beastiebw.4th diff --git a/sys/boot/forth/logo-fbsdbw.4th b/stand/forth/logo-fbsdbw.4th similarity index 100% rename from sys/boot/forth/logo-fbsdbw.4th rename to stand/forth/logo-fbsdbw.4th diff --git a/sys/boot/forth/logo-orb.4th b/stand/forth/logo-orb.4th similarity index 100% rename from sys/boot/forth/logo-orb.4th rename to stand/forth/logo-orb.4th diff --git a/sys/boot/forth/logo-orbbw.4th b/stand/forth/logo-orbbw.4th similarity index 100% rename from sys/boot/forth/logo-orbbw.4th rename to stand/forth/logo-orbbw.4th diff --git a/sys/boot/forth/menu-commands.4th b/stand/forth/menu-commands.4th similarity index 100% rename from sys/boot/forth/menu-commands.4th rename to stand/forth/menu-commands.4th diff --git a/sys/boot/forth/menu.4th b/stand/forth/menu.4th similarity index 100% rename from sys/boot/forth/menu.4th rename to stand/forth/menu.4th diff --git a/sys/boot/forth/menu.4th.8 b/stand/forth/menu.4th.8 similarity index 100% rename from sys/boot/forth/menu.4th.8 rename to stand/forth/menu.4th.8 diff --git a/sys/boot/forth/menu.rc b/stand/forth/menu.rc similarity index 100% rename from sys/boot/forth/menu.rc rename to stand/forth/menu.rc diff --git a/sys/boot/forth/menusets.4th b/stand/forth/menusets.4th similarity index 100% rename from sys/boot/forth/menusets.4th rename to stand/forth/menusets.4th diff --git a/sys/boot/forth/menusets.4th.8 b/stand/forth/menusets.4th.8 similarity index 100% rename from sys/boot/forth/menusets.4th.8 rename to stand/forth/menusets.4th.8 diff --git a/sys/boot/forth/pcibios.4th b/stand/forth/pcibios.4th similarity index 100% rename from sys/boot/forth/pcibios.4th rename to stand/forth/pcibios.4th diff --git a/sys/boot/forth/pnp.4th b/stand/forth/pnp.4th similarity index 98% rename from sys/boot/forth/pnp.4th rename to stand/forth/pnp.4th index 8be89d8277fe..4aa4bcf2ac21 100644 --- a/sys/boot/forth/pnp.4th +++ b/stand/forth/pnp.4th @@ -45,7 +45,7 @@ structure: pnpident sizeof STAILQ_ENTRY cells member: pnpid.link \ pnpident ;structure -structure: pnpinfo \ sync with sys/boot/config/bootstrap.h +structure: pnpinfo \ sync with stand/common/bootstrap.h ptr pnpi.desc int pnpi.revision ptr pnpi.module \ (char*) module args diff --git a/sys/boot/forth/screen.4th b/stand/forth/screen.4th similarity index 100% rename from sys/boot/forth/screen.4th rename to stand/forth/screen.4th diff --git a/sys/boot/forth/shortcuts.4th b/stand/forth/shortcuts.4th similarity index 100% rename from sys/boot/forth/shortcuts.4th rename to stand/forth/shortcuts.4th diff --git a/sys/boot/forth/support.4th b/stand/forth/support.4th similarity index 99% rename from sys/boot/forth/support.4th rename to stand/forth/support.4th index 7ce9e5289acf..aa50b3bb3a9d 100644 --- a/sys/boot/forth/support.4th +++ b/stand/forth/support.4th @@ -130,7 +130,7 @@ structure: module ;structure \ Internal loader structures (preloaded_file, kernel_module, file_metadata) -\ must be in sync with the C struct in sys/boot/common/bootstrap.h +\ must be in sync with the C struct in stand/common/bootstrap.h structure: preloaded_file ptr pf.name ptr pf.type diff --git a/sys/boot/forth/version.4th b/stand/forth/version.4th similarity index 100% rename from sys/boot/forth/version.4th rename to stand/forth/version.4th diff --git a/sys/boot/forth/version.4th.8 b/stand/forth/version.4th.8 similarity index 100% rename from sys/boot/forth/version.4th.8 rename to stand/forth/version.4th.8 diff --git a/sys/boot/geli/Makefile b/stand/geli/Makefile similarity index 94% rename from sys/boot/geli/Makefile rename to stand/geli/Makefile index b16f7a8c5ab3..c7904311c08d 100644 --- a/sys/boot/geli/Makefile +++ b/stand/geli/Makefile @@ -38,7 +38,6 @@ SRCS+= md5c.c # AES implementation from sys/crypto .PATH: ${SYSDIR}/crypto/rijndael -CFLAGS+= -I${SYSDIR} CFLAGS+= -I${LDRSRC} # Remove asserts CFLAGS+= -DNDEBUG @@ -49,5 +48,9 @@ SRCS+= rijndael-alg-fst.c rijndael-api-fst.c rijndael-api.c CFLAGS+= -D_STAND SRCS+= geliboot_crypto.c g_eli_hmac.c g_eli_key.c g_eli_key_cache.c pkcs5v2.c +# aes +.PATH: ${SYSDIR}/opencrypto +SRCS+= xform_aes_xts.c + .include .include diff --git a/sys/boot/geli/Makefile.depend b/stand/geli/Makefile.depend similarity index 100% rename from sys/boot/geli/Makefile.depend rename to stand/geli/Makefile.depend diff --git a/sys/boot/geli/geliboot.c b/stand/geli/geliboot.c similarity index 100% rename from sys/boot/geli/geliboot.c rename to stand/geli/geliboot.c diff --git a/sys/boot/geli/geliboot.h b/stand/geli/geliboot.h similarity index 100% rename from sys/boot/geli/geliboot.h rename to stand/geli/geliboot.h diff --git a/sys/boot/geli/geliboot_crypto.c b/stand/geli/geliboot_crypto.c similarity index 100% rename from sys/boot/geli/geliboot_crypto.c rename to stand/geli/geliboot_crypto.c diff --git a/sys/boot/geli/geliboot_internal.h b/stand/geli/geliboot_internal.h similarity index 100% rename from sys/boot/geli/geliboot_internal.h rename to stand/geli/geliboot_internal.h diff --git a/sys/boot/geli/pwgets.c b/stand/geli/pwgets.c similarity index 100% rename from sys/boot/geli/pwgets.c rename to stand/geli/pwgets.c diff --git a/sys/boot/i386/Makefile b/stand/i386/Makefile similarity index 77% rename from sys/boot/i386/Makefile rename to stand/i386/Makefile index af74d6954dac..9a1663abab07 100644 --- a/sys/boot/i386/Makefile +++ b/stand/i386/Makefile @@ -3,7 +3,13 @@ .include SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \ - libi386 libfirewire loader + libi386 + +.if ${MK_LOADER_FIREWIRE} == "yes" +SUBDIR+= libfirewire +.endif + +SUBDIR+= loader # special boot programs, 'self-extracting boot2+loader' SUBDIR+= pxeldr diff --git a/sys/boot/i386/Makefile.inc b/stand/i386/Makefile.inc similarity index 80% rename from sys/boot/i386/Makefile.inc rename to stand/i386/Makefile.inc index b324d1adfef5..54391c4d62c2 100644 --- a/sys/boot/i386/Makefile.inc +++ b/stand/i386/Makefile.inc @@ -1,4 +1,4 @@ -# Common defines for all of /sys/boot/i386/ +# Common defines for all of stand/i386/ # # $FreeBSD$ @@ -28,4 +28,9 @@ LD_FLAGS_BIN=-static -N --gc-sections DO32=1 .endif +.if defined(LOADER_FIREWIRE_SUPPORT) +MK_LOADER_FIREWIRE=yes +.warning "LOADER_FIREWIRE_SUPPORT deprecated, please move to WITH_LOADER_FIREWIRE" +.endif + .include "../Makefile.inc" diff --git a/sys/boot/i386/boot.ldscript b/stand/i386/boot.ldscript similarity index 100% rename from sys/boot/i386/boot.ldscript rename to stand/i386/boot.ldscript diff --git a/sys/boot/i386/boot0/Makefile b/stand/i386/boot0/Makefile similarity index 100% rename from sys/boot/i386/boot0/Makefile rename to stand/i386/boot0/Makefile diff --git a/sys/boot/i386/boot0/Makefile.depend b/stand/i386/boot0/Makefile.depend similarity index 100% rename from sys/boot/i386/boot0/Makefile.depend rename to stand/i386/boot0/Makefile.depend diff --git a/sys/boot/i386/boot0/boot0.S b/stand/i386/boot0/boot0.S similarity index 100% rename from sys/boot/i386/boot0/boot0.S rename to stand/i386/boot0/boot0.S diff --git a/sys/boot/i386/boot0sio/Makefile b/stand/i386/boot0sio/Makefile similarity index 100% rename from sys/boot/i386/boot0sio/Makefile rename to stand/i386/boot0sio/Makefile diff --git a/sys/boot/i386/boot0sio/Makefile.depend b/stand/i386/boot0sio/Makefile.depend similarity index 100% rename from sys/boot/i386/boot0sio/Makefile.depend rename to stand/i386/boot0sio/Makefile.depend diff --git a/sys/boot/i386/boot2/Makefile b/stand/i386/boot2/Makefile similarity index 98% rename from sys/boot/i386/boot2/Makefile rename to stand/i386/boot2/Makefile index 9f9e5191e133..c3146b3e9063 100644 --- a/sys/boot/i386/boot2/Makefile +++ b/stand/i386/boot2/Makefile @@ -31,7 +31,7 @@ CFLAGS+=-fomit-frame-pointer \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ -I${LDRSRC} \ - -I${BTXLIB} -I. \ + -I${BTXLIB} \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ @@ -48,7 +48,7 @@ CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} LD_FLAGS+=${LD_FLAGS_BIN} -CLEANFILES= boot +CLEANFILES+= boot boot: boot1 boot2 cat boot1 boot2 > boot diff --git a/sys/boot/i386/boot2/Makefile.depend b/stand/i386/boot2/Makefile.depend similarity index 78% rename from sys/boot/i386/boot2/Makefile.depend rename to stand/i386/boot2/Makefile.depend index d5a67a6b2085..bc9b1b7bddc9 100644 --- a/sys/boot/i386/boot2/Makefile.depend +++ b/stand/i386/boot2/Makefile.depend @@ -3,8 +3,8 @@ DIRDEPS = \ include \ - sys/boot/i386/btx/btx \ - sys/boot/i386/btx/lib \ + stand/i386/btx/btx \ + stand/i386/btx/lib \ .include diff --git a/sys/boot/i386/boot2/boot1.S b/stand/i386/boot2/boot1.S similarity index 100% rename from sys/boot/i386/boot2/boot1.S rename to stand/i386/boot2/boot1.S diff --git a/sys/boot/i386/boot2/boot2.c b/stand/i386/boot2/boot2.c similarity index 100% rename from sys/boot/i386/boot2/boot2.c rename to stand/i386/boot2/boot2.c diff --git a/sys/boot/i386/boot2/lib.h b/stand/i386/boot2/lib.h similarity index 100% rename from sys/boot/i386/boot2/lib.h rename to stand/i386/boot2/lib.h diff --git a/sys/boot/i386/boot2/sio.S b/stand/i386/boot2/sio.S similarity index 100% rename from sys/boot/i386/boot2/sio.S rename to stand/i386/boot2/sio.S diff --git a/sys/boot/i386/btx/Makefile b/stand/i386/btx/Makefile similarity index 100% rename from sys/boot/i386/btx/Makefile rename to stand/i386/btx/Makefile diff --git a/sys/boot/i386/btx/Makefile.inc b/stand/i386/btx/Makefile.inc similarity index 100% rename from sys/boot/i386/btx/Makefile.inc rename to stand/i386/btx/Makefile.inc diff --git a/sys/boot/i386/btx/btx/Makefile b/stand/i386/btx/btx/Makefile similarity index 100% rename from sys/boot/i386/btx/btx/Makefile rename to stand/i386/btx/btx/Makefile diff --git a/sys/boot/i386/btx/btx/Makefile.depend b/stand/i386/btx/btx/Makefile.depend similarity index 100% rename from sys/boot/i386/btx/btx/Makefile.depend rename to stand/i386/btx/btx/Makefile.depend diff --git a/sys/boot/i386/btx/btx/btx.S b/stand/i386/btx/btx/btx.S similarity index 100% rename from sys/boot/i386/btx/btx/btx.S rename to stand/i386/btx/btx/btx.S diff --git a/sys/boot/i386/btx/btxldr/Makefile b/stand/i386/btx/btxldr/Makefile similarity index 100% rename from sys/boot/i386/btx/btxldr/Makefile rename to stand/i386/btx/btxldr/Makefile diff --git a/sys/boot/i386/btx/btxldr/Makefile.depend b/stand/i386/btx/btxldr/Makefile.depend similarity index 100% rename from sys/boot/i386/btx/btxldr/Makefile.depend rename to stand/i386/btx/btxldr/Makefile.depend diff --git a/sys/boot/i386/btx/btxldr/btxldr.S b/stand/i386/btx/btxldr/btxldr.S similarity index 100% rename from sys/boot/i386/btx/btxldr/btxldr.S rename to stand/i386/btx/btxldr/btxldr.S diff --git a/sys/boot/i386/btx/lib/Makefile b/stand/i386/btx/lib/Makefile similarity index 100% rename from sys/boot/i386/btx/lib/Makefile rename to stand/i386/btx/lib/Makefile diff --git a/sys/boot/i386/btx/lib/Makefile.depend b/stand/i386/btx/lib/Makefile.depend similarity index 100% rename from sys/boot/i386/btx/lib/Makefile.depend rename to stand/i386/btx/lib/Makefile.depend diff --git a/sys/boot/i386/btx/lib/btxcsu.S b/stand/i386/btx/lib/btxcsu.S similarity index 100% rename from sys/boot/i386/btx/lib/btxcsu.S rename to stand/i386/btx/lib/btxcsu.S diff --git a/sys/boot/i386/btx/lib/btxsys.s b/stand/i386/btx/lib/btxsys.s similarity index 100% rename from sys/boot/i386/btx/lib/btxsys.s rename to stand/i386/btx/lib/btxsys.s diff --git a/sys/boot/i386/btx/lib/btxv86.h b/stand/i386/btx/lib/btxv86.h similarity index 100% rename from sys/boot/i386/btx/lib/btxv86.h rename to stand/i386/btx/lib/btxv86.h diff --git a/sys/boot/i386/btx/lib/btxv86.s b/stand/i386/btx/lib/btxv86.s similarity index 100% rename from sys/boot/i386/btx/lib/btxv86.s rename to stand/i386/btx/lib/btxv86.s diff --git a/sys/boot/i386/cdboot/Makefile b/stand/i386/cdboot/Makefile similarity index 100% rename from sys/boot/i386/cdboot/Makefile rename to stand/i386/cdboot/Makefile diff --git a/sys/boot/i386/cdboot/Makefile.depend b/stand/i386/cdboot/Makefile.depend similarity index 100% rename from sys/boot/i386/cdboot/Makefile.depend rename to stand/i386/cdboot/Makefile.depend diff --git a/sys/boot/i386/cdboot/cdboot.S b/stand/i386/cdboot/cdboot.S similarity index 100% rename from sys/boot/i386/cdboot/cdboot.S rename to stand/i386/cdboot/cdboot.S diff --git a/sys/boot/i386/common/bootargs.h b/stand/i386/common/bootargs.h similarity index 100% rename from sys/boot/i386/common/bootargs.h rename to stand/i386/common/bootargs.h diff --git a/sys/boot/i386/common/cons.c b/stand/i386/common/cons.c similarity index 100% rename from sys/boot/i386/common/cons.c rename to stand/i386/common/cons.c diff --git a/sys/boot/i386/common/cons.h b/stand/i386/common/cons.h similarity index 100% rename from sys/boot/i386/common/cons.h rename to stand/i386/common/cons.h diff --git a/sys/boot/i386/common/drv.c b/stand/i386/common/drv.c similarity index 100% rename from sys/boot/i386/common/drv.c rename to stand/i386/common/drv.c diff --git a/sys/boot/i386/common/drv.h b/stand/i386/common/drv.h similarity index 100% rename from sys/boot/i386/common/drv.h rename to stand/i386/common/drv.h diff --git a/sys/boot/i386/common/edd.h b/stand/i386/common/edd.h similarity index 100% rename from sys/boot/i386/common/edd.h rename to stand/i386/common/edd.h diff --git a/sys/boot/i386/gptboot/Makefile b/stand/i386/gptboot/Makefile similarity index 80% rename from sys/boot/i386/gptboot/Makefile rename to stand/i386/gptboot/Makefile index 9d3048a89c56..9e62007c55ae 100644 --- a/sys/boot/i386/gptboot/Makefile +++ b/stand/i386/gptboot/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +HAVE_GELI= yes + .include .PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/common ${SASRC} @@ -31,9 +33,8 @@ CFLAGS+=-DBOOTPROG=\"gptboot\" \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ -I${LDRSRC} \ -I${BOOTSRC}/i386/common \ - -I${BTXLIB} -I. \ + -I${BTXLIB} \ -I${BOOTSRC}/i386/boot2 \ - -I${SYSDIR} \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ @@ -41,17 +42,9 @@ CFLAGS+=-DBOOTPROG=\"gptboot\" \ CFLAGS.gcc+= --param max-inline-insns-single=100 -.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" -CFLAGS+= -DLOADER_GELI_SUPPORT -CFLAGS+= -I${BOOTSRC}/geli -LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a -.PATH: ${SYSDIR}/opencrypto -OPENCRYPTO_XTS= xform_aes_xts.o -.endif - LD_FLAGS+=${LD_FLAGS_BIN} -CLEANFILES= gptboot +CLEANFILES+= gptboot gptboot: gptldr.bin gptboot.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \ @@ -66,12 +59,12 @@ gptldr.out: gptldr.o ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o CLEANFILES+= gptboot.bin gptboot.out gptboot.o sio.o crc32.o drv.o \ - cons.o util.o ${OPENCRYPTO_XTS} + cons.o ${OPENCRYPTO_XTS} gptboot.bin: gptboot.out ${OBJCOPY} -S -O binary gptboot.out ${.TARGET} -gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o util.o ${OPENCRYPTO_XTS} +gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o ${OPENCRYPTO_XTS} ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} gptboot.o: ${SASRC}/ufsread.c diff --git a/sys/boot/i386/gptboot/Makefile.depend b/stand/i386/gptboot/Makefile.depend similarity index 71% rename from sys/boot/i386/gptboot/Makefile.depend rename to stand/i386/gptboot/Makefile.depend index c6ac7d89dda0..89aa3261d133 100644 --- a/sys/boot/i386/gptboot/Makefile.depend +++ b/stand/i386/gptboot/Makefile.depend @@ -5,10 +5,10 @@ DIRDEPS = \ include \ include/xlocale \ lib/libmd \ - sys/boot/geli \ - sys/boot/i386/btx/btx \ - sys/boot/i386/btx/lib \ - sys/boot/libsa32 \ + stand/geli \ + stand/i386/btx/btx \ + stand/i386/btx/lib \ + stand/libsa32 \ .include diff --git a/sys/boot/i386/gptboot/gptboot.8 b/stand/i386/gptboot/gptboot.8 similarity index 100% rename from sys/boot/i386/gptboot/gptboot.8 rename to stand/i386/gptboot/gptboot.8 diff --git a/sys/boot/i386/gptboot/gptboot.c b/stand/i386/gptboot/gptboot.c similarity index 100% rename from sys/boot/i386/gptboot/gptboot.c rename to stand/i386/gptboot/gptboot.c diff --git a/sys/boot/i386/gptboot/gptldr.S b/stand/i386/gptboot/gptldr.S similarity index 100% rename from sys/boot/i386/gptboot/gptldr.S rename to stand/i386/gptboot/gptldr.S diff --git a/sys/boot/i386/gptzfsboot/Makefile b/stand/i386/gptzfsboot/Makefile similarity index 87% rename from sys/boot/i386/gptzfsboot/Makefile rename to stand/i386/gptzfsboot/Makefile index b9df313dd291..97f195445151 100644 --- a/sys/boot/i386/gptzfsboot/Makefile +++ b/stand/i386/gptzfsboot/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +HAVE_GPT= yes + .include .PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/gptboot \ @@ -29,9 +31,8 @@ CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \ -I${BOOTSRC}/i386/common \ -I${ZFSSRC} \ -I${SYSDIR}/cddl/boot/zfs \ - -I${BOOTSRC}/i386/btx/lib -I. \ + -I${BOOTSRC}/i386/btx/lib \ -I${BOOTSRC}/i386/boot2 \ - -I${SYSDIR} \ -Wall -Waggregate-return -Wbad-function-cast \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ @@ -50,19 +51,11 @@ LIBZFSBOOT=${BOOTOBJ}/zfs32/libzfsboot.a LIBZFSBOOT=${BOOTOBJ}/zfs/libzfsboot.a .endif -.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" -CFLAGS+= -DLOADER_GELI_SUPPORT -CFLAGS+= -I${BOOTSRC}/geli -LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a -.PATH: ${SYSDIR}/opencrypto -OPENCRYPTO_XTS= xform_aes_xts.o -.endif - CFLAGS.gcc+= --param max-inline-insns-single=100 LD_FLAGS+=${LD_FLAGS_BIN} -CLEANFILES= gptzfsboot +CLEANFILES+= gptzfsboot gptzfsboot: gptldr.bin gptzfsboot.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \ diff --git a/sys/boot/i386/gptzfsboot/Makefile.depend b/stand/i386/gptzfsboot/Makefile.depend similarity index 67% rename from sys/boot/i386/gptzfsboot/Makefile.depend rename to stand/i386/gptzfsboot/Makefile.depend index 16b58a77a452..ce86c7a5535c 100644 --- a/sys/boot/i386/gptzfsboot/Makefile.depend +++ b/stand/i386/gptzfsboot/Makefile.depend @@ -5,11 +5,11 @@ DIRDEPS = \ include \ include/xlocale \ lib/libmd \ - sys/boot/geli \ - sys/boot/i386/btx/btx \ - sys/boot/i386/btx/lib \ - sys/boot/libsa32 \ - sys/boot/zfs32 \ + stand/geli \ + stand/i386/btx/btx \ + stand/i386/btx/lib \ + stand/libsa32 \ + stand/zfs32 \ .include diff --git a/sys/boot/i386/gptzfsboot/gptzfsboot.8 b/stand/i386/gptzfsboot/gptzfsboot.8 similarity index 100% rename from sys/boot/i386/gptzfsboot/gptzfsboot.8 rename to stand/i386/gptzfsboot/gptzfsboot.8 diff --git a/sys/boot/i386/kgzldr/Makefile b/stand/i386/kgzldr/Makefile similarity index 100% rename from sys/boot/i386/kgzldr/Makefile rename to stand/i386/kgzldr/Makefile diff --git a/sys/boot/i386/kgzldr/Makefile.depend b/stand/i386/kgzldr/Makefile.depend similarity index 100% rename from sys/boot/i386/kgzldr/Makefile.depend rename to stand/i386/kgzldr/Makefile.depend diff --git a/sys/boot/i386/kgzldr/boot.c b/stand/i386/kgzldr/boot.c similarity index 100% rename from sys/boot/i386/kgzldr/boot.c rename to stand/i386/kgzldr/boot.c diff --git a/sys/boot/i386/kgzldr/crt.s b/stand/i386/kgzldr/crt.s similarity index 100% rename from sys/boot/i386/kgzldr/crt.s rename to stand/i386/kgzldr/crt.s diff --git a/sys/boot/i386/kgzldr/kgzldr.h b/stand/i386/kgzldr/kgzldr.h similarity index 100% rename from sys/boot/i386/kgzldr/kgzldr.h rename to stand/i386/kgzldr/kgzldr.h diff --git a/sys/boot/i386/kgzldr/lib.c b/stand/i386/kgzldr/lib.c similarity index 100% rename from sys/boot/i386/kgzldr/lib.c rename to stand/i386/kgzldr/lib.c diff --git a/sys/boot/i386/kgzldr/sio.s b/stand/i386/kgzldr/sio.s similarity index 100% rename from sys/boot/i386/kgzldr/sio.s rename to stand/i386/kgzldr/sio.s diff --git a/sys/boot/i386/kgzldr/start.s b/stand/i386/kgzldr/start.s similarity index 100% rename from sys/boot/i386/kgzldr/start.s rename to stand/i386/kgzldr/start.s diff --git a/sys/boot/i386/libfirewire/Makefile b/stand/i386/libfirewire/Makefile similarity index 89% rename from sys/boot/i386/libfirewire/Makefile rename to stand/i386/libfirewire/Makefile index be906ff94636..d3f88c448b6f 100644 --- a/sys/boot/i386/libfirewire/Makefile +++ b/stand/i386/libfirewire/Makefile @@ -11,7 +11,7 @@ SRCS+= dcons.c fwcrom.c CFLAGS+= -D_BOOT -CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. +CFLAGS+= -I${LDRSRC} CFLAGS+= -I${BTXLIB} CFLAGS+= -I${BOOTSRC}/i386/libi386 diff --git a/sys/boot/i386/libfirewire/Makefile.depend b/stand/i386/libfirewire/Makefile.depend similarity index 100% rename from sys/boot/i386/libfirewire/Makefile.depend rename to stand/i386/libfirewire/Makefile.depend diff --git a/sys/boot/i386/libfirewire/dconsole.c b/stand/i386/libfirewire/dconsole.c similarity index 100% rename from sys/boot/i386/libfirewire/dconsole.c rename to stand/i386/libfirewire/dconsole.c diff --git a/sys/boot/i386/libfirewire/firewire.c b/stand/i386/libfirewire/firewire.c similarity index 100% rename from sys/boot/i386/libfirewire/firewire.c rename to stand/i386/libfirewire/firewire.c diff --git a/sys/boot/i386/libfirewire/fwohci.c b/stand/i386/libfirewire/fwohci.c similarity index 100% rename from sys/boot/i386/libfirewire/fwohci.c rename to stand/i386/libfirewire/fwohci.c diff --git a/sys/boot/i386/libfirewire/fwohci.h b/stand/i386/libfirewire/fwohci.h similarity index 100% rename from sys/boot/i386/libfirewire/fwohci.h rename to stand/i386/libfirewire/fwohci.h diff --git a/sys/boot/i386/libfirewire/fwohcireg.h b/stand/i386/libfirewire/fwohcireg.h similarity index 100% rename from sys/boot/i386/libfirewire/fwohcireg.h rename to stand/i386/libfirewire/fwohcireg.h diff --git a/sys/boot/i386/libi386/Makefile b/stand/i386/libi386/Makefile similarity index 89% rename from sys/boot/i386/libi386/Makefile rename to stand/i386/libi386/Makefile index 20ce255fd50b..8d65513436c3 100644 --- a/sys/boot/i386/libi386/Makefile +++ b/stand/i386/libi386/Makefile @@ -1,5 +1,8 @@ # $FreeBSD$ +HAVE_GPT= yes +HAVE_GELI= yes + .include LIB= i386 @@ -25,12 +28,6 @@ CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED} CFLAGS+= -DDISK_DEBUG .endif -.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" -# Decrypt encrypted drives -CFLAGS+= -DLOADER_GELI_SUPPORT -CFLAGS+= -I${BOOTSRC}/geli -.endif - .if !defined(BOOT_HIDE_SERIAL_NUMBERS) # Export serial numbers, UUID, and asset tag from loader. CFLAGS+= -DSMBIOS_SERIAL_NUMBERS @@ -52,8 +49,7 @@ CFLAGS+= -Dalloca=__builtin_alloca CFLAGS+= -I${BOOTSRC}/ficl -I${BOOTSRC}/ficl/i386 \ -I${LDRSRC} -I${BOOTSRC}/i386/common \ -I${BTXLIB} \ - -I${SYSDIR}/contrib/dev/acpica/include \ - -I${SYSDIR} -I. + -I${SYSDIR}/contrib/dev/acpica/include # Handle FreeBSD specific %b and %D printf format specifiers CFLAGS+= ${FORMAT_EXTENSIONS} diff --git a/sys/boot/i386/libi386/Makefile.depend b/stand/i386/libi386/Makefile.depend similarity index 100% rename from sys/boot/i386/libi386/Makefile.depend rename to stand/i386/libi386/Makefile.depend diff --git a/sys/boot/i386/libi386/amd64_tramp.S b/stand/i386/libi386/amd64_tramp.S similarity index 100% rename from sys/boot/i386/libi386/amd64_tramp.S rename to stand/i386/libi386/amd64_tramp.S diff --git a/sys/boot/i386/libi386/biosacpi.c b/stand/i386/libi386/biosacpi.c similarity index 100% rename from sys/boot/i386/libi386/biosacpi.c rename to stand/i386/libi386/biosacpi.c diff --git a/sys/boot/i386/libi386/bioscd.c b/stand/i386/libi386/bioscd.c similarity index 100% rename from sys/boot/i386/libi386/bioscd.c rename to stand/i386/libi386/bioscd.c diff --git a/sys/boot/i386/libi386/biosdisk.c b/stand/i386/libi386/biosdisk.c similarity index 100% rename from sys/boot/i386/libi386/biosdisk.c rename to stand/i386/libi386/biosdisk.c diff --git a/sys/boot/i386/libi386/biosmem.c b/stand/i386/libi386/biosmem.c similarity index 100% rename from sys/boot/i386/libi386/biosmem.c rename to stand/i386/libi386/biosmem.c diff --git a/sys/boot/i386/libi386/biospci.c b/stand/i386/libi386/biospci.c similarity index 100% rename from sys/boot/i386/libi386/biospci.c rename to stand/i386/libi386/biospci.c diff --git a/sys/boot/i386/libi386/biospnp.c b/stand/i386/libi386/biospnp.c similarity index 100% rename from sys/boot/i386/libi386/biospnp.c rename to stand/i386/libi386/biospnp.c diff --git a/sys/boot/i386/libi386/biossmap.c b/stand/i386/libi386/biossmap.c similarity index 100% rename from sys/boot/i386/libi386/biossmap.c rename to stand/i386/libi386/biossmap.c diff --git a/sys/boot/i386/libi386/bootinfo.c b/stand/i386/libi386/bootinfo.c similarity index 100% rename from sys/boot/i386/libi386/bootinfo.c rename to stand/i386/libi386/bootinfo.c diff --git a/sys/boot/i386/libi386/bootinfo32.c b/stand/i386/libi386/bootinfo32.c similarity index 100% rename from sys/boot/i386/libi386/bootinfo32.c rename to stand/i386/libi386/bootinfo32.c diff --git a/sys/boot/i386/libi386/bootinfo64.c b/stand/i386/libi386/bootinfo64.c similarity index 100% rename from sys/boot/i386/libi386/bootinfo64.c rename to stand/i386/libi386/bootinfo64.c diff --git a/sys/boot/i386/libi386/comconsole.c b/stand/i386/libi386/comconsole.c similarity index 100% rename from sys/boot/i386/libi386/comconsole.c rename to stand/i386/libi386/comconsole.c diff --git a/sys/boot/i386/libi386/devicename.c b/stand/i386/libi386/devicename.c similarity index 100% rename from sys/boot/i386/libi386/devicename.c rename to stand/i386/libi386/devicename.c diff --git a/sys/boot/i386/libi386/elf32_freebsd.c b/stand/i386/libi386/elf32_freebsd.c similarity index 100% rename from sys/boot/i386/libi386/elf32_freebsd.c rename to stand/i386/libi386/elf32_freebsd.c diff --git a/sys/boot/i386/libi386/elf64_freebsd.c b/stand/i386/libi386/elf64_freebsd.c similarity index 100% rename from sys/boot/i386/libi386/elf64_freebsd.c rename to stand/i386/libi386/elf64_freebsd.c diff --git a/sys/boot/i386/libi386/i386_copy.c b/stand/i386/libi386/i386_copy.c similarity index 100% rename from sys/boot/i386/libi386/i386_copy.c rename to stand/i386/libi386/i386_copy.c diff --git a/sys/boot/i386/libi386/i386_module.c b/stand/i386/libi386/i386_module.c similarity index 100% rename from sys/boot/i386/libi386/i386_module.c rename to stand/i386/libi386/i386_module.c diff --git a/sys/boot/i386/libi386/libi386.h b/stand/i386/libi386/libi386.h similarity index 100% rename from sys/boot/i386/libi386/libi386.h rename to stand/i386/libi386/libi386.h diff --git a/sys/boot/i386/libi386/multiboot.c b/stand/i386/libi386/multiboot.c similarity index 100% rename from sys/boot/i386/libi386/multiboot.c rename to stand/i386/libi386/multiboot.c diff --git a/sys/boot/i386/libi386/multiboot.h b/stand/i386/libi386/multiboot.h similarity index 100% rename from sys/boot/i386/libi386/multiboot.h rename to stand/i386/libi386/multiboot.h diff --git a/sys/boot/i386/libi386/multiboot_tramp.S b/stand/i386/libi386/multiboot_tramp.S similarity index 100% rename from sys/boot/i386/libi386/multiboot_tramp.S rename to stand/i386/libi386/multiboot_tramp.S diff --git a/sys/boot/i386/libi386/nullconsole.c b/stand/i386/libi386/nullconsole.c similarity index 100% rename from sys/boot/i386/libi386/nullconsole.c rename to stand/i386/libi386/nullconsole.c diff --git a/sys/boot/i386/libi386/pread.c b/stand/i386/libi386/pread.c similarity index 100% rename from sys/boot/i386/libi386/pread.c rename to stand/i386/libi386/pread.c diff --git a/sys/boot/i386/libi386/pxe.c b/stand/i386/libi386/pxe.c similarity index 100% rename from sys/boot/i386/libi386/pxe.c rename to stand/i386/libi386/pxe.c diff --git a/sys/boot/i386/libi386/pxe.h b/stand/i386/libi386/pxe.h similarity index 100% rename from sys/boot/i386/libi386/pxe.h rename to stand/i386/libi386/pxe.h diff --git a/sys/boot/i386/libi386/pxetramp.s b/stand/i386/libi386/pxetramp.s similarity index 100% rename from sys/boot/i386/libi386/pxetramp.s rename to stand/i386/libi386/pxetramp.s diff --git a/sys/boot/i386/libi386/relocater_tramp.S b/stand/i386/libi386/relocater_tramp.S similarity index 100% rename from sys/boot/i386/libi386/relocater_tramp.S rename to stand/i386/libi386/relocater_tramp.S diff --git a/sys/boot/i386/libi386/smbios.c b/stand/i386/libi386/smbios.c similarity index 100% rename from sys/boot/i386/libi386/smbios.c rename to stand/i386/libi386/smbios.c diff --git a/sys/boot/i386/libi386/smbios.h b/stand/i386/libi386/smbios.h similarity index 100% rename from sys/boot/i386/libi386/smbios.h rename to stand/i386/libi386/smbios.h diff --git a/sys/boot/i386/libi386/spinconsole.c b/stand/i386/libi386/spinconsole.c similarity index 100% rename from sys/boot/i386/libi386/spinconsole.c rename to stand/i386/libi386/spinconsole.c diff --git a/sys/boot/i386/libi386/time.c b/stand/i386/libi386/time.c similarity index 100% rename from sys/boot/i386/libi386/time.c rename to stand/i386/libi386/time.c diff --git a/sys/boot/i386/libi386/vidconsole.c b/stand/i386/libi386/vidconsole.c similarity index 100% rename from sys/boot/i386/libi386/vidconsole.c rename to stand/i386/libi386/vidconsole.c diff --git a/sys/boot/i386/loader/Makefile b/stand/i386/loader/Makefile similarity index 65% rename from sys/boot/i386/loader/Makefile rename to stand/i386/loader/Makefile index e330b6e7b72d..40ac46ce0cf7 100644 --- a/sys/boot/i386/loader/Makefile +++ b/stand/i386/loader/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +HAVE_GELI= yes + LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes @@ -21,25 +23,11 @@ INTERNALPROG= NEWVERSWHAT?= "bootstrap loader" x86 VERSION_FILE= ${.CURDIR}/../loader/version +.PATH: ${BOOTSRC}/i386/loader + # architecture-specific loader code SRCS= main.c conf.c vers.c chain.c -# Put LOADER_FIREWIRE_SUPPORT=yes in /etc/make.conf for FireWire/dcons support -.if defined(LOADER_FIREWIRE_SUPPORT) -CFLAGS+= -DLOADER_FIREWIRE_SUPPORT -LIBFIREWIRE= ${BOOTOBJ}/i386/libfirewire/libfirewire.a -.endif - -# Set by zfsloader Makefile -.if defined(LOADER_ZFS_SUPPORT) -CFLAGS+= -DLOADER_ZFS_SUPPORT -.if ${MACHINE} == "amd64" -LIBZFSBOOT= ${BOOTOBJ}/zfs32/libzfsboot.a -.else -LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a -.endif -.endif - # Include bcache code. HAVE_BCACHE= yes @@ -47,20 +35,21 @@ HAVE_BCACHE= yes HAVE_PNP= yes HAVE_ISABUS= yes -.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" -CFLAGS+= -DLOADER_GELI_SUPPORT -CFLAGS+= -I${BOOTSRC}/geli -LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a -.PATH: ${SYSDIR}/opencrypto -SRCS+= xform_aes_xts.c -CFLAGS+= -I${SYSDIR} -D_STAND +.if ${MK_LOADER_FIREWIRE} == "yes" +CFLAGS+= -DLOADER_FIREWIRE_SUPPORT +LIBFIREWIRE= ${BOOTOBJ}/i386/libfirewire/libfirewire.a +.endif + +.if exists(${.CURDIR}/help.i386) +HELP_FILES+= help.i386 +.else +HELP_FILES= .endif # Always add MI sources .include "${BOOTSRC}/loader.mk" -CFLAGS+= -I. -CLEANFILES= ${LOADER} ${LOADER}.bin loader.help +CLEANFILES+= ${LOADER} ${LOADER}.bin CFLAGS+= -Wall LDFLAGS+= -static -Ttext 0x0 @@ -83,21 +72,10 @@ ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} ${LOADER}.bin: ${LOADER}.sym strip -R .comment -R .note -o ${.TARGET} ${.ALLSRC} -loader.help: help.common help.i386 - cat ${.ALLSRC} | awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -FILES= ${LOADER} +FILES+= ${LOADER} # XXX INSTALLFLAGS_loader= -b FILESMODE_${LOADER}= ${BINMODE} -b -.if !defined(LOADER_ONLY) -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" -FILES+= pcibios.4th - -FILES+= loader.rc menu.rc -.endif - # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} diff --git a/stand/i386/loader/Makefile.depend b/stand/i386/loader/Makefile.depend new file mode 100644 index 000000000000..05739faa951d --- /dev/null +++ b/stand/i386/loader/Makefile.depend @@ -0,0 +1,20 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + stand/ficl32 \ + stand/geli \ + stand/i386/btx/btx \ + stand/i386/btx/btxldr \ + stand/i386/btx/lib \ + stand/i386/libi386 \ + stand/libsa32 \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/sys/boot/i386/loader/chain.c b/stand/i386/loader/chain.c similarity index 100% rename from sys/boot/i386/loader/chain.c rename to stand/i386/loader/chain.c diff --git a/sys/boot/i386/loader/conf.c b/stand/i386/loader/conf.c similarity index 100% rename from sys/boot/i386/loader/conf.c rename to stand/i386/loader/conf.c diff --git a/sys/boot/i386/loader/help.i386 b/stand/i386/loader/help.i386 similarity index 100% rename from sys/boot/i386/loader/help.i386 rename to stand/i386/loader/help.i386 diff --git a/sys/boot/i386/loader/loader.rc b/stand/i386/loader/loader.rc similarity index 100% rename from sys/boot/i386/loader/loader.rc rename to stand/i386/loader/loader.rc diff --git a/sys/boot/i386/loader/main.c b/stand/i386/loader/main.c similarity index 100% rename from sys/boot/i386/loader/main.c rename to stand/i386/loader/main.c diff --git a/sys/boot/i386/loader/version b/stand/i386/loader/version similarity index 100% rename from sys/boot/i386/loader/version rename to stand/i386/loader/version diff --git a/sys/boot/i386/mbr/Makefile b/stand/i386/mbr/Makefile similarity index 100% rename from sys/boot/i386/mbr/Makefile rename to stand/i386/mbr/Makefile diff --git a/sys/boot/i386/mbr/Makefile.depend b/stand/i386/mbr/Makefile.depend similarity index 100% rename from sys/boot/i386/mbr/Makefile.depend rename to stand/i386/mbr/Makefile.depend diff --git a/sys/boot/i386/mbr/mbr.s b/stand/i386/mbr/mbr.s similarity index 100% rename from sys/boot/i386/mbr/mbr.s rename to stand/i386/mbr/mbr.s diff --git a/sys/boot/i386/pmbr/Makefile b/stand/i386/pmbr/Makefile similarity index 100% rename from sys/boot/i386/pmbr/Makefile rename to stand/i386/pmbr/Makefile diff --git a/sys/boot/i386/pmbr/Makefile.depend b/stand/i386/pmbr/Makefile.depend similarity index 100% rename from sys/boot/i386/pmbr/Makefile.depend rename to stand/i386/pmbr/Makefile.depend diff --git a/sys/boot/i386/pmbr/pmbr.s b/stand/i386/pmbr/pmbr.s similarity index 100% rename from sys/boot/i386/pmbr/pmbr.s rename to stand/i386/pmbr/pmbr.s diff --git a/sys/boot/i386/pxeldr/Makefile b/stand/i386/pxeldr/Makefile similarity index 97% rename from sys/boot/i386/pxeldr/Makefile rename to stand/i386/pxeldr/Makefile index 57931a5206cd..819283cf8a2a 100644 --- a/sys/boot/i386/pxeldr/Makefile +++ b/stand/i386/pxeldr/Makefile @@ -7,7 +7,7 @@ INTERNALPROG= FILES= ${BOOT} MAN= ${BOOT}.8 SRCS= ${LDR}.S -CLEANFILES= ${BOOT} +CLEANFILES+= ${BOOT} BOOT= pxeboot LDR= pxeldr diff --git a/sys/boot/i386/pxeldr/Makefile.depend b/stand/i386/pxeldr/Makefile.depend similarity index 70% rename from sys/boot/i386/pxeldr/Makefile.depend rename to stand/i386/pxeldr/Makefile.depend index c6f574a284a3..35b75b1ca42b 100644 --- a/sys/boot/i386/pxeldr/Makefile.depend +++ b/stand/i386/pxeldr/Makefile.depend @@ -3,9 +3,9 @@ DIRDEPS = \ include \ - sys/boot/i386/btx/btx \ - sys/boot/i386/btx/btxldr \ - sys/boot/i386/loader \ + stand/i386/btx/btx \ + stand/i386/btx/btxldr \ + stand/i386/loader \ .include diff --git a/sys/boot/i386/pxeldr/pxeboot.8 b/stand/i386/pxeldr/pxeboot.8 similarity index 100% rename from sys/boot/i386/pxeldr/pxeboot.8 rename to stand/i386/pxeldr/pxeboot.8 diff --git a/sys/boot/i386/pxeldr/pxeldr.S b/stand/i386/pxeldr/pxeldr.S similarity index 100% rename from sys/boot/i386/pxeldr/pxeldr.S rename to stand/i386/pxeldr/pxeldr.S diff --git a/sys/boot/i386/zfsboot/Makefile b/stand/i386/zfsboot/Makefile similarity index 91% rename from sys/boot/i386/zfsboot/Makefile rename to stand/i386/zfsboot/Makefile index a83bfa960590..f0523dfa2612 100644 --- a/sys/boot/i386/zfsboot/Makefile +++ b/stand/i386/zfsboot/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -LOADER_GELI_SUPPORT=no +HAVE_GELI=yes .include @@ -30,7 +30,7 @@ CFLAGS+=-DBOOTPROG=\"zfsboot\" \ -I${BOOTSRC}/i386 \ -I${ZFSSRC} \ -I${SYSDIR}/cddl/boot/zfs \ - -I${BTXLIB} -I. \ + -I${BTXLIB} \ -I${BOOTSRC}/i386/boot2 \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ @@ -46,7 +46,7 @@ LIBZFSBOOT=${BOOTOBJ}/zfs/libzfsboot.a LD_FLAGS+=${LD_FLAGS_BIN} -CLEANFILES= zfsboot +CLEANFILES+= zfsboot zfsboot: zfsboot1 zfsboot2 cat zfsboot1 zfsboot2 > zfsboot @@ -60,7 +60,7 @@ zfsldr.out: zfsldr.o ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o CLEANFILES+= zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \ - zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o util.o + zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o # We currently allow 128k bytes for zfsboot - in practice it could be # any size up to 3.5Mb but keeping it fixed size simplifies zfsldr. @@ -82,8 +82,8 @@ zfsboot.ldr: zfsboot.bin: zfsboot.out ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET} -zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBSA32} +zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBGELIBOOT} ${LIBSA32} SRCS= zfsboot.c diff --git a/sys/boot/i386/zfsboot/Makefile.depend b/stand/i386/zfsboot/Makefile.depend similarity index 71% rename from sys/boot/i386/zfsboot/Makefile.depend rename to stand/i386/zfsboot/Makefile.depend index 491ced5bb565..58b2754996b4 100644 --- a/sys/boot/i386/zfsboot/Makefile.depend +++ b/stand/i386/zfsboot/Makefile.depend @@ -5,10 +5,10 @@ DIRDEPS = \ include \ include/xlocale \ lib/libmd \ - sys/boot/i386/btx/btx \ - sys/boot/i386/btx/lib \ - sys/boot/libsa32 \ - sys/boot/zfs32 \ + stand/i386/btx/btx \ + stand/i386/btx/lib \ + stand/libsa32 \ + stand/zfs32 \ .include diff --git a/sys/boot/i386/zfsboot/zfsboot.8 b/stand/i386/zfsboot/zfsboot.8 similarity index 100% rename from sys/boot/i386/zfsboot/zfsboot.8 rename to stand/i386/zfsboot/zfsboot.8 diff --git a/sys/boot/i386/zfsboot/zfsboot.c b/stand/i386/zfsboot/zfsboot.c similarity index 100% rename from sys/boot/i386/zfsboot/zfsboot.c rename to stand/i386/zfsboot/zfsboot.c diff --git a/sys/boot/i386/zfsboot/zfsldr.S b/stand/i386/zfsboot/zfsldr.S similarity index 100% rename from sys/boot/i386/zfsboot/zfsldr.S rename to stand/i386/zfsboot/zfsldr.S diff --git a/stand/i386/zfsloader/Makefile b/stand/i386/zfsloader/Makefile new file mode 100644 index 000000000000..a9fa913e7e13 --- /dev/null +++ b/stand/i386/zfsloader/Makefile @@ -0,0 +1,7 @@ +# $FreeBSD$ + +LOADER= zfsloader +NEWVERSWHAT= "ZFS enabled bootstrap loader" x86 +HAVE_ZFS= yes + +.include "${.CURDIR}/../loader/Makefile" diff --git a/stand/i386/zfsloader/Makefile.depend b/stand/i386/zfsloader/Makefile.depend new file mode 100644 index 000000000000..59ee8748092a --- /dev/null +++ b/stand/i386/zfsloader/Makefile.depend @@ -0,0 +1,21 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + stand/ficl32 \ + stand/geli \ + stand/i386/btx/btx \ + stand/i386/btx/btxldr \ + stand/i386/btx/lib \ + stand/i386/libi386 \ + stand/libsa32 \ + stand/zfs32 \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/sys/boot/kshim/bsd_busspace.c b/stand/kshim/bsd_busspace.c similarity index 100% rename from sys/boot/kshim/bsd_busspace.c rename to stand/kshim/bsd_busspace.c diff --git a/sys/boot/kshim/bsd_global.h b/stand/kshim/bsd_global.h similarity index 100% rename from sys/boot/kshim/bsd_global.h rename to stand/kshim/bsd_global.h diff --git a/sys/boot/kshim/bsd_kernel.c b/stand/kshim/bsd_kernel.c similarity index 100% rename from sys/boot/kshim/bsd_kernel.c rename to stand/kshim/bsd_kernel.c diff --git a/sys/boot/kshim/bsd_kernel.h b/stand/kshim/bsd_kernel.h similarity index 100% rename from sys/boot/kshim/bsd_kernel.h rename to stand/kshim/bsd_kernel.h diff --git a/sys/boot/kshim/kshim.mk b/stand/kshim/kshim.mk similarity index 100% rename from sys/boot/kshim/kshim.mk rename to stand/kshim/kshim.mk diff --git a/sys/boot/kshim/sysinit.h b/stand/kshim/sysinit.h similarity index 100% rename from sys/boot/kshim/sysinit.h rename to stand/kshim/sysinit.h diff --git a/sys/boot/libsa/Makefile b/stand/libsa/Makefile similarity index 99% rename from sys/boot/libsa/Makefile rename to stand/libsa/Makefile index 057eb7615beb..9aa228847c83 100644 --- a/sys/boot/libsa/Makefile +++ b/stand/libsa/Makefile @@ -19,7 +19,7 @@ LIB?= sa NO_PIC= WARNS?= 0 -CFLAGS+= -I${SASRC} -I${SYSDIR} +CFLAGS+= -I${SASRC} # standalone components and stuff we have modified locally SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c environment.c getopt.c gets.c \ diff --git a/sys/boot/libsa/Makefile.depend b/stand/libsa/Makefile.depend similarity index 100% rename from sys/boot/libsa/Makefile.depend rename to stand/libsa/Makefile.depend diff --git a/sys/boot/libsa/__main.c b/stand/libsa/__main.c similarity index 100% rename from sys/boot/libsa/__main.c rename to stand/libsa/__main.c diff --git a/sys/boot/libsa/amd64/_setjmp.S b/stand/libsa/amd64/_setjmp.S similarity index 100% rename from sys/boot/libsa/amd64/_setjmp.S rename to stand/libsa/amd64/_setjmp.S diff --git a/sys/boot/libsa/arp.c b/stand/libsa/arp.c similarity index 100% rename from sys/boot/libsa/arp.c rename to stand/libsa/arp.c diff --git a/sys/boot/libsa/assert.c b/stand/libsa/assert.c similarity index 100% rename from sys/boot/libsa/assert.c rename to stand/libsa/assert.c diff --git a/sys/boot/libsa/bcd.c b/stand/libsa/bcd.c similarity index 100% rename from sys/boot/libsa/bcd.c rename to stand/libsa/bcd.c diff --git a/sys/boot/libsa/bootp.c b/stand/libsa/bootp.c similarity index 100% rename from sys/boot/libsa/bootp.c rename to stand/libsa/bootp.c diff --git a/sys/boot/libsa/bootp.h b/stand/libsa/bootp.h similarity index 100% rename from sys/boot/libsa/bootp.h rename to stand/libsa/bootp.h diff --git a/sys/boot/libsa/bootparam.c b/stand/libsa/bootparam.c similarity index 100% rename from sys/boot/libsa/bootparam.c rename to stand/libsa/bootparam.c diff --git a/sys/boot/libsa/bootparam.h b/stand/libsa/bootparam.h similarity index 100% rename from sys/boot/libsa/bootparam.h rename to stand/libsa/bootparam.h diff --git a/sys/boot/libsa/bzipfs.c b/stand/libsa/bzipfs.c similarity index 100% rename from sys/boot/libsa/bzipfs.c rename to stand/libsa/bzipfs.c diff --git a/sys/boot/libsa/cd9660.c b/stand/libsa/cd9660.c similarity index 100% rename from sys/boot/libsa/cd9660.c rename to stand/libsa/cd9660.c diff --git a/sys/boot/libsa/close.c b/stand/libsa/close.c similarity index 100% rename from sys/boot/libsa/close.c rename to stand/libsa/close.c diff --git a/sys/boot/libsa/closeall.c b/stand/libsa/closeall.c similarity index 100% rename from sys/boot/libsa/closeall.c rename to stand/libsa/closeall.c diff --git a/sys/boot/libsa/crc32.c b/stand/libsa/crc32.c similarity index 100% rename from sys/boot/libsa/crc32.c rename to stand/libsa/crc32.c diff --git a/sys/boot/libsa/crc32.h b/stand/libsa/crc32.h similarity index 100% rename from sys/boot/libsa/crc32.h rename to stand/libsa/crc32.h diff --git a/sys/boot/libsa/dev.c b/stand/libsa/dev.c similarity index 100% rename from sys/boot/libsa/dev.c rename to stand/libsa/dev.c diff --git a/sys/boot/libsa/dosfs.c b/stand/libsa/dosfs.c similarity index 100% rename from sys/boot/libsa/dosfs.c rename to stand/libsa/dosfs.c diff --git a/sys/boot/libsa/dosfs.h b/stand/libsa/dosfs.h similarity index 100% rename from sys/boot/libsa/dosfs.h rename to stand/libsa/dosfs.h diff --git a/sys/boot/libsa/environment.c b/stand/libsa/environment.c similarity index 100% rename from sys/boot/libsa/environment.c rename to stand/libsa/environment.c diff --git a/sys/boot/libsa/ether.c b/stand/libsa/ether.c similarity index 100% rename from sys/boot/libsa/ether.c rename to stand/libsa/ether.c diff --git a/sys/boot/libsa/ext2fs.c b/stand/libsa/ext2fs.c similarity index 100% rename from sys/boot/libsa/ext2fs.c rename to stand/libsa/ext2fs.c diff --git a/sys/boot/libsa/fstat.c b/stand/libsa/fstat.c similarity index 100% rename from sys/boot/libsa/fstat.c rename to stand/libsa/fstat.c diff --git a/sys/boot/libsa/getopt.c b/stand/libsa/getopt.c similarity index 100% rename from sys/boot/libsa/getopt.c rename to stand/libsa/getopt.c diff --git a/sys/boot/libsa/gets.c b/stand/libsa/gets.c similarity index 100% rename from sys/boot/libsa/gets.c rename to stand/libsa/gets.c diff --git a/sys/boot/libsa/globals.c b/stand/libsa/globals.c similarity index 100% rename from sys/boot/libsa/globals.c rename to stand/libsa/globals.c diff --git a/sys/boot/libsa/gpt.c b/stand/libsa/gpt.c similarity index 100% rename from sys/boot/libsa/gpt.c rename to stand/libsa/gpt.c diff --git a/sys/boot/libsa/gpt.h b/stand/libsa/gpt.h similarity index 100% rename from sys/boot/libsa/gpt.h rename to stand/libsa/gpt.h diff --git a/sys/boot/libsa/gzipfs.c b/stand/libsa/gzipfs.c similarity index 100% rename from sys/boot/libsa/gzipfs.c rename to stand/libsa/gzipfs.c diff --git a/sys/boot/libsa/i386/_setjmp.S b/stand/libsa/i386/_setjmp.S similarity index 100% rename from sys/boot/libsa/i386/_setjmp.S rename to stand/libsa/i386/_setjmp.S diff --git a/sys/boot/libsa/in_cksum.c b/stand/libsa/in_cksum.c similarity index 100% rename from sys/boot/libsa/in_cksum.c rename to stand/libsa/in_cksum.c diff --git a/sys/boot/libsa/inet_ntoa.c b/stand/libsa/inet_ntoa.c similarity index 100% rename from sys/boot/libsa/inet_ntoa.c rename to stand/libsa/inet_ntoa.c diff --git a/sys/boot/libsa/ioctl.c b/stand/libsa/ioctl.c similarity index 100% rename from sys/boot/libsa/ioctl.c rename to stand/libsa/ioctl.c diff --git a/sys/boot/libsa/iodesc.h b/stand/libsa/iodesc.h similarity index 100% rename from sys/boot/libsa/iodesc.h rename to stand/libsa/iodesc.h diff --git a/sys/boot/libsa/ip.c b/stand/libsa/ip.c similarity index 100% rename from sys/boot/libsa/ip.c rename to stand/libsa/ip.c diff --git a/sys/boot/libsa/libstand.3 b/stand/libsa/libstand.3 similarity index 100% rename from sys/boot/libsa/libstand.3 rename to stand/libsa/libstand.3 diff --git a/sys/boot/libsa/lseek.c b/stand/libsa/lseek.c similarity index 100% rename from sys/boot/libsa/lseek.c rename to stand/libsa/lseek.c diff --git a/sys/boot/libsa/mips/_setjmp.S b/stand/libsa/mips/_setjmp.S similarity index 100% rename from sys/boot/libsa/mips/_setjmp.S rename to stand/libsa/mips/_setjmp.S diff --git a/sys/boot/libsa/nandfs.c b/stand/libsa/nandfs.c similarity index 100% rename from sys/boot/libsa/nandfs.c rename to stand/libsa/nandfs.c diff --git a/sys/boot/libsa/net.c b/stand/libsa/net.c similarity index 100% rename from sys/boot/libsa/net.c rename to stand/libsa/net.c diff --git a/sys/boot/libsa/net.h b/stand/libsa/net.h similarity index 100% rename from sys/boot/libsa/net.h rename to stand/libsa/net.h diff --git a/sys/boot/libsa/netif.c b/stand/libsa/netif.c similarity index 100% rename from sys/boot/libsa/netif.c rename to stand/libsa/netif.c diff --git a/sys/boot/libsa/netif.h b/stand/libsa/netif.h similarity index 100% rename from sys/boot/libsa/netif.h rename to stand/libsa/netif.h diff --git a/sys/boot/libsa/nfs.c b/stand/libsa/nfs.c similarity index 100% rename from sys/boot/libsa/nfs.c rename to stand/libsa/nfs.c diff --git a/sys/boot/libsa/nfsv2.h b/stand/libsa/nfsv2.h similarity index 100% rename from sys/boot/libsa/nfsv2.h rename to stand/libsa/nfsv2.h diff --git a/sys/boot/libsa/nullfs.c b/stand/libsa/nullfs.c similarity index 100% rename from sys/boot/libsa/nullfs.c rename to stand/libsa/nullfs.c diff --git a/sys/boot/libsa/open.c b/stand/libsa/open.c similarity index 100% rename from sys/boot/libsa/open.c rename to stand/libsa/open.c diff --git a/sys/boot/libsa/pager.c b/stand/libsa/pager.c similarity index 100% rename from sys/boot/libsa/pager.c rename to stand/libsa/pager.c diff --git a/sys/boot/libsa/panic.c b/stand/libsa/panic.c similarity index 100% rename from sys/boot/libsa/panic.c rename to stand/libsa/panic.c diff --git a/sys/boot/libsa/pkgfs.c b/stand/libsa/pkgfs.c similarity index 100% rename from sys/boot/libsa/pkgfs.c rename to stand/libsa/pkgfs.c diff --git a/sys/boot/libsa/powerpc/_setjmp.S b/stand/libsa/powerpc/_setjmp.S similarity index 100% rename from sys/boot/libsa/powerpc/_setjmp.S rename to stand/libsa/powerpc/_setjmp.S diff --git a/sys/boot/libsa/powerpc/syncicache.c b/stand/libsa/powerpc/syncicache.c similarity index 100% rename from sys/boot/libsa/powerpc/syncicache.c rename to stand/libsa/powerpc/syncicache.c diff --git a/sys/boot/libsa/printf.c b/stand/libsa/printf.c similarity index 100% rename from sys/boot/libsa/printf.c rename to stand/libsa/printf.c diff --git a/sys/boot/libsa/qdivrem.c b/stand/libsa/qdivrem.c similarity index 100% rename from sys/boot/libsa/qdivrem.c rename to stand/libsa/qdivrem.c diff --git a/sys/boot/libsa/quad.h b/stand/libsa/quad.h similarity index 100% rename from sys/boot/libsa/quad.h rename to stand/libsa/quad.h diff --git a/sys/boot/libsa/random.c b/stand/libsa/random.c similarity index 100% rename from sys/boot/libsa/random.c rename to stand/libsa/random.c diff --git a/sys/boot/libsa/rarp.c b/stand/libsa/rarp.c similarity index 100% rename from sys/boot/libsa/rarp.c rename to stand/libsa/rarp.c diff --git a/sys/boot/libsa/read.c b/stand/libsa/read.c similarity index 100% rename from sys/boot/libsa/read.c rename to stand/libsa/read.c diff --git a/sys/boot/libsa/readdir.c b/stand/libsa/readdir.c similarity index 100% rename from sys/boot/libsa/readdir.c rename to stand/libsa/readdir.c diff --git a/sys/boot/libsa/rpc.c b/stand/libsa/rpc.c similarity index 100% rename from sys/boot/libsa/rpc.c rename to stand/libsa/rpc.c diff --git a/sys/boot/libsa/rpc.h b/stand/libsa/rpc.h similarity index 100% rename from sys/boot/libsa/rpc.h rename to stand/libsa/rpc.h diff --git a/sys/boot/libsa/rpcv2.h b/stand/libsa/rpcv2.h similarity index 100% rename from sys/boot/libsa/rpcv2.h rename to stand/libsa/rpcv2.h diff --git a/sys/boot/libsa/saioctl.h b/stand/libsa/saioctl.h similarity index 100% rename from sys/boot/libsa/saioctl.h rename to stand/libsa/saioctl.h diff --git a/sys/boot/libsa/sbrk.c b/stand/libsa/sbrk.c similarity index 100% rename from sys/boot/libsa/sbrk.c rename to stand/libsa/sbrk.c diff --git a/sys/boot/libsa/sparc64/_setjmp.S b/stand/libsa/sparc64/_setjmp.S similarity index 100% rename from sys/boot/libsa/sparc64/_setjmp.S rename to stand/libsa/sparc64/_setjmp.S diff --git a/sys/boot/libsa/splitfs.c b/stand/libsa/splitfs.c similarity index 100% rename from sys/boot/libsa/splitfs.c rename to stand/libsa/splitfs.c diff --git a/sys/boot/libsa/stand.h b/stand/libsa/stand.h similarity index 100% rename from sys/boot/libsa/stand.h rename to stand/libsa/stand.h diff --git a/sys/boot/libsa/stat.c b/stand/libsa/stat.c similarity index 100% rename from sys/boot/libsa/stat.c rename to stand/libsa/stat.c diff --git a/sys/boot/libsa/strcasecmp.c b/stand/libsa/strcasecmp.c similarity index 100% rename from sys/boot/libsa/strcasecmp.c rename to stand/libsa/strcasecmp.c diff --git a/sys/boot/libsa/strdup.c b/stand/libsa/strdup.c similarity index 100% rename from sys/boot/libsa/strdup.c rename to stand/libsa/strdup.c diff --git a/sys/boot/libsa/strerror.c b/stand/libsa/strerror.c similarity index 100% rename from sys/boot/libsa/strerror.c rename to stand/libsa/strerror.c diff --git a/sys/boot/libsa/strtol.c b/stand/libsa/strtol.c similarity index 100% rename from sys/boot/libsa/strtol.c rename to stand/libsa/strtol.c diff --git a/sys/boot/libsa/strtoul.c b/stand/libsa/strtoul.c similarity index 100% rename from sys/boot/libsa/strtoul.c rename to stand/libsa/strtoul.c diff --git a/sys/boot/libsa/tftp.c b/stand/libsa/tftp.c similarity index 100% rename from sys/boot/libsa/tftp.c rename to stand/libsa/tftp.c diff --git a/sys/boot/libsa/tftp.h b/stand/libsa/tftp.h similarity index 100% rename from sys/boot/libsa/tftp.h rename to stand/libsa/tftp.h diff --git a/sys/boot/libsa/twiddle.c b/stand/libsa/twiddle.c similarity index 100% rename from sys/boot/libsa/twiddle.c rename to stand/libsa/twiddle.c diff --git a/sys/boot/libsa/udp.c b/stand/libsa/udp.c similarity index 100% rename from sys/boot/libsa/udp.c rename to stand/libsa/udp.c diff --git a/sys/boot/libsa/ufs.c b/stand/libsa/ufs.c similarity index 100% rename from sys/boot/libsa/ufs.c rename to stand/libsa/ufs.c diff --git a/sys/boot/libsa/ufsread.c b/stand/libsa/ufsread.c similarity index 100% rename from sys/boot/libsa/ufsread.c rename to stand/libsa/ufsread.c diff --git a/sys/boot/libsa/util.c b/stand/libsa/util.c similarity index 100% rename from sys/boot/libsa/util.c rename to stand/libsa/util.c diff --git a/sys/boot/libsa/util.h b/stand/libsa/util.h similarity index 100% rename from sys/boot/libsa/util.h rename to stand/libsa/util.h diff --git a/sys/boot/libsa/uuid_from_string.c b/stand/libsa/uuid_from_string.c similarity index 100% rename from sys/boot/libsa/uuid_from_string.c rename to stand/libsa/uuid_from_string.c diff --git a/sys/boot/libsa/uuid_to_string.c b/stand/libsa/uuid_to_string.c similarity index 100% rename from sys/boot/libsa/uuid_to_string.c rename to stand/libsa/uuid_to_string.c diff --git a/sys/boot/libsa/write.c b/stand/libsa/write.c similarity index 100% rename from sys/boot/libsa/write.c rename to stand/libsa/write.c diff --git a/sys/boot/libsa/zalloc.c b/stand/libsa/zalloc.c similarity index 100% rename from sys/boot/libsa/zalloc.c rename to stand/libsa/zalloc.c diff --git a/sys/boot/libsa/zalloc_defs.h b/stand/libsa/zalloc_defs.h similarity index 100% rename from sys/boot/libsa/zalloc_defs.h rename to stand/libsa/zalloc_defs.h diff --git a/sys/boot/libsa/zalloc_malloc.c b/stand/libsa/zalloc_malloc.c similarity index 100% rename from sys/boot/libsa/zalloc_malloc.c rename to stand/libsa/zalloc_malloc.c diff --git a/sys/boot/libsa/zalloc_mem.h b/stand/libsa/zalloc_mem.h similarity index 100% rename from sys/boot/libsa/zalloc_mem.h rename to stand/libsa/zalloc_mem.h diff --git a/sys/boot/libsa/zalloc_protos.h b/stand/libsa/zalloc_protos.h similarity index 100% rename from sys/boot/libsa/zalloc_protos.h rename to stand/libsa/zalloc_protos.h diff --git a/sys/boot/libsa32/Makefile b/stand/libsa32/Makefile similarity index 91% rename from sys/boot/libsa32/Makefile rename to stand/libsa32/Makefile index f09811b62128..eba6c00bd891 100644 --- a/sys/boot/libsa32/Makefile +++ b/stand/libsa32/Makefile @@ -7,7 +7,5 @@ DO32=1 LIB=sa32 LIBSA_CPUARCH=${MACHINE_CPUARCH:C/amd64/i386/} -CFLAGS+= -I. - .PATH: ${SASRC} .include "${SASRC}/Makefile" diff --git a/sys/boot/libsa32/Makefile.depend b/stand/libsa32/Makefile.depend similarity index 100% rename from sys/boot/libsa32/Makefile.depend rename to stand/libsa32/Makefile.depend diff --git a/sys/boot/loader.mk b/stand/loader.mk similarity index 77% rename from sys/boot/loader.mk rename to stand/loader.mk index 26eda97df66d..7236c8614e06 100644 --- a/sys/boot/loader.mk +++ b/stand/loader.mk @@ -69,6 +69,19 @@ CFLAGS+= -DBOOT_PROMPT_123 SRCS+= install.c .endif +.if defined(HAVE_ZFS) +CFLAGS+= -DLOADER_ZFS_SUPPORT +CFLAGS+= -I${ZFSSRC} +CFLAGS+= -I${SYSDIR}/cddl/boot/zfs +.if ${MACHINE} == "amd64" +# Have to override to use 32-bit version of zfs library... +# kinda lame to select that there XXX +LIBZFSBOOT= ${BOOTOBJ}/zfs32/libzfsboot.a +.else +LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a +.endif +.endif + CLEANFILES+= vers.c VERSION_FILE?= ${.CURDIR}/version .if ${MK_REPRODUCIBLE_BUILD} != no @@ -77,3 +90,11 @@ REPRO_FLAG= -r vers.c: ${LDRSRC}/newvers.sh ${VERSION_FILE} sh ${LDRSRC}/newvers.sh ${REPRO_FLAG} ${VERSION_FILE} \ ${NEWVERSWHAT} + +.if !empty(HELP_FILES) +CLEANFILES+= loader.help +FILES+= loader.help + +loader.help: ${HELP_FILES} + cat ${HELP_FILES} | awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} +.endif diff --git a/sys/boot/man/Makefile b/stand/man/Makefile similarity index 100% rename from sys/boot/man/Makefile rename to stand/man/Makefile diff --git a/sys/boot/man/Makefile.depend b/stand/man/Makefile.depend similarity index 100% rename from sys/boot/man/Makefile.depend rename to stand/man/Makefile.depend diff --git a/sys/boot/man/loader.8 b/stand/man/loader.8 similarity index 100% rename from sys/boot/man/loader.8 rename to stand/man/loader.8 diff --git a/sys/boot/man/zfsloader.8 b/stand/man/zfsloader.8 similarity index 100% rename from sys/boot/man/zfsloader.8 rename to stand/man/zfsloader.8 diff --git a/sys/boot/mips/Makefile b/stand/mips/Makefile similarity index 100% rename from sys/boot/mips/Makefile rename to stand/mips/Makefile diff --git a/sys/boot/mips/Makefile.inc b/stand/mips/Makefile.inc similarity index 100% rename from sys/boot/mips/Makefile.inc rename to stand/mips/Makefile.inc diff --git a/sys/boot/mips/beri/Makefile b/stand/mips/beri/Makefile similarity index 100% rename from sys/boot/mips/beri/Makefile rename to stand/mips/beri/Makefile diff --git a/sys/boot/mips/beri/Makefile.inc b/stand/mips/beri/Makefile.inc similarity index 100% rename from sys/boot/mips/beri/Makefile.inc rename to stand/mips/beri/Makefile.inc diff --git a/sys/boot/mips/beri/boot2/Makefile b/stand/mips/beri/boot2/Makefile similarity index 99% rename from sys/boot/mips/beri/boot2/Makefile rename to stand/mips/beri/boot2/Makefile index 9a993e22cdac..d36934078e1a 100644 --- a/sys/boot/mips/beri/boot2/Makefile +++ b/stand/mips/beri/boot2/Makefile @@ -51,7 +51,6 @@ CFLAGS= -ffreestanding \ -I${.CURDIR} \ -I${SASRC} \ -I${LDRSRC} \ - -I${SYSDIR} \ -D_KERNEL \ -Wall \ -G0 \ diff --git a/sys/boot/mips/beri/boot2/boot2.c b/stand/mips/beri/boot2/boot2.c similarity index 100% rename from sys/boot/mips/beri/boot2/boot2.c rename to stand/mips/beri/boot2/boot2.c diff --git a/sys/boot/mips/beri/boot2/flashboot.ldscript b/stand/mips/beri/boot2/flashboot.ldscript similarity index 100% rename from sys/boot/mips/beri/boot2/flashboot.ldscript rename to stand/mips/beri/boot2/flashboot.ldscript diff --git a/sys/boot/mips/beri/boot2/jtagboot.ldscript b/stand/mips/beri/boot2/jtagboot.ldscript similarity index 100% rename from sys/boot/mips/beri/boot2/jtagboot.ldscript rename to stand/mips/beri/boot2/jtagboot.ldscript diff --git a/sys/boot/mips/beri/boot2/relocate.S b/stand/mips/beri/boot2/relocate.S similarity index 100% rename from sys/boot/mips/beri/boot2/relocate.S rename to stand/mips/beri/boot2/relocate.S diff --git a/sys/boot/mips/beri/boot2/start.S b/stand/mips/beri/boot2/start.S similarity index 100% rename from sys/boot/mips/beri/boot2/start.S rename to stand/mips/beri/boot2/start.S diff --git a/sys/boot/mips/beri/common/altera_jtag_uart.c b/stand/mips/beri/common/altera_jtag_uart.c similarity index 100% rename from sys/boot/mips/beri/common/altera_jtag_uart.c rename to stand/mips/beri/common/altera_jtag_uart.c diff --git a/sys/boot/mips/beri/common/beri.h b/stand/mips/beri/common/beri.h similarity index 100% rename from sys/boot/mips/beri/common/beri.h rename to stand/mips/beri/common/beri.h diff --git a/sys/boot/mips/beri/common/cfi.c b/stand/mips/beri/common/cfi.c similarity index 100% rename from sys/boot/mips/beri/common/cfi.c rename to stand/mips/beri/common/cfi.c diff --git a/sys/boot/mips/beri/common/cfi.h b/stand/mips/beri/common/cfi.h similarity index 100% rename from sys/boot/mips/beri/common/cfi.h rename to stand/mips/beri/common/cfi.h diff --git a/sys/boot/mips/beri/common/common.ldscript b/stand/mips/beri/common/common.ldscript similarity index 100% rename from sys/boot/mips/beri/common/common.ldscript rename to stand/mips/beri/common/common.ldscript diff --git a/sys/boot/mips/beri/common/cons.h b/stand/mips/beri/common/cons.h similarity index 100% rename from sys/boot/mips/beri/common/cons.h rename to stand/mips/beri/common/cons.h diff --git a/sys/boot/mips/beri/common/mips.h b/stand/mips/beri/common/mips.h similarity index 100% rename from sys/boot/mips/beri/common/mips.h rename to stand/mips/beri/common/mips.h diff --git a/sys/boot/mips/beri/common/sdcard.c b/stand/mips/beri/common/sdcard.c similarity index 100% rename from sys/boot/mips/beri/common/sdcard.c rename to stand/mips/beri/common/sdcard.c diff --git a/sys/boot/mips/beri/common/sdcard.h b/stand/mips/beri/common/sdcard.h similarity index 100% rename from sys/boot/mips/beri/common/sdcard.h rename to stand/mips/beri/common/sdcard.h diff --git a/sys/boot/mips/beri/loader/Makefile b/stand/mips/beri/loader/Makefile similarity index 93% rename from sys/boot/mips/beri/loader/Makefile rename to stand/mips/beri/loader/Makefile index 35a2ab33319c..763b3b34662e 100644 --- a/sys/boot/mips/beri/loader/Makefile +++ b/stand/mips/beri/loader/Makefile @@ -67,6 +67,8 @@ SRCS+= altera_jtag_uart.c \ # Since we don't have a backward compatibility issue, default to this on BERI. CFLAGS+= -DBOOT_PROMPT_123 +HELP_FILES+= help.mips + # Always add MI sources .include "${BOOTSRC}/loader.mk" @@ -77,8 +79,6 @@ CFLAGS+= -I${BOOTSRC}/mips/beri/common # Loader-specific MD headers CFLAGS+= -I${.CURDIR} -CLEANFILES+= loader.help - # Generate code appropriate for the loader environment CFLAGS+= -G0 \ -fno-pic \ @@ -95,15 +95,6 @@ LDFLAGS= -nostdlib \ DPADD= ${LIBFICL} ${LIBSA} LDADD= ${LIBFICL} ${LIBSA} -loader.help: help.common help.mips - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -FILES+= loader.rc menu.rc - .if defined(LOADER_USB_SUPPORT) # Do garbage collection CFLAGS+= -ffunction-sections -fdata-sections diff --git a/sys/boot/mips/beri/loader/arch.c b/stand/mips/beri/loader/arch.c similarity index 100% rename from sys/boot/mips/beri/loader/arch.c rename to stand/mips/beri/loader/arch.c diff --git a/sys/boot/mips/beri/loader/beri_console.c b/stand/mips/beri/loader/beri_console.c similarity index 100% rename from sys/boot/mips/beri/loader/beri_console.c rename to stand/mips/beri/loader/beri_console.c diff --git a/sys/boot/mips/beri/loader/beri_disk_cfi.c b/stand/mips/beri/loader/beri_disk_cfi.c similarity index 100% rename from sys/boot/mips/beri/loader/beri_disk_cfi.c rename to stand/mips/beri/loader/beri_disk_cfi.c diff --git a/sys/boot/mips/beri/loader/beri_disk_sdcard.c b/stand/mips/beri/loader/beri_disk_sdcard.c similarity index 100% rename from sys/boot/mips/beri/loader/beri_disk_sdcard.c rename to stand/mips/beri/loader/beri_disk_sdcard.c diff --git a/sys/boot/mips/beri/loader/devicename.c b/stand/mips/beri/loader/devicename.c similarity index 100% rename from sys/boot/mips/beri/loader/devicename.c rename to stand/mips/beri/loader/devicename.c diff --git a/sys/boot/mips/beri/loader/exec.c b/stand/mips/beri/loader/exec.c similarity index 100% rename from sys/boot/mips/beri/loader/exec.c rename to stand/mips/beri/loader/exec.c diff --git a/sys/boot/mips/beri/loader/help.mips b/stand/mips/beri/loader/help.mips similarity index 100% rename from sys/boot/mips/beri/loader/help.mips rename to stand/mips/beri/loader/help.mips diff --git a/sys/boot/mips/beri/loader/loader.h b/stand/mips/beri/loader/loader.h similarity index 100% rename from sys/boot/mips/beri/loader/loader.h rename to stand/mips/beri/loader/loader.h diff --git a/sys/boot/mips/beri/loader/loader.ldscript b/stand/mips/beri/loader/loader.ldscript similarity index 100% rename from sys/boot/mips/beri/loader/loader.ldscript rename to stand/mips/beri/loader/loader.ldscript diff --git a/sys/boot/mips/beri/loader/main.c b/stand/mips/beri/loader/main.c similarity index 100% rename from sys/boot/mips/beri/loader/main.c rename to stand/mips/beri/loader/main.c diff --git a/sys/boot/mips/beri/loader/metadata.c b/stand/mips/beri/loader/metadata.c similarity index 100% rename from sys/boot/mips/beri/loader/metadata.c rename to stand/mips/beri/loader/metadata.c diff --git a/sys/boot/mips/beri/loader/start.S b/stand/mips/beri/loader/start.S similarity index 100% rename from sys/boot/mips/beri/loader/start.S rename to stand/mips/beri/loader/start.S diff --git a/sys/boot/mips/beri/loader/version b/stand/mips/beri/loader/version similarity index 100% rename from sys/boot/mips/beri/loader/version rename to stand/mips/beri/loader/version diff --git a/sys/boot/mips/uboot/Makefile b/stand/mips/uboot/Makefile similarity index 74% rename from sys/boot/mips/uboot/Makefile rename to stand/mips/uboot/Makefile index 01df0b4e9183..b941ba342431 100644 --- a/sys/boot/mips/uboot/Makefile +++ b/stand/mips/uboot/Makefile @@ -9,11 +9,10 @@ LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no -LOADER_FDT_SUPPORT= ${MK_FDT} .include -FILES= ubldr +FILES+= ubldr NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b @@ -25,11 +24,10 @@ UBLDR_LOADADDR?= 0xffffffff80800000 # Architecture-specific loader code SRCS= start.S conf.c vers.c +HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt + # Always add MI sources .include "${BOOTSRC}/loader.mk" -CFLAGS+= -I. - -CLEANFILES+= loader.help CFLAGS+= -ffreestanding -msoft-float -g @@ -42,10 +40,6 @@ LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} -loader.help: help.common help.uboot ${BOOTSRC}/fdt/help.fdt - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - ldscript.abs: echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} @@ -59,16 +53,5 @@ ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD} CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin -.if !defined(LOADER_ONLY) -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -# Install loader.rc. -FILES+= loader.rc -# Put sample menu.rc on disk but don't enable it by default. -FILES+= menu.rc -FILESNAME_menu.rc= menu.rc.sample -.endif - .include .include diff --git a/sys/boot/mips/uboot/conf.c b/stand/mips/uboot/conf.c similarity index 100% rename from sys/boot/mips/uboot/conf.c rename to stand/mips/uboot/conf.c diff --git a/sys/boot/mips/uboot/help.uboot b/stand/mips/uboot/help.uboot similarity index 100% rename from sys/boot/mips/uboot/help.uboot rename to stand/mips/uboot/help.uboot diff --git a/sys/boot/mips/uboot/ldscript.mips b/stand/mips/uboot/ldscript.mips similarity index 100% rename from sys/boot/mips/uboot/ldscript.mips rename to stand/mips/uboot/ldscript.mips diff --git a/sys/boot/mips/uboot/loader.conf b/stand/mips/uboot/loader.conf similarity index 100% rename from sys/boot/mips/uboot/loader.conf rename to stand/mips/uboot/loader.conf diff --git a/sys/boot/mips/uboot/start.S b/stand/mips/uboot/start.S similarity index 100% rename from sys/boot/mips/uboot/start.S rename to stand/mips/uboot/start.S diff --git a/sys/boot/mips/uboot/version b/stand/mips/uboot/version similarity index 100% rename from sys/boot/mips/uboot/version rename to stand/mips/uboot/version diff --git a/sys/boot/ofw/Makefile b/stand/ofw/Makefile similarity index 100% rename from sys/boot/ofw/Makefile rename to stand/ofw/Makefile diff --git a/sys/boot/ofw/Makefile.inc b/stand/ofw/Makefile.inc similarity index 100% rename from sys/boot/ofw/Makefile.inc rename to stand/ofw/Makefile.inc diff --git a/sys/boot/ofw/common/Makefile.inc b/stand/ofw/common/Makefile.inc similarity index 100% rename from sys/boot/ofw/common/Makefile.inc rename to stand/ofw/common/Makefile.inc diff --git a/sys/boot/ofw/common/main.c b/stand/ofw/common/main.c similarity index 100% rename from sys/boot/ofw/common/main.c rename to stand/ofw/common/main.c diff --git a/sys/boot/ofw/libofw/Makefile b/stand/ofw/libofw/Makefile similarity index 93% rename from sys/boot/ofw/libofw/Makefile rename to stand/ofw/libofw/Makefile index 836e2a821d1a..8e9ac804c5fa 100644 --- a/sys/boot/ofw/libofw/Makefile +++ b/stand/ofw/libofw/Makefile @@ -12,7 +12,7 @@ SRCS= devicename.c elf_freebsd.c ofw_console.c ofw_copy.c ofw_disk.c \ SRCS+= devicename_stubs.c # Pick up the bootstrap header for some interface items -CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. +CFLAGS+= -I${LDRSRC} CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "powerpc" diff --git a/sys/boot/ofw/libofw/devicename.c b/stand/ofw/libofw/devicename.c similarity index 100% rename from sys/boot/ofw/libofw/devicename.c rename to stand/ofw/libofw/devicename.c diff --git a/sys/boot/ofw/libofw/elf_freebsd.c b/stand/ofw/libofw/elf_freebsd.c similarity index 100% rename from sys/boot/ofw/libofw/elf_freebsd.c rename to stand/ofw/libofw/elf_freebsd.c diff --git a/sys/boot/ofw/libofw/libofw.h b/stand/ofw/libofw/libofw.h similarity index 100% rename from sys/boot/ofw/libofw/libofw.h rename to stand/ofw/libofw/libofw.h diff --git a/sys/boot/ofw/libofw/ofw_console.c b/stand/ofw/libofw/ofw_console.c similarity index 100% rename from sys/boot/ofw/libofw/ofw_console.c rename to stand/ofw/libofw/ofw_console.c diff --git a/sys/boot/ofw/libofw/ofw_copy.c b/stand/ofw/libofw/ofw_copy.c similarity index 100% rename from sys/boot/ofw/libofw/ofw_copy.c rename to stand/ofw/libofw/ofw_copy.c diff --git a/sys/boot/ofw/libofw/ofw_disk.c b/stand/ofw/libofw/ofw_disk.c similarity index 100% rename from sys/boot/ofw/libofw/ofw_disk.c rename to stand/ofw/libofw/ofw_disk.c diff --git a/sys/boot/ofw/libofw/ofw_memory.c b/stand/ofw/libofw/ofw_memory.c similarity index 100% rename from sys/boot/ofw/libofw/ofw_memory.c rename to stand/ofw/libofw/ofw_memory.c diff --git a/sys/boot/ofw/libofw/ofw_module.c b/stand/ofw/libofw/ofw_module.c similarity index 100% rename from sys/boot/ofw/libofw/ofw_module.c rename to stand/ofw/libofw/ofw_module.c diff --git a/sys/boot/ofw/libofw/ofw_net.c b/stand/ofw/libofw/ofw_net.c similarity index 100% rename from sys/boot/ofw/libofw/ofw_net.c rename to stand/ofw/libofw/ofw_net.c diff --git a/sys/boot/ofw/libofw/ofw_reboot.c b/stand/ofw/libofw/ofw_reboot.c similarity index 100% rename from sys/boot/ofw/libofw/ofw_reboot.c rename to stand/ofw/libofw/ofw_reboot.c diff --git a/sys/boot/ofw/libofw/ofw_time.c b/stand/ofw/libofw/ofw_time.c similarity index 100% rename from sys/boot/ofw/libofw/ofw_time.c rename to stand/ofw/libofw/ofw_time.c diff --git a/sys/boot/ofw/libofw/openfirm.c b/stand/ofw/libofw/openfirm.c similarity index 100% rename from sys/boot/ofw/libofw/openfirm.c rename to stand/ofw/libofw/openfirm.c diff --git a/sys/boot/ofw/libofw/openfirm.h b/stand/ofw/libofw/openfirm.h similarity index 100% rename from sys/boot/ofw/libofw/openfirm.h rename to stand/ofw/libofw/openfirm.h diff --git a/sys/boot/ofw/libofw/ppc64_elf_freebsd.c b/stand/ofw/libofw/ppc64_elf_freebsd.c similarity index 100% rename from sys/boot/ofw/libofw/ppc64_elf_freebsd.c rename to stand/ofw/libofw/ppc64_elf_freebsd.c diff --git a/stand/powerpc/Makefile b/stand/powerpc/Makefile new file mode 100644 index 000000000000..969eee8dc63e --- /dev/null +++ b/stand/powerpc/Makefile @@ -0,0 +1,13 @@ +# $FreeBSD$ + +.include + +SUBDIR= boot1.chrp ofw uboot +.if ${MACHINE_ARCH} != "powerpcspe" +SUBDIR+= ps3 +.endif +.if ${MK_FDT} == "yes" +SUBDIR+= kboot +.endif + +.include diff --git a/sys/boot/powerpc/Makefile.inc b/stand/powerpc/Makefile.inc similarity index 100% rename from sys/boot/powerpc/Makefile.inc rename to stand/powerpc/Makefile.inc diff --git a/sys/boot/powerpc/boot1.chrp/Makefile b/stand/powerpc/boot1.chrp/Makefile similarity index 97% rename from sys/boot/powerpc/boot1.chrp/Makefile rename to stand/powerpc/boot1.chrp/Makefile index 8439d140b68a..384d0abc2788 100644 --- a/sys/boot/powerpc/boot1.chrp/Makefile +++ b/stand/powerpc/boot1.chrp/Makefile @@ -34,7 +34,7 @@ boot1.hfs: boot1.elf bootinfo.txt ${DD} if=${.CURDIR}/bootinfo.txt of=${.TARGET} seek=${BOOTINFO_OFFSET} \ conv=notrunc -CLEANFILES= boot1.hfs +CLEANFILES+= boot1.hfs boot1.o: ${SASRC}/ufsread.c diff --git a/sys/boot/powerpc/boot1.chrp/Makefile.hfs b/stand/powerpc/boot1.chrp/Makefile.hfs similarity index 100% rename from sys/boot/powerpc/boot1.chrp/Makefile.hfs rename to stand/powerpc/boot1.chrp/Makefile.hfs diff --git a/sys/boot/powerpc/boot1.chrp/boot1.c b/stand/powerpc/boot1.chrp/boot1.c similarity index 100% rename from sys/boot/powerpc/boot1.chrp/boot1.c rename to stand/powerpc/boot1.chrp/boot1.c diff --git a/sys/boot/powerpc/boot1.chrp/bootinfo.txt b/stand/powerpc/boot1.chrp/bootinfo.txt similarity index 100% rename from sys/boot/powerpc/boot1.chrp/bootinfo.txt rename to stand/powerpc/boot1.chrp/bootinfo.txt diff --git a/sys/boot/powerpc/boot1.chrp/generate-hfs.sh b/stand/powerpc/boot1.chrp/generate-hfs.sh similarity index 100% rename from sys/boot/powerpc/boot1.chrp/generate-hfs.sh rename to stand/powerpc/boot1.chrp/generate-hfs.sh diff --git a/sys/boot/powerpc/boot1.chrp/hfs.tmpl.bz2.uu b/stand/powerpc/boot1.chrp/hfs.tmpl.bz2.uu similarity index 100% rename from sys/boot/powerpc/boot1.chrp/hfs.tmpl.bz2.uu rename to stand/powerpc/boot1.chrp/hfs.tmpl.bz2.uu diff --git a/sys/boot/powerpc/kboot/Makefile b/stand/powerpc/kboot/Makefile similarity index 68% rename from sys/boot/powerpc/kboot/Makefile rename to stand/powerpc/kboot/Makefile index 925c1d0d0448..bed586e6732a 100644 --- a/sys/boot/powerpc/kboot/Makefile +++ b/stand/powerpc/kboot/Makefile @@ -8,7 +8,6 @@ LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= yes -LOADER_FDT_SUPPORT= yes LOADER_BZIP2_SUPPORT?= no .include @@ -24,22 +23,14 @@ SRCS= conf.c metadata.c vers.c main.c ppc64_elf_freebsd.c SRCS+= host_syscall.S hostcons.c hostdisk.c kerneltramp.S kbootfdt.c SRCS+= ucmpdi2.c -.if ${LOADER_FDT_SUPPORT} == "yes" -CFLAGS+= -I${FDTSRC} -CFLAGS+= -I${SYSDIR}/contrib/libfdt -CFLAGS+= -DLOADER_FDT_SUPPORT -LIBFDT= ${BOOTOBJ}/fdt/libfdt.a -.endif +.include "${BOOTSRC}/fdt.mk" CFLAGS+= -mcpu=powerpc64 # Always add MI sources +HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -I${SYSDIR} -CFLAGS+= -I. - -CLEANFILES+= loader.help CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM # load address. set in linker script @@ -54,13 +45,6 @@ CFLAGS+= -Wa,-mppc64bridge DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} -loader.help: help.common help.kboot ${FDTSRC}/help.fdt - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -FILES+= loader.rc menu.rc +HELP_FILES+= ${FDTSRC}/help.fdt .include diff --git a/sys/boot/powerpc/kboot/conf.c b/stand/powerpc/kboot/conf.c similarity index 100% rename from sys/boot/powerpc/kboot/conf.c rename to stand/powerpc/kboot/conf.c diff --git a/sys/boot/powerpc/kboot/host_syscall.S b/stand/powerpc/kboot/host_syscall.S similarity index 100% rename from sys/boot/powerpc/kboot/host_syscall.S rename to stand/powerpc/kboot/host_syscall.S diff --git a/sys/boot/powerpc/kboot/host_syscall.h b/stand/powerpc/kboot/host_syscall.h similarity index 100% rename from sys/boot/powerpc/kboot/host_syscall.h rename to stand/powerpc/kboot/host_syscall.h diff --git a/sys/boot/powerpc/kboot/hostcons.c b/stand/powerpc/kboot/hostcons.c similarity index 100% rename from sys/boot/powerpc/kboot/hostcons.c rename to stand/powerpc/kboot/hostcons.c diff --git a/sys/boot/powerpc/kboot/hostdisk.c b/stand/powerpc/kboot/hostdisk.c similarity index 100% rename from sys/boot/powerpc/kboot/hostdisk.c rename to stand/powerpc/kboot/hostdisk.c diff --git a/sys/boot/powerpc/kboot/kbootfdt.c b/stand/powerpc/kboot/kbootfdt.c similarity index 100% rename from sys/boot/powerpc/kboot/kbootfdt.c rename to stand/powerpc/kboot/kbootfdt.c diff --git a/sys/boot/powerpc/kboot/kerneltramp.S b/stand/powerpc/kboot/kerneltramp.S similarity index 100% rename from sys/boot/powerpc/kboot/kerneltramp.S rename to stand/powerpc/kboot/kerneltramp.S diff --git a/sys/boot/powerpc/kboot/ldscript.powerpc b/stand/powerpc/kboot/ldscript.powerpc similarity index 100% rename from sys/boot/powerpc/kboot/ldscript.powerpc rename to stand/powerpc/kboot/ldscript.powerpc diff --git a/sys/boot/powerpc/kboot/main.c b/stand/powerpc/kboot/main.c similarity index 100% rename from sys/boot/powerpc/kboot/main.c rename to stand/powerpc/kboot/main.c diff --git a/sys/boot/powerpc/kboot/metadata.c b/stand/powerpc/kboot/metadata.c similarity index 100% rename from sys/boot/powerpc/kboot/metadata.c rename to stand/powerpc/kboot/metadata.c diff --git a/sys/boot/powerpc/kboot/ppc64_elf_freebsd.c b/stand/powerpc/kboot/ppc64_elf_freebsd.c similarity index 100% rename from sys/boot/powerpc/kboot/ppc64_elf_freebsd.c rename to stand/powerpc/kboot/ppc64_elf_freebsd.c diff --git a/sys/boot/powerpc/kboot/version b/stand/powerpc/kboot/version similarity index 100% rename from sys/boot/powerpc/kboot/version rename to stand/powerpc/kboot/version diff --git a/sys/boot/powerpc/ofw/Makefile b/stand/powerpc/ofw/Makefile similarity index 70% rename from sys/boot/powerpc/ofw/Makefile rename to stand/powerpc/ofw/Makefile index f17fd0095c74..1853b2596fce 100644 --- a/sys/boot/powerpc/ofw/Makefile +++ b/stand/powerpc/ofw/Makefile @@ -9,7 +9,6 @@ LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= yes LOADER_BZIP2_SUPPORT?= no -LOADER_FDT_SUPPORT?= yes .include MK_SSP= no @@ -23,22 +22,17 @@ INSTALLFLAGS= -b SRCS= conf.c metadata.c vers.c start.c SRCS+= ucmpdi2.c -.if ${LOADER_FDT_SUPPORT} == "yes" +.include "${BOOTSRC}/fdt.mk" +.if ${MK_FDT} == "yes" SRCS+= ofwfdt.c -CFLAGS+= -I${FDTSRC} -CFLAGS+= -I${SYSDIR}/contrib/libfdt -CFLAGS+= -DLOADER_FDT_SUPPORT -LIBFDT= ${BOOTOBJ}/fdt/libfdt.a .endif +HELP_FILES+= ${FDTSRC}/help.fdt + # Always add MI sources .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -I${SYSDIR} -CFLAGS+= -I. - -CLEANFILES+= loader.help CFLAGS+= -ffreestanding -msoft-float # load address. set in linker script @@ -58,13 +52,4 @@ CFLAGS+= -I${BOOTSRC}/ofw/libofw DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} -loader.help: help.common help.ofw ${FDTSRC}/help.fdt - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -FILES+= loader.rc menu.rc - .include diff --git a/sys/boot/powerpc/ofw/conf.c b/stand/powerpc/ofw/conf.c similarity index 100% rename from sys/boot/powerpc/ofw/conf.c rename to stand/powerpc/ofw/conf.c diff --git a/sys/boot/powerpc/ofw/ldscript.powerpc b/stand/powerpc/ofw/ldscript.powerpc similarity index 100% rename from sys/boot/powerpc/ofw/ldscript.powerpc rename to stand/powerpc/ofw/ldscript.powerpc diff --git a/sys/boot/powerpc/ofw/metadata.c b/stand/powerpc/ofw/metadata.c similarity index 100% rename from sys/boot/powerpc/ofw/metadata.c rename to stand/powerpc/ofw/metadata.c diff --git a/sys/boot/powerpc/ofw/ofwfdt.c b/stand/powerpc/ofw/ofwfdt.c similarity index 100% rename from sys/boot/powerpc/ofw/ofwfdt.c rename to stand/powerpc/ofw/ofwfdt.c diff --git a/sys/boot/powerpc/ofw/start.c b/stand/powerpc/ofw/start.c similarity index 100% rename from sys/boot/powerpc/ofw/start.c rename to stand/powerpc/ofw/start.c diff --git a/sys/boot/powerpc/ofw/version b/stand/powerpc/ofw/version similarity index 100% rename from sys/boot/powerpc/ofw/version rename to stand/powerpc/ofw/version diff --git a/sys/boot/powerpc/ps3/Makefile b/stand/powerpc/ps3/Makefile similarity index 77% rename from sys/boot/powerpc/ps3/Makefile rename to stand/powerpc/ps3/Makefile index 206ce247e97a..07ad135d9796 100644 --- a/sys/boot/powerpc/ps3/Makefile +++ b/stand/powerpc/ps3/Makefile @@ -7,7 +7,6 @@ LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= yes -LOADER_FDT_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no .include @@ -24,21 +23,12 @@ SRCS+= lv1call.S ps3cons.c font.h ps3mmu.c ps3net.c ps3repo.c \ ps3stor.c ps3disk.c ps3cdrom.c SRCS+= ucmpdi2.c -.if ${LOADER_FDT_SUPPORT} == "yes" -CFLAGS+= -I${FDTSRC} -CFLAGS+= -DLOADER_FDT_SUPPORT -LIBFDT= ${BOOTOBJ}/fdt/libfdt.a -.endif - CFLAGS+= -mcpu=powerpc64 # Always add MI sources +HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -I${SYSDIR} -CFLAGS+= -I. - -CLEANFILES+= loader.help CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM # load address. set in linker script @@ -55,13 +45,4 @@ SC_DFLT_FONT=cp437 font.h: uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h -loader.help: help.common help.ps3 ${FDTSRC}/help.fdt - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -FILES+= loader.rc menu.rc - .include diff --git a/sys/boot/powerpc/ps3/conf.c b/stand/powerpc/ps3/conf.c similarity index 100% rename from sys/boot/powerpc/ps3/conf.c rename to stand/powerpc/ps3/conf.c diff --git a/sys/boot/powerpc/ps3/devicename.c b/stand/powerpc/ps3/devicename.c similarity index 100% rename from sys/boot/powerpc/ps3/devicename.c rename to stand/powerpc/ps3/devicename.c diff --git a/sys/boot/powerpc/ps3/ldscript.powerpc b/stand/powerpc/ps3/ldscript.powerpc similarity index 100% rename from sys/boot/powerpc/ps3/ldscript.powerpc rename to stand/powerpc/ps3/ldscript.powerpc diff --git a/sys/boot/powerpc/ps3/lv1call.S b/stand/powerpc/ps3/lv1call.S similarity index 100% rename from sys/boot/powerpc/ps3/lv1call.S rename to stand/powerpc/ps3/lv1call.S diff --git a/sys/boot/powerpc/ps3/lv1call.h b/stand/powerpc/ps3/lv1call.h similarity index 100% rename from sys/boot/powerpc/ps3/lv1call.h rename to stand/powerpc/ps3/lv1call.h diff --git a/sys/boot/powerpc/ps3/main.c b/stand/powerpc/ps3/main.c similarity index 100% rename from sys/boot/powerpc/ps3/main.c rename to stand/powerpc/ps3/main.c diff --git a/sys/boot/powerpc/ps3/metadata.c b/stand/powerpc/ps3/metadata.c similarity index 100% rename from sys/boot/powerpc/ps3/metadata.c rename to stand/powerpc/ps3/metadata.c diff --git a/sys/boot/powerpc/ps3/ppc64_elf_freebsd.c b/stand/powerpc/ps3/ppc64_elf_freebsd.c similarity index 100% rename from sys/boot/powerpc/ps3/ppc64_elf_freebsd.c rename to stand/powerpc/ps3/ppc64_elf_freebsd.c diff --git a/sys/boot/powerpc/ps3/ps3.h b/stand/powerpc/ps3/ps3.h similarity index 100% rename from sys/boot/powerpc/ps3/ps3.h rename to stand/powerpc/ps3/ps3.h diff --git a/sys/boot/powerpc/ps3/ps3bus.h b/stand/powerpc/ps3/ps3bus.h similarity index 100% rename from sys/boot/powerpc/ps3/ps3bus.h rename to stand/powerpc/ps3/ps3bus.h diff --git a/sys/boot/powerpc/ps3/ps3cdrom.c b/stand/powerpc/ps3/ps3cdrom.c similarity index 100% rename from sys/boot/powerpc/ps3/ps3cdrom.c rename to stand/powerpc/ps3/ps3cdrom.c diff --git a/sys/boot/powerpc/ps3/ps3cons.c b/stand/powerpc/ps3/ps3cons.c similarity index 100% rename from sys/boot/powerpc/ps3/ps3cons.c rename to stand/powerpc/ps3/ps3cons.c diff --git a/sys/boot/powerpc/ps3/ps3devdesc.h b/stand/powerpc/ps3/ps3devdesc.h similarity index 100% rename from sys/boot/powerpc/ps3/ps3devdesc.h rename to stand/powerpc/ps3/ps3devdesc.h diff --git a/sys/boot/powerpc/ps3/ps3disk.c b/stand/powerpc/ps3/ps3disk.c similarity index 100% rename from sys/boot/powerpc/ps3/ps3disk.c rename to stand/powerpc/ps3/ps3disk.c diff --git a/sys/boot/powerpc/ps3/ps3mmu.c b/stand/powerpc/ps3/ps3mmu.c similarity index 100% rename from sys/boot/powerpc/ps3/ps3mmu.c rename to stand/powerpc/ps3/ps3mmu.c diff --git a/sys/boot/powerpc/ps3/ps3net.c b/stand/powerpc/ps3/ps3net.c similarity index 100% rename from sys/boot/powerpc/ps3/ps3net.c rename to stand/powerpc/ps3/ps3net.c diff --git a/sys/boot/powerpc/ps3/ps3repo.c b/stand/powerpc/ps3/ps3repo.c similarity index 100% rename from sys/boot/powerpc/ps3/ps3repo.c rename to stand/powerpc/ps3/ps3repo.c diff --git a/sys/boot/powerpc/ps3/ps3repo.h b/stand/powerpc/ps3/ps3repo.h similarity index 100% rename from sys/boot/powerpc/ps3/ps3repo.h rename to stand/powerpc/ps3/ps3repo.h diff --git a/sys/boot/powerpc/ps3/ps3stor.c b/stand/powerpc/ps3/ps3stor.c similarity index 100% rename from sys/boot/powerpc/ps3/ps3stor.c rename to stand/powerpc/ps3/ps3stor.c diff --git a/sys/boot/powerpc/ps3/ps3stor.h b/stand/powerpc/ps3/ps3stor.h similarity index 100% rename from sys/boot/powerpc/ps3/ps3stor.h rename to stand/powerpc/ps3/ps3stor.h diff --git a/sys/boot/powerpc/ps3/start.S b/stand/powerpc/ps3/start.S similarity index 100% rename from sys/boot/powerpc/ps3/start.S rename to stand/powerpc/ps3/start.S diff --git a/sys/boot/powerpc/ps3/version b/stand/powerpc/ps3/version similarity index 100% rename from sys/boot/powerpc/ps3/version rename to stand/powerpc/ps3/version diff --git a/sys/boot/powerpc/uboot/Makefile b/stand/powerpc/uboot/Makefile similarity index 74% rename from sys/boot/powerpc/uboot/Makefile rename to stand/powerpc/uboot/Makefile index d195c8c25513..d543aceeee4c 100644 --- a/sys/boot/powerpc/uboot/Makefile +++ b/stand/powerpc/uboot/Makefile @@ -8,7 +8,6 @@ LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no -LOADER_FDT_SUPPORT= ${MK_FDT} .include @@ -22,12 +21,9 @@ SRCS= start.S conf.c vers.c SRCS+= ucmpdi2.c # Always add MI sources +HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -I${SYSDIR} -CFLAGS+= -I. - -CLEANFILES+= ${PROG}.help CFLAGS+= -ffreestanding @@ -38,11 +34,4 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} -loader.help: help.common help.uboot ${BOOTSRC}/fdt/help.fdt - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.PATH: ${BOOTSRC}/forth -FILES= loader.help - .include diff --git a/sys/boot/powerpc/uboot/conf.c b/stand/powerpc/uboot/conf.c similarity index 100% rename from sys/boot/powerpc/uboot/conf.c rename to stand/powerpc/uboot/conf.c diff --git a/sys/boot/powerpc/uboot/ldscript.powerpc b/stand/powerpc/uboot/ldscript.powerpc similarity index 100% rename from sys/boot/powerpc/uboot/ldscript.powerpc rename to stand/powerpc/uboot/ldscript.powerpc diff --git a/sys/boot/powerpc/uboot/start.S b/stand/powerpc/uboot/start.S similarity index 100% rename from sys/boot/powerpc/uboot/start.S rename to stand/powerpc/uboot/start.S diff --git a/sys/boot/powerpc/uboot/version b/stand/powerpc/uboot/version similarity index 100% rename from sys/boot/powerpc/uboot/version rename to stand/powerpc/uboot/version diff --git a/stand/sparc64/Makefile b/stand/sparc64/Makefile new file mode 100644 index 000000000000..6a81a0580d5f --- /dev/null +++ b/stand/sparc64/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include + +SUBDIR= boot1 loader +.if ${MK_ZFS} != "no" +SUBDIR+=zfsboot zfsloader +.endif + +.include diff --git a/sys/boot/sparc64/Makefile.inc b/stand/sparc64/Makefile.inc similarity index 100% rename from sys/boot/sparc64/Makefile.inc rename to stand/sparc64/Makefile.inc diff --git a/sys/boot/sparc64/boot1/Makefile b/stand/sparc64/boot1/Makefile similarity index 95% rename from sys/boot/sparc64/boot1/Makefile rename to stand/sparc64/boot1/Makefile index 7d501a0f75ba..36e396896102 100644 --- a/sys/boot/sparc64/boot1/Makefile +++ b/stand/sparc64/boot1/Makefile @@ -7,7 +7,7 @@ INTERNALPROG= MAN= FILES?= boot1 SRCS= _start.s boot1.c -CLEANFILES=${FILES} boot1.aout +CLEANFILES+=${FILES} boot1.aout BOOTBLOCKBASE= 0x4000 diff --git a/sys/boot/sparc64/boot1/_start.s b/stand/sparc64/boot1/_start.s similarity index 100% rename from sys/boot/sparc64/boot1/_start.s rename to stand/sparc64/boot1/_start.s diff --git a/sys/boot/sparc64/boot1/boot1.c b/stand/sparc64/boot1/boot1.c similarity index 100% rename from sys/boot/sparc64/boot1/boot1.c rename to stand/sparc64/boot1/boot1.c diff --git a/sys/boot/sparc64/loader/Makefile b/stand/sparc64/loader/Makefile similarity index 65% rename from sys/boot/sparc64/loader/Makefile rename to stand/sparc64/loader/Makefile index 3f3185cd4ea2..5388761cf525 100644 --- a/sys/boot/sparc64/loader/Makefile +++ b/stand/sparc64/loader/Makefile @@ -5,7 +5,6 @@ LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes LOADER_EXT2FS_SUPPORT?= no LOADER_MSDOS_SUPPORT?= no -LOADER_ZFS_SUPPORT?= no LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes @@ -23,23 +22,21 @@ VERSION_FILE= ${.CURDIR}/../loader/version INSTALLFLAGS= -b # Architecture-specific loader code +.PATH: ${BOOTSRC}/sparc64/loader SRCS= locore.S main.c metadata.c vers.c .if ${LOADER_DEBUG} == "yes" CFLAGS+= -DLOADER_DEBUG .endif -.if ${LOADER_ZFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_ZFS_SUPPORT -CFLAGS+= -I${ZFSSRC} -CFLAGS+= -I${SYSDIR}/cddl/boot/zfs -LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a + +.if exists(${.CURDIR}/help.sparc64) +HELP_FILES+= help.sparc64 +.else +HELP_FILES= .endif # Always add MI sources .include "${BOOTSRC}/loader.mk" -CFLAGS+= -I. - -CLEANFILES+= loader.help LDFLAGS+= -static @@ -47,19 +44,7 @@ LDFLAGS+= -static LIBOFW= ${BOOTOBJ}/ofw/libofw/libofw.a CFLAGS+= -I${BOOTSRC}/ofw/libofw/ -# Need sys/ for crypto/intake.h -CFLAGS+= -I${SRCTOP}/sys - DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA} LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA} -loader.help: help.common help.sparc64 - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -FILES+= loader.rc menu.rc - .include diff --git a/sys/boot/sparc64/loader/help.sparc64 b/stand/sparc64/loader/help.sparc64 similarity index 100% rename from sys/boot/sparc64/loader/help.sparc64 rename to stand/sparc64/loader/help.sparc64 diff --git a/sys/boot/sparc64/loader/locore.S b/stand/sparc64/loader/locore.S similarity index 100% rename from sys/boot/sparc64/loader/locore.S rename to stand/sparc64/loader/locore.S diff --git a/sys/boot/sparc64/loader/main.c b/stand/sparc64/loader/main.c similarity index 100% rename from sys/boot/sparc64/loader/main.c rename to stand/sparc64/loader/main.c diff --git a/sys/boot/sparc64/loader/metadata.c b/stand/sparc64/loader/metadata.c similarity index 100% rename from sys/boot/sparc64/loader/metadata.c rename to stand/sparc64/loader/metadata.c diff --git a/sys/boot/sparc64/loader/version b/stand/sparc64/loader/version similarity index 100% rename from sys/boot/sparc64/loader/version rename to stand/sparc64/loader/version diff --git a/sys/boot/sparc64/zfsboot/Makefile b/stand/sparc64/zfsboot/Makefile similarity index 100% rename from sys/boot/sparc64/zfsboot/Makefile rename to stand/sparc64/zfsboot/Makefile diff --git a/sys/boot/sparc64/zfsloader/Makefile b/stand/sparc64/zfsloader/Makefile similarity index 70% rename from sys/boot/sparc64/zfsloader/Makefile rename to stand/sparc64/zfsloader/Makefile index 1ed280829245..b4c554b5cb15 100644 --- a/sys/boot/sparc64/zfsloader/Makefile +++ b/stand/sparc64/zfsloader/Makefile @@ -1,9 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../loader - PROG= zfsloader NEWVERSWHAT= "ZFS enabled bootstrap loader" sparc64 -LOADER_ZFS_SUPPORT=yes +HAVE_ZFS= yes .include "${.CURDIR}/../loader/Makefile" diff --git a/sys/boot/uboot.mk b/stand/uboot.mk similarity index 66% rename from sys/boot/uboot.mk rename to stand/uboot.mk index d8871bb47456..d120481a4b96 100644 --- a/sys/boot/uboot.mk +++ b/stand/uboot.mk @@ -11,10 +11,8 @@ LIBUBOOT= ${BOOTOBJ}/uboot/lib/libuboot.a CFLAGS+= -I${UBOOTSRC}/lib CFLAGS+= -I${BOOTOBJ}/uboot/lib -.if ${LOADER_FDT_SUPPORT} == "yes" -CFLAGS+= -I${FDTSRC} -CFLAGS+= -I${BOOTOBJ}/fdt -CFLAGS+= -DLOADER_FDT_SUPPORT +.include "${BOOTSRC}/fdt.mk" + +.if ${MK_FDT} == "yes" LIBUBOOT_FDT= ${BOOTOBJ}/uboot/fdt/libuboot_fdt.a -LIBFDT= ${BOOTOBJ}/fdt/libfdt.a .endif diff --git a/sys/boot/uboot/Makefile b/stand/uboot/Makefile similarity index 100% rename from sys/boot/uboot/Makefile rename to stand/uboot/Makefile diff --git a/sys/boot/uboot/Makefile.inc b/stand/uboot/Makefile.inc similarity index 100% rename from sys/boot/uboot/Makefile.inc rename to stand/uboot/Makefile.inc diff --git a/sys/boot/uboot/common/main.c b/stand/uboot/common/main.c similarity index 100% rename from sys/boot/uboot/common/main.c rename to stand/uboot/common/main.c diff --git a/sys/boot/uboot/common/metadata.c b/stand/uboot/common/metadata.c similarity index 100% rename from sys/boot/uboot/common/metadata.c rename to stand/uboot/common/metadata.c diff --git a/sys/boot/uboot/fdt/Makefile b/stand/uboot/fdt/Makefile similarity index 90% rename from sys/boot/uboot/fdt/Makefile rename to stand/uboot/fdt/Makefile index 87bebca5c0d8..4bc38ec7c6f0 100644 --- a/sys/boot/uboot/fdt/Makefile +++ b/stand/uboot/fdt/Makefile @@ -19,7 +19,7 @@ CFLAGS+= -I${UBOOTSRC}/lib CFLAGS+= -I${FDTSRC} # Pick up the bootstrap header for some interface items -CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. +CFLAGS+= -I${LDRSRC} .include .include diff --git a/sys/boot/uboot/fdt/uboot_fdt.c b/stand/uboot/fdt/uboot_fdt.c similarity index 100% rename from sys/boot/uboot/fdt/uboot_fdt.c rename to stand/uboot/fdt/uboot_fdt.c diff --git a/sys/boot/uboot/lib/Makefile b/stand/uboot/lib/Makefile similarity index 64% rename from sys/boot/uboot/lib/Makefile rename to stand/uboot/lib/Makefile index 6b25a415e6cd..d12d48cafaa1 100644 --- a/sys/boot/uboot/lib/Makefile +++ b/stand/uboot/lib/Makefile @@ -17,21 +17,10 @@ CFLAGS+= -ffreestanding -msoft-float SRCS+= disk.c .endif -.if ${MK_FDT} != "no" -LOADER_FDT_SUPPORT= yes -.else -LOADER_FDT_SUPPORT= no -.endif - -.if ${LOADER_FDT_SUPPORT} == "yes" -CFLAGS+= -DLOADER_FDT_SUPPORT -I${FDTSRC} -.endif - -# Pick up FDT includes -CFLAGS+= -I${SYSDIR}/contrib/libfdt/ +.include "${BOOTSRC}/fdt.mk" # Pick up the bootstrap header for some interface items -CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. +CFLAGS+= -I${LDRSRC} .ifdef(BOOT_DISK_DEBUG) # Make the disk code more talkative diff --git a/sys/boot/uboot/lib/api_public.h b/stand/uboot/lib/api_public.h similarity index 100% rename from sys/boot/uboot/lib/api_public.h rename to stand/uboot/lib/api_public.h diff --git a/sys/boot/uboot/lib/console.c b/stand/uboot/lib/console.c similarity index 100% rename from sys/boot/uboot/lib/console.c rename to stand/uboot/lib/console.c diff --git a/sys/boot/uboot/lib/copy.c b/stand/uboot/lib/copy.c similarity index 100% rename from sys/boot/uboot/lib/copy.c rename to stand/uboot/lib/copy.c diff --git a/sys/boot/uboot/lib/devicename.c b/stand/uboot/lib/devicename.c similarity index 100% rename from sys/boot/uboot/lib/devicename.c rename to stand/uboot/lib/devicename.c diff --git a/sys/boot/uboot/lib/disk.c b/stand/uboot/lib/disk.c similarity index 100% rename from sys/boot/uboot/lib/disk.c rename to stand/uboot/lib/disk.c diff --git a/sys/boot/uboot/lib/elf_freebsd.c b/stand/uboot/lib/elf_freebsd.c similarity index 100% rename from sys/boot/uboot/lib/elf_freebsd.c rename to stand/uboot/lib/elf_freebsd.c diff --git a/sys/boot/uboot/lib/glue.c b/stand/uboot/lib/glue.c similarity index 100% rename from sys/boot/uboot/lib/glue.c rename to stand/uboot/lib/glue.c diff --git a/sys/boot/uboot/lib/glue.h b/stand/uboot/lib/glue.h similarity index 100% rename from sys/boot/uboot/lib/glue.h rename to stand/uboot/lib/glue.h diff --git a/sys/boot/uboot/lib/libuboot.h b/stand/uboot/lib/libuboot.h similarity index 100% rename from sys/boot/uboot/lib/libuboot.h rename to stand/uboot/lib/libuboot.h diff --git a/sys/boot/uboot/lib/module.c b/stand/uboot/lib/module.c similarity index 100% rename from sys/boot/uboot/lib/module.c rename to stand/uboot/lib/module.c diff --git a/sys/boot/uboot/lib/net.c b/stand/uboot/lib/net.c similarity index 100% rename from sys/boot/uboot/lib/net.c rename to stand/uboot/lib/net.c diff --git a/sys/boot/uboot/lib/reboot.c b/stand/uboot/lib/reboot.c similarity index 100% rename from sys/boot/uboot/lib/reboot.c rename to stand/uboot/lib/reboot.c diff --git a/sys/boot/uboot/lib/time.c b/stand/uboot/lib/time.c similarity index 100% rename from sys/boot/uboot/lib/time.c rename to stand/uboot/lib/time.c diff --git a/sys/boot/usb/Makefile b/stand/usb/Makefile similarity index 100% rename from sys/boot/usb/Makefile rename to stand/usb/Makefile diff --git a/sys/boot/usb/Makefile.test b/stand/usb/Makefile.test similarity index 100% rename from sys/boot/usb/Makefile.test rename to stand/usb/Makefile.test diff --git a/sys/boot/usb/bsd_usbloader_test.c b/stand/usb/bsd_usbloader_test.c similarity index 100% rename from sys/boot/usb/bsd_usbloader_test.c rename to stand/usb/bsd_usbloader_test.c diff --git a/sys/boot/usb/storage/umass_common.c b/stand/usb/storage/umass_common.c similarity index 100% rename from sys/boot/usb/storage/umass_common.c rename to stand/usb/storage/umass_common.c diff --git a/sys/boot/usb/storage/umass_common.h b/stand/usb/storage/umass_common.h similarity index 100% rename from sys/boot/usb/storage/umass_common.h rename to stand/usb/storage/umass_common.h diff --git a/sys/boot/usb/storage/umass_loader.c b/stand/usb/storage/umass_loader.c similarity index 100% rename from sys/boot/usb/storage/umass_loader.c rename to stand/usb/storage/umass_loader.c diff --git a/sys/boot/usb/tools/Makefile b/stand/usb/tools/Makefile similarity index 100% rename from sys/boot/usb/tools/Makefile rename to stand/usb/tools/Makefile diff --git a/sys/boot/usb/tools/sysinit.c b/stand/usb/tools/sysinit.c similarity index 100% rename from sys/boot/usb/tools/sysinit.c rename to stand/usb/tools/sysinit.c diff --git a/sys/boot/usb/usb_busdma_loader.c b/stand/usb/usb_busdma_loader.c similarity index 100% rename from sys/boot/usb/usb_busdma_loader.c rename to stand/usb/usb_busdma_loader.c diff --git a/sys/boot/usb/usbcore.mk b/stand/usb/usbcore.mk similarity index 100% rename from sys/boot/usb/usbcore.mk rename to stand/usb/usbcore.mk diff --git a/sys/boot/userboot/Makefile b/stand/userboot/Makefile similarity index 100% rename from sys/boot/userboot/Makefile rename to stand/userboot/Makefile diff --git a/sys/boot/userboot/Makefile.inc b/stand/userboot/Makefile.inc similarity index 100% rename from sys/boot/userboot/Makefile.inc rename to stand/userboot/Makefile.inc diff --git a/sys/boot/userboot/test/Makefile b/stand/userboot/test/Makefile similarity index 86% rename from sys/boot/userboot/test/Makefile rename to stand/userboot/test/Makefile index cfca6971d12c..1bc66798aac8 100644 --- a/sys/boot/userboot/test/Makefile +++ b/stand/userboot/test/Makefile @@ -10,6 +10,5 @@ PROG= test INTERNALPROG= CFLAGS+= -I${BOOTSRC}/userboot -CFLAGS+= -I${SYSDIR} .include diff --git a/sys/boot/userboot/test/Makefile.depend b/stand/userboot/test/Makefile.depend similarity index 100% rename from sys/boot/userboot/test/Makefile.depend rename to stand/userboot/test/Makefile.depend diff --git a/sys/boot/userboot/test/test.c b/stand/userboot/test/test.c similarity index 99% rename from sys/boot/userboot/test/test.c rename to stand/userboot/test/test.c index bf64e9010cc2..bacde565ec3b 100644 --- a/sys/boot/userboot/test/test.c +++ b/stand/userboot/test/test.c @@ -44,7 +44,7 @@ #include #include -#include +#include char *host_base = NULL; struct termios term, oldterm; diff --git a/sys/boot/userboot/userboot.h b/stand/userboot/userboot.h similarity index 100% rename from sys/boot/userboot/userboot.h rename to stand/userboot/userboot.h diff --git a/sys/boot/userboot/userboot/Makefile b/stand/userboot/userboot/Makefile similarity index 95% rename from sys/boot/userboot/userboot/Makefile rename to stand/userboot/userboot/Makefile index ae0c35db9453..cbada8227ba0 100644 --- a/sys/boot/userboot/userboot/Makefile +++ b/stand/userboot/userboot/Makefile @@ -36,8 +36,7 @@ SRCS+= vers.c CFLAGS+= -Wall CFLAGS+= -I${BOOTSRC}/userboot -CFLAGS+= -I${SYSDIR} -CFLAGS+= -ffreestanding -I. +CFLAGS+= -ffreestanding CWARNFLAGS.main.c += -Wno-implicit-function-declaration @@ -51,6 +50,7 @@ LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a .endif # Always add MI sources +HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" CFLAGS+= -I. DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSA} diff --git a/sys/boot/userboot/userboot/Makefile.depend b/stand/userboot/userboot/Makefile.depend similarity index 80% rename from sys/boot/userboot/userboot/Makefile.depend rename to stand/userboot/userboot/Makefile.depend index 0d4affa29aee..87e0acc0f3b5 100644 --- a/sys/boot/userboot/userboot/Makefile.depend +++ b/stand/userboot/userboot/Makefile.depend @@ -4,9 +4,9 @@ DIRDEPS = \ include \ include/xlocale \ - sys/boot/ficl \ - sys/boot/libsa \ - sys/boot/zfs \ + stand/ficl \ + stand/libsa \ + stand/zfs \ .include diff --git a/sys/boot/userboot/userboot/autoload.c b/stand/userboot/userboot/autoload.c similarity index 100% rename from sys/boot/userboot/userboot/autoload.c rename to stand/userboot/userboot/autoload.c diff --git a/sys/boot/userboot/userboot/biossmap.c b/stand/userboot/userboot/biossmap.c similarity index 100% rename from sys/boot/userboot/userboot/biossmap.c rename to stand/userboot/userboot/biossmap.c diff --git a/sys/boot/userboot/userboot/bootinfo.c b/stand/userboot/userboot/bootinfo.c similarity index 100% rename from sys/boot/userboot/userboot/bootinfo.c rename to stand/userboot/userboot/bootinfo.c diff --git a/sys/boot/userboot/userboot/bootinfo32.c b/stand/userboot/userboot/bootinfo32.c similarity index 100% rename from sys/boot/userboot/userboot/bootinfo32.c rename to stand/userboot/userboot/bootinfo32.c diff --git a/sys/boot/userboot/userboot/bootinfo64.c b/stand/userboot/userboot/bootinfo64.c similarity index 100% rename from sys/boot/userboot/userboot/bootinfo64.c rename to stand/userboot/userboot/bootinfo64.c diff --git a/sys/boot/userboot/userboot/conf.c b/stand/userboot/userboot/conf.c similarity index 100% rename from sys/boot/userboot/userboot/conf.c rename to stand/userboot/userboot/conf.c diff --git a/sys/boot/userboot/userboot/copy.c b/stand/userboot/userboot/copy.c similarity index 100% rename from sys/boot/userboot/userboot/copy.c rename to stand/userboot/userboot/copy.c diff --git a/sys/boot/userboot/userboot/devicename.c b/stand/userboot/userboot/devicename.c similarity index 100% rename from sys/boot/userboot/userboot/devicename.c rename to stand/userboot/userboot/devicename.c diff --git a/sys/boot/userboot/userboot/elf32_freebsd.c b/stand/userboot/userboot/elf32_freebsd.c similarity index 100% rename from sys/boot/userboot/userboot/elf32_freebsd.c rename to stand/userboot/userboot/elf32_freebsd.c diff --git a/sys/boot/userboot/userboot/elf64_freebsd.c b/stand/userboot/userboot/elf64_freebsd.c similarity index 100% rename from sys/boot/userboot/userboot/elf64_freebsd.c rename to stand/userboot/userboot/elf64_freebsd.c diff --git a/sys/boot/userboot/userboot/host.c b/stand/userboot/userboot/host.c similarity index 100% rename from sys/boot/userboot/userboot/host.c rename to stand/userboot/userboot/host.c diff --git a/sys/boot/userboot/userboot/libuserboot.h b/stand/userboot/userboot/libuserboot.h similarity index 100% rename from sys/boot/userboot/userboot/libuserboot.h rename to stand/userboot/userboot/libuserboot.h diff --git a/sys/boot/userboot/userboot/main.c b/stand/userboot/userboot/main.c similarity index 100% rename from sys/boot/userboot/userboot/main.c rename to stand/userboot/userboot/main.c diff --git a/sys/boot/userboot/userboot/userboot_cons.c b/stand/userboot/userboot/userboot_cons.c similarity index 100% rename from sys/boot/userboot/userboot/userboot_cons.c rename to stand/userboot/userboot/userboot_cons.c diff --git a/sys/boot/userboot/userboot/userboot_disk.c b/stand/userboot/userboot/userboot_disk.c similarity index 100% rename from sys/boot/userboot/userboot/userboot_disk.c rename to stand/userboot/userboot/userboot_disk.c diff --git a/sys/boot/userboot/userboot/version b/stand/userboot/userboot/version similarity index 100% rename from sys/boot/userboot/userboot/version rename to stand/userboot/userboot/version diff --git a/sys/boot/zfs/Makefile b/stand/zfs/Makefile similarity index 91% rename from sys/boot/zfs/Makefile rename to stand/zfs/Makefile index 7575aa9207eb..e86c84b02fc0 100644 --- a/sys/boot/zfs/Makefile +++ b/stand/zfs/Makefile @@ -12,7 +12,7 @@ CFLAGS+= -DSKEIN_LOOP=111 .PATH: ${SYSDIR}/crypto/skein CFLAGS+= -DBOOTPROG=\"zfsloader\" -CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. +CFLAGS+= -I${LDRSRC} CFLAGS+= -I${SYSDIR}/cddl/boot/zfs CFLAGS+= -I${SYSDIR}/crypto/skein diff --git a/sys/boot/zfs/Makefile.depend b/stand/zfs/Makefile.depend similarity index 100% rename from sys/boot/zfs/Makefile.depend rename to stand/zfs/Makefile.depend diff --git a/sys/boot/zfs/devicename_stubs.c b/stand/zfs/devicename_stubs.c similarity index 100% rename from sys/boot/zfs/devicename_stubs.c rename to stand/zfs/devicename_stubs.c diff --git a/sys/boot/zfs/libzfs.h b/stand/zfs/libzfs.h similarity index 100% rename from sys/boot/zfs/libzfs.h rename to stand/zfs/libzfs.h diff --git a/sys/boot/zfs/zfs.c b/stand/zfs/zfs.c similarity index 100% rename from sys/boot/zfs/zfs.c rename to stand/zfs/zfs.c diff --git a/sys/boot/zfs/zfsimpl.c b/stand/zfs/zfsimpl.c similarity index 100% rename from sys/boot/zfs/zfsimpl.c rename to stand/zfs/zfsimpl.c diff --git a/sys/boot/zfs32/Makefile b/stand/zfs32/Makefile similarity index 100% rename from sys/boot/zfs32/Makefile rename to stand/zfs32/Makefile diff --git a/sys/boot/zfs32/Makefile.depend b/stand/zfs32/Makefile.depend similarity index 100% rename from sys/boot/zfs32/Makefile.depend rename to stand/zfs32/Makefile.depend diff --git a/sys/Makefile b/sys/Makefile index 0de854341ff5..760c2073e5ee 100644 --- a/sys/Makefile +++ b/sys/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ # Directories to include in cscope name file and TAGS. -CSCOPEDIRS= boot bsm cam cddl compat conf contrib crypto ddb dev fs gdb \ +CSCOPEDIRS= bsm cam cddl compat conf contrib crypto ddb dev fs gdb \ geom gnu isa kern libkern modules net net80211 \ netgraph netinet netinet6 netipsec netpfil \ netsmb nfs nfsclient nfsserver nlm ofed opencrypto \ @@ -62,11 +62,6 @@ TAGS ${.CURDIR}/TAGS: ${.CURDIR}/cscope.files .if !(make(cscope) || make(cscope-clean) || make(cscope-hook) || make(TAGS)) .include -# The boot loader -.if ${MK_BOOT} != "no" -SUBDIR= boot -.endif - # Loadable kernel modules .if defined(MODULES_WITH_WORLD) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index ea38a5f6b9fb..4ce0285b1fa6 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1853,9 +1853,9 @@ spinlock_enter(void) flags = intr_disable(); td->td_md.md_spinlock_count = 1; td->td_md.md_saved_flags = flags; + critical_enter(); } else td->td_md.md_spinlock_count++; - critical_enter(); } void @@ -1865,11 +1865,12 @@ spinlock_exit(void) register_t flags; td = curthread; - critical_exit(); flags = td->td_md.md_saved_flags; td->td_md.md_spinlock_count--; - if (td->td_md.md_spinlock_count == 0) + if (td->td_md.md_spinlock_count == 0) { + critical_exit(); intr_restore(flags); + } } /* diff --git a/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c b/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c index e97856fbded2..52f3651ee670 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c @@ -126,6 +126,7 @@ static struct ofw_compat_data compat_data[] = { { "broadcom,bcm2835-vc", 1 }, { "broadcom,bcm2708-vc", 1 }, { "brcm,bcm2709", 1 }, + { "brcm,bcm2836", 1 }, { NULL, 0 } }; diff --git a/sys/boot/efi/loader/arch/arm64/Makefile.inc b/sys/boot/efi/loader/arch/arm64/Makefile.inc deleted file mode 100644 index 2ce5af79d0c3..000000000000 --- a/sys/boot/efi/loader/arch/arm64/Makefile.inc +++ /dev/null @@ -1,24 +0,0 @@ -# $FreeBSD$ - -LOADER_FDT_SUPPORT=yes -SRCS+= exec.c \ - start.S - -.PATH: ${BOOTSRC}/arm64/libarm64 -CFLAGS+=-I${BOOTSRC}/arm64/libarm64 -SRCS+= cache.c - -CFLAGS+= -mgeneral-regs-only - -CLEANFILES+= loader.help - -loader.help: help.common - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.if !defined(LOADER_ONLY) -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -FILES+= loader.rc -.endif diff --git a/sys/boot/forth/Makefile b/sys/boot/forth/Makefile deleted file mode 100644 index 1f42003f9dcb..000000000000 --- a/sys/boot/forth/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -# $FreeBSD$ - -MAN+= beastie.4th.8 \ - brand.4th.8 \ - check-password.4th.8 \ - color.4th.8 \ - delay.4th.8 \ - loader.conf.5 \ - loader.4th.8 \ - menu.4th.8 \ - menusets.4th.8 \ - version.4th.8 - -.include diff --git a/sys/boot/i386/loader/Makefile.depend b/sys/boot/i386/loader/Makefile.depend deleted file mode 100644 index 5d4398105e2a..000000000000 --- a/sys/boot/i386/loader/Makefile.depend +++ /dev/null @@ -1,20 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - include \ - include/xlocale \ - sys/boot/ficl32 \ - sys/boot/geli \ - sys/boot/i386/btx/btx \ - sys/boot/i386/btx/btxldr \ - sys/boot/i386/btx/lib \ - sys/boot/i386/libi386 \ - sys/boot/libsa32 \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/sys/boot/i386/zfsloader/Makefile b/sys/boot/i386/zfsloader/Makefile deleted file mode 100644 index 6e07df776940..000000000000 --- a/sys/boot/i386/zfsloader/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# $FreeBSD$ - -LOADER_ZFS_SUPPORT=yes - -.include - -.PATH: ${BOOTSRC}/i386/loader - -LOADER= zfsloader -NEWVERSWHAT= "ZFS enabled bootstrap loader" x86 -LOADER_ONLY= yes -MAN= - -.include "${BOOTSRC}/i386/loader/Makefile" - diff --git a/sys/boot/i386/zfsloader/Makefile.depend b/sys/boot/i386/zfsloader/Makefile.depend deleted file mode 100644 index d17b39324022..000000000000 --- a/sys/boot/i386/zfsloader/Makefile.depend +++ /dev/null @@ -1,21 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - include \ - include/xlocale \ - sys/boot/ficl32 \ - sys/boot/geli \ - sys/boot/i386/btx/btx \ - sys/boot/i386/btx/btxldr \ - sys/boot/i386/btx/lib \ - sys/boot/i386/libi386 \ - sys/boot/libsa32 \ - sys/boot/zfs32 \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/sys/boot/powerpc/Makefile b/sys/boot/powerpc/Makefile deleted file mode 100644 index e3ac008fb799..000000000000 --- a/sys/boot/powerpc/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -SUBDIR= boot1.chrp kboot ofw uboot -.if ${MACHINE_ARCH} != "powerpcspe" -SUBDIR+= ps3 -.endif - -.include diff --git a/sys/boot/powerpc/kboot/help.kboot b/sys/boot/powerpc/kboot/help.kboot deleted file mode 100644 index e9308e852cd6..000000000000 --- a/sys/boot/powerpc/kboot/help.kboot +++ /dev/null @@ -1 +0,0 @@ -$FreeBSD: user/nwhitehorn/kboot/powerpc/kboot/help.kboot 217044 2011-01-06 04:12:29Z nwhitehorn $ diff --git a/sys/boot/powerpc/ofw/help.ofw b/sys/boot/powerpc/ofw/help.ofw deleted file mode 100644 index 5873eb0512d2..000000000000 --- a/sys/boot/powerpc/ofw/help.ofw +++ /dev/null @@ -1 +0,0 @@ -$FreeBSD$ diff --git a/sys/boot/powerpc/ps3/help.ps3 b/sys/boot/powerpc/ps3/help.ps3 deleted file mode 100644 index 5873eb0512d2..000000000000 --- a/sys/boot/powerpc/ps3/help.ps3 +++ /dev/null @@ -1 +0,0 @@ -$FreeBSD$ diff --git a/sys/boot/powerpc/uboot/help.uboot b/sys/boot/powerpc/uboot/help.uboot deleted file mode 100644 index 5873eb0512d2..000000000000 --- a/sys/boot/powerpc/uboot/help.uboot +++ /dev/null @@ -1 +0,0 @@ -$FreeBSD$ diff --git a/sys/boot/sparc64/Makefile b/sys/boot/sparc64/Makefile deleted file mode 100644 index a76803909082..000000000000 --- a/sys/boot/sparc64/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# $FreeBSD$ - -SUBDIR= boot1 loader zfsboot zfsloader - -.include diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h index 18022d2c125e..d1d99c8e70cd 100644 --- a/sys/cam/cam_ccb.h +++ b/sys/cam/cam_ccb.h @@ -1016,11 +1016,14 @@ struct ccb_trans_settings_nvme u_int valid; /* Which fields to honor */ #define CTS_NVME_VALID_SPEC 0x01 #define CTS_NVME_VALID_CAPS 0x02 - u_int spec_major; /* Major version of spec supported */ - u_int spec_minor; /* Minor verison of spec supported */ - u_int spec_tiny; /* Tiny version of spec supported */ - u_int max_xfer; /* Max transfer size (0 -> unlimited */ - u_int caps; +#define CTS_NVME_VALID_LINK 0x04 + uint32_t spec; /* NVMe spec implemented -- same as vs register */ + uint32_t max_xfer; /* Max transfer size (0 -> unlimited */ + uint32_t caps; + uint8_t lanes; /* Number of PCIe lanes */ + uint8_t speed; /* PCIe generation for each lane */ + uint8_t max_lanes; /* Number of PCIe lanes */ + uint8_t max_speed; /* PCIe generation for each lane */ }; #include diff --git a/sys/cam/nvme/nvme_all.c b/sys/cam/nvme/nvme_all.c index 9a1bf53a4675..8d1e688ec74f 100644 --- a/sys/cam/nvme/nvme_all.c +++ b/sys/cam/nvme/nvme_all.c @@ -87,9 +87,16 @@ nvme_identify_match(caddr_t identbuffer, caddr_t table_entry) void nvme_print_ident(const struct nvme_controller_data *cdata, - const struct nvme_namespace_data *data) + const struct nvme_namespace_data *data, struct sbuf *sb) { - printf("I'm a pretty NVME drive\n"); + + sbuf_printf(sb, "<"); + cam_strvis_sbuf(sb, cdata->mn, sizeof(cdata->mn), 0); + sbuf_printf(sb, " "); + cam_strvis_sbuf(sb, cdata->fr, sizeof(cdata->fr), 0); + sbuf_printf(sb, " "); + cam_strvis_sbuf(sb, cdata->sn, sizeof(cdata->sn), 0); + sbuf_printf(sb, ">\n"); } /* XXX need to do nvme admin opcodes too, but those aren't used yet by nda */ diff --git a/sys/cam/nvme/nvme_all.h b/sys/cam/nvme/nvme_all.h index b52b7a7812f9..b2db4833bb26 100644 --- a/sys/cam/nvme/nvme_all.h +++ b/sys/cam/nvme/nvme_all.h @@ -33,15 +33,14 @@ struct ccb_nvmeio; -#define NVME_REV_1 1 /* Supports NVMe 1.2 or earlier */ - void nvme_ns_cmd(struct ccb_nvmeio *nvmeio, uint8_t cmd, uint32_t nsid, uint32_t cdw10, uint32_t cdw11, uint32_t cdw12, uint32_t cdw13, uint32_t cdw14, uint32_t cdw15); int nvme_identify_match(caddr_t identbuffer, caddr_t table_entry); -void nvme_print_ident(const struct nvme_controller_data *, const struct nvme_namespace_data *); +struct sbuf; +void nvme_print_ident(const struct nvme_controller_data *, const struct nvme_namespace_data *, struct sbuf *); const char *nvme_op_string(const struct nvme_command *); const char *nvme_cmd_string(const struct nvme_command *, char *, size_t); const void *nvme_get_identify_cntrl(struct cam_periph *); diff --git a/sys/cam/nvme/nvme_xpt.c b/sys/cam/nvme/nvme_xpt.c index 5229ca365c79..5721bc527f39 100644 --- a/sys/cam/nvme/nvme_xpt.c +++ b/sys/cam/nvme/nvme_xpt.c @@ -619,33 +619,49 @@ nvme_announce_periph(struct cam_periph *periph) struct ccb_pathinq cpi; struct ccb_trans_settings cts; struct cam_path *path = periph->path; + struct ccb_trans_settings_nvme *nvmex; cam_periph_assert(periph, MA_OWNED); + /* Ask the SIM for connection details */ xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; xpt_action((union ccb*)&cts); if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) return; + nvmex = &cts.xport_specific.nvme; + /* Ask the SIM for its base transfer speed */ xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); - /* XXX NVME STUFF HERE */ + printf("%s%d: nvme version %d.%d x%d (max x%d) lanes PCIe Gen%d (max Gen%d) link", + periph->periph_name, periph->unit_number, + NVME_MAJOR(nvmex->spec), + NVME_MINOR(nvmex->spec), + nvmex->lanes, nvmex->max_lanes, + nvmex->speed, nvmex->max_speed); printf("\n"); } static void nvme_proto_announce(struct cam_ed *device) { - nvme_print_ident(device->nvme_cdata, device->nvme_data); + struct sbuf sb; + char buffer[120]; + + sbuf_new(&sb, buffer, sizeof(buffer), SBUF_FIXEDLEN); + nvme_print_ident(device->nvme_cdata, device->nvme_data, &sb); + sbuf_finish(&sb); + sbuf_putbuf(&sb); } static void nvme_proto_denounce(struct cam_ed *device) { - nvme_print_ident(device->nvme_cdata, device->nvme_data); + + nvme_proto_announce(device); } static void diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c index 69bcd9423f09..e9e3f3d541c8 100644 --- a/sys/compat/linux/linux_signal.c +++ b/sys/compat/linux/linux_signal.c @@ -748,8 +748,7 @@ linux_rt_sigqueueinfo(struct thread *td, struct linux_rt_sigqueueinfo_args *args sig = linux_to_bsd_signal(args->sig); error = ESRCH; - if ((p = pfind(args->pid)) != NULL || - (p = zpfind(args->pid)) != NULL) { + if ((p = pfind_any(args->pid)) != NULL) { error = p_cansignal(td, p, sig); if (error != 0) { PROC_UNLOCK(p); diff --git a/sys/compat/linuxkpi/common/include/linux/sched.h b/sys/compat/linuxkpi/common/include/linux/sched.h index 1742430f430b..9d5bca717b4d 100644 --- a/sys/compat/linuxkpi/common/include/linux/sched.h +++ b/sys/compat/linuxkpi/common/include/linux/sched.h @@ -67,7 +67,7 @@ struct task_struct { void *task_data; int task_ret; atomic_t usage; - int state; + atomic_t state; atomic_t kthread_flags; pid_t pid; /* BSD thread ID */ const char *comm; @@ -92,9 +92,8 @@ struct task_struct { #define put_pid(x) do { } while (0) #define current_euid() (curthread->td_ucred->cr_uid) -#define set_task_state(task, x) \ - atomic_store_rel_int((volatile int *)&task->state, (x)) -#define __set_task_state(task, x) (task->state = (x)) +#define set_task_state(task, x) atomic_set(&(task)->state, (x)) +#define __set_task_state(task, x) ((task)->state.counter = (x)) #define set_current_state(x) set_task_state(current, x) #define __set_current_state(x) __set_task_state(current, x) diff --git a/sys/compat/linuxkpi/common/include/linux/timer.h b/sys/compat/linuxkpi/common/include/linux/timer.h index bee3acaabea9..d046b6e141a5 100644 --- a/sys/compat/linuxkpi/common/include/linux/timer.h +++ b/sys/compat/linuxkpi/common/include/linux/timer.h @@ -69,8 +69,8 @@ extern void mod_timer(struct timer_list *, int); extern void add_timer(struct timer_list *); extern void add_timer_on(struct timer_list *, int cpu); -#define del_timer(timer) callout_stop(&(timer)->timer_callout) -#define del_timer_sync(timer) callout_drain(&(timer)->timer_callout) +#define del_timer(timer) (void)callout_stop(&(timer)->timer_callout) +#define del_timer_sync(timer) (void)callout_drain(&(timer)->timer_callout) #define timer_pending(timer) callout_pending(&(timer)->timer_callout) #define round_jiffies(j) \ ((int)(((j) + linux_timer_hz_mask) & ~linux_timer_hz_mask)) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 46c232e89469..57a6774464ed 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -607,24 +607,6 @@ linux_cdev_handle_free(struct vm_area_struct *vmap) kfree(vmap); } -static struct vm_area_struct * -linux_cdev_handle_insert(void *handle, struct vm_area_struct *vmap) -{ - struct vm_area_struct *ptr; - - rw_wlock(&linux_vma_lock); - TAILQ_FOREACH(ptr, &linux_vma_head, vm_entry) { - if (ptr->vm_private_data == handle) { - rw_wunlock(&linux_vma_lock); - linux_cdev_handle_free(vmap); - return (NULL); - } - } - TAILQ_INSERT_TAIL(&linux_vma_head, vmap, vm_entry); - rw_wunlock(&linux_vma_lock); - return (vmap); -} - static void linux_cdev_handle_remove(struct vm_area_struct *vmap) { @@ -1318,20 +1300,55 @@ linux_dev_mmap_single(struct cdev *dev, vm_ooffset_t *offset, attr = pgprot2cachemode(vmap->vm_page_prot); if (vmap->vm_ops != NULL) { + struct vm_area_struct *ptr; void *vm_private_data; + bool vm_no_fault; if (vmap->vm_ops->open == NULL || vmap->vm_ops->close == NULL || vmap->vm_private_data == NULL) { + /* free allocated VM area struct */ linux_cdev_handle_free(vmap); return (EINVAL); } vm_private_data = vmap->vm_private_data; - vmap = linux_cdev_handle_insert(vm_private_data, vmap); + rw_wlock(&linux_vma_lock); + TAILQ_FOREACH(ptr, &linux_vma_head, vm_entry) { + if (ptr->vm_private_data == vm_private_data) + break; + } + /* check if there is an existing VM area struct */ + if (ptr != NULL) { + /* check if the VM area structure is invalid */ + if (ptr->vm_ops == NULL || + ptr->vm_ops->open == NULL || + ptr->vm_ops->close == NULL) { + error = ESTALE; + vm_no_fault = 1; + } else { + error = EEXIST; + vm_no_fault = (ptr->vm_ops->fault == NULL); + } + } else { + /* insert VM area structure into list */ + TAILQ_INSERT_TAIL(&linux_vma_head, vmap, vm_entry); + error = 0; + vm_no_fault = (vmap->vm_ops->fault == NULL); + } + rw_wunlock(&linux_vma_lock); - if (vmap->vm_ops->fault == NULL) { + if (error != 0) { + /* free allocated VM area struct */ + linux_cdev_handle_free(vmap); + /* check for stale VM area struct */ + if (error != EEXIST) + return (error); + } + + /* check if there is no fault handler */ + if (vm_no_fault) { *object = cdev_pager_allocate(vm_private_data, OBJT_DEVICE, &linux_cdev_pager_ops[1], size, nprot, *offset, curthread->td_ucred); @@ -1341,9 +1358,14 @@ linux_dev_mmap_single(struct cdev *dev, vm_ooffset_t *offset, curthread->td_ucred); } + /* check if allocating the VM object failed */ if (*object == NULL) { - linux_cdev_handle_remove(vmap); - linux_cdev_handle_free(vmap); + if (error == 0) { + /* remove VM area struct from list */ + linux_cdev_handle_remove(vmap); + /* free allocated VM area struct */ + linux_cdev_handle_free(vmap); + } return (EINVAL); } } else { diff --git a/sys/compat/linuxkpi/common/src/linux_current.c b/sys/compat/linuxkpi/common/src/linux_current.c index 331f6e2d2b7a..6cac640ef73b 100644 --- a/sys/compat/linuxkpi/common/src/linux_current.c +++ b/sys/compat/linuxkpi/common/src/linux_current.c @@ -68,7 +68,7 @@ linux_alloc_current(struct thread *td, int flags) ts->comm = td->td_name; ts->pid = td->td_tid; atomic_set(&ts->usage, 1); - ts->state = TASK_RUNNING; + atomic_set(&ts->state, TASK_RUNNING); init_completion(&ts->parked); init_completion(&ts->exited); diff --git a/sys/compat/linuxkpi/common/src/linux_schedule.c b/sys/compat/linuxkpi/common/src/linux_schedule.c index 97afc8c4867f..dc3dd918d1e7 100644 --- a/sys/compat/linuxkpi/common/src/linux_schedule.c +++ b/sys/compat/linuxkpi/common/src/linux_schedule.c @@ -78,7 +78,7 @@ wake_up_task(struct task_struct *task, unsigned int state) ret = wakeup_swapper = 0; sleepq_lock(task); - if ((atomic_load_acq_int(&task->state) & state) != 0) { + if ((atomic_read(&task->state) & state) != 0) { set_task_state(task, TASK_WAKING); wakeup_swapper = sleepq_signal(task, SLEEPQ_SLEEP, 0, 0); ret = 1; @@ -234,7 +234,7 @@ linux_wait_event_common(wait_queue_head_t *wqh, wait_queue_t *wq, int timeout, */ PHOLD(task->task_thread->td_proc); sleepq_lock(task); - if (atomic_load_acq_int(&task->state) != TASK_WAKING) { + if (atomic_read(&task->state) != TASK_WAKING) { ret = linux_add_to_sleepqueue(task, "wevent", timeout, state); } else { sleepq_release(task); @@ -269,7 +269,7 @@ linux_schedule_timeout(int timeout) DROP_GIANT(); sleepq_lock(task); - state = atomic_load_acq_int(&task->state); + state = atomic_read(&task->state); if (state != TASK_WAKING) (void)linux_add_to_sleepqueue(task, "sched", timeout, state); else diff --git a/sys/conf/dtb.mk b/sys/conf/dtb.mk index f3e2fa7435ef..96947171b05f 100644 --- a/sys/conf/dtb.mk +++ b/sys/conf/dtb.mk @@ -47,7 +47,7 @@ SYSDIR= ${_dir:tA} .SUFFIXES: .dtb .dts -.PATH: ${SYSDIR}/gnu/dts/${MACHINE} ${SYSDIR}/boot/fdt/dts/${MACHINE} +.PATH: ${SYSDIR}/gnu/dts/${MACHINE} ${SYSDIR}/dts/${MACHINE} DTB=${DTS:R:S/$/.dtb/} diff --git a/sys/conf/files b/sys/conf/files index a79619d650e3..1de9341d511a 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4571,6 +4571,8 @@ dev/mlx4/mlx4_core/mlx4_eq.c optional mlx4 pci \ compile-with "${OFED_C}" dev/mlx4/mlx4_core/mlx4_fw.c optional mlx4 pci \ compile-with "${OFED_C}" +dev/mlx4/mlx4_core/mlx4_fw_qos.c optional mlx4 pci \ + compile-with "${OFED_C}" dev/mlx4/mlx4_core/mlx4_icm.c optional mlx4 pci \ compile-with "${OFED_C}" dev/mlx4/mlx4_core/mlx4_intf.c optional mlx4 pci \ @@ -4597,8 +4599,6 @@ dev/mlx4/mlx4_core/mlx4_srq.c optional mlx4 pci \ compile-with "${OFED_C}" dev/mlx4/mlx4_core/mlx4_resource_tracker.c optional mlx4 pci \ compile-with "${OFED_C}" -dev/mlx4/mlx4_core/mlx4_sys_tune.c optional mlx4 pci \ - compile-with "${OFED_C}" dev/mlx4/mlx4_en/mlx4_en_cq.c optional mlx4en pci inet inet6 \ compile-with "${OFED_C}" diff --git a/sys/conf/makeLINT.mk b/sys/conf/makeLINT.mk index 65ab59579aac..fc75b35a7bc6 100644 --- a/sys/conf/makeLINT.mk +++ b/sys/conf/makeLINT.mk @@ -1,5 +1,8 @@ # $FreeBSD$ +# The LINT files need to end up in the kernel source directory. +.OBJDIR: ${.CURDIR} + all: @echo "make LINT only" @@ -9,9 +12,10 @@ clean: rm -f LINT-NOINET LINT-NOINET6 LINT-NOIP .endif -NOTES= ../../conf/NOTES NOTES -LINT: ${NOTES} ../../conf/makeLINT.sed - cat ${NOTES} | sed -E -n -f ../../conf/makeLINT.sed > ${.TARGET} +NOTES= ${.CURDIR}/../../conf/NOTES ${.CURDIR}/NOTES +MAKELINT_SED= ${.CURDIR}/../../conf/makeLINT.sed +LINT: ${NOTES} ${MAKELINT_SED} + cat ${NOTES} | sed -E -n -f ${MAKELINT_SED} > ${.TARGET} .if ${TARGET} == "amd64" || ${TARGET} == "i386" echo "include ${.TARGET}" > ${.TARGET}-NOINET echo "ident ${.TARGET}-NOINET" >> ${.TARGET}-NOINET diff --git a/sys/contrib/dev/acpica/acpica_prep.sh b/sys/contrib/dev/acpica/acpica_prep.sh index e56a33a41c0e..91770e33f556 100755 --- a/sys/contrib/dev/acpica/acpica_prep.sh +++ b/sys/contrib/dev/acpica/acpica_prep.sh @@ -90,4 +90,4 @@ echo "Directories you may want to 'svn diff':" echo " sys/contrib/dev/acpica sys/dev/acpica \\" echo " sys/amd64/acpica sys/arm64/acpica sys/i386/acpica sys/x86/acpica \\" echo " sys/amd64/include sys/arm64/include sys/i386/include include \\" -echo " sys/boot sys/conf sys/modules/acpi usr.sbin/acpi" +echo " stand sys/conf sys/modules/acpi usr.sbin/acpi" diff --git a/sys/contrib/dev/acpica/changes.txt b/sys/contrib/dev/acpica/changes.txt index b40fa3209912..85cd9c9ae611 100644 --- a/sys/contrib/dev/acpica/changes.txt +++ b/sys/contrib/dev/acpica/changes.txt @@ -1,3 +1,56 @@ +---------------------------------------- +10 November 2017. Summary of changes for version 20171110: + + +1) ACPICA kernel-resident subsystem: + +This release implements full support for ACPI 6.2A: + NFIT - Added a new subtable, "Platform Capabilities Structure" +No other changes to ACPICA were required, since ACPI 6.2A is primarily an +errata release of the specification. + +Other ACPI table changes: + IORT: Added the SMMUv3 Device ID mapping index. Hanjun Guo + PPTT: Added cache attribute flag definitions to actbl1.h. Jeremy +Linton + +Utilities: Modified the string/integer conversion functions to use +internal 64-bit divide support instead of a native divide. On 32-bit +platforms, a 64-bit divide typically requires a library function which +may not be present in the build (kernel or otherwise). + +Implemented a targeted error message for timeouts returned from the +Embedded Controller device driver. This is seen frequently enough to +special-case an AE_TIME returned from an EC operation region access: + "Timeout from EC hardware or EC device driver" + +Changed the "ACPI Exception" message prefix to "ACPI Error" so that all +runtime error messages have the identical prefix. + + +2) iASL Compiler/Disassembler and Tools: + +AcpiXtract: Fixed a problem with table header detection within the +acpidump file. Processing a table could be ended early if a 0x40 (@) +appears in the original binary table, resulting in the @ symbol appearing +in the decoded ASCII field at the end of the acpidump text line. The +symbol caused acpixtract to incorrectly think it had reached the end of +the current table and the beginning of a new table. + +AcpiXtract: Added an option (-f) to ignore some errors during table +extraction. This initial implementation ignores non-ASCII and non- +printable characters found in the acpidump text file. + +TestSuite(ASLTS)/AcpiExec: Fixed and restored the memory usage statistics +for ASLTS. This feature is used to track memory allocations from +different memory caches within the ACPICA code. At the end of an ASLTS +run, these memory statistics are recorded and stored in a log file. + +Debugger (user-space version): Implemented a simple "Background" command. +Creates a new thread to execute a control method in the background, while +control returns to the debugger prompt to allow additional commands. + Syntax: Background [Arguments] + ---------------------------------------- 29 September 2017. Summary of changes for version 20170929: diff --git a/sys/contrib/dev/acpica/common/dmtable.c b/sys/contrib/dev/acpica/common/dmtable.c index 26b6c64c423a..0549413d6117 100644 --- a/sys/contrib/dev/acpica/common/dmtable.c +++ b/sys/contrib/dev/acpica/common/dmtable.c @@ -356,6 +356,7 @@ static const char *AcpiDmNfitSubnames[] = "NVDIMM Control Region", /* ACPI_NFIT_TYPE_CONTROL_REGION */ "NVDIMM Block Data Window Region", /* ACPI_NFIT_TYPE_DATA_REGION */ "Flush Hint Address", /* ACPI_NFIT_TYPE_FLUSH_ADDRESS */ + "Platform Capabilities", /* ACPI_NFIT_TYPE_CAPABILITIES */ "Unknown Subtable Type" /* Reserved */ }; diff --git a/sys/contrib/dev/acpica/common/dmtbdump.c b/sys/contrib/dev/acpica/common/dmtbdump.c index bb82bfdfacc0..1e7a3e4259ab 100644 --- a/sys/contrib/dev/acpica/common/dmtbdump.c +++ b/sys/contrib/dev/acpica/common/dmtbdump.c @@ -3061,6 +3061,11 @@ AcpiDmDumpNfit ( FieldOffset = sizeof (ACPI_NFIT_FLUSH_ADDRESS) - sizeof (UINT64); break; + case ACPI_NFIT_TYPE_CAPABILITIES: /* ACPI 6.0A */ + + InfoTable = AcpiDmTableInfoNfit7; + break; + default: AcpiOsPrintf ("\n**** Unknown NFIT subtable type 0x%X\n", Subtable->Type); diff --git a/sys/contrib/dev/acpica/common/dmtbinfo.c b/sys/contrib/dev/acpica/common/dmtbinfo.c index 5487261a0e81..2702e61905b7 100644 --- a/sys/contrib/dev/acpica/common/dmtbinfo.c +++ b/sys/contrib/dev/acpica/common/dmtbinfo.c @@ -336,6 +336,7 @@ #define ACPI_NFIT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_CONTROL_REGION,f) #define ACPI_NFIT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_DATA_REGION,f) #define ACPI_NFIT6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_FLUSH_ADDRESS,f) +#define ACPI_NFIT7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_CAPABILITIES,f) #define ACPI_PCCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f) #define ACPI_PCCT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED,f) #define ACPI_PCCT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED_TYPE2,f) @@ -419,6 +420,7 @@ #define ACPI_NFIT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_SYSTEM_ADDRESS,f,o) #define ACPI_NFIT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_MEMORY_MAP,f,o) #define ACPI_NFIT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_CONTROL_REGION,f,o) +#define ACPI_NFIT7_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_CAPABILITIES,f,o) #define ACPI_PCCT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_PCCT,f,o) #define ACPI_PCCT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED,f,o) #define ACPI_PCCT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED_TYPE2,f,o) @@ -1861,6 +1863,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[] = {ACPI_DMT_UINT8, ACPI_IORT4_OFFSET (Pxm), "Proximity Domain", 0}, {ACPI_DMT_UINT8, ACPI_IORT4_OFFSET (Reserved1), "Reserved", 0}, {ACPI_DMT_UINT16, ACPI_IORT4_OFFSET (Reserved2), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (IdMappingIndex), "Device ID Mapping Index", 0}, ACPI_DMT_TERMINATOR }; @@ -2564,6 +2567,18 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoNfit6a[] = ACPI_DMT_TERMINATOR }; +ACPI_DMTABLE_INFO AcpiDmTableInfoNfit7[] = +{ + {ACPI_DMT_UINT8, ACPI_NFIT7_OFFSET (HighestCapability), "Highest Capability", 0}, + {ACPI_DMT_UINT24, ACPI_NFIT7_OFFSET (Reserved[0]), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_NFIT7_OFFSET (Capabilities), "Capabilities (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_NFIT7_FLAG_OFFSET (Capabilities,0), "Cache Flush to NVDIMM", 0}, + {ACPI_DMT_FLAG1, ACPI_NFIT7_FLAG_OFFSET (Capabilities,0), "Memory Flush to MVDIMM", 0}, + {ACPI_DMT_FLAG2, ACPI_NFIT7_FLAG_OFFSET (Capabilities,0), "Memory Mirroring", 0}, + {ACPI_DMT_UINT32, ACPI_NFIT7_OFFSET (Reserved2), "Reserved", 0}, + ACPI_DMT_TERMINATOR +}; + /******************************************************************************* * diff --git a/sys/contrib/dev/acpica/compiler/asldefine.h b/sys/contrib/dev/acpica/compiler/asldefine.h index a7d1a289d527..bcdc8c2407c9 100644 --- a/sys/contrib/dev/acpica/compiler/asldefine.h +++ b/sys/contrib/dev/acpica/compiler/asldefine.h @@ -162,7 +162,7 @@ #define ASL_CREATOR_ID "INTL" #define ASL_DEFINE "__IASL__" #define ASL_PREFIX "iASL: " -#define ASL_COMPLIANCE "Supports ACPI Specification Revision 6.2" +#define ASL_COMPLIANCE "Supports ACPI Specification Revision 6.2A" /* Configuration constants */ diff --git a/sys/contrib/dev/acpica/compiler/dttable2.c b/sys/contrib/dev/acpica/compiler/dttable2.c index 51f5b2c488ff..73f543ef4aff 100644 --- a/sys/contrib/dev/acpica/compiler/dttable2.c +++ b/sys/contrib/dev/acpica/compiler/dttable2.c @@ -697,6 +697,11 @@ DtCompileNfit ( InfoTable = AcpiDmTableInfoNfit6; break; + case ACPI_NFIT_TYPE_CAPABILITIES: + + InfoTable = AcpiDmTableInfoNfit7; + break; + default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "NFIT"); @@ -740,7 +745,6 @@ DtCompileNfit ( } Interleave->LineCount = Count; - DtPopSubtable (); break; case ACPI_NFIT_TYPE_SMBIOS: @@ -786,7 +790,6 @@ DtCompileNfit ( } Hint->HintCount = (UINT16) Count; - DtPopSubtable (); break; default: diff --git a/sys/contrib/dev/acpica/compiler/dttemplate.h b/sys/contrib/dev/acpica/compiler/dttemplate.h index 38750f79d979..4c77afc16fd1 100644 --- a/sys/contrib/dev/acpica/compiler/dttemplate.h +++ b/sys/contrib/dev/acpica/compiler/dttemplate.h @@ -696,53 +696,56 @@ const unsigned char TemplateHpet[] = const unsigned char TemplateIort[] = { - 0x49,0x4F,0x52,0x54,0x74,0x01,0x00,0x00, /* 00000000 "IORTt..." */ - 0x00,0xD2,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ - 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ + 0x49,0x4F,0x52,0x54,0x90,0x01,0x00,0x00, /* 00000000 "IORT...." */ + 0x00,0x5F,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "._INTEL " */ + 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x19,0x01,0x17,0x20,0x05,0x00,0x00,0x00, /* 00000020 "... ...." */ + 0x31,0x08,0x17,0x20,0x05,0x00,0x00,0x00, /* 00000020 "1.. ...." */ 0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "4......." */ 0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000040 "........" */ - 0x00,0x00,0x00,0x00,0x01,0x44,0x00,0x00, /* 00000048 ".....D.." */ + 0x00,0x00,0x00,0x00,0x01,0x58,0x00,0x00, /* 00000048 ".....X.." */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000050 "........" */ - 0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "0......." */ + 0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "D......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ 0x00,0x5C,0x5F,0x53,0x42,0x2E,0x50,0x43, /* 00000068 ".\_SB.PC" */ 0x49,0x30,0x2E,0x44,0x45,0x56,0x30,0x00, /* 00000070 "I0.DEV0." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */ - 0x02,0x34,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 ".4......" */ - 0x01,0x00,0x00,0x00,0x20,0x00,0x00,0x00, /* 00000098 ".... ..." */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */ + 0x00,0x00,0x00,0x00,0x02,0x34,0x00,0x00, /* 000000A0 ".....4.." */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000A8 "........" */ + 0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 " ......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */ - 0x00,0x00,0x00,0x00,0x03,0x60,0x00,0x00, /* 000000C0 ".....`.." */ - 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000C8 "........" */ - 0x4C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D0 "L......." */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D8 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */ - 0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00, /* 000000E8 "....<..." */ - 0x00,0x00,0x00,0x00,0x4C,0x00,0x00,0x00, /* 000000F0 "....L..." */ - 0x00,0x00,0x00,0x00,0x4C,0x00,0x00,0x00, /* 000000F8 "....L..." */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D0 "........" */ + 0x03,0x60,0x00,0x01,0x00,0x00,0x00,0x00, /* 000000D8 ".`......" */ + 0x01,0x00,0x00,0x00,0x4C,0x00,0x00,0x00, /* 000000E0 "....L..." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */ + 0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "<......." */ + 0x4C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "L......." */ + 0x4C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "L......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */ - 0x00,0x00,0x00,0x00,0x04,0x50,0x00,0x00, /* 00000120 ".....P.." */ - 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000128 "........" */ - 0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "<......." */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000138 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000140 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */ + 0x04,0x58,0x00,0x01,0x00,0x00,0x00,0x00, /* 00000138 ".X......" */ + 0x01,0x00,0x00,0x00,0x44,0x00,0x00,0x00, /* 00000140 "....D..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000148 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000150 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000160 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000168 "........" */ - 0x00,0x00,0x00,0x00 /* 00000170 "...." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000170 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000178 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000180 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000188 "........" */ }; const unsigned char TemplateIvrs[] = @@ -939,11 +942,11 @@ const unsigned char TemplateMsct[] = const unsigned char TemplateNfit[] = { - 0x4E,0x46,0x49,0x54,0x70,0x01,0x00,0x00, /* 00000000 "NFITp..." */ - 0x01,0x53,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".SINTEL " */ + 0x4E,0x46,0x49,0x54,0x80,0x01,0x00,0x00, /* 00000000 "NFIT...." */ + 0x01,0x07,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x10,0x04,0x15,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */ + 0x29,0x09,0x17,0x20,0x00,0x00,0x00,0x00, /* 00000020 ").. ...." */ 0x00,0x00,0x38,0x00,0x01,0x00,0x00,0x00, /* 00000028 "..8....." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x30,0x05,0xAF,0x91,0x86,0x5D,0x0E,0x47, /* 00000038 "0....].G" */ @@ -984,7 +987,9 @@ const unsigned char TemplateNfit[] = 0x06,0x00,0x20,0x00,0x01,0x00,0x00,0x00, /* 00000150 ".. ....." */ 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */ 0x00,0x00,0x00,0x18,0x04,0x00,0x00,0x00, /* 00000160 "........" */ - 0x00,0x00,0x00,0x18,0x06,0x00,0x00,0x00 /* 00000168 "........" */ + 0x00,0x00,0x00,0x18,0x06,0x00,0x00,0x00, /* 00000168 "........" */ + 0x07,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* 00000170 "........" */ + 0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000178 "........" */ }; const unsigned char TemplateMtmr[] = diff --git a/sys/contrib/dev/acpica/components/debugger/dbexec.c b/sys/contrib/dev/acpica/components/debugger/dbexec.c index 2ca3a12c8c93..d6abb9a00269 100644 --- a/sys/contrib/dev/acpica/components/debugger/dbexec.c +++ b/sys/contrib/dev/acpica/components/debugger/dbexec.c @@ -187,6 +187,10 @@ AcpiDbExecutionWalk ( void *Context, void **ReturnValue); +static void ACPI_SYSTEM_XFACE +AcpiDbSingleExecutionThread ( + void *Context); + /******************************************************************************* * @@ -366,7 +370,7 @@ AcpiDbExecuteSetup ( ACPI_FUNCTION_NAME (DbExecuteSetup); - /* Catenate the current scope to the supplied name */ + /* Concatenate the current scope to the supplied name */ Info->Pathname[0] = 0; if ((Info->Name[0] != '\\') && @@ -789,6 +793,124 @@ AcpiDbMethodThread ( } +/******************************************************************************* + * + * FUNCTION: AcpiDbSingleExecutionThread + * + * PARAMETERS: Context - Method info struct + * + * RETURN: None + * + * DESCRIPTION: Create one thread and execute a method + * + ******************************************************************************/ + +static void ACPI_SYSTEM_XFACE +AcpiDbSingleExecutionThread ( + void *Context) +{ + ACPI_DB_METHOD_INFO *Info = Context; + ACPI_STATUS Status; + ACPI_BUFFER ReturnObj; + + + AcpiOsPrintf ("\n"); + + Status = AcpiDbExecuteMethod (Info, &ReturnObj); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("%s During evaluation of %s\n", + AcpiFormatException (Status), Info->Pathname); + return; + } + + /* Display a return object, if any */ + + if (ReturnObj.Length) + { + AcpiOsPrintf ("Evaluation of %s returned object %p, " + "external buffer length %X\n", + AcpiGbl_DbMethodInfo.Pathname, ReturnObj.Pointer, + (UINT32) ReturnObj.Length); + + AcpiDbDumpExternalObject (ReturnObj.Pointer, 1); + } + + AcpiOsPrintf ("\nBackground thread completed\n%c ", + ACPI_DEBUGGER_COMMAND_PROMPT); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDbCreateExecutionThread + * + * PARAMETERS: MethodNameArg - Control method to execute + * Arguments - Array of arguments to the method + * Types - Corresponding array of object types + * + * RETURN: None + * + * DESCRIPTION: Create a single thread to evaluate a namespace object. Handles + * arguments passed on command line for control methods. + * + ******************************************************************************/ + +void +AcpiDbCreateExecutionThread ( + char *MethodNameArg, + char **Arguments, + ACPI_OBJECT_TYPE *Types) +{ + ACPI_STATUS Status; + UINT32 i; + + + memset (&AcpiGbl_DbMethodInfo, 0, sizeof (ACPI_DB_METHOD_INFO)); + AcpiGbl_DbMethodInfo.Name = MethodNameArg; + AcpiGbl_DbMethodInfo.InitArgs = 1; + AcpiGbl_DbMethodInfo.Args = AcpiGbl_DbMethodInfo.Arguments; + AcpiGbl_DbMethodInfo.Types = AcpiGbl_DbMethodInfo.ArgTypes; + + /* Setup method arguments, up to 7 (0-6) */ + + for (i = 0; (i < ACPI_METHOD_NUM_ARGS) && *Arguments; i++) + { + AcpiGbl_DbMethodInfo.Arguments[i] = *Arguments; + Arguments++; + + AcpiGbl_DbMethodInfo.ArgTypes[i] = *Types; + Types++; + } + + Status = AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Get the NS node, determines existence also */ + + Status = AcpiGetHandle (NULL, AcpiGbl_DbMethodInfo.Pathname, + &AcpiGbl_DbMethodInfo.Method); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("%s Could not get handle for %s\n", + AcpiFormatException (Status), AcpiGbl_DbMethodInfo.Pathname); + return; + } + + Status = AcpiOsExecute (OSL_DEBUGGER_EXEC_THREAD, + AcpiDbSingleExecutionThread, &AcpiGbl_DbMethodInfo); + if (ACPI_FAILURE (Status)) + { + return; + } + + AcpiOsPrintf ("\nBackground thread started\n"); +} + + /******************************************************************************* * * FUNCTION: AcpiDbCreateExecutionThreads diff --git a/sys/contrib/dev/acpica/components/debugger/dbinput.c b/sys/contrib/dev/acpica/components/debugger/dbinput.c index 140395d9541e..222f7cebf0bd 100644 --- a/sys/contrib/dev/acpica/components/debugger/dbinput.c +++ b/sys/contrib/dev/acpica/components/debugger/dbinput.c @@ -258,6 +258,7 @@ enum AcpiExDebuggerCommands CMD_UNLOAD, CMD_TERMINATE, + CMD_BACKGROUND, CMD_THREADS, CMD_TEST, @@ -336,6 +337,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] = {"UNLOAD", 1}, {"TERMINATE", 0}, + {"BACKGROUND", 1}, {"THREADS", 3}, {"TEST", 1}, @@ -346,102 +348,113 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] = /* * Help for all debugger commands. First argument is the number of lines * of help to output for the command. + * + * Note: Some commands are not supported by the kernel-level version of + * the debugger. */ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] = { - {0, "\nGeneral-Purpose Commands:", "\n"}, - {1, " Allocations", "Display list of current memory allocations\n"}, - {2, " Dump
|", "\n"}, - {0, " [Byte|Word|Dword|Qword]", "Display ACPI objects or memory\n"}, - {1, " Handlers", "Info about global handlers\n"}, - {1, " Help [Command]", "This help screen or individual command\n"}, - {1, " History", "Display command history buffer\n"}, - {1, " Level ] [console]", "Get/Set debug level for file or console\n"}, - {1, " Locks", "Current status of internal mutexes\n"}, - {1, " Osi [Install|Remove ]", "Display or modify global _OSI list\n"}, - {1, " Quit or Exit", "Exit this command\n"}, - {8, " Stats ", "Display namespace and memory statistics\n"}, - {1, " Allocations", "Display list of current memory allocations\n"}, - {1, " Memory", "Dump internal memory lists\n"}, - {1, " Misc", "Namespace search and mutex stats\n"}, - {1, " Objects", "Summary of namespace objects\n"}, - {1, " Sizes", "Sizes for each of the internal objects\n"}, - {1, " Stack", "Display CPU stack usage\n"}, - {1, " Tables", "Info about current ACPI table(s)\n"}, - {1, " Tables", "Display info about loaded ACPI tables\n"}, - {1, " ! ", "Execute command from history buffer\n"}, - {1, " !!", "Execute last command again\n"}, + {0, "\nNamespace Access:", "\n"}, + {1, " Businfo", "Display system bus info\n"}, + {1, " Disassemble ", "Disassemble a control method\n"}, + {1, " Find (? is wildcard)", "Find ACPI name(s) with wildcards\n"}, + {1, " Integrity", "Validate namespace integrity\n"}, + {1, " Methods", "Display list of loaded control methods\n"}, + {1, " Namespace [Object] [Depth]", "Display loaded namespace tree/subtree\n"}, + {1, " Notify ", "Send a notification on Object\n"}, + {1, " Objects [ObjectType]", "Display summary of all objects or just given type\n"}, + {1, " Owner [Depth]", "Display loaded namespace by object owner\n"}, + {1, " Paths", "Display full pathnames of namespace objects\n"}, + {1, " Predefined", "Check all predefined names\n"}, + {1, " Prefix []", "Set or Get current execution prefix\n"}, + {1, " References ", "Find all references to object at addr\n"}, + {1, " Resources [DeviceName]", "Display Device resources (no arg = all devices)\n"}, + {1, " Set N ", "Set value for named integer\n"}, + {1, " Template ", "Format/dump a Buffer/ResourceTemplate\n"}, + {1, " Type ", "Display object type\n"}, - {0, "\nNamespace Access Commands:", "\n"}, - {1, " Businfo", "Display system bus info\n"}, - {1, " Disassemble ", "Disassemble a control method\n"}, - {1, " Find (? is wildcard)", "Find ACPI name(s) with wildcards\n"}, - {1, " Integrity", "Validate namespace integrity\n"}, - {1, " Methods", "Display list of loaded control methods\n"}, - {1, " Namespace [Object] [Depth]", "Display loaded namespace tree/subtree\n"}, - {1, " Notify ", "Send a notification on Object\n"}, - {1, " Objects [ObjectType]", "Display summary of all objects or just given type\n"}, - {1, " Owner [Depth]", "Display loaded namespace by object owner\n"}, - {1, " Paths", "Display full pathnames of namespace objects\n"}, - {1, " Predefined", "Check all predefined names\n"}, - {1, " Prefix []", "Set or Get current execution prefix\n"}, - {1, " References ", "Find all references to object at addr\n"}, - {1, " Resources [DeviceName]", "Display Device resources (no arg = all devices)\n"}, - {1, " Set N ", "Set value for named integer\n"}, - {1, " Template ", "Format/dump a Buffer/ResourceTemplate\n"}, - {1, " Type ", "Display object type\n"}, + {0, "\nControl Method Execution:", "\n"}, + {1, " Evaluate [Arguments]", "Evaluate object or control method\n"}, + {1, " Execute [Arguments]", "Synonym for Evaluate\n"}, +#ifdef ACPI_APPLICATION + {1, " Background [Arguments]", "Evaluate object/method in a separate thread\n"}, + {1, " Thread ", "Spawn threads to execute method(s)\n"}, +#endif + {1, " Debug [Arguments]", "Single-Step a control method\n"}, + {7, " [Arguments] formats:", "Control method argument formats\n"}, + {1, " Hex Integer", "Integer\n"}, + {1, " \"Ascii String\"", "String\n"}, + {1, " (Hex Byte List)", "Buffer\n"}, + {1, " (01 42 7A BF)", "Buffer example (4 bytes)\n"}, + {1, " [Package Element List]", "Package\n"}, + {1, " [0x01 0x1234 \"string\"]", "Package example (3 elements)\n"}, - {0, "\nControl Method Execution Commands:","\n"}, - {1, " Arguments (or Args)", "Display method arguments\n"}, - {1, " Breakpoint ", "Set an AML execution breakpoint\n"}, - {1, " Call", "Run to next control method invocation\n"}, - {1, " Debug [Arguments]", "Single Step a control method\n"}, - {6, " Evaluate", "Synonym for Execute\n"}, - {5, " Execute [Arguments]", "Execute control method\n"}, - {1, " Hex Integer", "Integer method argument\n"}, - {1, " \"Ascii String\"", "String method argument\n"}, - {1, " (Hex Byte List)", "Buffer method argument\n"}, - {1, " [Package Element List]", "Package method argument\n"}, - {5, " Execute predefined", "Execute all predefined (public) methods\n"}, - {1, " Go", "Allow method to run to completion\n"}, - {1, " Information", "Display info about the current method\n"}, - {1, " Into", "Step into (not over) a method call\n"}, - {1, " List [# of Aml Opcodes]", "Display method ASL statements\n"}, - {1, " Locals", "Display method local variables\n"}, - {1, " Results", "Display method result stack\n"}, - {1, " Set <#> ", "Set method data (Arguments/Locals)\n"}, - {1, " Stop", "Terminate control method\n"}, - {5, " Trace [] [Once]", "Trace control method execution\n"}, - {1, " Enable", "Enable all messages\n"}, - {1, " Disable", "Disable tracing\n"}, - {1, " Method", "Enable method execution messages\n"}, - {1, " Opcode", "Enable opcode execution messages\n"}, - {1, " Tree", "Display control method calling tree\n"}, - {1, " ", "Single step next AML opcode (over calls)\n"}, + {0, "\nMiscellaneous:", "\n"}, + {1, " Allocations", "Display list of current memory allocations\n"}, + {2, " Dump
|", "\n"}, + {0, " [Byte|Word|Dword|Qword]", "Display ACPI objects or memory\n"}, + {1, " Handlers", "Info about global handlers\n"}, + {1, " Help [Command]", "This help screen or individual command\n"}, + {1, " History", "Display command history buffer\n"}, + {1, " Level ] [console]", "Get/Set debug level for file or console\n"}, + {1, " Locks", "Current status of internal mutexes\n"}, + {1, " Osi [Install|Remove ]", "Display or modify global _OSI list\n"}, + {1, " Quit or Exit", "Exit this command\n"}, + {8, " Stats ", "Display namespace and memory statistics\n"}, + {1, " Allocations", "Display list of current memory allocations\n"}, + {1, " Memory", "Dump internal memory lists\n"}, + {1, " Misc", "Namespace search and mutex stats\n"}, + {1, " Objects", "Summary of namespace objects\n"}, + {1, " Sizes", "Sizes for each of the internal objects\n"}, + {1, " Stack", "Display CPU stack usage\n"}, + {1, " Tables", "Info about current ACPI table(s)\n"}, + {1, " Tables", "Display info about loaded ACPI tables\n"}, +#ifdef ACPI_APPLICATION + {1, " Terminate", "Delete namespace and all internal objects\n"}, +#endif + {1, " ! ", "Execute command from history buffer\n"}, + {1, " !!", "Execute last command again\n"}, + + {0, "\nMethod and Namespace Debugging:", "\n"}, + {5, " Trace [] [Once]", "Trace control method execution\n"}, + {1, " Enable", "Enable all messages\n"}, + {1, " Disable", "Disable tracing\n"}, + {1, " Method", "Enable method execution messages\n"}, + {1, " Opcode", "Enable opcode execution messages\n"}, + {3, " Test ", "Invoke a debug test\n"}, + {1, " Objects", "Read/write/compare all namespace data objects\n"}, + {1, " Predefined", "Validate all ACPI predefined names (_STA, etc.)\n"}, + {1, " Execute predefined", "Execute all predefined (public) methods\n"}, + + {0, "\nControl Method Single-Step Execution:","\n"}, + {1, " Arguments (or Args)", "Display method arguments\n"}, + {1, " Breakpoint ", "Set an AML execution breakpoint\n"}, + {1, " Call", "Run to next control method invocation\n"}, + {1, " Go", "Allow method to run to completion\n"}, + {1, " Information", "Display info about the current method\n"}, + {1, " Into", "Step into (not over) a method call\n"}, + {1, " List [# of Aml Opcodes]", "Display method ASL statements\n"}, + {1, " Locals", "Display method local variables\n"}, + {1, " Results", "Display method result stack\n"}, + {1, " Set <#> ", "Set method data (Arguments/Locals)\n"}, + {1, " Stop", "Terminate control method\n"}, + {1, " Tree", "Display control method calling tree\n"}, + {1, " ", "Single step next AML opcode (over calls)\n"}, #ifdef ACPI_APPLICATION - {0, "\nHardware Simulation Commands:", "\n"}, - {1, " EnableAcpi", "Enable ACPI (hardware) mode\n"}, - {1, " Event ", "Generate AcpiEvent (Fixed/GPE)\n"}, - {1, " Gpe [GpeBlockDevice]", "Simulate a GPE\n"}, - {1, " Gpes", "Display info on all GPE devices\n"}, - {1, " Sci", "Generate an SCI\n"}, - {1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"}, + {0, "\nFile Operations:", "\n"}, + {1, " Close", "Close debug output file\n"}, + {1, " Load ", "Load ACPI table from a file\n"}, + {1, " Open ", "Open a file for debug output\n"}, + {1, " Unload ", "Unload an ACPI table via namespace object\n"}, - {0, "\nFile I/O Commands:", "\n"}, - {1, " Close", "Close debug output file\n"}, - {1, " Load ", "Load ACPI table from a file\n"}, - {1, " Open ", "Open a file for debug output\n"}, - {1, " Unload ", "Unload an ACPI table via namespace object\n"}, - - {0, "\nUser Space Commands:", "\n"}, - {1, " Terminate", "Delete namespace and all internal objects\n"}, - {1, " Thread ", "Spawn threads to execute method(s)\n"}, - - {0, "\nDebug Test Commands:", "\n"}, - {3, " Test ", "Invoke a debug test\n"}, - {1, " Objects", "Read/write/compare all namespace data objects\n"}, - {1, " Predefined", "Execute all ACPI predefined names (_STA, etc.)\n"}, + {0, "\nHardware Simulation:", "\n"}, + {1, " EnableAcpi", "Enable ACPI (hardware) mode\n"}, + {1, " Event ", "Generate AcpiEvent (Fixed/GPE)\n"}, + {1, " Gpe [GpeBlockDevice]", "Simulate a GPE\n"}, + {1, " Gpes", "Display info on all GPE devices\n"}, + {1, " Sci", "Generate an SCI\n"}, + {1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"}, #endif {0, NULL, NULL} }; @@ -571,11 +584,15 @@ AcpiDbDisplayHelp ( { /* No argument to help, display help for all commands */ + AcpiOsPrintf ("\nSummary of AML Debugger Commands\n\n"); + while (Next->Invocation) { AcpiOsPrintf ("%-38s%s", Next->Invocation, Next->Description); Next++; } + AcpiOsPrintf ("\n"); + } else { @@ -1258,6 +1275,12 @@ AcpiDbCommandDispatch ( /* AcpiInitialize (NULL); */ break; + case CMD_BACKGROUND: + + AcpiDbCreateExecutionThread (AcpiGbl_DbArgs[1], &AcpiGbl_DbArgs[2], + &AcpiGbl_DbArgTypes[2]); + break; + case CMD_THREADS: AcpiDbCreateExecutionThreads (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2], diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsfield.c b/sys/contrib/dev/acpica/components/dispatcher/dsfield.c index a52686330390..566a39613a08 100644 --- a/sys/contrib/dev/acpica/components/dispatcher/dsfield.c +++ b/sys/contrib/dev/acpica/components/dispatcher/dsfield.c @@ -340,7 +340,8 @@ AcpiDsCreateBufferField ( ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &Node); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.String, Status); return_ACPI_STATUS (Status); } } @@ -524,7 +525,8 @@ AcpiDsGetFieldNames ( WalkState, &Info->ConnectionNode); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Child->Common.Value.Name, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Child->Common.Value.Name, Status); return_ACPI_STATUS (Status); } } @@ -540,7 +542,8 @@ AcpiDsGetFieldNames ( WalkState, &Info->FieldNode); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE ((char *) &Arg->Named.Name, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + (char *) &Arg->Named.Name, Status); return_ACPI_STATUS (Status); } else @@ -639,7 +642,8 @@ AcpiDsCreateField ( #endif if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.Name, Status); return_ACPI_STATUS (Status); } } @@ -769,7 +773,8 @@ AcpiDsInitFieldObjects ( Flags, WalkState, &Node); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE ((char *) &Arg->Named.Name, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + (char *) &Arg->Named.Name, Status); if (Status != AE_ALREADY_EXISTS) { return_ACPI_STATUS (Status); @@ -834,7 +839,8 @@ AcpiDsCreateBankField ( #endif if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.Name, Status); return_ACPI_STATUS (Status); } } @@ -847,7 +853,8 @@ AcpiDsCreateBankField ( ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.String, Status); return_ACPI_STATUS (Status); } @@ -920,7 +927,8 @@ AcpiDsCreateIndexField ( ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.String, Status); return_ACPI_STATUS (Status); } @@ -932,7 +940,8 @@ AcpiDsCreateIndexField ( ACPI_NS_SEARCH_PARENT, WalkState, &Info.DataRegisterNode); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.String, Status); return_ACPI_STATUS (Status); } diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsobject.c b/sys/contrib/dev/acpica/components/dispatcher/dsobject.c index 55061de66d0e..0e8dc7262cf3 100644 --- a/sys/contrib/dev/acpica/components/dispatcher/dsobject.c +++ b/sys/contrib/dev/acpica/components/dispatcher/dsobject.c @@ -223,7 +223,8 @@ AcpiDsBuildInternalObject ( ACPI_NAMESPACE_NODE, &(Op->Common.Node))); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Op->Common.Value.String, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Op->Common.Value.String, Status); return_ACPI_STATUS (Status); } } diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsutils.c b/sys/contrib/dev/acpica/components/dispatcher/dsutils.c index 41583abbf348..abd55de0c6c4 100644 --- a/sys/contrib/dev/acpica/components/dispatcher/dsutils.c +++ b/sys/contrib/dev/acpica/components/dispatcher/dsutils.c @@ -732,7 +732,8 @@ AcpiDsCreateOperand ( if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (NameString, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + NameString, Status); } } diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswload.c b/sys/contrib/dev/acpica/components/dispatcher/dswload.c index 2ac3d6d02504..60a4e301822f 100644 --- a/sys/contrib/dev/acpica/components/dispatcher/dswload.c +++ b/sys/contrib/dev/acpica/components/dispatcher/dswload.c @@ -325,7 +325,7 @@ AcpiDsLoad1BeginOp ( #endif if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Path, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, Path, Status); return_ACPI_STATUS (Status); } @@ -495,7 +495,7 @@ AcpiDsLoad1BeginOp ( if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Path, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, Path, Status); return_ACPI_STATUS (Status); } } diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswload2.c b/sys/contrib/dev/acpica/components/dispatcher/dswload2.c index f0bcdba41cc0..cd691da7488f 100644 --- a/sys/contrib/dev/acpica/components/dispatcher/dswload2.c +++ b/sys/contrib/dev/acpica/components/dispatcher/dswload2.c @@ -304,10 +304,12 @@ AcpiDsLoad2BeginOp ( } else { - ACPI_ERROR_NAMESPACE (BufferPtr, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + BufferPtr, Status); } #else - ACPI_ERROR_NAMESPACE (BufferPtr, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + BufferPtr, Status); #endif return_ACPI_STATUS (Status); } @@ -462,7 +464,8 @@ AcpiDsLoad2BeginOp ( if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (BufferPtr, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + BufferPtr, Status); return_ACPI_STATUS (Status); } @@ -844,7 +847,8 @@ AcpiDsLoad2EndOp ( } else { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.String, Status); } break; diff --git a/sys/contrib/dev/acpica/components/events/evregion.c b/sys/contrib/dev/acpica/components/events/evregion.c index ac2adc64c255..7cdd634217d1 100644 --- a/sys/contrib/dev/acpica/components/events/evregion.c +++ b/sys/contrib/dev/acpica/components/events/evregion.c @@ -423,6 +423,17 @@ AcpiEvAddressSpaceDispatch ( { ACPI_EXCEPTION ((AE_INFO, Status, "Returned by Handler for [%s]", AcpiUtGetRegionName (RegionObj->Region.SpaceId))); + + /* + * Special case for an EC timeout. These are seen so frequently + * that an additional error message is helpful + */ + if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) && + (Status == AE_TIME)) + { + ACPI_ERROR ((AE_INFO, + "Timeout from EC hardware or EC device driver")); + } } if (!(HandlerDesc->AddressSpace.HandlerFlags & diff --git a/sys/contrib/dev/acpica/components/namespace/nsconvert.c b/sys/contrib/dev/acpica/components/namespace/nsconvert.c index 75214ba8d45e..1f8b87401046 100644 --- a/sys/contrib/dev/acpica/components/namespace/nsconvert.c +++ b/sys/contrib/dev/acpica/components/namespace/nsconvert.c @@ -644,7 +644,8 @@ AcpiNsConvertToReference ( { /* Check if we are resolving a named reference within a package */ - ACPI_ERROR_NAMESPACE (OriginalObject->String.Pointer, Status); + ACPI_ERROR_NAMESPACE (&ScopeInfo, + OriginalObject->String.Pointer, Status); goto ErrorExit; } diff --git a/sys/contrib/dev/acpica/components/namespace/nsnames.c b/sys/contrib/dev/acpica/components/namespace/nsnames.c index f122729b9bee..389c83d28e76 100644 --- a/sys/contrib/dev/acpica/components/namespace/nsnames.c +++ b/sys/contrib/dev/acpica/components/namespace/nsnames.c @@ -158,6 +158,12 @@ #define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsnames") +/* Local Prototypes */ + +static void +AcpiNsNormalizePathname ( + char *OriginalPath); + /******************************************************************************* * @@ -507,3 +513,169 @@ AcpiNsGetNormalizedPathname ( return_PTR (NameBuffer); } + + +/******************************************************************************* + * + * FUNCTION: AcpiNsBuildPrefixedPathname + * + * PARAMETERS: PrefixScope - Scope/Path that prefixes the internal path + * InternalPath - Name or path of the namespace node + * + * RETURN: None + * + * DESCRIPTION: Construct a fully qualified pathname from a concatenation of: + * 1) Path associated with the PrefixScope namespace node + * 2) External path representation of the Internal path + * + ******************************************************************************/ + +char * +AcpiNsBuildPrefixedPathname ( + ACPI_GENERIC_STATE *PrefixScope, + const char *InternalPath) +{ + ACPI_STATUS Status; + char *FullPath = NULL; + char *ExternalPath = NULL; + char *PrefixPath = NULL; + UINT32 PrefixPathLength = 0; + + + /* If there is a prefix, get the pathname to it */ + + if (PrefixScope && PrefixScope->Scope.Node) + { + PrefixPath = AcpiNsGetNormalizedPathname (PrefixScope->Scope.Node, TRUE); + if (PrefixPath) + { + PrefixPathLength = strlen (PrefixPath); + } + } + + Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, InternalPath, + NULL, &ExternalPath); + if (ACPI_FAILURE (Status)) + { + goto Cleanup; + } + + /* Merge the prefix path and the path. 2 is for one dot and trailing null */ + + FullPath = ACPI_ALLOCATE_ZEROED ( + PrefixPathLength + strlen (ExternalPath) + 2); + if (!FullPath) + { + goto Cleanup; + } + + /* Don't merge if the External path is already fully qualified */ + + if (PrefixPath && + (*ExternalPath != '\\') && + (*ExternalPath != '^')) + { + strcat (FullPath, PrefixPath); + if (PrefixPath[1]) + { + strcat (FullPath, "."); + } + } + + AcpiNsNormalizePathname (ExternalPath); + strcat (FullPath, ExternalPath); + +Cleanup: + if (PrefixPath) + { + ACPI_FREE (PrefixPath); + } + if (ExternalPath) + { + ACPI_FREE (ExternalPath); + } + + return (FullPath); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsNormalizePathname + * + * PARAMETERS: OriginalPath - Path to be normalized, in External format + * + * RETURN: The original path is processed in-place + * + * DESCRIPTION: Remove trailing underscores from each element of a path. + * + * For example: \A___.B___.C___ becomes \A.B.C + * + ******************************************************************************/ + +static void +AcpiNsNormalizePathname ( + char *OriginalPath) +{ + char *InputPath = OriginalPath; + char *NewPathBuffer; + char *NewPath; + UINT32 i; + + + /* Allocate a temp buffer in which to construct the new path */ + + NewPathBuffer = ACPI_ALLOCATE_ZEROED (strlen (InputPath) + 1); + NewPath = NewPathBuffer; + if (!NewPathBuffer) + { + return; + } + + /* Special characters may appear at the beginning of the path */ + + if (*InputPath == '\\') + { + *NewPath = *InputPath; + NewPath++; + InputPath++; + } + + while (*InputPath == '^') + { + *NewPath = *InputPath; + NewPath++; + InputPath++; + } + + /* Remainder of the path */ + + while (*InputPath) + { + /* Do one nameseg at a time */ + + for (i = 0; (i < ACPI_NAME_SIZE) && *InputPath; i++) + { + if ((i == 0) || (*InputPath != '_')) /* First char is allowed to be underscore */ + { + *NewPath = *InputPath; + NewPath++; + } + + InputPath++; + } + + /* Dot means that there are more namesegs to come */ + + if (*InputPath == '.') + { + *NewPath = *InputPath; + NewPath++; + InputPath++; + } + } + + *NewPath = 0; + strcpy (OriginalPath, NewPathBuffer); + ACPI_FREE (NewPathBuffer); +} diff --git a/sys/contrib/dev/acpica/components/parser/psargs.c b/sys/contrib/dev/acpica/components/parser/psargs.c index 32dd906748a6..7bf286c0206a 100644 --- a/sys/contrib/dev/acpica/components/parser/psargs.c +++ b/sys/contrib/dev/acpica/components/parser/psargs.c @@ -500,7 +500,7 @@ AcpiPsGetNextNamepath ( if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Path, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, Path, Status); if ((WalkState->ParseFlags & ACPI_PARSE_MODE_MASK) == ACPI_PARSE_EXECUTE) diff --git a/sys/contrib/dev/acpica/components/utilities/utdecode.c b/sys/contrib/dev/acpica/components/utilities/utdecode.c index 726853de1239..d77c71f6f503 100644 --- a/sys/contrib/dev/acpica/components/utilities/utdecode.c +++ b/sys/contrib/dev/acpica/components/utilities/utdecode.c @@ -558,11 +558,6 @@ AcpiUtGetReferenceName ( } -#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) -/* - * Strings and procedures used for debug only - */ - /******************************************************************************* * * FUNCTION: AcpiUtGetMutexName @@ -601,6 +596,12 @@ AcpiUtGetMutexName ( } +#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) + +/* + * Strings and procedures used for debug only + */ + /******************************************************************************* * * FUNCTION: AcpiUtGetNotifyName diff --git a/sys/contrib/dev/acpica/components/utilities/uterror.c b/sys/contrib/dev/acpica/components/utilities/uterror.c index d386637d0ca7..3b72808f67e1 100644 --- a/sys/contrib/dev/acpica/components/utilities/uterror.c +++ b/sys/contrib/dev/acpica/components/utilities/uterror.c @@ -311,6 +311,82 @@ AcpiUtPredefinedBiosError ( } +/******************************************************************************* + * + * FUNCTION: AcpiUtPrefixedNamespaceError + * + * PARAMETERS: ModuleName - Caller's module name (for error output) + * LineNumber - Caller's line number (for error output) + * PrefixScope - Scope/Path that prefixes the internal path + * InternalPath - Name or path of the namespace node + * LookupStatus - Exception code from NS lookup + * + * RETURN: None + * + * DESCRIPTION: Print error message with the full pathname constructed this way: + * + * PrefixScopeNodeFullPath.ExternalizedInternalPath + * + * NOTE: 10/2017: Treat the major NsLookup errors as firmware errors + * + ******************************************************************************/ + +void +AcpiUtPrefixedNamespaceError ( + const char *ModuleName, + UINT32 LineNumber, + ACPI_GENERIC_STATE *PrefixScope, + const char *InternalPath, + ACPI_STATUS LookupStatus) +{ + char *FullPath; + const char *Message; + + + /* + * Main cases: + * 1) Object creation, object must not already exist + * 2) Object lookup, object must exist + */ + switch (LookupStatus) + { + case AE_ALREADY_EXISTS: + + AcpiOsPrintf (ACPI_MSG_BIOS_ERROR); + Message = "Failure creating"; + break; + + case AE_NOT_FOUND: + + AcpiOsPrintf (ACPI_MSG_BIOS_ERROR); + Message = "Failure looking up"; + break; + + default: + + AcpiOsPrintf (ACPI_MSG_ERROR); + Message = "Failure looking up"; + break; + } + + /* Concatenate the prefix path and the internal path */ + + FullPath = AcpiNsBuildPrefixedPathname (PrefixScope, InternalPath); + + AcpiOsPrintf ("%s [%s], %s", Message, + FullPath ? FullPath : "Could not get pathname", + AcpiFormatException (LookupStatus)); + + if (FullPath) + { + ACPI_FREE (FullPath); + } + + ACPI_MSG_SUFFIX; +} + + +#ifdef __OBSOLETE_FUNCTION /******************************************************************************* * * FUNCTION: AcpiUtNamespaceError @@ -378,7 +454,7 @@ AcpiUtNamespaceError ( ACPI_MSG_SUFFIX; ACPI_MSG_REDIRECT_END; } - +#endif /******************************************************************************* * diff --git a/sys/contrib/dev/acpica/components/utilities/utmutex.c b/sys/contrib/dev/acpica/components/utilities/utmutex.c index 26160e59b2d9..40c0118e5336 100644 --- a/sys/contrib/dev/acpica/components/utilities/utmutex.c +++ b/sys/contrib/dev/acpica/components/utilities/utmutex.c @@ -432,8 +432,8 @@ AcpiUtAcquireMutex ( else { ACPI_EXCEPTION ((AE_INFO, Status, - "Thread %u could not acquire Mutex [0x%X]", - (UINT32) ThisThreadId, MutexId)); + "Thread %u could not acquire Mutex [%s] (0x%X)", + (UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId), MutexId)); } return (Status); @@ -473,7 +473,8 @@ AcpiUtReleaseMutex ( if (AcpiGbl_MutexInfo[MutexId].ThreadId == ACPI_MUTEX_NOT_ACQUIRED) { ACPI_ERROR ((AE_INFO, - "Mutex [0x%X] is not acquired, cannot release", MutexId)); + "Mutex [%s] (0x%X) is not acquired, cannot release", + AcpiUtGetMutexName (MutexId), MutexId)); return (AE_NOT_ACQUIRED); } diff --git a/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c b/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c index 667591e94541..00d4cd690138 100644 --- a/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c +++ b/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c @@ -167,13 +167,13 @@ AcpiUtInsertDigit ( static ACPI_STATUS AcpiUtStrtoulMultiply64 ( UINT64 Multiplicand, - UINT64 Multiplier, + UINT32 Base, UINT64 *OutProduct); static ACPI_STATUS AcpiUtStrtoulAdd64 ( UINT64 Addend1, - UINT64 Addend2, + UINT32 Digit, UINT64 *OutSum); @@ -518,7 +518,7 @@ AcpiUtInsertDigit ( * FUNCTION: AcpiUtStrtoulMultiply64 * * PARAMETERS: Multiplicand - Current accumulated converted integer - * Multiplier - Base/Radix + * Base - Base/Radix * OutProduct - Where the product is returned * * RETURN: Status and 64-bit product @@ -532,28 +532,36 @@ AcpiUtInsertDigit ( static ACPI_STATUS AcpiUtStrtoulMultiply64 ( UINT64 Multiplicand, - UINT64 Multiplier, + UINT32 Base, UINT64 *OutProduct) { UINT64 Product; + UINT64 Quotient; /* Exit if either operand is zero */ *OutProduct = 0; - if (!Multiplicand || !Multiplier) + if (!Multiplicand || !Base) { return (AE_OK); } - /* Check for 64-bit overflow before the actual multiplication */ - - if (Multiplicand > (ACPI_UINT64_MAX / Multiplier)) + /* + * Check for 64-bit overflow before the actual multiplication. + * + * Notes: 64-bit division is often not supported on 32-bit platforms + * (it requires a library function), Therefore ACPICA has a local + * 64-bit divide function. Also, Multiplier is currently only used + * as the radix (8/10/16), to the 64/32 divide will always work. + */ + AcpiUtShortDivide (ACPI_UINT64_MAX, Base, &Quotient, NULL); + if (Multiplicand > Quotient) { return (AE_NUMERIC_OVERFLOW); } - Product = Multiplicand * Multiplier; + Product = Multiplicand * Base; /* Check for 32-bit overflow if necessary */ @@ -572,7 +580,7 @@ AcpiUtStrtoulMultiply64 ( * FUNCTION: AcpiUtStrtoulAdd64 * * PARAMETERS: Addend1 - Current accumulated converted integer - * Addend2 - New hex value/char + * Digit - New hex value/char * OutSum - Where sum is returned (Accumulator) * * RETURN: Status and 64-bit sum @@ -586,7 +594,7 @@ AcpiUtStrtoulMultiply64 ( static ACPI_STATUS AcpiUtStrtoulAdd64 ( UINT64 Addend1, - UINT64 Addend2, + UINT32 Digit, UINT64 *OutSum) { UINT64 Sum; @@ -594,12 +602,12 @@ AcpiUtStrtoulAdd64 ( /* Check for 64-bit overflow before the actual addition */ - if ((Addend1 > 0) && (Addend2 > (ACPI_UINT64_MAX - Addend1))) + if ((Addend1 > 0) && (Digit > (ACPI_UINT64_MAX - Addend1))) { return (AE_NUMERIC_OVERFLOW); } - Sum = Addend1 + Addend2; + Sum = Addend1 + Digit; /* Check for 32-bit overflow if necessary */ diff --git a/sys/contrib/dev/acpica/components/utilities/uttrack.c b/sys/contrib/dev/acpica/components/utilities/uttrack.c index 41538b5ea82a..63b41fea5957 100644 --- a/sys/contrib/dev/acpica/components/utilities/uttrack.c +++ b/sys/contrib/dev/acpica/components/utilities/uttrack.c @@ -891,7 +891,7 @@ AcpiUtDumpAllocations ( } else { - ACPI_ERROR ((AE_INFO, "%u(0x%X) Outstanding allocations", + ACPI_ERROR ((AE_INFO, "%u (0x%X) Outstanding cache allocations", NumOutstanding, NumOutstanding)); } diff --git a/sys/contrib/dev/acpica/components/utilities/utxferror.c b/sys/contrib/dev/acpica/components/utilities/utxferror.c index 9c1799ca102f..75eea317c7b7 100644 --- a/sys/contrib/dev/acpica/components/utilities/utxferror.c +++ b/sys/contrib/dev/acpica/components/utilities/utxferror.c @@ -214,8 +214,8 @@ ACPI_EXPORT_SYMBOL (AcpiError) * * RETURN: None * - * DESCRIPTION: Print "ACPI Exception" message with module/line/version info - * and decoded ACPI_STATUS. + * DESCRIPTION: Print an "ACPI Error" message with module/line/version + * info as well as decoded ACPI_STATUS. * ******************************************************************************/ @@ -236,12 +236,12 @@ AcpiException ( if (ACPI_SUCCESS (Status)) { - AcpiOsPrintf (ACPI_MSG_EXCEPTION); + AcpiOsPrintf (ACPI_MSG_ERROR); } else { - AcpiOsPrintf (ACPI_MSG_EXCEPTION "%s, ", + AcpiOsPrintf (ACPI_MSG_ERROR "%s, ", AcpiFormatException (Status)); } diff --git a/sys/contrib/dev/acpica/include/acdebug.h b/sys/contrib/dev/acpica/include/acdebug.h index ae176c219e03..0a278415a5e5 100644 --- a/sys/contrib/dev/acpica/include/acdebug.h +++ b/sys/contrib/dev/acpica/include/acdebug.h @@ -451,6 +451,12 @@ AcpiDbExecute ( ACPI_OBJECT_TYPE *Types, UINT32 Flags); +void +AcpiDbCreateExecutionThread ( + char *MethodNameArg, + char **Arguments, + ACPI_OBJECT_TYPE *Types); + void AcpiDbCreateExecutionThreads ( char *NumThreadsArg, diff --git a/sys/contrib/dev/acpica/include/acdisasm.h b/sys/contrib/dev/acpica/include/acdisasm.h index a6f8cfdc7653..5f2030eb38c4 100644 --- a/sys/contrib/dev/acpica/include/acdisasm.h +++ b/sys/contrib/dev/acpica/include/acdisasm.h @@ -504,6 +504,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit4[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit5[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit6[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit6a[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit7[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPdtt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt0[]; diff --git a/sys/contrib/dev/acpica/include/aclocal.h b/sys/contrib/dev/acpica/include/aclocal.h index 7a20fe6fca66..5ad319024ad9 100644 --- a/sys/contrib/dev/acpica/include/aclocal.h +++ b/sys/contrib/dev/acpica/include/aclocal.h @@ -1532,16 +1532,17 @@ typedef struct acpi_db_method_info ACPI_OBJECT_TYPE *Types; /* - * Arguments to be passed to method for the command - * Threads - - * the Number of threads, ID of current thread and - * Index of current thread inside all them created. + * Arguments to be passed to method for the commands Threads and + * Background. Note, ACPI specifies a maximum of 7 arguments (0 - 6). + * + * For the Threads command, the Number of threads, ID of current + * thread and Index of current thread inside all them created. */ char InitArgs; #ifdef ACPI_DEBUGGER - ACPI_OBJECT_TYPE ArgTypes[4]; + ACPI_OBJECT_TYPE ArgTypes[ACPI_METHOD_NUM_ARGS]; #endif - char *Arguments[4]; + char *Arguments[ACPI_METHOD_NUM_ARGS]; char NumThreadsStr[11]; char IdOfThreadStr[11]; char IndexOfThreadStr[11]; diff --git a/sys/contrib/dev/acpica/include/acmacros.h b/sys/contrib/dev/acpica/include/acmacros.h index 9d7ed06d5ddc..feb45937e141 100644 --- a/sys/contrib/dev/acpica/include/acmacros.h +++ b/sys/contrib/dev/acpica/include/acmacros.h @@ -567,7 +567,7 @@ * the plist contains a set of parens to allow variable-length lists. * These macros are used for both the debug and non-debug versions of the code. */ -#define ACPI_ERROR_NAMESPACE(s, e) AcpiUtNamespaceError (AE_INFO, s, e); +#define ACPI_ERROR_NAMESPACE(s, p, e) AcpiUtPrefixedNamespaceError (AE_INFO, s, p, e); #define ACPI_ERROR_METHOD(s, n, p, e) AcpiUtMethodError (AE_INFO, s, n, p, e); #define ACPI_WARN_PREDEFINED(plist) AcpiUtPredefinedWarning plist #define ACPI_INFO_PREDEFINED(plist) AcpiUtPredefinedInfo plist diff --git a/sys/contrib/dev/acpica/include/acnamesp.h b/sys/contrib/dev/acpica/include/acnamesp.h index 990309ebfb27..43402719a7d8 100644 --- a/sys/contrib/dev/acpica/include/acnamesp.h +++ b/sys/contrib/dev/acpica/include/acnamesp.h @@ -488,6 +488,11 @@ AcpiNsGetNormalizedPathname ( ACPI_NAMESPACE_NODE *Node, BOOLEAN NoTrailing); +char * +AcpiNsBuildPrefixedPathname ( + ACPI_GENERIC_STATE *PrefixScope, + const char *InternalPath); + char * AcpiNsNameOfCurrentScope ( ACPI_WALK_STATE *WalkState); diff --git a/sys/contrib/dev/acpica/include/acpixf.h b/sys/contrib/dev/acpica/include/acpixf.h index 38981a0ffa60..3801fab7d84e 100644 --- a/sys/contrib/dev/acpica/include/acpixf.h +++ b/sys/contrib/dev/acpica/include/acpixf.h @@ -154,7 +154,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20170929 +#define ACPI_CA_VERSION 0x20171110 #include #include diff --git a/sys/contrib/dev/acpica/include/actbl1.h b/sys/contrib/dev/acpica/include/actbl1.h index 7eed2c5507ae..6d0f5c85b7b6 100644 --- a/sys/contrib/dev/acpica/include/actbl1.h +++ b/sys/contrib/dev/acpica/include/actbl1.h @@ -1449,7 +1449,8 @@ enum AcpiNfitType ACPI_NFIT_TYPE_CONTROL_REGION = 4, ACPI_NFIT_TYPE_DATA_REGION = 5, ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6, - ACPI_NFIT_TYPE_RESERVED = 7 /* 7 and greater are reserved */ + ACPI_NFIT_TYPE_CAPABILITIES = 7, + ACPI_NFIT_TYPE_RESERVED = 8 /* 8 and greater are reserved */ }; /* @@ -1463,7 +1464,7 @@ typedef struct acpi_nfit_system_address ACPI_NFIT_HEADER Header; UINT16 RangeIndex; UINT16 Flags; - UINT32 Reserved; /* Reseved, must be zero */ + UINT32 Reserved; /* Reserved, must be zero */ UINT32 ProximityDomain; UINT8 RangeGuid[16]; UINT64 Address; @@ -1602,6 +1603,75 @@ typedef struct acpi_nfit_flush_address } ACPI_NFIT_FLUSH_ADDRESS; +/* 7: Platform Capabilities Structure */ + +typedef struct acpi_nfit_capabilities +{ + ACPI_NFIT_HEADER Header; + UINT8 HighestCapability; + UINT8 Reserved[3]; /* Reserved, must be zero */ + UINT32 Capabilities; + UINT32 Reserved2; + +} ACPI_NFIT_CAPABILITIES; + +/* Capabilities Flags */ + +#define ACPI_NFIT_CAPABILITY_CACHE_FLUSH (1) /* 00: Cache Flush to NVDIMM capable */ +#define ACPI_NFIT_CAPABILITY_MEM_FLUSH (1<<1) /* 01: Memory Flush to NVDIMM capable */ +#define ACPI_NFIT_CAPABILITY_MEM_MIRRORING (1<<2) /* 02: Memory Mirroring capable */ + + +/* + * NFIT/DVDIMM device handle support - used as the _ADR for each NVDIMM + */ +typedef struct nfit_device_handle +{ + UINT32 Handle; + +} NFIT_DEVICE_HANDLE; + +/* Device handle construction and extraction macros */ + +#define ACPI_NFIT_DIMM_NUMBER_MASK 0x0000000F +#define ACPI_NFIT_CHANNEL_NUMBER_MASK 0x000000F0 +#define ACPI_NFIT_MEMORY_ID_MASK 0x00000F00 +#define ACPI_NFIT_SOCKET_ID_MASK 0x0000F000 +#define ACPI_NFIT_NODE_ID_MASK 0x0FFF0000 + +#define ACPI_NFIT_DIMM_NUMBER_OFFSET 0 +#define ACPI_NFIT_CHANNEL_NUMBER_OFFSET 4 +#define ACPI_NFIT_MEMORY_ID_OFFSET 8 +#define ACPI_NFIT_SOCKET_ID_OFFSET 12 +#define ACPI_NFIT_NODE_ID_OFFSET 16 + +/* Macro to construct a NFIT/NVDIMM device handle */ + +#define ACPI_NFIT_BUILD_DEVICE_HANDLE(dimm, channel, memory, socket, node) \ + ((dimm) | \ + ((channel) << ACPI_NFIT_CHANNEL_NUMBER_OFFSET) | \ + ((memory) << ACPI_NFIT_MEMORY_ID_OFFSET) | \ + ((socket) << ACPI_NFIT_SOCKET_ID_OFFSET) | \ + ((node) << ACPI_NFIT_NODE_ID_OFFSET)) + +/* Macros to extract individual fields from a NFIT/NVDIMM device handle */ + +#define ACPI_NFIT_GET_DIMM_NUMBER(handle) \ + ((handle) & ACPI_NFIT_DIMM_NUMBER_MASK) + +#define ACPI_NFIT_GET_CHANNEL_NUMBER(handle) \ + (((handle) & ACPI_NFIT_CHANNEL_NUMBER_MASK) >> ACPI_NFIT_CHANNEL_NUMBER_OFFSET) + +#define ACPI_NFIT_GET_MEMORY_ID(handle) \ + (((handle) & ACPI_NFIT_MEMORY_ID_MASK) >> ACPI_NFIT_MEMORY_ID_OFFSET) + +#define ACPI_NFIT_GET_SOCKET_ID(handle) \ + (((handle) & ACPI_NFIT_SOCKET_ID_MASK) >> ACPI_NFIT_SOCKET_ID_OFFSET) + +#define ACPI_NFIT_GET_NODE_ID(handle) \ + (((handle) & ACPI_NFIT_NODE_ID_MASK) >> ACPI_NFIT_NODE_ID_OFFSET) + + /******************************************************************************* * * PDTT - Platform Debug Trigger Table (ACPI 6.2) @@ -1634,7 +1704,7 @@ typedef struct acpi_pdtt_channel /* Flags for above */ #define ACPI_PDTT_RUNTIME_TRIGGER (1) -#define ACPI_PPTT_WAIT_COMPLETION (1<<1) +#define ACPI_PDTT_WAIT_COMPLETION (1<<1) /******************************************************************************* @@ -1712,6 +1782,19 @@ typedef struct acpi_pptt_cache #define ACPI_PPTT_MASK_CACHE_TYPE (0x0C) /* Cache type */ #define ACPI_PPTT_MASK_WRITE_POLICY (0x10) /* Write policy */ +/* Attributes describing cache */ +#define ACPI_PPTT_CACHE_READ_ALLOCATE (0x0) /* Cache line is allocated on read */ +#define ACPI_PPTT_CACHE_WRITE_ALLOCATE (0x01) /* Cache line is allocated on write */ +#define ACPI_PPTT_CACHE_RW_ALLOCATE (0x02) /* Cache line is allocated on read and write */ +#define ACPI_PPTT_CACHE_RW_ALLOCATE_ALT (0x03) /* Alternate representation of above */ + +#define ACPI_PPTT_CACHE_TYPE_DATA (0x0) /* Data cache */ +#define ACPI_PPTT_CACHE_TYPE_INSTR (1<<2) /* Instruction cache */ +#define ACPI_PPTT_CACHE_TYPE_UNIFIED (2<<2) /* Unified I & D cache */ +#define ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT (3<<2) /* Alternate representation of above */ + +#define ACPI_PPTT_CACHE_POLICY_WB (0x0) /* Cache is write back */ +#define ACPI_PPTT_CACHE_POLICY_WT (1<<4) /* Cache is write through */ /* 2: ID Structure */ diff --git a/sys/contrib/dev/acpica/include/actbl2.h b/sys/contrib/dev/acpica/include/actbl2.h index 02a897b0fb19..cdf7ac06d728 100644 --- a/sys/contrib/dev/acpica/include/actbl2.h +++ b/sys/contrib/dev/acpica/include/actbl2.h @@ -1048,6 +1048,7 @@ typedef struct acpi_iort_smmu_v3 UINT8 Pxm; UINT8 Reserved1; UINT16 Reserved2; + UINT32 IdMappingIndex; } ACPI_IORT_SMMU_V3; diff --git a/sys/contrib/dev/acpica/include/acutils.h b/sys/contrib/dev/acpica/include/acutils.h index ef71050c25f9..fbfdc898c9ca 100644 --- a/sys/contrib/dev/acpica/include/acutils.h +++ b/sys/contrib/dev/acpica/include/acutils.h @@ -227,9 +227,6 @@ extern const char *AcpiGbl_PtypDecode[]; #ifndef ACPI_MSG_ERROR #define ACPI_MSG_ERROR "ACPI Error: " #endif -#ifndef ACPI_MSG_EXCEPTION -#define ACPI_MSG_EXCEPTION "ACPI Exception: " -#endif #ifndef ACPI_MSG_WARNING #define ACPI_MSG_WARNING "ACPI Warning: " #endif @@ -238,10 +235,10 @@ extern const char *AcpiGbl_PtypDecode[]; #endif #ifndef ACPI_MSG_BIOS_ERROR -#define ACPI_MSG_BIOS_ERROR "ACPI BIOS Error (bug): " +#define ACPI_MSG_BIOS_ERROR "Firmware Error (ACPI): " #endif #ifndef ACPI_MSG_BIOS_WARNING -#define ACPI_MSG_BIOS_WARNING "ACPI BIOS Warning (bug): " +#define ACPI_MSG_BIOS_WARNING "Firmware Warning (ACPI): " #endif /* @@ -394,12 +391,12 @@ ACPI_STATUS AcpiUtInitGlobals ( void); -#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) - const char * AcpiUtGetMutexName ( UINT32 MutexId); +#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) + const char * AcpiUtGetNotifyName ( UINT32 NotifyValue, @@ -1215,9 +1212,10 @@ AcpiUtPredefinedBiosError ( ...); void -AcpiUtNamespaceError ( +AcpiUtPrefixedNamespaceError ( const char *ModuleName, UINT32 LineNumber, + ACPI_GENERIC_STATE *PrefixScope, const char *InternalName, ACPI_STATUS LookupStatus); diff --git a/sys/contrib/octeon-sdk/cvmx-app-init.h b/sys/contrib/octeon-sdk/cvmx-app-init.h index 9870a6f0d0f1..b005627898db 100644 --- a/sys/contrib/octeon-sdk/cvmx-app-init.h +++ b/sys/contrib/octeon-sdk/cvmx-app-init.h @@ -311,7 +311,7 @@ enum cvmx_board_types_enum { #endif #if defined(OCTEON_VENDOR_UBIQUITI) CVMX_BOARD_TYPE_CUST_UBIQUITI_E100=20002, - CVMX_BOARD_TYPE_CUST_UBIQUITI_USG= 20004, + CVMX_BOARD_TYPE_CUST_UBIQUITI_E110= 20004, #endif #if defined(OCTEON_VENDOR_RADISYS) CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE=20002, @@ -458,7 +458,7 @@ static inline const char *cvmx_board_type_to_string(enum cvmx_board_types_enum t #endif #if defined(OCTEON_VENDOR_UBIQUITI) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_UBIQUITI_E100) - ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_UBIQUITI_USG) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_UBIQUITI_E110) #endif #if defined(OCTEON_VENDOR_RADISYS) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE) diff --git a/sys/contrib/octeon-sdk/cvmx-helper-board.c b/sys/contrib/octeon-sdk/cvmx-helper-board.c index b7375e55cdf9..2c501ffae9f3 100644 --- a/sys/contrib/octeon-sdk/cvmx-helper-board.c +++ b/sys/contrib/octeon-sdk/cvmx-helper-board.c @@ -598,7 +598,7 @@ int cvmx_helper_board_get_mii_address(int ipd_port) #endif #if defined(OCTEON_VENDOR_UBIQUITI) case CVMX_BOARD_TYPE_CUST_UBIQUITI_E100: - case CVMX_BOARD_TYPE_CUST_UBIQUITI_USG: + case CVMX_BOARD_TYPE_CUST_UBIQUITI_E110: if (ipd_port > 2) return -1; return (7 - ipd_port); @@ -1501,7 +1501,7 @@ int __cvmx_helper_board_hardware_enable(int interface) } #if defined(OCTEON_VENDOR_UBIQUITI) else if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_CUST_UBIQUITI_E100 || - cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_CUST_UBIQUITI_USG) + cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_CUST_UBIQUITI_E110) { /* Configure ASX cloks for all ports on interface 0. */ if (interface == 0) @@ -1592,7 +1592,7 @@ cvmx_helper_board_usb_clock_types_t __cvmx_helper_board_usb_get_clock_type(void) #endif #if defined(OCTEON_VENDOR_UBIQUITI) case CVMX_BOARD_TYPE_CUST_UBIQUITI_E100: - case CVMX_BOARD_TYPE_CUST_UBIQUITI_USG: + case CVMX_BOARD_TYPE_CUST_UBIQUITI_E110: #endif #if defined(OCTEON_BOARD_CAPK_0100ND) case CVMX_BOARD_TYPE_CN3010_EVB_HS5: diff --git a/contrib/zstd/.buckconfig b/sys/contrib/zstd/.buckconfig similarity index 100% rename from contrib/zstd/.buckconfig rename to sys/contrib/zstd/.buckconfig diff --git a/contrib/zstd/.buckversion b/sys/contrib/zstd/.buckversion similarity index 100% rename from contrib/zstd/.buckversion rename to sys/contrib/zstd/.buckversion diff --git a/contrib/zstd/.gitattributes b/sys/contrib/zstd/.gitattributes similarity index 100% rename from contrib/zstd/.gitattributes rename to sys/contrib/zstd/.gitattributes diff --git a/contrib/zstd/CONTRIBUTING.md b/sys/contrib/zstd/CONTRIBUTING.md similarity index 100% rename from contrib/zstd/CONTRIBUTING.md rename to sys/contrib/zstd/CONTRIBUTING.md diff --git a/sys/contrib/zstd/COPYING b/sys/contrib/zstd/COPYING new file mode 100644 index 000000000000..ecbc0593737b --- /dev/null +++ b/sys/contrib/zstd/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. \ No newline at end of file diff --git a/contrib/zstd/LICENSE b/sys/contrib/zstd/LICENSE similarity index 100% rename from contrib/zstd/LICENSE rename to sys/contrib/zstd/LICENSE diff --git a/contrib/zstd/Makefile b/sys/contrib/zstd/Makefile similarity index 86% rename from contrib/zstd/Makefile rename to sys/contrib/zstd/Makefile index a72f99fcb9d2..2805c8ad4b54 100644 --- a/contrib/zstd/Makefile +++ b/sys/contrib/zstd/Makefile @@ -1,10 +1,10 @@ # ################################################################ -# Copyright (c) 2016-present, Yann Collet, Facebook, Inc. +# Copyright (c) 2015-present, Yann Collet, Facebook, Inc. # All rights reserved. # -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. An additional grant -# of patent rights can be found in the PATENTS file in the same directory. +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). # ################################################################ PRGDIR = programs @@ -12,6 +12,7 @@ ZSTDDIR = lib BUILDIR = build ZWRAPDIR = zlibWrapper TESTDIR = tests +FUZZDIR = $(TESTDIR)/fuzz # Define nul output VOID = /dev/null @@ -29,15 +30,12 @@ default: lib-release zstd-release all: | allmost examples manual .PHONY: allmost -allmost: - $(MAKE) -C $(ZSTDDIR) all - $(MAKE) -C $(PRGDIR) all - $(MAKE) -C $(TESTDIR) all +allmost: allzstd $(MAKE) -C $(ZWRAPDIR) all #skip zwrapper, can't build that on alternate architectures without the proper zlib installed -.PHONY: allarch -allarch: +.PHONY: allzstd +allzstd: $(MAKE) -C $(ZSTDDIR) all $(MAKE) -C $(PRGDIR) all $(MAKE) -C $(TESTDIR) all @@ -100,6 +98,7 @@ clean: @$(MAKE) -C examples/ $@ > $(VOID) @$(MAKE) -C contrib/gen_html $@ > $(VOID) @$(RM) zstd$(EXT) zstdmt$(EXT) tmp* + @$(RM) -r lz4 @echo Cleaning completed #------------------------------------------------------------------------------ @@ -114,7 +113,7 @@ CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_B list: @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs -.PHONY: install clangtest gpptest armtest usan asan uasan +.PHONY: install clangtest armtest usan asan uasan install: @$(MAKE) -C $(ZSTDDIR) $@ @$(MAKE) -C $(PRGDIR) $@ @@ -158,16 +157,16 @@ m32build: clean $(MAKE) all32 armbuild: clean - CC=arm-linux-gnueabi-gcc CFLAGS="-Werror" $(MAKE) allarch + CC=arm-linux-gnueabi-gcc CFLAGS="-Werror" $(MAKE) allzstd aarch64build: clean - CC=aarch64-linux-gnu-gcc CFLAGS="-Werror" $(MAKE) allarch + CC=aarch64-linux-gnu-gcc CFLAGS="-Werror" $(MAKE) allzstd ppcbuild: clean - CC=powerpc-linux-gnu-gcc CLAGS="-m32 -Wno-attributes -Werror" $(MAKE) allarch + CC=powerpc-linux-gnu-gcc CLAGS="-m32 -Wno-attributes -Werror" $(MAKE) allzstd ppc64build: clean - CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) allarch + CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) allzstd armfuzz: clean CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest @@ -181,8 +180,10 @@ ppcfuzz: clean ppc64fuzz: clean CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest -gpptest: clean - CC=$(CXX) $(MAKE) -C $(PRGDIR) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" +.PHONY: cxxtest +cxxtest: CXXFLAGS += -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror +cxxtest: clean + $(MAKE) -C $(PRGDIR) all CC="$(CXX) -Wno-deprecated" CFLAGS="$(CXXFLAGS)" # adding -Wno-deprecated to avoid clang++ warning on dealing with C files directly gcc5test: clean gcc-5 -v @@ -218,6 +219,15 @@ arm-ppc-compilation: $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static" $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static" +regressiontest: + $(MAKE) -C $(FUZZDIR) regressiontest + +uasanregressiontest: + $(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=address,undefined" CXXFLAGS="-O3 -fsanitize=address,undefined" + +msanregressiontest: + $(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=memory" CXXFLAGS="-O3 -fsanitize=memory" + # run UBsan with -fsanitize-recover=signed-integer-overflow # due to a bug in UBsan when doing pointer subtraction # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63303 @@ -277,6 +287,10 @@ gpp6install: apt-add-repo clang38install: APT_PACKAGES="clang-3.8" $(MAKE) apt-install +# Ubuntu 14.04 ships a too-old lz4 +lz4install: + [ -e lz4 ] || git clone https://github.com/lz4/lz4 && sudo $(MAKE) -C lz4 install + endif @@ -287,7 +301,7 @@ endif #------------------------------------------------------------------------ -#make tests validated only for MSYS, Linux, OSX, kFreeBSD and Hurd targets +# target specific tests #------------------------------------------------------------------------ ifneq (,$(filter $(HOST_OS),MSYS POSIX)) cmakebuild: @@ -297,38 +311,38 @@ cmakebuild: cd $(BUILDIR)/cmake/build ; cmake -DCMAKE_INSTALL_PREFIX:PATH=~/install_test_dir $(CMAKE_PARAMS) .. ; $(MAKE) install ; $(MAKE) uninstall c90build: clean - gcc -v + $(CC) -v CFLAGS="-std=c90" $(MAKE) allmost # will fail, due to missing support for `long long` gnu90build: clean - gcc -v + $(CC) -v CFLAGS="-std=gnu90" $(MAKE) allmost c99build: clean - gcc -v + $(CC) -v CFLAGS="-std=c99" $(MAKE) allmost gnu99build: clean - gcc -v + $(CC) -v CFLAGS="-std=gnu99" $(MAKE) allmost c11build: clean - gcc -v + $(CC) -v CFLAGS="-std=c11" $(MAKE) allmost bmix64build: clean - gcc -v + $(CC) -v CFLAGS="-O3 -mbmi -Werror" $(MAKE) -C $(TESTDIR) test bmix32build: clean - gcc -v + $(CC) -v CFLAGS="-O3 -mbmi -mx32 -Werror" $(MAKE) -C $(TESTDIR) test bmi32build: clean - gcc -v + $(CC) -v CFLAGS="-O3 -mbmi -m32 -Werror" $(MAKE) -C $(TESTDIR) test staticAnalyze: clean - gcc -v + $(CC) -v CPPFLAGS=-g scan-build --status-bugs -v $(MAKE) all endif diff --git a/contrib/zstd/NEWS b/sys/contrib/zstd/NEWS similarity index 90% rename from contrib/zstd/NEWS rename to sys/contrib/zstd/NEWS index 59687532fe22..215c0a329ba6 100644 --- a/contrib/zstd/NEWS +++ b/sys/contrib/zstd/NEWS @@ -1,3 +1,26 @@ +v1.3.2 +new : long range mode, using --long command, by Stella Lau (@stellamplau) +new : ability to generate and decode magicless frames (#591) +changed : maximum nb of threads reduced to 200, to avoid address space exhaustion in 32-bits mode +fix : multi-threading compression works with custom allocators +fix : ZSTD_sizeof_CStream() was over-evaluating memory usage +fix : a rare compression bug when compression generates very large distances and bunch of other conditions (only possible at --ultra -22) +fix : 32-bits build can now decode large offsets (levels 21+) +cli : added LZ4 frame support by default, by Felix Handte (@felixhandte) +cli : improved --list output +cli : new : can split input file for dictionary training, using command -B# +cli : new : clean operation artefact on Ctrl-C interruption +cli : fix : do not change /dev/null permissions when using command -t with root access, reported by @mike155 (#851) +cli : fix : write file size in header in multiple-files mode +api : added macro ZSTD_COMPRESSBOUND() for static allocation +api : experimental : new advanced decompression API +api : fix : sizeof_CCtx() used to over-estimate +build: fix : no-multithread variant compiles without pool.c dependency, reported by Mitchell Blank Jr (@mitchblank) (#819) +build: better compatibility with reproducible builds, by Bernhard M. Wiedemann (@bmwiedemann) (#818) +example : added streaming_memory_usage +license : changed /examples license to BSD + GPLv2 +license : fix a few header files to reflect new license (#825) + v1.3.1 New license : BSD + GPLv2 perf: substantially decreased memory usage in Multi-threading mode, thanks to reports by Tino Reichardt (@mcmilk) diff --git a/contrib/zstd/README.md b/sys/contrib/zstd/README.md similarity index 100% rename from contrib/zstd/README.md rename to sys/contrib/zstd/README.md diff --git a/contrib/zstd/TESTING.md b/sys/contrib/zstd/TESTING.md similarity index 100% rename from contrib/zstd/TESTING.md rename to sys/contrib/zstd/TESTING.md diff --git a/contrib/zstd/appveyor.yml b/sys/contrib/zstd/appveyor.yml similarity index 97% rename from contrib/zstd/appveyor.yml rename to sys/contrib/zstd/appveyor.yml index 1815563e7f5d..0f9142b4715a 100644 --- a/contrib/zstd/appveyor.yml +++ b/sys/contrib/zstd/appveyor.yml @@ -9,19 +9,19 @@ - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x64" - SCRIPT: "make allarch && make -C tests test-symbols fullbench-dll fullbench-lib" + SCRIPT: "make allzstd MOREFLAGS=-static && make -C tests test-symbols fullbench-dll fullbench-lib" ARTIFACT: "true" BUILD: "true" - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x86" - SCRIPT: "make allarch" + SCRIPT: "make allzstd MOREFLAGS=-static" ARTIFACT: "true" BUILD: "true" - COMPILER: "clang" HOST: "mingw" PLATFORM: "x64" - SCRIPT: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make allarch" + SCRIPT: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make allzstd" BUILD: "true" - COMPILER: "gcc" @@ -172,15 +172,15 @@ - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x64" - SCRIPT: "make allarch" + SCRIPT: "make allzstd" - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x86" - SCRIPT: "make allarch" + SCRIPT: "make allzstd" - COMPILER: "clang" HOST: "mingw" PLATFORM: "x64" - SCRIPT: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make allarch" + SCRIPT: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make allzstd" - COMPILER: "visual" HOST: "visual" diff --git a/contrib/zstd/circle.yml b/sys/contrib/zstd/circle.yml similarity index 89% rename from contrib/zstd/circle.yml rename to sys/contrib/zstd/circle.yml index 8c2bd30d330d..5bc0ce643204 100644 --- a/contrib/zstd/circle.yml +++ b/sys/contrib/zstd/circle.yml @@ -9,7 +9,7 @@ dependencies: test: override: - ? | - if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then cc -v; make all && make clean; fi && + if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then cc -v; make all && make clean && make -C lib libzstd-nomt && make clean; fi && if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make gnu90build && make clean; fi : parallel: true @@ -45,7 +45,7 @@ test: parallel: true - ? | if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make ppc64build && make clean; fi && - if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make gcc7build && make clean; fi #could add another test here + if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make gcc7build && make clean; fi : parallel: true - ? | @@ -53,6 +53,11 @@ test: if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make -C tests test-legacy test-longmatch test-symbols && make clean; fi : parallel: true + - ? | + if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make -j regressiontest && make clean; fi && + if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then true; fi # Could add another test here + : + parallel: true post: - echo Circle CI tests finished diff --git a/contrib/zstd/contrib/cleanTabs b/sys/contrib/zstd/contrib/cleanTabs similarity index 100% rename from contrib/zstd/contrib/cleanTabs rename to sys/contrib/zstd/contrib/cleanTabs diff --git a/contrib/zstd/contrib/gen_html/.gitignore b/sys/contrib/zstd/contrib/gen_html/.gitignore similarity index 100% rename from contrib/zstd/contrib/gen_html/.gitignore rename to sys/contrib/zstd/contrib/gen_html/.gitignore diff --git a/contrib/zstd/contrib/gen_html/Makefile b/sys/contrib/zstd/contrib/gen_html/Makefile similarity index 84% rename from contrib/zstd/contrib/gen_html/Makefile rename to sys/contrib/zstd/contrib/gen_html/Makefile index ea68b11fc568..d9b32e351273 100644 --- a/contrib/zstd/contrib/gen_html/Makefile +++ b/sys/contrib/zstd/contrib/gen_html/Makefile @@ -1,11 +1,11 @@ -# ########################################################################## +# ################################################################ # Copyright (c) 2016-present, Facebook, Inc. # All rights reserved. # -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. An additional grant -# of patent rights can be found in the PATENTS file in the same directory. -# ########################################################################## +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ CFLAGS ?= -O3 CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wno-comment diff --git a/contrib/zstd/contrib/gen_html/README.md b/sys/contrib/zstd/contrib/gen_html/README.md similarity index 100% rename from contrib/zstd/contrib/gen_html/README.md rename to sys/contrib/zstd/contrib/gen_html/README.md diff --git a/contrib/zstd/contrib/gen_html/gen-zstd-manual.sh b/sys/contrib/zstd/contrib/gen_html/gen-zstd-manual.sh similarity index 100% rename from contrib/zstd/contrib/gen_html/gen-zstd-manual.sh rename to sys/contrib/zstd/contrib/gen_html/gen-zstd-manual.sh diff --git a/contrib/zstd/contrib/gen_html/gen_html.cpp b/sys/contrib/zstd/contrib/gen_html/gen_html.cpp similarity index 96% rename from contrib/zstd/contrib/gen_html/gen_html.cpp rename to sys/contrib/zstd/contrib/gen_html/gen_html.cpp index e5261c0866d0..90d5b21a3aa6 100644 --- a/contrib/zstd/contrib/gen_html/gen_html.cpp +++ b/sys/contrib/zstd/contrib/gen_html/gen_html.cpp @@ -2,9 +2,9 @@ * Copyright (c) 2016-present, Przemyslaw Skibinski, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include diff --git a/contrib/zstd/contrib/meson/README b/sys/contrib/zstd/contrib/meson/README similarity index 100% rename from contrib/zstd/contrib/meson/README rename to sys/contrib/zstd/contrib/meson/README diff --git a/contrib/zstd/contrib/meson/meson.build b/sys/contrib/zstd/contrib/meson/meson.build similarity index 100% rename from contrib/zstd/contrib/meson/meson.build rename to sys/contrib/zstd/contrib/meson/meson.build diff --git a/contrib/zstd/contrib/meson/meson_options.txt b/sys/contrib/zstd/contrib/meson/meson_options.txt similarity index 100% rename from contrib/zstd/contrib/meson/meson_options.txt rename to sys/contrib/zstd/contrib/meson/meson_options.txt diff --git a/contrib/zstd/contrib/pzstd/.gitignore b/sys/contrib/zstd/contrib/pzstd/.gitignore similarity index 100% rename from contrib/zstd/contrib/pzstd/.gitignore rename to sys/contrib/zstd/contrib/pzstd/.gitignore diff --git a/contrib/zstd/contrib/pzstd/BUCK b/sys/contrib/zstd/contrib/pzstd/BUCK similarity index 100% rename from contrib/zstd/contrib/pzstd/BUCK rename to sys/contrib/zstd/contrib/pzstd/BUCK diff --git a/contrib/zstd/contrib/pzstd/ErrorHolder.h b/sys/contrib/zstd/contrib/pzstd/ErrorHolder.h similarity index 80% rename from contrib/zstd/contrib/pzstd/ErrorHolder.h rename to sys/contrib/zstd/contrib/pzstd/ErrorHolder.h index 188badcadfd3..829651c5961e 100644 --- a/contrib/zstd/contrib/pzstd/ErrorHolder.h +++ b/sys/contrib/zstd/contrib/pzstd/ErrorHolder.h @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once diff --git a/contrib/zstd/contrib/pzstd/Logging.h b/sys/contrib/zstd/contrib/pzstd/Logging.h similarity index 85% rename from contrib/zstd/contrib/pzstd/Logging.h rename to sys/contrib/zstd/contrib/pzstd/Logging.h index 76c982ab2a46..16a63932c0a3 100644 --- a/contrib/zstd/contrib/pzstd/Logging.h +++ b/sys/contrib/zstd/contrib/pzstd/Logging.h @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once diff --git a/contrib/zstd/contrib/pzstd/Makefile b/sys/contrib/zstd/contrib/pzstd/Makefile similarity index 96% rename from contrib/zstd/contrib/pzstd/Makefile rename to sys/contrib/zstd/contrib/pzstd/Makefile index cec6959e62a5..40531e216539 100644 --- a/contrib/zstd/contrib/pzstd/Makefile +++ b/sys/contrib/zstd/contrib/pzstd/Makefile @@ -1,11 +1,11 @@ -# ########################################################################## +# ################################################################ # Copyright (c) 2016-present, Facebook, Inc. # All rights reserved. # -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. An additional grant -# of patent rights can be found in the PATENTS file in the same directory. -# ########################################################################## +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ # Standard variables for installation DESTDIR ?= diff --git a/contrib/zstd/contrib/pzstd/Options.cpp b/sys/contrib/zstd/contrib/pzstd/Options.cpp similarity index 98% rename from contrib/zstd/contrib/pzstd/Options.cpp rename to sys/contrib/zstd/contrib/pzstd/Options.cpp index 1f53f2bff78a..d9b216b42951 100644 --- a/contrib/zstd/contrib/pzstd/Options.cpp +++ b/sys/contrib/zstd/contrib/pzstd/Options.cpp @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "Options.h" #include "util.h" diff --git a/contrib/zstd/contrib/pzstd/Options.h b/sys/contrib/zstd/contrib/pzstd/Options.h similarity index 89% rename from contrib/zstd/contrib/pzstd/Options.h rename to sys/contrib/zstd/contrib/pzstd/Options.h index d58de017e012..f4f2aaa499cb 100644 --- a/contrib/zstd/contrib/pzstd/Options.h +++ b/sys/contrib/zstd/contrib/pzstd/Options.h @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once diff --git a/contrib/zstd/contrib/pzstd/Pzstd.cpp b/sys/contrib/zstd/contrib/pzstd/Pzstd.cpp similarity index 98% rename from contrib/zstd/contrib/pzstd/Pzstd.cpp rename to sys/contrib/zstd/contrib/pzstd/Pzstd.cpp index ae5d73444413..1eb4ce14cf15 100644 --- a/contrib/zstd/contrib/pzstd/Pzstd.cpp +++ b/sys/contrib/zstd/contrib/pzstd/Pzstd.cpp @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "Pzstd.h" #include "SkippableFrame.h" diff --git a/contrib/zstd/contrib/pzstd/Pzstd.h b/sys/contrib/zstd/contrib/pzstd/Pzstd.h similarity index 95% rename from contrib/zstd/contrib/pzstd/Pzstd.h rename to sys/contrib/zstd/contrib/pzstd/Pzstd.h index 1e29a7170e08..79d1fcca2653 100644 --- a/contrib/zstd/contrib/pzstd/Pzstd.h +++ b/sys/contrib/zstd/contrib/pzstd/Pzstd.h @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once diff --git a/contrib/zstd/contrib/pzstd/README.md b/sys/contrib/zstd/contrib/pzstd/README.md similarity index 100% rename from contrib/zstd/contrib/pzstd/README.md rename to sys/contrib/zstd/contrib/pzstd/README.md diff --git a/contrib/zstd/contrib/pzstd/SkippableFrame.cpp b/sys/contrib/zstd/contrib/pzstd/SkippableFrame.cpp similarity index 75% rename from contrib/zstd/contrib/pzstd/SkippableFrame.cpp rename to sys/contrib/zstd/contrib/pzstd/SkippableFrame.cpp index 5dc95e5ab099..769866dfc815 100644 --- a/contrib/zstd/contrib/pzstd/SkippableFrame.cpp +++ b/sys/contrib/zstd/contrib/pzstd/SkippableFrame.cpp @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "SkippableFrame.h" #include "mem.h" diff --git a/contrib/zstd/contrib/pzstd/SkippableFrame.h b/sys/contrib/zstd/contrib/pzstd/SkippableFrame.h similarity index 87% rename from contrib/zstd/contrib/pzstd/SkippableFrame.h rename to sys/contrib/zstd/contrib/pzstd/SkippableFrame.h index 9dc95c1f51e2..60deed0405be 100644 --- a/contrib/zstd/contrib/pzstd/SkippableFrame.h +++ b/sys/contrib/zstd/contrib/pzstd/SkippableFrame.h @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once diff --git a/contrib/zstd/contrib/pzstd/images/Cspeed.png b/sys/contrib/zstd/contrib/pzstd/images/Cspeed.png similarity index 100% rename from contrib/zstd/contrib/pzstd/images/Cspeed.png rename to sys/contrib/zstd/contrib/pzstd/images/Cspeed.png diff --git a/contrib/zstd/contrib/pzstd/images/Dspeed.png b/sys/contrib/zstd/contrib/pzstd/images/Dspeed.png similarity index 100% rename from contrib/zstd/contrib/pzstd/images/Dspeed.png rename to sys/contrib/zstd/contrib/pzstd/images/Dspeed.png diff --git a/contrib/zstd/contrib/pzstd/main.cpp b/sys/contrib/zstd/contrib/pzstd/main.cpp similarity index 64% rename from contrib/zstd/contrib/pzstd/main.cpp rename to sys/contrib/zstd/contrib/pzstd/main.cpp index 7d8dbfbcff5e..b93f043b16b1 100644 --- a/contrib/zstd/contrib/pzstd/main.cpp +++ b/sys/contrib/zstd/contrib/pzstd/main.cpp @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "ErrorHolder.h" #include "Options.h" diff --git a/contrib/zstd/contrib/pzstd/test/BUCK b/sys/contrib/zstd/contrib/pzstd/test/BUCK similarity index 100% rename from contrib/zstd/contrib/pzstd/test/BUCK rename to sys/contrib/zstd/contrib/pzstd/test/BUCK diff --git a/contrib/zstd/contrib/pzstd/test/OptionsTest.cpp b/sys/contrib/zstd/contrib/pzstd/test/OptionsTest.cpp similarity index 98% rename from contrib/zstd/contrib/pzstd/test/OptionsTest.cpp rename to sys/contrib/zstd/contrib/pzstd/test/OptionsTest.cpp index b3efe2b7ef5b..e601148255d4 100644 --- a/contrib/zstd/contrib/pzstd/test/OptionsTest.cpp +++ b/sys/contrib/zstd/contrib/pzstd/test/OptionsTest.cpp @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "Options.h" diff --git a/contrib/zstd/contrib/pzstd/test/PzstdTest.cpp b/sys/contrib/zstd/contrib/pzstd/test/PzstdTest.cpp similarity index 95% rename from contrib/zstd/contrib/pzstd/test/PzstdTest.cpp rename to sys/contrib/zstd/contrib/pzstd/test/PzstdTest.cpp index cadfa83f7215..5c7d66310805 100644 --- a/contrib/zstd/contrib/pzstd/test/PzstdTest.cpp +++ b/sys/contrib/zstd/contrib/pzstd/test/PzstdTest.cpp @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "Pzstd.h" extern "C" { diff --git a/contrib/zstd/contrib/pzstd/test/RoundTrip.h b/sys/contrib/zstd/contrib/pzstd/test/RoundTrip.h similarity index 89% rename from contrib/zstd/contrib/pzstd/test/RoundTrip.h rename to sys/contrib/zstd/contrib/pzstd/test/RoundTrip.h index 8b908845941f..c6364ecb4227 100644 --- a/contrib/zstd/contrib/pzstd/test/RoundTrip.h +++ b/sys/contrib/zstd/contrib/pzstd/test/RoundTrip.h @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once diff --git a/contrib/zstd/contrib/pzstd/test/RoundTripTest.cpp b/sys/contrib/zstd/contrib/pzstd/test/RoundTripTest.cpp similarity index 91% rename from contrib/zstd/contrib/pzstd/test/RoundTripTest.cpp rename to sys/contrib/zstd/contrib/pzstd/test/RoundTripTest.cpp index ed2ea770c523..36af0673ae6a 100644 --- a/contrib/zstd/contrib/pzstd/test/RoundTripTest.cpp +++ b/sys/contrib/zstd/contrib/pzstd/test/RoundTripTest.cpp @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ extern "C" { #include "datagen.h" diff --git a/contrib/zstd/contrib/pzstd/utils/BUCK b/sys/contrib/zstd/contrib/pzstd/utils/BUCK similarity index 100% rename from contrib/zstd/contrib/pzstd/utils/BUCK rename to sys/contrib/zstd/contrib/pzstd/utils/BUCK diff --git a/contrib/zstd/contrib/pzstd/utils/Buffer.h b/sys/contrib/zstd/contrib/pzstd/utils/Buffer.h similarity index 91% rename from contrib/zstd/contrib/pzstd/utils/Buffer.h rename to sys/contrib/zstd/contrib/pzstd/utils/Buffer.h index ab25bac9cb55..f69c3b4d9f7a 100644 --- a/contrib/zstd/contrib/pzstd/utils/Buffer.h +++ b/sys/contrib/zstd/contrib/pzstd/utils/Buffer.h @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once diff --git a/contrib/zstd/contrib/pzstd/utils/FileSystem.h b/sys/contrib/zstd/contrib/pzstd/utils/FileSystem.h similarity index 91% rename from contrib/zstd/contrib/pzstd/utils/FileSystem.h rename to sys/contrib/zstd/contrib/pzstd/utils/FileSystem.h index 7d597047fd1f..3cfbe86e507e 100644 --- a/contrib/zstd/contrib/pzstd/utils/FileSystem.h +++ b/sys/contrib/zstd/contrib/pzstd/utils/FileSystem.h @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once diff --git a/contrib/zstd/contrib/pzstd/utils/Likely.h b/sys/contrib/zstd/contrib/pzstd/utils/Likely.h similarity index 67% rename from contrib/zstd/contrib/pzstd/utils/Likely.h rename to sys/contrib/zstd/contrib/pzstd/utils/Likely.h index c8ea102b1396..7cea8da2771f 100644 --- a/contrib/zstd/contrib/pzstd/utils/Likely.h +++ b/sys/contrib/zstd/contrib/pzstd/utils/Likely.h @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ /** diff --git a/contrib/zstd/contrib/pzstd/utils/Range.h b/sys/contrib/zstd/contrib/pzstd/utils/Range.h similarity index 92% rename from contrib/zstd/contrib/pzstd/utils/Range.h rename to sys/contrib/zstd/contrib/pzstd/utils/Range.h index 111e98f58813..7e2559cc9e3d 100644 --- a/contrib/zstd/contrib/pzstd/utils/Range.h +++ b/sys/contrib/zstd/contrib/pzstd/utils/Range.h @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ /** diff --git a/contrib/zstd/contrib/pzstd/utils/ResourcePool.h b/sys/contrib/zstd/contrib/pzstd/utils/ResourcePool.h similarity index 91% rename from contrib/zstd/contrib/pzstd/utils/ResourcePool.h rename to sys/contrib/zstd/contrib/pzstd/utils/ResourcePool.h index ed011306ba52..a6ff5ffc5db3 100644 --- a/contrib/zstd/contrib/pzstd/utils/ResourcePool.h +++ b/sys/contrib/zstd/contrib/pzstd/utils/ResourcePool.h @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once diff --git a/contrib/zstd/contrib/pzstd/utils/ScopeGuard.h b/sys/contrib/zstd/contrib/pzstd/utils/ScopeGuard.h similarity index 79% rename from contrib/zstd/contrib/pzstd/utils/ScopeGuard.h rename to sys/contrib/zstd/contrib/pzstd/utils/ScopeGuard.h index 5a333e0ab884..31768f43d22c 100644 --- a/contrib/zstd/contrib/pzstd/utils/ScopeGuard.h +++ b/sys/contrib/zstd/contrib/pzstd/utils/ScopeGuard.h @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once diff --git a/contrib/zstd/contrib/pzstd/utils/ThreadPool.h b/sys/contrib/zstd/contrib/pzstd/utils/ThreadPool.h similarity index 84% rename from contrib/zstd/contrib/pzstd/utils/ThreadPool.h rename to sys/contrib/zstd/contrib/pzstd/utils/ThreadPool.h index 99b3ecfa51ae..8ece8e0da4eb 100644 --- a/contrib/zstd/contrib/pzstd/utils/ThreadPool.h +++ b/sys/contrib/zstd/contrib/pzstd/utils/ThreadPool.h @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once diff --git a/contrib/zstd/contrib/pzstd/utils/WorkQueue.h b/sys/contrib/zstd/contrib/pzstd/utils/WorkQueue.h similarity index 94% rename from contrib/zstd/contrib/pzstd/utils/WorkQueue.h rename to sys/contrib/zstd/contrib/pzstd/utils/WorkQueue.h index 780e5360ffb1..1d14d922c648 100644 --- a/contrib/zstd/contrib/pzstd/utils/WorkQueue.h +++ b/sys/contrib/zstd/contrib/pzstd/utils/WorkQueue.h @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once diff --git a/contrib/zstd/contrib/pzstd/utils/test/BUCK b/sys/contrib/zstd/contrib/pzstd/utils/test/BUCK similarity index 100% rename from contrib/zstd/contrib/pzstd/utils/test/BUCK rename to sys/contrib/zstd/contrib/pzstd/utils/test/BUCK diff --git a/contrib/zstd/contrib/pzstd/utils/test/BufferTest.cpp b/sys/contrib/zstd/contrib/pzstd/utils/test/BufferTest.cpp similarity index 88% rename from contrib/zstd/contrib/pzstd/utils/test/BufferTest.cpp rename to sys/contrib/zstd/contrib/pzstd/utils/test/BufferTest.cpp index 66ec961e236f..fbba74e82628 100644 --- a/contrib/zstd/contrib/pzstd/utils/test/BufferTest.cpp +++ b/sys/contrib/zstd/contrib/pzstd/utils/test/BufferTest.cpp @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "utils/Buffer.h" #include "utils/Range.h" diff --git a/contrib/zstd/contrib/pzstd/utils/test/RangeTest.cpp b/sys/contrib/zstd/contrib/pzstd/utils/test/RangeTest.cpp similarity index 88% rename from contrib/zstd/contrib/pzstd/utils/test/RangeTest.cpp rename to sys/contrib/zstd/contrib/pzstd/utils/test/RangeTest.cpp index c761c8aff6e3..755b50fa6e80 100644 --- a/contrib/zstd/contrib/pzstd/utils/test/RangeTest.cpp +++ b/sys/contrib/zstd/contrib/pzstd/utils/test/RangeTest.cpp @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "utils/Range.h" diff --git a/contrib/zstd/contrib/pzstd/utils/test/ResourcePoolTest.cpp b/sys/contrib/zstd/contrib/pzstd/utils/test/ResourcePoolTest.cpp similarity index 86% rename from contrib/zstd/contrib/pzstd/utils/test/ResourcePoolTest.cpp rename to sys/contrib/zstd/contrib/pzstd/utils/test/ResourcePoolTest.cpp index a6a86b345eb9..6fe145180be9 100644 --- a/contrib/zstd/contrib/pzstd/utils/test/ResourcePoolTest.cpp +++ b/sys/contrib/zstd/contrib/pzstd/utils/test/ResourcePoolTest.cpp @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "utils/ResourcePool.h" diff --git a/contrib/zstd/contrib/pzstd/utils/test/ScopeGuardTest.cpp b/sys/contrib/zstd/contrib/pzstd/utils/test/ScopeGuardTest.cpp similarity index 64% rename from contrib/zstd/contrib/pzstd/utils/test/ScopeGuardTest.cpp rename to sys/contrib/zstd/contrib/pzstd/utils/test/ScopeGuardTest.cpp index 0c4dc0357304..7bc624da79b2 100644 --- a/contrib/zstd/contrib/pzstd/utils/test/ScopeGuardTest.cpp +++ b/sys/contrib/zstd/contrib/pzstd/utils/test/ScopeGuardTest.cpp @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "utils/ScopeGuard.h" diff --git a/contrib/zstd/contrib/pzstd/utils/test/ThreadPoolTest.cpp b/sys/contrib/zstd/contrib/pzstd/utils/test/ThreadPoolTest.cpp similarity index 86% rename from contrib/zstd/contrib/pzstd/utils/test/ThreadPoolTest.cpp rename to sys/contrib/zstd/contrib/pzstd/utils/test/ThreadPoolTest.cpp index 89085afd434c..703fd4c9ca17 100644 --- a/contrib/zstd/contrib/pzstd/utils/test/ThreadPoolTest.cpp +++ b/sys/contrib/zstd/contrib/pzstd/utils/test/ThreadPoolTest.cpp @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "utils/ThreadPool.h" diff --git a/contrib/zstd/contrib/pzstd/utils/test/WorkQueueTest.cpp b/sys/contrib/zstd/contrib/pzstd/utils/test/WorkQueueTest.cpp similarity index 96% rename from contrib/zstd/contrib/pzstd/utils/test/WorkQueueTest.cpp rename to sys/contrib/zstd/contrib/pzstd/utils/test/WorkQueueTest.cpp index 8caf170d2948..14cf77304f21 100644 --- a/contrib/zstd/contrib/pzstd/utils/test/WorkQueueTest.cpp +++ b/sys/contrib/zstd/contrib/pzstd/utils/test/WorkQueueTest.cpp @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "utils/Buffer.h" #include "utils/WorkQueue.h" diff --git a/sys/contrib/zstd/contrib/seekable_format/examples/.gitignore b/sys/contrib/zstd/contrib/seekable_format/examples/.gitignore new file mode 100644 index 000000000000..df2f9ab07499 --- /dev/null +++ b/sys/contrib/zstd/contrib/seekable_format/examples/.gitignore @@ -0,0 +1,4 @@ +seekable_compression +seekable_decompression +parallel_processing +parallel_compression diff --git a/sys/contrib/zstd/contrib/seekable_format/examples/Makefile b/sys/contrib/zstd/contrib/seekable_format/examples/Makefile new file mode 100644 index 000000000000..1847aa7e7b39 --- /dev/null +++ b/sys/contrib/zstd/contrib/seekable_format/examples/Makefile @@ -0,0 +1,42 @@ +# ################################################################ +# Copyright (c) 2017-present, Facebook, Inc. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ + +# This Makefile presumes libzstd is built, using `make` in / or /lib/ + +LDFLAGS += ../../../lib/libzstd.a +CPPFLAGS += -I../ -I../../../lib -I../../../lib/common + +CFLAGS ?= -O3 +CFLAGS += -g + +SEEKABLE_OBJS = ../zstdseek_compress.c ../zstdseek_decompress.c + +.PHONY: default all clean test + +default: all + +all: seekable_compression seekable_decompression parallel_processing + +seekable_compression : seekable_compression.c $(SEEKABLE_OBJS) + $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ + +seekable_decompression : seekable_decompression.c $(SEEKABLE_OBJS) + $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ + +parallel_processing : parallel_processing.c $(SEEKABLE_OBJS) + $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ -pthread + +parallel_compression : parallel_compression.c $(SEEKABLE_OBJS) + $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ -pthread + +clean: + @rm -f core *.o tmp* result* *.zst \ + seekable_compression seekable_decompression \ + parallel_processing parallel_compression + @echo Cleaning completed diff --git a/sys/contrib/zstd/contrib/seekable_format/examples/parallel_compression.c b/sys/contrib/zstd/contrib/seekable_format/examples/parallel_compression.c new file mode 100644 index 000000000000..69644d2b3c80 --- /dev/null +++ b/sys/contrib/zstd/contrib/seekable_format/examples/parallel_compression.c @@ -0,0 +1,215 @@ +/* + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + */ + +#include // malloc, free, exit, atoi +#include // fprintf, perror, feof, fopen, etc. +#include // strlen, memset, strcat +#define ZSTD_STATIC_LINKING_ONLY +#include // presumes zstd library is installed +#include +#if defined(WIN32) || defined(_WIN32) +# include +# define SLEEP(x) Sleep(x) +#else +# include +# define SLEEP(x) usleep(x * 1000) +#endif + +#define XXH_NAMESPACE ZSTD_ +#include "xxhash.h" + +#include "pool.h" // use zstd thread pool for demo + +#include "zstd_seekable.h" + +static void* malloc_orDie(size_t size) +{ + void* const buff = malloc(size); + if (buff) return buff; + /* error */ + perror("malloc:"); + exit(1); +} + +static FILE* fopen_orDie(const char *filename, const char *instruction) +{ + FILE* const inFile = fopen(filename, instruction); + if (inFile) return inFile; + /* error */ + perror(filename); + exit(3); +} + +static size_t fread_orDie(void* buffer, size_t sizeToRead, FILE* file) +{ + size_t const readSize = fread(buffer, 1, sizeToRead, file); + if (readSize == sizeToRead) return readSize; /* good */ + if (feof(file)) return readSize; /* good, reached end of file */ + /* error */ + perror("fread"); + exit(4); +} + +static size_t fwrite_orDie(const void* buffer, size_t sizeToWrite, FILE* file) +{ + size_t const writtenSize = fwrite(buffer, 1, sizeToWrite, file); + if (writtenSize == sizeToWrite) return sizeToWrite; /* good */ + /* error */ + perror("fwrite"); + exit(5); +} + +static size_t fclose_orDie(FILE* file) +{ + if (!fclose(file)) return 0; + /* error */ + perror("fclose"); + exit(6); +} + +static void fseek_orDie(FILE* file, long int offset, int origin) +{ + if (!fseek(file, offset, origin)) { + if (!fflush(file)) return; + } + /* error */ + perror("fseek"); + exit(7); +} + +static long int ftell_orDie(FILE* file) +{ + long int off = ftell(file); + if (off != -1) return off; + /* error */ + perror("ftell"); + exit(8); +} + +struct job { + const void* src; + size_t srcSize; + void* dst; + size_t dstSize; + + unsigned checksum; + + int compressionLevel; + int done; +}; + +static void compressFrame(void* opaque) +{ + struct job* job = opaque; + + job->checksum = XXH64(job->src, job->srcSize, 0); + + size_t ret = ZSTD_compress(job->dst, job->dstSize, job->src, job->srcSize, job->compressionLevel); + if (ZSTD_isError(ret)) { + fprintf(stderr, "ZSTD_compress() error : %s \n", ZSTD_getErrorName(ret)); + exit(20); + } + + job->dstSize = ret; + job->done = 1; +} + +static void compressFile_orDie(const char* fname, const char* outName, int cLevel, unsigned frameSize, int nbThreads) +{ + POOL_ctx* pool = POOL_create(nbThreads, nbThreads); + if (pool == NULL) { fprintf(stderr, "POOL_create() error \n"); exit(9); } + + FILE* const fin = fopen_orDie(fname, "rb"); + FILE* const fout = fopen_orDie(outName, "wb"); + + if (ZSTD_compressBound(frameSize) > 0xFFFFFFFFU) { fprintf(stderr, "Frame size too large \n"); exit(10); } + unsigned dstSize = ZSTD_compressBound(frameSize); + + + fseek_orDie(fin, 0, SEEK_END); + long int length = ftell_orDie(fin); + fseek_orDie(fin, 0, SEEK_SET); + + size_t numFrames = (length + frameSize - 1) / frameSize; + + struct job* jobs = malloc_orDie(sizeof(struct job) * numFrames); + + size_t i; + for(i = 0; i < numFrames; i++) { + void* in = malloc_orDie(frameSize); + void* out = malloc_orDie(dstSize); + + size_t inSize = fread_orDie(in, frameSize, fin); + + jobs[i].src = in; + jobs[i].srcSize = inSize; + jobs[i].dst = out; + jobs[i].dstSize = dstSize; + jobs[i].compressionLevel = cLevel; + jobs[i].done = 0; + POOL_add(pool, compressFrame, &jobs[i]); + } + + ZSTD_frameLog* fl = ZSTD_seekable_createFrameLog(1); + if (fl == NULL) { fprintf(stderr, "ZSTD_seekable_createFrameLog() failed \n"); exit(11); } + for (i = 0; i < numFrames; i++) { + while (!jobs[i].done) SLEEP(5); /* wake up every 5 milliseconds to check */ + fwrite_orDie(jobs[i].dst, jobs[i].dstSize, fout); + free((void*)jobs[i].src); + free(jobs[i].dst); + + size_t ret = ZSTD_seekable_logFrame(fl, jobs[i].dstSize, jobs[i].srcSize, jobs[i].checksum); + if (ZSTD_isError(ret)) { fprintf(stderr, "ZSTD_seekable_logFrame() error : %s \n", ZSTD_getErrorName(ret)); } + } + + { unsigned char seekTableBuff[1024]; + ZSTD_outBuffer out = {seekTableBuff, 1024, 0}; + while (ZSTD_seekable_writeSeekTable(fl, &out) != 0) { + fwrite_orDie(seekTableBuff, out.pos, fout); + out.pos = 0; + } + fwrite_orDie(seekTableBuff, out.pos, fout); + } + + ZSTD_seekable_freeFrameLog(fl); + free(jobs); + fclose_orDie(fout); + fclose_orDie(fin); +} + +static const char* createOutFilename_orDie(const char* filename) +{ + size_t const inL = strlen(filename); + size_t const outL = inL + 5; + void* outSpace = malloc_orDie(outL); + memset(outSpace, 0, outL); + strcat(outSpace, filename); + strcat(outSpace, ".zst"); + return (const char*)outSpace; +} + +int main(int argc, const char** argv) { + const char* const exeName = argv[0]; + if (argc!=4) { + printf("wrong arguments\n"); + printf("usage:\n"); + printf("%s FILE FRAME_SIZE NB_THREADS\n", exeName); + return 1; + } + + { const char* const inFileName = argv[1]; + unsigned const frameSize = (unsigned)atoi(argv[2]); + int const nbThreads = atoi(argv[3]); + + const char* const outFileName = createOutFilename_orDie(inFileName); + compressFile_orDie(inFileName, outFileName, 5, frameSize, nbThreads); + } + + return 0; +} diff --git a/sys/contrib/zstd/contrib/seekable_format/examples/parallel_processing.c b/sys/contrib/zstd/contrib/seekable_format/examples/parallel_processing.c new file mode 100644 index 000000000000..da3477632e2c --- /dev/null +++ b/sys/contrib/zstd/contrib/seekable_format/examples/parallel_processing.c @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + */ + +/* + * A simple demo that sums up all the bytes in the file in parallel using + * seekable decompression and the zstd thread pool + */ + +#include // malloc, exit +#include // fprintf, perror, feof +#include // strerror +#include // errno +#define ZSTD_STATIC_LINKING_ONLY +#include // presumes zstd library is installed +#include +#if defined(WIN32) || defined(_WIN32) +# include +# define SLEEP(x) Sleep(x) +#else +# include +# define SLEEP(x) usleep(x * 1000) +#endif + +#include "pool.h" // use zstd thread pool for demo + +#include "zstd_seekable.h" + +#define MIN(a, b) ((a) < (b) ? (a) : (b)) + +static void* malloc_orDie(size_t size) +{ + void* const buff = malloc(size); + if (buff) return buff; + /* error */ + perror("malloc"); + exit(1); +} + +static void* realloc_orDie(void* ptr, size_t size) +{ + ptr = realloc(ptr, size); + if (ptr) return ptr; + /* error */ + perror("realloc"); + exit(1); +} + +static FILE* fopen_orDie(const char *filename, const char *instruction) +{ + FILE* const inFile = fopen(filename, instruction); + if (inFile) return inFile; + /* error */ + perror(filename); + exit(3); +} + +static size_t fread_orDie(void* buffer, size_t sizeToRead, FILE* file) +{ + size_t const readSize = fread(buffer, 1, sizeToRead, file); + if (readSize == sizeToRead) return readSize; /* good */ + if (feof(file)) return readSize; /* good, reached end of file */ + /* error */ + perror("fread"); + exit(4); +} + +static size_t fwrite_orDie(const void* buffer, size_t sizeToWrite, FILE* file) +{ + size_t const writtenSize = fwrite(buffer, 1, sizeToWrite, file); + if (writtenSize == sizeToWrite) return sizeToWrite; /* good */ + /* error */ + perror("fwrite"); + exit(5); +} + +static size_t fclose_orDie(FILE* file) +{ + if (!fclose(file)) return 0; + /* error */ + perror("fclose"); + exit(6); +} + +static void fseek_orDie(FILE* file, long int offset, int origin) { + if (!fseek(file, offset, origin)) { + if (!fflush(file)) return; + } + /* error */ + perror("fseek"); + exit(7); +} + +struct sum_job { + const char* fname; + unsigned long long sum; + unsigned frameNb; + int done; +}; + +static void sumFrame(void* opaque) +{ + struct sum_job* job = (struct sum_job*)opaque; + job->done = 0; + + FILE* const fin = fopen_orDie(job->fname, "rb"); + + ZSTD_seekable* const seekable = ZSTD_seekable_create(); + if (seekable==NULL) { fprintf(stderr, "ZSTD_seekable_create() error \n"); exit(10); } + + size_t const initResult = ZSTD_seekable_initFile(seekable, fin); + if (ZSTD_isError(initResult)) { fprintf(stderr, "ZSTD_seekable_init() error : %s \n", ZSTD_getErrorName(initResult)); exit(11); } + + size_t const frameSize = ZSTD_seekable_getFrameDecompressedSize(seekable, job->frameNb); + unsigned char* data = malloc_orDie(frameSize); + + size_t result = ZSTD_seekable_decompressFrame(seekable, data, frameSize, job->frameNb); + if (ZSTD_isError(result)) { fprintf(stderr, "ZSTD_seekable_decompressFrame() error : %s \n", ZSTD_getErrorName(result)); exit(12); } + + unsigned long long sum = 0; + size_t i; + for (i = 0; i < frameSize; i++) { + sum += data[i]; + } + job->sum = sum; + job->done = 1; + + fclose(fin); + ZSTD_seekable_free(seekable); + free(data); +} + +static void sumFile_orDie(const char* fname, int nbThreads) +{ + POOL_ctx* pool = POOL_create(nbThreads, nbThreads); + if (pool == NULL) { fprintf(stderr, "POOL_create() error \n"); exit(9); } + + FILE* const fin = fopen_orDie(fname, "rb"); + + ZSTD_seekable* const seekable = ZSTD_seekable_create(); + if (seekable==NULL) { fprintf(stderr, "ZSTD_seekable_create() error \n"); exit(10); } + + size_t const initResult = ZSTD_seekable_initFile(seekable, fin); + if (ZSTD_isError(initResult)) { fprintf(stderr, "ZSTD_seekable_init() error : %s \n", ZSTD_getErrorName(initResult)); exit(11); } + + size_t const numFrames = ZSTD_seekable_getNumFrames(seekable); + struct sum_job* jobs = (struct sum_job*)malloc(numFrames * sizeof(struct sum_job)); + + size_t i; + for (i = 0; i < numFrames; i++) { + jobs[i] = (struct sum_job){ fname, 0, i, 0 }; + POOL_add(pool, sumFrame, &jobs[i]); + } + + unsigned long long total = 0; + + for (i = 0; i < numFrames; i++) { + while (!jobs[i].done) SLEEP(5); /* wake up every 5 milliseconds to check */ + total += jobs[i].sum; + } + + printf("Sum: %llu\n", total); + + POOL_free(pool); + ZSTD_seekable_free(seekable); + fclose(fin); + free(jobs); +} + + +int main(int argc, const char** argv) +{ + const char* const exeName = argv[0]; + + if (argc!=3) { + fprintf(stderr, "wrong arguments\n"); + fprintf(stderr, "usage:\n"); + fprintf(stderr, "%s FILE NB_THREADS\n", exeName); + return 1; + } + + { + const char* const inFilename = argv[1]; + int const nbThreads = atoi(argv[2]); + sumFile_orDie(inFilename, nbThreads); + } + + return 0; +} diff --git a/sys/contrib/zstd/contrib/seekable_format/examples/seekable_compression.c b/sys/contrib/zstd/contrib/seekable_format/examples/seekable_compression.c new file mode 100644 index 000000000000..9485bf26fc46 --- /dev/null +++ b/sys/contrib/zstd/contrib/seekable_format/examples/seekable_compression.c @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + */ + +#include // malloc, free, exit, atoi +#include // fprintf, perror, feof, fopen, etc. +#include // strlen, memset, strcat +#define ZSTD_STATIC_LINKING_ONLY +#include // presumes zstd library is installed + +#include "zstd_seekable.h" + +static void* malloc_orDie(size_t size) +{ + void* const buff = malloc(size); + if (buff) return buff; + /* error */ + perror("malloc:"); + exit(1); +} + +static FILE* fopen_orDie(const char *filename, const char *instruction) +{ + FILE* const inFile = fopen(filename, instruction); + if (inFile) return inFile; + /* error */ + perror(filename); + exit(3); +} + +static size_t fread_orDie(void* buffer, size_t sizeToRead, FILE* file) +{ + size_t const readSize = fread(buffer, 1, sizeToRead, file); + if (readSize == sizeToRead) return readSize; /* good */ + if (feof(file)) return readSize; /* good, reached end of file */ + /* error */ + perror("fread"); + exit(4); +} + +static size_t fwrite_orDie(const void* buffer, size_t sizeToWrite, FILE* file) +{ + size_t const writtenSize = fwrite(buffer, 1, sizeToWrite, file); + if (writtenSize == sizeToWrite) return sizeToWrite; /* good */ + /* error */ + perror("fwrite"); + exit(5); +} + +static size_t fclose_orDie(FILE* file) +{ + if (!fclose(file)) return 0; + /* error */ + perror("fclose"); + exit(6); +} + +static void compressFile_orDie(const char* fname, const char* outName, int cLevel, unsigned frameSize) +{ + FILE* const fin = fopen_orDie(fname, "rb"); + FILE* const fout = fopen_orDie(outName, "wb"); + size_t const buffInSize = ZSTD_CStreamInSize(); /* can always read one full block */ + void* const buffIn = malloc_orDie(buffInSize); + size_t const buffOutSize = ZSTD_CStreamOutSize(); /* can always flush a full block */ + void* const buffOut = malloc_orDie(buffOutSize); + + ZSTD_seekable_CStream* const cstream = ZSTD_seekable_createCStream(); + if (cstream==NULL) { fprintf(stderr, "ZSTD_seekable_createCStream() error \n"); exit(10); } + size_t const initResult = ZSTD_seekable_initCStream(cstream, cLevel, 1, frameSize); + if (ZSTD_isError(initResult)) { fprintf(stderr, "ZSTD_seekable_initCStream() error : %s \n", ZSTD_getErrorName(initResult)); exit(11); } + + size_t read, toRead = buffInSize; + while( (read = fread_orDie(buffIn, toRead, fin)) ) { + ZSTD_inBuffer input = { buffIn, read, 0 }; + while (input.pos < input.size) { + ZSTD_outBuffer output = { buffOut, buffOutSize, 0 }; + toRead = ZSTD_seekable_compressStream(cstream, &output , &input); /* toRead is guaranteed to be <= ZSTD_CStreamInSize() */ + if (ZSTD_isError(toRead)) { fprintf(stderr, "ZSTD_seekable_compressStream() error : %s \n", ZSTD_getErrorName(toRead)); exit(12); } + if (toRead > buffInSize) toRead = buffInSize; /* Safely handle case when `buffInSize` is manually changed to a value < ZSTD_CStreamInSize()*/ + fwrite_orDie(buffOut, output.pos, fout); + } + } + + while (1) { + ZSTD_outBuffer output = { buffOut, buffOutSize, 0 }; + size_t const remainingToFlush = ZSTD_seekable_endStream(cstream, &output); /* close stream */ + if (ZSTD_isError(remainingToFlush)) { fprintf(stderr, "ZSTD_seekable_endStream() error : %s \n", ZSTD_getErrorName(remainingToFlush)); exit(13); } + fwrite_orDie(buffOut, output.pos, fout); + if (!remainingToFlush) break; + } + + ZSTD_seekable_freeCStream(cstream); + fclose_orDie(fout); + fclose_orDie(fin); + free(buffIn); + free(buffOut); +} + +static const char* createOutFilename_orDie(const char* filename) +{ + size_t const inL = strlen(filename); + size_t const outL = inL + 5; + void* outSpace = malloc_orDie(outL); + memset(outSpace, 0, outL); + strcat(outSpace, filename); + strcat(outSpace, ".zst"); + return (const char*)outSpace; +} + +int main(int argc, const char** argv) { + const char* const exeName = argv[0]; + if (argc!=3) { + printf("wrong arguments\n"); + printf("usage:\n"); + printf("%s FILE FRAME_SIZE\n", exeName); + return 1; + } + + { const char* const inFileName = argv[1]; + unsigned const frameSize = (unsigned)atoi(argv[2]); + + const char* const outFileName = createOutFilename_orDie(inFileName); + compressFile_orDie(inFileName, outFileName, 5, frameSize); + } + + return 0; +} diff --git a/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression.c b/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression.c new file mode 100644 index 000000000000..9cd232922636 --- /dev/null +++ b/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression.c @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + */ + + +#include // malloc, exit +#include // fprintf, perror, feof +#include // strerror +#include // errno +#define ZSTD_STATIC_LINKING_ONLY +#include // presumes zstd library is installed +#include + +#include "zstd_seekable.h" + +#define MIN(a, b) ((a) < (b) ? (a) : (b)) + +static void* malloc_orDie(size_t size) +{ + void* const buff = malloc(size); + if (buff) return buff; + /* error */ + perror("malloc"); + exit(1); +} + +static void* realloc_orDie(void* ptr, size_t size) +{ + ptr = realloc(ptr, size); + if (ptr) return ptr; + /* error */ + perror("realloc"); + exit(1); +} + +static FILE* fopen_orDie(const char *filename, const char *instruction) +{ + FILE* const inFile = fopen(filename, instruction); + if (inFile) return inFile; + /* error */ + perror(filename); + exit(3); +} + +static size_t fread_orDie(void* buffer, size_t sizeToRead, FILE* file) +{ + size_t const readSize = fread(buffer, 1, sizeToRead, file); + if (readSize == sizeToRead) return readSize; /* good */ + if (feof(file)) return readSize; /* good, reached end of file */ + /* error */ + perror("fread"); + exit(4); +} + +static size_t fwrite_orDie(const void* buffer, size_t sizeToWrite, FILE* file) +{ + size_t const writtenSize = fwrite(buffer, 1, sizeToWrite, file); + if (writtenSize == sizeToWrite) return sizeToWrite; /* good */ + /* error */ + perror("fwrite"); + exit(5); +} + +static size_t fclose_orDie(FILE* file) +{ + if (!fclose(file)) return 0; + /* error */ + perror("fclose"); + exit(6); +} + +static void fseek_orDie(FILE* file, long int offset, int origin) { + if (!fseek(file, offset, origin)) { + if (!fflush(file)) return; + } + /* error */ + perror("fseek"); + exit(7); +} + + +static void decompressFile_orDie(const char* fname, unsigned startOffset, unsigned endOffset) +{ + FILE* const fin = fopen_orDie(fname, "rb"); + FILE* const fout = stdout; + size_t const buffOutSize = ZSTD_DStreamOutSize(); /* Guarantee to successfully flush at least one complete compressed block in all circumstances. */ + void* const buffOut = malloc_orDie(buffOutSize); + + ZSTD_seekable* const seekable = ZSTD_seekable_create(); + if (seekable==NULL) { fprintf(stderr, "ZSTD_seekable_create() error \n"); exit(10); } + + size_t const initResult = ZSTD_seekable_initFile(seekable, fin); + if (ZSTD_isError(initResult)) { fprintf(stderr, "ZSTD_seekable_init() error : %s \n", ZSTD_getErrorName(initResult)); exit(11); } + + while (startOffset < endOffset) { + size_t const result = ZSTD_seekable_decompress(seekable, buffOut, MIN(endOffset - startOffset, buffOutSize), startOffset); + + if (ZSTD_isError(result)) { + fprintf(stderr, "ZSTD_seekable_decompress() error : %s \n", + ZSTD_getErrorName(result)); + exit(12); + } + fwrite_orDie(buffOut, result, fout); + startOffset += result; + } + + ZSTD_seekable_free(seekable); + fclose_orDie(fin); + fclose_orDie(fout); + free(buffOut); +} + + +int main(int argc, const char** argv) +{ + const char* const exeName = argv[0]; + + if (argc!=4) { + fprintf(stderr, "wrong arguments\n"); + fprintf(stderr, "usage:\n"); + fprintf(stderr, "%s FILE START END\n", exeName); + return 1; + } + + { + const char* const inFilename = argv[1]; + unsigned const startOffset = (unsigned) atoi(argv[2]); + unsigned const endOffset = (unsigned) atoi(argv[3]); + decompressFile_orDie(inFilename, startOffset, endOffset); + } + + return 0; +} diff --git a/sys/contrib/zstd/contrib/seekable_format/zstd_seekable.h b/sys/contrib/zstd/contrib/seekable_format/zstd_seekable.h new file mode 100644 index 000000000000..438ac20149f8 --- /dev/null +++ b/sys/contrib/zstd/contrib/seekable_format/zstd_seekable.h @@ -0,0 +1,184 @@ +#ifndef SEEKABLE_H +#define SEEKABLE_H + +#if defined (__cplusplus) +extern "C" { +#endif + +#include + +static const unsigned ZSTD_seekTableFooterSize = 9; + +#define ZSTD_SEEKABLE_MAGICNUMBER 0x8F92EAB1 + +#define ZSTD_SEEKABLE_MAXFRAMES 0x8000000U + +/* Limit the maximum size to avoid any potential issues storing the compressed size */ +#define ZSTD_SEEKABLE_MAX_FRAME_DECOMPRESSED_SIZE 0x80000000U + +/*-**************************************************************************** +* Seekable Format +* +* The seekable format splits the compressed data into a series of "frames", +* each compressed individually so that decompression of a section in the +* middle of an archive only requires zstd to decompress at most a frame's +* worth of extra data, instead of the entire archive. +******************************************************************************/ + +typedef struct ZSTD_seekable_CStream_s ZSTD_seekable_CStream; +typedef struct ZSTD_seekable_s ZSTD_seekable; + +/*-**************************************************************************** +* Seekable compression - HowTo +* A ZSTD_seekable_CStream object is required to tracking streaming operation. +* Use ZSTD_seekable_createCStream() and ZSTD_seekable_freeCStream() to create/ +* release resources. +* +* Streaming objects are reusable to avoid allocation and deallocation, +* to start a new compression operation call ZSTD_seekable_initCStream() on the +* compressor. +* +* Data streamed to the seekable compressor will automatically be split into +* frames of size `maxFrameSize` (provided in ZSTD_seekable_initCStream()), +* or if none is provided, will be cut off whenever ZSTD_seekable_endFrame() is +* called or when the default maximum frame size (2GB) is reached. +* +* Use ZSTD_seekable_initCStream() to initialize a ZSTD_seekable_CStream object +* for a new compression operation. +* `maxFrameSize` indicates the size at which to automatically start a new +* seekable frame. `maxFrameSize == 0` implies the default maximum size. +* `checksumFlag` indicates whether or not the seek table should include frame +* checksums on the uncompressed data for verification. +* @return : a size hint for input to provide for compression, or an error code +* checkable with ZSTD_isError() +* +* Use ZSTD_seekable_compressStream() repetitively to consume input stream. +* The function will automatically update both `pos` fields. +* Note that it may not consume the entire input, in which case `pos < size`, +* and it's up to the caller to present again remaining data. +* @return : a size hint, preferred nb of bytes to use as input for next +* function call or an error code, which can be tested using +* ZSTD_isError(). +* Note 1 : it's just a hint, to help latency a little, any other +* value will work fine. +* +* At any time, call ZSTD_seekable_endFrame() to end the current frame and +* start a new one. +* +* ZSTD_seekable_endStream() will end the current frame, and then write the seek +* table so that decompressors can efficiently find compressed frames. +* ZSTD_seekable_endStream() may return a number > 0 if it was unable to flush +* all the necessary data to `output`. In this case, it should be called again +* until all remaining data is flushed out and 0 is returned. +******************************************************************************/ + +/*===== Seekable compressor management =====*/ +ZSTDLIB_API ZSTD_seekable_CStream* ZSTD_seekable_createCStream(void); +ZSTDLIB_API size_t ZSTD_seekable_freeCStream(ZSTD_seekable_CStream* zcs); + +/*===== Seekable compression functions =====*/ +ZSTDLIB_API size_t ZSTD_seekable_initCStream(ZSTD_seekable_CStream* zcs, int compressionLevel, int checksumFlag, unsigned maxFrameSize); +ZSTDLIB_API size_t ZSTD_seekable_compressStream(ZSTD_seekable_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input); +ZSTDLIB_API size_t ZSTD_seekable_endFrame(ZSTD_seekable_CStream* zcs, ZSTD_outBuffer* output); +ZSTDLIB_API size_t ZSTD_seekable_endStream(ZSTD_seekable_CStream* zcs, ZSTD_outBuffer* output); + +/*= Raw seek table API + * These functions allow for the seek table to be constructed directly. + * This table can then be appended to a file of concatenated frames. + * This allows the frames to be compressed independently, even in parallel, + * and compiled together afterward into a seekable archive. + * + * Use ZSTD_seekable_createFrameLog() to allocate and initialize a tracking + * structure. + * + * Call ZSTD_seekable_logFrame() once for each frame in the archive. + * checksum is optional, and will not be used if checksumFlag was 0 when the + * frame log was created. If present, it should be the least significant 32 + * bits of the XXH64 hash of the uncompressed data. + * + * Call ZSTD_seekable_writeSeekTable to serialize the data into a seek table. + * If the entire table was written, the return value will be 0. Otherwise, + * it will be equal to the number of bytes left to write. */ +typedef struct ZSTD_frameLog_s ZSTD_frameLog; +ZSTDLIB_API ZSTD_frameLog* ZSTD_seekable_createFrameLog(int checksumFlag); +ZSTDLIB_API size_t ZSTD_seekable_freeFrameLog(ZSTD_frameLog* fl); +ZSTDLIB_API size_t ZSTD_seekable_logFrame(ZSTD_frameLog* fl, unsigned compressedSize, unsigned decompressedSize, unsigned checksum); +ZSTDLIB_API size_t ZSTD_seekable_writeSeekTable(ZSTD_frameLog* fl, ZSTD_outBuffer* output); + +/*-**************************************************************************** +* Seekable decompression - HowTo +* A ZSTD_seekable object is required to tracking the seekTable. +* +* Call ZSTD_seekable_init* to initialize a ZSTD_seekable object with the +* the seek table provided in the input. +* There are three modes for ZSTD_seekable_init: +* - ZSTD_seekable_initBuff() : An in-memory API. The data contained in +* `src` should be the entire seekable file, including the seek table. +* `src` should be kept alive and unmodified until the ZSTD_seekable object +* is freed or reset. +* - ZSTD_seekable_initFile() : A simplified file API using stdio. fread and +* fseek will be used to access the required data for building the seek +* table and doing decompression operations. `src` should not be closed +* or modified until the ZSTD_seekable object is freed or reset. +* - ZSTD_seekable_initAdvanced() : A general API allowing the client to +* provide its own read and seek callbacks. +* + ZSTD_seekable_read() : read exactly `n` bytes into `buffer`. +* Premature EOF should be treated as an error. +* + ZSTD_seekable_seek() : seek the read head to `offset` from `origin`, +* where origin is either SEEK_SET (beginning of +* file), or SEEK_END (end of file). +* Both functions should return a non-negative value in case of success, and a +* negative value in case of failure. If implementing using this API and +* stdio, be careful with files larger than 4GB and fseek. All of these +* functions return an error code checkable with ZSTD_isError(). +* +* Call ZSTD_seekable_decompress to decompress `dstSize` bytes at decompressed +* offset `offset`. ZSTD_seekable_decompress may have to decompress the entire +* prefix of the frame before the desired data if it has not already processed +* this section. If ZSTD_seekable_decompress is called multiple times for a +* consecutive range of data, it will efficiently retain the decompressor object +* and avoid redecompressing frame prefixes. The return value is the number of +* bytes decompressed, or an error code checkable with ZSTD_isError(). +* +* The seek table access functions can be used to obtain the data contained +* in the seek table. If frameIndex is larger than the value returned by +* ZSTD_seekable_getNumFrames(), they will return error codes checkable with +* ZSTD_isError(). Note that since the offset access functions return +* unsigned long long instead of size_t, in this case they will instead return +* the value ZSTD_SEEKABLE_FRAMEINDEX_TOOLARGE. +******************************************************************************/ + +/*===== Seekable decompressor management =====*/ +ZSTDLIB_API ZSTD_seekable* ZSTD_seekable_create(void); +ZSTDLIB_API size_t ZSTD_seekable_free(ZSTD_seekable* zs); + +/*===== Seekable decompression functions =====*/ +ZSTDLIB_API size_t ZSTD_seekable_initBuff(ZSTD_seekable* zs, const void* src, size_t srcSize); +ZSTDLIB_API size_t ZSTD_seekable_initFile(ZSTD_seekable* zs, FILE* src); +ZSTDLIB_API size_t ZSTD_seekable_decompress(ZSTD_seekable* zs, void* dst, size_t dstSize, unsigned long long offset); +ZSTDLIB_API size_t ZSTD_seekable_decompressFrame(ZSTD_seekable* zs, void* dst, size_t dstSize, unsigned frameIndex); + +#define ZSTD_SEEKABLE_FRAMEINDEX_TOOLARGE (0ULL-2) +/*===== Seek Table access functions =====*/ +ZSTDLIB_API unsigned ZSTD_seekable_getNumFrames(ZSTD_seekable* const zs); +ZSTDLIB_API unsigned long long ZSTD_seekable_getFrameCompressedOffset(ZSTD_seekable* const zs, unsigned frameIndex); +ZSTDLIB_API unsigned long long ZSTD_seekable_getFrameDecompressedOffset(ZSTD_seekable* const zs, unsigned frameIndex); +ZSTDLIB_API size_t ZSTD_seekable_getFrameCompressedSize(ZSTD_seekable* const zs, unsigned frameIndex); +ZSTDLIB_API size_t ZSTD_seekable_getFrameDecompressedSize(ZSTD_seekable* const zs, unsigned frameIndex); +ZSTDLIB_API unsigned ZSTD_seekable_offsetToFrameIndex(ZSTD_seekable* const zs, unsigned long long offset); + +/*===== Seekable advanced I/O API =====*/ +typedef int(ZSTD_seekable_read)(void* opaque, void* buffer, size_t n); +typedef int(ZSTD_seekable_seek)(void* opaque, long long offset, int origin); +typedef struct { + void* opaque; + ZSTD_seekable_read* read; + ZSTD_seekable_seek* seek; +} ZSTD_seekable_customFile; +ZSTDLIB_API size_t ZSTD_seekable_initAdvanced(ZSTD_seekable* zs, ZSTD_seekable_customFile src); + +#if defined (__cplusplus) +} +#endif + +#endif diff --git a/sys/contrib/zstd/contrib/seekable_format/zstd_seekable_compression_format.md b/sys/contrib/zstd/contrib/seekable_format/zstd_seekable_compression_format.md new file mode 100644 index 000000000000..bf3080f7bbed --- /dev/null +++ b/sys/contrib/zstd/contrib/seekable_format/zstd_seekable_compression_format.md @@ -0,0 +1,116 @@ +# Zstandard Seekable Format + +### Notices + +Copyright (c) 2017-present Facebook, Inc. + +Permission is granted to copy and distribute this document +for any purpose and without charge, +including translations into other languages +and incorporation into compilations, +provided that the copyright notice and this notice are preserved, +and that any substantive changes or deletions from the original +are clearly marked. +Distribution of this document is unlimited. + +### Version +0.1.0 (11/04/17) + +## Introduction +This document defines a format for compressed data to be stored so that subranges of the data can be efficiently decompressed without requiring the entire document to be decompressed. +This is done by splitting up the input data into frames, +each of which are compressed independently, +and so can be decompressed independently. +Decompression then takes advantage of a provided 'seek table', which allows the decompressor to immediately jump to the desired data. This is done in a way that is compatible with the original Zstandard format by placing the seek table in a Zstandard skippable frame. + +### Overall conventions +In this document: +- square brackets i.e. `[` and `]` are used to indicate optional fields or parameters. +- the naming convention for identifiers is `Mixed_Case_With_Underscores` +- All numeric fields are little-endian unless specified otherwise + +## Format + +The format consists of a number of frames (Zstandard compressed frames and skippable frames), followed by a final skippable frame at the end containing the seek table. + +### Seek Table Format +The structure of the seek table frame is as follows: + +|`Skippable_Magic_Number`|`Frame_Size`|`[Seek_Table_Entries]`|`Seek_Table_Footer`| +|------------------------|------------|----------------------|-------------------| +| 4 bytes | 4 bytes | 8-12 bytes each | 9 bytes | + +__`Skippable_Magic_Number`__ + +Value : 0x184D2A5E. +This is for compatibility with [Zstandard skippable frames]. +Since it is legal for other Zstandard skippable frames to use the same +magic number, it is not recommended for a decoder to recognize frames +solely on this. + +__`Frame_Size`__ + +The total size of the skippable frame, not including the `Skippable_Magic_Number` or `Frame_Size`. +This is for compatibility with [Zstandard skippable frames]. + +[Zstandard skippable frames]: https://github.com/facebook/zstd/blob/master/doc/zstd_compression_format.md#skippable-frames + +#### `Seek_Table_Footer` +The seek table footer format is as follows: + +|`Number_Of_Frames`|`Seek_Table_Descriptor`|`Seekable_Magic_Number`| +|------------------|-----------------------|-----------------------| +| 4 bytes | 1 byte | 4 bytes | + +__`Seekable_Magic_Number`__ + +Value : 0x8F92EAB1. +This value must be the last bytes present in the compressed file so that decoders +can efficiently find it and determine if there is an actual seek table present. + +__`Number_Of_Frames`__ + +The number of stored frames in the data. + +__`Seek_Table_Descriptor`__ + +A bitfield describing the format of the seek table. + +| Bit number | Field name | +| ---------- | ---------- | +| 7 | `Checksum_Flag` | +| 6-2 | `Reserved_Bits` | +| 1-0 | `Unused_Bits` | + +While only `Checksum_Flag` currently exists, there are 7 other bits in this field that can be used for future changes to the format, +for example the addition of inline dictionaries. + +__`Checksum_Flag`__ + +If the checksum flag is set, each of the seek table entries contains a 4 byte checksum of the uncompressed data contained in its frame. + +`Reserved_Bits` are not currently used but may be used in the future for breaking changes, so a compliant decoder should ensure they are set to 0. `Unused_Bits` may be used in the future for non-breaking changes, so a compliant decoder should not interpret these bits. + +#### __`Seek_Table_Entries`__ + +`Seek_Table_Entries` consists of `Number_Of_Frames` (one for each frame in the data, not including the seek table frame) entries of the following form, in sequence: + +|`Compressed_Size`|`Decompressed_Size`|`[Checksum]`| +|-----------------|-------------------|------------| +| 4 bytes | 4 bytes | 4 bytes | + +__`Compressed_Size`__ + +The compressed size of the frame. +The cumulative sum of the `Compressed_Size` fields of frames `0` to `i` gives the offset in the compressed file of frame `i+1`. + +__`Decompressed_Size`__ + +The size of the decompressed data contained in the frame. For skippable or otherwise empty frames, this value is 0. + +__`Checksum`__ + +Only present if `Checksum_Flag` is set in the `Seek_Table_Descriptor`. Value : the least significant 32 bits of the XXH64 digest of the uncompressed data, stored in little-endian format. + +## Version Changes +- 0.1.0: initial version diff --git a/sys/contrib/zstd/contrib/seekable_format/zstdseek_compress.c b/sys/contrib/zstd/contrib/seekable_format/zstdseek_compress.c new file mode 100644 index 000000000000..df2074988e63 --- /dev/null +++ b/sys/contrib/zstd/contrib/seekable_format/zstdseek_compress.c @@ -0,0 +1,366 @@ +/* + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + */ + +#include /* malloc, free */ + +#define XXH_STATIC_LINKING_ONLY +#define XXH_NAMESPACE ZSTD_ +#include "xxhash.h" + +#define ZSTD_STATIC_LINKING_ONLY +#include "zstd.h" +#include "zstd_errors.h" +#include "mem.h" +#include "zstd_seekable.h" + +#define CHECK_Z(f) { size_t const ret = (f); if (ret != 0) return ret; } + +#undef ERROR +#define ERROR(name) ((size_t)-ZSTD_error_##name) + +#undef MIN +#undef MAX +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define MAX(a, b) ((a) > (b) ? (a) : (b)) + +typedef struct { + U32 cSize; + U32 dSize; + U32 checksum; +} framelogEntry_t; + +struct ZSTD_frameLog_s { + framelogEntry_t* entries; + U32 size; + U32 capacity; + + int checksumFlag; + + /* for use when streaming out the seek table */ + U32 seekTablePos; + U32 seekTableIndex; +} framelog_t; + +struct ZSTD_seekable_CStream_s { + ZSTD_CStream* cstream; + ZSTD_frameLog framelog; + + U32 frameCSize; + U32 frameDSize; + + XXH64_state_t xxhState; + + U32 maxFrameSize; + + int writingSeekTable; +}; + +size_t ZSTD_seekable_frameLog_allocVec(ZSTD_frameLog* fl) +{ + /* allocate some initial space */ + size_t const FRAMELOG_STARTING_CAPACITY = 16; + fl->entries = (framelogEntry_t*)malloc( + sizeof(framelogEntry_t) * FRAMELOG_STARTING_CAPACITY); + if (fl->entries == NULL) return ERROR(memory_allocation); + fl->capacity = FRAMELOG_STARTING_CAPACITY; + + return 0; +} + +size_t ZSTD_seekable_frameLog_freeVec(ZSTD_frameLog* fl) +{ + if (fl != NULL) free(fl->entries); + return 0; +} + +ZSTD_frameLog* ZSTD_seekable_createFrameLog(int checksumFlag) +{ + ZSTD_frameLog* fl = malloc(sizeof(ZSTD_frameLog)); + if (fl == NULL) return NULL; + + if (ZSTD_isError(ZSTD_seekable_frameLog_allocVec(fl))) { + free(fl); + return NULL; + } + + fl->checksumFlag = checksumFlag; + fl->seekTablePos = 0; + fl->seekTableIndex = 0; + fl->size = 0; + + return fl; +} + +size_t ZSTD_seekable_freeFrameLog(ZSTD_frameLog* fl) +{ + ZSTD_seekable_frameLog_freeVec(fl); + free(fl); + return 0; +} + +ZSTD_seekable_CStream* ZSTD_seekable_createCStream() +{ + ZSTD_seekable_CStream* zcs = malloc(sizeof(ZSTD_seekable_CStream)); + + if (zcs == NULL) return NULL; + + memset(zcs, 0, sizeof(*zcs)); + + zcs->cstream = ZSTD_createCStream(); + if (zcs->cstream == NULL) goto failed1; + + if (ZSTD_isError(ZSTD_seekable_frameLog_allocVec(&zcs->framelog))) goto failed2; + + return zcs; + +failed2: + ZSTD_freeCStream(zcs->cstream); +failed1: + free(zcs); + return NULL; +} + +size_t ZSTD_seekable_freeCStream(ZSTD_seekable_CStream* zcs) +{ + if (zcs == NULL) return 0; /* support free on null */ + ZSTD_freeCStream(zcs->cstream); + ZSTD_seekable_frameLog_freeVec(&zcs->framelog); + free(zcs); + + return 0; +} + +size_t ZSTD_seekable_initCStream(ZSTD_seekable_CStream* zcs, + int compressionLevel, + int checksumFlag, + U32 maxFrameSize) +{ + zcs->framelog.size = 0; + zcs->frameCSize = 0; + zcs->frameDSize = 0; + + /* make sure maxFrameSize has a reasonable value */ + if (maxFrameSize > ZSTD_SEEKABLE_MAX_FRAME_DECOMPRESSED_SIZE) { + return ERROR(compressionParameter_unsupported); + } + + zcs->maxFrameSize = maxFrameSize + ? maxFrameSize + : ZSTD_SEEKABLE_MAX_FRAME_DECOMPRESSED_SIZE; + + zcs->framelog.checksumFlag = checksumFlag; + if (zcs->framelog.checksumFlag) { + XXH64_reset(&zcs->xxhState, 0); + } + + zcs->framelog.seekTablePos = 0; + zcs->framelog.seekTableIndex = 0; + zcs->writingSeekTable = 0; + + return ZSTD_initCStream(zcs->cstream, compressionLevel); +} + +size_t ZSTD_seekable_logFrame(ZSTD_frameLog* fl, + unsigned compressedSize, + unsigned decompressedSize, + unsigned checksum) +{ + if (fl->size == ZSTD_SEEKABLE_MAXFRAMES) + return ERROR(frameIndex_tooLarge); + + /* grow the buffer if required */ + if (fl->size == fl->capacity) { + /* exponential size increase for constant amortized runtime */ + size_t const newCapacity = fl->capacity * 2; + framelogEntry_t* const newEntries = realloc(fl->entries, + sizeof(framelogEntry_t) * newCapacity); + + if (newEntries == NULL) return ERROR(memory_allocation); + + fl->entries = newEntries; + fl->capacity = newCapacity; + } + + fl->entries[fl->size] = (framelogEntry_t){ + compressedSize, decompressedSize, checksum + }; + fl->size++; + + return 0; +} + +size_t ZSTD_seekable_endFrame(ZSTD_seekable_CStream* zcs, ZSTD_outBuffer* output) +{ + size_t const prevOutPos = output->pos; + /* end the frame */ + size_t ret = ZSTD_endStream(zcs->cstream, output); + + zcs->frameCSize += output->pos - prevOutPos; + + /* need to flush before doing the rest */ + if (ret) return ret; + + /* frame done */ + + /* store the frame data for later */ + ret = ZSTD_seekable_logFrame( + &zcs->framelog, zcs->frameCSize, zcs->frameDSize, + zcs->framelog.checksumFlag + ? XXH64_digest(&zcs->xxhState) & 0xFFFFFFFFU + : 0); + if (ret) return ret; + + /* reset for the next frame */ + zcs->frameCSize = 0; + zcs->frameDSize = 0; + + ZSTD_resetCStream(zcs->cstream, 0); + if (zcs->framelog.checksumFlag) + XXH64_reset(&zcs->xxhState, 0); + + return 0; +} + +size_t ZSTD_seekable_compressStream(ZSTD_seekable_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input) +{ + const BYTE* const inBase = (const BYTE*) input->src + input->pos; + size_t inLen = input->size - input->pos; + + inLen = MIN(inLen, (size_t)(zcs->maxFrameSize - zcs->frameDSize)); + + /* if we haven't finished flushing the last frame, don't start writing a new one */ + if (inLen > 0) { + ZSTD_inBuffer inTmp = { inBase, inLen, 0 }; + size_t const prevOutPos = output->pos; + + size_t const ret = ZSTD_compressStream(zcs->cstream, output, &inTmp); + + if (zcs->framelog.checksumFlag) { + XXH64_update(&zcs->xxhState, inBase, inTmp.pos); + } + + zcs->frameCSize += output->pos - prevOutPos; + zcs->frameDSize += inTmp.pos; + + input->pos += inTmp.pos; + + if (ZSTD_isError(ret)) return ret; + } + + if (zcs->maxFrameSize == zcs->frameDSize) { + /* log the frame and start over */ + size_t const ret = ZSTD_seekable_endFrame(zcs, output); + if (ZSTD_isError(ret)) return ret; + + /* get the client ready for the next frame */ + return (size_t)zcs->maxFrameSize; + } + + return (size_t)(zcs->maxFrameSize - zcs->frameDSize); +} + +static inline size_t ZSTD_seekable_seekTableSize(const ZSTD_frameLog* fl) +{ + size_t const sizePerFrame = 8 + (fl->checksumFlag?4:0); + size_t const seekTableLen = ZSTD_skippableHeaderSize + + sizePerFrame * fl->size + + ZSTD_seekTableFooterSize; + + return seekTableLen; +} + +static inline size_t ZSTD_stwrite32(ZSTD_frameLog* fl, + ZSTD_outBuffer* output, U32 const value, + U32 const offset) +{ + if (fl->seekTablePos < offset + 4) { + BYTE tmp[4]; /* so that we can work with buffers too small to write a whole word to */ + size_t const lenWrite = + MIN(output->size - output->pos, offset + 4 - fl->seekTablePos); + MEM_writeLE32(tmp, value); + memcpy((BYTE*)output->dst + output->pos, + tmp + (fl->seekTablePos - offset), lenWrite); + output->pos += lenWrite; + fl->seekTablePos += lenWrite; + + if (lenWrite < 4) return ZSTD_seekable_seekTableSize(fl) - fl->seekTablePos; + } + return 0; +} + +size_t ZSTD_seekable_writeSeekTable(ZSTD_frameLog* fl, ZSTD_outBuffer* output) +{ + /* seekTableIndex: the current index in the table and + * seekTableSize: the amount of the table written so far + * + * This function is written this way so that if it has to return early + * because of a small buffer, it can keep going where it left off. + */ + + size_t const sizePerFrame = 8 + (fl->checksumFlag?4:0); + size_t const seekTableLen = ZSTD_seekable_seekTableSize(fl); + + CHECK_Z(ZSTD_stwrite32(fl, output, ZSTD_MAGIC_SKIPPABLE_START | 0xE, 0)); + CHECK_Z(ZSTD_stwrite32(fl, output, seekTableLen - ZSTD_skippableHeaderSize, + 4)); + + while (fl->seekTableIndex < fl->size) { + CHECK_Z(ZSTD_stwrite32(fl, output, + fl->entries[fl->seekTableIndex].cSize, + ZSTD_skippableHeaderSize + + sizePerFrame * fl->seekTableIndex + 0)); + + CHECK_Z(ZSTD_stwrite32(fl, output, + fl->entries[fl->seekTableIndex].dSize, + ZSTD_skippableHeaderSize + + sizePerFrame * fl->seekTableIndex + 4)); + + if (fl->checksumFlag) { + CHECK_Z(ZSTD_stwrite32( + fl, output, fl->entries[fl->seekTableIndex].checksum, + ZSTD_skippableHeaderSize + + sizePerFrame * fl->seekTableIndex + 8)); + } + + fl->seekTableIndex++; + } + + CHECK_Z(ZSTD_stwrite32(fl, output, fl->size, + seekTableLen - ZSTD_seekTableFooterSize)); + + if (output->size - output->pos < 1) return seekTableLen - fl->seekTablePos; + if (fl->seekTablePos < seekTableLen - 4) { + BYTE sfd = 0; + sfd |= (fl->checksumFlag) << 7; + + ((BYTE*)output->dst)[output->pos] = sfd; + output->pos++; + fl->seekTablePos++; + } + + CHECK_Z(ZSTD_stwrite32(fl, output, ZSTD_SEEKABLE_MAGICNUMBER, + seekTableLen - 4)); + + if (fl->seekTablePos != seekTableLen) return ERROR(GENERIC); + return 0; +} + +size_t ZSTD_seekable_endStream(ZSTD_seekable_CStream* zcs, ZSTD_outBuffer* output) +{ + if (!zcs->writingSeekTable && zcs->frameDSize) { + const size_t endFrame = ZSTD_seekable_endFrame(zcs, output); + if (ZSTD_isError(endFrame)) return endFrame; + /* return an accurate size hint */ + if (endFrame) return endFrame + ZSTD_seekable_seekTableSize(&zcs->framelog); + } + + zcs->writingSeekTable = 1; + + return ZSTD_seekable_writeSeekTable(&zcs->framelog, output); +} diff --git a/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c b/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c new file mode 100644 index 000000000000..d740e16be465 --- /dev/null +++ b/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c @@ -0,0 +1,462 @@ +/* + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +/* ********************************************************* +* Turn on Large Files support (>4GB) for 32-bit Linux/Unix +***********************************************************/ +#if !defined(__64BIT__) || defined(__MINGW32__) /* No point defining Large file for 64 bit but MinGW-w64 requires it */ +# if !defined(_FILE_OFFSET_BITS) +# define _FILE_OFFSET_BITS 64 /* turn off_t into a 64-bit type for ftello, fseeko */ +# endif +# if !defined(_LARGEFILE_SOURCE) /* obsolete macro, replaced with _FILE_OFFSET_BITS */ +# define _LARGEFILE_SOURCE 1 /* Large File Support extension (LFS) - fseeko, ftello */ +# endif +# if defined(_AIX) || defined(__hpux) +# define _LARGE_FILES /* Large file support on 32-bits AIX and HP-UX */ +# endif +#endif + +/* ************************************************************ +* Avoid fseek()'s 2GiB barrier with MSVC, MacOS, *BSD, MinGW +***************************************************************/ +#if defined(_MSC_VER) && _MSC_VER >= 1400 +# define LONG_SEEK _fseeki64 +#elif !defined(__64BIT__) && (PLATFORM_POSIX_VERSION >= 200112L) /* No point defining Large file for 64 bit */ +# define LONG_SEEK fseeko +#elif defined(__MINGW32__) && !defined(__STRICT_ANSI__) && !defined(__NO_MINGW_LFS) && defined(__MSVCRT__) +# define LONG_SEEK fseeko64 +#elif defined(_WIN32) && !defined(__DJGPP__) +# include + static int LONG_SEEK(FILE* file, __int64 offset, int origin) { + LARGE_INTEGER off; + DWORD method; + off.QuadPart = offset; + if (origin == SEEK_END) + method = FILE_END; + else if (origin == SEEK_CUR) + method = FILE_CURRENT; + else + method = FILE_BEGIN; + + if (SetFilePointerEx((HANDLE) _get_osfhandle(_fileno(file)), off, NULL, method)) + return 0; + else + return -1; + } +#else +# define LONG_SEEK fseek +#endif + +#include /* malloc, free */ +#include /* FILE* */ + +#define XXH_STATIC_LINKING_ONLY +#define XXH_NAMESPACE ZSTD_ +#include "xxhash.h" + +#define ZSTD_STATIC_LINKING_ONLY +#include "zstd.h" +#include "zstd_errors.h" +#include "mem.h" +#include "zstd_seekable.h" + +#undef ERROR +#define ERROR(name) ((size_t)-ZSTD_error_##name) + +#define CHECK_IO(f) { int const errcod = (f); if (errcod < 0) return ERROR(seekableIO); } + +#undef MIN +#undef MAX +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define MAX(a, b) ((a) > (b) ? (a) : (b)) + +/* Special-case callbacks for FILE* and in-memory modes, so that we can treat + * them the same way as the advanced API */ +static int ZSTD_seekable_read_FILE(void* opaque, void* buffer, size_t n) +{ + size_t const result = fread(buffer, 1, n, (FILE*)opaque); + if (result != n) { + return -1; + } + return 0; +} + +static int ZSTD_seekable_seek_FILE(void* opaque, S64 offset, int origin) +{ + int const ret = LONG_SEEK((FILE*)opaque, offset, origin); + if (ret) return ret; + return fflush((FILE*)opaque); +} + +typedef struct { + const void *ptr; + size_t size; + size_t pos; +} buffWrapper_t; + +static int ZSTD_seekable_read_buff(void* opaque, void* buffer, size_t n) +{ + buffWrapper_t* buff = (buffWrapper_t*) opaque; + if (buff->size + n > buff->pos) return -1; + memcpy(buffer, (const BYTE*)buff->ptr + buff->pos, n); + buff->pos += n; + return 0; +} + +static int ZSTD_seekable_seek_buff(void* opaque, S64 offset, int origin) +{ + buffWrapper_t* buff = (buffWrapper_t*) opaque; + unsigned long long newOffset; + switch (origin) { + case SEEK_SET: + newOffset = offset; + break; + case SEEK_CUR: + newOffset = (unsigned long long)buff->pos + offset; + break; + case SEEK_END: + newOffset = (unsigned long long)buff->size - offset; + break; + } + if (newOffset < 0 || newOffset > buff->size) { + return -1; + } + buff->pos = newOffset; + return 0; +} + +typedef struct { + U64 cOffset; + U64 dOffset; + U32 checksum; +} seekEntry_t; + +typedef struct { + seekEntry_t* entries; + size_t tableLen; + + int checksumFlag; +} seekTable_t; + +#define SEEKABLE_BUFF_SIZE ZSTD_BLOCKSIZE_ABSOLUTEMAX + +struct ZSTD_seekable_s { + ZSTD_DStream* dstream; + seekTable_t seekTable; + ZSTD_seekable_customFile src; + + U64 decompressedOffset; + U32 curFrame; + + BYTE inBuff[SEEKABLE_BUFF_SIZE]; /* need to do our own input buffering */ + BYTE outBuff[SEEKABLE_BUFF_SIZE]; /* so we can efficiently decompress the + starts of chunks before we get to the + desired section */ + ZSTD_inBuffer in; /* maintain continuity across ZSTD_seekable_decompress operations */ + buffWrapper_t buffWrapper; /* for `src.opaque` in in-memory mode */ + + XXH64_state_t xxhState; +}; + +ZSTD_seekable* ZSTD_seekable_create(void) +{ + ZSTD_seekable* zs = malloc(sizeof(ZSTD_seekable)); + + if (zs == NULL) return NULL; + + /* also initializes stage to zsds_init */ + memset(zs, 0, sizeof(*zs)); + + zs->dstream = ZSTD_createDStream(); + if (zs->dstream == NULL) { + free(zs); + return NULL; + } + + return zs; +} + +size_t ZSTD_seekable_free(ZSTD_seekable* zs) +{ + if (zs == NULL) return 0; /* support free on null */ + ZSTD_freeDStream(zs->dstream); + free(zs->seekTable.entries); + free(zs); + + return 0; +} + +/** ZSTD_seekable_offsetToFrameIndex() : + * Performs a binary search to find the last frame with a decompressed offset + * <= pos + * @return : the frame's index */ +U32 ZSTD_seekable_offsetToFrameIndex(ZSTD_seekable* const zs, U64 pos) +{ + U32 lo = 0; + U32 hi = zs->seekTable.tableLen; + + if (pos >= zs->seekTable.entries[zs->seekTable.tableLen].dOffset) { + return zs->seekTable.tableLen; + } + + while (lo + 1 < hi) { + U32 const mid = lo + ((hi - lo) >> 1); + if (zs->seekTable.entries[mid].dOffset <= pos) { + lo = mid; + } else { + hi = mid; + } + } + return lo; +} + +U32 ZSTD_seekable_getNumFrames(ZSTD_seekable* const zs) +{ + return zs->seekTable.tableLen; +} + +U64 ZSTD_seekable_getFrameCompressedOffset(ZSTD_seekable* const zs, U32 frameIndex) +{ + if (frameIndex >= zs->seekTable.tableLen) return ZSTD_SEEKABLE_FRAMEINDEX_TOOLARGE; + return zs->seekTable.entries[frameIndex].cOffset; +} + +U64 ZSTD_seekable_getFrameDecompressedOffset(ZSTD_seekable* const zs, U32 frameIndex) +{ + if (frameIndex >= zs->seekTable.tableLen) return ZSTD_SEEKABLE_FRAMEINDEX_TOOLARGE; + return zs->seekTable.entries[frameIndex].dOffset; +} + +size_t ZSTD_seekable_getFrameCompressedSize(ZSTD_seekable* const zs, U32 frameIndex) +{ + if (frameIndex >= zs->seekTable.tableLen) return ERROR(frameIndex_tooLarge); + return zs->seekTable.entries[frameIndex + 1].cOffset - + zs->seekTable.entries[frameIndex].cOffset; +} + +size_t ZSTD_seekable_getFrameDecompressedSize(ZSTD_seekable* const zs, U32 frameIndex) +{ + if (frameIndex > zs->seekTable.tableLen) return ERROR(frameIndex_tooLarge); + return zs->seekTable.entries[frameIndex + 1].dOffset - + zs->seekTable.entries[frameIndex].dOffset; +} + +static size_t ZSTD_seekable_loadSeekTable(ZSTD_seekable* zs) +{ + int checksumFlag; + ZSTD_seekable_customFile src = zs->src; + /* read the footer, fixed size */ + CHECK_IO(src.seek(src.opaque, -(int)ZSTD_seekTableFooterSize, SEEK_END)); + CHECK_IO(src.read(src.opaque, zs->inBuff, ZSTD_seekTableFooterSize)); + + if (MEM_readLE32(zs->inBuff + 5) != ZSTD_SEEKABLE_MAGICNUMBER) { + return ERROR(prefix_unknown); + } + + { BYTE const sfd = zs->inBuff[4]; + checksumFlag = sfd >> 7; + + /* check reserved bits */ + if ((checksumFlag >> 2) & 0x1f) { + return ERROR(corruption_detected); + } + } + + { U32 const numFrames = MEM_readLE32(zs->inBuff); + U32 const sizePerEntry = 8 + (checksumFlag?4:0); + U32 const tableSize = sizePerEntry * numFrames; + U32 const frameSize = tableSize + ZSTD_seekTableFooterSize + ZSTD_skippableHeaderSize; + + U32 remaining = frameSize - ZSTD_seekTableFooterSize; /* don't need to re-read footer */ + { + U32 const toRead = MIN(remaining, SEEKABLE_BUFF_SIZE); + + CHECK_IO(src.seek(src.opaque, -(S64)frameSize, SEEK_END)); + CHECK_IO(src.read(src.opaque, zs->inBuff, toRead)); + + remaining -= toRead; + } + + if (MEM_readLE32(zs->inBuff) != (ZSTD_MAGIC_SKIPPABLE_START | 0xE)) { + return ERROR(prefix_unknown); + } + if (MEM_readLE32(zs->inBuff+4) + ZSTD_skippableHeaderSize != frameSize) { + return ERROR(prefix_unknown); + } + + { /* Allocate an extra entry at the end so that we can do size + * computations on the last element without special case */ + seekEntry_t* entries = (seekEntry_t*)malloc(sizeof(seekEntry_t) * (numFrames + 1)); + const BYTE* tableBase = zs->inBuff + ZSTD_skippableHeaderSize; + + U32 idx = 0; + U32 pos = 8; + + + U64 cOffset = 0; + U64 dOffset = 0; + + if (!entries) { + free(entries); + return ERROR(memory_allocation); + } + + /* compute cumulative positions */ + for (; idx < numFrames; idx++) { + if (pos + sizePerEntry > SEEKABLE_BUFF_SIZE) { + U32 const toRead = MIN(remaining, SEEKABLE_BUFF_SIZE); + U32 const offset = SEEKABLE_BUFF_SIZE - pos; + memmove(zs->inBuff, zs->inBuff + pos, offset); /* move any data we haven't read yet */ + CHECK_IO(src.read(src.opaque, zs->inBuff+offset, toRead)); + remaining -= toRead; + pos = 0; + } + entries[idx].cOffset = cOffset; + entries[idx].dOffset = dOffset; + + cOffset += MEM_readLE32(zs->inBuff + pos); + pos += 4; + dOffset += MEM_readLE32(zs->inBuff + pos); + pos += 4; + if (checksumFlag) { + entries[idx].checksum = MEM_readLE32(zs->inBuff + pos); + pos += 4; + } + } + entries[numFrames].cOffset = cOffset; + entries[numFrames].dOffset = dOffset; + + zs->seekTable.entries = entries; + zs->seekTable.tableLen = numFrames; + zs->seekTable.checksumFlag = checksumFlag; + return 0; + } + } +} + +size_t ZSTD_seekable_initBuff(ZSTD_seekable* zs, const void* src, size_t srcSize) +{ + zs->buffWrapper = (buffWrapper_t){src, srcSize, 0}; + { ZSTD_seekable_customFile srcFile = {&zs->buffWrapper, + &ZSTD_seekable_read_buff, + &ZSTD_seekable_seek_buff}; + return ZSTD_seekable_initAdvanced(zs, srcFile); } +} + +size_t ZSTD_seekable_initFile(ZSTD_seekable* zs, FILE* src) +{ + ZSTD_seekable_customFile srcFile = {src, &ZSTD_seekable_read_FILE, + &ZSTD_seekable_seek_FILE}; + return ZSTD_seekable_initAdvanced(zs, srcFile); +} + +size_t ZSTD_seekable_initAdvanced(ZSTD_seekable* zs, ZSTD_seekable_customFile src) +{ + zs->src = src; + + { const size_t seekTableInit = ZSTD_seekable_loadSeekTable(zs); + if (ZSTD_isError(seekTableInit)) return seekTableInit; } + + zs->decompressedOffset = (U64)-1; + zs->curFrame = (U32)-1; + + { const size_t dstreamInit = ZSTD_initDStream(zs->dstream); + if (ZSTD_isError(dstreamInit)) return dstreamInit; } + return 0; +} + +size_t ZSTD_seekable_decompress(ZSTD_seekable* zs, void* dst, size_t len, U64 offset) +{ + U32 targetFrame = ZSTD_seekable_offsetToFrameIndex(zs, offset); + do { + /* check if we can continue from a previous decompress job */ + if (targetFrame != zs->curFrame || offset != zs->decompressedOffset) { + zs->decompressedOffset = zs->seekTable.entries[targetFrame].dOffset; + zs->curFrame = targetFrame; + + CHECK_IO(zs->src.seek(zs->src.opaque, + zs->seekTable.entries[targetFrame].cOffset, + SEEK_SET)); + zs->in = (ZSTD_inBuffer){zs->inBuff, 0, 0}; + XXH64_reset(&zs->xxhState, 0); + ZSTD_resetDStream(zs->dstream); + } + + while (zs->decompressedOffset < offset + len) { + size_t toRead; + ZSTD_outBuffer outTmp; + size_t prevOutPos; + if (zs->decompressedOffset < offset) { + /* dummy decompressions until we get to the target offset */ + outTmp = (ZSTD_outBuffer){zs->outBuff, MIN(SEEKABLE_BUFF_SIZE, offset - zs->decompressedOffset), 0}; + } else { + outTmp = (ZSTD_outBuffer){dst, len, zs->decompressedOffset - offset}; + } + + prevOutPos = outTmp.pos; + toRead = ZSTD_decompressStream(zs->dstream, &outTmp, &zs->in); + if (ZSTD_isError(toRead)) { + return toRead; + } + + if (zs->seekTable.checksumFlag) { + XXH64_update(&zs->xxhState, (BYTE*)outTmp.dst + prevOutPos, + outTmp.pos - prevOutPos); + } + zs->decompressedOffset += outTmp.pos - prevOutPos; + + if (toRead == 0) { + /* frame complete */ + + /* verify checksum */ + if (zs->seekTable.checksumFlag && + (XXH64_digest(&zs->xxhState) & 0xFFFFFFFFU) != + zs->seekTable.entries[targetFrame].checksum) { + return ERROR(corruption_detected); + } + + if (zs->decompressedOffset < offset + len) { + /* go back to the start and force a reset of the stream */ + targetFrame = ZSTD_seekable_offsetToFrameIndex(zs, zs->decompressedOffset); + } + break; + } + + /* read in more data if we're done with this buffer */ + if (zs->in.pos == zs->in.size) { + toRead = MIN(toRead, SEEKABLE_BUFF_SIZE); + CHECK_IO(zs->src.read(zs->src.opaque, zs->inBuff, toRead)); + zs->in.size = toRead; + zs->in.pos = 0; + } + } + } while (zs->decompressedOffset != offset + len); + + return len; +} + +size_t ZSTD_seekable_decompressFrame(ZSTD_seekable* zs, void* dst, size_t dstSize, U32 frameIndex) +{ + if (frameIndex >= zs->seekTable.tableLen) { + return ERROR(frameIndex_tooLarge); + } + + { + size_t const decompressedSize = + zs->seekTable.entries[frameIndex + 1].dOffset - + zs->seekTable.entries[frameIndex].dOffset; + if (dstSize < decompressedSize) { + return ERROR(dstSize_tooSmall); + } + return ZSTD_seekable_decompress( + zs, dst, decompressedSize, + zs->seekTable.entries[frameIndex].dOffset); + } +} diff --git a/contrib/zstd/doc/README.md b/sys/contrib/zstd/doc/README.md similarity index 100% rename from contrib/zstd/doc/README.md rename to sys/contrib/zstd/doc/README.md diff --git a/sys/contrib/zstd/doc/educational_decoder/Makefile b/sys/contrib/zstd/doc/educational_decoder/Makefile new file mode 100644 index 000000000000..ace1294f8e73 --- /dev/null +++ b/sys/contrib/zstd/doc/educational_decoder/Makefile @@ -0,0 +1,34 @@ +HARNESS_FILES=*.c + +MULTITHREAD_LDFLAGS = -pthread +DEBUGFLAGS= -g -DZSTD_DEBUG=1 +CPPFLAGS += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \ + -I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR) +CFLAGS ?= -O3 +CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ + -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \ + -Wstrict-prototypes -Wundef -Wformat-security \ + -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \ + -Wredundant-decls +CFLAGS += $(DEBUGFLAGS) +CFLAGS += $(MOREFLAGS) +FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MULTITHREAD_LDFLAGS) + +harness: $(HARNESS_FILES) + $(CC) $(FLAGS) $^ -o $@ + +clean: + @$(RM) -f harness + @$(RM) -rf harness.dSYM + +test: harness + @zstd README.md -o tmp.zst + @./harness tmp.zst tmp + @diff -s tmp README.md + @$(RM) -f tmp* + @zstd --train harness.c zstd_decompress.c zstd_decompress.h README.md + @zstd -D dictionary README.md -o tmp.zst + @./harness tmp.zst tmp dictionary + @diff -s tmp README.md + @$(RM) -f tmp* dictionary + @make clean diff --git a/contrib/zstd/doc/educational_decoder/README.md b/sys/contrib/zstd/doc/educational_decoder/README.md similarity index 100% rename from contrib/zstd/doc/educational_decoder/README.md rename to sys/contrib/zstd/doc/educational_decoder/README.md diff --git a/contrib/zstd/doc/educational_decoder/harness.c b/sys/contrib/zstd/doc/educational_decoder/harness.c similarity index 93% rename from contrib/zstd/doc/educational_decoder/harness.c rename to sys/contrib/zstd/doc/educational_decoder/harness.c index 982e066e28f0..47882b168953 100644 --- a/contrib/zstd/doc/educational_decoder/harness.c +++ b/sys/contrib/zstd/doc/educational_decoder/harness.c @@ -2,9 +2,9 @@ * Copyright (c) 2017-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include diff --git a/contrib/zstd/doc/educational_decoder/zstd_decompress.c b/sys/contrib/zstd/doc/educational_decoder/zstd_decompress.c similarity index 99% rename from contrib/zstd/doc/educational_decoder/zstd_decompress.c rename to sys/contrib/zstd/doc/educational_decoder/zstd_decompress.c index af10db528d2a..bea0e0ce1f45 100644 --- a/contrib/zstd/doc/educational_decoder/zstd_decompress.c +++ b/sys/contrib/zstd/doc/educational_decoder/zstd_decompress.c @@ -2,9 +2,9 @@ * Copyright (c) 2017-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ /// Zstandard educational decoder implementation @@ -1289,7 +1289,7 @@ static void execute_sequences(frame_context_t *const ctx, ostream_t *const out, // Copy any leftover literals { size_t len = IO_istream_len(&litstream); - copy_literals(len, &litstream, out); + copy_literals(len, &litstream, out); total_output += len; } diff --git a/contrib/zstd/doc/educational_decoder/zstd_decompress.h b/sys/contrib/zstd/doc/educational_decoder/zstd_decompress.h similarity index 88% rename from contrib/zstd/doc/educational_decoder/zstd_decompress.h rename to sys/contrib/zstd/doc/educational_decoder/zstd_decompress.h index 41009909bfa1..a01fde331fb8 100644 --- a/contrib/zstd/doc/educational_decoder/zstd_decompress.h +++ b/sys/contrib/zstd/doc/educational_decoder/zstd_decompress.h @@ -1,10 +1,10 @@ /* - * Copyright (c) 2017-present, Facebook, Inc. + * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ /******* EXPOSED TYPES ********************************************************/ diff --git a/contrib/zstd/doc/images/Cspeed4.png b/sys/contrib/zstd/doc/images/Cspeed4.png similarity index 100% rename from contrib/zstd/doc/images/Cspeed4.png rename to sys/contrib/zstd/doc/images/Cspeed4.png diff --git a/contrib/zstd/doc/images/DCspeed5.png b/sys/contrib/zstd/doc/images/DCspeed5.png similarity index 100% rename from contrib/zstd/doc/images/DCspeed5.png rename to sys/contrib/zstd/doc/images/DCspeed5.png diff --git a/contrib/zstd/doc/images/Dspeed4.png b/sys/contrib/zstd/doc/images/Dspeed4.png similarity index 100% rename from contrib/zstd/doc/images/Dspeed4.png rename to sys/contrib/zstd/doc/images/Dspeed4.png diff --git a/contrib/zstd/doc/images/dict-cr.png b/sys/contrib/zstd/doc/images/dict-cr.png similarity index 100% rename from contrib/zstd/doc/images/dict-cr.png rename to sys/contrib/zstd/doc/images/dict-cr.png diff --git a/contrib/zstd/doc/images/dict-cs.png b/sys/contrib/zstd/doc/images/dict-cs.png similarity index 100% rename from contrib/zstd/doc/images/dict-cs.png rename to sys/contrib/zstd/doc/images/dict-cs.png diff --git a/contrib/zstd/doc/images/dict-ds.png b/sys/contrib/zstd/doc/images/dict-ds.png similarity index 100% rename from contrib/zstd/doc/images/dict-ds.png rename to sys/contrib/zstd/doc/images/dict-ds.png diff --git a/contrib/zstd/doc/zstd_compression_format.md b/sys/contrib/zstd/doc/zstd_compression_format.md similarity index 100% rename from contrib/zstd/doc/zstd_compression_format.md rename to sys/contrib/zstd/doc/zstd_compression_format.md diff --git a/contrib/zstd/doc/zstd_manual.html b/sys/contrib/zstd/doc/zstd_manual.html similarity index 73% rename from contrib/zstd/doc/zstd_manual.html rename to sys/contrib/zstd/doc/zstd_manual.html index c166e7258d32..b4720adac263 100644 --- a/contrib/zstd/doc/zstd_manual.html +++ b/sys/contrib/zstd/doc/zstd_manual.html @@ -1,10 +1,10 @@ -zstd 1.3.1 Manual +zstd 1.3.2 Manual -

zstd 1.3.1 Manual

+

zstd 1.3.2 Manual


Contents

    @@ -27,7 +27,8 @@
  1. Buffer-less and synchronous inner streaming functions
  2. Buffer-less streaming compression (synchronous mode)
  3. Buffer-less streaming decompression (synchronous mode)
  4. -
  5. Block functions
  6. +
  7. New advanced API (experimental)
  8. +
  9. Block level API

Introduction

@@ -110,10 +111,11 @@ unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize);
   @return : content size to be decompressed, as a 64-bits value _if known and not empty_, 0 otherwise. 
 


-

Helper functions

int         ZSTD_maxCLevel(void);               /*!< maximum compression level available */
+

Helper functions

#define ZSTD_COMPRESSBOUND(srcSize)   ((srcSize) + ((srcSize)>>8) + (((srcSize) < 128 KB) ? ((128 KB - (srcSize)) >> 11) /* margin, from 64 to 0 */ : 0))  /* this formula ensures that bound(A) + bound(B) <= bound(A+B) as long as A and B >= 128 KB */
 size_t      ZSTD_compressBound(size_t srcSize); /*!< maximum compressed size in worst case scenario */
 unsigned    ZSTD_isError(size_t code);          /*!< tells if a `size_t` function result is an error code */
 const char* ZSTD_getErrorName(size_t code);     /*!< provides readable string from an error code */
+int         ZSTD_maxCLevel(void);               /*!< maximum compression level available */
 

Explicit memory management


 
@@ -398,29 +400,33 @@ size_t ZSTD_sizeof_DStream(const ZSTD_DStream* zds);
 size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict);
 size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
 

These functions give the current memory usage of selected object. - Object memory usage can evolve if it's re-used multiple times. + Object memory usage can evolve when re-used multiple times.


size_t ZSTD_estimateCCtxSize(int compressionLevel);
-size_t ZSTD_estimateCCtxSize_advanced(ZSTD_compressionParameters cParams);
+size_t ZSTD_estimateCCtxSize_usingCParams(ZSTD_compressionParameters cParams);
+size_t ZSTD_estimateCCtxSize_usingCCtxParams(const ZSTD_CCtx_params* params);
 size_t ZSTD_estimateDCtxSize(void);
 

These functions make it possible to estimate memory usage of a future {D,C}Ctx, before its creation. ZSTD_estimateCCtxSize() will provide a budget large enough for any compression level up to selected one. It will also consider src size to be arbitrarily "large", which is worst case. - If srcSize is known to always be small, ZSTD_estimateCCtxSize_advanced() can provide a tighter estimation. - ZSTD_estimateCCtxSize_advanced() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel. + If srcSize is known to always be small, ZSTD_estimateCCtxSize_usingCParams() can provide a tighter estimation. + ZSTD_estimateCCtxSize_usingCParams() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel. + ZSTD_estimateCCtxSize_usingCCtxParams() can be used in tandem with ZSTD_CCtxParam_setParameter(). Only single-threaded compression is supported. This function will return an error code if ZSTD_p_nbThreads is > 1. Note : CCtx estimation is only correct for single-threaded compression


size_t ZSTD_estimateCStreamSize(int compressionLevel);
-size_t ZSTD_estimateCStreamSize_advanced(ZSTD_compressionParameters cParams);
+size_t ZSTD_estimateCStreamSize_usingCParams(ZSTD_compressionParameters cParams);
+size_t ZSTD_estimateCStreamSize_usingCCtxParams(const ZSTD_CCtx_params* params);
 size_t ZSTD_estimateDStreamSize(size_t windowSize);
 size_t ZSTD_estimateDStreamSize_fromFrame(const void* src, size_t srcSize);
 

ZSTD_estimateCStreamSize() will provide a budget large enough for any compression level up to selected one. It will also consider src size to be arbitrarily "large", which is worst case. - If srcSize is known to always be small, ZSTD_estimateCStreamSize_advanced() can provide a tighter estimation. - ZSTD_estimateCStreamSize_advanced() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel. + If srcSize is known to always be small, ZSTD_estimateCStreamSize_usingCParams() can provide a tighter estimation. + ZSTD_estimateCStreamSize_usingCParams() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel. + ZSTD_estimateCStreamSize_usingCCtxParams() can be used in tandem with ZSTD_CCtxParam_setParameter(). Only single-threaded compression is supported. This function will return an error code if ZSTD_p_nbThreads is set to a value > 1. Note : CStream estimation is only correct for single-threaded compression. ZSTD_DStream memory budget depends on window Size. This information can be passed manually, using ZSTD_estimateDStreamSize, @@ -430,12 +436,18 @@ size_t ZSTD_estimateDStreamSize_fromFrame(const void* src, size_t srcSize); In this case, get total size by adding ZSTD_estimate?DictSize


+
typedef enum {
+    ZSTD_dlm_byCopy = 0,     /**< Copy dictionary content internally */
+    ZSTD_dlm_byRef,          /**< Reference dictionary content -- the dictionary buffer must outlive its users. */
+} ZSTD_dictLoadMethod_e;
+

size_t ZSTD_estimateCDictSize(size_t dictSize, int compressionLevel);
-size_t ZSTD_estimateCDictSize_advanced(size_t dictSize, ZSTD_compressionParameters cParams, unsigned byReference);
-size_t ZSTD_estimateDDictSize(size_t dictSize, unsigned byReference);
+size_t ZSTD_estimateCDictSize_advanced(size_t dictSize, ZSTD_compressionParameters cParams, ZSTD_dictLoadMethod_e dictLoadMethod);
+size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod);
 

ZSTD_estimateCDictSize() will bet that src size is relatively "small", and content is copied, like ZSTD_createCDict(). - ZSTD_estimateCStreamSize_advanced() makes it possible to control precisely compression parameters, like ZSTD_createCDict_advanced(). - Note : dictionary created "byReference" are smaller + ZSTD_estimateCStreamSize_advanced_usingCParams() makes it possible to control precisely compression parameters, like ZSTD_createCDict_advanced(). + Note : dictionary created by reference using ZSTD_dlm_byRef are smaller +


Advanced compression functions


@@ -461,16 +473,6 @@ size_t ZSTD_estimateDDictSize(size_t dictSize, unsigned byReference);
  
 


-
typedef enum {
-    ZSTD_p_forceWindow,   /* Force back-references to remain < windowSize, even when referencing Dictionary content (default:0) */
-    ZSTD_p_forceRawDict   /* Force loading dictionary in "content-only" mode (no header analysis) */
-} ZSTD_CCtxParameter;
-

-
size_t ZSTD_setCCtxParameter(ZSTD_CCtx* cctx, ZSTD_CCtxParameter param, unsigned value);
-

Set advanced parameters, selected through enum ZSTD_CCtxParameter - @result : 0, or an error code (which can be tested with ZSTD_isError()) -


-
ZSTD_CDict* ZSTD_createCDict_byReference(const void* dictBuffer, size_t dictSize, int compressionLevel);
 

Create a digested dictionary for compression Dictionary content is simply referenced, and therefore stays in dictBuffer. @@ -483,7 +485,8 @@ size_t ZSTD_estimateDDictSize(size_t dictSize, unsigned byReference); } ZSTD_dictMode_e;


ZSTD_CDict* ZSTD_createCDict_advanced(const void* dict, size_t dictSize,
-                                      unsigned byReference, ZSTD_dictMode_e dictMode,
+                                      ZSTD_dictLoadMethod_e dictLoadMethod,
+                                      ZSTD_dictMode_e dictMode,
                                       ZSTD_compressionParameters cParams,
                                       ZSTD_customMem customMem);
 

Create a ZSTD_CDict using external alloc and free, and customized compression parameters @@ -492,7 +495,7 @@ size_t ZSTD_estimateDDictSize(size_t dictSize, unsigned byReference);

ZSTD_CDict* ZSTD_initStaticCDict(
                 void* workspace, size_t workspaceSize,
           const void* dict, size_t dictSize,
-                unsigned byReference, ZSTD_dictMode_e dictMode,
+                ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictMode_e dictMode,
                 ZSTD_compressionParameters cParams);
 

Generate a digested dictionary in provided memory area. workspace: The memory area to emplace the dictionary into. @@ -580,13 +583,14 @@ size_t ZSTD_estimateDDictSize(size_t dictSize, unsigned byReference);


ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize,
-                                      unsigned byReference, ZSTD_customMem customMem);
+                                      ZSTD_dictLoadMethod_e dictLoadMethod,
+                                      ZSTD_customMem customMem);
 

Create a ZSTD_DDict using external alloc and free, optionally by reference


ZSTD_DDict* ZSTD_initStaticDDict(void* workspace, size_t workspaceSize,
                                  const void* dict, size_t dictSize,
-                                 unsigned byReference);
+                                 ZSTD_dictLoadMethod_e dictLoadMethod);
 

Generate a digested dictionary in provided memory area. workspace: The memory area to emplace the dictionary into. Provided pointer must 8-bytes aligned. @@ -628,9 +632,9 @@ size_t ZSTD_estimateDDictSize(size_t dictSize, unsigned byReference);

Advanced Streaming compression functions

ZSTD_CStream* ZSTD_createCStream_advanced(ZSTD_customMem customMem);
 ZSTD_CStream* ZSTD_initStaticCStream(void* workspace, size_t workspaceSize);    /**< same as ZSTD_initStaticCCtx() */
 size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLevel, unsigned long long pledgedSrcSize);   /**< pledgedSrcSize must be correct, a size of 0 means unknown.  for a frame size of 0 use initCStream_advanced */
-size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compressionLevel); /**< creates of an internal CDict (incompatible with static CCtx), except if dict == NULL or dictSize < 8, in which case no dict is used. */
+size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compressionLevel); /**< creates of an internal CDict (incompatible with static CCtx), except if dict == NULL or dictSize < 8, in which case no dict is used. Note: dict is loaded with ZSTD_dm_auto (treated as a full zstd dictionary if it begins with ZSTD_MAGIC_DICTIONARY, else as raw content) and ZSTD_dlm_byCopy.*/
 size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, const void* dict, size_t dictSize,
-                                             ZSTD_parameters params, unsigned long long pledgedSrcSize);  /**< pledgedSrcSize is optional and can be 0 (meaning unknown). note: if the contentSizeFlag is set, pledgedSrcSize == 0 means the source size is actually 0 */
+                                             ZSTD_parameters params, unsigned long long pledgedSrcSize);  /**< pledgedSrcSize is optional and can be 0 (meaning unknown). note: if the contentSizeFlag is set, pledgedSrcSize == 0 means the source size is actually 0. dict is loaded with ZSTD_dm_auto and ZSTD_dlm_byCopy. */
 size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict);  /**< note : cdict will just be referenced, and must outlive compression session */
 size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, const ZSTD_CDict* cdict, ZSTD_frameParameters fParams, unsigned long long pledgedSrcSize);  /**< same as ZSTD_initCStream_usingCDict(), with control over frame parameters */
 

@@ -643,18 +647,18 @@ size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, const ZSTD_CDict* @return : 0, or an error code (which can be tested using ZSTD_isError())


-

Advanced Streaming decompression functions

typedef enum { DStream_p_maxWindowSize } ZSTD_DStreamParameter_e;
-ZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem);
+

Advanced Streaming decompression functions

ZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem);
 ZSTD_DStream* ZSTD_initStaticDStream(void* workspace, size_t workspaceSize);    /**< same as ZSTD_initStaticDCtx() */
-size_t ZSTD_setDStreamParameter(ZSTD_DStream* zds, ZSTD_DStreamParameter_e paramType, unsigned paramValue);
-size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize); /**< note: a dict will not be used if dict == NULL or dictSize < 8 */
-size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict);  /**< note : ddict will just be referenced, and must outlive decompression session */
+typedef enum { DStream_p_maxWindowSize } ZSTD_DStreamParameter_e;
+size_t ZSTD_setDStreamParameter(ZSTD_DStream* zds, ZSTD_DStreamParameter_e paramType, unsigned paramValue);   /* obsolete : this API will be removed in a future version */
+size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize); /**< note: no dictionary will be used if dict == NULL or dictSize < 8 */
+size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict);  /**< note : ddict is referenced, it must outlive decompression session */
 size_t ZSTD_resetDStream(ZSTD_DStream* zds);  /**< re-use decompression parameters from previous init; saves dictionary loading */
 

Buffer-less and synchronous inner streaming functions

   This is an advanced API, giving full control over buffer management, for users which need direct control over memory.
-  But it's also a complex one, with many restrictions (documented below).
-  Prefer using normal streaming API for an easier experience
+  But it's also a complex one, with several restrictions, documented below.
+  Prefer normal streaming API for an easier experience.
  
 
@@ -670,8 +674,8 @@ size_t ZSTD_resetDStream(ZSTD_DStream* zds);
/**< re-use decompression para Then, consume your input using ZSTD_compressContinue(). There are some important considerations to keep in mind when using this advanced function : - - ZSTD_compressContinue() has no internal buffer. It uses externally provided buffer only. - - Interface is synchronous : input is consumed entirely and produce 1+ (or more) compressed blocks. + - ZSTD_compressContinue() has no internal buffer. It uses externally provided buffers only. + - Interface is synchronous : input is consumed entirely and produces 1+ compressed blocks. - Caller must ensure there is enough space in `dst` to store compressed data under worst case scenario. Worst case evaluation is provided by ZSTD_compressBound(). ZSTD_compressContinue() doesn't guarantee recover after a failed compression. @@ -682,9 +686,9 @@ size_t ZSTD_resetDStream(ZSTD_DStream* zds); /**< re-use decompression para Finish a frame with ZSTD_compressEnd(), which will write the last block(s) and optional checksum. It's possible to use srcSize==0, in which case, it will write a final empty block to end the frame. - Without last block mark, frames will be considered unfinished (corrupted) by decoders. + Without last block mark, frames are considered unfinished (hence corrupted) by compliant decoders. - `ZSTD_CCtx` object can be re-used (ZSTD_compressBegin()) to compress some new frame. + `ZSTD_CCtx` object can be re-used (ZSTD_compressBegin()) to compress again.

Buffer-less streaming compression functions

size_t ZSTD_compressBegin(ZSTD_CCtx* cctx, int compressionLevel);
@@ -700,40 +704,53 @@ size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx* preparedCCtx, unsigned lo
   A ZSTD_DCtx object can be re-used multiple times.
 
   First typical operation is to retrieve frame parameters, using ZSTD_getFrameHeader().
-  It fills a ZSTD_frameHeader structure with important information to correctly decode the frame,
-  such as minimum rolling buffer size to allocate to decompress data (`windowSize`),
-  and the dictionary ID in use.
-  (Note : content size is optional, it may not be present. 0 means : content size unknown).
-  Note that these values could be wrong, either because of data malformation, or because an attacker is spoofing deliberate false information.
-  As a consequence, check that values remain within valid application range, especially `windowSize`, before allocation.
-  Each application can set its own limit, depending on local restrictions.
-  For extended interoperability, it is recommended to support windowSize of at least 8 MB.
   Frame header is extracted from the beginning of compressed frame, so providing only the frame's beginning is enough.
   Data fragment must be large enough to ensure successful decoding.
-  `ZSTD_frameHeaderSize_max` bytes is guaranteed to always be large enough.
+ `ZSTD_frameHeaderSize_max` bytes is guaranteed to always be large enough.
   @result : 0 : successful decoding, the `ZSTD_frameHeader` structure is correctly filled.
            >0 : `srcSize` is too small, please provide at least @result bytes on next attempt.
            errorCode, which can be tested using ZSTD_isError().
 
-  Start decompression, with ZSTD_decompressBegin().
+  It fills a ZSTD_frameHeader structure with important information to correctly decode the frame,
+  such as the dictionary ID, content size, or maximum back-reference distance (`windowSize`).
+  Note that these values could be wrong, either because of data corruption, or because a 3rd party deliberately spoofs false information.
+  As a consequence, check that values remain within valid application range.
+  For example, do not allocate memory blindly, check that `windowSize` is within expectation.
+  Each application can set its own limits, depending on local restrictions.
+  For extended interoperability, it is recommended to support `windowSize` of at least 8 MB.
+
+  ZSTD_decompressContinue() needs previous data blocks during decompression, up to `windowSize` bytes.
+  ZSTD_decompressContinue() is very sensitive to contiguity,
+  if 2 blocks don't follow each other, make sure that either the compressor breaks contiguity at the same place,
+  or that previous contiguous segment is large enough to properly handle maximum back-reference distance.
+  There are multiple ways to guarantee this condition.
+
+  The most memory efficient way is to use a round buffer of sufficient size.
+  Sufficient size is determined by invoking ZSTD_decodingBufferSize_min(),
+  which can @return an error code if required value is too large for current system (in 32-bits mode).
+  In a round buffer methodology, ZSTD_decompressContinue() decompresses each block next to previous one,
+  up to the moment there is not enough room left in the buffer to guarantee decoding another full block,
+  which maximum size is provided in `ZSTD_frameHeader` structure, field `blockSizeMax`.
+  At which point, decoding can resume from the beginning of the buffer.
+  Note that already decoded data stored in the buffer should be flushed before being overwritten.
+
+  There are alternatives possible, for example using two or more buffers of size `windowSize` each, though they consume more memory.
+
+  Finally, if you control the compression process, you can also ignore all buffer size rules,
+  as long as the encoder and decoder progress in "lock-step",
+  aka use exactly the same buffer sizes, break contiguity at the same place, etc.
+
+  Once buffers are setup, start decompression, with ZSTD_decompressBegin().
   If decompression requires a dictionary, use ZSTD_decompressBegin_usingDict() or ZSTD_decompressBegin_usingDDict().
-  Alternatively, you can copy a prepared context, using ZSTD_copyDCtx().
 
   Then use ZSTD_nextSrcSizeToDecompress() and ZSTD_decompressContinue() alternatively.
   ZSTD_nextSrcSizeToDecompress() tells how many bytes to provide as 'srcSize' to ZSTD_decompressContinue().
   ZSTD_decompressContinue() requires this _exact_ amount of bytes, or it will fail.
 
-  @result of ZSTD_decompressContinue() is the number of bytes regenerated within 'dst' (necessarily <= dstCapacity).
-  It can be zero, which is not an error; it just means ZSTD_decompressContinue() has decoded some metadata item.
+ @result of ZSTD_decompressContinue() is the number of bytes regenerated within 'dst' (necessarily <= dstCapacity).
+  It can be zero : it just means ZSTD_decompressContinue() has decoded some metadata item.
   It can also be an error code, which can be tested with ZSTD_isError().
 
-  ZSTD_decompressContinue() needs previous data blocks during decompression, up to `windowSize`.
-  They should preferably be located contiguously, prior to current block.
-  Alternatively, a round buffer of sufficient size is also possible. Sufficient size is determined by frame parameters.
-  ZSTD_decompressContinue() is very sensitive to contiguity,
-  if 2 blocks don't follow each other, make sure that either the compressor breaks contiguity at the same place,
-  or that previous contiguous segment is large enough to properly handle maximum back-reference.
-
   A frame is fully decoded when ZSTD_nextSrcSizeToDecompress() returns zero.
   Context can then be reset to start a new decompression.
 
@@ -743,44 +760,62 @@ size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx* preparedCCtx, unsigned lo
   == Special case : skippable frames 
 
   Skippable frames allow integration of user-defined data into a flow of concatenated frames.
-  Skippable frames will be ignored (skipped) by a decompressor. The format of skippable frames is as follows :
+  Skippable frames will be ignored (skipped) by decompressor.
+  The format of skippable frames is as follows :
   a) Skippable frame ID - 4 Bytes, Little endian format, any value from 0x184D2A50 to 0x184D2A5F
   b) Frame Size - 4 Bytes, Little endian format, unsigned 32-bits
   c) Frame Content - any content (User Data) of length equal to Frame Size
-  For skippable frames ZSTD_decompressContinue() always returns 0.
-  For skippable frames ZSTD_getFrameHeader() returns fparamsPtr->windowLog==0 what means that a frame is skippable.
-    Note : If fparamsPtr->frameContentSize==0, it is ambiguous: the frame might actually be a Zstd encoded frame with no content.
-           For purposes of decompression, it is valid in both cases to skip the frame using
-           ZSTD_findFrameCompressedSize to find its size in bytes.
-  It also returns Frame Size as fparamsPtr->frameContentSize.
+  For skippable frames ZSTD_getFrameHeader() returns zfhPtr->frameType==ZSTD_skippableFrame.
+  For skippable frames ZSTD_decompressContinue() always returns 0 : it only skips the content.
 

Buffer-less streaming decompression functions

typedef enum { ZSTD_frame, ZSTD_skippableFrame } ZSTD_frameType_e;
 typedef struct {
-    unsigned long long frameContentSize; /* ZSTD_CONTENTSIZE_UNKNOWN means this field is not available. 0 means "empty" */
+    unsigned long long frameContentSize; /* if == ZSTD_CONTENTSIZE_UNKNOWN, it means this field is not available. 0 means "empty" */
     unsigned long long windowSize;       /* can be very large, up to <= frameContentSize */
+    unsigned blockSizeMax;
     ZSTD_frameType_e frameType;          /* if == ZSTD_skippableFrame, frameContentSize is the size of skippable content */
     unsigned headerSize;
     unsigned dictID;
     unsigned checksumFlag;
 } ZSTD_frameHeader;
 size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize);   /**< doesn't consume input */
-size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx);
-size_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);
-size_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict);
-void   ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx);
+size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize);  /**< when frame content size is not known, pass in frameContentSize == ZSTD_CONTENTSIZE_UNKNOWN */
 

typedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e;
 

-

New advanced API (experimental, and compression only)


+

New advanced API (experimental)


+
 
typedef enum {
+    /* Question : should we have a format ZSTD_f_auto ?
+     * For the time being, it would mean exactly the same as ZSTD_f_zstd1.
+     * But, in the future, should several formats be supported,
+     * on the compression side, it would mean "default format".
+     * On the decompression side, it would mean "multi format",
+     * and ZSTD_f_zstd1 could be reserved to mean "accept *only* zstd frames".
+     * Since meaning is a little different, another option could be to define different enums for compression and decompression.
+     * This question could be kept for later, when there are actually multiple formats to support,
+     * but there is also the question of pinning enum values, and pinning value `0` is especially important */
+    ZSTD_f_zstd1 = 0,        /* zstd frame format, specified in zstd_compression_format.md (default) */
+    ZSTD_f_zstd1_magicless,  /* Variant of zstd frame format, without initial 4-bytes magic number.
+                              * Useful to save 4 bytes per generated frame.
+                              * Decoder cannot recognise automatically this format, requiring instructions. */
+} ZSTD_format_e;
+

+
typedef enum {
+    /* compression format */
+    ZSTD_p_format = 10,      /* See ZSTD_format_e enum definition.
+                              * Cast selected format as unsigned for ZSTD_CCtx_setParameter() compatibility. */
+
     /* compression parameters */
     ZSTD_p_compressionLevel=100, /* Update all compression parameters according to pre-defined cLevel table
                               * Default level is ZSTD_CLEVEL_DEFAULT==3.
                               * Special: value 0 means "do not change cLevel". */
     ZSTD_p_windowLog,        /* Maximum allowed back-reference distance, expressed as power of 2.
                               * Must be clamped between ZSTD_WINDOWLOG_MIN and ZSTD_WINDOWLOG_MAX.
-                              * Special: value 0 means "do not change windowLog". */
+                              * Special: value 0 means "do not change windowLog".
+                              * Note: Using a window size greater than ZSTD_MAXWINDOWSIZE_DEFAULT (default: 2^27)
+                              * requires setting the maximum window size at least as large during decompression. */
     ZSTD_p_hashLog,          /* Size of the probe table, as a power of 2.
                               * Resulting table size is (1 << (hashLog+2)).
                               * Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX.
@@ -819,12 +854,6 @@ void   ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx);
     ZSTD_p_checksumFlag,     /* A 32-bits checksum of content is written at end of frame (default:0) */
     ZSTD_p_dictIDFlag,       /* When applicable, dictID of dictionary is provided in frame header (default:1) */
 
-    /* dictionary parameters (must be set before ZSTD_CCtx_loadDictionary) */
-    ZSTD_p_dictMode=300,     /* Select how dictionary content must be interpreted. Value must be from type ZSTD_dictMode_e.
-                              * default : 0==auto : dictionary will be "full" if it respects specification, otherwise it will be "rawContent" */
-    ZSTD_p_refDictContent,   /* Dictionary content will be referenced, instead of copied (default:0==byCopy).
-                              * It requires that dictionary buffer outlives its users */
-
     /* multi-threading parameters */
     ZSTD_p_nbThreads=400,    /* Select how many threads a compression job can spawn (default:1)
                               * More threads improve speed, but also increase memory usage.
@@ -840,6 +869,35 @@ void   ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx);
     /* advanced parameters - may not remain available after API update */
     ZSTD_p_forceMaxWindow=1100, /* Force back-reference distances to remain < windowSize,
                               * even when referencing into Dictionary content (default:0) */
+    ZSTD_p_enableLongDistanceMatching=1200,  /* Enable long distance matching.
+                                         * This parameter is designed to improve the compression
+                                         * ratio for large inputs with long distance matches.
+                                         * This increases the memory usage as well as window size.
+                                         * Note: setting this parameter sets all the LDM parameters
+                                         * as well as ZSTD_p_windowLog. It should be set after
+                                         * ZSTD_p_compressionLevel and before ZSTD_p_windowLog and
+                                         * other LDM parameters. Setting the compression level
+                                         * after this parameter overrides the window log, though LDM
+                                         * will remain enabled until explicitly disabled. */
+    ZSTD_p_ldmHashLog,   /* Size of the table for long distance matching, as a power of 2.
+                          * Larger values increase memory usage and compression ratio, but decrease
+                          * compression speed.
+                          * Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX
+                          * (default: windowlog - 7). */
+    ZSTD_p_ldmMinMatch,  /* Minimum size of searched matches for long distance matcher.
+                          * Larger/too small values usually decrease compression ratio.
+                          * Must be clamped between ZSTD_LDM_MINMATCH_MIN
+                          * and ZSTD_LDM_MINMATCH_MAX (default: 64). */
+    ZSTD_p_ldmBucketSizeLog,  /* Log size of each bucket in the LDM hash table for collision resolution.
+                               * Larger values usually improve collision resolution but may decrease
+                               * compression speed.
+                               * The maximum value is ZSTD_LDM_BUCKETSIZELOG_MAX (default: 3). */
+    ZSTD_p_ldmHashEveryLog,  /* Frequency of inserting/looking up entries in the LDM hash table.
+                              * The default is MAX(0, (windowLog - ldmHashLog)) to
+                              * optimize hash table usage.
+                              * Larger values improve compression speed. Deviating far from the
+                              * default value will likely result in a decrease in compression ratio.
+                              * Must be clamped between 0 and ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN. */
 
 } ZSTD_cParameter;
 

@@ -861,18 +919,25 @@ void ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx);


size_t ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, const void* dict, size_t dictSize);
+size_t ZSTD_CCtx_loadDictionary_byReference(ZSTD_CCtx* cctx, const void* dict, size_t dictSize);
+size_t ZSTD_CCtx_loadDictionary_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictMode_e dictMode);
 

Create an internal CDict from dict buffer. Decompression will have to use same buffer. @result : 0, or an error code (which can be tested with ZSTD_isError()). Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary, meaning "return to no-dictionary mode". - Note 1 : `dict` content will be copied internally, - except if ZSTD_p_refDictContent is set before loading. + Note 1 : `dict` content will be copied internally. Use + ZSTD_CCtx_loadDictionary_byReference() to reference dictionary + content instead. The dictionary buffer must then outlive its + users. Note 2 : Loading a dictionary involves building tables, which are dependent on compression parameters. For this reason, compression parameters cannot be changed anymore after loading a dictionary. It's also a CPU-heavy operation, with non-negligible impact on latency. Note 3 : Dictionary will be used for all future compression jobs. - To return to "no-dictionary" situation, load a NULL dictionary + To return to "no-dictionary" situation, load a NULL dictionary + Note 5 : Use ZSTD_CCtx_loadDictionary_advanced() to select how dictionary + content will be interpreted. +


size_t ZSTD_CCtx_refCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict);
@@ -889,6 +954,7 @@ void   ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx);
 


size_t ZSTD_CCtx_refPrefix(ZSTD_CCtx* cctx, const void* prefix, size_t prefixSize);
+size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, const void* prefix, size_t prefixSize, ZSTD_dictMode_e dictMode);
 

Reference a prefix (single-usage dictionary) for next compression job. Decompression need same prefix to properly regenerate data. Prefix is **only used once**. Tables are discarded at end of compression job. @@ -899,13 +965,15 @@ void ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx); Note 1 : Prefix buffer is referenced. It must outlive compression job. Note 2 : Referencing a prefix involves building tables, which are dependent on compression parameters. It's a CPU-heavy operation, with non-negligible impact on latency. - Note 3 : it's possible to alter ZSTD_p_dictMode using ZSTD_CCtx_setParameter() + Note 3 : By default, the prefix is treated as raw content + (ZSTD_dm_rawContent). Use ZSTD_CCtx_refPrefix_advanced() to alter + dictMode.


typedef enum {
     ZSTD_e_continue=0, /* collect more data, encoder transparently decides when to output result, for optimal conditions */
     ZSTD_e_flush,      /* flush any data provided so far - frame will continue, future data can still reference previous data for better compression */
-    ZSTD_e_end         /* flush any remaining data and ends current frame. Any future compression starts a new frame. */
+    ZSTD_e_end         /* flush any remaining data and close current frame. Any additional data starts a new frame. */
 } ZSTD_EndDirective;
 

size_t ZSTD_compress_generic (ZSTD_CCtx* cctx,
@@ -915,8 +983,8 @@ void   ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx);
 

Behave about the same as ZSTD_compressStream. To note : - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_setParameter() - Compression parameters cannot be changed once compression is started. - - *dstPos must be <= dstCapacity, *srcPos must be <= srcSize - - *dspPos and *srcPos will be updated. They are guaranteed to remain below their respective limit. + - outpot->pos must be <= dstCapacity, input->pos must be <= srcSize + - outpot->pos and input->pos will be updated. They are guaranteed to remain below their respective limit. - @return provides the minimum amount of data still to flush from internal buffers or an error code, which can be tested using ZSTD_isError(). if @return != 0, flush is not fully completed, there is some data left within internal buffers. @@ -932,6 +1000,7 @@ void ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx); Useful after an error, or to interrupt an ongoing compression job and start a new one. Any internal data not yet flushed is cancelled. Dictionary (if any) is dropped. + All parameters are back to default values. It's possible to modify compression parameters after a reset.


@@ -943,15 +1012,163 @@ void ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx); ZSTD_EndDirective endOp);

Same as ZSTD_compress_generic(), but using only integral types as arguments. - Argument list is larger and less expressive than ZSTD_{in,out}Buffer, + Argument list is larger than ZSTD_{in,out}Buffer, but can be helpful for binders from dynamic languages which have troubles handling structures containing memory pointers.


-

Block functions

-    Block functions produce and decode raw zstd blocks, without frame metadata.
-    Frame metadata cost is typically ~18 bytes, which can be non-negligible for very small blocks (< 100 bytes).
+
ZSTD_CCtx_params* ZSTD_createCCtxParams(void);
+

Quick howto : + - ZSTD_createCCtxParams() : Create a ZSTD_CCtx_params structure + - ZSTD_CCtxParam_setParameter() : Push parameters one by one into + an existing ZSTD_CCtx_params structure. + This is similar to + ZSTD_CCtx_setParameter(). + - ZSTD_CCtx_setParametersUsingCCtxParams() : Apply parameters to + an existing CCtx. + These parameters will be applied to + all subsequent compression jobs. + - ZSTD_compress_generic() : Do compression using the CCtx. + - ZSTD_freeCCtxParams() : Free the memory. + + This can be used with ZSTD_estimateCCtxSize_advanced_usingCCtxParams() + for static allocation for single-threaded compression. + +


+ +
size_t ZSTD_resetCCtxParams(ZSTD_CCtx_params* params);
+

Reset params to default, with the default compression level. + +


+ +
size_t ZSTD_initCCtxParams(ZSTD_CCtx_params* cctxParams, int compressionLevel);
+

Initializes the compression parameters of cctxParams according to + compression level. All other parameters are reset to their default values. + +


+ +
size_t ZSTD_initCCtxParams_advanced(ZSTD_CCtx_params* cctxParams, ZSTD_parameters params);
+

Initializes the compression and frame parameters of cctxParams according to + params. All other parameters are reset to their default values. + +


+ +
size_t ZSTD_CCtxParam_setParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, unsigned value);
+

Similar to ZSTD_CCtx_setParameter. + Set one compression parameter, selected by enum ZSTD_cParameter. + Parameters must be applied to a ZSTD_CCtx using ZSTD_CCtx_setParametersUsingCCtxParams(). + Note : when `value` is an enum, cast it to unsigned for proper type checking. + @result : 0, or an error code (which can be tested with ZSTD_isError()). + +


+ +
size_t ZSTD_CCtx_setParametersUsingCCtxParams(
+        ZSTD_CCtx* cctx, const ZSTD_CCtx_params* params);
+

Apply a set of ZSTD_CCtx_params to the compression context. + This must be done before the dictionary is loaded. + The pledgedSrcSize is treated as unknown. + Multithreading parameters are applied only if nbThreads > 1. + +


+ +

Advanced parameters for decompression API


+
size_t ZSTD_DCtx_loadDictionary(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);   /* not implemented */
+size_t ZSTD_DCtx_loadDictionary_byReference(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);   /* not implemented */
+size_t ZSTD_DCtx_loadDictionary_advanced(ZSTD_DCtx* dctx, const void* dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictMode_e dictMode);   /* not implemented */
+

Create an internal DDict from dict buffer, + to be used to decompress next frames. + @result : 0, or an error code (which can be tested with ZSTD_isError()). + Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary, + meaning "return to no-dictionary mode". + Note 1 : `dict` content will be copied internally. + Use ZSTD_DCtx_loadDictionary_byReference() + to reference dictionary content instead. + In which case, the dictionary buffer must outlive its users. + Note 2 : Loading a dictionary involves building tables, + which has a non-negligible impact on CPU usage and latency. + Note 3 : Use ZSTD_DCtx_loadDictionary_advanced() to select + how dictionary content will be interpreted and loaded. + +


+ +
size_t ZSTD_DCtx_refDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict);   /* not implemented */
+

Reference a prepared dictionary, to be used to decompress next frames. + The dictionary remains active for decompression of future frames using same DCtx. + @result : 0, or an error code (which can be tested with ZSTD_isError()). + Note 1 : Currently, only one dictionary can be managed. + Referencing a new dictionary effectively "discards" any previous one. + Special : adding a NULL DDict means "return to no-dictionary mode". + Note 2 : DDict is just referenced, its lifetime must outlive its usage from DCtx. + +


+ +
size_t ZSTD_DCtx_refPrefix(ZSTD_DCtx* dctx, const void* prefix, size_t prefixSize);   /* not implemented */
+size_t ZSTD_DCtx_refPrefix_advanced(ZSTD_DCtx* dctx, const void* prefix, size_t prefixSize, ZSTD_dictMode_e dictMode);   /* not implemented */
+

Reference a prefix (single-usage dictionary) for next compression job. + Prefix is **only used once**. It must be explicitly referenced before each frame. + If there is a need to use same prefix multiple times, consider embedding it into a ZSTD_DDict instead. + @result : 0, or an error code (which can be tested with ZSTD_isError()). + Note 1 : Adding any prefix (including NULL) invalidates any previously set prefix or dictionary + Note 2 : Prefix buffer is referenced. It must outlive compression job. + Note 3 : By default, the prefix is treated as raw content (ZSTD_dm_rawContent). + Use ZSTD_CCtx_refPrefix_advanced() to alter dictMode. + Note 4 : Referencing a raw content prefix has almost no cpu nor memory cost. + +


+ +
size_t ZSTD_DCtx_setMaxWindowSize(ZSTD_DCtx* dctx, size_t maxWindowSize);
+

Refuses allocating internal buffers for frames requiring a window size larger than provided limit. + This is useful to prevent a decoder context from reserving too much memory for itself (potential attack scenario). + This parameter is only useful in streaming mode, since no internal buffer is allocated in direct mode. + By default, a decompression context accepts all window sizes <= (1 << ZSTD_WINDOWLOG_MAX) + @return : 0, or an error code (which can be tested using ZSTD_isError()). + +


+ +
size_t ZSTD_DCtx_setFormat(ZSTD_DCtx* dctx, ZSTD_format_e format);
+

Instruct the decoder context about what kind of data to decode next. + This instruction is mandatory to decode data without a fully-formed header, + such ZSTD_f_zstd1_magicless for example. + @return : 0, or an error code (which can be tested using ZSTD_isError()). + +


+ +
size_t ZSTD_decompress_generic(ZSTD_DCtx* dctx,
+                               ZSTD_outBuffer* output,
+                               ZSTD_inBuffer* input);
+

Behave the same as ZSTD_decompressStream. + Decompression parameters cannot be changed once decompression is started. + @return : an error code, which can be tested using ZSTD_isError() + if >0, a hint, nb of expected input bytes for next invocation. + `0` means : a frame has just been fully decoded and flushed. + +


+ +
size_t ZSTD_decompress_generic_simpleArgs (
+                ZSTD_DCtx* dctx,
+                void* dst, size_t dstCapacity, size_t* dstPos,
+          const void* src, size_t srcSize, size_t* srcPos);
+

Same as ZSTD_decompress_generic(), + but using only integral types as arguments. + Argument list is larger than ZSTD_{in,out}Buffer, + but can be helpful for binders from dynamic languages + which have troubles handling structures containing memory pointers. + +


+ +
void ZSTD_DCtx_reset(ZSTD_DCtx* dctx);
+

Return a DCtx to clean state. + If a decompression was ongoing, any internal data not yet flushed is cancelled. + All parameters are back to default values, including sticky ones. + Dictionary (if any) is dropped. + Parameters can be modified again after a reset. + +


+ +

Block level API


+
+

Frame metadata cost is typically ~18 bytes, which can be non-negligible for very small blocks (< 100 bytes). User will have to take in charge required information to regenerate data, such as compressed and content sizes. A few rules to respect : @@ -961,7 +1178,7 @@ void ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx); + compression : any ZSTD_compressBegin*() variant, including with dictionary + decompression : any ZSTD_decompressBegin*() variant, including with dictionary + copyCCtx() and copyDCtx() can be used too - - Block size is limited, it must be <= ZSTD_getBlockSize() <= ZSTD_BLOCKSIZE_MAX + - Block size is limited, it must be <= ZSTD_getBlockSize() <= ZSTD_BLOCKSIZE_MAX == 128 KB + If input is larger than a block size, it's necessary to split input data into multiple blocks + For inputs larger than a single block size, consider using the regular ZSTD_compress() instead. Frame metadata is not that costly, and quickly becomes negligible as source size grows larger. @@ -972,12 +1189,12 @@ void ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx); + In case of multiple successive blocks, should some of them be uncompressed, decoder must be informed of their existence in order to follow proper history. Use ZSTD_insertBlock() for such a case. -

+


Raw zstd block functions

size_t ZSTD_getBlockSize   (const ZSTD_CCtx* cctx);
 size_t ZSTD_compressBlock  (ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
 size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
-size_t ZSTD_insertBlock(ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize);  /**< insert block into `dctx` history. Useful for uncompressed blocks */
+size_t ZSTD_insertBlock(ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize);  /**< insert uncompressed block into `dctx` history. Useful for multi-blocks decompression */
 

diff --git a/contrib/zstd/lib/.gitignore b/sys/contrib/zstd/lib/.gitignore similarity index 72% rename from contrib/zstd/lib/.gitignore rename to sys/contrib/zstd/lib/.gitignore index b43a8543a199..4cd50ac61e52 100644 --- a/contrib/zstd/lib/.gitignore +++ b/sys/contrib/zstd/lib/.gitignore @@ -1,2 +1,3 @@ # make install artefact libzstd.pc +libzstd-nomt diff --git a/contrib/zstd/lib/BUCK b/sys/contrib/zstd/lib/BUCK similarity index 100% rename from contrib/zstd/lib/BUCK rename to sys/contrib/zstd/lib/BUCK diff --git a/contrib/zstd/lib/Makefile b/sys/contrib/zstd/lib/Makefile similarity index 77% rename from contrib/zstd/lib/Makefile rename to sys/contrib/zstd/lib/Makefile index 5845cf170e71..cdfdc5cdfd46 100644 --- a/contrib/zstd/lib/Makefile +++ b/sys/contrib/zstd/lib/Makefile @@ -1,13 +1,11 @@ -# ########################################################################## -# Copyright (c) 2016-present, Yann Collet, Facebook, Inc. +# ################################################################ +# Copyright (c) 2015-present, Yann Collet, Facebook, Inc. # All rights reserved. # -# This Makefile is validated for Linux, macOS, *BSD, Hurd, Solaris, MSYS2 targets -# -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. An additional grant -# of patent rights can be found in the PATENTS file in the same directory. -# ########################################################################## +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ # Version numbers LIBVER_MAJOR_SCRIPT:=`sed -n '/define ZSTD_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./zstd.h` @@ -31,7 +29,7 @@ CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS) FLAGS = $(CPPFLAGS) $(CFLAGS) -ZSTD_FILES := $(wildcard common/*.c compress/*.c decompress/*.c dictBuilder/*.c deprecated/*.c) +ZSTD_FILES := $(sort $(wildcard common/*.c compress/*.c decompress/*.c dictBuilder/*.c deprecated/*.c)) ZSTD_LEGACY_SUPPORT ?= 4 @@ -103,10 +101,19 @@ lib-release lib-release-mt: DEBUGFLAGS := lib-release: lib lib-release-mt: lib-mt +# Special case : building library in single-thread mode _and_ without zstdmt_compress.c +ZSTDMT_FILES = compress/zstdmt_compress.c +ZSTD_NOMT_FILES = $(filter-out $(ZSTDMT_FILES),$(ZSTD_FILES)) +libzstd-nomt: LDFLAGS += -shared -fPIC -fvisibility=hidden +libzstd-nomt: $(ZSTD_NOMT_FILES) + @echo compiling single-thread dynamic library $(LIBVER) + @echo files : $(ZSTD_NOMT_FILES) + @$(CC) $(FLAGS) $^ $(LDFLAGS) $(SONAME_FLAGS) -o $@ + clean: @$(RM) -r *.dSYM # Mac OS-X specific @$(RM) core *.o *.a *.gcda *.$(SHARED_EXT) *.$(SHARED_EXT).* libzstd.pc - @$(RM) dll/libzstd.dll dll/libzstd.lib + @$(RM) dll/libzstd.dll dll/libzstd.lib libzstd-nomt* @$(RM) common/*.o compress/*.o decompress/*.o dictBuilder/*.o legacy/*.o deprecated/*.o @echo Cleaning library completed @@ -115,16 +122,17 @@ clean: #----------------------------------------------------------------------------- ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS)) -ifneq (,$(filter $(shell uname),SunOS)) -INSTALL ?= ginstall -else -INSTALL ?= install -endif - -PREFIX ?= /usr/local -DESTDIR ?= -LIBDIR ?= $(PREFIX)/lib -INCLUDEDIR ?= $(PREFIX)/include +DESTDIR ?= +# directory variables : GNU conventions prefer lowercase +# see https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html +# support both lower and uppercase (BSD), use uppercase in script +prefix ?= /usr/local +PREFIX ?= $(prefix) +exec_prefix ?= $(PREFIX) +libdir ?= $(exec_prefix)/lib +LIBDIR ?= $(libdir) +includedir ?= $(PREFIX)/include +INCLUDEDIR ?= $(includedir) ifneq (,$(filter $(shell uname),OpenBSD FreeBSD NetBSD DragonFly)) PKGCONFIGDIR ?= $(PREFIX)/libdata/pkgconfig @@ -132,8 +140,14 @@ else PKGCONFIGDIR ?= $(LIBDIR)/pkgconfig endif -INSTALL_LIB ?= $(INSTALL) -m 755 -INSTALL_DATA ?= $(INSTALL) -m 644 +ifneq (,$(filter $(shell uname),SunOS)) +INSTALL ?= ginstall +else +INSTALL ?= install +endif + +INSTALL_PROGRAM ?= $(INSTALL) +INSTALL_DATA ?= $(INSTALL) -m 644 libzstd.pc: @@ -150,9 +164,9 @@ install: libzstd.a libzstd libzstd.pc @$(INSTALL_DATA) libzstd.pc $(DESTDIR)$(PKGCONFIGDIR)/ @echo Installing libraries @$(INSTALL_DATA) libzstd.a $(DESTDIR)$(LIBDIR) - @$(INSTALL_LIB) libzstd.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR) - @ln -sf libzstd.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR) - @ln -sf libzstd.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT) + @$(INSTALL_PROGRAM) $(LIBZSTD) $(DESTDIR)$(LIBDIR) + @ln -sf $(LIBZSTD) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR) + @ln -sf $(LIBZSTD) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT) @echo Installing includes @$(INSTALL_DATA) zstd.h $(DESTDIR)$(INCLUDEDIR) @$(INSTALL_DATA) common/zstd_errors.h $(DESTDIR)$(INCLUDEDIR) @@ -164,7 +178,7 @@ uninstall: @$(RM) $(DESTDIR)$(LIBDIR)/libzstd.a @$(RM) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT) @$(RM) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR) - @$(RM) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_VER) + @$(RM) $(DESTDIR)$(LIBDIR)/$(LIBZSTD) @$(RM) $(DESTDIR)$(PKGCONFIGDIR)/libzstd.pc @$(RM) $(DESTDIR)$(INCLUDEDIR)/zstd.h @$(RM) $(DESTDIR)$(INCLUDEDIR)/zstd_errors.h diff --git a/sys/contrib/zstd/lib/README.md b/sys/contrib/zstd/lib/README.md new file mode 100644 index 000000000000..df136c4867d2 --- /dev/null +++ b/sys/contrib/zstd/lib/README.md @@ -0,0 +1,108 @@ +Zstandard library files +================================ + +The __lib__ directory is split into several sub-directories, +in order to make it easier to select or exclude specific features. + + +#### Building + +`Makefile` script is provided, supporting the standard set of commands, +directories, and variables (see https://www.gnu.org/prep/standards/html_node/Command-Variables.html). +- `make` : generates both static and dynamic libraries +- `make install` : install libraries in default system directories + + +#### API + +Zstandard's stable API is exposed within [lib/zstd.h](zstd.h). + + +#### Advanced API + +Optional advanced features are exposed via : + +- `lib/common/zstd_errors.h` : translates `size_t` function results + into an `ZSTD_ErrorCode`, for accurate error handling. +- `ZSTD_STATIC_LINKING_ONLY` : if this macro is defined _before_ including `zstd.h`, + it unlocks access to advanced experimental API, + exposed in second part of `zstd.h`. + These APIs shall ___never be used with dynamic library___ ! + They are not "stable", their definition may change in the future. + Only static linking is allowed. + + +#### Modular build + +- Directory `lib/common` is always required, for all variants. +- Compression source code lies in `lib/compress` +- Decompression source code lies in `lib/decompress` +- It's possible to include only `compress` or only `decompress`, they don't depend on each other. +- `lib/dictBuilder` : makes it possible to generate dictionaries from a set of samples. + The API is exposed in `lib/dictBuilder/zdict.h`. + This module depends on both `lib/common` and `lib/compress` . +- `lib/legacy` : source code to decompress older zstd formats, starting from `v0.1`. + This module depends on `lib/common` and `lib/decompress`. + To enable this feature, it's necessary to define `ZSTD_LEGACY_SUPPORT = 1` during compilation. + Typically, with `gcc`, add argument `-DZSTD_LEGACY_SUPPORT=1`. + Using higher number limits the number of version supported. + For example, `ZSTD_LEGACY_SUPPORT=2` means : "support legacy formats starting from v0.2+". + The API is exposed in `lib/legacy/zstd_legacy.h`. + Each version also provides a (dedicated) set of advanced API. + For example, advanced API for version `v0.4` is exposed in `lib/legacy/zstd_v04.h` . + + +#### Multithreading support + +Multithreading is disabled by default when building with `make`. +Enabling multithreading requires 2 conditions : +- set macro `ZSTD_MULTITHREAD` +- on POSIX systems : compile with pthread (`-pthread` compilation flag for `gcc` for example) + +Both conditions are automatically triggered by invoking `make lib-mt` target. +Note that, when linking a POSIX program with a multithreaded version of `libzstd`, +it's necessary to trigger `-pthread` flag during link stage. + +Multithreading capabilities are exposed via : +- private API `lib/compress/zstdmt_compress.h`. + Symbols defined in this header are currently exposed in `libzstd`, hence usable. + Note however that this API is planned to be locked and remain strictly internal in the future. +- advanced API `ZSTD_compress_generic()`, defined in `lib/zstd.h`, experimental section. + This API is still considered experimental, but is designed to be labelled "stable" at some point in the future. + It's the recommended entry point for multi-threading operations. + + +#### Windows : using MinGW+MSYS to create DLL + +DLL can be created using MinGW+MSYS with the `make libzstd` command. +This command creates `dll\libzstd.dll` and the import library `dll\libzstd.lib`. +The import library is only required with Visual C++. +The header file `zstd.h` and the dynamic library `dll\libzstd.dll` are required to +compile a project using gcc/MinGW. +The dynamic library has to be added to linking options. +It means that if a project that uses ZSTD consists of a single `test-dll.c` +file it should be linked with `dll\libzstd.dll`. For example: +``` + gcc $(CFLAGS) -Iinclude/ test-dll.c -o test-dll dll\libzstd.dll +``` +The compiled executable will require ZSTD DLL which is available at `dll\libzstd.dll`. + + +#### Deprecated API + +Obsolete API on their way out are stored in directory `lib/deprecated`. +At this stage, it contains older streaming prototypes, in `lib/deprecated/zbuff.h`. +Presence in this directory is temporary. +These prototypes will be removed in some future version. +Consider migrating code towards supported streaming API exposed in `zstd.h`. + + +#### Miscellaneous + +The other files are not source code. There are : + + - `LICENSE` : contains the BSD license text + - `Makefile` : `make` script to build and install zstd library (static and dynamic) + - `BUCK` : support for `buck` build system (https://buckbuild.com/) + - `libzstd.pc.in` : for `pkg-config` (used in `make install`) + - `README.md` : this file diff --git a/contrib/zstd/lib/common/bitstream.h b/sys/contrib/zstd/lib/common/bitstream.h similarity index 91% rename from contrib/zstd/lib/common/bitstream.h rename to sys/contrib/zstd/lib/common/bitstream.h index 06121f21c5b3..2094823fe240 100644 --- a/contrib/zstd/lib/common/bitstream.h +++ b/sys/contrib/zstd/lib/common/bitstream.h @@ -169,33 +169,39 @@ MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits); ****************************************************************/ MEM_STATIC unsigned BIT_highbit32 (register U32 val) { + assert(val != 0); + { # if defined(_MSC_VER) /* Visual */ - unsigned long r=0; - _BitScanReverse ( &r, val ); - return (unsigned) r; + unsigned long r=0; + _BitScanReverse ( &r, val ); + return (unsigned) r; # elif defined(__GNUC__) && (__GNUC__ >= 3) /* Use GCC Intrinsic */ - return 31 - __builtin_clz (val); + return 31 - __builtin_clz (val); # else /* Software version */ - static const unsigned DeBruijnClz[32] = { 0, 9, 1, 10, 13, 21, 2, 29, - 11, 14, 16, 18, 22, 25, 3, 30, - 8, 12, 20, 28, 15, 17, 24, 7, - 19, 27, 23, 6, 26, 5, 4, 31 }; - U32 v = val; - v |= v >> 1; - v |= v >> 2; - v |= v >> 4; - v |= v >> 8; - v |= v >> 16; - return DeBruijnClz[ (U32) (v * 0x07C4ACDDU) >> 27]; + static const unsigned DeBruijnClz[32] = { 0, 9, 1, 10, 13, 21, 2, 29, + 11, 14, 16, 18, 22, 25, 3, 30, + 8, 12, 20, 28, 15, 17, 24, 7, + 19, 27, 23, 6, 26, 5, 4, 31 }; + U32 v = val; + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + return DeBruijnClz[ (U32) (v * 0x07C4ACDDU) >> 27]; # endif + } } /*===== Local Constants =====*/ -static const unsigned BIT_mask[] = { 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, - 0xFF, 0x1FF, 0x3FF, 0x7FF, 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, - 0xFFFF, 0x1FFFF, 0x3FFFF, 0x7FFFF, 0xFFFFF, 0x1FFFFF, 0x3FFFFF, 0x7FFFFF, - 0xFFFFFF, 0x1FFFFFF, 0x3FFFFFF }; /* up to 26 bits */ - +static const unsigned BIT_mask[] = { + 0, 1, 3, 7, 0xF, 0x1F, + 0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF, + 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, 0x1FFFF, + 0x3FFFF, 0x7FFFF, 0xFFFFF, 0x1FFFFF, 0x3FFFFF, 0x7FFFFF, + 0xFFFFFF, 0x1FFFFFF, 0x3FFFFFF, 0x7FFFFFF, 0xFFFFFFF, 0x1FFFFFFF, + 0x3FFFFFFF, 0x7FFFFFFF}; /* up to 31 bits */ +#define BIT_MASK_SIZE (sizeof(BIT_mask) / sizeof(BIT_mask[0])) /*-************************************************************** * bitStream encoding @@ -217,11 +223,14 @@ MEM_STATIC size_t BIT_initCStream(BIT_CStream_t* bitC, } /*! BIT_addBits() : - * can add up to 26 bits into `bitC`. + * can add up to 31 bits into `bitC`. * Note : does not check for register overflow ! */ MEM_STATIC void BIT_addBits(BIT_CStream_t* bitC, size_t value, unsigned nbBits) { + MEM_STATIC_ASSERT(BIT_MASK_SIZE == 32); + assert(nbBits < BIT_MASK_SIZE); + assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8); bitC->bitContainer |= (value & BIT_mask[nbBits]) << bitC->bitPos; bitC->bitPos += nbBits; } @@ -232,6 +241,7 @@ MEM_STATIC void BIT_addBitsFast(BIT_CStream_t* bitC, size_t value, unsigned nbBits) { assert((value>>nbBits) == 0); + assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8); bitC->bitContainer |= value << bitC->bitPos; bitC->bitPos += nbBits; } @@ -242,7 +252,7 @@ MEM_STATIC void BIT_addBitsFast(BIT_CStream_t* bitC, MEM_STATIC void BIT_flushBitsFast(BIT_CStream_t* bitC) { size_t const nbBytes = bitC->bitPos >> 3; - assert( bitC->bitPos <= (sizeof(bitC->bitContainer)*8) ); + assert(bitC->bitPos < sizeof(bitC->bitContainer) * 8); MEM_writeLEST(bitC->ptr, bitC->bitContainer); bitC->ptr += nbBytes; assert(bitC->ptr <= bitC->endPtr); @@ -258,7 +268,7 @@ MEM_STATIC void BIT_flushBitsFast(BIT_CStream_t* bitC) MEM_STATIC void BIT_flushBits(BIT_CStream_t* bitC) { size_t const nbBytes = bitC->bitPos >> 3; - assert( bitC->bitPos <= (sizeof(bitC->bitContainer)*8) ); + assert(bitC->bitPos < sizeof(bitC->bitContainer) * 8); MEM_writeLEST(bitC->ptr, bitC->bitContainer); bitC->ptr += nbBytes; if (bitC->ptr > bitC->endPtr) bitC->ptr = bitC->endPtr; @@ -350,12 +360,14 @@ MEM_STATIC size_t BIT_getMiddleBits(size_t bitContainer, U32 const start, U32 co # endif return _bextr_u32(bitContainer, start, nbBits); #else + assert(nbBits < BIT_MASK_SIZE); return (bitContainer >> start) & BIT_mask[nbBits]; #endif } MEM_STATIC size_t BIT_getLowerBits(size_t bitContainer, U32 const nbBits) { + assert(nbBits < BIT_MASK_SIZE); return bitContainer & BIT_mask[nbBits]; } diff --git a/contrib/zstd/lib/common/compiler.h b/sys/contrib/zstd/lib/common/compiler.h similarity index 97% rename from contrib/zstd/lib/common/compiler.h rename to sys/contrib/zstd/lib/common/compiler.h index d7225c443e91..3a7553c3807e 100644 --- a/contrib/zstd/lib/common/compiler.h +++ b/sys/contrib/zstd/lib/common/compiler.h @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ #ifndef ZSTD_COMPILER_H diff --git a/contrib/zstd/lib/common/entropy_common.c b/sys/contrib/zstd/lib/common/entropy_common.c similarity index 100% rename from contrib/zstd/lib/common/entropy_common.c rename to sys/contrib/zstd/lib/common/entropy_common.c diff --git a/contrib/zstd/lib/common/error_private.c b/sys/contrib/zstd/lib/common/error_private.c similarity index 93% rename from contrib/zstd/lib/common/error_private.c rename to sys/contrib/zstd/lib/common/error_private.c index b5b14b509cf1..11f7cdab1c60 100644 --- a/contrib/zstd/lib/common/error_private.c +++ b/sys/contrib/zstd/lib/common/error_private.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ /* The purpose of this file is to have a single list of error strings embedded in binary */ @@ -29,14 +30,15 @@ const char* ERR_getErrorString(ERR_enum code) case PREFIX(init_missing): return "Context should be init first"; case PREFIX(memory_allocation): return "Allocation error : not enough memory"; case PREFIX(stage_wrong): return "Operation not authorized at current processing stage"; - case PREFIX(dstSize_tooSmall): return "Destination buffer is too small"; - case PREFIX(srcSize_wrong): return "Src size is incorrect"; case PREFIX(tableLog_tooLarge): return "tableLog requires too much memory : unsupported"; case PREFIX(maxSymbolValue_tooLarge): return "Unsupported max Symbol Value : too large"; case PREFIX(maxSymbolValue_tooSmall): return "Specified maxSymbolValue is too small"; case PREFIX(dictionary_corrupted): return "Dictionary is corrupted"; case PREFIX(dictionary_wrong): return "Dictionary mismatch"; case PREFIX(dictionaryCreation_failed): return "Cannot create Dictionary from provided samples"; + case PREFIX(dstSize_tooSmall): return "Destination buffer is too small"; + case PREFIX(srcSize_wrong): return "Src size is incorrect"; + /* following error codes are not stable and may be removed or changed in a future version */ case PREFIX(frameIndex_tooLarge): return "Frame index is too large"; case PREFIX(seekableIO): return "An I/O error occurred when reading/seeking"; case PREFIX(maxCode): diff --git a/contrib/zstd/lib/common/error_private.h b/sys/contrib/zstd/lib/common/error_private.h similarity index 90% rename from contrib/zstd/lib/common/error_private.h rename to sys/contrib/zstd/lib/common/error_private.h index 9dd9a87cfac8..0d2fa7e34b01 100644 --- a/contrib/zstd/lib/common/error_private.h +++ b/sys/contrib/zstd/lib/common/error_private.h @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ /* Note : this module is expected to remain private, do not expose it */ @@ -48,10 +49,9 @@ typedef ZSTD_ErrorCode ERR_enum; /*-**************************************** * Error codes handling ******************************************/ -#ifdef ERROR -# undef ERROR /* reported already defined on VS 2015 (Rich Geldreich) */ -#endif -#define ERROR(name) ((size_t)-PREFIX(name)) +#undef ERROR /* reported already defined on VS 2015 (Rich Geldreich) */ +#define ERROR(name) ZSTD_ERROR(name) +#define ZSTD_ERROR(name) ((size_t)-PREFIX(name)) ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); } diff --git a/contrib/zstd/lib/common/fse.h b/sys/contrib/zstd/lib/common/fse.h similarity index 99% rename from contrib/zstd/lib/common/fse.h rename to sys/contrib/zstd/lib/common/fse.h index 1c44f8375078..afd78019635a 100644 --- a/contrib/zstd/lib/common/fse.h +++ b/sys/contrib/zstd/lib/common/fse.h @@ -184,7 +184,7 @@ FSE_PUBLIC_API size_t FSE_writeNCount (void* buffer, size_t bufferSize, const sh /*! Constructor and Destructor of FSE_CTable. Note that FSE_CTable size depends on 'tableLog' and 'maxSymbolValue' */ typedef unsigned FSE_CTable; /* don't allocate that. It's only meant to be more restrictive than void* */ -FSE_PUBLIC_API FSE_CTable* FSE_createCTable (unsigned tableLog, unsigned maxSymbolValue); +FSE_PUBLIC_API FSE_CTable* FSE_createCTable (unsigned maxSymbolValue, unsigned tableLog); FSE_PUBLIC_API void FSE_freeCTable (FSE_CTable* ct); /*! FSE_buildCTable(): diff --git a/contrib/zstd/lib/common/fse_decompress.c b/sys/contrib/zstd/lib/common/fse_decompress.c similarity index 100% rename from contrib/zstd/lib/common/fse_decompress.c rename to sys/contrib/zstd/lib/common/fse_decompress.c diff --git a/contrib/zstd/lib/common/huf.h b/sys/contrib/zstd/lib/common/huf.h similarity index 99% rename from contrib/zstd/lib/common/huf.h rename to sys/contrib/zstd/lib/common/huf.h index 2b3015a84c19..522bf9b6c003 100644 --- a/contrib/zstd/lib/common/huf.h +++ b/sys/contrib/zstd/lib/common/huf.h @@ -242,7 +242,7 @@ size_t HUF_readStats(BYTE* huffWeight, size_t hwSize, U32* rankStats, /** HUF_readCTable() : * Loading a CTable saved with HUF_writeCTable() */ -size_t HUF_readCTable (HUF_CElt* CTable, unsigned maxSymbolValue, const void* src, size_t srcSize); +size_t HUF_readCTable (HUF_CElt* CTable, unsigned* maxSymbolValuePtr, const void* src, size_t srcSize); /* diff --git a/contrib/zstd/lib/common/mem.h b/sys/contrib/zstd/lib/common/mem.h similarity index 99% rename from contrib/zstd/lib/common/mem.h rename to sys/contrib/zstd/lib/common/mem.h index df85404fb869..23335c3146d7 100644 --- a/contrib/zstd/lib/common/mem.h +++ b/sys/contrib/zstd/lib/common/mem.h @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ #ifndef MEM_H_MODULE diff --git a/contrib/zstd/lib/common/pool.c b/sys/contrib/zstd/lib/common/pool.c similarity index 67% rename from contrib/zstd/lib/common/pool.c rename to sys/contrib/zstd/lib/common/pool.c index a227044f7f1c..1b0fe1035d2d 100644 --- a/contrib/zstd/lib/common/pool.c +++ b/sys/contrib/zstd/lib/common/pool.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ @@ -25,13 +26,14 @@ /* A job is a function and an opaque argument */ typedef struct POOL_job_s { - POOL_function function; - void *opaque; + POOL_function function; + void *opaque; } POOL_job; struct POOL_ctx_s { + ZSTD_customMem customMem; /* Keep track of the threads */ - pthread_t *threads; + ZSTD_pthread_t *threads; size_t numThreads; /* The queue is a circular buffer */ @@ -46,11 +48,11 @@ struct POOL_ctx_s { int queueEmpty; /* The mutex protects the queue */ - pthread_mutex_t queueMutex; + ZSTD_pthread_mutex_t queueMutex; /* Condition variable for pushers to wait on when the queue is full */ - pthread_cond_t queuePushCond; + ZSTD_pthread_cond_t queuePushCond; /* Condition variables for poppers to wait on when the queue is empty */ - pthread_cond_t queuePopCond; + ZSTD_pthread_cond_t queuePopCond; /* Indicates if the queue is shutting down */ int shutdown; }; @@ -65,14 +67,14 @@ static void* POOL_thread(void* opaque) { if (!ctx) { return NULL; } for (;;) { /* Lock the mutex and wait for a non-empty queue or until shutdown */ - pthread_mutex_lock(&ctx->queueMutex); + ZSTD_pthread_mutex_lock(&ctx->queueMutex); while (ctx->queueEmpty && !ctx->shutdown) { - pthread_cond_wait(&ctx->queuePopCond, &ctx->queueMutex); + ZSTD_pthread_cond_wait(&ctx->queuePopCond, &ctx->queueMutex); } /* empty => shutting down: so stop */ if (ctx->queueEmpty) { - pthread_mutex_unlock(&ctx->queueMutex); + ZSTD_pthread_mutex_unlock(&ctx->queueMutex); return opaque; } /* Pop a job off the queue */ @@ -81,28 +83,32 @@ static void* POOL_thread(void* opaque) { ctx->numThreadsBusy++; ctx->queueEmpty = ctx->queueHead == ctx->queueTail; /* Unlock the mutex, signal a pusher, and run the job */ - pthread_mutex_unlock(&ctx->queueMutex); - pthread_cond_signal(&ctx->queuePushCond); + ZSTD_pthread_mutex_unlock(&ctx->queueMutex); + ZSTD_pthread_cond_signal(&ctx->queuePushCond); job.function(job.opaque); /* If the intended queue size was 0, signal after finishing job */ if (ctx->queueSize == 1) { - pthread_mutex_lock(&ctx->queueMutex); + ZSTD_pthread_mutex_lock(&ctx->queueMutex); ctx->numThreadsBusy--; - pthread_mutex_unlock(&ctx->queueMutex); - pthread_cond_signal(&ctx->queuePushCond); + ZSTD_pthread_mutex_unlock(&ctx->queueMutex); + ZSTD_pthread_cond_signal(&ctx->queuePushCond); } } } /* for (;;) */ /* Unreachable */ } -POOL_ctx *POOL_create(size_t numThreads, size_t queueSize) { - POOL_ctx *ctx; +POOL_ctx* POOL_create(size_t numThreads, size_t queueSize) { + return POOL_create_advanced(numThreads, queueSize, ZSTD_defaultCMem); +} + +POOL_ctx* POOL_create_advanced(size_t numThreads, size_t queueSize, ZSTD_customMem customMem) { + POOL_ctx* ctx; /* Check the parameters */ if (!numThreads) { return NULL; } /* Allocate the context and zero initialize */ - ctx = (POOL_ctx *)calloc(1, sizeof(POOL_ctx)); + ctx = (POOL_ctx*)ZSTD_calloc(sizeof(POOL_ctx), customMem); if (!ctx) { return NULL; } /* Initialize the job queue. * It needs one extra space since one space is wasted to differentiate empty @@ -114,19 +120,20 @@ POOL_ctx *POOL_create(size_t numThreads, size_t queueSize) { ctx->queueTail = 0; ctx->numThreadsBusy = 0; ctx->queueEmpty = 1; - (void)pthread_mutex_init(&ctx->queueMutex, NULL); - (void)pthread_cond_init(&ctx->queuePushCond, NULL); - (void)pthread_cond_init(&ctx->queuePopCond, NULL); + (void)ZSTD_pthread_mutex_init(&ctx->queueMutex, NULL); + (void)ZSTD_pthread_cond_init(&ctx->queuePushCond, NULL); + (void)ZSTD_pthread_cond_init(&ctx->queuePopCond, NULL); ctx->shutdown = 0; /* Allocate space for the thread handles */ - ctx->threads = (pthread_t*)malloc(numThreads * sizeof(pthread_t)); + ctx->threads = (ZSTD_pthread_t*)ZSTD_malloc(numThreads * sizeof(ZSTD_pthread_t), customMem); ctx->numThreads = 0; + ctx->customMem = customMem; /* Check for errors */ if (!ctx->threads || !ctx->queue) { POOL_free(ctx); return NULL; } /* Initialize the threads */ { size_t i; for (i = 0; i < numThreads; ++i) { - if (pthread_create(&ctx->threads[i], NULL, &POOL_thread, ctx)) { + if (ZSTD_pthread_create(&ctx->threads[i], NULL, &POOL_thread, ctx)) { ctx->numThreads = i; POOL_free(ctx); return NULL; @@ -139,37 +146,37 @@ POOL_ctx *POOL_create(size_t numThreads, size_t queueSize) { /*! POOL_join() : Shutdown the queue, wake any sleeping threads, and join all of the threads. */ -static void POOL_join(POOL_ctx *ctx) { +static void POOL_join(POOL_ctx* ctx) { /* Shut down the queue */ - pthread_mutex_lock(&ctx->queueMutex); + ZSTD_pthread_mutex_lock(&ctx->queueMutex); ctx->shutdown = 1; - pthread_mutex_unlock(&ctx->queueMutex); + ZSTD_pthread_mutex_unlock(&ctx->queueMutex); /* Wake up sleeping threads */ - pthread_cond_broadcast(&ctx->queuePushCond); - pthread_cond_broadcast(&ctx->queuePopCond); + ZSTD_pthread_cond_broadcast(&ctx->queuePushCond); + ZSTD_pthread_cond_broadcast(&ctx->queuePopCond); /* Join all of the threads */ { size_t i; for (i = 0; i < ctx->numThreads; ++i) { - pthread_join(ctx->threads[i], NULL); + ZSTD_pthread_join(ctx->threads[i], NULL); } } } void POOL_free(POOL_ctx *ctx) { if (!ctx) { return; } POOL_join(ctx); - pthread_mutex_destroy(&ctx->queueMutex); - pthread_cond_destroy(&ctx->queuePushCond); - pthread_cond_destroy(&ctx->queuePopCond); - if (ctx->queue) free(ctx->queue); - if (ctx->threads) free(ctx->threads); - free(ctx); + ZSTD_pthread_mutex_destroy(&ctx->queueMutex); + ZSTD_pthread_cond_destroy(&ctx->queuePushCond); + ZSTD_pthread_cond_destroy(&ctx->queuePopCond); + ZSTD_free(ctx->queue, ctx->customMem); + ZSTD_free(ctx->threads, ctx->customMem); + ZSTD_free(ctx, ctx->customMem); } size_t POOL_sizeof(POOL_ctx *ctx) { if (ctx==NULL) return 0; /* supports sizeof NULL */ return sizeof(*ctx) + ctx->queueSize * sizeof(POOL_job) - + ctx->numThreads * sizeof(pthread_t); + + ctx->numThreads * sizeof(ZSTD_pthread_t); } /** @@ -191,12 +198,12 @@ void POOL_add(void* ctxVoid, POOL_function function, void *opaque) { POOL_ctx* const ctx = (POOL_ctx*)ctxVoid; if (!ctx) { return; } - pthread_mutex_lock(&ctx->queueMutex); + ZSTD_pthread_mutex_lock(&ctx->queueMutex); { POOL_job const job = {function, opaque}; /* Wait until there is space in the queue for the new job */ while (isQueueFull(ctx) && !ctx->shutdown) { - pthread_cond_wait(&ctx->queuePushCond, &ctx->queueMutex); + ZSTD_pthread_cond_wait(&ctx->queuePushCond, &ctx->queueMutex); } /* The queue is still going => there is space */ if (!ctx->shutdown) { @@ -205,8 +212,8 @@ void POOL_add(void* ctxVoid, POOL_function function, void *opaque) { ctx->queueTail = (ctx->queueTail + 1) % ctx->queueSize; } } - pthread_mutex_unlock(&ctx->queueMutex); - pthread_cond_signal(&ctx->queuePopCond); + ZSTD_pthread_mutex_unlock(&ctx->queueMutex); + ZSTD_pthread_cond_signal(&ctx->queuePopCond); } #else /* ZSTD_MULTITHREAD not defined */ @@ -214,26 +221,34 @@ void POOL_add(void* ctxVoid, POOL_function function, void *opaque) { /* We don't need any data, but if it is empty malloc() might return NULL. */ struct POOL_ctx_s { - int data; + int dummy; }; +static POOL_ctx g_ctx; POOL_ctx* POOL_create(size_t numThreads, size_t queueSize) { - (void)numThreads; - (void)queueSize; - return (POOL_ctx*)malloc(sizeof(POOL_ctx)); + return POOL_create_advanced(numThreads, queueSize, ZSTD_defaultCMem); +} + +POOL_ctx* POOL_create_advanced(size_t numThreads, size_t queueSize, ZSTD_customMem customMem) { + (void)numThreads; + (void)queueSize; + (void)customMem; + return &g_ctx; } void POOL_free(POOL_ctx* ctx) { - free(ctx); + assert(!ctx || ctx == &g_ctx); + (void)ctx; } void POOL_add(void* ctx, POOL_function function, void* opaque) { - (void)ctx; - function(opaque); + (void)ctx; + function(opaque); } size_t POOL_sizeof(POOL_ctx* ctx) { if (ctx==NULL) return 0; /* supports sizeof NULL */ + assert(ctx == &g_ctx); return sizeof(*ctx); } diff --git a/contrib/zstd/lib/common/pool.h b/sys/contrib/zstd/lib/common/pool.h similarity index 88% rename from contrib/zstd/lib/common/pool.h rename to sys/contrib/zstd/lib/common/pool.h index 264c5c9ca7ea..08c63715aaa6 100644 --- a/contrib/zstd/lib/common/pool.h +++ b/sys/contrib/zstd/lib/common/pool.h @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ #ifndef POOL_H @@ -16,6 +17,7 @@ extern "C" { #include /* size_t */ +#include "zstd_internal.h" /* ZSTD_customMem */ typedef struct POOL_ctx_s POOL_ctx; @@ -27,6 +29,8 @@ typedef struct POOL_ctx_s POOL_ctx; */ POOL_ctx *POOL_create(size_t numThreads, size_t queueSize); +POOL_ctx *POOL_create_advanced(size_t numThreads, size_t queueSize, ZSTD_customMem customMem); + /*! POOL_free() : Free a thread pool returned by POOL_create(). */ diff --git a/contrib/zstd/lib/common/threading.c b/sys/contrib/zstd/lib/common/threading.c similarity index 59% rename from contrib/zstd/lib/common/threading.c rename to sys/contrib/zstd/lib/common/threading.c index 141376c56199..8be8c8da948a 100644 --- a/contrib/zstd/lib/common/threading.c +++ b/sys/contrib/zstd/lib/common/threading.c @@ -2,9 +2,9 @@ * Copyright (c) 2016 Tino Reichardt * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). * * You can contact the author at: * - zstdmt source repository: https://github.com/mcmilk/zstdmt @@ -14,12 +14,8 @@ * This file will hold wrapper for systems, which do not support pthreads */ -/* When ZSTD_MULTITHREAD is not defined, this file would become an empty translation unit. -* Include some ISO C header code to prevent this and portably avoid related warnings. -* (Visual C++: C4206 / GCC: -Wpedantic / Clang: -Wempty-translation-unit) -*/ -#include - +/* create fake symbol to avoid empty trnaslation unit warning */ +int g_ZSTD_threading_useles_symbol; #if defined(ZSTD_MULTITHREAD) && defined(_WIN32) @@ -39,12 +35,12 @@ static unsigned __stdcall worker(void *arg) { - pthread_t* const thread = (pthread_t*) arg; + ZSTD_pthread_t* const thread = (ZSTD_pthread_t*) arg; thread->arg = thread->start_routine(thread->arg); return 0; } -int pthread_create(pthread_t* thread, const void* unused, +int ZSTD_pthread_create(ZSTD_pthread_t* thread, const void* unused, void* (*start_routine) (void*), void* arg) { (void)unused; @@ -58,16 +54,16 @@ int pthread_create(pthread_t* thread, const void* unused, return 0; } -int _pthread_join(pthread_t * thread, void **value_ptr) +int ZSTD_pthread_join(ZSTD_pthread_t thread, void **value_ptr) { DWORD result; - if (!thread->handle) return 0; + if (!thread.handle) return 0; - result = WaitForSingleObject(thread->handle, INFINITE); + result = WaitForSingleObject(thread.handle, INFINITE); switch (result) { case WAIT_OBJECT_0: - if (value_ptr) *value_ptr = thread->arg; + if (value_ptr) *value_ptr = thread.arg; return 0; case WAIT_ABANDONED: return EINVAL; diff --git a/sys/contrib/zstd/lib/common/threading.h b/sys/contrib/zstd/lib/common/threading.h new file mode 100644 index 000000000000..197770db27a8 --- /dev/null +++ b/sys/contrib/zstd/lib/common/threading.h @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2016 Tino Reichardt + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * + * You can contact the author at: + * - zstdmt source repository: https://github.com/mcmilk/zstdmt + */ + +#ifndef THREADING_H_938743 +#define THREADING_H_938743 + +#if defined (__cplusplus) +extern "C" { +#endif + +#if defined(ZSTD_MULTITHREAD) && defined(_WIN32) + +/** + * Windows minimalist Pthread Wrapper, based on : + * http://www.cse.wustl.edu/~schmidt/win32-cv-1.html + */ +#ifdef WINVER +# undef WINVER +#endif +#define WINVER 0x0600 + +#ifdef _WIN32_WINNT +# undef _WIN32_WINNT +#endif +#define _WIN32_WINNT 0x0600 + +#ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif + +#undef ERROR /* reported already defined on VS 2015 (Rich Geldreich) */ +#include +#undef ERROR +#define ERROR(name) ZSTD_ERROR(name) + + +/* mutex */ +#define ZSTD_pthread_mutex_t CRITICAL_SECTION +#define ZSTD_pthread_mutex_init(a, b) (InitializeCriticalSection((a)), 0) +#define ZSTD_pthread_mutex_destroy(a) DeleteCriticalSection((a)) +#define ZSTD_pthread_mutex_lock(a) EnterCriticalSection((a)) +#define ZSTD_pthread_mutex_unlock(a) LeaveCriticalSection((a)) + +/* condition variable */ +#define ZSTD_pthread_cond_t CONDITION_VARIABLE +#define ZSTD_pthread_cond_init(a, b) (InitializeConditionVariable((a)), 0) +#define ZSTD_pthread_cond_destroy(a) /* No delete */ +#define ZSTD_pthread_cond_wait(a, b) SleepConditionVariableCS((a), (b), INFINITE) +#define ZSTD_pthread_cond_signal(a) WakeConditionVariable((a)) +#define ZSTD_pthread_cond_broadcast(a) WakeAllConditionVariable((a)) + +/* ZSTD_pthread_create() and ZSTD_pthread_join() */ +typedef struct { + HANDLE handle; + void* (*start_routine)(void*); + void* arg; +} ZSTD_pthread_t; + +int ZSTD_pthread_create(ZSTD_pthread_t* thread, const void* unused, + void* (*start_routine) (void*), void* arg); + +int ZSTD_pthread_join(ZSTD_pthread_t thread, void** value_ptr); + +/** + * add here more wrappers as required + */ + + +#elif defined(ZSTD_MULTITHREAD) /* posix assumed ; need a better detection method */ +/* === POSIX Systems === */ +# include + +#define ZSTD_pthread_mutex_t pthread_mutex_t +#define ZSTD_pthread_mutex_init(a, b) pthread_mutex_init((a), (b)) +#define ZSTD_pthread_mutex_destroy(a) pthread_mutex_destroy((a)) +#define ZSTD_pthread_mutex_lock(a) pthread_mutex_lock((a)) +#define ZSTD_pthread_mutex_unlock(a) pthread_mutex_unlock((a)) + +#define ZSTD_pthread_cond_t pthread_cond_t +#define ZSTD_pthread_cond_init(a, b) pthread_cond_init((a), (b)) +#define ZSTD_pthread_cond_destroy(a) pthread_cond_destroy((a)) +#define ZSTD_pthread_cond_wait(a, b) pthread_cond_wait((a), (b)) +#define ZSTD_pthread_cond_signal(a) pthread_cond_signal((a)) +#define ZSTD_pthread_cond_broadcast(a) pthread_cond_broadcast((a)) + +#define ZSTD_pthread_t pthread_t +#define ZSTD_pthread_create(a, b, c, d) pthread_create((a), (b), (c), (d)) +#define ZSTD_pthread_join(a, b) pthread_join((a),(b)) + +#else /* ZSTD_MULTITHREAD not defined */ +/* No multithreading support */ + +typedef int ZSTD_pthread_mutex_t; +#define ZSTD_pthread_mutex_init(a, b) ((void)a, 0) +#define ZSTD_pthread_mutex_destroy(a) +#define ZSTD_pthread_mutex_lock(a) +#define ZSTD_pthread_mutex_unlock(a) + +typedef int ZSTD_pthread_cond_t; +#define ZSTD_pthread_cond_init(a, b) ((void)a, 0) +#define ZSTD_pthread_cond_destroy(a) +#define ZSTD_pthread_cond_wait(a, b) +#define ZSTD_pthread_cond_signal(a) +#define ZSTD_pthread_cond_broadcast(a) + +/* do not use ZSTD_pthread_t */ + +#endif /* ZSTD_MULTITHREAD */ + +#if defined (__cplusplus) +} +#endif + +#endif /* THREADING_H_938743 */ diff --git a/contrib/zstd/lib/common/xxhash.c b/sys/contrib/zstd/lib/common/xxhash.c similarity index 100% rename from contrib/zstd/lib/common/xxhash.c rename to sys/contrib/zstd/lib/common/xxhash.c diff --git a/contrib/zstd/lib/common/xxhash.h b/sys/contrib/zstd/lib/common/xxhash.h similarity index 100% rename from contrib/zstd/lib/common/xxhash.h rename to sys/contrib/zstd/lib/common/xxhash.h diff --git a/contrib/zstd/lib/common/zstd_common.c b/sys/contrib/zstd/lib/common/zstd_common.c similarity index 96% rename from contrib/zstd/lib/common/zstd_common.c rename to sys/contrib/zstd/lib/common/zstd_common.c index 08384cabf59b..c2041053be7f 100644 --- a/contrib/zstd/lib/common/zstd_common.c +++ b/sys/contrib/zstd/lib/common/zstd_common.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ @@ -15,8 +16,7 @@ #include /* malloc, calloc, free */ #include /* memset */ #include "error_private.h" -#define ZSTD_STATIC_LINKING_ONLY -#include "zstd.h" +#include "zstd_internal.h" /*-**************************************** diff --git a/contrib/zstd/lib/common/zstd_errors.h b/sys/contrib/zstd/lib/common/zstd_errors.h similarity index 92% rename from contrib/zstd/lib/common/zstd_errors.h rename to sys/contrib/zstd/lib/common/zstd_errors.h index a69387b714a8..4bcb7769fe77 100644 --- a/contrib/zstd/lib/common/zstd_errors.h +++ b/sys/contrib/zstd/lib/common/zstd_errors.h @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ #ifndef ZSTD_ERRORS_H_398273423 @@ -62,9 +63,10 @@ typedef enum { ZSTD_error_memory_allocation = 64, ZSTD_error_dstSize_tooSmall = 70, ZSTD_error_srcSize_wrong = 72, + /* following error codes are not stable and may be removed or changed in a future version */ ZSTD_error_frameIndex_tooLarge = 100, ZSTD_error_seekableIO = 102, - ZSTD_error_maxCode = 120 /* never EVER use this value directly, it may change in future versions! Use ZSTD_isError() instead */ + ZSTD_error_maxCode = 120 /* never EVER use this value directly, it can change in future versions! Use ZSTD_isError() instead */ } ZSTD_ErrorCode; /*! ZSTD_getErrorCode() : diff --git a/contrib/zstd/lib/common/zstd_internal.h b/sys/contrib/zstd/lib/common/zstd_internal.h similarity index 74% rename from contrib/zstd/lib/common/zstd_internal.h rename to sys/contrib/zstd/lib/common/zstd_internal.h index 2610528608d4..e91cd20baa79 100644 --- a/contrib/zstd/lib/common/zstd_internal.h +++ b/sys/contrib/zstd/lib/common/zstd_internal.h @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ #ifndef ZSTD_CCOMMON_H_MODULE @@ -29,6 +30,11 @@ #include "xxhash.h" /* XXH_reset, update, digest */ +#if defined (__cplusplus) +extern "C" { +#endif + + /*-************************************* * Debug ***************************************/ @@ -96,9 +102,13 @@ static const U32 repStartValue[ZSTD_REP_NUM] = { 1, 4, 8 }; #define BIT0 1 #define ZSTD_WINDOWLOG_ABSOLUTEMIN 10 +#define ZSTD_WINDOWLOG_DEFAULTMAX 27 /* Default maximum allowed window log */ static const size_t ZSTD_fcs_fieldSize[4] = { 0, 2, 4, 8 }; static const size_t ZSTD_did_fieldSize[4] = { 0, 1, 2, 4 }; +#define ZSTD_FRAMEIDSIZE 4 +static const size_t ZSTD_frameIdSize = ZSTD_FRAMEIDSIZE; /* magic number size */ + #define ZSTD_BLOCKHEADERSIZE 3 /* C standard doesn't allow `static const` variable to be init using another `static const` variable */ static const size_t ZSTD_blockHeaderSize = ZSTD_BLOCKHEADERSIZE; typedef enum { bt_raw, bt_rle, bt_compressed, bt_reserved } blockType_e; @@ -117,7 +127,8 @@ typedef enum { set_basic, set_rle, set_compressed, set_repeat } symbolEncodingTy #define MaxLit ((1<= 3) /* GCC Intrinsic */ - return 31 - __builtin_clz(val); + return 31 - __builtin_clz(val); # else /* Software version */ - static const int DeBruijnClz[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 }; - U32 v = val; - int r; - v |= v >> 1; - v |= v >> 2; - v |= v >> 4; - v |= v >> 8; - v |= v >> 16; - r = DeBruijnClz[(U32)(v * 0x07C4ACDDU) >> 27]; - return r; + static const int DeBruijnClz[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 }; + U32 v = val; + int r; + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + r = DeBruijnClz[(U32)(v * 0x07C4ACDDU) >> 27]; + return r; # endif + } } @@ -306,7 +362,7 @@ void ZSTD_invalidateRepCodes(ZSTD_CCtx* cctx); size_t ZSTD_initCStream_internal(ZSTD_CStream* zcs, const void* dict, size_t dictSize, const ZSTD_CDict* cdict, - ZSTD_parameters params, unsigned long long pledgedSrcSize); + ZSTD_CCtx_params params, unsigned long long pledgedSrcSize); /*! ZSTD_compressStream_generic() : * Private use only. To be called from zstdmt_compress.c in single-thread mode. */ @@ -315,10 +371,25 @@ size_t ZSTD_compressStream_generic(ZSTD_CStream* zcs, ZSTD_inBuffer* input, ZSTD_EndDirective const flushMode); -/*! ZSTD_getParamsFromCDict() : +/*! ZSTD_getCParamsFromCDict() : * as the name implies */ -ZSTD_parameters ZSTD_getParamsFromCDict(const ZSTD_CDict* cdict); +ZSTD_compressionParameters ZSTD_getCParamsFromCDict(const ZSTD_CDict* cdict); +/* ZSTD_compressBegin_advanced_internal() : + * Private use only. To be called from zstdmt_compress.c. */ +size_t ZSTD_compressBegin_advanced_internal(ZSTD_CCtx* cctx, + const void* dict, size_t dictSize, + ZSTD_dictMode_e dictMode, + ZSTD_CCtx_params params, + unsigned long long pledgedSrcSize); + +/* ZSTD_compress_advanced_internal() : + * Private use only. To be called from zstdmt_compress.c. */ +size_t ZSTD_compress_advanced_internal(ZSTD_CCtx* cctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + const void* dict,size_t dictSize, + ZSTD_CCtx_params params); typedef struct { blockType_e blockType; @@ -331,5 +402,8 @@ typedef struct { size_t ZSTD_getcBlockSize(const void* src, size_t srcSize, blockProperties_t* bpPtr); +#if defined (__cplusplus) +} +#endif #endif /* ZSTD_CCOMMON_H_MODULE */ diff --git a/contrib/zstd/lib/compress/fse_compress.c b/sys/contrib/zstd/lib/compress/fse_compress.c similarity index 99% rename from contrib/zstd/lib/compress/fse_compress.c rename to sys/contrib/zstd/lib/compress/fse_compress.c index cc9fa73514ad..549c115d4238 100644 --- a/contrib/zstd/lib/compress/fse_compress.c +++ b/sys/contrib/zstd/lib/compress/fse_compress.c @@ -461,6 +461,7 @@ static unsigned FSE_minTableLog(size_t srcSize, unsigned maxSymbolValue) U32 minBitsSrc = BIT_highbit32((U32)(srcSize - 1)) + 1; U32 minBitsSymbols = BIT_highbit32(maxSymbolValue) + 2; U32 minBits = minBitsSrc < minBitsSymbols ? minBitsSrc : minBitsSymbols; + assert(srcSize > 1); /* Not supported, RLE should be used instead */ return minBits; } @@ -469,6 +470,7 @@ unsigned FSE_optimalTableLog_internal(unsigned maxTableLog, size_t srcSize, unsi U32 maxBitsSrc = BIT_highbit32((U32)(srcSize - 1)) - minus; U32 tableLog = maxTableLog; U32 minBits = FSE_minTableLog(srcSize, maxSymbolValue); + assert(srcSize > 1); /* Not supported, RLE should be used instead */ if (tableLog==0) tableLog = FSE_DEFAULT_TABLELOG; if (maxBitsSrc < tableLog) tableLog = maxBitsSrc; /* Accuracy can be reduced */ if (minBits > tableLog) tableLog = minBits; /* Need a minimum to safely represent all symbol values */ @@ -580,7 +582,7 @@ size_t FSE_normalizeCount (short* normalizedCounter, unsigned tableLog, if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); /* Unsupported size */ if (tableLog < FSE_minTableLog(total, maxSymbolValue)) return ERROR(GENERIC); /* Too small tableLog, compression potentially impossible */ - { U32 const rtbTable[] = { 0, 473195, 504333, 520860, 550000, 700000, 750000, 830000 }; + { static U32 const rtbTable[] = { 0, 473195, 504333, 520860, 550000, 700000, 750000, 830000 }; U64 const scale = 62 - tableLog; U64 const step = ((U64)1<<62) / total; /* <== here, one division ! */ U64 const vStep = 1ULL<<(scale-20); diff --git a/contrib/zstd/lib/compress/huf_compress.c b/sys/contrib/zstd/lib/compress/huf_compress.c similarity index 98% rename from contrib/zstd/lib/compress/huf_compress.c rename to sys/contrib/zstd/lib/compress/huf_compress.c index 2a47c1820526..5692d56e003d 100644 --- a/contrib/zstd/lib/compress/huf_compress.c +++ b/sys/contrib/zstd/lib/compress/huf_compress.c @@ -167,7 +167,7 @@ size_t HUF_writeCTable (void* dst, size_t maxDstSize, } -size_t HUF_readCTable (HUF_CElt* CTable, U32 maxSymbolValue, const void* src, size_t srcSize) +size_t HUF_readCTable (HUF_CElt* CTable, U32* maxSymbolValuePtr, const void* src, size_t srcSize) { BYTE huffWeight[HUF_SYMBOLVALUE_MAX + 1]; /* init not required, even though some static analyzer may complain */ U32 rankVal[HUF_TABLELOG_ABSOLUTEMAX + 1]; /* large enough for values from 0 to 16 */ @@ -179,7 +179,7 @@ size_t HUF_readCTable (HUF_CElt* CTable, U32 maxSymbolValue, const void* src, si /* check result */ if (tableLog > HUF_TABLELOG_MAX) return ERROR(tableLog_tooLarge); - if (nbSymbols > maxSymbolValue+1) return ERROR(maxSymbolValue_tooSmall); + if (nbSymbols > *maxSymbolValuePtr+1) return ERROR(maxSymbolValue_tooSmall); /* Prepare base value per rank */ { U32 n, nextRankStart = 0; @@ -208,9 +208,10 @@ size_t HUF_readCTable (HUF_CElt* CTable, U32 maxSymbolValue, const void* src, si min >>= 1; } } /* assign value within rank, symbol order */ - { U32 n; for (n=0; n<=maxSymbolValue; n++) CTable[n].val = valPerRank[CTable[n].nbBits]++; } + { U32 n; for (n=0; n> 12 : 0; /* from 64 to 0 */ - return srcSize + (srcSize >> 8) + margin; + return ZSTD_COMPRESSBOUND(srcSize); } @@ -61,8 +56,6 @@ static void ZSTD_resetSeqStore(seqStore_t* ssPtr) /*-************************************* * Context memory management ***************************************/ -typedef enum { zcss_init=0, zcss_load, zcss_flush } ZSTD_cStreamStage; - struct ZSTD_CDict_s { void* dictBuffer; const void* dictContent; @@ -70,65 +63,6 @@ struct ZSTD_CDict_s { ZSTD_CCtx* refContext; }; /* typedef'd to ZSTD_CDict within "zstd.h" */ -struct ZSTD_CCtx_s { - const BYTE* nextSrc; /* next block here to continue on current prefix */ - const BYTE* base; /* All regular indexes relative to this position */ - const BYTE* dictBase; /* extDict indexes relative to this position */ - U32 dictLimit; /* below that point, need extDict */ - U32 lowLimit; /* below that point, no more data */ - U32 nextToUpdate; /* index from which to continue dictionary update */ - U32 nextToUpdate3; /* index from which to continue dictionary update */ - U32 hashLog3; /* dispatch table : larger == faster, more memory */ - U32 loadedDictEnd; /* index of end of dictionary */ - U32 forceWindow; /* force back-references to respect limit of 1<customMem = customMem; - cctx->compressionLevel = ZSTD_CLEVEL_DEFAULT; + cctx->requestedParams.compressionLevel = ZSTD_CLEVEL_DEFAULT; ZSTD_STATIC_ASSERT(zcss_init==0); ZSTD_STATIC_ASSERT(ZSTD_CONTENTSIZE_UNKNOWN==(0ULL - 1)); return cctx; @@ -151,7 +85,7 @@ ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem) ZSTD_CCtx* ZSTD_initStaticCCtx(void *workspace, size_t workspaceSize) { - ZSTD_CCtx* cctx = (ZSTD_CCtx*) workspace; + ZSTD_CCtx* const cctx = (ZSTD_CCtx*) workspace; if (workspaceSize <= sizeof(ZSTD_CCtx)) return NULL; /* minimum size */ if ((size_t)workspace & 7) return NULL; /* must be 8-aligned */ memset(workspace, 0, workspaceSize); /* may be a bit generous, could memset be smaller ? */ @@ -161,7 +95,7 @@ ZSTD_CCtx* ZSTD_initStaticCCtx(void *workspace, size_t workspaceSize) /* entropy space (never moves) */ if (cctx->workSpaceSize < sizeof(ZSTD_entropyCTables_t)) return NULL; - assert(((size_t)cctx->workSpace & 7) == 0); /* ensure correct alignment */ + assert(((size_t)cctx->workSpace & (sizeof(void*)-1)) == 0); /* ensure correct alignment */ cctx->entropy = (ZSTD_entropyCTables_t*)cctx->workSpace; return cctx; @@ -175,23 +109,36 @@ size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx) cctx->workSpace = NULL; ZSTD_freeCDict(cctx->cdictLocal); cctx->cdictLocal = NULL; +#ifdef ZSTD_MULTITHREAD ZSTDMT_freeCCtx(cctx->mtctx); cctx->mtctx = NULL; +#endif ZSTD_free(cctx, cctx->customMem); return 0; /* reserved as a potential error code in the future */ } + +static size_t ZSTD_sizeof_mtctx(const ZSTD_CCtx* cctx) +{ +#ifdef ZSTD_MULTITHREAD + return ZSTDMT_sizeof_CCtx(cctx->mtctx); +#else + (void) cctx; + return 0; +#endif +} + + size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx) { if (cctx==NULL) return 0; /* support sizeof on NULL */ - DEBUGLOG(5, "sizeof(*cctx) : %u", (U32)sizeof(*cctx)); - DEBUGLOG(5, "workSpaceSize : %u", (U32)cctx->workSpaceSize); - DEBUGLOG(5, "streaming buffers : %u", (U32)(cctx->outBuffSize + cctx->inBuffSize)); - DEBUGLOG(5, "inner MTCTX : %u", (U32)ZSTDMT_sizeof_CCtx(cctx->mtctx)); + DEBUGLOG(3, "sizeof(*cctx) : %u", (U32)sizeof(*cctx)); + DEBUGLOG(3, "workSpaceSize (including streaming buffers): %u", (U32)cctx->workSpaceSize); + DEBUGLOG(3, "inner cdict : %u", (U32)ZSTD_sizeof_CDict(cctx->cdictLocal)); + DEBUGLOG(3, "inner MTCTX : %u", (U32)ZSTD_sizeof_mtctx(cctx)); return sizeof(*cctx) + cctx->workSpaceSize + ZSTD_sizeof_CDict(cctx->cdictLocal) - + cctx->outBuffSize + cctx->inBuffSize - + ZSTDMT_sizeof_CCtx(cctx->mtctx); + + ZSTD_sizeof_mtctx(cctx); } size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs) @@ -202,29 +149,99 @@ size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs) /* private API call, for dictBuilder only */ const seqStore_t* ZSTD_getSeqStore(const ZSTD_CCtx* ctx) { return &(ctx->seqStore); } -static ZSTD_parameters ZSTD_getParamsFromCCtx(const ZSTD_CCtx* cctx) { return cctx->appliedParams; } +#define ZSTD_CLEVEL_CUSTOM 999 -/* older variant; will be deprecated */ -size_t ZSTD_setCCtxParameter(ZSTD_CCtx* cctx, ZSTD_CCtxParameter param, unsigned value) +static ZSTD_compressionParameters ZSTD_getCParamsFromCCtxParams( + ZSTD_CCtx_params params, U64 srcSizeHint, size_t dictSize) { - switch(param) - { - case ZSTD_p_forceWindow : cctx->forceWindow = value>0; cctx->loadedDictEnd = 0; return 0; - ZSTD_STATIC_ASSERT(ZSTD_dm_auto==0); - ZSTD_STATIC_ASSERT(ZSTD_dm_rawContent==1); - case ZSTD_p_forceRawDict : cctx->dictMode = (ZSTD_dictMode_e)(value>0); return 0; - default: return ERROR(parameter_unsupported); - } + return (params.compressionLevel == ZSTD_CLEVEL_CUSTOM ? + params.cParams : + ZSTD_getCParams(params.compressionLevel, srcSizeHint, dictSize)); } +static void ZSTD_cLevelToCCtxParams_srcSize(ZSTD_CCtx_params* params, U64 srcSize) +{ + params->cParams = ZSTD_getCParamsFromCCtxParams(*params, srcSize, 0); + params->compressionLevel = ZSTD_CLEVEL_CUSTOM; +} -#define ZSTD_CLEVEL_CUSTOM 999 static void ZSTD_cLevelToCParams(ZSTD_CCtx* cctx) { - if (cctx->compressionLevel==ZSTD_CLEVEL_CUSTOM) return; - cctx->requestedParams.cParams = ZSTD_getCParams(cctx->compressionLevel, - cctx->pledgedSrcSizePlusOne-1, 0); - cctx->compressionLevel = ZSTD_CLEVEL_CUSTOM; + ZSTD_cLevelToCCtxParams_srcSize( + &cctx->requestedParams, cctx->pledgedSrcSizePlusOne-1); +} + +static void ZSTD_cLevelToCCtxParams(ZSTD_CCtx_params* params) +{ + ZSTD_cLevelToCCtxParams_srcSize(params, 0); +} + +static ZSTD_CCtx_params ZSTD_makeCCtxParamsFromCParams( + ZSTD_compressionParameters cParams) +{ + ZSTD_CCtx_params cctxParams; + memset(&cctxParams, 0, sizeof(cctxParams)); + cctxParams.cParams = cParams; + cctxParams.compressionLevel = ZSTD_CLEVEL_CUSTOM; + return cctxParams; +} + +static ZSTD_CCtx_params* ZSTD_createCCtxParams_advanced( + ZSTD_customMem customMem) +{ + ZSTD_CCtx_params* params; + if (!customMem.customAlloc ^ !customMem.customFree) return NULL; + params = (ZSTD_CCtx_params*)ZSTD_calloc( + sizeof(ZSTD_CCtx_params), customMem); + if (!params) { return NULL; } + params->customMem = customMem; + params->compressionLevel = ZSTD_CLEVEL_DEFAULT; + return params; +} + +ZSTD_CCtx_params* ZSTD_createCCtxParams(void) +{ + return ZSTD_createCCtxParams_advanced(ZSTD_defaultCMem); +} + +size_t ZSTD_freeCCtxParams(ZSTD_CCtx_params* params) +{ + if (params == NULL) { return 0; } + ZSTD_free(params, params->customMem); + return 0; +} + +size_t ZSTD_resetCCtxParams(ZSTD_CCtx_params* params) +{ + return ZSTD_initCCtxParams(params, ZSTD_CLEVEL_DEFAULT); +} + +size_t ZSTD_initCCtxParams(ZSTD_CCtx_params* cctxParams, int compressionLevel) { + if (!cctxParams) { return ERROR(GENERIC); } + memset(cctxParams, 0, sizeof(*cctxParams)); + cctxParams->compressionLevel = compressionLevel; + return 0; +} + +size_t ZSTD_initCCtxParams_advanced(ZSTD_CCtx_params* cctxParams, ZSTD_parameters params) +{ + if (!cctxParams) { return ERROR(GENERIC); } + CHECK_F( ZSTD_checkCParams(params.cParams) ); + memset(cctxParams, 0, sizeof(*cctxParams)); + cctxParams->cParams = params.cParams; + cctxParams->fParams = params.fParams; + cctxParams->compressionLevel = ZSTD_CLEVEL_CUSTOM; + return 0; +} + +static ZSTD_CCtx_params ZSTD_assignParamsToCCtxParams( + ZSTD_CCtx_params cctxParams, ZSTD_parameters params) +{ + ZSTD_CCtx_params ret = cctxParams; + ret.cParams = params.cParams; + ret.fParams = params.fParams; + ret.compressionLevel = ZSTD_CLEVEL_CUSTOM; + return ret; } #define CLAMPCHECK(val,min,max) { \ @@ -238,167 +255,285 @@ size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned v switch(param) { - case ZSTD_p_compressionLevel : - if ((int)value > ZSTD_maxCLevel()) value = ZSTD_maxCLevel(); /* cap max compression level */ + case ZSTD_p_format : + return ZSTD_CCtxParam_setParameter(&cctx->requestedParams, param, value); + + case ZSTD_p_compressionLevel: if (value == 0) return 0; /* special value : 0 means "don't change anything" */ if (cctx->cdict) return ERROR(stage_wrong); - cctx->compressionLevel = value; - return 0; + return ZSTD_CCtxParam_setParameter(&cctx->requestedParams, param, value); - case ZSTD_p_windowLog : - DEBUGLOG(5, "setting ZSTD_p_windowLog = %u (cdict:%u)", - value, (cctx->cdict!=NULL)); + case ZSTD_p_windowLog: + case ZSTD_p_hashLog: + case ZSTD_p_chainLog: + case ZSTD_p_searchLog: + case ZSTD_p_minMatch: + case ZSTD_p_targetLength: + case ZSTD_p_compressionStrategy: if (value == 0) return 0; /* special value : 0 means "don't change anything" */ if (cctx->cdict) return ERROR(stage_wrong); - CLAMPCHECK(value, ZSTD_WINDOWLOG_MIN, ZSTD_WINDOWLOG_MAX); - ZSTD_cLevelToCParams(cctx); - cctx->requestedParams.cParams.windowLog = value; - return 0; + ZSTD_cLevelToCParams(cctx); /* Can optimize if srcSize is known */ + return ZSTD_CCtxParam_setParameter(&cctx->requestedParams, param, value); - case ZSTD_p_hashLog : - if (value == 0) return 0; /* special value : 0 means "don't change anything" */ - if (cctx->cdict) return ERROR(stage_wrong); - CLAMPCHECK(value, ZSTD_HASHLOG_MIN, ZSTD_HASHLOG_MAX); - ZSTD_cLevelToCParams(cctx); - cctx->requestedParams.cParams.hashLog = value; - return 0; - - case ZSTD_p_chainLog : - if (value == 0) return 0; /* special value : 0 means "don't change anything" */ - if (cctx->cdict) return ERROR(stage_wrong); - CLAMPCHECK(value, ZSTD_CHAINLOG_MIN, ZSTD_CHAINLOG_MAX); - ZSTD_cLevelToCParams(cctx); - cctx->requestedParams.cParams.chainLog = value; - return 0; - - case ZSTD_p_searchLog : - if (value == 0) return 0; /* special value : 0 means "don't change anything" */ - if (cctx->cdict) return ERROR(stage_wrong); - CLAMPCHECK(value, ZSTD_SEARCHLOG_MIN, ZSTD_SEARCHLOG_MAX); - ZSTD_cLevelToCParams(cctx); - cctx->requestedParams.cParams.searchLog = value; - return 0; - - case ZSTD_p_minMatch : - if (value == 0) return 0; /* special value : 0 means "don't change anything" */ - if (cctx->cdict) return ERROR(stage_wrong); - CLAMPCHECK(value, ZSTD_SEARCHLENGTH_MIN, ZSTD_SEARCHLENGTH_MAX); - ZSTD_cLevelToCParams(cctx); - cctx->requestedParams.cParams.searchLength = value; - return 0; - - case ZSTD_p_targetLength : - if (value == 0) return 0; /* special value : 0 means "don't change anything" */ - if (cctx->cdict) return ERROR(stage_wrong); - CLAMPCHECK(value, ZSTD_TARGETLENGTH_MIN, ZSTD_TARGETLENGTH_MAX); - ZSTD_cLevelToCParams(cctx); - cctx->requestedParams.cParams.targetLength = value; - return 0; - - case ZSTD_p_compressionStrategy : - if (value == 0) return 0; /* special value : 0 means "don't change anything" */ - if (cctx->cdict) return ERROR(stage_wrong); - CLAMPCHECK(value, (unsigned)ZSTD_fast, (unsigned)ZSTD_btultra); - ZSTD_cLevelToCParams(cctx); - cctx->requestedParams.cParams.strategy = (ZSTD_strategy)value; - return 0; - - case ZSTD_p_contentSizeFlag : - DEBUGLOG(5, "set content size flag = %u", (value>0)); - /* Content size written in frame header _when known_ (default:1) */ - cctx->requestedParams.fParams.contentSizeFlag = value>0; - return 0; - - case ZSTD_p_checksumFlag : - /* A 32-bits content checksum will be calculated and written at end of frame (default:0) */ - cctx->requestedParams.fParams.checksumFlag = value>0; - return 0; - - case ZSTD_p_dictIDFlag : /* When applicable, dictionary's dictID is provided in frame header (default:1) */ - DEBUGLOG(5, "set dictIDFlag = %u", (value>0)); - cctx->requestedParams.fParams.noDictIDFlag = (value==0); - return 0; - - /* Dictionary parameters */ - case ZSTD_p_dictMode : - if (cctx->cdict) return ERROR(stage_wrong); /* must be set before loading */ - /* restrict dictionary mode, to "rawContent" or "fullDict" only */ - ZSTD_STATIC_ASSERT((U32)ZSTD_dm_fullDict > (U32)ZSTD_dm_rawContent); - if (value > (unsigned)ZSTD_dm_fullDict) - return ERROR(parameter_outOfBound); - cctx->dictMode = (ZSTD_dictMode_e)value; - return 0; - - case ZSTD_p_refDictContent : - if (cctx->cdict) return ERROR(stage_wrong); /* must be set before loading */ - /* dictionary content will be referenced, instead of copied */ - cctx->dictContentByRef = value>0; - return 0; + case ZSTD_p_contentSizeFlag: + case ZSTD_p_checksumFlag: + case ZSTD_p_dictIDFlag: + return ZSTD_CCtxParam_setParameter(&cctx->requestedParams, param, value); case ZSTD_p_forceMaxWindow : /* Force back-references to remain < windowSize, * even when referencing into Dictionary content * default : 0 when using a CDict, 1 when using a Prefix */ - cctx->forceWindow = value>0; cctx->loadedDictEnd = 0; - return 0; + return ZSTD_CCtxParam_setParameter(&cctx->requestedParams, param, value); case ZSTD_p_nbThreads: if (value==0) return 0; DEBUGLOG(5, " setting nbThreads : %u", value); -#ifndef ZSTD_MULTITHREAD - if (value > 1) return ERROR(parameter_unsupported); -#endif - if ((value>1) && (cctx->nbThreads != value)) { - if (cctx->staticSize) /* MT not compatible with static alloc */ - return ERROR(parameter_unsupported); - ZSTDMT_freeCCtx(cctx->mtctx); - cctx->nbThreads = 1; - cctx->mtctx = ZSTDMT_createCCtx_advanced(value, cctx->customMem); - if (cctx->mtctx == NULL) return ERROR(memory_allocation); + if (value > 1 && cctx->staticSize) { + return ERROR(parameter_unsupported); /* MT not compatible with static alloc */ } - cctx->nbThreads = value; - return 0; + return ZSTD_CCtxParam_setParameter(&cctx->requestedParams, param, value); case ZSTD_p_jobSize: - if (cctx->nbThreads <= 1) return ERROR(parameter_unsupported); - assert(cctx->mtctx != NULL); - return ZSTDMT_setMTCtxParameter(cctx->mtctx, ZSTDMT_p_sectionSize, value); + return ZSTD_CCtxParam_setParameter(&cctx->requestedParams, param, value); case ZSTD_p_overlapSizeLog: - DEBUGLOG(5, " setting overlap with nbThreads == %u", cctx->nbThreads); - if (cctx->nbThreads <= 1) return ERROR(parameter_unsupported); - assert(cctx->mtctx != NULL); - return ZSTDMT_setMTCtxParameter(cctx->mtctx, ZSTDMT_p_overlapSectionLog, value); + DEBUGLOG(5, " setting overlap with nbThreads == %u", cctx->requestedParams.nbThreads); + return ZSTD_CCtxParam_setParameter(&cctx->requestedParams, param, value); + + case ZSTD_p_enableLongDistanceMatching: + if (cctx->cdict) return ERROR(stage_wrong); + if (value != 0) { + ZSTD_cLevelToCParams(cctx); + } + return ZSTD_CCtxParam_setParameter(&cctx->requestedParams, param, value); + + case ZSTD_p_ldmHashLog: + case ZSTD_p_ldmMinMatch: + if (value == 0) return 0; /* special value : 0 means "don't change anything" */ + if (cctx->cdict) return ERROR(stage_wrong); + return ZSTD_CCtxParam_setParameter(&cctx->requestedParams, param, value); + + case ZSTD_p_ldmBucketSizeLog: + case ZSTD_p_ldmHashEveryLog: + if (cctx->cdict) return ERROR(stage_wrong); + return ZSTD_CCtxParam_setParameter(&cctx->requestedParams, param, value); default: return ERROR(parameter_unsupported); } } +size_t ZSTD_CCtxParam_setParameter( + ZSTD_CCtx_params* params, ZSTD_cParameter param, unsigned value) +{ + switch(param) + { + case ZSTD_p_format : + if (value > (unsigned)ZSTD_f_zstd1_magicless) + return ERROR(parameter_unsupported); + params->format = (ZSTD_format_e)value; + return 0; + + case ZSTD_p_compressionLevel : + if ((int)value > ZSTD_maxCLevel()) value = ZSTD_maxCLevel(); + if (value == 0) return 0; + params->compressionLevel = value; + return 0; + + case ZSTD_p_windowLog : + if (value == 0) return 0; + CLAMPCHECK(value, ZSTD_WINDOWLOG_MIN, ZSTD_WINDOWLOG_MAX); + ZSTD_cLevelToCCtxParams(params); + params->cParams.windowLog = value; + return 0; + + case ZSTD_p_hashLog : + if (value == 0) return 0; + CLAMPCHECK(value, ZSTD_HASHLOG_MIN, ZSTD_HASHLOG_MAX); + ZSTD_cLevelToCCtxParams(params); + params->cParams.hashLog = value; + return 0; + + case ZSTD_p_chainLog : + if (value == 0) return 0; + CLAMPCHECK(value, ZSTD_CHAINLOG_MIN, ZSTD_CHAINLOG_MAX); + ZSTD_cLevelToCCtxParams(params); + params->cParams.chainLog = value; + return 0; + + case ZSTD_p_searchLog : + if (value == 0) return 0; + CLAMPCHECK(value, ZSTD_SEARCHLOG_MIN, ZSTD_SEARCHLOG_MAX); + ZSTD_cLevelToCCtxParams(params); + params->cParams.searchLog = value; + return 0; + + case ZSTD_p_minMatch : + if (value == 0) return 0; + CLAMPCHECK(value, ZSTD_SEARCHLENGTH_MIN, ZSTD_SEARCHLENGTH_MAX); + ZSTD_cLevelToCCtxParams(params); + params->cParams.searchLength = value; + return 0; + + case ZSTD_p_targetLength : + if (value == 0) return 0; + CLAMPCHECK(value, ZSTD_TARGETLENGTH_MIN, ZSTD_TARGETLENGTH_MAX); + ZSTD_cLevelToCCtxParams(params); + params->cParams.targetLength = value; + return 0; + + case ZSTD_p_compressionStrategy : + if (value == 0) return 0; + CLAMPCHECK(value, (unsigned)ZSTD_fast, (unsigned)ZSTD_btultra); + ZSTD_cLevelToCCtxParams(params); + params->cParams.strategy = (ZSTD_strategy)value; + return 0; + + case ZSTD_p_contentSizeFlag : + /* Content size written in frame header _when known_ (default:1) */ + DEBUGLOG(5, "set content size flag = %u", (value>0)); + params->fParams.contentSizeFlag = value > 0; + return 0; + + case ZSTD_p_checksumFlag : + /* A 32-bits content checksum will be calculated and written at end of frame (default:0) */ + params->fParams.checksumFlag = value > 0; + return 0; + + case ZSTD_p_dictIDFlag : /* When applicable, dictionary's dictID is provided in frame header (default:1) */ + DEBUGLOG(5, "set dictIDFlag = %u", (value>0)); + params->fParams.noDictIDFlag = (value == 0); + return 0; + + case ZSTD_p_forceMaxWindow : + params->forceWindow = value > 0; + return 0; + + case ZSTD_p_nbThreads : + if (value == 0) return 0; +#ifndef ZSTD_MULTITHREAD + if (value > 1) return ERROR(parameter_unsupported); + return 0; +#else + return ZSTDMT_initializeCCtxParameters(params, value); +#endif + + case ZSTD_p_jobSize : +#ifndef ZSTD_MULTITHREAD + return ERROR(parameter_unsupported); +#else + if (params->nbThreads <= 1) return ERROR(parameter_unsupported); + return ZSTDMT_CCtxParam_setMTCtxParameter(params, ZSTDMT_p_sectionSize, value); +#endif + + case ZSTD_p_overlapSizeLog : +#ifndef ZSTD_MULTITHREAD + return ERROR(parameter_unsupported); +#else + if (params->nbThreads <= 1) return ERROR(parameter_unsupported); + return ZSTDMT_CCtxParam_setMTCtxParameter(params, ZSTDMT_p_overlapSectionLog, value); +#endif + + case ZSTD_p_enableLongDistanceMatching : + if (value != 0) { + ZSTD_cLevelToCCtxParams(params); + params->cParams.windowLog = ZSTD_LDM_DEFAULT_WINDOW_LOG; + } + return ZSTD_ldm_initializeParameters(¶ms->ldmParams, value); + + case ZSTD_p_ldmHashLog : + if (value == 0) return 0; + CLAMPCHECK(value, ZSTD_HASHLOG_MIN, ZSTD_HASHLOG_MAX); + params->ldmParams.hashLog = value; + return 0; + + case ZSTD_p_ldmMinMatch : + if (value == 0) return 0; + CLAMPCHECK(value, ZSTD_LDM_MINMATCH_MIN, ZSTD_LDM_MINMATCH_MAX); + params->ldmParams.minMatchLength = value; + return 0; + + case ZSTD_p_ldmBucketSizeLog : + if (value > ZSTD_LDM_BUCKETSIZELOG_MAX) { + return ERROR(parameter_outOfBound); + } + params->ldmParams.bucketSizeLog = value; + return 0; + + case ZSTD_p_ldmHashEveryLog : + if (value > ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN) { + return ERROR(parameter_outOfBound); + } + params->ldmParams.hashEveryLog = value; + return 0; + + default: return ERROR(parameter_unsupported); + } +} + +/** + * This function should be updated whenever ZSTD_CCtx_params is updated. + * Parameters are copied manually before the dictionary is loaded. + * The multithreading parameters jobSize and overlapSizeLog are set only if + * nbThreads > 1. + * + * Pledged srcSize is treated as unknown. + */ +size_t ZSTD_CCtx_setParametersUsingCCtxParams( + ZSTD_CCtx* cctx, const ZSTD_CCtx_params* params) +{ + if (cctx->streamStage != zcss_init) return ERROR(stage_wrong); + if (cctx->cdict) return ERROR(stage_wrong); + + /* Assume the compression and frame parameters are validated */ + cctx->requestedParams.cParams = params->cParams; + cctx->requestedParams.fParams = params->fParams; + cctx->requestedParams.compressionLevel = params->compressionLevel; + + /* Set force window explicitly since it sets cctx->loadedDictEnd */ + CHECK_F( ZSTD_CCtx_setParameter( + cctx, ZSTD_p_forceMaxWindow, params->forceWindow) ); + + /* Set multithreading parameters explicitly */ + CHECK_F( ZSTD_CCtx_setParameter(cctx, ZSTD_p_nbThreads, params->nbThreads) ); + if (params->nbThreads > 1) { + CHECK_F( ZSTD_CCtx_setParameter(cctx, ZSTD_p_jobSize, params->jobSize) ); + CHECK_F( ZSTD_CCtx_setParameter( + cctx, ZSTD_p_overlapSizeLog, params->overlapSizeLog) ); + } + + /* Copy long distance matching parameters */ + cctx->requestedParams.ldmParams = params->ldmParams; + + /* customMem is used only for create/free params and can be ignored */ + return 0; +} + ZSTDLIB_API size_t ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx* cctx, unsigned long long pledgedSrcSize) { - DEBUGLOG(5, " setting pledgedSrcSize to %u", (U32)pledgedSrcSize); + DEBUGLOG(4, " setting pledgedSrcSize to %u", (U32)pledgedSrcSize); if (cctx->streamStage != zcss_init) return ERROR(stage_wrong); cctx->pledgedSrcSizePlusOne = pledgedSrcSize+1; return 0; } -ZSTDLIB_API size_t ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, const void* dict, size_t dictSize) +size_t ZSTD_CCtx_loadDictionary_advanced( + ZSTD_CCtx* cctx, const void* dict, size_t dictSize, + ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictMode_e dictMode) { if (cctx->streamStage != zcss_init) return ERROR(stage_wrong); if (cctx->staticSize) return ERROR(memory_allocation); /* no malloc for static CCtx */ - DEBUGLOG(5, "load dictionary of size %u", (U32)dictSize); + DEBUGLOG(4, "load dictionary of size %u", (U32)dictSize); ZSTD_freeCDict(cctx->cdictLocal); /* in case one already exists */ if (dict==NULL || dictSize==0) { /* no dictionary mode */ cctx->cdictLocal = NULL; cctx->cdict = NULL; } else { ZSTD_compressionParameters const cParams = - cctx->compressionLevel == ZSTD_CLEVEL_CUSTOM ? - cctx->requestedParams.cParams : - ZSTD_getCParams(cctx->compressionLevel, 0, dictSize); + ZSTD_getCParamsFromCCtxParams(cctx->requestedParams, 0, dictSize); cctx->cdictLocal = ZSTD_createCDict_advanced( dict, dictSize, - cctx->dictContentByRef, cctx->dictMode, + dictLoadMethod, dictMode, cParams, cctx->customMem); cctx->cdict = cctx->cdictLocal; if (cctx->cdictLocal == NULL) @@ -407,21 +542,41 @@ ZSTDLIB_API size_t ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, const void* dict, s return 0; } +ZSTDLIB_API size_t ZSTD_CCtx_loadDictionary_byReference( + ZSTD_CCtx* cctx, const void* dict, size_t dictSize) +{ + return ZSTD_CCtx_loadDictionary_advanced( + cctx, dict, dictSize, ZSTD_dlm_byRef, ZSTD_dm_auto); +} + +ZSTDLIB_API size_t ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, const void* dict, size_t dictSize) +{ + return ZSTD_CCtx_loadDictionary_advanced( + cctx, dict, dictSize, ZSTD_dlm_byCopy, ZSTD_dm_auto); +} + + size_t ZSTD_CCtx_refCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict) { if (cctx->streamStage != zcss_init) return ERROR(stage_wrong); cctx->cdict = cdict; - cctx->prefix = NULL; /* exclusive */ - cctx->prefixSize = 0; + memset(&cctx->prefixDict, 0, sizeof(cctx->prefixDict)); /* exclusive */ return 0; } size_t ZSTD_CCtx_refPrefix(ZSTD_CCtx* cctx, const void* prefix, size_t prefixSize) +{ + return ZSTD_CCtx_refPrefix_advanced(cctx, prefix, prefixSize, ZSTD_dm_rawContent); +} + +size_t ZSTD_CCtx_refPrefix_advanced( + ZSTD_CCtx* cctx, const void* prefix, size_t prefixSize, ZSTD_dictMode_e dictMode) { if (cctx->streamStage != zcss_init) return ERROR(stage_wrong); cctx->cdict = NULL; /* prefix discards any prior cdict */ - cctx->prefix = prefix; - cctx->prefixSize = prefixSize; + cctx->prefixDict.dict = prefix; + cctx->prefixDict.dictSize = prefixSize; + cctx->prefixDict.dictMode = dictMode; return 0; } @@ -484,28 +639,37 @@ static U32 ZSTD_cycleLog(U32 hashLog, ZSTD_strategy strat) /** ZSTD_adjustCParams_internal() : optimize `cPar` for a given input (`srcSize` and `dictSize`). - mostly downsizing to reduce memory consumption and initialization. - Both `srcSize` and `dictSize` are optional (use 0 if unknown), - but if both are 0, no optimization can be done. - Note : cPar is considered validated at this stage. Use ZSTD_checkParams() to ensure that. */ + mostly downsizing to reduce memory consumption and initialization latency. + Both `srcSize` and `dictSize` are optional (use 0 if unknown). + Note : cPar is considered validated at this stage. Use ZSTD_checkCParams() to ensure that condition. */ ZSTD_compressionParameters ZSTD_adjustCParams_internal(ZSTD_compressionParameters cPar, unsigned long long srcSize, size_t dictSize) { + static const U64 minSrcSize = 513; /* (1<<9) + 1 */ + static const U64 maxWindowResize = 1ULL << (ZSTD_WINDOWLOG_MAX-1); assert(ZSTD_checkCParams(cPar)==0); - if (srcSize+dictSize == 0) return cPar; /* no size information available : no adjustment */ - /* resize params, to use less memory when necessary */ - { U32 const minSrcSize = (srcSize==0) ? 500 : 0; - U64 const rSize = srcSize + dictSize + minSrcSize; - if (rSize < ((U64)1< srcLog) cPar.windowLog = srcLog; - } } + if (dictSize && (srcSize+1<2) /* srcSize unknown */ ) + srcSize = minSrcSize; /* presumed small when there is a dictionary */ + else if (srcSize == 0) + srcSize = ZSTD_CONTENTSIZE_UNKNOWN; /* 0 == unknown : presumed large */ + + /* resize windowLog if input is small enough, to use less memory */ + if ( (srcSize < maxWindowResize) + && (dictSize < maxWindowResize) ) { + U32 const tSize = (U32)(srcSize + dictSize); + static U32 const hashSizeMin = 1 << ZSTD_HASHLOG_MIN; + U32 const srcLog = (tSize < hashSizeMin) ? ZSTD_HASHLOG_MIN : + ZSTD_highbit32(tSize-1) + 1; + if (cPar.windowLog > srcLog) cPar.windowLog = srcLog; + } if (cPar.hashLog > cPar.windowLog) cPar.hashLog = cPar.windowLog; { U32 const cycleLog = ZSTD_cycleLog(cPar.chainLog, cPar.strategy); - if (cycleLog > cPar.windowLog) cPar.chainLog -= (cycleLog - cPar.windowLog); + if (cycleLog > cPar.windowLog) + cPar.chainLog -= (cycleLog - cPar.windowLog); } - if (cPar.windowLog < ZSTD_WINDOWLOG_ABSOLUTEMIN) cPar.windowLog = ZSTD_WINDOWLOG_ABSOLUTEMIN; /* required for frame header */ + if (cPar.windowLog < ZSTD_WINDOWLOG_ABSOLUTEMIN) + cPar.windowLog = ZSTD_WINDOWLOG_ABSOLUTEMIN; /* required for frame header */ return cPar; } @@ -516,56 +680,81 @@ ZSTD_compressionParameters ZSTD_adjustCParams(ZSTD_compressionParameters cPar, u return ZSTD_adjustCParams_internal(cPar, srcSize, dictSize); } - -size_t ZSTD_estimateCCtxSize_advanced(ZSTD_compressionParameters cParams) +size_t ZSTD_estimateCCtxSize_usingCCtxParams(const ZSTD_CCtx_params* params) { - size_t const blockSize = MIN(ZSTD_BLOCKSIZE_MAX, (size_t)1 << cParams.windowLog); - U32 const divider = (cParams.searchLength==3) ? 3 : 4; - size_t const maxNbSeq = blockSize / divider; - size_t const tokenSpace = blockSize + 11*maxNbSeq; + /* Estimate CCtx size is supported for single-threaded compression only. */ + if (params->nbThreads > 1) { return ERROR(GENERIC); } + { ZSTD_compressionParameters const cParams = + ZSTD_getCParamsFromCCtxParams(*params, 0, 0); + size_t const blockSize = MIN(ZSTD_BLOCKSIZE_MAX, (size_t)1 << cParams.windowLog); + U32 const divider = (cParams.searchLength==3) ? 3 : 4; + size_t const maxNbSeq = blockSize / divider; + size_t const tokenSpace = blockSize + 11*maxNbSeq; + size_t const chainSize = + (cParams.strategy == ZSTD_fast) ? 0 : ((size_t)1 << cParams.chainLog); + size_t const hSize = ((size_t)1) << cParams.hashLog; + U32 const hashLog3 = (cParams.searchLength>3) ? + 0 : MIN(ZSTD_HASHLOG3_MAX, cParams.windowLog); + size_t const h3Size = ((size_t)1) << hashLog3; + size_t const entropySpace = sizeof(ZSTD_entropyCTables_t); + size_t const tableSpace = (chainSize + hSize + h3Size) * sizeof(U32); - size_t const chainSize = (cParams.strategy == ZSTD_fast) ? 0 : (1 << cParams.chainLog); - size_t const hSize = ((size_t)1) << cParams.hashLog; - U32 const hashLog3 = (cParams.searchLength>3) ? 0 : MIN(ZSTD_HASHLOG3_MAX, cParams.windowLog); - size_t const h3Size = ((size_t)1) << hashLog3; - size_t const entropySpace = sizeof(ZSTD_entropyCTables_t); - size_t const tableSpace = (chainSize + hSize + h3Size) * sizeof(U32); + size_t const optBudget = + ((MaxML+1) + (MaxLL+1) + (MaxOff+1) + (1<ldmParams.enableLdm ? + ZSTD_ldm_getTableSize(params->ldmParams.hashLog, + params->ldmParams.bucketSizeLog) : 0; - DEBUGLOG(5, "sizeof(ZSTD_CCtx) : %u", (U32)sizeof(ZSTD_CCtx)); - DEBUGLOG(5, "estimate workSpace : %u", (U32)neededSpace); - return sizeof(ZSTD_CCtx) + neededSpace; + size_t const neededSpace = entropySpace + tableSpace + tokenSpace + + optSpace + ldmSpace; + + DEBUGLOG(5, "sizeof(ZSTD_CCtx) : %u", (U32)sizeof(ZSTD_CCtx)); + DEBUGLOG(5, "estimate workSpace : %u", (U32)neededSpace); + return sizeof(ZSTD_CCtx) + neededSpace; + } +} + +size_t ZSTD_estimateCCtxSize_usingCParams(ZSTD_compressionParameters cParams) +{ + ZSTD_CCtx_params const params = ZSTD_makeCCtxParamsFromCParams(cParams); + return ZSTD_estimateCCtxSize_usingCCtxParams(¶ms); } size_t ZSTD_estimateCCtxSize(int compressionLevel) { ZSTD_compressionParameters const cParams = ZSTD_getCParams(compressionLevel, 0, 0); - return ZSTD_estimateCCtxSize_advanced(cParams); + return ZSTD_estimateCCtxSize_usingCParams(cParams); } -size_t ZSTD_estimateCStreamSize_advanced(ZSTD_compressionParameters cParams) +size_t ZSTD_estimateCStreamSize_usingCCtxParams(const ZSTD_CCtx_params* params) { - size_t const CCtxSize = ZSTD_estimateCCtxSize_advanced(cParams); - size_t const blockSize = MIN(ZSTD_BLOCKSIZE_MAX, (size_t)1 << cParams.windowLog); - size_t const inBuffSize = ((size_t)1 << cParams.windowLog) + blockSize; - size_t const outBuffSize = ZSTD_compressBound(blockSize) + 1; - size_t const streamingSize = inBuffSize + outBuffSize; + if (params->nbThreads > 1) { return ERROR(GENERIC); } + { size_t const CCtxSize = ZSTD_estimateCCtxSize_usingCCtxParams(params); + size_t const blockSize = MIN(ZSTD_BLOCKSIZE_MAX, (size_t)1 << params->cParams.windowLog); + size_t const inBuffSize = ((size_t)1 << params->cParams.windowLog) + blockSize; + size_t const outBuffSize = ZSTD_compressBound(blockSize) + 1; + size_t const streamingSize = inBuffSize + outBuffSize; - return CCtxSize + streamingSize; + return CCtxSize + streamingSize; + } +} + +size_t ZSTD_estimateCStreamSize_usingCParams(ZSTD_compressionParameters cParams) +{ + ZSTD_CCtx_params const params = ZSTD_makeCCtxParamsFromCParams(cParams); + return ZSTD_estimateCStreamSize_usingCCtxParams(¶ms); } size_t ZSTD_estimateCStreamSize(int compressionLevel) { ZSTD_compressionParameters const cParams = ZSTD_getCParams(compressionLevel, 0, 0); - return ZSTD_estimateCStreamSize_advanced(cParams); + return ZSTD_estimateCStreamSize_usingCParams(cParams); } - -static U32 ZSTD_equivalentParams(ZSTD_compressionParameters cParams1, - ZSTD_compressionParameters cParams2) +static U32 ZSTD_equivalentCParams(ZSTD_compressionParameters cParams1, + ZSTD_compressionParameters cParams2) { U32 bslog1 = MIN(cParams1.windowLog, ZSTD_BLOCKSIZELOG_MAX); U32 bslog2 = MIN(cParams2.windowLog, ZSTD_BLOCKSIZELOG_MAX); @@ -576,18 +765,39 @@ static U32 ZSTD_equivalentParams(ZSTD_compressionParameters cParams1, & ((cParams1.searchLength==3) == (cParams2.searchLength==3)); /* hashlog3 space */ } +/** The parameters are equivalent if ldm is not enabled in both sets or + * all the parameters are equivalent. */ +static U32 ZSTD_equivalentLdmParams(ldmParams_t ldmParams1, + ldmParams_t ldmParams2) +{ + return (!ldmParams1.enableLdm && !ldmParams2.enableLdm) || + (ldmParams1.enableLdm == ldmParams2.enableLdm && + ldmParams1.hashLog == ldmParams2.hashLog && + ldmParams1.bucketSizeLog == ldmParams2.bucketSizeLog && + ldmParams1.minMatchLength == ldmParams2.minMatchLength && + ldmParams1.hashEveryLog == ldmParams2.hashEveryLog); +} + +/** Equivalence for resetCCtx purposes */ +static U32 ZSTD_equivalentParams(ZSTD_CCtx_params params1, + ZSTD_CCtx_params params2) +{ + return ZSTD_equivalentCParams(params1.cParams, params2.cParams) && + ZSTD_equivalentLdmParams(params1.ldmParams, params2.ldmParams); +} + /*! ZSTD_continueCCtx() : * reuse CCtx without reset (note : requires no dictionary) */ -static size_t ZSTD_continueCCtx(ZSTD_CCtx* cctx, ZSTD_parameters params, U64 pledgedSrcSize) +static size_t ZSTD_continueCCtx(ZSTD_CCtx* cctx, ZSTD_CCtx_params params, U64 pledgedSrcSize) { U32 const end = (U32)(cctx->nextSrc - cctx->base); - DEBUGLOG(5, "continue mode"); + DEBUGLOG(4, "continue mode"); cctx->appliedParams = params; cctx->pledgedSrcSizePlusOne = pledgedSrcSize+1; cctx->consumedSrcSize = 0; if (pledgedSrcSize == ZSTD_CONTENTSIZE_UNKNOWN) cctx->appliedParams.fParams.contentSizeFlag = 0; - DEBUGLOG(5, "pledged content size : %u ; flag : %u", + DEBUGLOG(4, "pledged content size : %u ; flag : %u", (U32)pledgedSrcSize, cctx->appliedParams.fParams.contentSizeFlag); cctx->lowLimit = end; cctx->dictLimit = end; @@ -607,15 +817,19 @@ typedef enum { ZSTDb_not_buffered, ZSTDb_buffered } ZSTD_buffered_policy_e; /*! ZSTD_resetCCtx_internal() : note : `params` are assumed fully validated at this stage */ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, - ZSTD_parameters params, U64 pledgedSrcSize, + ZSTD_CCtx_params params, U64 pledgedSrcSize, ZSTD_compResetPolicy_e const crp, ZSTD_buffered_policy_e const zbuff) { + DEBUGLOG(4, "ZSTD_resetCCtx_internal"); assert(!ZSTD_isError(ZSTD_checkCParams(params.cParams))); + DEBUGLOG(4, "pledgedSrcSize: %u", (U32)pledgedSrcSize); if (crp == ZSTDcrp_continue) { - if (ZSTD_equivalentParams(params.cParams, zc->appliedParams.cParams)) { - DEBUGLOG(5, "ZSTD_equivalentParams()==1"); + if (ZSTD_equivalentParams(params, zc->appliedParams)) { + DEBUGLOG(4, "ZSTD_equivalentParams()==1"); + assert(!(params.ldmParams.enableLdm && + params.ldmParams.hashEveryLog == ZSTD_LDM_HASHEVERYLOG_NOTSET)); zc->entropy->hufCTable_repeatMode = HUF_repeat_none; zc->entropy->offcode_repeatMode = FSE_repeat_none; zc->entropy->matchlength_repeatMode = FSE_repeat_none; @@ -623,12 +837,21 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, return ZSTD_continueCCtx(zc, params, pledgedSrcSize); } } + if (params.ldmParams.enableLdm) { + /* Adjust long distance matching parameters */ + ZSTD_ldm_adjustParameters(¶ms.ldmParams, params.cParams.windowLog); + assert(params.ldmParams.hashLog >= params.ldmParams.bucketSizeLog); + assert(params.ldmParams.hashEveryLog < 32); + zc->ldmState.hashPower = + ZSTD_ldm_getHashPower(params.ldmParams.minMatchLength); + } + { size_t const blockSize = MIN(ZSTD_BLOCKSIZE_MAX, (size_t)1 << params.cParams.windowLog); U32 const divider = (params.cParams.searchLength==3) ? 3 : 4; size_t const maxNbSeq = blockSize / divider; size_t const tokenSpace = blockSize + 11*maxNbSeq; size_t const chainSize = (params.cParams.strategy == ZSTD_fast) ? - 0 : (1 << params.cParams.chainLog); + 0 : ((size_t)1 << params.cParams.chainLog); size_t const hSize = ((size_t)1) << params.cParams.hashLog; U32 const hashLog3 = (params.cParams.searchLength>3) ? 0 : MIN(ZSTD_HASHLOG3_MAX, params.cParams.windowLog); @@ -646,10 +869,13 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, || (params.cParams.strategy == ZSTD_btultra)) ? optPotentialSpace : 0; size_t const bufferSpace = buffInSize + buffOutSize; - size_t const neededSpace = entropySpace + optSpace + tableSpace - + tokenSpace + bufferSpace; + size_t const ldmSpace = params.ldmParams.enableLdm + ? ZSTD_ldm_getTableSize(params.ldmParams.hashLog, params.ldmParams.bucketSizeLog) + : 0; + size_t const neededSpace = entropySpace + optSpace + ldmSpace + + tableSpace + tokenSpace + bufferSpace; - if (zc->workSpaceSize < neededSpace) { /* too small : resize /*/ + if (zc->workSpaceSize < neededSpace) { /* too small : resize */ DEBUGLOG(5, "Need to update workSpaceSize from %uK to %uK \n", (unsigned)zc->workSpaceSize>>10, (unsigned)neededSpace>>10); @@ -714,6 +940,16 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, ptr = zc->optState.priceTable + ZSTD_OPT_NUM+1; } + /* ldm hash table */ + /* initialize bucketOffsets table later for pointer alignment */ + if (params.ldmParams.enableLdm) { + size_t const ldmHSize = ((size_t)1) << params.ldmParams.hashLog; + memset(ptr, 0, ldmHSize * sizeof(ldmEntry_t)); + assert(((size_t)ptr & 3) == 0); /* ensure ptr is properly aligned */ + zc->ldmState.hashTable = (ldmEntry_t*)ptr; + ptr = zc->ldmState.hashTable + ldmHSize; + } + /* table Space */ if (crp!=ZSTDcrp_noMemset) memset(ptr, 0, tableSpace); /* reset tables only */ assert(((size_t)ptr & 3) == 0); /* ensure ptr is properly aligned */ @@ -731,6 +967,16 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, zc->seqStore.litStart = zc->seqStore.ofCode + maxNbSeq; ptr = zc->seqStore.litStart + blockSize; + /* ldm bucketOffsets table */ + if (params.ldmParams.enableLdm) { + size_t const ldmBucketSize = + ((size_t)1) << (params.ldmParams.hashLog - + params.ldmParams.bucketSizeLog); + memset(ptr, 0, ldmBucketSize); + zc->ldmState.bucketOffsets = (BYTE*)ptr; + ptr = zc->ldmState.bucketOffsets + ldmBucketSize; + } + /* buffers */ zc->inBuffSize = buffInSize; zc->inBuff = (char*)ptr; @@ -753,6 +999,8 @@ void ZSTD_invalidateRepCodes(ZSTD_CCtx* cctx) { /*! ZSTD_copyCCtx_internal() : * Duplicate an existing context `srcCCtx` into another one `dstCCtx`. + * The "context", in this case, refers to the hash and chain tables, entropy + * tables, and dictionary offsets. * Only works during stage ZSTDcs_init (i.e. after creation, but before first call to ZSTD_compressContinue()). * pledgedSrcSize=0 means "empty" if fParams.contentSizeFlag=1 * @return : 0, or an error code */ @@ -766,14 +1014,16 @@ static size_t ZSTD_copyCCtx_internal(ZSTD_CCtx* dstCCtx, if (srcCCtx->stage!=ZSTDcs_init) return ERROR(stage_wrong); memcpy(&dstCCtx->customMem, &srcCCtx->customMem, sizeof(ZSTD_customMem)); - { ZSTD_parameters params = srcCCtx->appliedParams; + { ZSTD_CCtx_params params = dstCCtx->requestedParams; + /* Copy only compression parameters related to tables. */ + params.cParams = srcCCtx->appliedParams.cParams; params.fParams = fParams; ZSTD_resetCCtx_internal(dstCCtx, params, pledgedSrcSize, ZSTDcrp_noMemset, zbuff); } /* copy tables */ - { size_t const chainSize = (srcCCtx->appliedParams.cParams.strategy == ZSTD_fast) ? 0 : (1 << srcCCtx->appliedParams.cParams.chainLog); + { size_t const chainSize = (srcCCtx->appliedParams.cParams.strategy == ZSTD_fast) ? 0 : ((size_t)1 << srcCCtx->appliedParams.cParams.chainLog); size_t const hSize = (size_t)1 << srcCCtx->appliedParams.cParams.hashLog; size_t const h3Size = (size_t)1 << srcCCtx->hashLog3; size_t const tableSpace = (chainSize + hSize + h3Size) * sizeof(U32); @@ -826,18 +1076,36 @@ static void ZSTD_reduceTable (U32* const table, U32 const size, U32 const reduce } } +/*! ZSTD_ldm_reduceTable() : + * reduce table indexes by `reducerValue` */ +static void ZSTD_ldm_reduceTable(ldmEntry_t* const table, U32 const size, + U32 const reducerValue) +{ + U32 u; + for (u = 0; u < size; u++) { + if (table[u].offset < reducerValue) table[u].offset = 0; + else table[u].offset -= reducerValue; + } +} + /*! ZSTD_reduceIndex() : * rescale all indexes to avoid future overflow (indexes are U32) */ static void ZSTD_reduceIndex (ZSTD_CCtx* zc, const U32 reducerValue) { - { U32 const hSize = 1 << zc->appliedParams.cParams.hashLog; + { U32 const hSize = (U32)1 << zc->appliedParams.cParams.hashLog; ZSTD_reduceTable(zc->hashTable, hSize, reducerValue); } - { U32 const chainSize = (zc->appliedParams.cParams.strategy == ZSTD_fast) ? 0 : (1 << zc->appliedParams.cParams.chainLog); + { U32 const chainSize = (zc->appliedParams.cParams.strategy == ZSTD_fast) ? 0 : ((U32)1 << zc->appliedParams.cParams.chainLog); ZSTD_reduceTable(zc->chainTable, chainSize, reducerValue); } - { U32 const h3Size = (zc->hashLog3) ? 1 << zc->hashLog3 : 0; + { U32 const h3Size = (zc->hashLog3) ? (U32)1 << zc->hashLog3 : 0; ZSTD_reduceTable(zc->hashTable3, h3Size, reducerValue); } + + { if (zc->appliedParams.ldmParams.enableLdm) { + U32 const ldmHSize = (U32)1 << zc->appliedParams.ldmParams.hashLog; + ZSTD_ldm_reduceTable(zc->ldmState.hashTable, ldmHSize, reducerValue); + } + } } @@ -976,24 +1244,6 @@ static size_t ZSTD_compressLiterals (ZSTD_entropyCTables_t * entropy, return lhSize+cLitSize; } -static const BYTE LL_Code[64] = { 0, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, - 16, 16, 17, 17, 18, 18, 19, 19, - 20, 20, 20, 20, 21, 21, 21, 21, - 22, 22, 22, 22, 22, 22, 22, 22, - 23, 23, 23, 23, 23, 23, 23, 23, - 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24 }; - -static const BYTE ML_Code[128] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 36, 36, 37, 37, 37, 37, - 38, 38, 38, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, 39, 39, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42 }; - void ZSTD_seqToCodes(const seqStore_t* seqStorePtr) { @@ -1018,20 +1268,30 @@ void ZSTD_seqToCodes(const seqStore_t* seqStorePtr) mlCodeTable[seqStorePtr->longLengthPos] = MaxML; } -MEM_STATIC symbolEncodingType_e ZSTD_selectEncodingType(FSE_repeat* repeatMode, - size_t const mostFrequent, size_t nbSeq, U32 defaultNormLog) +typedef enum { + ZSTD_defaultDisallowed = 0, + ZSTD_defaultAllowed = 1 +} ZSTD_defaultPolicy_e; + +MEM_STATIC symbolEncodingType_e ZSTD_selectEncodingType( + FSE_repeat* repeatMode, size_t const mostFrequent, size_t nbSeq, + U32 defaultNormLog, ZSTD_defaultPolicy_e const isDefaultAllowed) { #define MIN_SEQ_FOR_DYNAMIC_FSE 64 #define MAX_SEQ_FOR_STATIC_FSE 1000 - - if ((mostFrequent == nbSeq) && (nbSeq > 2)) { + ZSTD_STATIC_ASSERT(ZSTD_defaultDisallowed == 0 && ZSTD_defaultAllowed != 0); + if ((mostFrequent == nbSeq) && (!isDefaultAllowed || nbSeq > 2)) { + /* Prefer set_basic over set_rle when there are 2 or less symbols, + * since RLE uses 1 byte, but set_basic uses 5-6 bits per symbol. + * If basic encoding isn't possible, always choose RLE. + */ *repeatMode = FSE_repeat_check; return set_rle; } - if ((*repeatMode == FSE_repeat_valid) && (nbSeq < MAX_SEQ_FOR_STATIC_FSE)) { + if (isDefaultAllowed && (*repeatMode == FSE_repeat_valid) && (nbSeq < MAX_SEQ_FOR_STATIC_FSE)) { return set_repeat; } - if ((nbSeq < MIN_SEQ_FOR_DYNAMIC_FSE) || (mostFrequent < (nbSeq >> (defaultNormLog-1)))) { + if (isDefaultAllowed && ((nbSeq < MIN_SEQ_FOR_DYNAMIC_FSE) || (mostFrequent < (nbSeq >> (defaultNormLog-1))))) { *repeatMode = FSE_repeat_valid; return set_basic; } @@ -1067,6 +1327,7 @@ MEM_STATIC size_t ZSTD_buildCTable(void* dst, size_t dstCapacity, count[codeTable[nbSeq-1]]--; nbSeq_1--; } + assert(nbSeq_1 > 1); CHECK_F(FSE_normalizeCount(norm, tableLog, count, nbSeq_1, max)); { size_t const NCountSize = FSE_writeNCount(op, oend - op, norm, max, tableLog); /* overflow protected */ if (FSE_isError(NCountSize)) return NCountSize; @@ -1131,7 +1392,7 @@ MEM_STATIC size_t ZSTD_encodeSequences(void* dst, size_t dstCapacity, BIT_addBits(&blockStream, sequences[n].litLength, llBits); if (MEM_32bits() && ((llBits+mlBits)>24)) BIT_flushBits(&blockStream); BIT_addBits(&blockStream, sequences[n].matchLength, mlBits); - if (MEM_32bits()) BIT_flushBits(&blockStream); /* (7)*/ + if (MEM_32bits() || (ofBits+mlBits+llBits > 56)) BIT_flushBits(&blockStream); if (longOffsets) { int const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULATOR_MIN-1); if (extraBits) { @@ -1204,7 +1465,7 @@ MEM_STATIC size_t ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, /* CTable for Literal Lengths */ { U32 max = MaxLL; size_t const mostFrequent = FSE_countFast_wksp(count, &max, llCodeTable, nbSeq, entropy->workspace); - LLtype = ZSTD_selectEncodingType(&entropy->litlength_repeatMode, mostFrequent, nbSeq, LL_defaultNormLog); + LLtype = ZSTD_selectEncodingType(&entropy->litlength_repeatMode, mostFrequent, nbSeq, LL_defaultNormLog, ZSTD_defaultAllowed); { size_t const countSize = ZSTD_buildCTable(op, oend - op, CTable_LitLength, LLFSELog, (symbolEncodingType_e)LLtype, count, max, llCodeTable, nbSeq, LL_defaultNorm, LL_defaultNormLog, MaxLL, entropy->workspace, sizeof(entropy->workspace)); @@ -1214,9 +1475,11 @@ MEM_STATIC size_t ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, /* CTable for Offsets */ { U32 max = MaxOff; size_t const mostFrequent = FSE_countFast_wksp(count, &max, ofCodeTable, nbSeq, entropy->workspace); - Offtype = ZSTD_selectEncodingType(&entropy->offcode_repeatMode, mostFrequent, nbSeq, OF_defaultNormLog); + /* We can only use the basic table if max <= DefaultMaxOff, otherwise the offsets are too large */ + ZSTD_defaultPolicy_e const defaultPolicy = max <= DefaultMaxOff ? ZSTD_defaultAllowed : ZSTD_defaultDisallowed; + Offtype = ZSTD_selectEncodingType(&entropy->offcode_repeatMode, mostFrequent, nbSeq, OF_defaultNormLog, defaultPolicy); { size_t const countSize = ZSTD_buildCTable(op, oend - op, CTable_OffsetBits, OffFSELog, (symbolEncodingType_e)Offtype, - count, max, ofCodeTable, nbSeq, OF_defaultNorm, OF_defaultNormLog, MaxOff, + count, max, ofCodeTable, nbSeq, OF_defaultNorm, OF_defaultNormLog, DefaultMaxOff, entropy->workspace, sizeof(entropy->workspace)); if (ZSTD_isError(countSize)) return countSize; op += countSize; @@ -1224,7 +1487,7 @@ MEM_STATIC size_t ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, /* CTable for MatchLengths */ { U32 max = MaxML; size_t const mostFrequent = FSE_countFast_wksp(count, &max, mlCodeTable, nbSeq, entropy->workspace); - MLtype = ZSTD_selectEncodingType(&entropy->matchlength_repeatMode, mostFrequent, nbSeq, ML_defaultNormLog); + MLtype = ZSTD_selectEncodingType(&entropy->matchlength_repeatMode, mostFrequent, nbSeq, ML_defaultNormLog, ZSTD_defaultAllowed); { size_t const countSize = ZSTD_buildCTable(op, oend - op, CTable_MatchLength, MLFSELog, (symbolEncodingType_e)MLtype, count, max, mlCodeTable, nbSeq, ML_defaultNorm, ML_defaultNormLog, MaxML, entropy->workspace, sizeof(entropy->workspace)); @@ -1279,1528 +1542,11 @@ MEM_STATIC size_t ZSTD_compressSequences(seqStore_t* seqStorePtr, return cSize; } - -/*! ZSTD_storeSeq() : - Store a sequence (literal length, literals, offset code and match length code) into seqStore_t. - `offsetCode` : distance to match, or 0 == repCode. - `matchCode` : matchLength - MINMATCH -*/ -MEM_STATIC void ZSTD_storeSeq(seqStore_t* seqStorePtr, size_t litLength, const void* literals, U32 offsetCode, size_t matchCode) -{ -#if defined(ZSTD_DEBUG) && (ZSTD_DEBUG >= 6) - static const BYTE* g_start = NULL; - U32 const pos = (U32)((const BYTE*)literals - g_start); - if (g_start==NULL) g_start = (const BYTE*)literals; - if ((pos > 0) && (pos < 1000000000)) - DEBUGLOG(6, "Cpos %6u :%5u literals & match %3u bytes at distance %6u", - pos, (U32)litLength, (U32)matchCode+MINMATCH, (U32)offsetCode); -#endif - /* copy Literals */ - assert(seqStorePtr->lit + litLength <= seqStorePtr->litStart + 128 KB); - ZSTD_wildcopy(seqStorePtr->lit, literals, litLength); - seqStorePtr->lit += litLength; - - /* literal Length */ - if (litLength>0xFFFF) { - seqStorePtr->longLengthID = 1; - seqStorePtr->longLengthPos = (U32)(seqStorePtr->sequences - seqStorePtr->sequencesStart); - } - seqStorePtr->sequences[0].litLength = (U16)litLength; - - /* match offset */ - seqStorePtr->sequences[0].offset = offsetCode + 1; - - /* match Length */ - if (matchCode>0xFFFF) { - seqStorePtr->longLengthID = 2; - seqStorePtr->longLengthPos = (U32)(seqStorePtr->sequences - seqStorePtr->sequencesStart); - } - seqStorePtr->sequences[0].matchLength = (U16)matchCode; - - seqStorePtr->sequences++; -} - - -/*-************************************* -* Match length counter -***************************************/ -static unsigned ZSTD_NbCommonBytes (register size_t val) -{ - if (MEM_isLittleEndian()) { - if (MEM_64bits()) { -# if defined(_MSC_VER) && defined(_WIN64) - unsigned long r = 0; - _BitScanForward64( &r, (U64)val ); - return (unsigned)(r>>3); -# elif defined(__GNUC__) && (__GNUC__ >= 3) - return (__builtin_ctzll((U64)val) >> 3); -# else - static const int DeBruijnBytePos[64] = { 0, 0, 0, 0, 0, 1, 1, 2, - 0, 3, 1, 3, 1, 4, 2, 7, - 0, 2, 3, 6, 1, 5, 3, 5, - 1, 3, 4, 4, 2, 5, 6, 7, - 7, 0, 1, 2, 3, 3, 4, 6, - 2, 6, 5, 5, 3, 4, 5, 6, - 7, 1, 2, 4, 6, 4, 4, 5, - 7, 2, 6, 5, 7, 6, 7, 7 }; - return DeBruijnBytePos[((U64)((val & -(long long)val) * 0x0218A392CDABBD3FULL)) >> 58]; -# endif - } else { /* 32 bits */ -# if defined(_MSC_VER) - unsigned long r=0; - _BitScanForward( &r, (U32)val ); - return (unsigned)(r>>3); -# elif defined(__GNUC__) && (__GNUC__ >= 3) - return (__builtin_ctz((U32)val) >> 3); -# else - static const int DeBruijnBytePos[32] = { 0, 0, 3, 0, 3, 1, 3, 0, - 3, 2, 2, 1, 3, 2, 0, 1, - 3, 3, 1, 2, 2, 2, 2, 0, - 3, 1, 2, 0, 1, 0, 1, 1 }; - return DeBruijnBytePos[((U32)((val & -(S32)val) * 0x077CB531U)) >> 27]; -# endif - } - } else { /* Big Endian CPU */ - if (MEM_64bits()) { -# if defined(_MSC_VER) && defined(_WIN64) - unsigned long r = 0; - _BitScanReverse64( &r, val ); - return (unsigned)(r>>3); -# elif defined(__GNUC__) && (__GNUC__ >= 3) - return (__builtin_clzll(val) >> 3); -# else - unsigned r; - const unsigned n32 = sizeof(size_t)*4; /* calculate this way due to compiler complaining in 32-bits mode */ - if (!(val>>n32)) { r=4; } else { r=0; val>>=n32; } - if (!(val>>16)) { r+=2; val>>=8; } else { val>>=24; } - r += (!val); - return r; -# endif - } else { /* 32 bits */ -# if defined(_MSC_VER) - unsigned long r = 0; - _BitScanReverse( &r, (unsigned long)val ); - return (unsigned)(r>>3); -# elif defined(__GNUC__) && (__GNUC__ >= 3) - return (__builtin_clz((U32)val) >> 3); -# else - unsigned r; - if (!(val>>16)) { r=2; val>>=8; } else { r=0; val>>=24; } - r += (!val); - return r; -# endif - } } -} - - -static size_t ZSTD_count(const BYTE* pIn, const BYTE* pMatch, const BYTE* const pInLimit) -{ - const BYTE* const pStart = pIn; - const BYTE* const pInLoopLimit = pInLimit - (sizeof(size_t)-1); - - while (pIn < pInLoopLimit) { - size_t const diff = MEM_readST(pMatch) ^ MEM_readST(pIn); - if (!diff) { pIn+=sizeof(size_t); pMatch+=sizeof(size_t); continue; } - pIn += ZSTD_NbCommonBytes(diff); - return (size_t)(pIn - pStart); - } - if (MEM_64bits()) if ((pIn<(pInLimit-3)) && (MEM_read32(pMatch) == MEM_read32(pIn))) { pIn+=4; pMatch+=4; } - if ((pIn<(pInLimit-1)) && (MEM_read16(pMatch) == MEM_read16(pIn))) { pIn+=2; pMatch+=2; } - if ((pIn> (32-h) ; } -MEM_STATIC size_t ZSTD_hash3Ptr(const void* ptr, U32 h) { return ZSTD_hash3(MEM_readLE32(ptr), h); } /* only in zstd_opt.h */ - -static const U32 prime4bytes = 2654435761U; -static U32 ZSTD_hash4(U32 u, U32 h) { return (u * prime4bytes) >> (32-h) ; } -static size_t ZSTD_hash4Ptr(const void* ptr, U32 h) { return ZSTD_hash4(MEM_read32(ptr), h); } - -static const U64 prime5bytes = 889523592379ULL; -static size_t ZSTD_hash5(U64 u, U32 h) { return (size_t)(((u << (64-40)) * prime5bytes) >> (64-h)) ; } -static size_t ZSTD_hash5Ptr(const void* p, U32 h) { return ZSTD_hash5(MEM_readLE64(p), h); } - -static const U64 prime6bytes = 227718039650203ULL; -static size_t ZSTD_hash6(U64 u, U32 h) { return (size_t)(((u << (64-48)) * prime6bytes) >> (64-h)) ; } -static size_t ZSTD_hash6Ptr(const void* p, U32 h) { return ZSTD_hash6(MEM_readLE64(p), h); } - -static const U64 prime7bytes = 58295818150454627ULL; -static size_t ZSTD_hash7(U64 u, U32 h) { return (size_t)(((u << (64-56)) * prime7bytes) >> (64-h)) ; } -static size_t ZSTD_hash7Ptr(const void* p, U32 h) { return ZSTD_hash7(MEM_readLE64(p), h); } - -static const U64 prime8bytes = 0xCF1BBCDCB7A56463ULL; -static size_t ZSTD_hash8(U64 u, U32 h) { return (size_t)(((u) * prime8bytes) >> (64-h)) ; } -static size_t ZSTD_hash8Ptr(const void* p, U32 h) { return ZSTD_hash8(MEM_readLE64(p), h); } - -static size_t ZSTD_hashPtr(const void* p, U32 hBits, U32 mls) -{ - switch(mls) - { - default: - case 4: return ZSTD_hash4Ptr(p, hBits); - case 5: return ZSTD_hash5Ptr(p, hBits); - case 6: return ZSTD_hash6Ptr(p, hBits); - case 7: return ZSTD_hash7Ptr(p, hBits); - case 8: return ZSTD_hash8Ptr(p, hBits); - } -} - - -/*-************************************* -* Fast Scan -***************************************/ -static void ZSTD_fillHashTable (ZSTD_CCtx* zc, const void* end, const U32 mls) -{ - U32* const hashTable = zc->hashTable; - U32 const hBits = zc->appliedParams.cParams.hashLog; - const BYTE* const base = zc->base; - const BYTE* ip = base + zc->nextToUpdate; - const BYTE* const iend = ((const BYTE*)end) - HASH_READ_SIZE; - const size_t fastHashFillStep = 3; - - while(ip <= iend) { - hashTable[ZSTD_hashPtr(ip, hBits, mls)] = (U32)(ip - base); - ip += fastHashFillStep; - } -} - - -FORCE_INLINE_TEMPLATE -void ZSTD_compressBlock_fast_generic(ZSTD_CCtx* cctx, - const void* src, size_t srcSize, - const U32 mls) -{ - U32* const hashTable = cctx->hashTable; - U32 const hBits = cctx->appliedParams.cParams.hashLog; - seqStore_t* seqStorePtr = &(cctx->seqStore); - const BYTE* const base = cctx->base; - const BYTE* const istart = (const BYTE*)src; - const BYTE* ip = istart; - const BYTE* anchor = istart; - const U32 lowestIndex = cctx->dictLimit; - const BYTE* const lowest = base + lowestIndex; - const BYTE* const iend = istart + srcSize; - const BYTE* const ilimit = iend - HASH_READ_SIZE; - U32 offset_1=seqStorePtr->rep[0], offset_2=seqStorePtr->rep[1]; - U32 offsetSaved = 0; - - /* init */ - ip += (ip==lowest); - { U32 const maxRep = (U32)(ip-lowest); - if (offset_2 > maxRep) offsetSaved = offset_2, offset_2 = 0; - if (offset_1 > maxRep) offsetSaved = offset_1, offset_1 = 0; - } - - /* Main Search Loop */ - while (ip < ilimit) { /* < instead of <=, because repcode check at (ip+1) */ - size_t mLength; - size_t const h = ZSTD_hashPtr(ip, hBits, mls); - U32 const current = (U32)(ip-base); - U32 const matchIndex = hashTable[h]; - const BYTE* match = base + matchIndex; - hashTable[h] = current; /* update hash table */ - - if ((offset_1 > 0) & (MEM_read32(ip+1-offset_1) == MEM_read32(ip+1))) { - mLength = ZSTD_count(ip+1+4, ip+1+4-offset_1, iend) + 4; - ip++; - ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, 0, mLength-MINMATCH); - } else { - U32 offset; - if ( (matchIndex <= lowestIndex) || (MEM_read32(match) != MEM_read32(ip)) ) { - ip += ((ip-anchor) >> g_searchStrength) + 1; - continue; - } - mLength = ZSTD_count(ip+4, match+4, iend) + 4; - offset = (U32)(ip-match); - while (((ip>anchor) & (match>lowest)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* catch up */ - offset_2 = offset_1; - offset_1 = offset; - - ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); - } - - /* match found */ - ip += mLength; - anchor = ip; - - if (ip <= ilimit) { - /* Fill Table */ - hashTable[ZSTD_hashPtr(base+current+2, hBits, mls)] = current+2; /* here because current+2 could be > iend-8 */ - hashTable[ZSTD_hashPtr(ip-2, hBits, mls)] = (U32)(ip-2-base); - /* check immediate repcode */ - while ( (ip <= ilimit) - && ( (offset_2>0) - & (MEM_read32(ip) == MEM_read32(ip - offset_2)) )) { - /* store sequence */ - size_t const rLength = ZSTD_count(ip+4, ip+4-offset_2, iend) + 4; - { U32 const tmpOff = offset_2; offset_2 = offset_1; offset_1 = tmpOff; } /* swap offset_2 <=> offset_1 */ - hashTable[ZSTD_hashPtr(ip, hBits, mls)] = (U32)(ip-base); - ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, rLength-MINMATCH); - ip += rLength; - anchor = ip; - continue; /* faster when present ... (?) */ - } } } - - /* save reps for next block */ - seqStorePtr->repToConfirm[0] = offset_1 ? offset_1 : offsetSaved; - seqStorePtr->repToConfirm[1] = offset_2 ? offset_2 : offsetSaved; - - /* Last Literals */ - { size_t const lastLLSize = iend - anchor; - memcpy(seqStorePtr->lit, anchor, lastLLSize); - seqStorePtr->lit += lastLLSize; - } -} - - -static void ZSTD_compressBlock_fast(ZSTD_CCtx* ctx, - const void* src, size_t srcSize) -{ - const U32 mls = ctx->appliedParams.cParams.searchLength; - switch(mls) - { - default: /* includes case 3 */ - case 4 : - ZSTD_compressBlock_fast_generic(ctx, src, srcSize, 4); return; - case 5 : - ZSTD_compressBlock_fast_generic(ctx, src, srcSize, 5); return; - case 6 : - ZSTD_compressBlock_fast_generic(ctx, src, srcSize, 6); return; - case 7 : - ZSTD_compressBlock_fast_generic(ctx, src, srcSize, 7); return; - } -} - - -static void ZSTD_compressBlock_fast_extDict_generic(ZSTD_CCtx* ctx, - const void* src, size_t srcSize, - const U32 mls) -{ - U32* hashTable = ctx->hashTable; - const U32 hBits = ctx->appliedParams.cParams.hashLog; - seqStore_t* seqStorePtr = &(ctx->seqStore); - const BYTE* const base = ctx->base; - const BYTE* const dictBase = ctx->dictBase; - const BYTE* const istart = (const BYTE*)src; - const BYTE* ip = istart; - const BYTE* anchor = istart; - const U32 lowestIndex = ctx->lowLimit; - const BYTE* const dictStart = dictBase + lowestIndex; - const U32 dictLimit = ctx->dictLimit; - const BYTE* const lowPrefixPtr = base + dictLimit; - const BYTE* const dictEnd = dictBase + dictLimit; - const BYTE* const iend = istart + srcSize; - const BYTE* const ilimit = iend - 8; - U32 offset_1=seqStorePtr->rep[0], offset_2=seqStorePtr->rep[1]; - - /* Search Loop */ - while (ip < ilimit) { /* < instead of <=, because (ip+1) */ - const size_t h = ZSTD_hashPtr(ip, hBits, mls); - const U32 matchIndex = hashTable[h]; - const BYTE* matchBase = matchIndex < dictLimit ? dictBase : base; - const BYTE* match = matchBase + matchIndex; - const U32 current = (U32)(ip-base); - const U32 repIndex = current + 1 - offset_1; /* offset_1 expected <= current +1 */ - const BYTE* repBase = repIndex < dictLimit ? dictBase : base; - const BYTE* repMatch = repBase + repIndex; - size_t mLength; - hashTable[h] = current; /* update hash table */ - - if ( (((U32)((dictLimit-1) - repIndex) >= 3) /* intentional underflow */ & (repIndex > lowestIndex)) - && (MEM_read32(repMatch) == MEM_read32(ip+1)) ) { - const BYTE* repMatchEnd = repIndex < dictLimit ? dictEnd : iend; - mLength = ZSTD_count_2segments(ip+1+4, repMatch+4, iend, repMatchEnd, lowPrefixPtr) + 4; - ip++; - ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, 0, mLength-MINMATCH); - } else { - if ( (matchIndex < lowestIndex) || - (MEM_read32(match) != MEM_read32(ip)) ) { - ip += ((ip-anchor) >> g_searchStrength) + 1; - continue; - } - { const BYTE* matchEnd = matchIndex < dictLimit ? dictEnd : iend; - const BYTE* lowMatchPtr = matchIndex < dictLimit ? dictStart : lowPrefixPtr; - U32 offset; - mLength = ZSTD_count_2segments(ip+4, match+4, iend, matchEnd, lowPrefixPtr) + 4; - while (((ip>anchor) & (match>lowMatchPtr)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* catch up */ - offset = current - matchIndex; - offset_2 = offset_1; - offset_1 = offset; - ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); - } } - - /* found a match : store it */ - ip += mLength; - anchor = ip; - - if (ip <= ilimit) { - /* Fill Table */ - hashTable[ZSTD_hashPtr(base+current+2, hBits, mls)] = current+2; - hashTable[ZSTD_hashPtr(ip-2, hBits, mls)] = (U32)(ip-2-base); - /* check immediate repcode */ - while (ip <= ilimit) { - U32 const current2 = (U32)(ip-base); - U32 const repIndex2 = current2 - offset_2; - const BYTE* repMatch2 = repIndex2 < dictLimit ? dictBase + repIndex2 : base + repIndex2; - if ( (((U32)((dictLimit-1) - repIndex2) >= 3) & (repIndex2 > lowestIndex)) /* intentional overflow */ - && (MEM_read32(repMatch2) == MEM_read32(ip)) ) { - const BYTE* const repEnd2 = repIndex2 < dictLimit ? dictEnd : iend; - size_t const repLength2 = ZSTD_count_2segments(ip+4, repMatch2+4, iend, repEnd2, lowPrefixPtr) + 4; - U32 tmpOffset = offset_2; offset_2 = offset_1; offset_1 = tmpOffset; /* swap offset_2 <=> offset_1 */ - ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, repLength2-MINMATCH); - hashTable[ZSTD_hashPtr(ip, hBits, mls)] = current2; - ip += repLength2; - anchor = ip; - continue; - } - break; - } } } - - /* save reps for next block */ - seqStorePtr->repToConfirm[0] = offset_1; seqStorePtr->repToConfirm[1] = offset_2; - - /* Last Literals */ - { size_t const lastLLSize = iend - anchor; - memcpy(seqStorePtr->lit, anchor, lastLLSize); - seqStorePtr->lit += lastLLSize; - } -} - - -static void ZSTD_compressBlock_fast_extDict(ZSTD_CCtx* ctx, - const void* src, size_t srcSize) -{ - U32 const mls = ctx->appliedParams.cParams.searchLength; - switch(mls) - { - default: /* includes case 3 */ - case 4 : - ZSTD_compressBlock_fast_extDict_generic(ctx, src, srcSize, 4); return; - case 5 : - ZSTD_compressBlock_fast_extDict_generic(ctx, src, srcSize, 5); return; - case 6 : - ZSTD_compressBlock_fast_extDict_generic(ctx, src, srcSize, 6); return; - case 7 : - ZSTD_compressBlock_fast_extDict_generic(ctx, src, srcSize, 7); return; - } -} - - -/*-************************************* -* Double Fast -***************************************/ -static void ZSTD_fillDoubleHashTable (ZSTD_CCtx* cctx, const void* end, const U32 mls) -{ - U32* const hashLarge = cctx->hashTable; - U32 const hBitsL = cctx->appliedParams.cParams.hashLog; - U32* const hashSmall = cctx->chainTable; - U32 const hBitsS = cctx->appliedParams.cParams.chainLog; - const BYTE* const base = cctx->base; - const BYTE* ip = base + cctx->nextToUpdate; - const BYTE* const iend = ((const BYTE*)end) - HASH_READ_SIZE; - const size_t fastHashFillStep = 3; - - while(ip <= iend) { - hashSmall[ZSTD_hashPtr(ip, hBitsS, mls)] = (U32)(ip - base); - hashLarge[ZSTD_hashPtr(ip, hBitsL, 8)] = (U32)(ip - base); - ip += fastHashFillStep; - } -} - - -FORCE_INLINE_TEMPLATE -void ZSTD_compressBlock_doubleFast_generic(ZSTD_CCtx* cctx, - const void* src, size_t srcSize, - const U32 mls) -{ - U32* const hashLong = cctx->hashTable; - const U32 hBitsL = cctx->appliedParams.cParams.hashLog; - U32* const hashSmall = cctx->chainTable; - const U32 hBitsS = cctx->appliedParams.cParams.chainLog; - seqStore_t* seqStorePtr = &(cctx->seqStore); - const BYTE* const base = cctx->base; - const BYTE* const istart = (const BYTE*)src; - const BYTE* ip = istart; - const BYTE* anchor = istart; - const U32 lowestIndex = cctx->dictLimit; - const BYTE* const lowest = base + lowestIndex; - const BYTE* const iend = istart + srcSize; - const BYTE* const ilimit = iend - HASH_READ_SIZE; - U32 offset_1=seqStorePtr->rep[0], offset_2=seqStorePtr->rep[1]; - U32 offsetSaved = 0; - - /* init */ - ip += (ip==lowest); - { U32 const maxRep = (U32)(ip-lowest); - if (offset_2 > maxRep) offsetSaved = offset_2, offset_2 = 0; - if (offset_1 > maxRep) offsetSaved = offset_1, offset_1 = 0; - } - - /* Main Search Loop */ - while (ip < ilimit) { /* < instead of <=, because repcode check at (ip+1) */ - size_t mLength; - size_t const h2 = ZSTD_hashPtr(ip, hBitsL, 8); - size_t const h = ZSTD_hashPtr(ip, hBitsS, mls); - U32 const current = (U32)(ip-base); - U32 const matchIndexL = hashLong[h2]; - U32 const matchIndexS = hashSmall[h]; - const BYTE* matchLong = base + matchIndexL; - const BYTE* match = base + matchIndexS; - hashLong[h2] = hashSmall[h] = current; /* update hash tables */ - - assert(offset_1 <= current); /* supposed guaranteed by construction */ - if ((offset_1 > 0) & (MEM_read32(ip+1-offset_1) == MEM_read32(ip+1))) { - /* favor repcode */ - mLength = ZSTD_count(ip+1+4, ip+1+4-offset_1, iend) + 4; - ip++; - ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, 0, mLength-MINMATCH); - } else { - U32 offset; - if ( (matchIndexL > lowestIndex) && (MEM_read64(matchLong) == MEM_read64(ip)) ) { - mLength = ZSTD_count(ip+8, matchLong+8, iend) + 8; - offset = (U32)(ip-matchLong); - while (((ip>anchor) & (matchLong>lowest)) && (ip[-1] == matchLong[-1])) { ip--; matchLong--; mLength++; } /* catch up */ - } else if ( (matchIndexS > lowestIndex) && (MEM_read32(match) == MEM_read32(ip)) ) { - size_t const hl3 = ZSTD_hashPtr(ip+1, hBitsL, 8); - U32 const matchIndexL3 = hashLong[hl3]; - const BYTE* matchL3 = base + matchIndexL3; - hashLong[hl3] = current + 1; - if ( (matchIndexL3 > lowestIndex) && (MEM_read64(matchL3) == MEM_read64(ip+1)) ) { - mLength = ZSTD_count(ip+9, matchL3+8, iend) + 8; - ip++; - offset = (U32)(ip-matchL3); - while (((ip>anchor) & (matchL3>lowest)) && (ip[-1] == matchL3[-1])) { ip--; matchL3--; mLength++; } /* catch up */ - } else { - mLength = ZSTD_count(ip+4, match+4, iend) + 4; - offset = (U32)(ip-match); - while (((ip>anchor) & (match>lowest)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* catch up */ - } - } else { - ip += ((ip-anchor) >> g_searchStrength) + 1; - continue; - } - - offset_2 = offset_1; - offset_1 = offset; - - ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); - } - - /* match found */ - ip += mLength; - anchor = ip; - - if (ip <= ilimit) { - /* Fill Table */ - hashLong[ZSTD_hashPtr(base+current+2, hBitsL, 8)] = - hashSmall[ZSTD_hashPtr(base+current+2, hBitsS, mls)] = current+2; /* here because current+2 could be > iend-8 */ - hashLong[ZSTD_hashPtr(ip-2, hBitsL, 8)] = - hashSmall[ZSTD_hashPtr(ip-2, hBitsS, mls)] = (U32)(ip-2-base); - - /* check immediate repcode */ - while ( (ip <= ilimit) - && ( (offset_2>0) - & (MEM_read32(ip) == MEM_read32(ip - offset_2)) )) { - /* store sequence */ - size_t const rLength = ZSTD_count(ip+4, ip+4-offset_2, iend) + 4; - { U32 const tmpOff = offset_2; offset_2 = offset_1; offset_1 = tmpOff; } /* swap offset_2 <=> offset_1 */ - hashSmall[ZSTD_hashPtr(ip, hBitsS, mls)] = (U32)(ip-base); - hashLong[ZSTD_hashPtr(ip, hBitsL, 8)] = (U32)(ip-base); - ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, rLength-MINMATCH); - ip += rLength; - anchor = ip; - continue; /* faster when present ... (?) */ - } } } - - /* save reps for next block */ - seqStorePtr->repToConfirm[0] = offset_1 ? offset_1 : offsetSaved; - seqStorePtr->repToConfirm[1] = offset_2 ? offset_2 : offsetSaved; - - /* Last Literals */ - { size_t const lastLLSize = iend - anchor; - memcpy(seqStorePtr->lit, anchor, lastLLSize); - seqStorePtr->lit += lastLLSize; - } -} - - -static void ZSTD_compressBlock_doubleFast(ZSTD_CCtx* ctx, const void* src, size_t srcSize) -{ - const U32 mls = ctx->appliedParams.cParams.searchLength; - switch(mls) - { - default: /* includes case 3 */ - case 4 : - ZSTD_compressBlock_doubleFast_generic(ctx, src, srcSize, 4); return; - case 5 : - ZSTD_compressBlock_doubleFast_generic(ctx, src, srcSize, 5); return; - case 6 : - ZSTD_compressBlock_doubleFast_generic(ctx, src, srcSize, 6); return; - case 7 : - ZSTD_compressBlock_doubleFast_generic(ctx, src, srcSize, 7); return; - } -} - - -static void ZSTD_compressBlock_doubleFast_extDict_generic(ZSTD_CCtx* ctx, - const void* src, size_t srcSize, - const U32 mls) -{ - U32* const hashLong = ctx->hashTable; - U32 const hBitsL = ctx->appliedParams.cParams.hashLog; - U32* const hashSmall = ctx->chainTable; - U32 const hBitsS = ctx->appliedParams.cParams.chainLog; - seqStore_t* seqStorePtr = &(ctx->seqStore); - const BYTE* const base = ctx->base; - const BYTE* const dictBase = ctx->dictBase; - const BYTE* const istart = (const BYTE*)src; - const BYTE* ip = istart; - const BYTE* anchor = istart; - const U32 lowestIndex = ctx->lowLimit; - const BYTE* const dictStart = dictBase + lowestIndex; - const U32 dictLimit = ctx->dictLimit; - const BYTE* const lowPrefixPtr = base + dictLimit; - const BYTE* const dictEnd = dictBase + dictLimit; - const BYTE* const iend = istart + srcSize; - const BYTE* const ilimit = iend - 8; - U32 offset_1=seqStorePtr->rep[0], offset_2=seqStorePtr->rep[1]; - - /* Search Loop */ - while (ip < ilimit) { /* < instead of <=, because (ip+1) */ - const size_t hSmall = ZSTD_hashPtr(ip, hBitsS, mls); - const U32 matchIndex = hashSmall[hSmall]; - const BYTE* matchBase = matchIndex < dictLimit ? dictBase : base; - const BYTE* match = matchBase + matchIndex; - - const size_t hLong = ZSTD_hashPtr(ip, hBitsL, 8); - const U32 matchLongIndex = hashLong[hLong]; - const BYTE* matchLongBase = matchLongIndex < dictLimit ? dictBase : base; - const BYTE* matchLong = matchLongBase + matchLongIndex; - - const U32 current = (U32)(ip-base); - const U32 repIndex = current + 1 - offset_1; /* offset_1 expected <= current +1 */ - const BYTE* repBase = repIndex < dictLimit ? dictBase : base; - const BYTE* repMatch = repBase + repIndex; - size_t mLength; - hashSmall[hSmall] = hashLong[hLong] = current; /* update hash table */ - - if ( (((U32)((dictLimit-1) - repIndex) >= 3) /* intentional underflow */ & (repIndex > lowestIndex)) - && (MEM_read32(repMatch) == MEM_read32(ip+1)) ) { - const BYTE* repMatchEnd = repIndex < dictLimit ? dictEnd : iend; - mLength = ZSTD_count_2segments(ip+1+4, repMatch+4, iend, repMatchEnd, lowPrefixPtr) + 4; - ip++; - ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, 0, mLength-MINMATCH); - } else { - if ((matchLongIndex > lowestIndex) && (MEM_read64(matchLong) == MEM_read64(ip))) { - const BYTE* matchEnd = matchLongIndex < dictLimit ? dictEnd : iend; - const BYTE* lowMatchPtr = matchLongIndex < dictLimit ? dictStart : lowPrefixPtr; - U32 offset; - mLength = ZSTD_count_2segments(ip+8, matchLong+8, iend, matchEnd, lowPrefixPtr) + 8; - offset = current - matchLongIndex; - while (((ip>anchor) & (matchLong>lowMatchPtr)) && (ip[-1] == matchLong[-1])) { ip--; matchLong--; mLength++; } /* catch up */ - offset_2 = offset_1; - offset_1 = offset; - ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); - - } else if ((matchIndex > lowestIndex) && (MEM_read32(match) == MEM_read32(ip))) { - size_t const h3 = ZSTD_hashPtr(ip+1, hBitsL, 8); - U32 const matchIndex3 = hashLong[h3]; - const BYTE* const match3Base = matchIndex3 < dictLimit ? dictBase : base; - const BYTE* match3 = match3Base + matchIndex3; - U32 offset; - hashLong[h3] = current + 1; - if ( (matchIndex3 > lowestIndex) && (MEM_read64(match3) == MEM_read64(ip+1)) ) { - const BYTE* matchEnd = matchIndex3 < dictLimit ? dictEnd : iend; - const BYTE* lowMatchPtr = matchIndex3 < dictLimit ? dictStart : lowPrefixPtr; - mLength = ZSTD_count_2segments(ip+9, match3+8, iend, matchEnd, lowPrefixPtr) + 8; - ip++; - offset = current+1 - matchIndex3; - while (((ip>anchor) & (match3>lowMatchPtr)) && (ip[-1] == match3[-1])) { ip--; match3--; mLength++; } /* catch up */ - } else { - const BYTE* matchEnd = matchIndex < dictLimit ? dictEnd : iend; - const BYTE* lowMatchPtr = matchIndex < dictLimit ? dictStart : lowPrefixPtr; - mLength = ZSTD_count_2segments(ip+4, match+4, iend, matchEnd, lowPrefixPtr) + 4; - offset = current - matchIndex; - while (((ip>anchor) & (match>lowMatchPtr)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* catch up */ - } - offset_2 = offset_1; - offset_1 = offset; - ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); - - } else { - ip += ((ip-anchor) >> g_searchStrength) + 1; - continue; - } } - - /* found a match : store it */ - ip += mLength; - anchor = ip; - - if (ip <= ilimit) { - /* Fill Table */ - hashSmall[ZSTD_hashPtr(base+current+2, hBitsS, mls)] = current+2; - hashLong[ZSTD_hashPtr(base+current+2, hBitsL, 8)] = current+2; - hashSmall[ZSTD_hashPtr(ip-2, hBitsS, mls)] = (U32)(ip-2-base); - hashLong[ZSTD_hashPtr(ip-2, hBitsL, 8)] = (U32)(ip-2-base); - /* check immediate repcode */ - while (ip <= ilimit) { - U32 const current2 = (U32)(ip-base); - U32 const repIndex2 = current2 - offset_2; - const BYTE* repMatch2 = repIndex2 < dictLimit ? dictBase + repIndex2 : base + repIndex2; - if ( (((U32)((dictLimit-1) - repIndex2) >= 3) & (repIndex2 > lowestIndex)) /* intentional overflow */ - && (MEM_read32(repMatch2) == MEM_read32(ip)) ) { - const BYTE* const repEnd2 = repIndex2 < dictLimit ? dictEnd : iend; - size_t const repLength2 = ZSTD_count_2segments(ip+4, repMatch2+4, iend, repEnd2, lowPrefixPtr) + 4; - U32 tmpOffset = offset_2; offset_2 = offset_1; offset_1 = tmpOffset; /* swap offset_2 <=> offset_1 */ - ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, repLength2-MINMATCH); - hashSmall[ZSTD_hashPtr(ip, hBitsS, mls)] = current2; - hashLong[ZSTD_hashPtr(ip, hBitsL, 8)] = current2; - ip += repLength2; - anchor = ip; - continue; - } - break; - } } } - - /* save reps for next block */ - seqStorePtr->repToConfirm[0] = offset_1; seqStorePtr->repToConfirm[1] = offset_2; - - /* Last Literals */ - { size_t const lastLLSize = iend - anchor; - memcpy(seqStorePtr->lit, anchor, lastLLSize); - seqStorePtr->lit += lastLLSize; - } -} - - -static void ZSTD_compressBlock_doubleFast_extDict(ZSTD_CCtx* ctx, - const void* src, size_t srcSize) -{ - U32 const mls = ctx->appliedParams.cParams.searchLength; - switch(mls) - { - default: /* includes case 3 */ - case 4 : - ZSTD_compressBlock_doubleFast_extDict_generic(ctx, src, srcSize, 4); return; - case 5 : - ZSTD_compressBlock_doubleFast_extDict_generic(ctx, src, srcSize, 5); return; - case 6 : - ZSTD_compressBlock_doubleFast_extDict_generic(ctx, src, srcSize, 6); return; - case 7 : - ZSTD_compressBlock_doubleFast_extDict_generic(ctx, src, srcSize, 7); return; - } -} - - -/*-************************************* -* Binary Tree search -***************************************/ -/** ZSTD_insertBt1() : add one or multiple positions to tree. -* ip : assumed <= iend-8 . -* @return : nb of positions added */ -static U32 ZSTD_insertBt1(ZSTD_CCtx* zc, const BYTE* const ip, const U32 mls, const BYTE* const iend, U32 nbCompares, - U32 extDict) -{ - U32* const hashTable = zc->hashTable; - U32 const hashLog = zc->appliedParams.cParams.hashLog; - size_t const h = ZSTD_hashPtr(ip, hashLog, mls); - U32* const bt = zc->chainTable; - U32 const btLog = zc->appliedParams.cParams.chainLog - 1; - U32 const btMask = (1 << btLog) - 1; - U32 matchIndex = hashTable[h]; - size_t commonLengthSmaller=0, commonLengthLarger=0; - const BYTE* const base = zc->base; - const BYTE* const dictBase = zc->dictBase; - const U32 dictLimit = zc->dictLimit; - const BYTE* const dictEnd = dictBase + dictLimit; - const BYTE* const prefixStart = base + dictLimit; - const BYTE* match; - const U32 current = (U32)(ip-base); - const U32 btLow = btMask >= current ? 0 : current - btMask; - U32* smallerPtr = bt + 2*(current&btMask); - U32* largerPtr = smallerPtr + 1; - U32 dummy32; /* to be nullified at the end */ - U32 const windowLow = zc->lowLimit; - U32 matchEndIdx = current+8; - size_t bestLength = 8; -#ifdef ZSTD_C_PREDICT - U32 predictedSmall = *(bt + 2*((current-1)&btMask) + 0); - U32 predictedLarge = *(bt + 2*((current-1)&btMask) + 1); - predictedSmall += (predictedSmall>0); - predictedLarge += (predictedLarge>0); -#endif /* ZSTD_C_PREDICT */ - - hashTable[h] = current; /* Update Hash Table */ - - while (nbCompares-- && (matchIndex > windowLow)) { - U32* const nextPtr = bt + 2*(matchIndex & btMask); - size_t matchLength = MIN(commonLengthSmaller, commonLengthLarger); /* guaranteed minimum nb of common bytes */ - -#ifdef ZSTD_C_PREDICT /* note : can create issues when hlog small <= 11 */ - const U32* predictPtr = bt + 2*((matchIndex-1) & btMask); /* written this way, as bt is a roll buffer */ - if (matchIndex == predictedSmall) { - /* no need to check length, result known */ - *smallerPtr = matchIndex; - if (matchIndex <= btLow) { smallerPtr=&dummy32; break; } /* beyond tree size, stop the search */ - smallerPtr = nextPtr+1; /* new "smaller" => larger of match */ - matchIndex = nextPtr[1]; /* new matchIndex larger than previous (closer to current) */ - predictedSmall = predictPtr[1] + (predictPtr[1]>0); - continue; - } - if (matchIndex == predictedLarge) { - *largerPtr = matchIndex; - if (matchIndex <= btLow) { largerPtr=&dummy32; break; } /* beyond tree size, stop the search */ - largerPtr = nextPtr; - matchIndex = nextPtr[0]; - predictedLarge = predictPtr[0] + (predictPtr[0]>0); - continue; - } -#endif - if ((!extDict) || (matchIndex+matchLength >= dictLimit)) { - match = base + matchIndex; - if (match[matchLength] == ip[matchLength]) - matchLength += ZSTD_count(ip+matchLength+1, match+matchLength+1, iend) +1; - } else { - match = dictBase + matchIndex; - matchLength += ZSTD_count_2segments(ip+matchLength, match+matchLength, iend, dictEnd, prefixStart); - if (matchIndex+matchLength >= dictLimit) - match = base + matchIndex; /* to prepare for next usage of match[matchLength] */ - } - - if (matchLength > bestLength) { - bestLength = matchLength; - if (matchLength > matchEndIdx - matchIndex) - matchEndIdx = matchIndex + (U32)matchLength; - } - - if (ip+matchLength == iend) /* equal : no way to know if inf or sup */ - break; /* drop , to guarantee consistency ; miss a bit of compression, but other solutions can corrupt the tree */ - - if (match[matchLength] < ip[matchLength]) { /* necessarily within correct buffer */ - /* match is smaller than current */ - *smallerPtr = matchIndex; /* update smaller idx */ - commonLengthSmaller = matchLength; /* all smaller will now have at least this guaranteed common length */ - if (matchIndex <= btLow) { smallerPtr=&dummy32; break; } /* beyond tree size, stop the search */ - smallerPtr = nextPtr+1; /* new "smaller" => larger of match */ - matchIndex = nextPtr[1]; /* new matchIndex larger than previous (closer to current) */ - } else { - /* match is larger than current */ - *largerPtr = matchIndex; - commonLengthLarger = matchLength; - if (matchIndex <= btLow) { largerPtr=&dummy32; break; } /* beyond tree size, stop the search */ - largerPtr = nextPtr; - matchIndex = nextPtr[0]; - } } - - *smallerPtr = *largerPtr = 0; - if (bestLength > 384) return MIN(192, (U32)(bestLength - 384)); /* speed optimization */ - if (matchEndIdx > current + 8) return matchEndIdx - current - 8; - return 1; -} - - -static size_t ZSTD_insertBtAndFindBestMatch ( - ZSTD_CCtx* zc, - const BYTE* const ip, const BYTE* const iend, - size_t* offsetPtr, - U32 nbCompares, const U32 mls, - U32 extDict) -{ - U32* const hashTable = zc->hashTable; - U32 const hashLog = zc->appliedParams.cParams.hashLog; - size_t const h = ZSTD_hashPtr(ip, hashLog, mls); - U32* const bt = zc->chainTable; - U32 const btLog = zc->appliedParams.cParams.chainLog - 1; - U32 const btMask = (1 << btLog) - 1; - U32 matchIndex = hashTable[h]; - size_t commonLengthSmaller=0, commonLengthLarger=0; - const BYTE* const base = zc->base; - const BYTE* const dictBase = zc->dictBase; - const U32 dictLimit = zc->dictLimit; - const BYTE* const dictEnd = dictBase + dictLimit; - const BYTE* const prefixStart = base + dictLimit; - const U32 current = (U32)(ip-base); - const U32 btLow = btMask >= current ? 0 : current - btMask; - const U32 windowLow = zc->lowLimit; - U32* smallerPtr = bt + 2*(current&btMask); - U32* largerPtr = bt + 2*(current&btMask) + 1; - U32 matchEndIdx = current+8; - U32 dummy32; /* to be nullified at the end */ - size_t bestLength = 0; - - hashTable[h] = current; /* Update Hash Table */ - - while (nbCompares-- && (matchIndex > windowLow)) { - U32* const nextPtr = bt + 2*(matchIndex & btMask); - size_t matchLength = MIN(commonLengthSmaller, commonLengthLarger); /* guaranteed minimum nb of common bytes */ - const BYTE* match; - - if ((!extDict) || (matchIndex+matchLength >= dictLimit)) { - match = base + matchIndex; - if (match[matchLength] == ip[matchLength]) - matchLength += ZSTD_count(ip+matchLength+1, match+matchLength+1, iend) +1; - } else { - match = dictBase + matchIndex; - matchLength += ZSTD_count_2segments(ip+matchLength, match+matchLength, iend, dictEnd, prefixStart); - if (matchIndex+matchLength >= dictLimit) - match = base + matchIndex; /* to prepare for next usage of match[matchLength] */ - } - - if (matchLength > bestLength) { - if (matchLength > matchEndIdx - matchIndex) - matchEndIdx = matchIndex + (U32)matchLength; - if ( (4*(int)(matchLength-bestLength)) > (int)(ZSTD_highbit32(current-matchIndex+1) - ZSTD_highbit32((U32)offsetPtr[0]+1)) ) - bestLength = matchLength, *offsetPtr = ZSTD_REP_MOVE + current - matchIndex; - if (ip+matchLength == iend) /* equal : no way to know if inf or sup */ - break; /* drop, to guarantee consistency (miss a little bit of compression) */ - } - - if (match[matchLength] < ip[matchLength]) { - /* match is smaller than current */ - *smallerPtr = matchIndex; /* update smaller idx */ - commonLengthSmaller = matchLength; /* all smaller will now have at least this guaranteed common length */ - if (matchIndex <= btLow) { smallerPtr=&dummy32; break; } /* beyond tree size, stop the search */ - smallerPtr = nextPtr+1; /* new "smaller" => larger of match */ - matchIndex = nextPtr[1]; /* new matchIndex larger than previous (closer to current) */ - } else { - /* match is larger than current */ - *largerPtr = matchIndex; - commonLengthLarger = matchLength; - if (matchIndex <= btLow) { largerPtr=&dummy32; break; } /* beyond tree size, stop the search */ - largerPtr = nextPtr; - matchIndex = nextPtr[0]; - } } - - *smallerPtr = *largerPtr = 0; - - zc->nextToUpdate = (matchEndIdx > current + 8) ? matchEndIdx - 8 : current+1; - return bestLength; -} - - -static void ZSTD_updateTree(ZSTD_CCtx* zc, const BYTE* const ip, const BYTE* const iend, const U32 nbCompares, const U32 mls) -{ - const BYTE* const base = zc->base; - const U32 target = (U32)(ip - base); - U32 idx = zc->nextToUpdate; - - while(idx < target) - idx += ZSTD_insertBt1(zc, base+idx, mls, iend, nbCompares, 0); -} - -/** ZSTD_BtFindBestMatch() : Tree updater, providing best match */ -static size_t ZSTD_BtFindBestMatch ( - ZSTD_CCtx* zc, - const BYTE* const ip, const BYTE* const iLimit, - size_t* offsetPtr, - const U32 maxNbAttempts, const U32 mls) -{ - if (ip < zc->base + zc->nextToUpdate) return 0; /* skipped area */ - ZSTD_updateTree(zc, ip, iLimit, maxNbAttempts, mls); - return ZSTD_insertBtAndFindBestMatch(zc, ip, iLimit, offsetPtr, maxNbAttempts, mls, 0); -} - - -static size_t ZSTD_BtFindBestMatch_selectMLS ( - ZSTD_CCtx* zc, /* Index table will be updated */ - const BYTE* ip, const BYTE* const iLimit, - size_t* offsetPtr, - const U32 maxNbAttempts, const U32 matchLengthSearch) -{ - switch(matchLengthSearch) - { - default : /* includes case 3 */ - case 4 : return ZSTD_BtFindBestMatch(zc, ip, iLimit, offsetPtr, maxNbAttempts, 4); - case 5 : return ZSTD_BtFindBestMatch(zc, ip, iLimit, offsetPtr, maxNbAttempts, 5); - case 7 : - case 6 : return ZSTD_BtFindBestMatch(zc, ip, iLimit, offsetPtr, maxNbAttempts, 6); - } -} - - -static void ZSTD_updateTree_extDict(ZSTD_CCtx* zc, const BYTE* const ip, const BYTE* const iend, const U32 nbCompares, const U32 mls) -{ - const BYTE* const base = zc->base; - const U32 target = (U32)(ip - base); - U32 idx = zc->nextToUpdate; - - while (idx < target) idx += ZSTD_insertBt1(zc, base+idx, mls, iend, nbCompares, 1); -} - - -/** Tree updater, providing best match */ -static size_t ZSTD_BtFindBestMatch_extDict ( - ZSTD_CCtx* zc, - const BYTE* const ip, const BYTE* const iLimit, - size_t* offsetPtr, - const U32 maxNbAttempts, const U32 mls) -{ - if (ip < zc->base + zc->nextToUpdate) return 0; /* skipped area */ - ZSTD_updateTree_extDict(zc, ip, iLimit, maxNbAttempts, mls); - return ZSTD_insertBtAndFindBestMatch(zc, ip, iLimit, offsetPtr, maxNbAttempts, mls, 1); -} - - -static size_t ZSTD_BtFindBestMatch_selectMLS_extDict ( - ZSTD_CCtx* zc, /* Index table will be updated */ - const BYTE* ip, const BYTE* const iLimit, - size_t* offsetPtr, - const U32 maxNbAttempts, const U32 matchLengthSearch) -{ - switch(matchLengthSearch) - { - default : /* includes case 3 */ - case 4 : return ZSTD_BtFindBestMatch_extDict(zc, ip, iLimit, offsetPtr, maxNbAttempts, 4); - case 5 : return ZSTD_BtFindBestMatch_extDict(zc, ip, iLimit, offsetPtr, maxNbAttempts, 5); - case 7 : - case 6 : return ZSTD_BtFindBestMatch_extDict(zc, ip, iLimit, offsetPtr, maxNbAttempts, 6); - } -} - - - -/* ********************************* -* Hash Chain -***********************************/ -#define NEXT_IN_CHAIN(d, mask) chainTable[(d) & mask] - -/* Update chains up to ip (excluded) - Assumption : always within prefix (i.e. not within extDict) */ -FORCE_INLINE_TEMPLATE -U32 ZSTD_insertAndFindFirstIndex (ZSTD_CCtx* zc, const BYTE* ip, U32 mls) -{ - U32* const hashTable = zc->hashTable; - const U32 hashLog = zc->appliedParams.cParams.hashLog; - U32* const chainTable = zc->chainTable; - const U32 chainMask = (1 << zc->appliedParams.cParams.chainLog) - 1; - const BYTE* const base = zc->base; - const U32 target = (U32)(ip - base); - U32 idx = zc->nextToUpdate; - - while(idx < target) { /* catch up */ - size_t const h = ZSTD_hashPtr(base+idx, hashLog, mls); - NEXT_IN_CHAIN(idx, chainMask) = hashTable[h]; - hashTable[h] = idx; - idx++; - } - - zc->nextToUpdate = target; - return hashTable[ZSTD_hashPtr(ip, hashLog, mls)]; -} - - -/* inlining is important to hardwire a hot branch (template emulation) */ -FORCE_INLINE_TEMPLATE -size_t ZSTD_HcFindBestMatch_generic ( - ZSTD_CCtx* zc, /* Index table will be updated */ - const BYTE* const ip, const BYTE* const iLimit, - size_t* offsetPtr, - const U32 maxNbAttempts, const U32 mls, const U32 extDict) -{ - U32* const chainTable = zc->chainTable; - const U32 chainSize = (1 << zc->appliedParams.cParams.chainLog); - const U32 chainMask = chainSize-1; - const BYTE* const base = zc->base; - const BYTE* const dictBase = zc->dictBase; - const U32 dictLimit = zc->dictLimit; - const BYTE* const prefixStart = base + dictLimit; - const BYTE* const dictEnd = dictBase + dictLimit; - const U32 lowLimit = zc->lowLimit; - const U32 current = (U32)(ip-base); - const U32 minChain = current > chainSize ? current - chainSize : 0; - int nbAttempts=maxNbAttempts; - size_t ml=4-1; - - /* HC4 match finder */ - U32 matchIndex = ZSTD_insertAndFindFirstIndex (zc, ip, mls); - - for ( ; (matchIndex>lowLimit) & (nbAttempts>0) ; nbAttempts--) { - const BYTE* match; - size_t currentMl=0; - if ((!extDict) || matchIndex >= dictLimit) { - match = base + matchIndex; - if (match[ml] == ip[ml]) /* potentially better */ - currentMl = ZSTD_count(ip, match, iLimit); - } else { - match = dictBase + matchIndex; - if (MEM_read32(match) == MEM_read32(ip)) /* assumption : matchIndex <= dictLimit-4 (by table construction) */ - currentMl = ZSTD_count_2segments(ip+4, match+4, iLimit, dictEnd, prefixStart) + 4; - } - - /* save best solution */ - if (currentMl > ml) { - ml = currentMl; - *offsetPtr = current - matchIndex + ZSTD_REP_MOVE; - if (ip+currentMl == iLimit) break; /* best possible, avoids read overflow on next attempt */ - } - - if (matchIndex <= minChain) break; - matchIndex = NEXT_IN_CHAIN(matchIndex, chainMask); - } - - return ml; -} - - -FORCE_INLINE_TEMPLATE size_t ZSTD_HcFindBestMatch_selectMLS ( - ZSTD_CCtx* zc, - const BYTE* ip, const BYTE* const iLimit, - size_t* offsetPtr, - const U32 maxNbAttempts, const U32 matchLengthSearch) -{ - switch(matchLengthSearch) - { - default : /* includes case 3 */ - case 4 : return ZSTD_HcFindBestMatch_generic(zc, ip, iLimit, offsetPtr, maxNbAttempts, 4, 0); - case 5 : return ZSTD_HcFindBestMatch_generic(zc, ip, iLimit, offsetPtr, maxNbAttempts, 5, 0); - case 7 : - case 6 : return ZSTD_HcFindBestMatch_generic(zc, ip, iLimit, offsetPtr, maxNbAttempts, 6, 0); - } -} - - -FORCE_INLINE_TEMPLATE size_t ZSTD_HcFindBestMatch_extDict_selectMLS ( - ZSTD_CCtx* zc, - const BYTE* ip, const BYTE* const iLimit, - size_t* offsetPtr, - const U32 maxNbAttempts, const U32 matchLengthSearch) -{ - switch(matchLengthSearch) - { - default : /* includes case 3 */ - case 4 : return ZSTD_HcFindBestMatch_generic(zc, ip, iLimit, offsetPtr, maxNbAttempts, 4, 1); - case 5 : return ZSTD_HcFindBestMatch_generic(zc, ip, iLimit, offsetPtr, maxNbAttempts, 5, 1); - case 7 : - case 6 : return ZSTD_HcFindBestMatch_generic(zc, ip, iLimit, offsetPtr, maxNbAttempts, 6, 1); - } -} - - -/* ******************************* -* Common parser - lazy strategy -*********************************/ -FORCE_INLINE_TEMPLATE -void ZSTD_compressBlock_lazy_generic(ZSTD_CCtx* ctx, - const void* src, size_t srcSize, - const U32 searchMethod, const U32 depth) -{ - seqStore_t* seqStorePtr = &(ctx->seqStore); - const BYTE* const istart = (const BYTE*)src; - const BYTE* ip = istart; - const BYTE* anchor = istart; - const BYTE* const iend = istart + srcSize; - const BYTE* const ilimit = iend - 8; - const BYTE* const base = ctx->base + ctx->dictLimit; - - U32 const maxSearches = 1 << ctx->appliedParams.cParams.searchLog; - U32 const mls = ctx->appliedParams.cParams.searchLength; - - typedef size_t (*searchMax_f)(ZSTD_CCtx* zc, const BYTE* ip, const BYTE* iLimit, - size_t* offsetPtr, - U32 maxNbAttempts, U32 matchLengthSearch); - searchMax_f const searchMax = searchMethod ? ZSTD_BtFindBestMatch_selectMLS : ZSTD_HcFindBestMatch_selectMLS; - U32 offset_1 = seqStorePtr->rep[0], offset_2 = seqStorePtr->rep[1], savedOffset=0; - - /* init */ - ip += (ip==base); - ctx->nextToUpdate3 = ctx->nextToUpdate; - { U32 const maxRep = (U32)(ip-base); - if (offset_2 > maxRep) savedOffset = offset_2, offset_2 = 0; - if (offset_1 > maxRep) savedOffset = offset_1, offset_1 = 0; - } - - /* Match Loop */ - while (ip < ilimit) { - size_t matchLength=0; - size_t offset=0; - const BYTE* start=ip+1; - - /* check repCode */ - if ((offset_1>0) & (MEM_read32(ip+1) == MEM_read32(ip+1 - offset_1))) { - /* repcode : we take it */ - matchLength = ZSTD_count(ip+1+4, ip+1+4-offset_1, iend) + 4; - if (depth==0) goto _storeSequence; - } - - /* first search (depth 0) */ - { size_t offsetFound = 99999999; - size_t const ml2 = searchMax(ctx, ip, iend, &offsetFound, maxSearches, mls); - if (ml2 > matchLength) - matchLength = ml2, start = ip, offset=offsetFound; - } - - if (matchLength < 4) { - ip += ((ip-anchor) >> g_searchStrength) + 1; /* jump faster over incompressible sections */ - continue; - } - - /* let's try to find a better solution */ - if (depth>=1) - while (ip0) & (MEM_read32(ip) == MEM_read32(ip - offset_1)))) { - size_t const mlRep = ZSTD_count(ip+4, ip+4-offset_1, iend) + 4; - int const gain2 = (int)(mlRep * 3); - int const gain1 = (int)(matchLength*3 - ZSTD_highbit32((U32)offset+1) + 1); - if ((mlRep >= 4) && (gain2 > gain1)) - matchLength = mlRep, offset = 0, start = ip; - } - { size_t offset2=99999999; - size_t const ml2 = searchMax(ctx, ip, iend, &offset2, maxSearches, mls); - int const gain2 = (int)(ml2*4 - ZSTD_highbit32((U32)offset2+1)); /* raw approx */ - int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offset+1) + 4); - if ((ml2 >= 4) && (gain2 > gain1)) { - matchLength = ml2, offset = offset2, start = ip; - continue; /* search a better one */ - } } - - /* let's find an even better one */ - if ((depth==2) && (ip0) & (MEM_read32(ip) == MEM_read32(ip - offset_1)))) { - size_t const ml2 = ZSTD_count(ip+4, ip+4-offset_1, iend) + 4; - int const gain2 = (int)(ml2 * 4); - int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offset+1) + 1); - if ((ml2 >= 4) && (gain2 > gain1)) - matchLength = ml2, offset = 0, start = ip; - } - { size_t offset2=99999999; - size_t const ml2 = searchMax(ctx, ip, iend, &offset2, maxSearches, mls); - int const gain2 = (int)(ml2*4 - ZSTD_highbit32((U32)offset2+1)); /* raw approx */ - int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offset+1) + 7); - if ((ml2 >= 4) && (gain2 > gain1)) { - matchLength = ml2, offset = offset2, start = ip; - continue; - } } } - break; /* nothing found : store previous solution */ - } - - /* NOTE: - * start[-offset+ZSTD_REP_MOVE-1] is undefined behavior. - * (-offset+ZSTD_REP_MOVE-1) is unsigned, and is added to start, which - * overflows the pointer, which is undefined behavior. - */ - /* catch up */ - if (offset) { - while ( (start > anchor) - && (start > base+offset-ZSTD_REP_MOVE) - && (start[-1] == (start-offset+ZSTD_REP_MOVE)[-1]) ) /* only search for offset within prefix */ - { start--; matchLength++; } - offset_2 = offset_1; offset_1 = (U32)(offset - ZSTD_REP_MOVE); - } - /* store sequence */ -_storeSequence: - { size_t const litLength = start - anchor; - ZSTD_storeSeq(seqStorePtr, litLength, anchor, (U32)offset, matchLength-MINMATCH); - anchor = ip = start + matchLength; - } - - /* check immediate repcode */ - while ( (ip <= ilimit) - && ((offset_2>0) - & (MEM_read32(ip) == MEM_read32(ip - offset_2)) )) { - /* store sequence */ - matchLength = ZSTD_count(ip+4, ip+4-offset_2, iend) + 4; - offset = offset_2; offset_2 = offset_1; offset_1 = (U32)offset; /* swap repcodes */ - ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, matchLength-MINMATCH); - ip += matchLength; - anchor = ip; - continue; /* faster when present ... (?) */ - } } - - /* Save reps for next block */ - seqStorePtr->repToConfirm[0] = offset_1 ? offset_1 : savedOffset; - seqStorePtr->repToConfirm[1] = offset_2 ? offset_2 : savedOffset; - - /* Last Literals */ - { size_t const lastLLSize = iend - anchor; - memcpy(seqStorePtr->lit, anchor, lastLLSize); - seqStorePtr->lit += lastLLSize; - } -} - - -static void ZSTD_compressBlock_btlazy2(ZSTD_CCtx* ctx, const void* src, size_t srcSize) -{ - ZSTD_compressBlock_lazy_generic(ctx, src, srcSize, 1, 2); -} - -static void ZSTD_compressBlock_lazy2(ZSTD_CCtx* ctx, const void* src, size_t srcSize) -{ - ZSTD_compressBlock_lazy_generic(ctx, src, srcSize, 0, 2); -} - -static void ZSTD_compressBlock_lazy(ZSTD_CCtx* ctx, const void* src, size_t srcSize) -{ - ZSTD_compressBlock_lazy_generic(ctx, src, srcSize, 0, 1); -} - -static void ZSTD_compressBlock_greedy(ZSTD_CCtx* ctx, const void* src, size_t srcSize) -{ - ZSTD_compressBlock_lazy_generic(ctx, src, srcSize, 0, 0); -} - - -FORCE_INLINE_TEMPLATE -void ZSTD_compressBlock_lazy_extDict_generic(ZSTD_CCtx* ctx, - const void* src, size_t srcSize, - const U32 searchMethod, const U32 depth) -{ - seqStore_t* seqStorePtr = &(ctx->seqStore); - const BYTE* const istart = (const BYTE*)src; - const BYTE* ip = istart; - const BYTE* anchor = istart; - const BYTE* const iend = istart + srcSize; - const BYTE* const ilimit = iend - 8; - const BYTE* const base = ctx->base; - const U32 dictLimit = ctx->dictLimit; - const U32 lowestIndex = ctx->lowLimit; - const BYTE* const prefixStart = base + dictLimit; - const BYTE* const dictBase = ctx->dictBase; - const BYTE* const dictEnd = dictBase + dictLimit; - const BYTE* const dictStart = dictBase + ctx->lowLimit; - - const U32 maxSearches = 1 << ctx->appliedParams.cParams.searchLog; - const U32 mls = ctx->appliedParams.cParams.searchLength; - - typedef size_t (*searchMax_f)(ZSTD_CCtx* zc, const BYTE* ip, const BYTE* iLimit, - size_t* offsetPtr, - U32 maxNbAttempts, U32 matchLengthSearch); - searchMax_f searchMax = searchMethod ? ZSTD_BtFindBestMatch_selectMLS_extDict : ZSTD_HcFindBestMatch_extDict_selectMLS; - - U32 offset_1 = seqStorePtr->rep[0], offset_2 = seqStorePtr->rep[1]; - - /* init */ - ctx->nextToUpdate3 = ctx->nextToUpdate; - ip += (ip == prefixStart); - - /* Match Loop */ - while (ip < ilimit) { - size_t matchLength=0; - size_t offset=0; - const BYTE* start=ip+1; - U32 current = (U32)(ip-base); - - /* check repCode */ - { const U32 repIndex = (U32)(current+1 - offset_1); - const BYTE* const repBase = repIndex < dictLimit ? dictBase : base; - const BYTE* const repMatch = repBase + repIndex; - if (((U32)((dictLimit-1) - repIndex) >= 3) & (repIndex > lowestIndex)) /* intentional overflow */ - if (MEM_read32(ip+1) == MEM_read32(repMatch)) { - /* repcode detected we should take it */ - const BYTE* const repEnd = repIndex < dictLimit ? dictEnd : iend; - matchLength = ZSTD_count_2segments(ip+1+4, repMatch+4, iend, repEnd, prefixStart) + 4; - if (depth==0) goto _storeSequence; - } } - - /* first search (depth 0) */ - { size_t offsetFound = 99999999; - size_t const ml2 = searchMax(ctx, ip, iend, &offsetFound, maxSearches, mls); - if (ml2 > matchLength) - matchLength = ml2, start = ip, offset=offsetFound; - } - - if (matchLength < 4) { - ip += ((ip-anchor) >> g_searchStrength) + 1; /* jump faster over incompressible sections */ - continue; - } - - /* let's try to find a better solution */ - if (depth>=1) - while (ip= 3) & (repIndex > lowestIndex)) /* intentional overflow */ - if (MEM_read32(ip) == MEM_read32(repMatch)) { - /* repcode detected */ - const BYTE* const repEnd = repIndex < dictLimit ? dictEnd : iend; - size_t const repLength = ZSTD_count_2segments(ip+4, repMatch+4, iend, repEnd, prefixStart) + 4; - int const gain2 = (int)(repLength * 3); - int const gain1 = (int)(matchLength*3 - ZSTD_highbit32((U32)offset+1) + 1); - if ((repLength >= 4) && (gain2 > gain1)) - matchLength = repLength, offset = 0, start = ip; - } } - - /* search match, depth 1 */ - { size_t offset2=99999999; - size_t const ml2 = searchMax(ctx, ip, iend, &offset2, maxSearches, mls); - int const gain2 = (int)(ml2*4 - ZSTD_highbit32((U32)offset2+1)); /* raw approx */ - int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offset+1) + 4); - if ((ml2 >= 4) && (gain2 > gain1)) { - matchLength = ml2, offset = offset2, start = ip; - continue; /* search a better one */ - } } - - /* let's find an even better one */ - if ((depth==2) && (ip= 3) & (repIndex > lowestIndex)) /* intentional overflow */ - if (MEM_read32(ip) == MEM_read32(repMatch)) { - /* repcode detected */ - const BYTE* const repEnd = repIndex < dictLimit ? dictEnd : iend; - size_t const repLength = ZSTD_count_2segments(ip+4, repMatch+4, iend, repEnd, prefixStart) + 4; - int const gain2 = (int)(repLength * 4); - int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offset+1) + 1); - if ((repLength >= 4) && (gain2 > gain1)) - matchLength = repLength, offset = 0, start = ip; - } } - - /* search match, depth 2 */ - { size_t offset2=99999999; - size_t const ml2 = searchMax(ctx, ip, iend, &offset2, maxSearches, mls); - int const gain2 = (int)(ml2*4 - ZSTD_highbit32((U32)offset2+1)); /* raw approx */ - int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offset+1) + 7); - if ((ml2 >= 4) && (gain2 > gain1)) { - matchLength = ml2, offset = offset2, start = ip; - continue; - } } } - break; /* nothing found : store previous solution */ - } - - /* catch up */ - if (offset) { - U32 const matchIndex = (U32)((start-base) - (offset - ZSTD_REP_MOVE)); - const BYTE* match = (matchIndex < dictLimit) ? dictBase + matchIndex : base + matchIndex; - const BYTE* const mStart = (matchIndex < dictLimit) ? dictStart : prefixStart; - while ((start>anchor) && (match>mStart) && (start[-1] == match[-1])) { start--; match--; matchLength++; } /* catch up */ - offset_2 = offset_1; offset_1 = (U32)(offset - ZSTD_REP_MOVE); - } - - /* store sequence */ -_storeSequence: - { size_t const litLength = start - anchor; - ZSTD_storeSeq(seqStorePtr, litLength, anchor, (U32)offset, matchLength-MINMATCH); - anchor = ip = start + matchLength; - } - - /* check immediate repcode */ - while (ip <= ilimit) { - const U32 repIndex = (U32)((ip-base) - offset_2); - const BYTE* const repBase = repIndex < dictLimit ? dictBase : base; - const BYTE* const repMatch = repBase + repIndex; - if (((U32)((dictLimit-1) - repIndex) >= 3) & (repIndex > lowestIndex)) /* intentional overflow */ - if (MEM_read32(ip) == MEM_read32(repMatch)) { - /* repcode detected we should take it */ - const BYTE* const repEnd = repIndex < dictLimit ? dictEnd : iend; - matchLength = ZSTD_count_2segments(ip+4, repMatch+4, iend, repEnd, prefixStart) + 4; - offset = offset_2; offset_2 = offset_1; offset_1 = (U32)offset; /* swap offset history */ - ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, matchLength-MINMATCH); - ip += matchLength; - anchor = ip; - continue; /* faster when present ... (?) */ - } - break; - } } - - /* Save reps for next block */ - seqStorePtr->repToConfirm[0] = offset_1; seqStorePtr->repToConfirm[1] = offset_2; - - /* Last Literals */ - { size_t const lastLLSize = iend - anchor; - memcpy(seqStorePtr->lit, anchor, lastLLSize); - seqStorePtr->lit += lastLLSize; - } -} - - -void ZSTD_compressBlock_greedy_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize) -{ - ZSTD_compressBlock_lazy_extDict_generic(ctx, src, srcSize, 0, 0); -} - -static void ZSTD_compressBlock_lazy_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize) -{ - ZSTD_compressBlock_lazy_extDict_generic(ctx, src, srcSize, 0, 1); -} - -static void ZSTD_compressBlock_lazy2_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize) -{ - ZSTD_compressBlock_lazy_extDict_generic(ctx, src, srcSize, 0, 2); -} - -static void ZSTD_compressBlock_btlazy2_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize) -{ - ZSTD_compressBlock_lazy_extDict_generic(ctx, src, srcSize, 1, 2); -} - - -/* The optimal parser */ -#include "zstd_opt.h" - -static void ZSTD_compressBlock_btopt(ZSTD_CCtx* ctx, const void* src, size_t srcSize) -{ -#ifdef ZSTD_OPT_H_91842398743 - ZSTD_compressBlock_opt_generic(ctx, src, srcSize, 0); -#else - (void)ctx; (void)src; (void)srcSize; - return; -#endif -} - -static void ZSTD_compressBlock_btultra(ZSTD_CCtx* ctx, const void* src, size_t srcSize) -{ -#ifdef ZSTD_OPT_H_91842398743 - ZSTD_compressBlock_opt_generic(ctx, src, srcSize, 1); -#else - (void)ctx; (void)src; (void)srcSize; - return; -#endif -} - -static void ZSTD_compressBlock_btopt_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize) -{ -#ifdef ZSTD_OPT_H_91842398743 - ZSTD_compressBlock_opt_extDict_generic(ctx, src, srcSize, 0); -#else - (void)ctx; (void)src; (void)srcSize; - return; -#endif -} - -static void ZSTD_compressBlock_btultra_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize) -{ -#ifdef ZSTD_OPT_H_91842398743 - ZSTD_compressBlock_opt_extDict_generic(ctx, src, srcSize, 1); -#else - (void)ctx; (void)src; (void)srcSize; - return; -#endif -} - - /* ZSTD_selectBlockCompressor() : + * Not static, but internal use only (used by long distance matcher) * assumption : strat is a valid strategy */ -typedef void (*ZSTD_blockCompressor) (ZSTD_CCtx* ctx, const void* src, size_t srcSize); -static ZSTD_blockCompressor ZSTD_selectBlockCompressor(ZSTD_strategy strat, int extDict) +typedef size_t (*ZSTD_blockCompressor) (ZSTD_CCtx* ctx, const void* src, size_t srcSize); +ZSTD_blockCompressor ZSTD_selectBlockCompressor(ZSTD_strategy strat, int extDict) { static const ZSTD_blockCompressor blockCompressor[2][(unsigned)ZSTD_btultra+1] = { { ZSTD_compressBlock_fast /* default for 0 */, @@ -2819,18 +1565,37 @@ static ZSTD_blockCompressor ZSTD_selectBlockCompressor(ZSTD_strategy strat, int return blockCompressor[extDict!=0][(U32)strat]; } +static void ZSTD_storeLastLiterals(seqStore_t* seqStorePtr, + const BYTE* anchor, size_t lastLLSize) +{ + memcpy(seqStorePtr->lit, anchor, lastLLSize); + seqStorePtr->lit += lastLLSize; +} static size_t ZSTD_compressBlock_internal(ZSTD_CCtx* zc, void* dst, size_t dstCapacity, const void* src, size_t srcSize) { - ZSTD_blockCompressor const blockCompressor = ZSTD_selectBlockCompressor(zc->appliedParams.cParams.strategy, zc->lowLimit < zc->dictLimit); const BYTE* const base = zc->base; const BYTE* const istart = (const BYTE*)src; const U32 current = (U32)(istart-base); + size_t lastLLSize; + const BYTE* anchor; + U32 const extDict = zc->lowLimit < zc->dictLimit; + const ZSTD_blockCompressor blockCompressor = + zc->appliedParams.ldmParams.enableLdm + ? (extDict ? ZSTD_compressBlock_ldm_extDict : ZSTD_compressBlock_ldm) + : ZSTD_selectBlockCompressor(zc->appliedParams.cParams.strategy, extDict); + if (srcSize < MIN_CBLOCK_SIZE+ZSTD_blockHeaderSize+1) return 0; /* don't even attempt compression below a certain srcSize */ ZSTD_resetSeqStore(&(zc->seqStore)); if (current > zc->nextToUpdate + 384) zc->nextToUpdate = current - MIN(192, (U32)(current - zc->nextToUpdate - 384)); /* limited update after finding a very long match */ - blockCompressor(zc, src, srcSize); + + lastLLSize = blockCompressor(zc, src, srcSize); + + /* Last literals */ + anchor = (const BYTE*)src + srcSize - lastLLSize; + ZSTD_storeLastLiterals(&zc->seqStore, anchor, lastLLSize); + return ZSTD_compressSequences(&zc->seqStore, zc->entropy, &zc->appliedParams.cParams, dst, dstCapacity, srcSize); } @@ -2852,7 +1617,7 @@ static size_t ZSTD_compress_frameChunk (ZSTD_CCtx* cctx, const BYTE* ip = (const BYTE*)src; BYTE* const ostart = (BYTE*)dst; BYTE* op = ostart; - U32 const maxDist = 1 << cctx->appliedParams.cParams.windowLog; + U32 const maxDist = (U32)1 << cctx->appliedParams.cParams.windowLog; if (cctx->appliedParams.fParams.checksumFlag && srcSize) XXH64_update(&cctx->xxhState, src, srcSize); @@ -2865,13 +1630,33 @@ static size_t ZSTD_compress_frameChunk (ZSTD_CCtx* cctx, return ERROR(dstSize_tooSmall); /* not enough space to store compressed block */ if (remaining < blockSize) blockSize = remaining; - /* preemptive overflow correction */ + /* preemptive overflow correction: + * 1. correction is large enough: + * lowLimit > (3<<29) ==> current > 3<<29 + 1< (3<<29 + 1< (3<<29 - blockSize) - (1< (3<<29 - blockSize) - (1<<30) (NOTE: chainLog <= 30) + * > 1<<29 - 1<<17 + * + * 2. (ip+blockSize - cctx->base) doesn't overflow: + * In 32 bit mode we limit windowLog to 30 so we don't get + * differences larger than 1<<31-1. + * 3. cctx->lowLimit < 1<<32: + * windowLog <= 31 ==> 3<<29 + 1<lowLimit > (3U<<29)) { - U32 const cycleMask = (1 << ZSTD_cycleLog(cctx->appliedParams.cParams.hashLog, cctx->appliedParams.cParams.strategy)) - 1; + U32 const cycleMask = ((U32)1 << ZSTD_cycleLog(cctx->appliedParams.cParams.chainLog, cctx->appliedParams.cParams.strategy)) - 1; U32 const current = (U32)(ip - cctx->base); - U32 const newCurrent = (current & cycleMask) + (1 << cctx->appliedParams.cParams.windowLog); + U32 const newCurrent = (current & cycleMask) + ((U32)1 << cctx->appliedParams.cParams.windowLog); U32 const correction = current - newCurrent; - ZSTD_STATIC_ASSERT(ZSTD_WINDOWLOG_MAX_64 <= 30); + ZSTD_STATIC_ASSERT(ZSTD_CHAINLOG_MAX <= 30); + ZSTD_STATIC_ASSERT(ZSTD_WINDOWLOG_MAX_32 <= 30); + ZSTD_STATIC_ASSERT(ZSTD_WINDOWLOG_MAX <= 31); + assert(current > newCurrent); + assert(correction > 1<<28); /* Loose bound, should be about 1<<29 */ ZSTD_reduceIndex(cctx, correction); cctx->base += correction; cctx->dictBase += correction; @@ -2879,6 +1664,7 @@ static size_t ZSTD_compress_frameChunk (ZSTD_CCtx* cctx, cctx->dictLimit -= correction; if (cctx->nextToUpdate < correction) cctx->nextToUpdate = 0; else cctx->nextToUpdate -= correction; + DEBUGLOG(4, "Correction of 0x%x bytes to lowLimit=0x%x\n", correction, cctx->lowLimit); } if ((U32)(ip+blockSize - cctx->base) > cctx->loadedDictEnd + maxDist) { @@ -2915,25 +1701,29 @@ static size_t ZSTD_compress_frameChunk (ZSTD_CCtx* cctx, static size_t ZSTD_writeFrameHeader(void* dst, size_t dstCapacity, - ZSTD_parameters params, U64 pledgedSrcSize, U32 dictID) + ZSTD_CCtx_params params, U64 pledgedSrcSize, U32 dictID) { BYTE* const op = (BYTE*)dst; U32 const dictIDSizeCodeLength = (dictID>0) + (dictID>=256) + (dictID>=65536); /* 0-3 */ U32 const dictIDSizeCode = params.fParams.noDictIDFlag ? 0 : dictIDSizeCodeLength; /* 0-3 */ U32 const checksumFlag = params.fParams.checksumFlag>0; - U32 const windowSize = 1U << params.cParams.windowLog; + U32 const windowSize = (U32)1 << params.cParams.windowLog; U32 const singleSegment = params.fParams.contentSizeFlag && (windowSize >= pledgedSrcSize); BYTE const windowLogByte = (BYTE)((params.cParams.windowLog - ZSTD_WINDOWLOG_ABSOLUTEMIN) << 3); U32 const fcsCode = params.fParams.contentSizeFlag ? (pledgedSrcSize>=256) + (pledgedSrcSize>=65536+256) + (pledgedSrcSize>=0xFFFFFFFFU) : 0; /* 0-3 */ BYTE const frameHeaderDecriptionByte = (BYTE)(dictIDSizeCode + (checksumFlag<<2) + (singleSegment<<5) + (fcsCode<<6) ); - size_t pos; + size_t pos=0; if (dstCapacity < ZSTD_frameHeaderSize_max) return ERROR(dstSize_tooSmall); - DEBUGLOG(5, "ZSTD_writeFrameHeader : dictIDFlag : %u ; dictID : %u ; dictIDSizeCode : %u", + DEBUGLOG(4, "ZSTD_writeFrameHeader : dictIDFlag : %u ; dictID : %u ; dictIDSizeCode : %u", !params.fParams.noDictIDFlag, dictID, dictIDSizeCode); - MEM_writeLE32(dst, ZSTD_MAGICNUMBER); - op[4] = frameHeaderDecriptionByte; pos=5; + if (params.format == ZSTD_f_zstd1) { + DEBUGLOG(4, "writing zstd magic number"); + MEM_writeLE32(dst, ZSTD_MAGICNUMBER); + pos = 4; + } + op[pos++] = frameHeaderDecriptionByte; if (!singleSegment) op[pos++] = windowLogByte; switch(dictIDSizeCode) { @@ -2969,7 +1759,7 @@ static size_t ZSTD_compressContinue_internal (ZSTD_CCtx* cctx, if (frame && (cctx->stage==ZSTDcs_init)) { fhSize = ZSTD_writeFrameHeader(dst, dstCapacity, cctx->appliedParams, - cctx->pledgedSrcSizePlusOne-1, cctx->dictID); + cctx->pledgedSrcSizePlusOne-1, cctx->dictID); if (ZSTD_isError(fhSize)) return fhSize; dstCapacity -= fhSize; dst = (char*)dst + fhSize; @@ -3018,11 +1808,9 @@ size_t ZSTD_compressContinue (ZSTD_CCtx* cctx, size_t ZSTD_getBlockSize(const ZSTD_CCtx* cctx) { - U32 const cLevel = cctx->compressionLevel; - ZSTD_compressionParameters cParams = (cLevel == ZSTD_CLEVEL_CUSTOM) ? - cctx->appliedParams.cParams : - ZSTD_getCParams(cLevel, 0, 0); - return MIN (ZSTD_BLOCKSIZE_MAX, 1 << cParams.windowLog); + ZSTD_compressionParameters const cParams = + ZSTD_getCParamsFromCCtxParams(cctx->appliedParams, 0, 0); + return MIN (ZSTD_BLOCKSIZE_MAX, (U32)1 << cParams.windowLog); } size_t ZSTD_compressBlock(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize) @@ -3046,7 +1834,7 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_CCtx* zc, const void* src, size_t zc->dictBase = zc->base; zc->base += ip - zc->nextSrc; zc->nextToUpdate = zc->dictLimit; - zc->loadedDictEnd = zc->forceWindow ? 0 : (U32)(iend - zc->base); + zc->loadedDictEnd = zc->appliedParams.forceWindow ? 0 : (U32)(iend - zc->base); zc->nextSrc = iend; if (srcSize <= HASH_READ_SIZE) return 0; @@ -3056,7 +1844,6 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_CCtx* zc, const void* src, size_t case ZSTD_fast: ZSTD_fillHashTable (zc, iend, zc->appliedParams.cParams.searchLength); break; - case ZSTD_dfast: ZSTD_fillDoubleHashTable (zc, iend, zc->appliedParams.cParams.searchLength); break; @@ -3072,7 +1859,7 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_CCtx* zc, const void* src, size_t case ZSTD_btopt: case ZSTD_btultra: if (srcSize >= HASH_READ_SIZE) - ZSTD_updateTree(zc, iend-HASH_READ_SIZE, iend, 1 << zc->appliedParams.cParams.searchLog, zc->appliedParams.cParams.searchLength); + ZSTD_updateTree(zc, iend-HASH_READ_SIZE, iend, (U32)1 << zc->appliedParams.cParams.searchLog, zc->appliedParams.cParams.searchLength); break; default: @@ -3120,8 +1907,10 @@ static size_t ZSTD_loadZstdDictionary(ZSTD_CCtx* cctx, const void* dict, size_t cctx->dictID = cctx->appliedParams.fParams.noDictIDFlag ? 0 : MEM_readLE32(dictPtr); dictPtr += 4; - { size_t const hufHeaderSize = HUF_readCTable((HUF_CElt*)cctx->entropy->hufCTable, 255, dictPtr, dictEnd-dictPtr); + { unsigned maxSymbolValue = 255; + size_t const hufHeaderSize = HUF_readCTable((HUF_CElt*)cctx->entropy->hufCTable, &maxSymbolValue, dictPtr, dictEnd-dictPtr); if (HUF_isError(hufHeaderSize)) return ERROR(dictionary_corrupted); + if (maxSymbolValue < 255) return ERROR(dictionary_corrupted); dictPtr += hufHeaderSize; } @@ -3221,12 +2010,10 @@ static size_t ZSTD_compressBegin_internal(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_dictMode_e dictMode, const ZSTD_CDict* cdict, - ZSTD_parameters params, U64 pledgedSrcSize, + ZSTD_CCtx_params params, U64 pledgedSrcSize, ZSTD_buffered_policy_e zbuff) { DEBUGLOG(4, "ZSTD_compressBegin_internal"); - DEBUGLOG(4, "dict ? %s", dict ? "dict" : (cdict ? "cdict" : "none")); - DEBUGLOG(4, "dictMode : %u", (U32)dictMode); /* params are supposed to be fully validated at this point */ assert(!ZSTD_isError(ZSTD_checkCParams(params.cParams))); assert(!((dict) && (cdict))); /* either dict or cdict, not both */ @@ -3242,6 +2029,19 @@ static size_t ZSTD_compressBegin_internal(ZSTD_CCtx* cctx, return ZSTD_compress_insertDictionary(cctx, dict, dictSize, dictMode); } +size_t ZSTD_compressBegin_advanced_internal( + ZSTD_CCtx* cctx, + const void* dict, size_t dictSize, + ZSTD_dictMode_e dictMode, + ZSTD_CCtx_params params, + unsigned long long pledgedSrcSize) +{ + /* compression parameters verification and optimization */ + CHECK_F( ZSTD_checkCParams(params.cParams) ); + return ZSTD_compressBegin_internal(cctx, dict, dictSize, dictMode, NULL, + params, pledgedSrcSize, + ZSTDb_not_buffered); +} /*! ZSTD_compressBegin_advanced() : * @return : 0, or an error code */ @@ -3249,21 +2049,22 @@ size_t ZSTD_compressBegin_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_parameters params, unsigned long long pledgedSrcSize) { - /* compression parameters verification and optimization */ - CHECK_F(ZSTD_checkCParams(params.cParams)); - return ZSTD_compressBegin_internal(cctx, dict, dictSize, ZSTD_dm_auto, NULL, - params, pledgedSrcSize, ZSTDb_not_buffered); + ZSTD_CCtx_params const cctxParams = + ZSTD_assignParamsToCCtxParams(cctx->requestedParams, params); + return ZSTD_compressBegin_advanced_internal(cctx, dict, dictSize, ZSTD_dm_auto, + cctxParams, + pledgedSrcSize); } - size_t ZSTD_compressBegin_usingDict(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, int compressionLevel) { ZSTD_parameters const params = ZSTD_getParams(compressionLevel, 0, dictSize); + ZSTD_CCtx_params const cctxParams = + ZSTD_assignParamsToCCtxParams(cctx->requestedParams, params); return ZSTD_compressBegin_internal(cctx, dict, dictSize, ZSTD_dm_auto, NULL, - params, 0, ZSTDb_not_buffered); + cctxParams, 0, ZSTDb_not_buffered); } - size_t ZSTD_compressBegin(ZSTD_CCtx* cctx, int compressionLevel) { return ZSTD_compressBegin_usingDict(cctx, NULL, 0, compressionLevel); @@ -3324,9 +2125,9 @@ size_t ZSTD_compressEnd (ZSTD_CCtx* cctx, endResult = ZSTD_writeEpilogue(cctx, (char*)dst + cSize, dstCapacity-cSize); if (ZSTD_isError(endResult)) return endResult; if (cctx->appliedParams.fParams.contentSizeFlag) { /* control src size */ - DEBUGLOG(5, "end of frame : controlling src size"); + DEBUGLOG(4, "end of frame : controlling src size"); if (cctx->pledgedSrcSizePlusOne != cctx->consumedSrcSize+1) { - DEBUGLOG(5, "error : pledgedSrcSize = %u, while realSrcSize = %u", + DEBUGLOG(4, "error : pledgedSrcSize = %u, while realSrcSize = %u", (U32)cctx->pledgedSrcSizePlusOne-1, (U32)cctx->consumedSrcSize); return ERROR(srcSize_wrong); } } @@ -3340,9 +2141,13 @@ static size_t ZSTD_compress_internal (ZSTD_CCtx* cctx, const void* dict,size_t dictSize, ZSTD_parameters params) { - CHECK_F( ZSTD_compressBegin_internal(cctx, dict, dictSize, ZSTD_dm_auto, NULL, - params, srcSize, ZSTDb_not_buffered) ); - return ZSTD_compressEnd(cctx, dst, dstCapacity, src, srcSize); + ZSTD_CCtx_params const cctxParams = + ZSTD_assignParamsToCCtxParams(cctx->requestedParams, params); + return ZSTD_compress_advanced_internal(cctx, + dst, dstCapacity, + src, srcSize, + dict, dictSize, + cctxParams); } size_t ZSTD_compress_advanced (ZSTD_CCtx* ctx, @@ -3355,6 +2160,19 @@ size_t ZSTD_compress_advanced (ZSTD_CCtx* ctx, return ZSTD_compress_internal(ctx, dst, dstCapacity, src, srcSize, dict, dictSize, params); } +/* Internal */ +size_t ZSTD_compress_advanced_internal( + ZSTD_CCtx* cctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + const void* dict,size_t dictSize, + ZSTD_CCtx_params params) +{ + CHECK_F( ZSTD_compressBegin_internal(cctx, dict, dictSize, ZSTD_dm_auto, NULL, + params, srcSize, ZSTDb_not_buffered) ); + return ZSTD_compressEnd(cctx, dst, dstCapacity, src, srcSize); +} + size_t ZSTD_compress_usingDict(ZSTD_CCtx* ctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize, const void* dict, size_t dictSize, int compressionLevel) { @@ -3384,18 +2202,21 @@ size_t ZSTD_compress(void* dst, size_t dstCapacity, const void* src, size_t srcS /*! ZSTD_estimateCDictSize_advanced() : * Estimate amount of memory that will be needed to create a dictionary with following arguments */ -size_t ZSTD_estimateCDictSize_advanced(size_t dictSize, ZSTD_compressionParameters cParams, unsigned byReference) +size_t ZSTD_estimateCDictSize_advanced( + size_t dictSize, ZSTD_compressionParameters cParams, + ZSTD_dictLoadMethod_e dictLoadMethod) { DEBUGLOG(5, "sizeof(ZSTD_CDict) : %u", (U32)sizeof(ZSTD_CDict)); - DEBUGLOG(5, "CCtx estimate : %u", (U32)ZSTD_estimateCCtxSize_advanced(cParams)); - return sizeof(ZSTD_CDict) + ZSTD_estimateCCtxSize_advanced(cParams) - + (byReference ? 0 : dictSize); + DEBUGLOG(5, "CCtx estimate : %u", + (U32)ZSTD_estimateCCtxSize_usingCParams(cParams)); + return sizeof(ZSTD_CDict) + ZSTD_estimateCCtxSize_usingCParams(cParams) + + (dictLoadMethod == ZSTD_dlm_byRef ? 0 : dictSize); } size_t ZSTD_estimateCDictSize(size_t dictSize, int compressionLevel) { ZSTD_compressionParameters const cParams = ZSTD_getCParams(compressionLevel, 0, dictSize); - return ZSTD_estimateCDictSize_advanced(dictSize, cParams, 0); + return ZSTD_estimateCDictSize_advanced(dictSize, cParams, ZSTD_dlm_byCopy); } size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict) @@ -3406,22 +2227,15 @@ size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict) return ZSTD_sizeof_CCtx(cdict->refContext) + (cdict->dictBuffer ? cdict->dictContentSize : 0) + sizeof(*cdict); } -static ZSTD_parameters ZSTD_makeParams(ZSTD_compressionParameters cParams, ZSTD_frameParameters fParams) -{ - ZSTD_parameters params; - params.cParams = cParams; - params.fParams = fParams; - return params; -} - static size_t ZSTD_initCDict_internal( ZSTD_CDict* cdict, const void* dictBuffer, size_t dictSize, - unsigned byReference, ZSTD_dictMode_e dictMode, + ZSTD_dictLoadMethod_e dictLoadMethod, + ZSTD_dictMode_e dictMode, ZSTD_compressionParameters cParams) { DEBUGLOG(5, "ZSTD_initCDict_internal, mode %u", (U32)dictMode); - if ((byReference) || (!dictBuffer) || (!dictSize)) { + if ((dictLoadMethod == ZSTD_dlm_byRef) || (!dictBuffer) || (!dictSize)) { cdict->dictBuffer = NULL; cdict->dictContent = dictBuffer; } else { @@ -3433,13 +2247,12 @@ static size_t ZSTD_initCDict_internal( } cdict->dictContentSize = dictSize; - { ZSTD_frameParameters const fParams = { 0 /* contentSizeFlag */, - 0 /* checksumFlag */, 0 /* noDictIDFlag */ }; /* dummy */ - ZSTD_parameters const params = ZSTD_makeParams(cParams, fParams); + { ZSTD_CCtx_params cctxParams = cdict->refContext->requestedParams; + cctxParams.cParams = cParams; CHECK_F( ZSTD_compressBegin_internal(cdict->refContext, cdict->dictContent, dictSize, dictMode, NULL, - params, ZSTD_CONTENTSIZE_UNKNOWN, + cctxParams, ZSTD_CONTENTSIZE_UNKNOWN, ZSTDb_not_buffered) ); } @@ -3447,7 +2260,8 @@ static size_t ZSTD_initCDict_internal( } ZSTD_CDict* ZSTD_createCDict_advanced(const void* dictBuffer, size_t dictSize, - unsigned byReference, ZSTD_dictMode_e dictMode, + ZSTD_dictLoadMethod_e dictLoadMethod, + ZSTD_dictMode_e dictMode, ZSTD_compressionParameters cParams, ZSTD_customMem customMem) { DEBUGLOG(5, "ZSTD_createCDict_advanced, mode %u", (U32)dictMode); @@ -3462,10 +2276,9 @@ ZSTD_CDict* ZSTD_createCDict_advanced(const void* dictBuffer, size_t dictSize, return NULL; } cdict->refContext = cctx; - if (ZSTD_isError( ZSTD_initCDict_internal(cdict, dictBuffer, dictSize, - byReference, dictMode, + dictLoadMethod, dictMode, cParams) )) { ZSTD_freeCDict(cdict); return NULL; @@ -3479,7 +2292,7 @@ ZSTD_CDict* ZSTD_createCDict(const void* dict, size_t dictSize, int compressionL { ZSTD_compressionParameters cParams = ZSTD_getCParams(compressionLevel, 0, dictSize); return ZSTD_createCDict_advanced(dict, dictSize, - 0 /* byReference */, ZSTD_dm_auto, + ZSTD_dlm_byCopy, ZSTD_dm_auto, cParams, ZSTD_defaultCMem); } @@ -3487,7 +2300,7 @@ ZSTD_CDict* ZSTD_createCDict_byReference(const void* dict, size_t dictSize, int { ZSTD_compressionParameters cParams = ZSTD_getCParams(compressionLevel, 0, dictSize); return ZSTD_createCDict_advanced(dict, dictSize, - 1 /* byReference */, ZSTD_dm_auto, + ZSTD_dlm_byRef, ZSTD_dm_auto, cParams, ZSTD_defaultCMem); } @@ -3517,11 +2330,12 @@ size_t ZSTD_freeCDict(ZSTD_CDict* cdict) */ ZSTD_CDict* ZSTD_initStaticCDict(void* workspace, size_t workspaceSize, const void* dict, size_t dictSize, - unsigned byReference, ZSTD_dictMode_e dictMode, + ZSTD_dictLoadMethod_e dictLoadMethod, + ZSTD_dictMode_e dictMode, ZSTD_compressionParameters cParams) { - size_t const cctxSize = ZSTD_estimateCCtxSize_advanced(cParams); - size_t const neededSize = sizeof(ZSTD_CDict) + (byReference ? 0 : dictSize) + size_t const cctxSize = ZSTD_estimateCCtxSize_usingCParams(cParams); + size_t const neededSize = sizeof(ZSTD_CDict) + (dictLoadMethod == ZSTD_dlm_byRef ? 0 : dictSize) + cctxSize; ZSTD_CDict* const cdict = (ZSTD_CDict*) workspace; void* ptr; @@ -3531,7 +2345,7 @@ ZSTD_CDict* ZSTD_initStaticCDict(void* workspace, size_t workspaceSize, (U32)workspaceSize, (U32)neededSize, (U32)(workspaceSize < neededSize)); if (workspaceSize < neededSize) return NULL; - if (!byReference) { + if (dictLoadMethod == ZSTD_dlm_byCopy) { memcpy(cdict+1, dict, dictSize); dict = cdict+1; ptr = (char*)workspace + sizeof(ZSTD_CDict) + dictSize; @@ -3542,15 +2356,15 @@ ZSTD_CDict* ZSTD_initStaticCDict(void* workspace, size_t workspaceSize, if (ZSTD_isError( ZSTD_initCDict_internal(cdict, dict, dictSize, - 1 /* byReference */, dictMode, + ZSTD_dlm_byRef, dictMode, cParams) )) return NULL; return cdict; } -ZSTD_parameters ZSTD_getParamsFromCDict(const ZSTD_CDict* cdict) { - return ZSTD_getParamsFromCCtx(cdict->refContext); +ZSTD_compressionParameters ZSTD_getCParamsFromCDict(const ZSTD_CDict* cdict) { + return cdict->refContext->appliedParams.cParams; } /* ZSTD_compressBegin_usingCDict_advanced() : @@ -3560,7 +2374,8 @@ size_t ZSTD_compressBegin_usingCDict_advanced( ZSTD_frameParameters const fParams, unsigned long long const pledgedSrcSize) { if (cdict==NULL) return ERROR(dictionary_wrong); - { ZSTD_parameters params = cdict->refContext->appliedParams; + { ZSTD_CCtx_params params = cctx->requestedParams; + params.cParams = ZSTD_getCParamsFromCDict(cdict); params.fParams = fParams; DEBUGLOG(5, "ZSTD_compressBegin_usingCDict_advanced"); return ZSTD_compressBegin_internal(cctx, @@ -3644,7 +2459,7 @@ size_t ZSTD_CStreamOutSize(void) static size_t ZSTD_resetCStream_internal(ZSTD_CStream* zcs, const void* dict, size_t dictSize, ZSTD_dictMode_e dictMode, const ZSTD_CDict* cdict, - ZSTD_parameters params, unsigned long long pledgedSrcSize) + const ZSTD_CCtx_params params, unsigned long long pledgedSrcSize) { DEBUGLOG(4, "ZSTD_resetCStream_internal"); /* params are supposed to be fully validated at this point */ @@ -3668,13 +2483,11 @@ static size_t ZSTD_resetCStream_internal(ZSTD_CStream* zcs, size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize) { - ZSTD_parameters params = zcs->requestedParams; + ZSTD_CCtx_params params = zcs->requestedParams; params.fParams.contentSizeFlag = (pledgedSrcSize > 0); - DEBUGLOG(5, "ZSTD_resetCStream"); - if (zcs->compressionLevel != ZSTD_CLEVEL_CUSTOM) { - params.cParams = ZSTD_getCParams(zcs->compressionLevel, pledgedSrcSize, 0 /* dictSize */); - } - return ZSTD_resetCStream_internal(zcs, NULL, 0, zcs->dictMode, zcs->cdict, params, pledgedSrcSize); + params.cParams = ZSTD_getCParamsFromCCtxParams(params, pledgedSrcSize, 0); + DEBUGLOG(4, "ZSTD_resetCStream"); + return ZSTD_resetCStream_internal(zcs, NULL, 0, ZSTD_dm_auto, zcs->cdict, params, pledgedSrcSize); } /*! ZSTD_initCStream_internal() : @@ -3683,9 +2496,9 @@ size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize) * Assumption 2 : either dict, or cdict, is defined, not both */ size_t ZSTD_initCStream_internal(ZSTD_CStream* zcs, const void* dict, size_t dictSize, const ZSTD_CDict* cdict, - ZSTD_parameters params, unsigned long long pledgedSrcSize) + ZSTD_CCtx_params params, unsigned long long pledgedSrcSize) { - DEBUGLOG(5, "ZSTD_initCStream_internal"); + DEBUGLOG(4, "ZSTD_initCStream_internal"); assert(!ZSTD_isError(ZSTD_checkCParams(params.cParams))); assert(!((dict) && (cdict))); /* either dict or cdict, not both */ @@ -3697,23 +2510,23 @@ size_t ZSTD_initCStream_internal(ZSTD_CStream* zcs, } ZSTD_freeCDict(zcs->cdictLocal); zcs->cdictLocal = ZSTD_createCDict_advanced(dict, dictSize, - zcs->dictContentByRef, zcs->dictMode, + ZSTD_dlm_byCopy, ZSTD_dm_auto, params.cParams, zcs->customMem); zcs->cdict = zcs->cdictLocal; if (zcs->cdictLocal == NULL) return ERROR(memory_allocation); } else { if (cdict) { - ZSTD_parameters const cdictParams = ZSTD_getParamsFromCDict(cdict); - params.cParams = cdictParams.cParams; /* cParams are enforced from cdict */ + params.cParams = ZSTD_getCParamsFromCDict(cdict); /* cParams are enforced from cdict */ } ZSTD_freeCDict(zcs->cdictLocal); zcs->cdictLocal = NULL; zcs->cdict = cdict; } + params.compressionLevel = ZSTD_CLEVEL_CUSTOM; zcs->requestedParams = params; - zcs->compressionLevel = ZSTD_CLEVEL_CUSTOM; - return ZSTD_resetCStream_internal(zcs, NULL, 0, zcs->dictMode, zcs->cdict, params, pledgedSrcSize); + + return ZSTD_resetCStream_internal(zcs, NULL, 0, ZSTD_dm_auto, zcs->cdict, params, pledgedSrcSize); } /* ZSTD_initCStream_usingCDict_advanced() : @@ -3724,7 +2537,8 @@ size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize) { /* cannot handle NULL cdict (does not know what to do) */ if (!cdict) return ERROR(dictionary_wrong); - { ZSTD_parameters params = ZSTD_getParamsFromCDict(cdict); + { ZSTD_CCtx_params params = zcs->requestedParams; + params.cParams = ZSTD_getCParamsFromCDict(cdict); params.fParams = fParams; return ZSTD_initCStream_internal(zcs, NULL, 0, cdict, @@ -3743,30 +2557,32 @@ size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, const void* dict, size_t dictSize, ZSTD_parameters params, unsigned long long pledgedSrcSize) { + ZSTD_CCtx_params const cctxParams = + ZSTD_assignParamsToCCtxParams(zcs->requestedParams, params); CHECK_F( ZSTD_checkCParams(params.cParams) ); - zcs->requestedParams = params; - zcs->compressionLevel = ZSTD_CLEVEL_CUSTOM; - return ZSTD_initCStream_internal(zcs, dict, dictSize, NULL, params, pledgedSrcSize); + return ZSTD_initCStream_internal(zcs, dict, dictSize, NULL, cctxParams, pledgedSrcSize); } size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compressionLevel) { ZSTD_parameters const params = ZSTD_getParams(compressionLevel, 0, dictSize); - zcs->compressionLevel = compressionLevel; - return ZSTD_initCStream_internal(zcs, dict, dictSize, NULL, params, 0); + ZSTD_CCtx_params const cctxParams = + ZSTD_assignParamsToCCtxParams(zcs->requestedParams, params); + return ZSTD_initCStream_internal(zcs, dict, dictSize, NULL, cctxParams, 0); } size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLevel, unsigned long long pledgedSrcSize) { - ZSTD_parameters params = ZSTD_getParams(compressionLevel, pledgedSrcSize, 0); - params.fParams.contentSizeFlag = (pledgedSrcSize>0); - return ZSTD_initCStream_internal(zcs, NULL, 0, NULL, params, pledgedSrcSize); + ZSTD_CCtx_params cctxParams; + ZSTD_parameters const params = ZSTD_getParams(compressionLevel, pledgedSrcSize, 0); + cctxParams = ZSTD_assignParamsToCCtxParams(zcs->requestedParams, params); + cctxParams.fParams.contentSizeFlag = (pledgedSrcSize>0); + return ZSTD_initCStream_internal(zcs, NULL, 0, NULL, cctxParams, pledgedSrcSize); } size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel) { - ZSTD_parameters const params = ZSTD_getParams(compressionLevel, 0, 0); - return ZSTD_initCStream_internal(zcs, NULL, 0, NULL, params, 0); + return ZSTD_initCStream_srcSize(zcs, compressionLevel, 0); } /*====== Compression ======*/ @@ -3781,6 +2597,7 @@ MEM_STATIC size_t ZSTD_limitCopy(void* dst, size_t dstCapacity, /** ZSTD_compressStream_generic(): * internal function for all *compressStream*() variants and *compress_generic() + * non-static, because can be called from zstdmt.c * @return : hint size for next input */ size_t ZSTD_compressStream_generic(ZSTD_CStream* zcs, ZSTD_outBuffer* output, @@ -3934,21 +2751,13 @@ size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuf return ZSTD_compressStream_generic(zcs, output, input, ZSTD_e_continue); } -/*! ZSTDMT_initCStream_internal() : - * Private use only. Init streaming operation. - * expects params to be valid. - * must receive dict, or cdict, or none, but not both. - * @return : 0, or an error code */ -size_t ZSTDMT_initCStream_internal(ZSTDMT_CCtx* zcs, - const void* dict, size_t dictSize, const ZSTD_CDict* cdict, - ZSTD_parameters params, unsigned long long pledgedSrcSize); - size_t ZSTD_compress_generic (ZSTD_CCtx* cctx, ZSTD_outBuffer* output, ZSTD_inBuffer* input, ZSTD_EndDirective endOp) { + DEBUGLOG(5, "ZSTD_compress_generic"); /* check conditions */ if (output->pos > output->size) return ERROR(GENERIC); if (input->pos > input->size) return ERROR(GENERIC); @@ -3956,31 +2765,42 @@ size_t ZSTD_compress_generic (ZSTD_CCtx* cctx, /* transparent initialization stage */ if (cctx->streamStage == zcss_init) { - const void* const prefix = cctx->prefix; - size_t const prefixSize = cctx->prefixSize; - ZSTD_parameters params = cctx->requestedParams; - if (cctx->compressionLevel != ZSTD_CLEVEL_CUSTOM) - params.cParams = ZSTD_getCParams(cctx->compressionLevel, - cctx->pledgedSrcSizePlusOne-1, 0 /*dictSize*/); - cctx->prefix = NULL; cctx->prefixSize = 0; /* single usage */ - assert(prefix==NULL || cctx->cdict==NULL); /* only one can be set */ + ZSTD_prefixDict const prefixDict = cctx->prefixDict; + ZSTD_CCtx_params params = cctx->requestedParams; + params.cParams = ZSTD_getCParamsFromCCtxParams( + cctx->requestedParams, cctx->pledgedSrcSizePlusOne-1, 0 /*dictSize*/); + memset(&cctx->prefixDict, 0, sizeof(cctx->prefixDict)); /* single usage */ + assert(prefixDict.dict==NULL || cctx->cdict==NULL); /* only one can be set */ + DEBUGLOG(4, "ZSTD_compress_generic : transparent init stage"); #ifdef ZSTD_MULTITHREAD - if (cctx->nbThreads > 1) { - DEBUGLOG(4, "call ZSTDMT_initCStream_internal as nbThreads=%u", cctx->nbThreads); - CHECK_F( ZSTDMT_initCStream_internal(cctx->mtctx, prefix, prefixSize, cctx->cdict, params, cctx->pledgedSrcSizePlusOne-1) ); + if (params.nbThreads > 1) { + if (cctx->mtctx == NULL || cctx->appliedParams.nbThreads != params.nbThreads) { + ZSTDMT_freeCCtx(cctx->mtctx); + cctx->mtctx = ZSTDMT_createCCtx_advanced(params.nbThreads, cctx->customMem); + if (cctx->mtctx == NULL) return ERROR(memory_allocation); + } + DEBUGLOG(4, "call ZSTDMT_initCStream_internal as nbThreads=%u", params.nbThreads); + CHECK_F( ZSTDMT_initCStream_internal( + cctx->mtctx, + prefixDict.dict, prefixDict.dictSize, ZSTD_dm_rawContent, + cctx->cdict, params, cctx->pledgedSrcSizePlusOne-1) ); cctx->streamStage = zcss_load; + cctx->appliedParams.nbThreads = params.nbThreads; } else #endif { - CHECK_F( ZSTD_resetCStream_internal(cctx, prefix, prefixSize, cctx->dictMode, cctx->cdict, params, cctx->pledgedSrcSizePlusOne-1) ); + CHECK_F( ZSTD_resetCStream_internal( + cctx, prefixDict.dict, prefixDict.dictSize, + prefixDict.dictMode, cctx->cdict, params, + cctx->pledgedSrcSizePlusOne-1) ); } } /* compression stage */ #ifdef ZSTD_MULTITHREAD - if (cctx->nbThreads > 1) { + if (cctx->appliedParams.nbThreads > 1) { size_t const flushMin = ZSTDMT_compressStream_generic(cctx->mtctx, output, input, endOp); - DEBUGLOG(5, "ZSTDMT_compressStream_generic : %u", (U32)flushMin); + DEBUGLOG(5, "ZSTDMT_compressStream_generic result : %u", (U32)flushMin); if ( ZSTD_isError(flushMin) || (endOp == ZSTD_e_end && flushMin == 0) ) { /* compression completed */ ZSTD_startNewCompression(cctx); @@ -3988,7 +2808,6 @@ size_t ZSTD_compress_generic (ZSTD_CCtx* cctx, return flushMin; } #endif - CHECK_F( ZSTD_compressStream_generic(cctx, output, input, endOp) ); DEBUGLOG(5, "completed ZSTD_compress_generic"); return cctx->outBuffContentSize - cctx->outBuffFlushedSize; /* remaining to flush */ @@ -4189,6 +3008,7 @@ ZSTD_compressionParameters ZSTD_getCParams(int compressionLevel, unsigned long l if (compressionLevel > ZSTD_MAX_CLEVEL) compressionLevel = ZSTD_MAX_CLEVEL; { ZSTD_compressionParameters const cp = ZSTD_defaultCParameters[tableID][compressionLevel]; return ZSTD_adjustCParams_internal(cp, srcSizeHint, dictSize); } + } /*! ZSTD_getParams() : diff --git a/sys/contrib/zstd/lib/compress/zstd_compress.h b/sys/contrib/zstd/lib/compress/zstd_compress.h new file mode 100644 index 000000000000..94606edc935e --- /dev/null +++ b/sys/contrib/zstd/lib/compress/zstd_compress.h @@ -0,0 +1,307 @@ +/* + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + + +#ifndef ZSTD_COMPRESS_H +#define ZSTD_COMPRESS_H + +/*-************************************* +* Dependencies +***************************************/ +#include "zstd_internal.h" +#ifdef ZSTD_MULTITHREAD +# include "zstdmt_compress.h" +#endif + +#if defined (__cplusplus) +extern "C" { +#endif + +/*-************************************* +* Constants +***************************************/ +static const U32 g_searchStrength = 8; +#define HASH_READ_SIZE 8 + + +/*-************************************* +* Context memory management +***************************************/ +typedef enum { ZSTDcs_created=0, ZSTDcs_init, ZSTDcs_ongoing, ZSTDcs_ending } ZSTD_compressionStage_e; +typedef enum { zcss_init=0, zcss_load, zcss_flush } ZSTD_cStreamStage; + +typedef struct ZSTD_prefixDict_s { + const void* dict; + size_t dictSize; + ZSTD_dictMode_e dictMode; +} ZSTD_prefixDict; + +struct ZSTD_CCtx_s { + const BYTE* nextSrc; /* next block here to continue on current prefix */ + const BYTE* base; /* All regular indexes relative to this position */ + const BYTE* dictBase; /* extDict indexes relative to this position */ + U32 dictLimit; /* below that point, need extDict */ + U32 lowLimit; /* below that point, no more data */ + U32 nextToUpdate; /* index from which to continue dictionary update */ + U32 nextToUpdate3; /* index from which to continue dictionary update */ + U32 hashLog3; /* dispatch table : larger == faster, more memory */ + U32 loadedDictEnd; /* index of end of dictionary */ + ZSTD_compressionStage_e stage; + U32 dictID; + ZSTD_CCtx_params requestedParams; + ZSTD_CCtx_params appliedParams; + void* workSpace; + size_t workSpaceSize; + size_t blockSize; + U64 pledgedSrcSizePlusOne; /* this way, 0 (default) == unknown */ + U64 consumedSrcSize; + XXH64_state_t xxhState; + ZSTD_customMem customMem; + size_t staticSize; + + seqStore_t seqStore; /* sequences storage ptrs */ + optState_t optState; + ldmState_t ldmState; /* long distance matching state */ + U32* hashTable; + U32* hashTable3; + U32* chainTable; + ZSTD_entropyCTables_t* entropy; + + /* streaming */ + char* inBuff; + size_t inBuffSize; + size_t inToCompress; + size_t inBuffPos; + size_t inBuffTarget; + char* outBuff; + size_t outBuffSize; + size_t outBuffContentSize; + size_t outBuffFlushedSize; + ZSTD_cStreamStage streamStage; + U32 frameEnded; + + /* Dictionary */ + ZSTD_CDict* cdictLocal; + const ZSTD_CDict* cdict; + ZSTD_prefixDict prefixDict; /* single-usage dictionary */ + + /* Multi-threading */ +#ifdef ZSTD_MULTITHREAD + ZSTDMT_CCtx* mtctx; +#endif +}; + + +static const BYTE LL_Code[64] = { 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, + 16, 16, 17, 17, 18, 18, 19, 19, + 20, 20, 20, 20, 21, 21, 21, 21, + 22, 22, 22, 22, 22, 22, 22, 22, + 23, 23, 23, 23, 23, 23, 23, 23, + 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24 }; + +static const BYTE ML_Code[128] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 36, 36, 37, 37, 37, 37, + 38, 38, 38, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, 39, 39, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42 }; + +/*! ZSTD_storeSeq() : + Store a sequence (literal length, literals, offset code and match length code) into seqStore_t. + `offsetCode` : distance to match, or 0 == repCode. + `matchCode` : matchLength - MINMATCH +*/ +MEM_STATIC void ZSTD_storeSeq(seqStore_t* seqStorePtr, size_t litLength, const void* literals, U32 offsetCode, size_t matchCode) +{ +#if defined(ZSTD_DEBUG) && (ZSTD_DEBUG >= 6) + static const BYTE* g_start = NULL; + U32 const pos = (U32)((const BYTE*)literals - g_start); + if (g_start==NULL) g_start = (const BYTE*)literals; + if ((pos > 0) && (pos < 1000000000)) + DEBUGLOG(6, "Cpos %6u :%5u literals & match %3u bytes at distance %6u", + pos, (U32)litLength, (U32)matchCode+MINMATCH, (U32)offsetCode); +#endif + /* copy Literals */ + assert(seqStorePtr->lit + litLength <= seqStorePtr->litStart + 128 KB); + ZSTD_wildcopy(seqStorePtr->lit, literals, litLength); + seqStorePtr->lit += litLength; + + /* literal Length */ + if (litLength>0xFFFF) { + seqStorePtr->longLengthID = 1; + seqStorePtr->longLengthPos = (U32)(seqStorePtr->sequences - seqStorePtr->sequencesStart); + } + seqStorePtr->sequences[0].litLength = (U16)litLength; + + /* match offset */ + seqStorePtr->sequences[0].offset = offsetCode + 1; + + /* match Length */ + if (matchCode>0xFFFF) { + seqStorePtr->longLengthID = 2; + seqStorePtr->longLengthPos = (U32)(seqStorePtr->sequences - seqStorePtr->sequencesStart); + } + seqStorePtr->sequences[0].matchLength = (U16)matchCode; + + seqStorePtr->sequences++; +} + + +/*-************************************* +* Match length counter +***************************************/ +static unsigned ZSTD_NbCommonBytes (register size_t val) +{ + if (MEM_isLittleEndian()) { + if (MEM_64bits()) { +# if defined(_MSC_VER) && defined(_WIN64) + unsigned long r = 0; + _BitScanForward64( &r, (U64)val ); + return (unsigned)(r>>3); +# elif defined(__GNUC__) && (__GNUC__ >= 4) + return (__builtin_ctzll((U64)val) >> 3); +# else + static const int DeBruijnBytePos[64] = { 0, 0, 0, 0, 0, 1, 1, 2, + 0, 3, 1, 3, 1, 4, 2, 7, + 0, 2, 3, 6, 1, 5, 3, 5, + 1, 3, 4, 4, 2, 5, 6, 7, + 7, 0, 1, 2, 3, 3, 4, 6, + 2, 6, 5, 5, 3, 4, 5, 6, + 7, 1, 2, 4, 6, 4, 4, 5, + 7, 2, 6, 5, 7, 6, 7, 7 }; + return DeBruijnBytePos[((U64)((val & -(long long)val) * 0x0218A392CDABBD3FULL)) >> 58]; +# endif + } else { /* 32 bits */ +# if defined(_MSC_VER) + unsigned long r=0; + _BitScanForward( &r, (U32)val ); + return (unsigned)(r>>3); +# elif defined(__GNUC__) && (__GNUC__ >= 3) + return (__builtin_ctz((U32)val) >> 3); +# else + static const int DeBruijnBytePos[32] = { 0, 0, 3, 0, 3, 1, 3, 0, + 3, 2, 2, 1, 3, 2, 0, 1, + 3, 3, 1, 2, 2, 2, 2, 0, + 3, 1, 2, 0, 1, 0, 1, 1 }; + return DeBruijnBytePos[((U32)((val & -(S32)val) * 0x077CB531U)) >> 27]; +# endif + } + } else { /* Big Endian CPU */ + if (MEM_64bits()) { +# if defined(_MSC_VER) && defined(_WIN64) + unsigned long r = 0; + _BitScanReverse64( &r, val ); + return (unsigned)(r>>3); +# elif defined(__GNUC__) && (__GNUC__ >= 4) + return (__builtin_clzll(val) >> 3); +# else + unsigned r; + const unsigned n32 = sizeof(size_t)*4; /* calculate this way due to compiler complaining in 32-bits mode */ + if (!(val>>n32)) { r=4; } else { r=0; val>>=n32; } + if (!(val>>16)) { r+=2; val>>=8; } else { val>>=24; } + r += (!val); + return r; +# endif + } else { /* 32 bits */ +# if defined(_MSC_VER) + unsigned long r = 0; + _BitScanReverse( &r, (unsigned long)val ); + return (unsigned)(r>>3); +# elif defined(__GNUC__) && (__GNUC__ >= 3) + return (__builtin_clz((U32)val) >> 3); +# else + unsigned r; + if (!(val>>16)) { r=2; val>>=8; } else { r=0; val>>=24; } + r += (!val); + return r; +# endif + } } +} + + +MEM_STATIC size_t ZSTD_count(const BYTE* pIn, const BYTE* pMatch, const BYTE* const pInLimit) +{ + const BYTE* const pStart = pIn; + const BYTE* const pInLoopLimit = pInLimit - (sizeof(size_t)-1); + + while (pIn < pInLoopLimit) { + size_t const diff = MEM_readST(pMatch) ^ MEM_readST(pIn); + if (!diff) { pIn+=sizeof(size_t); pMatch+=sizeof(size_t); continue; } + pIn += ZSTD_NbCommonBytes(diff); + return (size_t)(pIn - pStart); + } + if (MEM_64bits()) if ((pIn<(pInLimit-3)) && (MEM_read32(pMatch) == MEM_read32(pIn))) { pIn+=4; pMatch+=4; } + if ((pIn<(pInLimit-1)) && (MEM_read16(pMatch) == MEM_read16(pIn))) { pIn+=2; pMatch+=2; } + if ((pIn> (32-h) ; } +MEM_STATIC size_t ZSTD_hash3Ptr(const void* ptr, U32 h) { return ZSTD_hash3(MEM_readLE32(ptr), h); } /* only in zstd_opt.h */ + +static const U32 prime4bytes = 2654435761U; +static U32 ZSTD_hash4(U32 u, U32 h) { return (u * prime4bytes) >> (32-h) ; } +static size_t ZSTD_hash4Ptr(const void* ptr, U32 h) { return ZSTD_hash4(MEM_read32(ptr), h); } + +static const U64 prime5bytes = 889523592379ULL; +static size_t ZSTD_hash5(U64 u, U32 h) { return (size_t)(((u << (64-40)) * prime5bytes) >> (64-h)) ; } +static size_t ZSTD_hash5Ptr(const void* p, U32 h) { return ZSTD_hash5(MEM_readLE64(p), h); } + +static const U64 prime6bytes = 227718039650203ULL; +static size_t ZSTD_hash6(U64 u, U32 h) { return (size_t)(((u << (64-48)) * prime6bytes) >> (64-h)) ; } +static size_t ZSTD_hash6Ptr(const void* p, U32 h) { return ZSTD_hash6(MEM_readLE64(p), h); } + +static const U64 prime7bytes = 58295818150454627ULL; +static size_t ZSTD_hash7(U64 u, U32 h) { return (size_t)(((u << (64-56)) * prime7bytes) >> (64-h)) ; } +static size_t ZSTD_hash7Ptr(const void* p, U32 h) { return ZSTD_hash7(MEM_readLE64(p), h); } + +static const U64 prime8bytes = 0xCF1BBCDCB7A56463ULL; +static size_t ZSTD_hash8(U64 u, U32 h) { return (size_t)(((u) * prime8bytes) >> (64-h)) ; } +static size_t ZSTD_hash8Ptr(const void* p, U32 h) { return ZSTD_hash8(MEM_readLE64(p), h); } + +MEM_STATIC size_t ZSTD_hashPtr(const void* p, U32 hBits, U32 mls) +{ + switch(mls) + { + default: + case 4: return ZSTD_hash4Ptr(p, hBits); + case 5: return ZSTD_hash5Ptr(p, hBits); + case 6: return ZSTD_hash6Ptr(p, hBits); + case 7: return ZSTD_hash7Ptr(p, hBits); + case 8: return ZSTD_hash8Ptr(p, hBits); + } +} + +#if defined (__cplusplus) +} +#endif + +#endif /* ZSTD_COMPRESS_H */ diff --git a/sys/contrib/zstd/lib/compress/zstd_double_fast.c b/sys/contrib/zstd/lib/compress/zstd_double_fast.c new file mode 100644 index 000000000000..876a36042ce8 --- /dev/null +++ b/sys/contrib/zstd/lib/compress/zstd_double_fast.c @@ -0,0 +1,308 @@ +/* + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#include "zstd_double_fast.h" + + +void ZSTD_fillDoubleHashTable(ZSTD_CCtx* cctx, const void* end, const U32 mls) +{ + U32* const hashLarge = cctx->hashTable; + U32 const hBitsL = cctx->appliedParams.cParams.hashLog; + U32* const hashSmall = cctx->chainTable; + U32 const hBitsS = cctx->appliedParams.cParams.chainLog; + const BYTE* const base = cctx->base; + const BYTE* ip = base + cctx->nextToUpdate; + const BYTE* const iend = ((const BYTE*)end) - HASH_READ_SIZE; + const size_t fastHashFillStep = 3; + + while(ip <= iend) { + hashSmall[ZSTD_hashPtr(ip, hBitsS, mls)] = (U32)(ip - base); + hashLarge[ZSTD_hashPtr(ip, hBitsL, 8)] = (U32)(ip - base); + ip += fastHashFillStep; + } +} + + +FORCE_INLINE_TEMPLATE +size_t ZSTD_compressBlock_doubleFast_generic(ZSTD_CCtx* cctx, + const void* src, size_t srcSize, + const U32 mls) +{ + U32* const hashLong = cctx->hashTable; + const U32 hBitsL = cctx->appliedParams.cParams.hashLog; + U32* const hashSmall = cctx->chainTable; + const U32 hBitsS = cctx->appliedParams.cParams.chainLog; + seqStore_t* seqStorePtr = &(cctx->seqStore); + const BYTE* const base = cctx->base; + const BYTE* const istart = (const BYTE*)src; + const BYTE* ip = istart; + const BYTE* anchor = istart; + const U32 lowestIndex = cctx->dictLimit; + const BYTE* const lowest = base + lowestIndex; + const BYTE* const iend = istart + srcSize; + const BYTE* const ilimit = iend - HASH_READ_SIZE; + U32 offset_1=seqStorePtr->rep[0], offset_2=seqStorePtr->rep[1]; + U32 offsetSaved = 0; + + /* init */ + ip += (ip==lowest); + { U32 const maxRep = (U32)(ip-lowest); + if (offset_2 > maxRep) offsetSaved = offset_2, offset_2 = 0; + if (offset_1 > maxRep) offsetSaved = offset_1, offset_1 = 0; + } + + /* Main Search Loop */ + while (ip < ilimit) { /* < instead of <=, because repcode check at (ip+1) */ + size_t mLength; + size_t const h2 = ZSTD_hashPtr(ip, hBitsL, 8); + size_t const h = ZSTD_hashPtr(ip, hBitsS, mls); + U32 const current = (U32)(ip-base); + U32 const matchIndexL = hashLong[h2]; + U32 const matchIndexS = hashSmall[h]; + const BYTE* matchLong = base + matchIndexL; + const BYTE* match = base + matchIndexS; + hashLong[h2] = hashSmall[h] = current; /* update hash tables */ + + assert(offset_1 <= current); /* supposed guaranteed by construction */ + if ((offset_1 > 0) & (MEM_read32(ip+1-offset_1) == MEM_read32(ip+1))) { + /* favor repcode */ + mLength = ZSTD_count(ip+1+4, ip+1+4-offset_1, iend) + 4; + ip++; + ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, 0, mLength-MINMATCH); + } else { + U32 offset; + if ( (matchIndexL > lowestIndex) && (MEM_read64(matchLong) == MEM_read64(ip)) ) { + mLength = ZSTD_count(ip+8, matchLong+8, iend) + 8; + offset = (U32)(ip-matchLong); + while (((ip>anchor) & (matchLong>lowest)) && (ip[-1] == matchLong[-1])) { ip--; matchLong--; mLength++; } /* catch up */ + } else if ( (matchIndexS > lowestIndex) && (MEM_read32(match) == MEM_read32(ip)) ) { + size_t const hl3 = ZSTD_hashPtr(ip+1, hBitsL, 8); + U32 const matchIndexL3 = hashLong[hl3]; + const BYTE* matchL3 = base + matchIndexL3; + hashLong[hl3] = current + 1; + if ( (matchIndexL3 > lowestIndex) && (MEM_read64(matchL3) == MEM_read64(ip+1)) ) { + mLength = ZSTD_count(ip+9, matchL3+8, iend) + 8; + ip++; + offset = (U32)(ip-matchL3); + while (((ip>anchor) & (matchL3>lowest)) && (ip[-1] == matchL3[-1])) { ip--; matchL3--; mLength++; } /* catch up */ + } else { + mLength = ZSTD_count(ip+4, match+4, iend) + 4; + offset = (U32)(ip-match); + while (((ip>anchor) & (match>lowest)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* catch up */ + } + } else { + ip += ((ip-anchor) >> g_searchStrength) + 1; + continue; + } + + offset_2 = offset_1; + offset_1 = offset; + + ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); + } + + /* match found */ + ip += mLength; + anchor = ip; + + if (ip <= ilimit) { + /* Fill Table */ + hashLong[ZSTD_hashPtr(base+current+2, hBitsL, 8)] = + hashSmall[ZSTD_hashPtr(base+current+2, hBitsS, mls)] = current+2; /* here because current+2 could be > iend-8 */ + hashLong[ZSTD_hashPtr(ip-2, hBitsL, 8)] = + hashSmall[ZSTD_hashPtr(ip-2, hBitsS, mls)] = (U32)(ip-2-base); + + /* check immediate repcode */ + while ( (ip <= ilimit) + && ( (offset_2>0) + & (MEM_read32(ip) == MEM_read32(ip - offset_2)) )) { + /* store sequence */ + size_t const rLength = ZSTD_count(ip+4, ip+4-offset_2, iend) + 4; + { U32 const tmpOff = offset_2; offset_2 = offset_1; offset_1 = tmpOff; } /* swap offset_2 <=> offset_1 */ + hashSmall[ZSTD_hashPtr(ip, hBitsS, mls)] = (U32)(ip-base); + hashLong[ZSTD_hashPtr(ip, hBitsL, 8)] = (U32)(ip-base); + ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, rLength-MINMATCH); + ip += rLength; + anchor = ip; + continue; /* faster when present ... (?) */ + } } } + + /* save reps for next block */ + seqStorePtr->repToConfirm[0] = offset_1 ? offset_1 : offsetSaved; + seqStorePtr->repToConfirm[1] = offset_2 ? offset_2 : offsetSaved; + + /* Return the last literals size */ + return iend - anchor; +} + + +size_t ZSTD_compressBlock_doubleFast(ZSTD_CCtx* ctx, const void* src, size_t srcSize) +{ + const U32 mls = ctx->appliedParams.cParams.searchLength; + switch(mls) + { + default: /* includes case 3 */ + case 4 : + return ZSTD_compressBlock_doubleFast_generic(ctx, src, srcSize, 4); + case 5 : + return ZSTD_compressBlock_doubleFast_generic(ctx, src, srcSize, 5); + case 6 : + return ZSTD_compressBlock_doubleFast_generic(ctx, src, srcSize, 6); + case 7 : + return ZSTD_compressBlock_doubleFast_generic(ctx, src, srcSize, 7); + } +} + + +static size_t ZSTD_compressBlock_doubleFast_extDict_generic(ZSTD_CCtx* ctx, + const void* src, size_t srcSize, + const U32 mls) +{ + U32* const hashLong = ctx->hashTable; + U32 const hBitsL = ctx->appliedParams.cParams.hashLog; + U32* const hashSmall = ctx->chainTable; + U32 const hBitsS = ctx->appliedParams.cParams.chainLog; + seqStore_t* seqStorePtr = &(ctx->seqStore); + const BYTE* const base = ctx->base; + const BYTE* const dictBase = ctx->dictBase; + const BYTE* const istart = (const BYTE*)src; + const BYTE* ip = istart; + const BYTE* anchor = istart; + const U32 lowestIndex = ctx->lowLimit; + const BYTE* const dictStart = dictBase + lowestIndex; + const U32 dictLimit = ctx->dictLimit; + const BYTE* const lowPrefixPtr = base + dictLimit; + const BYTE* const dictEnd = dictBase + dictLimit; + const BYTE* const iend = istart + srcSize; + const BYTE* const ilimit = iend - 8; + U32 offset_1=seqStorePtr->rep[0], offset_2=seqStorePtr->rep[1]; + + /* Search Loop */ + while (ip < ilimit) { /* < instead of <=, because (ip+1) */ + const size_t hSmall = ZSTD_hashPtr(ip, hBitsS, mls); + const U32 matchIndex = hashSmall[hSmall]; + const BYTE* matchBase = matchIndex < dictLimit ? dictBase : base; + const BYTE* match = matchBase + matchIndex; + + const size_t hLong = ZSTD_hashPtr(ip, hBitsL, 8); + const U32 matchLongIndex = hashLong[hLong]; + const BYTE* matchLongBase = matchLongIndex < dictLimit ? dictBase : base; + const BYTE* matchLong = matchLongBase + matchLongIndex; + + const U32 current = (U32)(ip-base); + const U32 repIndex = current + 1 - offset_1; /* offset_1 expected <= current +1 */ + const BYTE* repBase = repIndex < dictLimit ? dictBase : base; + const BYTE* repMatch = repBase + repIndex; + size_t mLength; + hashSmall[hSmall] = hashLong[hLong] = current; /* update hash table */ + + if ( (((U32)((dictLimit-1) - repIndex) >= 3) /* intentional underflow */ & (repIndex > lowestIndex)) + && (MEM_read32(repMatch) == MEM_read32(ip+1)) ) { + const BYTE* repMatchEnd = repIndex < dictLimit ? dictEnd : iend; + mLength = ZSTD_count_2segments(ip+1+4, repMatch+4, iend, repMatchEnd, lowPrefixPtr) + 4; + ip++; + ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, 0, mLength-MINMATCH); + } else { + if ((matchLongIndex > lowestIndex) && (MEM_read64(matchLong) == MEM_read64(ip))) { + const BYTE* matchEnd = matchLongIndex < dictLimit ? dictEnd : iend; + const BYTE* lowMatchPtr = matchLongIndex < dictLimit ? dictStart : lowPrefixPtr; + U32 offset; + mLength = ZSTD_count_2segments(ip+8, matchLong+8, iend, matchEnd, lowPrefixPtr) + 8; + offset = current - matchLongIndex; + while (((ip>anchor) & (matchLong>lowMatchPtr)) && (ip[-1] == matchLong[-1])) { ip--; matchLong--; mLength++; } /* catch up */ + offset_2 = offset_1; + offset_1 = offset; + ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); + + } else if ((matchIndex > lowestIndex) && (MEM_read32(match) == MEM_read32(ip))) { + size_t const h3 = ZSTD_hashPtr(ip+1, hBitsL, 8); + U32 const matchIndex3 = hashLong[h3]; + const BYTE* const match3Base = matchIndex3 < dictLimit ? dictBase : base; + const BYTE* match3 = match3Base + matchIndex3; + U32 offset; + hashLong[h3] = current + 1; + if ( (matchIndex3 > lowestIndex) && (MEM_read64(match3) == MEM_read64(ip+1)) ) { + const BYTE* matchEnd = matchIndex3 < dictLimit ? dictEnd : iend; + const BYTE* lowMatchPtr = matchIndex3 < dictLimit ? dictStart : lowPrefixPtr; + mLength = ZSTD_count_2segments(ip+9, match3+8, iend, matchEnd, lowPrefixPtr) + 8; + ip++; + offset = current+1 - matchIndex3; + while (((ip>anchor) & (match3>lowMatchPtr)) && (ip[-1] == match3[-1])) { ip--; match3--; mLength++; } /* catch up */ + } else { + const BYTE* matchEnd = matchIndex < dictLimit ? dictEnd : iend; + const BYTE* lowMatchPtr = matchIndex < dictLimit ? dictStart : lowPrefixPtr; + mLength = ZSTD_count_2segments(ip+4, match+4, iend, matchEnd, lowPrefixPtr) + 4; + offset = current - matchIndex; + while (((ip>anchor) & (match>lowMatchPtr)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* catch up */ + } + offset_2 = offset_1; + offset_1 = offset; + ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); + + } else { + ip += ((ip-anchor) >> g_searchStrength) + 1; + continue; + } } + + /* found a match : store it */ + ip += mLength; + anchor = ip; + + if (ip <= ilimit) { + /* Fill Table */ + hashSmall[ZSTD_hashPtr(base+current+2, hBitsS, mls)] = current+2; + hashLong[ZSTD_hashPtr(base+current+2, hBitsL, 8)] = current+2; + hashSmall[ZSTD_hashPtr(ip-2, hBitsS, mls)] = (U32)(ip-2-base); + hashLong[ZSTD_hashPtr(ip-2, hBitsL, 8)] = (U32)(ip-2-base); + /* check immediate repcode */ + while (ip <= ilimit) { + U32 const current2 = (U32)(ip-base); + U32 const repIndex2 = current2 - offset_2; + const BYTE* repMatch2 = repIndex2 < dictLimit ? dictBase + repIndex2 : base + repIndex2; + if ( (((U32)((dictLimit-1) - repIndex2) >= 3) & (repIndex2 > lowestIndex)) /* intentional overflow */ + && (MEM_read32(repMatch2) == MEM_read32(ip)) ) { + const BYTE* const repEnd2 = repIndex2 < dictLimit ? dictEnd : iend; + size_t const repLength2 = ZSTD_count_2segments(ip+4, repMatch2+4, iend, repEnd2, lowPrefixPtr) + 4; + U32 tmpOffset = offset_2; offset_2 = offset_1; offset_1 = tmpOffset; /* swap offset_2 <=> offset_1 */ + ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, repLength2-MINMATCH); + hashSmall[ZSTD_hashPtr(ip, hBitsS, mls)] = current2; + hashLong[ZSTD_hashPtr(ip, hBitsL, 8)] = current2; + ip += repLength2; + anchor = ip; + continue; + } + break; + } } } + + /* save reps for next block */ + seqStorePtr->repToConfirm[0] = offset_1; seqStorePtr->repToConfirm[1] = offset_2; + + /* Return the last literals size */ + return iend - anchor; +} + + +size_t ZSTD_compressBlock_doubleFast_extDict(ZSTD_CCtx* ctx, + const void* src, size_t srcSize) +{ + U32 const mls = ctx->appliedParams.cParams.searchLength; + switch(mls) + { + default: /* includes case 3 */ + case 4 : + return ZSTD_compressBlock_doubleFast_extDict_generic(ctx, src, srcSize, 4); + case 5 : + return ZSTD_compressBlock_doubleFast_extDict_generic(ctx, src, srcSize, 5); + case 6 : + return ZSTD_compressBlock_doubleFast_extDict_generic(ctx, src, srcSize, 6); + case 7 : + return ZSTD_compressBlock_doubleFast_extDict_generic(ctx, src, srcSize, 7); + } +} diff --git a/sys/contrib/zstd/lib/compress/zstd_double_fast.h b/sys/contrib/zstd/lib/compress/zstd_double_fast.h new file mode 100644 index 000000000000..3dba6c7108e5 --- /dev/null +++ b/sys/contrib/zstd/lib/compress/zstd_double_fast.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#ifndef ZSTD_DOUBLE_FAST_H +#define ZSTD_DOUBLE_FAST_H + +#include "zstd_compress.h" + +#if defined (__cplusplus) +extern "C" { +#endif + +void ZSTD_fillDoubleHashTable(ZSTD_CCtx* cctx, const void* end, const U32 mls); +size_t ZSTD_compressBlock_doubleFast(ZSTD_CCtx* ctx, const void* src, size_t srcSize); +size_t ZSTD_compressBlock_doubleFast_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize); + +#if defined (__cplusplus) +} +#endif + +#endif /* ZSTD_DOUBLE_FAST_H */ diff --git a/sys/contrib/zstd/lib/compress/zstd_fast.c b/sys/contrib/zstd/lib/compress/zstd_fast.c new file mode 100644 index 000000000000..2e057017b92e --- /dev/null +++ b/sys/contrib/zstd/lib/compress/zstd_fast.c @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#include "zstd_fast.h" + + +void ZSTD_fillHashTable (ZSTD_CCtx* zc, const void* end, const U32 mls) +{ + U32* const hashTable = zc->hashTable; + U32 const hBits = zc->appliedParams.cParams.hashLog; + const BYTE* const base = zc->base; + const BYTE* ip = base + zc->nextToUpdate; + const BYTE* const iend = ((const BYTE*)end) - HASH_READ_SIZE; + const size_t fastHashFillStep = 3; + + while(ip <= iend) { + hashTable[ZSTD_hashPtr(ip, hBits, mls)] = (U32)(ip - base); + ip += fastHashFillStep; + } +} + + +FORCE_INLINE_TEMPLATE +size_t ZSTD_compressBlock_fast_generic(ZSTD_CCtx* cctx, + const void* src, size_t srcSize, + const U32 mls) +{ + U32* const hashTable = cctx->hashTable; + U32 const hBits = cctx->appliedParams.cParams.hashLog; + seqStore_t* seqStorePtr = &(cctx->seqStore); + const BYTE* const base = cctx->base; + const BYTE* const istart = (const BYTE*)src; + const BYTE* ip = istart; + const BYTE* anchor = istart; + const U32 lowestIndex = cctx->dictLimit; + const BYTE* const lowest = base + lowestIndex; + const BYTE* const iend = istart + srcSize; + const BYTE* const ilimit = iend - HASH_READ_SIZE; + U32 offset_1=seqStorePtr->rep[0], offset_2=seqStorePtr->rep[1]; + U32 offsetSaved = 0; + + /* init */ + ip += (ip==lowest); + { U32 const maxRep = (U32)(ip-lowest); + if (offset_2 > maxRep) offsetSaved = offset_2, offset_2 = 0; + if (offset_1 > maxRep) offsetSaved = offset_1, offset_1 = 0; + } + + /* Main Search Loop */ + while (ip < ilimit) { /* < instead of <=, because repcode check at (ip+1) */ + size_t mLength; + size_t const h = ZSTD_hashPtr(ip, hBits, mls); + U32 const current = (U32)(ip-base); + U32 const matchIndex = hashTable[h]; + const BYTE* match = base + matchIndex; + hashTable[h] = current; /* update hash table */ + + if ((offset_1 > 0) & (MEM_read32(ip+1-offset_1) == MEM_read32(ip+1))) { + mLength = ZSTD_count(ip+1+4, ip+1+4-offset_1, iend) + 4; + ip++; + ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, 0, mLength-MINMATCH); + } else { + U32 offset; + if ( (matchIndex <= lowestIndex) || (MEM_read32(match) != MEM_read32(ip)) ) { + ip += ((ip-anchor) >> g_searchStrength) + 1; + continue; + } + mLength = ZSTD_count(ip+4, match+4, iend) + 4; + offset = (U32)(ip-match); + while (((ip>anchor) & (match>lowest)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* catch up */ + offset_2 = offset_1; + offset_1 = offset; + + ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); + } + + /* match found */ + ip += mLength; + anchor = ip; + + if (ip <= ilimit) { + /* Fill Table */ + hashTable[ZSTD_hashPtr(base+current+2, hBits, mls)] = current+2; /* here because current+2 could be > iend-8 */ + hashTable[ZSTD_hashPtr(ip-2, hBits, mls)] = (U32)(ip-2-base); + /* check immediate repcode */ + while ( (ip <= ilimit) + && ( (offset_2>0) + & (MEM_read32(ip) == MEM_read32(ip - offset_2)) )) { + /* store sequence */ + size_t const rLength = ZSTD_count(ip+4, ip+4-offset_2, iend) + 4; + { U32 const tmpOff = offset_2; offset_2 = offset_1; offset_1 = tmpOff; } /* swap offset_2 <=> offset_1 */ + hashTable[ZSTD_hashPtr(ip, hBits, mls)] = (U32)(ip-base); + ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, rLength-MINMATCH); + ip += rLength; + anchor = ip; + continue; /* faster when present ... (?) */ + } } } + + /* save reps for next block */ + seqStorePtr->repToConfirm[0] = offset_1 ? offset_1 : offsetSaved; + seqStorePtr->repToConfirm[1] = offset_2 ? offset_2 : offsetSaved; + + /* Return the last literals size */ + return iend - anchor; +} + + +size_t ZSTD_compressBlock_fast(ZSTD_CCtx* ctx, + const void* src, size_t srcSize) +{ + const U32 mls = ctx->appliedParams.cParams.searchLength; + switch(mls) + { + default: /* includes case 3 */ + case 4 : + return ZSTD_compressBlock_fast_generic(ctx, src, srcSize, 4); + case 5 : + return ZSTD_compressBlock_fast_generic(ctx, src, srcSize, 5); + case 6 : + return ZSTD_compressBlock_fast_generic(ctx, src, srcSize, 6); + case 7 : + return ZSTD_compressBlock_fast_generic(ctx, src, srcSize, 7); + } +} + + +static size_t ZSTD_compressBlock_fast_extDict_generic(ZSTD_CCtx* ctx, + const void* src, size_t srcSize, + const U32 mls) +{ + U32* hashTable = ctx->hashTable; + const U32 hBits = ctx->appliedParams.cParams.hashLog; + seqStore_t* seqStorePtr = &(ctx->seqStore); + const BYTE* const base = ctx->base; + const BYTE* const dictBase = ctx->dictBase; + const BYTE* const istart = (const BYTE*)src; + const BYTE* ip = istart; + const BYTE* anchor = istart; + const U32 lowestIndex = ctx->lowLimit; + const BYTE* const dictStart = dictBase + lowestIndex; + const U32 dictLimit = ctx->dictLimit; + const BYTE* const lowPrefixPtr = base + dictLimit; + const BYTE* const dictEnd = dictBase + dictLimit; + const BYTE* const iend = istart + srcSize; + const BYTE* const ilimit = iend - 8; + U32 offset_1=seqStorePtr->rep[0], offset_2=seqStorePtr->rep[1]; + + /* Search Loop */ + while (ip < ilimit) { /* < instead of <=, because (ip+1) */ + const size_t h = ZSTD_hashPtr(ip, hBits, mls); + const U32 matchIndex = hashTable[h]; + const BYTE* matchBase = matchIndex < dictLimit ? dictBase : base; + const BYTE* match = matchBase + matchIndex; + const U32 current = (U32)(ip-base); + const U32 repIndex = current + 1 - offset_1; /* offset_1 expected <= current +1 */ + const BYTE* repBase = repIndex < dictLimit ? dictBase : base; + const BYTE* repMatch = repBase + repIndex; + size_t mLength; + hashTable[h] = current; /* update hash table */ + + if ( (((U32)((dictLimit-1) - repIndex) >= 3) /* intentional underflow */ & (repIndex > lowestIndex)) + && (MEM_read32(repMatch) == MEM_read32(ip+1)) ) { + const BYTE* repMatchEnd = repIndex < dictLimit ? dictEnd : iend; + mLength = ZSTD_count_2segments(ip+1+4, repMatch+4, iend, repMatchEnd, lowPrefixPtr) + 4; + ip++; + ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, 0, mLength-MINMATCH); + } else { + if ( (matchIndex < lowestIndex) || + (MEM_read32(match) != MEM_read32(ip)) ) { + ip += ((ip-anchor) >> g_searchStrength) + 1; + continue; + } + { const BYTE* matchEnd = matchIndex < dictLimit ? dictEnd : iend; + const BYTE* lowMatchPtr = matchIndex < dictLimit ? dictStart : lowPrefixPtr; + U32 offset; + mLength = ZSTD_count_2segments(ip+4, match+4, iend, matchEnd, lowPrefixPtr) + 4; + while (((ip>anchor) & (match>lowMatchPtr)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* catch up */ + offset = current - matchIndex; + offset_2 = offset_1; + offset_1 = offset; + ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH); + } } + + /* found a match : store it */ + ip += mLength; + anchor = ip; + + if (ip <= ilimit) { + /* Fill Table */ + hashTable[ZSTD_hashPtr(base+current+2, hBits, mls)] = current+2; + hashTable[ZSTD_hashPtr(ip-2, hBits, mls)] = (U32)(ip-2-base); + /* check immediate repcode */ + while (ip <= ilimit) { + U32 const current2 = (U32)(ip-base); + U32 const repIndex2 = current2 - offset_2; + const BYTE* repMatch2 = repIndex2 < dictLimit ? dictBase + repIndex2 : base + repIndex2; + if ( (((U32)((dictLimit-1) - repIndex2) >= 3) & (repIndex2 > lowestIndex)) /* intentional overflow */ + && (MEM_read32(repMatch2) == MEM_read32(ip)) ) { + const BYTE* const repEnd2 = repIndex2 < dictLimit ? dictEnd : iend; + size_t const repLength2 = ZSTD_count_2segments(ip+4, repMatch2+4, iend, repEnd2, lowPrefixPtr) + 4; + U32 tmpOffset = offset_2; offset_2 = offset_1; offset_1 = tmpOffset; /* swap offset_2 <=> offset_1 */ + ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, repLength2-MINMATCH); + hashTable[ZSTD_hashPtr(ip, hBits, mls)] = current2; + ip += repLength2; + anchor = ip; + continue; + } + break; + } } } + + /* save reps for next block */ + seqStorePtr->repToConfirm[0] = offset_1; seqStorePtr->repToConfirm[1] = offset_2; + + /* Return the last literals size */ + return iend - anchor; +} + + +size_t ZSTD_compressBlock_fast_extDict(ZSTD_CCtx* ctx, + const void* src, size_t srcSize) +{ + U32 const mls = ctx->appliedParams.cParams.searchLength; + switch(mls) + { + default: /* includes case 3 */ + case 4 : + return ZSTD_compressBlock_fast_extDict_generic(ctx, src, srcSize, 4); + case 5 : + return ZSTD_compressBlock_fast_extDict_generic(ctx, src, srcSize, 5); + case 6 : + return ZSTD_compressBlock_fast_extDict_generic(ctx, src, srcSize, 6); + case 7 : + return ZSTD_compressBlock_fast_extDict_generic(ctx, src, srcSize, 7); + } +} diff --git a/sys/contrib/zstd/lib/compress/zstd_fast.h b/sys/contrib/zstd/lib/compress/zstd_fast.h new file mode 100644 index 000000000000..4205141a9aa0 --- /dev/null +++ b/sys/contrib/zstd/lib/compress/zstd_fast.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#ifndef ZSTD_FAST_H +#define ZSTD_FAST_H + +#include "zstd_compress.h" + +#if defined (__cplusplus) +extern "C" { +#endif + +void ZSTD_fillHashTable(ZSTD_CCtx* zc, const void* end, const U32 mls); +size_t ZSTD_compressBlock_fast(ZSTD_CCtx* ctx, + const void* src, size_t srcSize); +size_t ZSTD_compressBlock_fast_extDict(ZSTD_CCtx* ctx, + const void* src, size_t srcSize); + +#if defined (__cplusplus) +} +#endif + +#endif /* ZSTD_FAST_H */ diff --git a/sys/contrib/zstd/lib/compress/zstd_lazy.c b/sys/contrib/zstd/lib/compress/zstd_lazy.c new file mode 100644 index 000000000000..2a7f6a0fe2be --- /dev/null +++ b/sys/contrib/zstd/lib/compress/zstd_lazy.c @@ -0,0 +1,749 @@ +/* + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#include "zstd_lazy.h" + + +/*-************************************* +* Binary Tree search +***************************************/ +/** ZSTD_insertBt1() : add one or multiple positions to tree. +* ip : assumed <= iend-8 . +* @return : nb of positions added */ +static U32 ZSTD_insertBt1(ZSTD_CCtx* zc, const BYTE* const ip, const U32 mls, const BYTE* const iend, U32 nbCompares, + U32 extDict) +{ + U32* const hashTable = zc->hashTable; + U32 const hashLog = zc->appliedParams.cParams.hashLog; + size_t const h = ZSTD_hashPtr(ip, hashLog, mls); + U32* const bt = zc->chainTable; + U32 const btLog = zc->appliedParams.cParams.chainLog - 1; + U32 const btMask = (1 << btLog) - 1; + U32 matchIndex = hashTable[h]; + size_t commonLengthSmaller=0, commonLengthLarger=0; + const BYTE* const base = zc->base; + const BYTE* const dictBase = zc->dictBase; + const U32 dictLimit = zc->dictLimit; + const BYTE* const dictEnd = dictBase + dictLimit; + const BYTE* const prefixStart = base + dictLimit; + const BYTE* match; + const U32 current = (U32)(ip-base); + const U32 btLow = btMask >= current ? 0 : current - btMask; + U32* smallerPtr = bt + 2*(current&btMask); + U32* largerPtr = smallerPtr + 1; + U32 dummy32; /* to be nullified at the end */ + U32 const windowLow = zc->lowLimit; + U32 matchEndIdx = current+8; + size_t bestLength = 8; +#ifdef ZSTD_C_PREDICT + U32 predictedSmall = *(bt + 2*((current-1)&btMask) + 0); + U32 predictedLarge = *(bt + 2*((current-1)&btMask) + 1); + predictedSmall += (predictedSmall>0); + predictedLarge += (predictedLarge>0); +#endif /* ZSTD_C_PREDICT */ + + assert(ip <= iend-8); /* required for h calculation */ + hashTable[h] = current; /* Update Hash Table */ + + while (nbCompares-- && (matchIndex > windowLow)) { + U32* const nextPtr = bt + 2*(matchIndex & btMask); + size_t matchLength = MIN(commonLengthSmaller, commonLengthLarger); /* guaranteed minimum nb of common bytes */ + +#ifdef ZSTD_C_PREDICT /* note : can create issues when hlog small <= 11 */ + const U32* predictPtr = bt + 2*((matchIndex-1) & btMask); /* written this way, as bt is a roll buffer */ + if (matchIndex == predictedSmall) { + /* no need to check length, result known */ + *smallerPtr = matchIndex; + if (matchIndex <= btLow) { smallerPtr=&dummy32; break; } /* beyond tree size, stop the search */ + smallerPtr = nextPtr+1; /* new "smaller" => larger of match */ + matchIndex = nextPtr[1]; /* new matchIndex larger than previous (closer to current) */ + predictedSmall = predictPtr[1] + (predictPtr[1]>0); + continue; + } + if (matchIndex == predictedLarge) { + *largerPtr = matchIndex; + if (matchIndex <= btLow) { largerPtr=&dummy32; break; } /* beyond tree size, stop the search */ + largerPtr = nextPtr; + matchIndex = nextPtr[0]; + predictedLarge = predictPtr[0] + (predictPtr[0]>0); + continue; + } +#endif + if ((!extDict) || (matchIndex+matchLength >= dictLimit)) { + match = base + matchIndex; + if (match[matchLength] == ip[matchLength]) + matchLength += ZSTD_count(ip+matchLength+1, match+matchLength+1, iend) +1; + } else { + match = dictBase + matchIndex; + matchLength += ZSTD_count_2segments(ip+matchLength, match+matchLength, iend, dictEnd, prefixStart); + if (matchIndex+matchLength >= dictLimit) + match = base + matchIndex; /* to prepare for next usage of match[matchLength] */ + } + + if (matchLength > bestLength) { + bestLength = matchLength; + if (matchLength > matchEndIdx - matchIndex) + matchEndIdx = matchIndex + (U32)matchLength; + } + + if (ip+matchLength == iend) /* equal : no way to know if inf or sup */ + break; /* drop , to guarantee consistency ; miss a bit of compression, but other solutions can corrupt tree */ + + if (match[matchLength] < ip[matchLength]) { /* necessarily within buffer */ + /* match+1 is smaller than current */ + *smallerPtr = matchIndex; /* update smaller idx */ + commonLengthSmaller = matchLength; /* all smaller will now have at least this guaranteed common length */ + if (matchIndex <= btLow) { smallerPtr=&dummy32; break; } /* beyond tree size, stop searching */ + smallerPtr = nextPtr+1; /* new "smaller" => larger of match */ + matchIndex = nextPtr[1]; /* new matchIndex larger than previous (closer to current) */ + } else { + /* match is larger than current */ + *largerPtr = matchIndex; + commonLengthLarger = matchLength; + if (matchIndex <= btLow) { largerPtr=&dummy32; break; } /* beyond tree size, stop searching */ + largerPtr = nextPtr; + matchIndex = nextPtr[0]; + } } + + *smallerPtr = *largerPtr = 0; + if (bestLength > 384) return MIN(192, (U32)(bestLength - 384)); /* speed optimization */ + if (matchEndIdx > current + 8) return matchEndIdx - (current + 8); + return 1; +} + + +static size_t ZSTD_insertBtAndFindBestMatch ( + ZSTD_CCtx* zc, + const BYTE* const ip, const BYTE* const iend, + size_t* offsetPtr, + U32 nbCompares, const U32 mls, + U32 extDict) +{ + U32* const hashTable = zc->hashTable; + U32 const hashLog = zc->appliedParams.cParams.hashLog; + size_t const h = ZSTD_hashPtr(ip, hashLog, mls); + U32* const bt = zc->chainTable; + U32 const btLog = zc->appliedParams.cParams.chainLog - 1; + U32 const btMask = (1 << btLog) - 1; + U32 matchIndex = hashTable[h]; + size_t commonLengthSmaller=0, commonLengthLarger=0; + const BYTE* const base = zc->base; + const BYTE* const dictBase = zc->dictBase; + const U32 dictLimit = zc->dictLimit; + const BYTE* const dictEnd = dictBase + dictLimit; + const BYTE* const prefixStart = base + dictLimit; + const U32 current = (U32)(ip-base); + const U32 btLow = btMask >= current ? 0 : current - btMask; + const U32 windowLow = zc->lowLimit; + U32* smallerPtr = bt + 2*(current&btMask); + U32* largerPtr = bt + 2*(current&btMask) + 1; + U32 matchEndIdx = current+8; + U32 dummy32; /* to be nullified at the end */ + size_t bestLength = 0; + + assert(ip <= iend-8); /* required for h calculation */ + hashTable[h] = current; /* Update Hash Table */ + + while (nbCompares-- && (matchIndex > windowLow)) { + U32* const nextPtr = bt + 2*(matchIndex & btMask); + size_t matchLength = MIN(commonLengthSmaller, commonLengthLarger); /* guaranteed minimum nb of common bytes */ + const BYTE* match; + + if ((!extDict) || (matchIndex+matchLength >= dictLimit)) { + match = base + matchIndex; + if (match[matchLength] == ip[matchLength]) + matchLength += ZSTD_count(ip+matchLength+1, match+matchLength+1, iend) +1; + } else { + match = dictBase + matchIndex; + matchLength += ZSTD_count_2segments(ip+matchLength, match+matchLength, iend, dictEnd, prefixStart); + if (matchIndex+matchLength >= dictLimit) + match = base + matchIndex; /* to prepare for next usage of match[matchLength] */ + } + + if (matchLength > bestLength) { + if (matchLength > matchEndIdx - matchIndex) + matchEndIdx = matchIndex + (U32)matchLength; + if ( (4*(int)(matchLength-bestLength)) > (int)(ZSTD_highbit32(current-matchIndex+1) - ZSTD_highbit32((U32)offsetPtr[0]+1)) ) + bestLength = matchLength, *offsetPtr = ZSTD_REP_MOVE + current - matchIndex; + if (ip+matchLength == iend) /* equal : no way to know if inf or sup */ + break; /* drop, to guarantee consistency (miss a little bit of compression) */ + } + + if (match[matchLength] < ip[matchLength]) { + /* match is smaller than current */ + *smallerPtr = matchIndex; /* update smaller idx */ + commonLengthSmaller = matchLength; /* all smaller will now have at least this guaranteed common length */ + if (matchIndex <= btLow) { smallerPtr=&dummy32; break; } /* beyond tree size, stop the search */ + smallerPtr = nextPtr+1; /* new "smaller" => larger of match */ + matchIndex = nextPtr[1]; /* new matchIndex larger than previous (closer to current) */ + } else { + /* match is larger than current */ + *largerPtr = matchIndex; + commonLengthLarger = matchLength; + if (matchIndex <= btLow) { largerPtr=&dummy32; break; } /* beyond tree size, stop the search */ + largerPtr = nextPtr; + matchIndex = nextPtr[0]; + } } + + *smallerPtr = *largerPtr = 0; + + zc->nextToUpdate = (matchEndIdx > current + 8) ? matchEndIdx - 8 : current+1; + return bestLength; +} + + +void ZSTD_updateTree(ZSTD_CCtx* zc, const BYTE* const ip, const BYTE* const iend, const U32 nbCompares, const U32 mls) +{ + const BYTE* const base = zc->base; + const U32 target = (U32)(ip - base); + U32 idx = zc->nextToUpdate; + + while(idx < target) + idx += ZSTD_insertBt1(zc, base+idx, mls, iend, nbCompares, 0); +} + +/** ZSTD_BtFindBestMatch() : Tree updater, providing best match */ +static size_t ZSTD_BtFindBestMatch ( + ZSTD_CCtx* zc, + const BYTE* const ip, const BYTE* const iLimit, + size_t* offsetPtr, + const U32 maxNbAttempts, const U32 mls) +{ + if (ip < zc->base + zc->nextToUpdate) return 0; /* skipped area */ + ZSTD_updateTree(zc, ip, iLimit, maxNbAttempts, mls); + return ZSTD_insertBtAndFindBestMatch(zc, ip, iLimit, offsetPtr, maxNbAttempts, mls, 0); +} + + +static size_t ZSTD_BtFindBestMatch_selectMLS ( + ZSTD_CCtx* zc, /* Index table will be updated */ + const BYTE* ip, const BYTE* const iLimit, + size_t* offsetPtr, + const U32 maxNbAttempts, const U32 matchLengthSearch) +{ + switch(matchLengthSearch) + { + default : /* includes case 3 */ + case 4 : return ZSTD_BtFindBestMatch(zc, ip, iLimit, offsetPtr, maxNbAttempts, 4); + case 5 : return ZSTD_BtFindBestMatch(zc, ip, iLimit, offsetPtr, maxNbAttempts, 5); + case 7 : + case 6 : return ZSTD_BtFindBestMatch(zc, ip, iLimit, offsetPtr, maxNbAttempts, 6); + } +} + + +void ZSTD_updateTree_extDict(ZSTD_CCtx* zc, const BYTE* const ip, const BYTE* const iend, const U32 nbCompares, const U32 mls) +{ + const BYTE* const base = zc->base; + const U32 target = (U32)(ip - base); + U32 idx = zc->nextToUpdate; + + while (idx < target) idx += ZSTD_insertBt1(zc, base+idx, mls, iend, nbCompares, 1); +} + + +/** Tree updater, providing best match */ +static size_t ZSTD_BtFindBestMatch_extDict ( + ZSTD_CCtx* zc, + const BYTE* const ip, const BYTE* const iLimit, + size_t* offsetPtr, + const U32 maxNbAttempts, const U32 mls) +{ + if (ip < zc->base + zc->nextToUpdate) return 0; /* skipped area */ + ZSTD_updateTree_extDict(zc, ip, iLimit, maxNbAttempts, mls); + return ZSTD_insertBtAndFindBestMatch(zc, ip, iLimit, offsetPtr, maxNbAttempts, mls, 1); +} + + +static size_t ZSTD_BtFindBestMatch_selectMLS_extDict ( + ZSTD_CCtx* zc, /* Index table will be updated */ + const BYTE* ip, const BYTE* const iLimit, + size_t* offsetPtr, + const U32 maxNbAttempts, const U32 matchLengthSearch) +{ + switch(matchLengthSearch) + { + default : /* includes case 3 */ + case 4 : return ZSTD_BtFindBestMatch_extDict(zc, ip, iLimit, offsetPtr, maxNbAttempts, 4); + case 5 : return ZSTD_BtFindBestMatch_extDict(zc, ip, iLimit, offsetPtr, maxNbAttempts, 5); + case 7 : + case 6 : return ZSTD_BtFindBestMatch_extDict(zc, ip, iLimit, offsetPtr, maxNbAttempts, 6); + } +} + + + +/* ********************************* +* Hash Chain +***********************************/ +#define NEXT_IN_CHAIN(d, mask) chainTable[(d) & mask] + +/* Update chains up to ip (excluded) + Assumption : always within prefix (i.e. not within extDict) */ +U32 ZSTD_insertAndFindFirstIndex (ZSTD_CCtx* zc, const BYTE* ip, U32 mls) +{ + U32* const hashTable = zc->hashTable; + const U32 hashLog = zc->appliedParams.cParams.hashLog; + U32* const chainTable = zc->chainTable; + const U32 chainMask = (1 << zc->appliedParams.cParams.chainLog) - 1; + const BYTE* const base = zc->base; + const U32 target = (U32)(ip - base); + U32 idx = zc->nextToUpdate; + + while(idx < target) { /* catch up */ + size_t const h = ZSTD_hashPtr(base+idx, hashLog, mls); + NEXT_IN_CHAIN(idx, chainMask) = hashTable[h]; + hashTable[h] = idx; + idx++; + } + + zc->nextToUpdate = target; + return hashTable[ZSTD_hashPtr(ip, hashLog, mls)]; +} + + +/* inlining is important to hardwire a hot branch (template emulation) */ +FORCE_INLINE_TEMPLATE +size_t ZSTD_HcFindBestMatch_generic ( + ZSTD_CCtx* zc, /* Index table will be updated */ + const BYTE* const ip, const BYTE* const iLimit, + size_t* offsetPtr, + const U32 maxNbAttempts, const U32 mls, const U32 extDict) +{ + U32* const chainTable = zc->chainTable; + const U32 chainSize = (1 << zc->appliedParams.cParams.chainLog); + const U32 chainMask = chainSize-1; + const BYTE* const base = zc->base; + const BYTE* const dictBase = zc->dictBase; + const U32 dictLimit = zc->dictLimit; + const BYTE* const prefixStart = base + dictLimit; + const BYTE* const dictEnd = dictBase + dictLimit; + const U32 lowLimit = zc->lowLimit; + const U32 current = (U32)(ip-base); + const U32 minChain = current > chainSize ? current - chainSize : 0; + int nbAttempts=maxNbAttempts; + size_t ml=4-1; + + /* HC4 match finder */ + U32 matchIndex = ZSTD_insertAndFindFirstIndex (zc, ip, mls); + + for ( ; (matchIndex>lowLimit) & (nbAttempts>0) ; nbAttempts--) { + const BYTE* match; + size_t currentMl=0; + if ((!extDict) || matchIndex >= dictLimit) { + match = base + matchIndex; + if (match[ml] == ip[ml]) /* potentially better */ + currentMl = ZSTD_count(ip, match, iLimit); + } else { + match = dictBase + matchIndex; + if (MEM_read32(match) == MEM_read32(ip)) /* assumption : matchIndex <= dictLimit-4 (by table construction) */ + currentMl = ZSTD_count_2segments(ip+4, match+4, iLimit, dictEnd, prefixStart) + 4; + } + + /* save best solution */ + if (currentMl > ml) { + ml = currentMl; + *offsetPtr = current - matchIndex + ZSTD_REP_MOVE; + if (ip+currentMl == iLimit) break; /* best possible, avoids read overflow on next attempt */ + } + + if (matchIndex <= minChain) break; + matchIndex = NEXT_IN_CHAIN(matchIndex, chainMask); + } + + return ml; +} + + +FORCE_INLINE_TEMPLATE size_t ZSTD_HcFindBestMatch_selectMLS ( + ZSTD_CCtx* zc, + const BYTE* ip, const BYTE* const iLimit, + size_t* offsetPtr, + const U32 maxNbAttempts, const U32 matchLengthSearch) +{ + switch(matchLengthSearch) + { + default : /* includes case 3 */ + case 4 : return ZSTD_HcFindBestMatch_generic(zc, ip, iLimit, offsetPtr, maxNbAttempts, 4, 0); + case 5 : return ZSTD_HcFindBestMatch_generic(zc, ip, iLimit, offsetPtr, maxNbAttempts, 5, 0); + case 7 : + case 6 : return ZSTD_HcFindBestMatch_generic(zc, ip, iLimit, offsetPtr, maxNbAttempts, 6, 0); + } +} + + +FORCE_INLINE_TEMPLATE size_t ZSTD_HcFindBestMatch_extDict_selectMLS ( + ZSTD_CCtx* zc, + const BYTE* ip, const BYTE* const iLimit, + size_t* offsetPtr, + const U32 maxNbAttempts, const U32 matchLengthSearch) +{ + switch(matchLengthSearch) + { + default : /* includes case 3 */ + case 4 : return ZSTD_HcFindBestMatch_generic(zc, ip, iLimit, offsetPtr, maxNbAttempts, 4, 1); + case 5 : return ZSTD_HcFindBestMatch_generic(zc, ip, iLimit, offsetPtr, maxNbAttempts, 5, 1); + case 7 : + case 6 : return ZSTD_HcFindBestMatch_generic(zc, ip, iLimit, offsetPtr, maxNbAttempts, 6, 1); + } +} + + +/* ******************************* +* Common parser - lazy strategy +*********************************/ +FORCE_INLINE_TEMPLATE +size_t ZSTD_compressBlock_lazy_generic(ZSTD_CCtx* ctx, + const void* src, size_t srcSize, + const U32 searchMethod, const U32 depth) +{ + seqStore_t* seqStorePtr = &(ctx->seqStore); + const BYTE* const istart = (const BYTE*)src; + const BYTE* ip = istart; + const BYTE* anchor = istart; + const BYTE* const iend = istart + srcSize; + const BYTE* const ilimit = iend - 8; + const BYTE* const base = ctx->base + ctx->dictLimit; + + U32 const maxSearches = 1 << ctx->appliedParams.cParams.searchLog; + U32 const mls = ctx->appliedParams.cParams.searchLength; + + typedef size_t (*searchMax_f)(ZSTD_CCtx* zc, const BYTE* ip, const BYTE* iLimit, + size_t* offsetPtr, + U32 maxNbAttempts, U32 matchLengthSearch); + searchMax_f const searchMax = searchMethod ? ZSTD_BtFindBestMatch_selectMLS : ZSTD_HcFindBestMatch_selectMLS; + U32 offset_1 = seqStorePtr->rep[0], offset_2 = seqStorePtr->rep[1], savedOffset=0; + + /* init */ + ip += (ip==base); + ctx->nextToUpdate3 = ctx->nextToUpdate; + { U32 const maxRep = (U32)(ip-base); + if (offset_2 > maxRep) savedOffset = offset_2, offset_2 = 0; + if (offset_1 > maxRep) savedOffset = offset_1, offset_1 = 0; + } + + /* Match Loop */ + while (ip < ilimit) { + size_t matchLength=0; + size_t offset=0; + const BYTE* start=ip+1; + + /* check repCode */ + if ((offset_1>0) & (MEM_read32(ip+1) == MEM_read32(ip+1 - offset_1))) { + /* repcode : we take it */ + matchLength = ZSTD_count(ip+1+4, ip+1+4-offset_1, iend) + 4; + if (depth==0) goto _storeSequence; + } + + /* first search (depth 0) */ + { size_t offsetFound = 99999999; + size_t const ml2 = searchMax(ctx, ip, iend, &offsetFound, maxSearches, mls); + if (ml2 > matchLength) + matchLength = ml2, start = ip, offset=offsetFound; + } + + if (matchLength < 4) { + ip += ((ip-anchor) >> g_searchStrength) + 1; /* jump faster over incompressible sections */ + continue; + } + + /* let's try to find a better solution */ + if (depth>=1) + while (ip0) & (MEM_read32(ip) == MEM_read32(ip - offset_1)))) { + size_t const mlRep = ZSTD_count(ip+4, ip+4-offset_1, iend) + 4; + int const gain2 = (int)(mlRep * 3); + int const gain1 = (int)(matchLength*3 - ZSTD_highbit32((U32)offset+1) + 1); + if ((mlRep >= 4) && (gain2 > gain1)) + matchLength = mlRep, offset = 0, start = ip; + } + { size_t offset2=99999999; + size_t const ml2 = searchMax(ctx, ip, iend, &offset2, maxSearches, mls); + int const gain2 = (int)(ml2*4 - ZSTD_highbit32((U32)offset2+1)); /* raw approx */ + int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offset+1) + 4); + if ((ml2 >= 4) && (gain2 > gain1)) { + matchLength = ml2, offset = offset2, start = ip; + continue; /* search a better one */ + } } + + /* let's find an even better one */ + if ((depth==2) && (ip0) & (MEM_read32(ip) == MEM_read32(ip - offset_1)))) { + size_t const ml2 = ZSTD_count(ip+4, ip+4-offset_1, iend) + 4; + int const gain2 = (int)(ml2 * 4); + int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offset+1) + 1); + if ((ml2 >= 4) && (gain2 > gain1)) + matchLength = ml2, offset = 0, start = ip; + } + { size_t offset2=99999999; + size_t const ml2 = searchMax(ctx, ip, iend, &offset2, maxSearches, mls); + int const gain2 = (int)(ml2*4 - ZSTD_highbit32((U32)offset2+1)); /* raw approx */ + int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offset+1) + 7); + if ((ml2 >= 4) && (gain2 > gain1)) { + matchLength = ml2, offset = offset2, start = ip; + continue; + } } } + break; /* nothing found : store previous solution */ + } + + /* NOTE: + * start[-offset+ZSTD_REP_MOVE-1] is undefined behavior. + * (-offset+ZSTD_REP_MOVE-1) is unsigned, and is added to start, which + * overflows the pointer, which is undefined behavior. + */ + /* catch up */ + if (offset) { + while ( (start > anchor) + && (start > base+offset-ZSTD_REP_MOVE) + && (start[-1] == (start-offset+ZSTD_REP_MOVE)[-1]) ) /* only search for offset within prefix */ + { start--; matchLength++; } + offset_2 = offset_1; offset_1 = (U32)(offset - ZSTD_REP_MOVE); + } + /* store sequence */ +_storeSequence: + { size_t const litLength = start - anchor; + ZSTD_storeSeq(seqStorePtr, litLength, anchor, (U32)offset, matchLength-MINMATCH); + anchor = ip = start + matchLength; + } + + /* check immediate repcode */ + while ( (ip <= ilimit) + && ((offset_2>0) + & (MEM_read32(ip) == MEM_read32(ip - offset_2)) )) { + /* store sequence */ + matchLength = ZSTD_count(ip+4, ip+4-offset_2, iend) + 4; + offset = offset_2; offset_2 = offset_1; offset_1 = (U32)offset; /* swap repcodes */ + ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, matchLength-MINMATCH); + ip += matchLength; + anchor = ip; + continue; /* faster when present ... (?) */ + } } + + /* Save reps for next block */ + seqStorePtr->repToConfirm[0] = offset_1 ? offset_1 : savedOffset; + seqStorePtr->repToConfirm[1] = offset_2 ? offset_2 : savedOffset; + + /* Return the last literals size */ + return iend - anchor; +} + + +size_t ZSTD_compressBlock_btlazy2(ZSTD_CCtx* ctx, const void* src, size_t srcSize) +{ + return ZSTD_compressBlock_lazy_generic(ctx, src, srcSize, 1, 2); +} + +size_t ZSTD_compressBlock_lazy2(ZSTD_CCtx* ctx, const void* src, size_t srcSize) +{ + return ZSTD_compressBlock_lazy_generic(ctx, src, srcSize, 0, 2); +} + +size_t ZSTD_compressBlock_lazy(ZSTD_CCtx* ctx, const void* src, size_t srcSize) +{ + return ZSTD_compressBlock_lazy_generic(ctx, src, srcSize, 0, 1); +} + +size_t ZSTD_compressBlock_greedy(ZSTD_CCtx* ctx, const void* src, size_t srcSize) +{ + return ZSTD_compressBlock_lazy_generic(ctx, src, srcSize, 0, 0); +} + + +FORCE_INLINE_TEMPLATE +size_t ZSTD_compressBlock_lazy_extDict_generic(ZSTD_CCtx* ctx, + const void* src, size_t srcSize, + const U32 searchMethod, const U32 depth) +{ + seqStore_t* seqStorePtr = &(ctx->seqStore); + const BYTE* const istart = (const BYTE*)src; + const BYTE* ip = istart; + const BYTE* anchor = istart; + const BYTE* const iend = istart + srcSize; + const BYTE* const ilimit = iend - 8; + const BYTE* const base = ctx->base; + const U32 dictLimit = ctx->dictLimit; + const U32 lowestIndex = ctx->lowLimit; + const BYTE* const prefixStart = base + dictLimit; + const BYTE* const dictBase = ctx->dictBase; + const BYTE* const dictEnd = dictBase + dictLimit; + const BYTE* const dictStart = dictBase + ctx->lowLimit; + + const U32 maxSearches = 1 << ctx->appliedParams.cParams.searchLog; + const U32 mls = ctx->appliedParams.cParams.searchLength; + + typedef size_t (*searchMax_f)(ZSTD_CCtx* zc, const BYTE* ip, const BYTE* iLimit, + size_t* offsetPtr, + U32 maxNbAttempts, U32 matchLengthSearch); + searchMax_f searchMax = searchMethod ? ZSTD_BtFindBestMatch_selectMLS_extDict : ZSTD_HcFindBestMatch_extDict_selectMLS; + + U32 offset_1 = seqStorePtr->rep[0], offset_2 = seqStorePtr->rep[1]; + + /* init */ + ctx->nextToUpdate3 = ctx->nextToUpdate; + ip += (ip == prefixStart); + + /* Match Loop */ + while (ip < ilimit) { + size_t matchLength=0; + size_t offset=0; + const BYTE* start=ip+1; + U32 current = (U32)(ip-base); + + /* check repCode */ + { const U32 repIndex = (U32)(current+1 - offset_1); + const BYTE* const repBase = repIndex < dictLimit ? dictBase : base; + const BYTE* const repMatch = repBase + repIndex; + if (((U32)((dictLimit-1) - repIndex) >= 3) & (repIndex > lowestIndex)) /* intentional overflow */ + if (MEM_read32(ip+1) == MEM_read32(repMatch)) { + /* repcode detected we should take it */ + const BYTE* const repEnd = repIndex < dictLimit ? dictEnd : iend; + matchLength = ZSTD_count_2segments(ip+1+4, repMatch+4, iend, repEnd, prefixStart) + 4; + if (depth==0) goto _storeSequence; + } } + + /* first search (depth 0) */ + { size_t offsetFound = 99999999; + size_t const ml2 = searchMax(ctx, ip, iend, &offsetFound, maxSearches, mls); + if (ml2 > matchLength) + matchLength = ml2, start = ip, offset=offsetFound; + } + + if (matchLength < 4) { + ip += ((ip-anchor) >> g_searchStrength) + 1; /* jump faster over incompressible sections */ + continue; + } + + /* let's try to find a better solution */ + if (depth>=1) + while (ip= 3) & (repIndex > lowestIndex)) /* intentional overflow */ + if (MEM_read32(ip) == MEM_read32(repMatch)) { + /* repcode detected */ + const BYTE* const repEnd = repIndex < dictLimit ? dictEnd : iend; + size_t const repLength = ZSTD_count_2segments(ip+4, repMatch+4, iend, repEnd, prefixStart) + 4; + int const gain2 = (int)(repLength * 3); + int const gain1 = (int)(matchLength*3 - ZSTD_highbit32((U32)offset+1) + 1); + if ((repLength >= 4) && (gain2 > gain1)) + matchLength = repLength, offset = 0, start = ip; + } } + + /* search match, depth 1 */ + { size_t offset2=99999999; + size_t const ml2 = searchMax(ctx, ip, iend, &offset2, maxSearches, mls); + int const gain2 = (int)(ml2*4 - ZSTD_highbit32((U32)offset2+1)); /* raw approx */ + int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offset+1) + 4); + if ((ml2 >= 4) && (gain2 > gain1)) { + matchLength = ml2, offset = offset2, start = ip; + continue; /* search a better one */ + } } + + /* let's find an even better one */ + if ((depth==2) && (ip= 3) & (repIndex > lowestIndex)) /* intentional overflow */ + if (MEM_read32(ip) == MEM_read32(repMatch)) { + /* repcode detected */ + const BYTE* const repEnd = repIndex < dictLimit ? dictEnd : iend; + size_t const repLength = ZSTD_count_2segments(ip+4, repMatch+4, iend, repEnd, prefixStart) + 4; + int const gain2 = (int)(repLength * 4); + int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offset+1) + 1); + if ((repLength >= 4) && (gain2 > gain1)) + matchLength = repLength, offset = 0, start = ip; + } } + + /* search match, depth 2 */ + { size_t offset2=99999999; + size_t const ml2 = searchMax(ctx, ip, iend, &offset2, maxSearches, mls); + int const gain2 = (int)(ml2*4 - ZSTD_highbit32((U32)offset2+1)); /* raw approx */ + int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)offset+1) + 7); + if ((ml2 >= 4) && (gain2 > gain1)) { + matchLength = ml2, offset = offset2, start = ip; + continue; + } } } + break; /* nothing found : store previous solution */ + } + + /* catch up */ + if (offset) { + U32 const matchIndex = (U32)((start-base) - (offset - ZSTD_REP_MOVE)); + const BYTE* match = (matchIndex < dictLimit) ? dictBase + matchIndex : base + matchIndex; + const BYTE* const mStart = (matchIndex < dictLimit) ? dictStart : prefixStart; + while ((start>anchor) && (match>mStart) && (start[-1] == match[-1])) { start--; match--; matchLength++; } /* catch up */ + offset_2 = offset_1; offset_1 = (U32)(offset - ZSTD_REP_MOVE); + } + + /* store sequence */ +_storeSequence: + { size_t const litLength = start - anchor; + ZSTD_storeSeq(seqStorePtr, litLength, anchor, (U32)offset, matchLength-MINMATCH); + anchor = ip = start + matchLength; + } + + /* check immediate repcode */ + while (ip <= ilimit) { + const U32 repIndex = (U32)((ip-base) - offset_2); + const BYTE* const repBase = repIndex < dictLimit ? dictBase : base; + const BYTE* const repMatch = repBase + repIndex; + if (((U32)((dictLimit-1) - repIndex) >= 3) & (repIndex > lowestIndex)) /* intentional overflow */ + if (MEM_read32(ip) == MEM_read32(repMatch)) { + /* repcode detected we should take it */ + const BYTE* const repEnd = repIndex < dictLimit ? dictEnd : iend; + matchLength = ZSTD_count_2segments(ip+4, repMatch+4, iend, repEnd, prefixStart) + 4; + offset = offset_2; offset_2 = offset_1; offset_1 = (U32)offset; /* swap offset history */ + ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, matchLength-MINMATCH); + ip += matchLength; + anchor = ip; + continue; /* faster when present ... (?) */ + } + break; + } } + + /* Save reps for next block */ + seqStorePtr->repToConfirm[0] = offset_1; seqStorePtr->repToConfirm[1] = offset_2; + + /* Return the last literals size */ + return iend - anchor; +} + + +size_t ZSTD_compressBlock_greedy_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize) +{ + return ZSTD_compressBlock_lazy_extDict_generic(ctx, src, srcSize, 0, 0); +} + +size_t ZSTD_compressBlock_lazy_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize) +{ + return ZSTD_compressBlock_lazy_extDict_generic(ctx, src, srcSize, 0, 1); +} + +size_t ZSTD_compressBlock_lazy2_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize) +{ + return ZSTD_compressBlock_lazy_extDict_generic(ctx, src, srcSize, 0, 2); +} + +size_t ZSTD_compressBlock_btlazy2_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize) +{ + return ZSTD_compressBlock_lazy_extDict_generic(ctx, src, srcSize, 1, 2); +} diff --git a/sys/contrib/zstd/lib/compress/zstd_lazy.h b/sys/contrib/zstd/lib/compress/zstd_lazy.h new file mode 100644 index 000000000000..a9c4daed2582 --- /dev/null +++ b/sys/contrib/zstd/lib/compress/zstd_lazy.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#ifndef ZSTD_LAZY_H +#define ZSTD_LAZY_H + +#include "zstd_compress.h" + +#if defined (__cplusplus) +extern "C" { +#endif + +U32 ZSTD_insertAndFindFirstIndex (ZSTD_CCtx* zc, const BYTE* ip, U32 mls); +void ZSTD_updateTree(ZSTD_CCtx* zc, const BYTE* const ip, const BYTE* const iend, const U32 nbCompares, const U32 mls); +void ZSTD_updateTree_extDict(ZSTD_CCtx* zc, const BYTE* const ip, const BYTE* const iend, const U32 nbCompares, const U32 mls); + +size_t ZSTD_compressBlock_btlazy2(ZSTD_CCtx* ctx, const void* src, size_t srcSize); +size_t ZSTD_compressBlock_lazy2(ZSTD_CCtx* ctx, const void* src, size_t srcSize); +size_t ZSTD_compressBlock_lazy(ZSTD_CCtx* ctx, const void* src, size_t srcSize); +size_t ZSTD_compressBlock_greedy(ZSTD_CCtx* ctx, const void* src, size_t srcSize); + +size_t ZSTD_compressBlock_greedy_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize); +size_t ZSTD_compressBlock_lazy_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize); +size_t ZSTD_compressBlock_lazy2_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize); +size_t ZSTD_compressBlock_btlazy2_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize); + +#if defined (__cplusplus) +} +#endif + +#endif /* ZSTD_LAZY_H */ diff --git a/sys/contrib/zstd/lib/compress/zstd_ldm.c b/sys/contrib/zstd/lib/compress/zstd_ldm.c new file mode 100644 index 000000000000..be50872cf767 --- /dev/null +++ b/sys/contrib/zstd/lib/compress/zstd_ldm.c @@ -0,0 +1,707 @@ +/* + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + */ + +#include "zstd_ldm.h" + +#include "zstd_fast.h" /* ZSTD_fillHashTable() */ +#include "zstd_double_fast.h" /* ZSTD_fillDoubleHashTable() */ + +#define LDM_BUCKET_SIZE_LOG 3 +#define LDM_MIN_MATCH_LENGTH 64 +#define LDM_HASH_RLOG 7 +#define LDM_HASH_CHAR_OFFSET 10 + +size_t ZSTD_ldm_initializeParameters(ldmParams_t* params, U32 enableLdm) +{ + ZSTD_STATIC_ASSERT(LDM_BUCKET_SIZE_LOG <= ZSTD_LDM_BUCKETSIZELOG_MAX); + params->enableLdm = enableLdm>0; + params->hashLog = 0; + params->bucketSizeLog = LDM_BUCKET_SIZE_LOG; + params->minMatchLength = LDM_MIN_MATCH_LENGTH; + params->hashEveryLog = ZSTD_LDM_HASHEVERYLOG_NOTSET; + return 0; +} + +void ZSTD_ldm_adjustParameters(ldmParams_t* params, U32 windowLog) +{ + if (params->hashLog == 0) { + params->hashLog = MAX(ZSTD_HASHLOG_MIN, windowLog - LDM_HASH_RLOG); + assert(params->hashLog <= ZSTD_HASHLOG_MAX); + } + if (params->hashEveryLog == ZSTD_LDM_HASHEVERYLOG_NOTSET) { + params->hashEveryLog = + windowLog < params->hashLog ? 0 : windowLog - params->hashLog; + } + params->bucketSizeLog = MIN(params->bucketSizeLog, params->hashLog); +} + +size_t ZSTD_ldm_getTableSize(U32 hashLog, U32 bucketSizeLog) { + size_t const ldmHSize = ((size_t)1) << hashLog; + size_t const ldmBucketSizeLog = MIN(bucketSizeLog, hashLog); + size_t const ldmBucketSize = + ((size_t)1) << (hashLog - ldmBucketSizeLog); + return ldmBucketSize + (ldmHSize * (sizeof(ldmEntry_t))); +} + +/** ZSTD_ldm_getSmallHash() : + * numBits should be <= 32 + * If numBits==0, returns 0. + * @return : the most significant numBits of value. */ +static U32 ZSTD_ldm_getSmallHash(U64 value, U32 numBits) +{ + assert(numBits <= 32); + return numBits == 0 ? 0 : (U32)(value >> (64 - numBits)); +} + +/** ZSTD_ldm_getChecksum() : + * numBitsToDiscard should be <= 32 + * @return : the next most significant 32 bits after numBitsToDiscard */ +static U32 ZSTD_ldm_getChecksum(U64 hash, U32 numBitsToDiscard) +{ + assert(numBitsToDiscard <= 32); + return (hash >> (64 - 32 - numBitsToDiscard)) & 0xFFFFFFFF; +} + +/** ZSTD_ldm_getTag() ; + * Given the hash, returns the most significant numTagBits bits + * after (32 + hbits) bits. + * + * If there are not enough bits remaining, return the last + * numTagBits bits. */ +static U32 ZSTD_ldm_getTag(U64 hash, U32 hbits, U32 numTagBits) +{ + assert(numTagBits < 32 && hbits <= 32); + if (32 - hbits < numTagBits) { + return hash & (((U32)1 << numTagBits) - 1); + } else { + return (hash >> (32 - hbits - numTagBits)) & (((U32)1 << numTagBits) - 1); + } +} + +/** ZSTD_ldm_getBucket() : + * Returns a pointer to the start of the bucket associated with hash. */ +static ldmEntry_t* ZSTD_ldm_getBucket( + ldmState_t* ldmState, size_t hash, ldmParams_t const ldmParams) +{ + return ldmState->hashTable + (hash << ldmParams.bucketSizeLog); +} + +/** ZSTD_ldm_insertEntry() : + * Insert the entry with corresponding hash into the hash table */ +static void ZSTD_ldm_insertEntry(ldmState_t* ldmState, + size_t const hash, const ldmEntry_t entry, + ldmParams_t const ldmParams) +{ + BYTE* const bucketOffsets = ldmState->bucketOffsets; + *(ZSTD_ldm_getBucket(ldmState, hash, ldmParams) + bucketOffsets[hash]) = entry; + bucketOffsets[hash]++; + bucketOffsets[hash] &= ((U32)1 << ldmParams.bucketSizeLog) - 1; +} + +/** ZSTD_ldm_makeEntryAndInsertByTag() : + * + * Gets the small hash, checksum, and tag from the rollingHash. + * + * If the tag matches (1 << ldmParams.hashEveryLog)-1, then + * creates an ldmEntry from the offset, and inserts it into the hash table. + * + * hBits is the length of the small hash, which is the most significant hBits + * of rollingHash. The checksum is the next 32 most significant bits, followed + * by ldmParams.hashEveryLog bits that make up the tag. */ +static void ZSTD_ldm_makeEntryAndInsertByTag(ldmState_t* ldmState, + U64 const rollingHash, + U32 const hBits, + U32 const offset, + ldmParams_t const ldmParams) +{ + U32 const tag = ZSTD_ldm_getTag(rollingHash, hBits, ldmParams.hashEveryLog); + U32 const tagMask = ((U32)1 << ldmParams.hashEveryLog) - 1; + if (tag == tagMask) { + U32 const hash = ZSTD_ldm_getSmallHash(rollingHash, hBits); + U32 const checksum = ZSTD_ldm_getChecksum(rollingHash, hBits); + ldmEntry_t entry; + entry.offset = offset; + entry.checksum = checksum; + ZSTD_ldm_insertEntry(ldmState, hash, entry, ldmParams); + } +} + +/** ZSTD_ldm_getRollingHash() : + * Get a 64-bit hash using the first len bytes from buf. + * + * Giving bytes s = s_1, s_2, ... s_k, the hash is defined to be + * H(s) = s_1*(a^(k-1)) + s_2*(a^(k-2)) + ... + s_k*(a^0) + * + * where the constant a is defined to be prime8bytes. + * + * The implementation adds an offset to each byte, so + * H(s) = (s_1 + HASH_CHAR_OFFSET)*(a^(k-1)) + ... */ +static U64 ZSTD_ldm_getRollingHash(const BYTE* buf, U32 len) +{ + U64 ret = 0; + U32 i; + for (i = 0; i < len; i++) { + ret *= prime8bytes; + ret += buf[i] + LDM_HASH_CHAR_OFFSET; + } + return ret; +} + +/** ZSTD_ldm_ipow() : + * Return base^exp. */ +static U64 ZSTD_ldm_ipow(U64 base, U64 exp) +{ + U64 ret = 1; + while (exp) { + if (exp & 1) { ret *= base; } + exp >>= 1; + base *= base; + } + return ret; +} + +U64 ZSTD_ldm_getHashPower(U32 minMatchLength) { + assert(minMatchLength >= ZSTD_LDM_MINMATCH_MIN); + return ZSTD_ldm_ipow(prime8bytes, minMatchLength - 1); +} + +/** ZSTD_ldm_updateHash() : + * Updates hash by removing toRemove and adding toAdd. */ +static U64 ZSTD_ldm_updateHash(U64 hash, BYTE toRemove, BYTE toAdd, U64 hashPower) +{ + hash -= ((toRemove + LDM_HASH_CHAR_OFFSET) * hashPower); + hash *= prime8bytes; + hash += toAdd + LDM_HASH_CHAR_OFFSET; + return hash; +} + +/** ZSTD_ldm_countBackwardsMatch() : + * Returns the number of bytes that match backwards before pIn and pMatch. + * + * We count only bytes where pMatch >= pBase and pIn >= pAnchor. */ +static size_t ZSTD_ldm_countBackwardsMatch( + const BYTE* pIn, const BYTE* pAnchor, + const BYTE* pMatch, const BYTE* pBase) +{ + size_t matchLength = 0; + while (pIn > pAnchor && pMatch > pBase && pIn[-1] == pMatch[-1]) { + pIn--; + pMatch--; + matchLength++; + } + return matchLength; +} + +/** ZSTD_ldm_fillFastTables() : + * + * Fills the relevant tables for the ZSTD_fast and ZSTD_dfast strategies. + * This is similar to ZSTD_loadDictionaryContent. + * + * The tables for the other strategies are filled within their + * block compressors. */ +static size_t ZSTD_ldm_fillFastTables(ZSTD_CCtx* zc, const void* end) +{ + const BYTE* const iend = (const BYTE*)end; + const U32 mls = zc->appliedParams.cParams.searchLength; + + switch(zc->appliedParams.cParams.strategy) + { + case ZSTD_fast: + ZSTD_fillHashTable(zc, iend, mls); + zc->nextToUpdate = (U32)(iend - zc->base); + break; + + case ZSTD_dfast: + ZSTD_fillDoubleHashTable(zc, iend, mls); + zc->nextToUpdate = (U32)(iend - zc->base); + break; + + case ZSTD_greedy: + case ZSTD_lazy: + case ZSTD_lazy2: + case ZSTD_btlazy2: + case ZSTD_btopt: + case ZSTD_btultra: + break; + default: + assert(0); /* not possible : not a valid strategy id */ + } + + return 0; +} + +/** ZSTD_ldm_fillLdmHashTable() : + * + * Fills hashTable from (lastHashed + 1) to iend (non-inclusive). + * lastHash is the rolling hash that corresponds to lastHashed. + * + * Returns the rolling hash corresponding to position iend-1. */ +static U64 ZSTD_ldm_fillLdmHashTable(ldmState_t* state, + U64 lastHash, const BYTE* lastHashed, + const BYTE* iend, const BYTE* base, + U32 hBits, ldmParams_t const ldmParams) +{ + U64 rollingHash = lastHash; + const BYTE* cur = lastHashed + 1; + + while (cur < iend) { + rollingHash = ZSTD_ldm_updateHash(rollingHash, cur[-1], + cur[ldmParams.minMatchLength-1], + state->hashPower); + ZSTD_ldm_makeEntryAndInsertByTag(state, + rollingHash, hBits, + (U32)(cur - base), ldmParams); + ++cur; + } + return rollingHash; +} + + +/** ZSTD_ldm_limitTableUpdate() : + * + * Sets cctx->nextToUpdate to a position corresponding closer to anchor + * if it is far way + * (after a long match, only update tables a limited amount). */ +static void ZSTD_ldm_limitTableUpdate(ZSTD_CCtx* cctx, const BYTE* anchor) +{ + U32 const current = (U32)(anchor - cctx->base); + if (current > cctx->nextToUpdate + 1024) { + cctx->nextToUpdate = + current - MIN(512, current - cctx->nextToUpdate - 1024); + } +} + +typedef size_t (*ZSTD_blockCompressor) (ZSTD_CCtx* ctx, const void* src, size_t srcSize); +/* defined in zstd_compress.c */ +ZSTD_blockCompressor ZSTD_selectBlockCompressor(ZSTD_strategy strat, int extDict); + +FORCE_INLINE_TEMPLATE +size_t ZSTD_compressBlock_ldm_generic(ZSTD_CCtx* cctx, + const void* src, size_t srcSize) +{ + ldmState_t* const ldmState = &(cctx->ldmState); + const ldmParams_t ldmParams = cctx->appliedParams.ldmParams; + const U64 hashPower = ldmState->hashPower; + const U32 hBits = ldmParams.hashLog - ldmParams.bucketSizeLog; + const U32 ldmBucketSize = ((U32)1 << ldmParams.bucketSizeLog); + const U32 ldmTagMask = ((U32)1 << ldmParams.hashEveryLog) - 1; + seqStore_t* const seqStorePtr = &(cctx->seqStore); + const BYTE* const base = cctx->base; + const BYTE* const istart = (const BYTE*)src; + const BYTE* ip = istart; + const BYTE* anchor = istart; + const U32 lowestIndex = cctx->dictLimit; + const BYTE* const lowest = base + lowestIndex; + const BYTE* const iend = istart + srcSize; + const BYTE* const ilimit = iend - MAX(ldmParams.minMatchLength, HASH_READ_SIZE); + + const ZSTD_blockCompressor blockCompressor = + ZSTD_selectBlockCompressor(cctx->appliedParams.cParams.strategy, 0); + U32* const repToConfirm = seqStorePtr->repToConfirm; + U32 savedRep[ZSTD_REP_NUM]; + U64 rollingHash = 0; + const BYTE* lastHashed = NULL; + size_t i, lastLiterals; + + /* Save seqStorePtr->rep and copy repToConfirm */ + for (i = 0; i < ZSTD_REP_NUM; i++) + savedRep[i] = repToConfirm[i] = seqStorePtr->rep[i]; + + /* Main Search Loop */ + while (ip < ilimit) { /* < instead of <=, because repcode check at (ip+1) */ + size_t mLength; + U32 const current = (U32)(ip - base); + size_t forwardMatchLength = 0, backwardMatchLength = 0; + ldmEntry_t* bestEntry = NULL; + if (ip != istart) { + rollingHash = ZSTD_ldm_updateHash(rollingHash, lastHashed[0], + lastHashed[ldmParams.minMatchLength], + hashPower); + } else { + rollingHash = ZSTD_ldm_getRollingHash(ip, ldmParams.minMatchLength); + } + lastHashed = ip; + + /* Do not insert and do not look for a match */ + if (ZSTD_ldm_getTag(rollingHash, hBits, ldmParams.hashEveryLog) != + ldmTagMask) { + ip++; + continue; + } + + /* Get the best entry and compute the match lengths */ + { + ldmEntry_t* const bucket = + ZSTD_ldm_getBucket(ldmState, + ZSTD_ldm_getSmallHash(rollingHash, hBits), + ldmParams); + ldmEntry_t* cur; + size_t bestMatchLength = 0; + U32 const checksum = ZSTD_ldm_getChecksum(rollingHash, hBits); + + for (cur = bucket; cur < bucket + ldmBucketSize; ++cur) { + const BYTE* const pMatch = cur->offset + base; + size_t curForwardMatchLength, curBackwardMatchLength, + curTotalMatchLength; + if (cur->checksum != checksum || cur->offset <= lowestIndex) { + continue; + } + + curForwardMatchLength = ZSTD_count(ip, pMatch, iend); + if (curForwardMatchLength < ldmParams.minMatchLength) { + continue; + } + curBackwardMatchLength = ZSTD_ldm_countBackwardsMatch( + ip, anchor, pMatch, lowest); + curTotalMatchLength = curForwardMatchLength + + curBackwardMatchLength; + + if (curTotalMatchLength > bestMatchLength) { + bestMatchLength = curTotalMatchLength; + forwardMatchLength = curForwardMatchLength; + backwardMatchLength = curBackwardMatchLength; + bestEntry = cur; + } + } + } + + /* No match found -- continue searching */ + if (bestEntry == NULL) { + ZSTD_ldm_makeEntryAndInsertByTag(ldmState, rollingHash, + hBits, current, + ldmParams); + ip++; + continue; + } + + /* Match found */ + mLength = forwardMatchLength + backwardMatchLength; + ip -= backwardMatchLength; + + /* Call the block compressor on the remaining literals */ + { + U32 const matchIndex = bestEntry->offset; + const BYTE* const match = base + matchIndex - backwardMatchLength; + U32 const offset = (U32)(ip - match); + + /* Overwrite rep codes */ + for (i = 0; i < ZSTD_REP_NUM; i++) + seqStorePtr->rep[i] = repToConfirm[i]; + + /* Fill tables for block compressor */ + ZSTD_ldm_limitTableUpdate(cctx, anchor); + ZSTD_ldm_fillFastTables(cctx, anchor); + + /* Call block compressor and get remaining literals */ + lastLiterals = blockCompressor(cctx, anchor, ip - anchor); + cctx->nextToUpdate = (U32)(ip - base); + + /* Update repToConfirm with the new offset */ + for (i = ZSTD_REP_NUM - 1; i > 0; i--) + repToConfirm[i] = repToConfirm[i-1]; + repToConfirm[0] = offset; + + /* Store the sequence with the leftover literals */ + ZSTD_storeSeq(seqStorePtr, lastLiterals, ip - lastLiterals, + offset + ZSTD_REP_MOVE, mLength - MINMATCH); + } + + /* Insert the current entry into the hash table */ + ZSTD_ldm_makeEntryAndInsertByTag(ldmState, rollingHash, hBits, + (U32)(lastHashed - base), + ldmParams); + + assert(ip + backwardMatchLength == lastHashed); + + /* Fill the hash table from lastHashed+1 to ip+mLength*/ + /* Heuristic: don't need to fill the entire table at end of block */ + if (ip + mLength < ilimit) { + rollingHash = ZSTD_ldm_fillLdmHashTable( + ldmState, rollingHash, lastHashed, + ip + mLength, base, hBits, ldmParams); + lastHashed = ip + mLength - 1; + } + ip += mLength; + anchor = ip; + /* Check immediate repcode */ + while ( (ip < ilimit) + && ( (repToConfirm[1] > 0) && (repToConfirm[1] <= (U32)(ip-lowest)) + && (MEM_read32(ip) == MEM_read32(ip - repToConfirm[1])) )) { + + size_t const rLength = ZSTD_count(ip+4, ip+4-repToConfirm[1], + iend) + 4; + /* Swap repToConfirm[1] <=> repToConfirm[0] */ + { + U32 const tmpOff = repToConfirm[1]; + repToConfirm[1] = repToConfirm[0]; + repToConfirm[0] = tmpOff; + } + + ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, rLength-MINMATCH); + + /* Fill the hash table from lastHashed+1 to ip+rLength*/ + if (ip + rLength < ilimit) { + rollingHash = ZSTD_ldm_fillLdmHashTable( + ldmState, rollingHash, lastHashed, + ip + rLength, base, hBits, ldmParams); + lastHashed = ip + rLength - 1; + } + ip += rLength; + anchor = ip; + } + } + + /* Overwrite rep */ + for (i = 0; i < ZSTD_REP_NUM; i++) + seqStorePtr->rep[i] = repToConfirm[i]; + + ZSTD_ldm_limitTableUpdate(cctx, anchor); + ZSTD_ldm_fillFastTables(cctx, anchor); + + lastLiterals = blockCompressor(cctx, anchor, iend - anchor); + cctx->nextToUpdate = (U32)(iend - base); + + /* Restore seqStorePtr->rep */ + for (i = 0; i < ZSTD_REP_NUM; i++) + seqStorePtr->rep[i] = savedRep[i]; + + /* Return the last literals size */ + return lastLiterals; +} + +size_t ZSTD_compressBlock_ldm(ZSTD_CCtx* ctx, + const void* src, size_t srcSize) +{ + return ZSTD_compressBlock_ldm_generic(ctx, src, srcSize); +} + +static size_t ZSTD_compressBlock_ldm_extDict_generic( + ZSTD_CCtx* ctx, + const void* src, size_t srcSize) +{ + ldmState_t* const ldmState = &(ctx->ldmState); + const ldmParams_t ldmParams = ctx->appliedParams.ldmParams; + const U64 hashPower = ldmState->hashPower; + const U32 hBits = ldmParams.hashLog - ldmParams.bucketSizeLog; + const U32 ldmBucketSize = ((U32)1 << ldmParams.bucketSizeLog); + const U32 ldmTagMask = ((U32)1 << ldmParams.hashEveryLog) - 1; + seqStore_t* const seqStorePtr = &(ctx->seqStore); + const BYTE* const base = ctx->base; + const BYTE* const dictBase = ctx->dictBase; + const BYTE* const istart = (const BYTE*)src; + const BYTE* ip = istart; + const BYTE* anchor = istart; + const U32 lowestIndex = ctx->lowLimit; + const BYTE* const dictStart = dictBase + lowestIndex; + const U32 dictLimit = ctx->dictLimit; + const BYTE* const lowPrefixPtr = base + dictLimit; + const BYTE* const dictEnd = dictBase + dictLimit; + const BYTE* const iend = istart + srcSize; + const BYTE* const ilimit = iend - MAX(ldmParams.minMatchLength, HASH_READ_SIZE); + + const ZSTD_blockCompressor blockCompressor = + ZSTD_selectBlockCompressor(ctx->appliedParams.cParams.strategy, 1); + U32* const repToConfirm = seqStorePtr->repToConfirm; + U32 savedRep[ZSTD_REP_NUM]; + U64 rollingHash = 0; + const BYTE* lastHashed = NULL; + size_t i, lastLiterals; + + /* Save seqStorePtr->rep and copy repToConfirm */ + for (i = 0; i < ZSTD_REP_NUM; i++) { + savedRep[i] = repToConfirm[i] = seqStorePtr->rep[i]; + } + + /* Search Loop */ + while (ip < ilimit) { /* < instead of <=, because (ip+1) */ + size_t mLength; + const U32 current = (U32)(ip-base); + size_t forwardMatchLength = 0, backwardMatchLength = 0; + ldmEntry_t* bestEntry = NULL; + if (ip != istart) { + rollingHash = ZSTD_ldm_updateHash(rollingHash, lastHashed[0], + lastHashed[ldmParams.minMatchLength], + hashPower); + } else { + rollingHash = ZSTD_ldm_getRollingHash(ip, ldmParams.minMatchLength); + } + lastHashed = ip; + + if (ZSTD_ldm_getTag(rollingHash, hBits, ldmParams.hashEveryLog) != + ldmTagMask) { + /* Don't insert and don't look for a match */ + ip++; + continue; + } + + /* Get the best entry and compute the match lengths */ + { + ldmEntry_t* const bucket = + ZSTD_ldm_getBucket(ldmState, + ZSTD_ldm_getSmallHash(rollingHash, hBits), + ldmParams); + ldmEntry_t* cur; + size_t bestMatchLength = 0; + U32 const checksum = ZSTD_ldm_getChecksum(rollingHash, hBits); + + for (cur = bucket; cur < bucket + ldmBucketSize; ++cur) { + const BYTE* const curMatchBase = + cur->offset < dictLimit ? dictBase : base; + const BYTE* const pMatch = curMatchBase + cur->offset; + const BYTE* const matchEnd = + cur->offset < dictLimit ? dictEnd : iend; + const BYTE* const lowMatchPtr = + cur->offset < dictLimit ? dictStart : lowPrefixPtr; + size_t curForwardMatchLength, curBackwardMatchLength, + curTotalMatchLength; + + if (cur->checksum != checksum || cur->offset <= lowestIndex) { + continue; + } + + curForwardMatchLength = ZSTD_count_2segments( + ip, pMatch, iend, + matchEnd, lowPrefixPtr); + if (curForwardMatchLength < ldmParams.minMatchLength) { + continue; + } + curBackwardMatchLength = ZSTD_ldm_countBackwardsMatch( + ip, anchor, pMatch, lowMatchPtr); + curTotalMatchLength = curForwardMatchLength + + curBackwardMatchLength; + + if (curTotalMatchLength > bestMatchLength) { + bestMatchLength = curTotalMatchLength; + forwardMatchLength = curForwardMatchLength; + backwardMatchLength = curBackwardMatchLength; + bestEntry = cur; + } + } + } + + /* No match found -- continue searching */ + if (bestEntry == NULL) { + ZSTD_ldm_makeEntryAndInsertByTag(ldmState, rollingHash, hBits, + (U32)(lastHashed - base), + ldmParams); + ip++; + continue; + } + + /* Match found */ + mLength = forwardMatchLength + backwardMatchLength; + ip -= backwardMatchLength; + + /* Call the block compressor on the remaining literals */ + { + /* ip = current - backwardMatchLength + * The match is at (bestEntry->offset - backwardMatchLength) */ + U32 const matchIndex = bestEntry->offset; + U32 const offset = current - matchIndex; + + /* Overwrite rep codes */ + for (i = 0; i < ZSTD_REP_NUM; i++) + seqStorePtr->rep[i] = repToConfirm[i]; + + /* Fill the hash table for the block compressor */ + ZSTD_ldm_limitTableUpdate(ctx, anchor); + ZSTD_ldm_fillFastTables(ctx, anchor); + + /* Call block compressor and get remaining literals */ + lastLiterals = blockCompressor(ctx, anchor, ip - anchor); + ctx->nextToUpdate = (U32)(ip - base); + + /* Update repToConfirm with the new offset */ + for (i = ZSTD_REP_NUM - 1; i > 0; i--) + repToConfirm[i] = repToConfirm[i-1]; + repToConfirm[0] = offset; + + /* Store the sequence with the leftover literals */ + ZSTD_storeSeq(seqStorePtr, lastLiterals, ip - lastLiterals, + offset + ZSTD_REP_MOVE, mLength - MINMATCH); + } + + /* Insert the current entry into the hash table */ + ZSTD_ldm_makeEntryAndInsertByTag(ldmState, rollingHash, hBits, + (U32)(lastHashed - base), + ldmParams); + + /* Fill the hash table from lastHashed+1 to ip+mLength */ + assert(ip + backwardMatchLength == lastHashed); + if (ip + mLength < ilimit) { + rollingHash = ZSTD_ldm_fillLdmHashTable( + ldmState, rollingHash, lastHashed, + ip + mLength, base, hBits, + ldmParams); + lastHashed = ip + mLength - 1; + } + ip += mLength; + anchor = ip; + + /* check immediate repcode */ + while (ip < ilimit) { + U32 const current2 = (U32)(ip-base); + U32 const repIndex2 = current2 - repToConfirm[1]; + const BYTE* repMatch2 = repIndex2 < dictLimit ? + dictBase + repIndex2 : base + repIndex2; + if ( (((U32)((dictLimit-1) - repIndex2) >= 3) & + (repIndex2 > lowestIndex)) /* intentional overflow */ + && (MEM_read32(repMatch2) == MEM_read32(ip)) ) { + const BYTE* const repEnd2 = repIndex2 < dictLimit ? + dictEnd : iend; + size_t const repLength2 = + ZSTD_count_2segments(ip+4, repMatch2+4, iend, + repEnd2, lowPrefixPtr) + 4; + + U32 tmpOffset = repToConfirm[1]; + repToConfirm[1] = repToConfirm[0]; + repToConfirm[0] = tmpOffset; + + ZSTD_storeSeq(seqStorePtr, 0, anchor, 0, repLength2-MINMATCH); + + /* Fill the hash table from lastHashed+1 to ip+repLength2*/ + if (ip + repLength2 < ilimit) { + rollingHash = ZSTD_ldm_fillLdmHashTable( + ldmState, rollingHash, lastHashed, + ip + repLength2, base, hBits, + ldmParams); + lastHashed = ip + repLength2 - 1; + } + ip += repLength2; + anchor = ip; + continue; + } + break; + } + } + + /* Overwrite rep */ + for (i = 0; i < ZSTD_REP_NUM; i++) + seqStorePtr->rep[i] = repToConfirm[i]; + + ZSTD_ldm_limitTableUpdate(ctx, anchor); + ZSTD_ldm_fillFastTables(ctx, anchor); + + /* Call the block compressor one last time on the last literals */ + lastLiterals = blockCompressor(ctx, anchor, iend - anchor); + ctx->nextToUpdate = (U32)(iend - base); + + /* Restore seqStorePtr->rep */ + for (i = 0; i < ZSTD_REP_NUM; i++) + seqStorePtr->rep[i] = savedRep[i]; + + /* Return the last literals size */ + return lastLiterals; +} + +size_t ZSTD_compressBlock_ldm_extDict(ZSTD_CCtx* ctx, + const void* src, size_t srcSize) +{ + return ZSTD_compressBlock_ldm_extDict_generic(ctx, src, srcSize); +} diff --git a/sys/contrib/zstd/lib/compress/zstd_ldm.h b/sys/contrib/zstd/lib/compress/zstd_ldm.h new file mode 100644 index 000000000000..d6d3d42c337f --- /dev/null +++ b/sys/contrib/zstd/lib/compress/zstd_ldm.h @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + */ + +#ifndef ZSTD_LDM_H +#define ZSTD_LDM_H + +#include "zstd_compress.h" + +#if defined (__cplusplus) +extern "C" { +#endif + +/*-************************************* +* Long distance matching +***************************************/ + +#define ZSTD_LDM_DEFAULT_WINDOW_LOG ZSTD_WINDOWLOG_DEFAULTMAX +#define ZSTD_LDM_HASHEVERYLOG_NOTSET 9999 + +/** ZSTD_compressBlock_ldm_generic() : + * + * This is a block compressor intended for long distance matching. + * + * The function searches for matches of length at least + * ldmParams.minMatchLength using a hash table in cctx->ldmState. + * Matches can be at a distance of up to cParams.windowLog. + * + * Upon finding a match, the unmatched literals are compressed using a + * ZSTD_blockCompressor (depending on the strategy in the compression + * parameters), which stores the matched sequences. The "long distance" + * match is then stored with the remaining literals from the + * ZSTD_blockCompressor. */ +size_t ZSTD_compressBlock_ldm(ZSTD_CCtx* cctx, const void* src, size_t srcSize); +size_t ZSTD_compressBlock_ldm_extDict(ZSTD_CCtx* ctx, + const void* src, size_t srcSize); + +/** ZSTD_ldm_initializeParameters() : + * Initialize the long distance matching parameters to their default values. */ +size_t ZSTD_ldm_initializeParameters(ldmParams_t* params, U32 enableLdm); + +/** ZSTD_ldm_getTableSize() : + * Estimate the space needed for long distance matching tables. */ +size_t ZSTD_ldm_getTableSize(U32 hashLog, U32 bucketSizeLog); + +/** ZSTD_ldm_getTableSize() : + * Return prime8bytes^(minMatchLength-1) */ +U64 ZSTD_ldm_getHashPower(U32 minMatchLength); + +/** ZSTD_ldm_adjustParameters() : + * If the params->hashEveryLog is not set, set it to its default value based on + * windowLog and params->hashLog. + * + * Ensures that params->bucketSizeLog is <= params->hashLog (setting it to + * params->hashLog if it is not). */ +void ZSTD_ldm_adjustParameters(ldmParams_t* params, U32 windowLog); + +#if defined (__cplusplus) +} +#endif + +#endif /* ZSTD_FAST_H */ diff --git a/contrib/zstd/lib/compress/zstd_opt.h b/sys/contrib/zstd/lib/compress/zstd_opt.c similarity index 95% rename from contrib/zstd/lib/compress/zstd_opt.h rename to sys/contrib/zstd/lib/compress/zstd_opt.c index ae24732c7d84..c47ce23ad535 100644 --- a/contrib/zstd/lib/compress/zstd_opt.h +++ b/sys/contrib/zstd/lib/compress/zstd_opt.c @@ -1,18 +1,15 @@ /* - * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * Copyright (c) 2016-present, Przemyslaw Skibinski, Yann Collet, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ - -/* Note : this file is intended to be included within zstd_compress.c */ - - -#ifndef ZSTD_OPT_H_91842398743 -#define ZSTD_OPT_H_91842398743 +#include "zstd_opt.h" +#include "zstd_lazy.h" #define ZSTD_LITFREQ_ADD 2 @@ -413,8 +410,8 @@ static U32 ZSTD_BtGetAllMatches_selectMLS_extDict ( * Optimal parser *********************************/ FORCE_INLINE_TEMPLATE -void ZSTD_compressBlock_opt_generic(ZSTD_CCtx* ctx, - const void* src, size_t srcSize, const int ultra) +size_t ZSTD_compressBlock_opt_generic(ZSTD_CCtx* ctx, + const void* src, size_t srcSize, const int ultra) { seqStore_t* seqStorePtr = &(ctx->seqStore); optState_t* optStatePtr = &(ctx->optState); @@ -532,7 +529,14 @@ void ZSTD_compressBlock_opt_generic(ZSTD_CCtx* ctx, } else { opt[cur].rep[2] = (opt[cur].off > 1) ? opt[cur-mlen].rep[1] : opt[cur-mlen].rep[2]; opt[cur].rep[1] = (opt[cur].off > 0) ? opt[cur-mlen].rep[0] : opt[cur-mlen].rep[1]; - opt[cur].rep[0] = ((opt[cur].off==ZSTD_REP_MOVE_OPT) && (mlen != 1)) ? (opt[cur-mlen].rep[0] - 1) : (opt[cur-mlen].rep[opt[cur].off]); + /* If opt[cur].off == ZSTD_REP_MOVE_OPT, then mlen != 1. + * offset ZSTD_REP_MOVE_OPT is used for the special case + * litLength == 0, where offset 0 means something special. + * mlen == 1 means the previous byte was stored as a literal, + * so they are mutually exclusive. + */ + assert(!(opt[cur].off == ZSTD_REP_MOVE_OPT && mlen == 1)); + opt[cur].rep[0] = (opt[cur].off == ZSTD_REP_MOVE_OPT) ? (opt[cur-mlen].rep[0] - 1) : (opt[cur-mlen].rep[opt[cur].off]); } best_mlen = minMatch; @@ -654,16 +658,24 @@ void ZSTD_compressBlock_opt_generic(ZSTD_CCtx* ctx, /* Save reps for next block */ { int i; for (i=0; irepToConfirm[i] = rep[i]; } - /* Last Literals */ - { size_t const lastLLSize = iend - anchor; - memcpy(seqStorePtr->lit, anchor, lastLLSize); - seqStorePtr->lit += lastLLSize; - } + /* Return the last literals size */ + return iend - anchor; +} + + +size_t ZSTD_compressBlock_btopt(ZSTD_CCtx* ctx, const void* src, size_t srcSize) +{ + return ZSTD_compressBlock_opt_generic(ctx, src, srcSize, 0); +} + +size_t ZSTD_compressBlock_btultra(ZSTD_CCtx* ctx, const void* src, size_t srcSize) +{ + return ZSTD_compressBlock_opt_generic(ctx, src, srcSize, 1); } FORCE_INLINE_TEMPLATE -void ZSTD_compressBlock_opt_extDict_generic(ZSTD_CCtx* ctx, +size_t ZSTD_compressBlock_opt_extDict_generic(ZSTD_CCtx* ctx, const void* src, size_t srcSize, const int ultra) { seqStore_t* seqStorePtr = &(ctx->seqStore); @@ -799,7 +811,8 @@ void ZSTD_compressBlock_opt_extDict_generic(ZSTD_CCtx* ctx, } else { opt[cur].rep[2] = (opt[cur].off > 1) ? opt[cur-mlen].rep[1] : opt[cur-mlen].rep[2]; opt[cur].rep[1] = (opt[cur].off > 0) ? opt[cur-mlen].rep[0] : opt[cur-mlen].rep[1]; - opt[cur].rep[0] = ((opt[cur].off==ZSTD_REP_MOVE_OPT) && (mlen != 1)) ? (opt[cur-mlen].rep[0] - 1) : (opt[cur-mlen].rep[opt[cur].off]); + assert(!(opt[cur].off == ZSTD_REP_MOVE_OPT && mlen == 1)); + opt[cur].rep[0] = (opt[cur].off == ZSTD_REP_MOVE_OPT) ? (opt[cur-mlen].rep[0] - 1) : (opt[cur-mlen].rep[opt[cur].off]); } best_mlen = minMatch; @@ -928,11 +941,17 @@ void ZSTD_compressBlock_opt_extDict_generic(ZSTD_CCtx* ctx, /* Save reps for next block */ { int i; for (i=0; irepToConfirm[i] = rep[i]; } - /* Last Literals */ - { size_t lastLLSize = iend - anchor; - memcpy(seqStorePtr->lit, anchor, lastLLSize); - seqStorePtr->lit += lastLLSize; - } + /* Return the last literals size */ + return iend - anchor; } -#endif /* ZSTD_OPT_H_91842398743 */ + +size_t ZSTD_compressBlock_btopt_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize) +{ + return ZSTD_compressBlock_opt_extDict_generic(ctx, src, srcSize, 0); +} + +size_t ZSTD_compressBlock_btultra_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize) +{ + return ZSTD_compressBlock_opt_extDict_generic(ctx, src, srcSize, 1); +} diff --git a/sys/contrib/zstd/lib/compress/zstd_opt.h b/sys/contrib/zstd/lib/compress/zstd_opt.h new file mode 100644 index 000000000000..816a1fabbf16 --- /dev/null +++ b/sys/contrib/zstd/lib/compress/zstd_opt.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#ifndef ZSTD_OPT_H +#define ZSTD_OPT_H + +#include "zstd_compress.h" + +#if defined (__cplusplus) +extern "C" { +#endif + +size_t ZSTD_compressBlock_btopt(ZSTD_CCtx* ctx, const void* src, size_t srcSize); +size_t ZSTD_compressBlock_btultra(ZSTD_CCtx* ctx, const void* src, size_t srcSize); + +size_t ZSTD_compressBlock_btopt_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize); +size_t ZSTD_compressBlock_btultra_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize); + +#if defined (__cplusplus) +} +#endif + +#endif /* ZSTD_OPT_H */ diff --git a/contrib/zstd/lib/compress/zstdmt_compress.c b/sys/contrib/zstd/lib/compress/zstdmt_compress.c similarity index 78% rename from contrib/zstd/lib/compress/zstdmt_compress.c rename to sys/contrib/zstd/lib/compress/zstdmt_compress.c index 8564bc439214..7831cd3bd81a 100644 --- a/contrib/zstd/lib/compress/zstdmt_compress.c +++ b/sys/contrib/zstd/lib/compress/zstdmt_compress.c @@ -5,11 +5,12 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ /* ====== Tuning parameters ====== */ -#define ZSTDMT_NBTHREADS_MAX 256 +#define ZSTDMT_NBTHREADS_MAX 200 #define ZSTDMT_OVERLAPLOG_DEFAULT 6 @@ -52,22 +53,24 @@ static unsigned long long GetCurrentClockTimeMicroseconds(void) } #define MUTEX_WAIT_TIME_DLEVEL 6 -#define PTHREAD_MUTEX_LOCK(mutex) { \ - if (ZSTD_DEBUG>=MUTEX_WAIT_TIME_DLEVEL) { \ +#define ZSTD_PTHREAD_MUTEX_LOCK(mutex) { \ + if (ZSTD_DEBUG >= MUTEX_WAIT_TIME_DLEVEL) { \ unsigned long long const beforeTime = GetCurrentClockTimeMicroseconds(); \ - pthread_mutex_lock(mutex); \ + ZSTD_pthread_mutex_lock(mutex); \ { unsigned long long const afterTime = GetCurrentClockTimeMicroseconds(); \ unsigned long long const elapsedTime = (afterTime-beforeTime); \ if (elapsedTime > 1000) { /* or whatever threshold you like; I'm using 1 millisecond here */ \ DEBUGLOG(MUTEX_WAIT_TIME_DLEVEL, "Thread took %llu microseconds to acquire mutex %s \n", \ elapsedTime, #mutex); \ } } \ - } else pthread_mutex_lock(mutex); \ + } else { \ + ZSTD_pthread_mutex_lock(mutex); \ + } \ } #else -# define PTHREAD_MUTEX_LOCK(m) pthread_mutex_lock(m) +# define ZSTD_PTHREAD_MUTEX_LOCK(m) ZSTD_pthread_mutex_lock(m) # define DEBUG_PRINTHEX(l,p,n) {} #endif @@ -84,7 +87,7 @@ typedef struct buffer_s { static const buffer_t g_nullBuffer = { NULL, 0 }; typedef struct ZSTDMT_bufferPool_s { - pthread_mutex_t poolMutex; + ZSTD_pthread_mutex_t poolMutex; size_t bufferSize; unsigned totalBuffers; unsigned nbBuffers; @@ -98,7 +101,7 @@ static ZSTDMT_bufferPool* ZSTDMT_createBufferPool(unsigned nbThreads, ZSTD_custo ZSTDMT_bufferPool* const bufPool = (ZSTDMT_bufferPool*)ZSTD_calloc( sizeof(ZSTDMT_bufferPool) + (maxNbBuffers-1) * sizeof(buffer_t), cMem); if (bufPool==NULL) return NULL; - if (pthread_mutex_init(&bufPool->poolMutex, NULL)) { + if (ZSTD_pthread_mutex_init(&bufPool->poolMutex, NULL)) { ZSTD_free(bufPool, cMem); return NULL; } @@ -112,10 +115,13 @@ static ZSTDMT_bufferPool* ZSTDMT_createBufferPool(unsigned nbThreads, ZSTD_custo static void ZSTDMT_freeBufferPool(ZSTDMT_bufferPool* bufPool) { unsigned u; + DEBUGLOG(3, "ZSTDMT_freeBufferPool (address:%08X)", (U32)(size_t)bufPool); if (!bufPool) return; /* compatibility with free on NULL */ - for (u=0; utotalBuffers; u++) + for (u=0; utotalBuffers; u++) { + DEBUGLOG(4, "free buffer %2u (address:%08X)", u, (U32)(size_t)bufPool->bTable[u].start); ZSTD_free(bufPool->bTable[u].start, bufPool->cMem); - pthread_mutex_destroy(&bufPool->poolMutex); + } + ZSTD_pthread_mutex_destroy(&bufPool->poolMutex); ZSTD_free(bufPool, bufPool->cMem); } @@ -126,10 +132,10 @@ static size_t ZSTDMT_sizeof_bufferPool(ZSTDMT_bufferPool* bufPool) + (bufPool->totalBuffers - 1) * sizeof(buffer_t); unsigned u; size_t totalBufferSize = 0; - pthread_mutex_lock(&bufPool->poolMutex); + ZSTD_pthread_mutex_lock(&bufPool->poolMutex); for (u=0; utotalBuffers; u++) totalBufferSize += bufPool->bTable[u].size; - pthread_mutex_unlock(&bufPool->poolMutex); + ZSTD_pthread_mutex_unlock(&bufPool->poolMutex); return poolSize + totalBufferSize; } @@ -145,20 +151,21 @@ static buffer_t ZSTDMT_getBuffer(ZSTDMT_bufferPool* bufPool) { size_t const bSize = bufPool->bufferSize; DEBUGLOG(5, "ZSTDMT_getBuffer"); - pthread_mutex_lock(&bufPool->poolMutex); + ZSTD_pthread_mutex_lock(&bufPool->poolMutex); if (bufPool->nbBuffers) { /* try to use an existing buffer */ buffer_t const buf = bufPool->bTable[--(bufPool->nbBuffers)]; size_t const availBufferSize = buf.size; + bufPool->bTable[bufPool->nbBuffers] = g_nullBuffer; if ((availBufferSize >= bSize) & (availBufferSize <= 10*bSize)) { /* large enough, but not too much */ - pthread_mutex_unlock(&bufPool->poolMutex); + ZSTD_pthread_mutex_unlock(&bufPool->poolMutex); return buf; } /* size conditions not respected : scratch this buffer, create new one */ DEBUGLOG(5, "existing buffer does not meet size conditions => freeing"); ZSTD_free(buf.start, bufPool->cMem); } - pthread_mutex_unlock(&bufPool->poolMutex); + ZSTD_pthread_mutex_unlock(&bufPool->poolMutex); /* create new buffer */ DEBUGLOG(5, "create a new buffer"); { buffer_t buffer; @@ -174,24 +181,38 @@ static void ZSTDMT_releaseBuffer(ZSTDMT_bufferPool* bufPool, buffer_t buf) { if (buf.start == NULL) return; /* compatible with release on NULL */ DEBUGLOG(5, "ZSTDMT_releaseBuffer"); - pthread_mutex_lock(&bufPool->poolMutex); + ZSTD_pthread_mutex_lock(&bufPool->poolMutex); if (bufPool->nbBuffers < bufPool->totalBuffers) { bufPool->bTable[bufPool->nbBuffers++] = buf; /* stored for later use */ - pthread_mutex_unlock(&bufPool->poolMutex); + ZSTD_pthread_mutex_unlock(&bufPool->poolMutex); return; } - pthread_mutex_unlock(&bufPool->poolMutex); + ZSTD_pthread_mutex_unlock(&bufPool->poolMutex); /* Reached bufferPool capacity (should not happen) */ DEBUGLOG(5, "buffer pool capacity reached => freeing "); ZSTD_free(buf.start, bufPool->cMem); } +/* Sets parameters relevant to the compression job, initializing others to + * default values. Notably, nbThreads should probably be zero. */ +static ZSTD_CCtx_params ZSTDMT_makeJobCCtxParams(ZSTD_CCtx_params const params) +{ + ZSTD_CCtx_params jobParams; + memset(&jobParams, 0, sizeof(jobParams)); + + jobParams.cParams = params.cParams; + jobParams.fParams = params.fParams; + jobParams.compressionLevel = params.compressionLevel; + + jobParams.ldmParams = params.ldmParams; + return jobParams; +} /* ===== CCtx Pool ===== */ /* a single CCtx Pool can be invoked from multiple threads in parallel */ typedef struct { - pthread_mutex_t poolMutex; + ZSTD_pthread_mutex_t poolMutex; unsigned totalCCtx; unsigned availCCtx; ZSTD_customMem cMem; @@ -204,7 +225,7 @@ static void ZSTDMT_freeCCtxPool(ZSTDMT_CCtxPool* pool) unsigned u; for (u=0; utotalCCtx; u++) ZSTD_freeCCtx(pool->cctx[u]); /* note : compatible with free on NULL */ - pthread_mutex_destroy(&pool->poolMutex); + ZSTD_pthread_mutex_destroy(&pool->poolMutex); ZSTD_free(pool, pool->cMem); } @@ -216,7 +237,7 @@ static ZSTDMT_CCtxPool* ZSTDMT_createCCtxPool(unsigned nbThreads, ZSTDMT_CCtxPool* const cctxPool = (ZSTDMT_CCtxPool*) ZSTD_calloc( sizeof(ZSTDMT_CCtxPool) + (nbThreads-1)*sizeof(ZSTD_CCtx*), cMem); if (!cctxPool) return NULL; - if (pthread_mutex_init(&cctxPool->poolMutex, NULL)) { + if (ZSTD_pthread_mutex_init(&cctxPool->poolMutex, NULL)) { ZSTD_free(cctxPool, cMem); return NULL; } @@ -232,7 +253,7 @@ static ZSTDMT_CCtxPool* ZSTDMT_createCCtxPool(unsigned nbThreads, /* only works during initialization phase, not during compression */ static size_t ZSTDMT_sizeof_CCtxPool(ZSTDMT_CCtxPool* cctxPool) { - pthread_mutex_lock(&cctxPool->poolMutex); + ZSTD_pthread_mutex_lock(&cctxPool->poolMutex); { unsigned const nbThreads = cctxPool->totalCCtx; size_t const poolSize = sizeof(*cctxPool) + (nbThreads-1)*sizeof(ZSTD_CCtx*); @@ -241,7 +262,7 @@ static size_t ZSTDMT_sizeof_CCtxPool(ZSTDMT_CCtxPool* cctxPool) for (u=0; ucctx[u]); } - pthread_mutex_unlock(&cctxPool->poolMutex); + ZSTD_pthread_mutex_unlock(&cctxPool->poolMutex); return poolSize + totalCCtxSize; } } @@ -249,14 +270,14 @@ static size_t ZSTDMT_sizeof_CCtxPool(ZSTDMT_CCtxPool* cctxPool) static ZSTD_CCtx* ZSTDMT_getCCtx(ZSTDMT_CCtxPool* cctxPool) { DEBUGLOG(5, "ZSTDMT_getCCtx"); - pthread_mutex_lock(&cctxPool->poolMutex); + ZSTD_pthread_mutex_lock(&cctxPool->poolMutex); if (cctxPool->availCCtx) { cctxPool->availCCtx--; { ZSTD_CCtx* const cctx = cctxPool->cctx[cctxPool->availCCtx]; - pthread_mutex_unlock(&cctxPool->poolMutex); + ZSTD_pthread_mutex_unlock(&cctxPool->poolMutex); return cctx; } } - pthread_mutex_unlock(&cctxPool->poolMutex); + ZSTD_pthread_mutex_unlock(&cctxPool->poolMutex); DEBUGLOG(5, "create one more CCtx"); return ZSTD_createCCtx_advanced(cctxPool->cMem); /* note : can be NULL, when creation fails ! */ } @@ -264,7 +285,7 @@ static ZSTD_CCtx* ZSTDMT_getCCtx(ZSTDMT_CCtxPool* cctxPool) static void ZSTDMT_releaseCCtx(ZSTDMT_CCtxPool* pool, ZSTD_CCtx* cctx) { if (cctx==NULL) return; /* compatibility with release on NULL */ - pthread_mutex_lock(&pool->poolMutex); + ZSTD_pthread_mutex_lock(&pool->poolMutex); if (pool->availCCtx < pool->totalCCtx) pool->cctx[pool->availCCtx++] = cctx; else { @@ -272,7 +293,7 @@ static void ZSTDMT_releaseCCtx(ZSTDMT_CCtxPool* pool, ZSTD_CCtx* cctx) DEBUGLOG(5, "CCtx pool overflow : free cctx"); ZSTD_freeCCtx(cctx); } - pthread_mutex_unlock(&pool->poolMutex); + ZSTD_pthread_mutex_unlock(&pool->poolMutex); } @@ -290,9 +311,9 @@ typedef struct { unsigned lastChunk; unsigned jobCompleted; unsigned jobScanned; - pthread_mutex_t* jobCompleted_mutex; - pthread_cond_t* jobCompleted_cond; - ZSTD_parameters params; + ZSTD_pthread_mutex_t* jobCompleted_mutex; + ZSTD_pthread_cond_t* jobCompleted_cond; + ZSTD_CCtx_params params; const ZSTD_CDict* cdict; ZSTDMT_CCtxPool* cctxPool; ZSTDMT_bufferPool* bufPool; @@ -329,10 +350,15 @@ void ZSTDMT_compressChunk(void* jobDescription) if (ZSTD_isError(initError)) { job->cSize = initError; goto _endJob; } } else { /* srcStart points at reloaded section */ if (!job->firstChunk) job->params.fParams.contentSizeFlag = 0; /* ensure no srcSize control */ - { size_t const dictModeError = ZSTD_setCCtxParameter(cctx, ZSTD_p_forceRawDict, 1); /* Force loading dictionary in "content-only" mode (no header analysis) */ - size_t const initError = ZSTD_compressBegin_advanced(cctx, job->srcStart, job->dictSize, job->params, job->fullFrameSize); - if (ZSTD_isError(initError) || ZSTD_isError(dictModeError)) { job->cSize = initError; goto _endJob; } - ZSTD_setCCtxParameter(cctx, ZSTD_p_forceWindow, 1); + { ZSTD_CCtx_params jobParams = job->params; + size_t const forceWindowError = + ZSTD_CCtxParam_setParameter(&jobParams, ZSTD_p_forceMaxWindow, !job->firstChunk); + /* Force loading dictionary in "content-only" mode (no header analysis) */ + size_t const initError = ZSTD_compressBegin_advanced_internal(cctx, job->srcStart, job->dictSize, ZSTD_dm_rawContent, jobParams, job->fullFrameSize); + if (ZSTD_isError(initError) || ZSTD_isError(forceWindowError)) { + job->cSize = initError; + goto _endJob; + } } } if (!job->firstChunk) { /* flush and overwrite frame header when it's not first segment */ size_t const hSize = ZSTD_compressContinue(cctx, dstBuff.start, dstBuff.size, src, 0); @@ -353,11 +379,11 @@ void ZSTDMT_compressChunk(void* jobDescription) ZSTDMT_releaseCCtx(job->cctxPool, cctx); ZSTDMT_releaseBuffer(job->bufPool, job->src); job->src = g_nullBuffer; job->srcStart = NULL; - PTHREAD_MUTEX_LOCK(job->jobCompleted_mutex); + ZSTD_PTHREAD_MUTEX_LOCK(job->jobCompleted_mutex); job->jobCompleted = 1; job->jobScanned = 0; - pthread_cond_signal(job->jobCompleted_cond); - pthread_mutex_unlock(job->jobCompleted_mutex); + ZSTD_pthread_cond_signal(job->jobCompleted_cond); + ZSTD_pthread_mutex_unlock(job->jobCompleted_mutex); } @@ -375,24 +401,21 @@ struct ZSTDMT_CCtx_s { ZSTDMT_jobDescription* jobs; ZSTDMT_bufferPool* bufPool; ZSTDMT_CCtxPool* cctxPool; - pthread_mutex_t jobCompleted_mutex; - pthread_cond_t jobCompleted_cond; + ZSTD_pthread_mutex_t jobCompleted_mutex; + ZSTD_pthread_cond_t jobCompleted_cond; size_t targetSectionSize; size_t inBuffSize; size_t dictSize; size_t targetDictSize; inBuff_t inBuff; - ZSTD_parameters params; + ZSTD_CCtx_params params; XXH64_state_t xxhState; - unsigned nbThreads; unsigned jobIDMask; unsigned doneJobID; unsigned nextJobID; unsigned frameEnded; unsigned allJobsCompleted; - unsigned overlapLog; unsigned long long frameContentSize; - size_t sectionSize; ZSTD_customMem cMem; ZSTD_CDict* cdictLocal; const ZSTD_CDict* cdict; @@ -407,6 +430,15 @@ static ZSTDMT_jobDescription* ZSTDMT_allocJobsTable(U32* nbJobsPtr, ZSTD_customM nbJobs * sizeof(ZSTDMT_jobDescription), cMem); } +/* Internal only */ +size_t ZSTDMT_initializeCCtxParameters(ZSTD_CCtx_params* params, unsigned nbThreads) +{ + params->nbThreads = nbThreads; + params->overlapSizeLog = ZSTDMT_OVERLAPLOG_DEFAULT; + params->jobSize = 0; + return 0; +} + ZSTDMT_CCtx* ZSTDMT_createCCtx_advanced(unsigned nbThreads, ZSTD_customMem cMem) { ZSTDMT_CCtx* mtctx; @@ -421,12 +453,10 @@ ZSTDMT_CCtx* ZSTDMT_createCCtx_advanced(unsigned nbThreads, ZSTD_customMem cMem) mtctx = (ZSTDMT_CCtx*) ZSTD_calloc(sizeof(ZSTDMT_CCtx), cMem); if (!mtctx) return NULL; + ZSTDMT_initializeCCtxParameters(&mtctx->params, nbThreads); mtctx->cMem = cMem; - mtctx->nbThreads = nbThreads; mtctx->allJobsCompleted = 1; - mtctx->sectionSize = 0; - mtctx->overlapLog = ZSTDMT_OVERLAPLOG_DEFAULT; - mtctx->factory = POOL_create(nbThreads, 0); + mtctx->factory = POOL_create_advanced(nbThreads, 0, cMem); mtctx->jobs = ZSTDMT_allocJobsTable(&nbJobs, cMem); mtctx->jobIDMask = nbJobs - 1; mtctx->bufPool = ZSTDMT_createBufferPool(nbThreads, cMem); @@ -435,11 +465,11 @@ ZSTDMT_CCtx* ZSTDMT_createCCtx_advanced(unsigned nbThreads, ZSTD_customMem cMem) ZSTDMT_freeCCtx(mtctx); return NULL; } - if (pthread_mutex_init(&mtctx->jobCompleted_mutex, NULL)) { + if (ZSTD_pthread_mutex_init(&mtctx->jobCompleted_mutex, NULL)) { ZSTDMT_freeCCtx(mtctx); return NULL; } - if (pthread_cond_init(&mtctx->jobCompleted_cond, NULL)) { + if (ZSTD_pthread_cond_init(&mtctx->jobCompleted_cond, NULL)) { ZSTDMT_freeCCtx(mtctx); return NULL; } @@ -459,28 +489,46 @@ static void ZSTDMT_releaseAllJobResources(ZSTDMT_CCtx* mtctx) unsigned jobID; DEBUGLOG(3, "ZSTDMT_releaseAllJobResources"); for (jobID=0; jobID <= mtctx->jobIDMask; jobID++) { + DEBUGLOG(4, "job%02u: release dst address %08X", jobID, (U32)(size_t)mtctx->jobs[jobID].dstBuff.start); ZSTDMT_releaseBuffer(mtctx->bufPool, mtctx->jobs[jobID].dstBuff); mtctx->jobs[jobID].dstBuff = g_nullBuffer; + DEBUGLOG(4, "job%02u: release src address %08X", jobID, (U32)(size_t)mtctx->jobs[jobID].src.start); ZSTDMT_releaseBuffer(mtctx->bufPool, mtctx->jobs[jobID].src); mtctx->jobs[jobID].src = g_nullBuffer; } memset(mtctx->jobs, 0, (mtctx->jobIDMask+1)*sizeof(ZSTDMT_jobDescription)); + DEBUGLOG(4, "input: release address %08X", (U32)(size_t)mtctx->inBuff.buffer.start); ZSTDMT_releaseBuffer(mtctx->bufPool, mtctx->inBuff.buffer); mtctx->inBuff.buffer = g_nullBuffer; mtctx->allJobsCompleted = 1; } +static void ZSTDMT_waitForAllJobsCompleted(ZSTDMT_CCtx* zcs) +{ + DEBUGLOG(4, "ZSTDMT_waitForAllJobsCompleted"); + while (zcs->doneJobID < zcs->nextJobID) { + unsigned const jobID = zcs->doneJobID & zcs->jobIDMask; + ZSTD_PTHREAD_MUTEX_LOCK(&zcs->jobCompleted_mutex); + while (zcs->jobs[jobID].jobCompleted==0) { + DEBUGLOG(5, "waiting for jobCompleted signal from chunk %u", zcs->doneJobID); /* we want to block when waiting for data to flush */ + ZSTD_pthread_cond_wait(&zcs->jobCompleted_cond, &zcs->jobCompleted_mutex); + } + ZSTD_pthread_mutex_unlock(&zcs->jobCompleted_mutex); + zcs->doneJobID++; + } +} + size_t ZSTDMT_freeCCtx(ZSTDMT_CCtx* mtctx) { if (mtctx==NULL) return 0; /* compatible with free on NULL */ - POOL_free(mtctx->factory); - if (!mtctx->allJobsCompleted) ZSTDMT_releaseAllJobResources(mtctx); /* stop workers first */ - ZSTDMT_freeBufferPool(mtctx->bufPool); /* release job resources into pools first */ + POOL_free(mtctx->factory); /* stop and free worker threads */ + ZSTDMT_releaseAllJobResources(mtctx); /* release job resources into pools first */ ZSTD_free(mtctx->jobs, mtctx->cMem); + ZSTDMT_freeBufferPool(mtctx->bufPool); ZSTDMT_freeCCtxPool(mtctx->cctxPool); ZSTD_freeCDict(mtctx->cdictLocal); - pthread_mutex_destroy(&mtctx->jobCompleted_mutex); - pthread_cond_destroy(&mtctx->jobCompleted_cond); + ZSTD_pthread_mutex_destroy(&mtctx->jobCompleted_mutex); + ZSTD_pthread_cond_destroy(&mtctx->jobCompleted_cond); ZSTD_free(mtctx, mtctx->cMem); return 0; } @@ -496,22 +544,35 @@ size_t ZSTDMT_sizeof_CCtx(ZSTDMT_CCtx* mtctx) + ZSTD_sizeof_CDict(mtctx->cdictLocal); } -size_t ZSTDMT_setMTCtxParameter(ZSTDMT_CCtx* mtctx, ZSDTMT_parameter parameter, unsigned value) -{ +/* Internal only */ +size_t ZSTDMT_CCtxParam_setMTCtxParameter( + ZSTD_CCtx_params* params, ZSTDMT_parameter parameter, unsigned value) { switch(parameter) { case ZSTDMT_p_sectionSize : - mtctx->sectionSize = value; + params->jobSize = value; return 0; case ZSTDMT_p_overlapSectionLog : - DEBUGLOG(5, "ZSTDMT_p_overlapSectionLog : %u", value); - mtctx->overlapLog = (value >= 9) ? 9 : value; + DEBUGLOG(4, "ZSTDMT_p_overlapSectionLog : %u", value); + params->overlapSizeLog = (value >= 9) ? 9 : value; return 0; default : return ERROR(parameter_unsupported); } } +size_t ZSTDMT_setMTCtxParameter(ZSTDMT_CCtx* mtctx, ZSTDMT_parameter parameter, unsigned value) +{ + switch(parameter) + { + case ZSTDMT_p_sectionSize : + return ZSTDMT_CCtxParam_setMTCtxParameter(&mtctx->params, parameter, value); + case ZSTDMT_p_overlapSectionLog : + return ZSTDMT_CCtxParam_setMTCtxParameter(&mtctx->params, parameter, value); + default : + return ERROR(parameter_unsupported); + } +} /* ------------------------------------------ */ /* ===== Multi-threaded compression ===== */ @@ -528,17 +589,17 @@ static unsigned computeNbChunks(size_t srcSize, unsigned windowLog, unsigned nbT return (multiplier>1) ? nbChunksLarge : nbChunksSmall; } - -size_t ZSTDMT_compress_advanced(ZSTDMT_CCtx* mtctx, - void* dst, size_t dstCapacity, - const void* src, size_t srcSize, - const ZSTD_CDict* cdict, - ZSTD_parameters const params, - unsigned overlapLog) +static size_t ZSTDMT_compress_advanced_internal( + ZSTDMT_CCtx* mtctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + const ZSTD_CDict* cdict, + ZSTD_CCtx_params const params) { - unsigned const overlapRLog = (overlapLog>9) ? 0 : 9-overlapLog; + ZSTD_CCtx_params const jobParams = ZSTDMT_makeJobCCtxParams(params); + unsigned const overlapRLog = (params.overlapSizeLog>9) ? 0 : 9-params.overlapSizeLog; size_t const overlapSize = (overlapRLog>=9) ? 0 : (size_t)1 << (params.cParams.windowLog - overlapRLog); - unsigned nbChunks = computeNbChunks(srcSize, params.cParams.windowLog, mtctx->nbThreads); + unsigned nbChunks = computeNbChunks(srcSize, params.cParams.windowLog, params.nbThreads); size_t const proposedChunkSize = (srcSize + (nbChunks-1)) / nbChunks; size_t const avgChunkSize = ((proposedChunkSize & 0x1FFFF) < 0x7FFF) ? proposedChunkSize + 0xFFFF : proposedChunkSize; /* avoid too small last block */ const char* const srcStart = (const char*)src; @@ -546,12 +607,14 @@ size_t ZSTDMT_compress_advanced(ZSTDMT_CCtx* mtctx, unsigned const compressWithinDst = (dstCapacity >= ZSTD_compressBound(srcSize)) ? nbChunks : (unsigned)(dstCapacity / ZSTD_compressBound(avgChunkSize)); /* presumes avgChunkSize >= 256 KB, which should be the case */ size_t frameStartPos = 0, dstBufferPos = 0; XXH64_state_t xxh64; + assert(jobParams.nbThreads == 0); + assert(mtctx->cctxPool->totalCCtx == params.nbThreads); DEBUGLOG(4, "nbChunks : %2u (chunkSize : %u bytes) ", nbChunks, (U32)avgChunkSize); if (nbChunks==1) { /* fallback to single-thread mode */ ZSTD_CCtx* const cctx = mtctx->cctxPool->cctx[0]; - if (cdict) return ZSTD_compress_usingCDict_advanced(cctx, dst, dstCapacity, src, srcSize, cdict, params.fParams); - return ZSTD_compress_advanced(cctx, dst, dstCapacity, src, srcSize, NULL, 0, params); + if (cdict) return ZSTD_compress_usingCDict_advanced(cctx, dst, dstCapacity, src, srcSize, cdict, jobParams.fParams); + return ZSTD_compress_advanced_internal(cctx, dst, dstCapacity, src, srcSize, NULL, 0, jobParams); } assert(avgChunkSize >= 256 KB); /* condition for ZSTD_compressBound(A) + ZSTD_compressBound(B) <= ZSTD_compressBound(A+B), which is required for compressWithinDst */ ZSTDMT_setBufferSize(mtctx->bufPool, ZSTD_compressBound(avgChunkSize) ); @@ -580,7 +643,7 @@ size_t ZSTDMT_compress_advanced(ZSTDMT_CCtx* mtctx, mtctx->jobs[u].srcSize = chunkSize; mtctx->jobs[u].cdict = mtctx->nextJobID==0 ? cdict : NULL; mtctx->jobs[u].fullFrameSize = srcSize; - mtctx->jobs[u].params = params; + mtctx->jobs[u].params = jobParams; /* do not calculate checksum within sections, but write it in header for first section */ if (u!=0) mtctx->jobs[u].params.fParams.checksumFlag = 0; mtctx->jobs[u].dstBuff = dstBuffer; @@ -610,12 +673,12 @@ size_t ZSTDMT_compress_advanced(ZSTDMT_CCtx* mtctx, unsigned chunkID; for (chunkID=0; chunkIDjobCompleted_mutex); + ZSTD_PTHREAD_MUTEX_LOCK(&mtctx->jobCompleted_mutex); while (mtctx->jobs[chunkID].jobCompleted==0) { DEBUGLOG(5, "waiting for jobCompleted signal from chunk %u", chunkID); - pthread_cond_wait(&mtctx->jobCompleted_cond, &mtctx->jobCompleted_mutex); + ZSTD_pthread_cond_wait(&mtctx->jobCompleted_cond, &mtctx->jobCompleted_mutex); } - pthread_mutex_unlock(&mtctx->jobCompleted_mutex); + ZSTD_pthread_mutex_unlock(&mtctx->jobCompleted_mutex); DEBUGLOG(5, "ready to write chunk %u ", chunkID); mtctx->jobs[chunkID].srcStart = NULL; @@ -628,9 +691,8 @@ size_t ZSTDMT_compress_advanced(ZSTDMT_CCtx* mtctx, if (chunkID >= compressWithinDst) { /* chunk compressed into its own buffer, which must be released */ DEBUGLOG(5, "releasing buffer %u>=%u", chunkID, compressWithinDst); ZSTDMT_releaseBuffer(mtctx->bufPool, mtctx->jobs[chunkID].dstBuff); - } - mtctx->jobs[chunkID].dstBuff = g_nullBuffer; - } + } } + mtctx->jobs[chunkID].dstBuff = g_nullBuffer; dstPos += cSize ; } } /* for (chunkID=0; chunkIDparams; + cctxParams.cParams = params.cParams; + cctxParams.fParams = params.fParams; + cctxParams.overlapSizeLog = overlapLog; + return ZSTDMT_compress_advanced_internal(mtctx, + dst, dstCapacity, + src, srcSize, + cdict, cctxParams); +} + size_t ZSTDMT_compressCCtx(ZSTDMT_CCtx* mtctx, void* dst, size_t dstCapacity, @@ -668,38 +747,25 @@ size_t ZSTDMT_compressCCtx(ZSTDMT_CCtx* mtctx, /* ======= Streaming API ======= */ /* ====================================== */ -static void ZSTDMT_waitForAllJobsCompleted(ZSTDMT_CCtx* zcs) -{ - DEBUGLOG(4, "ZSTDMT_waitForAllJobsCompleted"); - while (zcs->doneJobID < zcs->nextJobID) { - unsigned const jobID = zcs->doneJobID & zcs->jobIDMask; - PTHREAD_MUTEX_LOCK(&zcs->jobCompleted_mutex); - while (zcs->jobs[jobID].jobCompleted==0) { - DEBUGLOG(5, "waiting for jobCompleted signal from chunk %u", zcs->doneJobID); /* we want to block when waiting for data to flush */ - pthread_cond_wait(&zcs->jobCompleted_cond, &zcs->jobCompleted_mutex); - } - pthread_mutex_unlock(&zcs->jobCompleted_mutex); - zcs->doneJobID++; - } -} - - -/** ZSTDMT_initCStream_internal() : - * internal usage only */ -size_t ZSTDMT_initCStream_internal(ZSTDMT_CCtx* zcs, - const void* dict, size_t dictSize, const ZSTD_CDict* cdict, - ZSTD_parameters params, unsigned long long pledgedSrcSize) +size_t ZSTDMT_initCStream_internal( + ZSTDMT_CCtx* zcs, + const void* dict, size_t dictSize, ZSTD_dictMode_e dictMode, + const ZSTD_CDict* cdict, ZSTD_CCtx_params params, + unsigned long long pledgedSrcSize) { DEBUGLOG(4, "ZSTDMT_initCStream_internal"); /* params are supposed to be fully validated at this point */ assert(!ZSTD_isError(ZSTD_checkCParams(params.cParams))); assert(!((dict) && (cdict))); /* either dict or cdict, not both */ + assert(zcs->cctxPool->totalCCtx == params.nbThreads); - if (zcs->nbThreads==1) { + if (params.nbThreads==1) { + ZSTD_CCtx_params const singleThreadParams = ZSTDMT_makeJobCCtxParams(params); DEBUGLOG(4, "single thread mode"); + assert(singleThreadParams.nbThreads == 0); return ZSTD_initCStream_internal(zcs->cctxPool->cctx[0], - dict, dictSize, cdict, - params, pledgedSrcSize); + dict, dictSize, cdict, + singleThreadParams, pledgedSrcSize); } if (zcs->allJobsCompleted == 0) { /* previous compression not correctly finished */ @@ -714,7 +780,7 @@ size_t ZSTDMT_initCStream_internal(ZSTDMT_CCtx* zcs, DEBUGLOG(4,"cdictLocal: %08X", (U32)(size_t)zcs->cdictLocal); ZSTD_freeCDict(zcs->cdictLocal); zcs->cdictLocal = ZSTD_createCDict_advanced(dict, dictSize, - 0 /* byRef */, ZSTD_dm_auto, /* note : a loadPrefix becomes an internal CDict */ + ZSTD_dlm_byCopy, dictMode, /* note : a loadPrefix becomes an internal CDict */ params.cParams, zcs->cMem); zcs->cdict = zcs->cdictLocal; if (zcs->cdictLocal == NULL) return ERROR(memory_allocation); @@ -725,10 +791,10 @@ size_t ZSTDMT_initCStream_internal(ZSTDMT_CCtx* zcs, zcs->cdict = cdict; } - zcs->targetDictSize = (zcs->overlapLog==0) ? 0 : (size_t)1 << (zcs->params.cParams.windowLog - (9 - zcs->overlapLog)); - DEBUGLOG(4, "overlapLog : %u ", zcs->overlapLog); + zcs->targetDictSize = (params.overlapSizeLog==0) ? 0 : (size_t)1 << (params.cParams.windowLog - (9 - params.overlapSizeLog)); + DEBUGLOG(4, "overlapLog : %u ", params.overlapSizeLog); DEBUGLOG(4, "overlap Size : %u KB", (U32)(zcs->targetDictSize>>10)); - zcs->targetSectionSize = zcs->sectionSize ? zcs->sectionSize : (size_t)1 << (zcs->params.cParams.windowLog + 2); + zcs->targetSectionSize = params.jobSize ? params.jobSize : (size_t)1 << (params.cParams.windowLog + 2); zcs->targetSectionSize = MAX(ZSTDMT_SECTION_SIZE_MIN, zcs->targetSectionSize); zcs->targetSectionSize = MAX(zcs->targetDictSize, zcs->targetSectionSize); DEBUGLOG(4, "Section Size : %u KB", (U32)(zcs->targetSectionSize>>10)); @@ -749,8 +815,12 @@ size_t ZSTDMT_initCStream_advanced(ZSTDMT_CCtx* mtctx, ZSTD_parameters params, unsigned long long pledgedSrcSize) { + ZSTD_CCtx_params cctxParams = mtctx->params; DEBUGLOG(5, "ZSTDMT_initCStream_advanced"); - return ZSTDMT_initCStream_internal(mtctx, dict, dictSize, NULL, params, pledgedSrcSize); + cctxParams.cParams = params.cParams; + cctxParams.fParams = params.fParams; + return ZSTDMT_initCStream_internal(mtctx, dict, dictSize, ZSTD_dm_auto, NULL, + cctxParams, pledgedSrcSize); } size_t ZSTDMT_initCStream_usingCDict(ZSTDMT_CCtx* mtctx, @@ -758,11 +828,12 @@ size_t ZSTDMT_initCStream_usingCDict(ZSTDMT_CCtx* mtctx, ZSTD_frameParameters fParams, unsigned long long pledgedSrcSize) { - ZSTD_parameters params = ZSTD_getParamsFromCDict(cdict); + ZSTD_CCtx_params cctxParams = mtctx->params; + cctxParams.cParams = ZSTD_getCParamsFromCDict(cdict); + cctxParams.fParams = fParams; if (cdict==NULL) return ERROR(dictionary_wrong); /* method incompatible with NULL cdict */ - params.fParams = fParams; - return ZSTDMT_initCStream_internal(mtctx, NULL, 0 /*dictSize*/, cdict, - params, pledgedSrcSize); + return ZSTDMT_initCStream_internal(mtctx, NULL, 0 /*dictSize*/, ZSTD_dm_auto, cdict, + cctxParams, pledgedSrcSize); } @@ -770,14 +841,18 @@ size_t ZSTDMT_initCStream_usingCDict(ZSTDMT_CCtx* mtctx, * pledgedSrcSize is optional and can be zero == unknown */ size_t ZSTDMT_resetCStream(ZSTDMT_CCtx* zcs, unsigned long long pledgedSrcSize) { - if (zcs->nbThreads==1) + if (zcs->params.nbThreads==1) return ZSTD_resetCStream(zcs->cctxPool->cctx[0], pledgedSrcSize); - return ZSTDMT_initCStream_internal(zcs, NULL, 0, 0, zcs->params, pledgedSrcSize); + return ZSTDMT_initCStream_internal(zcs, NULL, 0, ZSTD_dm_auto, 0, zcs->params, + pledgedSrcSize); } size_t ZSTDMT_initCStream(ZSTDMT_CCtx* zcs, int compressionLevel) { ZSTD_parameters const params = ZSTD_getParams(compressionLevel, 0, 0); - return ZSTDMT_initCStream_internal(zcs, NULL, 0, NULL, params, 0); + ZSTD_CCtx_params cctxParams = zcs->params; + cctxParams.cParams = params.cParams; + cctxParams.fParams = params.fParams; + return ZSTDMT_initCStream_internal(zcs, NULL, 0, ZSTD_dm_auto, NULL, cctxParams, 0); } @@ -856,13 +931,13 @@ static size_t ZSTDMT_flushNextJob(ZSTDMT_CCtx* zcs, ZSTD_outBuffer* output, unsi { unsigned const wJobID = zcs->doneJobID & zcs->jobIDMask; if (zcs->doneJobID == zcs->nextJobID) return 0; /* all flushed ! */ - PTHREAD_MUTEX_LOCK(&zcs->jobCompleted_mutex); + ZSTD_PTHREAD_MUTEX_LOCK(&zcs->jobCompleted_mutex); while (zcs->jobs[wJobID].jobCompleted==0) { DEBUGLOG(5, "waiting for jobCompleted signal from job %u", zcs->doneJobID); - if (!blockToFlush) { pthread_mutex_unlock(&zcs->jobCompleted_mutex); return 0; } /* nothing ready to be flushed => skip */ - pthread_cond_wait(&zcs->jobCompleted_cond, &zcs->jobCompleted_mutex); /* block when nothing available to flush */ + if (!blockToFlush) { ZSTD_pthread_mutex_unlock(&zcs->jobCompleted_mutex); return 0; } /* nothing ready to be flushed => skip */ + ZSTD_pthread_cond_wait(&zcs->jobCompleted_cond, &zcs->jobCompleted_mutex); /* block when nothing available to flush */ } - pthread_mutex_unlock(&zcs->jobCompleted_mutex); + ZSTD_pthread_mutex_unlock(&zcs->jobCompleted_mutex); /* compression job completed : output can be flushed */ { ZSTDMT_jobDescription job = zcs->jobs[wJobID]; if (!job.jobScanned) { @@ -906,7 +981,7 @@ static size_t ZSTDMT_flushNextJob(ZSTDMT_CCtx* zcs, ZSTD_outBuffer* output, unsi /** ZSTDMT_compressStream_generic() : - * internal use only + * internal use only - exposed to be invoked from zstd_compress.c * assumption : output and input are valid (pos <= size) * @return : minimum amount of data remaining to flush, 0 if none */ size_t ZSTDMT_compressStream_generic(ZSTDMT_CCtx* mtctx, @@ -915,25 +990,26 @@ size_t ZSTDMT_compressStream_generic(ZSTDMT_CCtx* mtctx, ZSTD_EndDirective endOp) { size_t const newJobThreshold = mtctx->dictSize + mtctx->targetSectionSize; + unsigned forwardInputProgress = 0; assert(output->pos <= output->size); assert(input->pos <= input->size); if ((mtctx->frameEnded) && (endOp==ZSTD_e_continue)) { - /* current frame being ended. Only flush/end are allowed. Or start new frame with init */ + /* current frame being ended. Only flush/end are allowed */ return ERROR(stage_wrong); } - if (mtctx->nbThreads==1) { /* delegate to single-thread (synchronous) */ + if (mtctx->params.nbThreads==1) { /* delegate to single-thread (synchronous) */ return ZSTD_compressStream_generic(mtctx->cctxPool->cctx[0], output, input, endOp); } - /* single-pass shortcut (note : this is synchronous-mode) */ - if ( (mtctx->nextJobID==0) /* just started */ - && (mtctx->inBuff.filled==0) /* nothing buffered */ - && (endOp==ZSTD_e_end) /* end order */ + /* single-pass shortcut (note : synchronous-mode) */ + if ( (mtctx->nextJobID == 0) /* just started */ + && (mtctx->inBuff.filled == 0) /* nothing buffered */ + && (endOp == ZSTD_e_end) /* end order */ && (output->size - output->pos >= ZSTD_compressBound(input->size - input->pos)) ) { /* enough room */ - size_t const cSize = ZSTDMT_compress_advanced(mtctx, + size_t const cSize = ZSTDMT_compress_advanced_internal(mtctx, (char*)output->dst + output->pos, output->size - output->pos, (const char*)input->src + input->pos, input->size - input->pos, - mtctx->cdict, mtctx->params, mtctx->overlapLog); + mtctx->cdict, mtctx->params); if (ZSTD_isError(cSize)) return cSize; input->pos = input->size; output->pos += cSize; @@ -946,15 +1022,16 @@ size_t ZSTDMT_compressStream_generic(ZSTDMT_CCtx* mtctx, /* fill input buffer */ if (input->size > input->pos) { /* support NULL input */ if (mtctx->inBuff.buffer.start == NULL) { - mtctx->inBuff.buffer = ZSTDMT_getBuffer(mtctx->bufPool); - if (mtctx->inBuff.buffer.start == NULL) return ERROR(memory_allocation); + mtctx->inBuff.buffer = ZSTDMT_getBuffer(mtctx->bufPool); /* note : may fail, in which case, no forward input progress */ mtctx->inBuff.filled = 0; } - { size_t const toLoad = MIN(input->size - input->pos, mtctx->inBuffSize - mtctx->inBuff.filled); + if (mtctx->inBuff.buffer.start) { + size_t const toLoad = MIN(input->size - input->pos, mtctx->inBuffSize - mtctx->inBuff.filled); DEBUGLOG(5, "inBuff:%08X; inBuffSize=%u; ToCopy=%u", (U32)(size_t)mtctx->inBuff.buffer.start, (U32)mtctx->inBuffSize, (U32)toLoad); memcpy((char*)mtctx->inBuff.buffer.start + mtctx->inBuff.filled, (const char*)input->src + input->pos, toLoad); input->pos += toLoad; mtctx->inBuff.filled += toLoad; + forwardInputProgress = toLoad>0; } } if ( (mtctx->inBuff.filled >= newJobThreshold) /* filled enough : let's compress */ @@ -963,7 +1040,7 @@ size_t ZSTDMT_compressStream_generic(ZSTDMT_CCtx* mtctx, } /* check for potential compressed data ready to be flushed */ - CHECK_F( ZSTDMT_flushNextJob(mtctx, output, (mtctx->inBuff.filled == mtctx->inBuffSize) /* blockToFlush */) ); /* block if it wasn't possible to create new job due to saturation */ + CHECK_F( ZSTDMT_flushNextJob(mtctx, output, !forwardInputProgress /* blockToFlush */) ); /* block if there was no forward input progress */ if (input->pos < input->size) /* input not consumed : do not flush yet */ endOp = ZSTD_e_continue; @@ -1008,7 +1085,7 @@ static size_t ZSTDMT_flushStream_internal(ZSTDMT_CCtx* zcs, ZSTD_outBuffer* outp size_t ZSTDMT_flushStream(ZSTDMT_CCtx* zcs, ZSTD_outBuffer* output) { DEBUGLOG(5, "ZSTDMT_flushStream"); - if (zcs->nbThreads==1) + if (zcs->params.nbThreads==1) return ZSTD_flushStream(zcs->cctxPool->cctx[0], output); return ZSTDMT_flushStream_internal(zcs, output, 0 /* endFrame */); } @@ -1016,7 +1093,7 @@ size_t ZSTDMT_flushStream(ZSTDMT_CCtx* zcs, ZSTD_outBuffer* output) size_t ZSTDMT_endStream(ZSTDMT_CCtx* zcs, ZSTD_outBuffer* output) { DEBUGLOG(4, "ZSTDMT_endStream"); - if (zcs->nbThreads==1) + if (zcs->params.nbThreads==1) return ZSTD_endStream(zcs->cctxPool->cctx[0], output); return ZSTDMT_flushStream_internal(zcs, output, 1 /* endFrame */); } diff --git a/contrib/zstd/lib/compress/zstdmt_compress.h b/sys/contrib/zstd/lib/compress/zstdmt_compress.h similarity index 85% rename from contrib/zstd/lib/compress/zstdmt_compress.h rename to sys/contrib/zstd/lib/compress/zstdmt_compress.h index 0f0fc2b03fc6..8c59c684f1a3 100644 --- a/contrib/zstd/lib/compress/zstdmt_compress.h +++ b/sys/contrib/zstd/lib/compress/zstdmt_compress.h @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ #ifndef ZSTDMT_COMPRESS_H @@ -80,19 +81,19 @@ ZSTDLIB_API size_t ZSTDMT_initCStream_usingCDict(ZSTDMT_CCtx* mtctx, ZSTD_frameParameters fparams, unsigned long long pledgedSrcSize); /* note : zero means empty */ -/* ZSDTMT_parameter : +/* ZSTDMT_parameter : * List of parameters that can be set using ZSTDMT_setMTCtxParameter() */ typedef enum { ZSTDMT_p_sectionSize, /* size of input "section". Each section is compressed in parallel. 0 means default, which is dynamically determined within compression functions */ ZSTDMT_p_overlapSectionLog /* Log of overlapped section; 0 == no overlap, 6(default) == use 1/8th of window, >=9 == use full window */ -} ZSDTMT_parameter; +} ZSTDMT_parameter; /* ZSTDMT_setMTCtxParameter() : * allow setting individual parameters, one at a time, among a list of enums defined in ZSTDMT_parameter. * The function must be called typically after ZSTD_createCCtx(). * Parameters not explicitly reset by ZSTDMT_init*() remain the same in consecutive compression sessions. * @return : 0, or an error code (which can be tested using ZSTD_isError()) */ -ZSTDLIB_API size_t ZSTDMT_setMTCtxParameter(ZSTDMT_CCtx* mtctx, ZSDTMT_parameter parameter, unsigned value); +ZSTDLIB_API size_t ZSTDMT_setMTCtxParameter(ZSTDMT_CCtx* mtctx, ZSTDMT_parameter parameter, unsigned value); /*! ZSTDMT_compressStream_generic() : @@ -107,6 +108,22 @@ ZSTDLIB_API size_t ZSTDMT_compressStream_generic(ZSTDMT_CCtx* mtctx, ZSTD_EndDirective endOp); +/* === Private definitions; never ever use directly === */ + +size_t ZSTDMT_CCtxParam_setMTCtxParameter(ZSTD_CCtx_params* params, ZSTDMT_parameter parameter, unsigned value); + +size_t ZSTDMT_initializeCCtxParameters(ZSTD_CCtx_params* params, unsigned nbThreads); + +/*! ZSTDMT_initCStream_internal() : + * Private use only. Init streaming operation. + * expects params to be valid. + * must receive dict, or cdict, or none, but not both. + * @return : 0, or an error code */ +size_t ZSTDMT_initCStream_internal(ZSTDMT_CCtx* zcs, + const void* dict, size_t dictSize, ZSTD_dictMode_e dictMode, + const ZSTD_CDict* cdict, + ZSTD_CCtx_params params, unsigned long long pledgedSrcSize); + #if defined (__cplusplus) } diff --git a/contrib/zstd/lib/decompress/huf_decompress.c b/sys/contrib/zstd/lib/decompress/huf_decompress.c similarity index 100% rename from contrib/zstd/lib/decompress/huf_decompress.c rename to sys/contrib/zstd/lib/decompress/huf_decompress.c diff --git a/contrib/zstd/lib/decompress/zstd_decompress.c b/sys/contrib/zstd/lib/decompress/zstd_decompress.c similarity index 83% rename from contrib/zstd/lib/decompress/zstd_decompress.c rename to sys/contrib/zstd/lib/decompress/zstd_decompress.c index d2bc545e52c5..96fc60908960 100644 --- a/contrib/zstd/lib/decompress/zstd_decompress.c +++ b/sys/contrib/zstd/lib/decompress/zstd_decompress.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ @@ -34,7 +35,7 @@ * Frames requiring more memory will be rejected. */ #ifndef ZSTD_MAXWINDOWSIZE_DEFAULT -# define ZSTD_MAXWINDOWSIZE_DEFAULT ((1 << ZSTD_WINDOWLOG_MAX) + 1) /* defined within zstd.h */ +# define ZSTD_MAXWINDOWSIZE_DEFAULT (((U32)1 << ZSTD_WINDOWLOG_DEFAULTMAX) + 1) #endif @@ -101,13 +102,15 @@ struct ZSTD_DCtx_s const void* dictEnd; /* end of previous segment */ size_t expected; ZSTD_frameHeader fParams; - blockType_e bType; /* used in ZSTD_decompressContinue(), to transfer blockType between header decoding and block decoding stages */ + U64 decodedSize; + blockType_e bType; /* used in ZSTD_decompressContinue(), store blockType between block header decoding and block decompression stages */ ZSTD_dStage stage; U32 litEntropy; U32 fseEntropy; XXH64_state_t xxhState; size_t headerSize; U32 dictID; + ZSTD_format_e format; const BYTE* litPtr; ZSTD_customMem customMem; size_t litSize; @@ -126,7 +129,6 @@ struct ZSTD_DCtx_s size_t outBuffSize; size_t outStart; size_t outEnd; - size_t blockSize; size_t lhSize; void* legacyContext; U32 previousLegacyVersion; @@ -148,39 +150,44 @@ size_t ZSTD_sizeof_DCtx (const ZSTD_DCtx* dctx) size_t ZSTD_estimateDCtxSize(void) { return sizeof(ZSTD_DCtx); } -size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx) + +static size_t ZSTD_startingInputLength(ZSTD_format_e format) { - dctx->expected = ZSTD_frameHeaderSize_prefix; - dctx->stage = ZSTDds_getFrameHeaderSize; - dctx->previousDstEnd = NULL; - dctx->base = NULL; - dctx->vBase = NULL; - dctx->dictEnd = NULL; - dctx->entropy.hufTable[0] = (HUF_DTable)((HufLog)*0x1000001); /* cover both little and big endian */ - dctx->litEntropy = dctx->fseEntropy = 0; - dctx->dictID = 0; - MEM_STATIC_ASSERT(sizeof(dctx->entropy.rep) == sizeof(repStartValue)); - memcpy(dctx->entropy.rep, repStartValue, sizeof(repStartValue)); /* initial repcodes */ - dctx->LLTptr = dctx->entropy.LLTable; - dctx->MLTptr = dctx->entropy.MLTable; - dctx->OFTptr = dctx->entropy.OFTable; - dctx->HUFptr = dctx->entropy.hufTable; - return 0; + size_t const startingInputLength = (format==ZSTD_f_zstd1_magicless) ? + ZSTD_frameHeaderSize_prefix - ZSTD_frameIdSize : + ZSTD_frameHeaderSize_prefix; + ZSTD_STATIC_ASSERT(ZSTD_FRAMEHEADERSIZE_PREFIX >= ZSTD_FRAMEIDSIZE); + /* only supports formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless */ + assert( (format == ZSTD_f_zstd1) || (format == ZSTD_f_zstd1_magicless) ); + return startingInputLength; } static void ZSTD_initDCtx_internal(ZSTD_DCtx* dctx) { - ZSTD_decompressBegin(dctx); /* cannot fail */ - dctx->staticSize = 0; + dctx->format = ZSTD_f_zstd1; /* ZSTD_decompressBegin() invokes ZSTD_startingInputLength() with argument dctx->format */ + dctx->staticSize = 0; dctx->maxWindowSize = ZSTD_MAXWINDOWSIZE_DEFAULT; - dctx->ddict = NULL; - dctx->ddictLocal = NULL; - dctx->inBuff = NULL; - dctx->inBuffSize = 0; - dctx->outBuffSize= 0; + dctx->ddict = NULL; + dctx->ddictLocal = NULL; + dctx->inBuff = NULL; + dctx->inBuffSize = 0; + dctx->outBuffSize = 0; dctx->streamStage = zdss_init; } +ZSTD_DCtx* ZSTD_initStaticDCtx(void *workspace, size_t workspaceSize) +{ + ZSTD_DCtx* const dctx = (ZSTD_DCtx*) workspace; + + if ((size_t)workspace & 7) return NULL; /* 8-aligned */ + if (workspaceSize < sizeof(ZSTD_DCtx)) return NULL; /* minimum size */ + + ZSTD_initDCtx_internal(dctx); + dctx->staticSize = workspaceSize; + dctx->inBuff = (char*)(dctx+1); + return dctx; +} + ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem) { if (!customMem.customAlloc ^ !customMem.customFree) return NULL; @@ -195,19 +202,6 @@ ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem) } } -ZSTD_DCtx* ZSTD_initStaticDCtx(void *workspace, size_t workspaceSize) -{ - ZSTD_DCtx* dctx = (ZSTD_DCtx*) workspace; - - if ((size_t)workspace & 7) return NULL; /* 8-aligned */ - if (workspaceSize < sizeof(ZSTD_DCtx)) return NULL; /* minimum size */ - - ZSTD_initDCtx_internal(dctx); - dctx->staticSize = workspaceSize; - dctx->inBuff = (char*)(dctx+1); - return dctx; -} - ZSTD_DCtx* ZSTD_createDCtx(void) { return ZSTD_createDCtx_advanced(ZSTD_defaultCMem); @@ -250,7 +244,7 @@ void ZSTD_copyDCtx(ZSTD_DCtx* dstDCtx, const ZSTD_DCtx* srcDCtx) * Note 3 : Skippable Frame Identifiers are considered valid. */ unsigned ZSTD_isFrame(const void* buffer, size_t size) { - if (size < 4) return 0; + if (size < ZSTD_frameIdSize) return 0; { U32 const magic = MEM_readLE32(buffer); if (magic == ZSTD_MAGICNUMBER) return 1; if ((magic & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START) return 1; @@ -261,55 +255,70 @@ unsigned ZSTD_isFrame(const void* buffer, size_t size) return 0; } - -/** ZSTD_frameHeaderSize() : -* srcSize must be >= ZSTD_frameHeaderSize_prefix. -* @return : size of the Frame Header */ -size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize) +/** ZSTD_frameHeaderSize_internal() : + * srcSize must be large enough to reach header size fields. + * note : only works for formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless + * @return : size of the Frame Header + * or an error code, which can be tested with ZSTD_isError() */ +static size_t ZSTD_frameHeaderSize_internal(const void* src, size_t srcSize, ZSTD_format_e format) { - if (srcSize < ZSTD_frameHeaderSize_prefix) return ERROR(srcSize_wrong); - { BYTE const fhd = ((const BYTE*)src)[4]; + size_t const minInputSize = ZSTD_startingInputLength(format); + if (srcSize < minInputSize) return ERROR(srcSize_wrong); + + { BYTE const fhd = ((const BYTE*)src)[minInputSize-1]; U32 const dictID= fhd & 3; U32 const singleSegment = (fhd >> 5) & 1; U32 const fcsId = fhd >> 6; - return ZSTD_frameHeaderSize_prefix + !singleSegment + ZSTD_did_fieldSize[dictID] + ZSTD_fcs_fieldSize[fcsId] - + (singleSegment && !fcsId); + return minInputSize + !singleSegment + + ZSTD_did_fieldSize[dictID] + ZSTD_fcs_fieldSize[fcsId] + + (singleSegment && !fcsId); } } +/** ZSTD_frameHeaderSize() : + * srcSize must be >= ZSTD_frameHeaderSize_prefix. + * @return : size of the Frame Header */ +size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize) +{ + return ZSTD_frameHeaderSize_internal(src, srcSize, ZSTD_f_zstd1); +} -/** ZSTD_getFrameHeader() : -* decode Frame Header, or require larger `srcSize`. -* @return : 0, `zfhPtr` is correctly filled, -* >0, `srcSize` is too small, result is expected `srcSize`, -* or an error code, which can be tested using ZSTD_isError() */ -size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize) + +/** ZSTD_getFrameHeader_internal() : + * decode Frame Header, or require larger `srcSize`. + * note : only works for formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless + * @return : 0, `zfhPtr` is correctly filled, + * >0, `srcSize` is too small, value is wanted `srcSize` amount, + * or an error code, which can be tested using ZSTD_isError() */ +static size_t ZSTD_getFrameHeader_internal(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize, ZSTD_format_e format) { const BYTE* ip = (const BYTE*)src; - if (srcSize < ZSTD_frameHeaderSize_prefix) return ZSTD_frameHeaderSize_prefix; + size_t const minInputSize = ZSTD_startingInputLength(format); - if (MEM_readLE32(src) != ZSTD_MAGICNUMBER) { + if (srcSize < minInputSize) return minInputSize; + + if ( (format != ZSTD_f_zstd1_magicless) + && (MEM_readLE32(src) != ZSTD_MAGICNUMBER) ) { if ((MEM_readLE32(src) & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START) { /* skippable frame */ if (srcSize < ZSTD_skippableHeaderSize) return ZSTD_skippableHeaderSize; /* magic number + frame length */ memset(zfhPtr, 0, sizeof(*zfhPtr)); - zfhPtr->frameContentSize = MEM_readLE32((const char *)src + 4); + zfhPtr->frameContentSize = MEM_readLE32((const char *)src + ZSTD_frameIdSize); zfhPtr->frameType = ZSTD_skippableFrame; - zfhPtr->windowSize = 0; return 0; } return ERROR(prefix_unknown); } /* ensure there is enough `srcSize` to fully read/decode frame header */ - { size_t const fhsize = ZSTD_frameHeaderSize(src, srcSize); + { size_t const fhsize = ZSTD_frameHeaderSize_internal(src, srcSize, format); if (srcSize < fhsize) return fhsize; zfhPtr->headerSize = (U32)fhsize; } - { BYTE const fhdByte = ip[4]; - size_t pos = 5; + { BYTE const fhdByte = ip[minInputSize-1]; + size_t pos = minInputSize; U32 const dictIDSizeCode = fhdByte&3; U32 const checksumFlag = (fhdByte>>2)&1; U32 const singleSegment = (fhdByte>>5)&1; @@ -349,12 +358,25 @@ size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t src zfhPtr->frameType = ZSTD_frame; zfhPtr->frameContentSize = frameContentSize; zfhPtr->windowSize = windowSize; + zfhPtr->blockSizeMax = (unsigned) MIN(windowSize, ZSTD_BLOCKSIZE_MAX); zfhPtr->dictID = dictID; zfhPtr->checksumFlag = checksumFlag; } return 0; } +/** ZSTD_getFrameHeader() : + * decode Frame Header, or require larger `srcSize`. + * note : this function does not consume input, it only reads it. + * @return : 0, `zfhPtr` is correctly filled, + * >0, `srcSize` is too small, value is wanted `srcSize` amount, + * or an error code, which can be tested using ZSTD_isError() */ +size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize) +{ + return ZSTD_getFrameHeader_internal(zfhPtr, src, srcSize, ZSTD_f_zstd1); +} + + /** ZSTD_getFrameContentSize() : * compatible with legacy mode * @return : decompressed size of the single frame pointed to be `src` if known, otherwise @@ -388,14 +410,14 @@ unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize) unsigned long long totalDstSize = 0; while (srcSize >= ZSTD_frameHeaderSize_prefix) { - const U32 magicNumber = MEM_readLE32(src); + U32 const magicNumber = MEM_readLE32(src); if ((magicNumber & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START) { size_t skippableSize; if (srcSize < ZSTD_skippableHeaderSize) return ERROR(srcSize_wrong); - skippableSize = MEM_readLE32((const BYTE *)src + 4) + - ZSTD_skippableHeaderSize; + skippableSize = MEM_readLE32((const BYTE *)src + ZSTD_frameIdSize) + + ZSTD_skippableHeaderSize; if (srcSize < skippableSize) { return ZSTD_CONTENTSIZE_ERROR; } @@ -420,11 +442,9 @@ unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize) src = (const BYTE *)src + frameSrcSize; srcSize -= frameSrcSize; } - } + } /* while (srcSize >= ZSTD_frameHeaderSize_prefix) */ - if (srcSize) { - return ZSTD_CONTENTSIZE_ERROR; - } + if (srcSize) return ZSTD_CONTENTSIZE_ERROR; return totalDstSize; } @@ -440,7 +460,8 @@ unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize) unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize) { unsigned long long const ret = ZSTD_getFrameContentSize(src, srcSize); - return ret >= ZSTD_CONTENTSIZE_ERROR ? 0 : ret; + ZSTD_STATIC_ASSERT(ZSTD_CONTENTSIZE_ERROR < ZSTD_CONTENTSIZE_UNKNOWN); + return (ret >= ZSTD_CONTENTSIZE_ERROR) ? 0 : ret; } @@ -449,9 +470,9 @@ unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize) * @return : 0 if success, or an error code, which can be tested using ZSTD_isError() */ static size_t ZSTD_decodeFrameHeader(ZSTD_DCtx* dctx, const void* src, size_t headerSize) { - size_t const result = ZSTD_getFrameHeader(&(dctx->fParams), src, headerSize); - if (ZSTD_isError(result)) return result; /* invalid header */ - if (result>0) return ERROR(srcSize_wrong); /* headerSize too small */ + size_t const result = ZSTD_getFrameHeader_internal(&(dctx->fParams), src, headerSize, dctx->format); + if (ZSTD_isError(result)) return result; /* invalid header */ + if (result>0) return ERROR(srcSize_wrong); /* headerSize too small */ if (dctx->fParams.dictID && (dctx->dictID != dctx->fParams.dictID)) return ERROR(dictionary_wrong); if (dctx->fParams.checksumFlag) XXH64_reset(&dctx->xxhState, 0); @@ -497,7 +518,8 @@ static size_t ZSTD_setRleBlock(void* dst, size_t dstCapacity, } /*! ZSTD_decodeLiteralsBlock() : - @return : nb of bytes read from src (< srcSize ) */ + * @return : nb of bytes read from src (< srcSize ) + * note : symbol not declared but exposed for fullbench */ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx, const void* src, size_t srcSize) /* note : srcSize < BLOCKSIZE */ { @@ -698,9 +720,9 @@ static const FSE_decode_t4 OF_defaultDTable[(1< STREAM_ACCUMULATOR_MIN_32 \ + ? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32 \ + : 0) + +static seq_t ZSTD_decodeSequence(seqState_t* seqState, const ZSTD_longOffset_e longOffsets) { seq_t seq; U32 const llCode = FSE_peekSymbol(&seqState->stateLL); U32 const mlCode = FSE_peekSymbol(&seqState->stateML); - U32 const ofCode = FSE_peekSymbol(&seqState->stateOffb); /* <= maxOff, by table construction */ + U32 const ofCode = FSE_peekSymbol(&seqState->stateOffb); /* <= MaxOff, by table construction */ U32 const llBits = LL_bits[llCode]; U32 const mlBits = ML_bits[mlCode]; @@ -891,15 +925,25 @@ static seq_t ZSTD_decodeSequence(seqState_t* seqState) 0, 1, 1, 5, 0xD, 0x1D, 0x3D, 0x7D, 0xFD, 0x1FD, 0x3FD, 0x7FD, 0xFFD, 0x1FFD, 0x3FFD, 0x7FFD, 0xFFFD, 0x1FFFD, 0x3FFFD, 0x7FFFD, 0xFFFFD, 0x1FFFFD, 0x3FFFFD, 0x7FFFFD, - 0xFFFFFD, 0x1FFFFFD, 0x3FFFFFD, 0x7FFFFFD, 0xFFFFFFD }; + 0xFFFFFD, 0x1FFFFFD, 0x3FFFFFD, 0x7FFFFFD, 0xFFFFFFD, 0x1FFFFFFD, 0x3FFFFFFD, 0x7FFFFFFD }; /* sequence */ { size_t offset; if (!ofCode) offset = 0; else { - offset = OF_base[ofCode] + BIT_readBitsFast(&seqState->DStream, ofBits); /* <= (ZSTD_WINDOWLOG_MAX-1) bits */ - if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream); + ZSTD_STATIC_ASSERT(ZSTD_lo_isLongOffset == 1); + ZSTD_STATIC_ASSERT(LONG_OFFSETS_MAX_EXTRA_BITS_32 == 5); + assert(ofBits <= MaxOff); + if (MEM_32bits() && longOffsets) { + U32 const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULATOR_MIN_32-1); + offset = OF_base[ofCode] + (BIT_readBitsFast(&seqState->DStream, ofBits - extraBits) << extraBits); + if (MEM_32bits() || extraBits) BIT_reloadDStream(&seqState->DStream); + if (extraBits) offset += BIT_readBitsFast(&seqState->DStream, extraBits); + } else { + offset = OF_base[ofCode] + BIT_readBitsFast(&seqState->DStream, ofBits); /* <= (ZSTD_WINDOWLOG_MAX-1) bits */ + if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream); + } } if (ofCode <= 1) { @@ -923,13 +967,17 @@ static seq_t ZSTD_decodeSequence(seqState_t* seqState) seq.matchLength = ML_base[mlCode] + ((mlCode>31) ? BIT_readBitsFast(&seqState->DStream, mlBits) : 0); /* <= 16 bits */ - if (MEM_32bits() && (mlBits+llBits>24)) BIT_reloadDStream(&seqState->DStream); + if (MEM_32bits() && (mlBits+llBits >= STREAM_ACCUMULATOR_MIN_32-LONG_OFFSETS_MAX_EXTRA_BITS_32)) + BIT_reloadDStream(&seqState->DStream); + if (MEM_64bits() && (totalBits >= STREAM_ACCUMULATOR_MIN_64-(LLFSELog+MLFSELog+OffFSELog))) + BIT_reloadDStream(&seqState->DStream); + /* Verify that there is enough bits to read the rest of the data in 64-bit mode. */ + ZSTD_STATIC_ASSERT(16+LLFSELog+MLFSELog+OffFSELog < STREAM_ACCUMULATOR_MIN_64); seq.litLength = LL_base[llCode] + ((llCode>15) ? BIT_readBitsFast(&seqState->DStream, llBits) : 0); /* <= 16 bits */ - if ( MEM_32bits() - || (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) - BIT_reloadDStream(&seqState->DStream); + if (MEM_32bits()) + BIT_reloadDStream(&seqState->DStream); DEBUGLOG(6, "seq: litL=%u, matchL=%u, offset=%u", (U32)seq.litLength, (U32)seq.matchLength, (U32)seq.offset); @@ -1028,7 +1076,8 @@ size_t ZSTD_execSequence(BYTE* op, static size_t ZSTD_decompressSequences( ZSTD_DCtx* dctx, void* dst, size_t maxDstSize, - const void* seqStart, size_t seqSize) + const void* seqStart, size_t seqSize, + const ZSTD_longOffset_e isLongOffset) { const BYTE* ip = (const BYTE*)seqStart; const BYTE* const iend = ip + seqSize; @@ -1063,7 +1112,7 @@ static size_t ZSTD_decompressSequences( for ( ; (BIT_reloadDStream(&(seqState.DStream)) <= BIT_DStream_completed) && nbSeq ; ) { nbSeq--; - { seq_t const sequence = ZSTD_decodeSequence(&seqState); + { seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset); size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litEnd, base, vBase, dictEnd); DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize); if (ZSTD_isError(oneSeqSize)) return oneSeqSize; @@ -1088,13 +1137,14 @@ static size_t ZSTD_decompressSequences( } -FORCE_INLINE_TEMPLATE seq_t ZSTD_decodeSequenceLong_generic(seqState_t* seqState, int const longOffsets) +HINT_INLINE +seq_t ZSTD_decodeSequenceLong(seqState_t* seqState, ZSTD_longOffset_e const longOffsets) { seq_t seq; U32 const llCode = FSE_peekSymbol(&seqState->stateLL); U32 const mlCode = FSE_peekSymbol(&seqState->stateML); - U32 const ofCode = FSE_peekSymbol(&seqState->stateOffb); /* <= maxOff, by table construction */ + U32 const ofCode = FSE_peekSymbol(&seqState->stateOffb); /* <= MaxOff, by table construction */ U32 const llBits = LL_bits[llCode]; U32 const mlBits = ML_bits[mlCode]; @@ -1121,15 +1171,18 @@ FORCE_INLINE_TEMPLATE seq_t ZSTD_decodeSequenceLong_generic(seqState_t* seqState 0, 1, 1, 5, 0xD, 0x1D, 0x3D, 0x7D, 0xFD, 0x1FD, 0x3FD, 0x7FD, 0xFFD, 0x1FFD, 0x3FFD, 0x7FFD, 0xFFFD, 0x1FFFD, 0x3FFFD, 0x7FFFD, 0xFFFFD, 0x1FFFFD, 0x3FFFFD, 0x7FFFFD, - 0xFFFFFD, 0x1FFFFFD, 0x3FFFFFD, 0x7FFFFFD, 0xFFFFFFD }; + 0xFFFFFD, 0x1FFFFFD, 0x3FFFFFD, 0x7FFFFFD, 0xFFFFFFD, 0x1FFFFFFD, 0x3FFFFFFD, 0x7FFFFFFD }; /* sequence */ { size_t offset; if (!ofCode) offset = 0; else { - if (longOffsets) { - int const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULATOR_MIN); + ZSTD_STATIC_ASSERT(ZSTD_lo_isLongOffset == 1); + ZSTD_STATIC_ASSERT(LONG_OFFSETS_MAX_EXTRA_BITS_32 == 5); + assert(ofBits <= MaxOff); + if (MEM_32bits() && longOffsets) { + U32 const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULATOR_MIN_32-1); offset = OF_base[ofCode] + (BIT_readBitsFast(&seqState->DStream, ofBits - extraBits) << extraBits); if (MEM_32bits() || extraBits) BIT_reloadDStream(&seqState->DStream); if (extraBits) offset += BIT_readBitsFast(&seqState->DStream, extraBits); @@ -1159,11 +1212,16 @@ FORCE_INLINE_TEMPLATE seq_t ZSTD_decodeSequenceLong_generic(seqState_t* seqState } seq.matchLength = ML_base[mlCode] + ((mlCode>31) ? BIT_readBitsFast(&seqState->DStream, mlBits) : 0); /* <= 16 bits */ - if (MEM_32bits() && (mlBits+llBits>24)) BIT_reloadDStream(&seqState->DStream); + if (MEM_32bits() && (mlBits+llBits >= STREAM_ACCUMULATOR_MIN_32-LONG_OFFSETS_MAX_EXTRA_BITS_32)) + BIT_reloadDStream(&seqState->DStream); + if (MEM_64bits() && (totalBits >= STREAM_ACCUMULATOR_MIN_64-(LLFSELog+MLFSELog+OffFSELog))) + BIT_reloadDStream(&seqState->DStream); + /* Verify that there is enough bits to read the rest of the data in 64-bit mode. */ + ZSTD_STATIC_ASSERT(16+LLFSELog+MLFSELog+OffFSELog < STREAM_ACCUMULATOR_MIN_64); seq.litLength = LL_base[llCode] + ((llCode>15) ? BIT_readBitsFast(&seqState->DStream, llBits) : 0); /* <= 16 bits */ - if (MEM_32bits() || - (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BIT_reloadDStream(&seqState->DStream); + if (MEM_32bits()) + BIT_reloadDStream(&seqState->DStream); { size_t const pos = seqState->pos + seq.litLength; seq.match = seqState->base + pos - seq.offset; /* single memory segment */ @@ -1180,19 +1238,12 @@ FORCE_INLINE_TEMPLATE seq_t ZSTD_decodeSequenceLong_generic(seqState_t* seqState return seq; } -static seq_t ZSTD_decodeSequenceLong(seqState_t* seqState, unsigned const windowSize) { - if (ZSTD_highbit32(windowSize) > STREAM_ACCUMULATOR_MIN) { - return ZSTD_decodeSequenceLong_generic(seqState, 1); - } else { - return ZSTD_decodeSequenceLong_generic(seqState, 0); - } -} HINT_INLINE size_t ZSTD_execSequenceLong(BYTE* op, - BYTE* const oend, seq_t sequence, - const BYTE** litPtr, const BYTE* const litLimit, - const BYTE* const base, const BYTE* const vBase, const BYTE* const dictEnd) + BYTE* const oend, seq_t sequence, + const BYTE** litPtr, const BYTE* const litLimit, + const BYTE* const base, const BYTE* const vBase, const BYTE* const dictEnd) { BYTE* const oLitEnd = op + sequence.litLength; size_t const sequenceLength = sequence.litLength + sequence.matchLength; @@ -1202,11 +1253,9 @@ size_t ZSTD_execSequenceLong(BYTE* op, const BYTE* match = sequence.match; /* check */ -#if 1 if (oMatchEnd>oend) return ERROR(dstSize_tooSmall); /* last match must start at a minimum distance of WILDCOPY_OVERLENGTH from oend */ if (iLitEnd > litLimit) return ERROR(corruption_detected); /* over-read beyond lit buffer */ if (oLitEnd>oend_w) return ZSTD_execSequenceLast7(op, oend, sequence, litPtr, litLimit, base, vBase, dictEnd); -#endif /* copy Literals */ ZSTD_copy8(op, *litPtr); @@ -1216,7 +1265,6 @@ size_t ZSTD_execSequenceLong(BYTE* op, *litPtr = iLitEnd; /* update for next sequence */ /* copy Match */ -#if 1 if (sequence.offset > (size_t)(oLitEnd - base)) { /* offset beyond prefix */ if (sequence.offset > (size_t)(oLitEnd - vBase)) return ERROR(corruption_detected); @@ -1236,8 +1284,8 @@ size_t ZSTD_execSequenceLong(BYTE* op, return sequenceLength; } } } - /* Requirement: op <= oend_w && sequence.matchLength >= MINMATCH */ -#endif + assert(op <= oend_w); + assert(sequence.matchLength >= MINMATCH); /* match within prefix */ if (sequence.offset < 8) { @@ -1273,7 +1321,8 @@ size_t ZSTD_execSequenceLong(BYTE* op, static size_t ZSTD_decompressSequencesLong( ZSTD_DCtx* dctx, void* dst, size_t maxDstSize, - const void* seqStart, size_t seqSize) + const void* seqStart, size_t seqSize, + const ZSTD_longOffset_e isLongOffset) { const BYTE* ip = (const BYTE*)seqStart; const BYTE* const iend = ip + seqSize; @@ -1285,7 +1334,6 @@ static size_t ZSTD_decompressSequencesLong( const BYTE* const base = (const BYTE*) (dctx->base); const BYTE* const vBase = (const BYTE*) (dctx->vBase); const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd); - unsigned const windowSize32 = (unsigned)dctx->fParams.windowSize; int nbSeq; /* Build Decoding Tables */ @@ -1315,13 +1363,13 @@ static size_t ZSTD_decompressSequencesLong( /* prepare in advance */ for (seqNb=0; (BIT_reloadDStream(&seqState.DStream) <= BIT_DStream_completed) && seqNbfParams.windowSize > (1ULL << STREAM_ACCUMULATOR_MIN))); + /* windowSize could be any value at this point, since it is only validated + * in the streaming API. + */ + DEBUGLOG(5, "ZSTD_decompressBlock_internal (size : %u)", (U32)srcSize); if (srcSize >= ZSTD_BLOCKSIZE_MAX) return ERROR(srcSize_wrong); @@ -1369,13 +1427,9 @@ static size_t ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx, ip += litCSize; srcSize -= litCSize; } - if (sizeof(size_t) > 4) /* do not enable prefetching on 32-bits x86, as it's performance detrimental */ - /* likely because of register pressure */ - /* if that's the correct cause, then 32-bits ARM should be affected differently */ - /* it would be good to test this on ARM real hardware, to see if prefetch version improves speed */ - if (dctx->fParams.windowSize > (1<<23)) - return ZSTD_decompressSequencesLong(dctx, dst, dstCapacity, ip, srcSize); - return ZSTD_decompressSequences(dctx, dst, dstCapacity, ip, srcSize); + if (frame && dctx->fParams.windowSize > (1<<23)) + return ZSTD_decompressSequencesLong(dctx, dst, dstCapacity, ip, srcSize, isLongOffset); + return ZSTD_decompressSequences(dctx, dst, dstCapacity, ip, srcSize, isLongOffset); } @@ -1395,7 +1449,7 @@ size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx, { size_t dSize; ZSTD_checkContinuity(dctx, dst); - dSize = ZSTD_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize); + dSize = ZSTD_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize, /* frame */ 0); dctx->previousDstEnd = (char*)dst + dSize; return dSize; } @@ -1411,7 +1465,7 @@ ZSTDLIB_API size_t ZSTD_insertBlock(ZSTD_DCtx* dctx, const void* blockStart, siz } -size_t ZSTD_generateNxBytes(void* dst, size_t dstCapacity, BYTE byte, size_t length) +static size_t ZSTD_generateNxBytes(void* dst, size_t dstCapacity, BYTE byte, size_t length) { if (length > dstCapacity) return ERROR(dstSize_tooSmall); memset(dst, byte, length); @@ -1431,7 +1485,7 @@ size_t ZSTD_findFrameCompressedSize(const void *src, size_t srcSize) #endif if ( (srcSize >= ZSTD_skippableHeaderSize) && (MEM_readLE32(src) & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START ) { - return ZSTD_skippableHeaderSize + MEM_readLE32((const BYTE*)src + 4); + return ZSTD_skippableHeaderSize + MEM_readLE32((const BYTE*)src + ZSTD_frameIdSize); } else { const BYTE* ip = (const BYTE*)src; const BYTE* const ipstart = ip; @@ -1511,7 +1565,7 @@ static size_t ZSTD_decompressFrame(ZSTD_DCtx* dctx, switch(blockProperties.blockType) { case bt_compressed: - decodedSize = ZSTD_decompressBlock_internal(dctx, op, oend-op, ip, cBlockSize); + decodedSize = ZSTD_decompressBlock_internal(dctx, op, oend-op, ip, cBlockSize, /* frame */ 1); break; case bt_raw : decodedSize = ZSTD_copyRawBlock(op, oend-op, ip, cBlockSize); @@ -1533,6 +1587,10 @@ static size_t ZSTD_decompressFrame(ZSTD_DCtx* dctx, if (blockProperties.lastBlock) break; } + if (dctx->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN) { + if ((U64)(op-ostart) != dctx->fParams.frameContentSize) { + return ERROR(corruption_detected); + } } if (dctx->fParams.checksumFlag) { /* Frame content checksum verification */ U32 const checkCalc = (U32)XXH64_digest(&dctx->xxhState); U32 checkRead; @@ -1590,13 +1648,15 @@ static size_t ZSTD_decompressMultiFrame(ZSTD_DCtx* dctx, #endif magicNumber = MEM_readLE32(src); + DEBUGLOG(4, "reading magic number %08X (expecting %08X)", + (U32)magicNumber, (U32)ZSTD_MAGICNUMBER); if (magicNumber != ZSTD_MAGICNUMBER) { if ((magicNumber & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START) { size_t skippableSize; if (srcSize < ZSTD_skippableHeaderSize) return ERROR(srcSize_wrong); - skippableSize = MEM_readLE32((const BYTE *)src + 4) + - ZSTD_skippableHeaderSize; + skippableSize = MEM_readLE32((const BYTE*)src + ZSTD_frameIdSize) + + ZSTD_skippableHeaderSize; if (srcSize < skippableSize) return ERROR(srcSize_wrong); src = (const BYTE *)src + skippableSize; @@ -1699,33 +1759,31 @@ size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, c { DEBUGLOG(5, "ZSTD_decompressContinue"); /* Sanity check */ - if (srcSize != dctx->expected) return ERROR(srcSize_wrong); /* unauthorized */ + if (srcSize != dctx->expected) return ERROR(srcSize_wrong); /* not allowed */ if (dstCapacity) ZSTD_checkContinuity(dctx, dst); switch (dctx->stage) { case ZSTDds_getFrameHeaderSize : - if (srcSize != ZSTD_frameHeaderSize_prefix) return ERROR(srcSize_wrong); /* unauthorized */ assert(src != NULL); - if ((MEM_readLE32(src) & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START) { /* skippable frame */ - memcpy(dctx->headerBuffer, src, ZSTD_frameHeaderSize_prefix); - dctx->expected = ZSTD_skippableHeaderSize - ZSTD_frameHeaderSize_prefix; /* magic number + skippable frame length */ - dctx->stage = ZSTDds_decodeSkippableHeader; - return 0; - } - dctx->headerSize = ZSTD_frameHeaderSize(src, ZSTD_frameHeaderSize_prefix); + if (dctx->format == ZSTD_f_zstd1) { /* allows header */ + assert(srcSize >= ZSTD_frameIdSize); /* to read skippable magic number */ + if ((MEM_readLE32(src) & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START) { /* skippable frame */ + memcpy(dctx->headerBuffer, src, srcSize); + dctx->expected = ZSTD_skippableHeaderSize - srcSize; /* remaining to load to get full skippable frame header */ + dctx->stage = ZSTDds_decodeSkippableHeader; + return 0; + } } + dctx->headerSize = ZSTD_frameHeaderSize_internal(src, srcSize, dctx->format); if (ZSTD_isError(dctx->headerSize)) return dctx->headerSize; - memcpy(dctx->headerBuffer, src, ZSTD_frameHeaderSize_prefix); - if (dctx->headerSize > ZSTD_frameHeaderSize_prefix) { - dctx->expected = dctx->headerSize - ZSTD_frameHeaderSize_prefix; - dctx->stage = ZSTDds_decodeFrameHeader; - return 0; - } - dctx->expected = 0; /* not necessary to copy more */ - /* fall-through */ + memcpy(dctx->headerBuffer, src, srcSize); + dctx->expected = dctx->headerSize - srcSize; + dctx->stage = ZSTDds_decodeFrameHeader; + return 0; + case ZSTDds_decodeFrameHeader: assert(src != NULL); - memcpy(dctx->headerBuffer + ZSTD_frameHeaderSize_prefix, src, dctx->expected); + memcpy(dctx->headerBuffer + (dctx->headerSize - srcSize), src, srcSize); CHECK_F(ZSTD_decodeFrameHeader(dctx, dctx->headerBuffer, dctx->headerSize)); dctx->expected = ZSTD_blockHeaderSize; dctx->stage = ZSTDds_decodeBlockHeader; @@ -1757,6 +1815,7 @@ size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, c } return 0; } + case ZSTDds_decompressLastBlock: case ZSTDds_decompressBlock: DEBUGLOG(5, "case ZSTDds_decompressBlock"); @@ -1765,7 +1824,7 @@ size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, c { case bt_compressed: DEBUGLOG(5, "case bt_compressed"); - rSize = ZSTD_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize); + rSize = ZSTD_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize, /* frame */ 1); break; case bt_raw : rSize = ZSTD_copyRawBlock(dst, dstCapacity, src, srcSize); @@ -1778,9 +1837,16 @@ size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, c return ERROR(corruption_detected); } if (ZSTD_isError(rSize)) return rSize; + DEBUGLOG(5, "decoded size from block : %u", (U32)rSize); + dctx->decodedSize += rSize; if (dctx->fParams.checksumFlag) XXH64_update(&dctx->xxhState, dst, rSize); if (dctx->stage == ZSTDds_decompressLastBlock) { /* end of frame */ + DEBUGLOG(4, "decoded size from frame : %u", (U32)dctx->decodedSize); + if (dctx->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN) { + if (dctx->decodedSize != dctx->fParams.frameContentSize) { + return ERROR(corruption_detected); + } } if (dctx->fParams.checksumFlag) { /* another round for frame checksum */ dctx->expected = 4; dctx->stage = ZSTDds_checkChecksum; @@ -1795,26 +1861,31 @@ size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, c } return rSize; } + case ZSTDds_checkChecksum: + assert(srcSize == 4); /* guaranteed by dctx->expected */ { U32 const h32 = (U32)XXH64_digest(&dctx->xxhState); - U32 const check32 = MEM_readLE32(src); /* srcSize == 4, guaranteed by dctx->expected */ + U32 const check32 = MEM_readLE32(src); + DEBUGLOG(4, "checksum : calculated %08X :: %08X read", h32, check32); if (check32 != h32) return ERROR(checksum_wrong); dctx->expected = 0; dctx->stage = ZSTDds_getFrameHeaderSize; return 0; } + case ZSTDds_decodeSkippableHeader: - { assert(src != NULL); - memcpy(dctx->headerBuffer + ZSTD_frameHeaderSize_prefix, src, dctx->expected); - dctx->expected = MEM_readLE32(dctx->headerBuffer + 4); - dctx->stage = ZSTDds_skipFrame; - return 0; - } + assert(src != NULL); + assert(srcSize <= ZSTD_skippableHeaderSize); + memcpy(dctx->headerBuffer + (ZSTD_skippableHeaderSize - srcSize), src, srcSize); /* complete skippable header */ + dctx->expected = MEM_readLE32(dctx->headerBuffer + ZSTD_frameIdSize); /* note : dctx->expected can grow seriously large, beyond local buffer size */ + dctx->stage = ZSTDds_skipFrame; + return 0; + case ZSTDds_skipFrame: - { dctx->expected = 0; - dctx->stage = ZSTDds_getFrameHeaderSize; - return 0; - } + dctx->expected = 0; + dctx->stage = ZSTDds_getFrameHeaderSize; + return 0; + default: return ERROR(GENERIC); /* impossible */ } @@ -1895,7 +1966,7 @@ static size_t ZSTD_decompress_insertDictionary(ZSTD_DCtx* dctx, const void* dict if (magic != ZSTD_MAGIC_DICTIONARY) { return ZSTD_refDictContent(dctx, dict, dictSize); /* pure content mode */ } } - dctx->dictID = MEM_readLE32((const char*)dict + 4); + dctx->dictID = MEM_readLE32((const char*)dict + ZSTD_frameIdSize); /* load entropy tables */ { size_t const eSize = ZSTD_loadEntropy(&dctx->entropy, dict, dictSize); @@ -1909,6 +1980,29 @@ static size_t ZSTD_decompress_insertDictionary(ZSTD_DCtx* dctx, const void* dict return ZSTD_refDictContent(dctx, dict, dictSize); } +/* Note : this function cannot fail */ +size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx) +{ + assert(dctx != NULL); + dctx->expected = ZSTD_startingInputLength(dctx->format); /* dctx->format must be properly set */ + dctx->stage = ZSTDds_getFrameHeaderSize; + dctx->decodedSize = 0; + dctx->previousDstEnd = NULL; + dctx->base = NULL; + dctx->vBase = NULL; + dctx->dictEnd = NULL; + dctx->entropy.hufTable[0] = (HUF_DTable)((HufLog)*0x1000001); /* cover both little and big endian */ + dctx->litEntropy = dctx->fseEntropy = 0; + dctx->dictID = 0; + ZSTD_STATIC_ASSERT(sizeof(dctx->entropy.rep) == sizeof(repStartValue)); + memcpy(dctx->entropy.rep, repStartValue, sizeof(repStartValue)); /* initial repcodes */ + dctx->LLTptr = dctx->entropy.LLTable; + dctx->MLTptr = dctx->entropy.MLTable; + dctx->OFTptr = dctx->entropy.OFTable; + dctx->HUFptr = dctx->entropy.hufTable; + return 0; +} + size_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize) { CHECK_F( ZSTD_decompressBegin(dctx) ); @@ -1975,7 +2069,7 @@ static size_t ZSTD_loadEntropy_inDDict(ZSTD_DDict* ddict) { U32 const magic = MEM_readLE32(ddict->dictContent); if (magic != ZSTD_MAGIC_DICTIONARY) return 0; /* pure content mode */ } - ddict->dictID = MEM_readLE32((const char*)ddict->dictContent + 4); + ddict->dictID = MEM_readLE32((const char*)ddict->dictContent + ZSTD_frameIdSize); /* load entropy tables */ CHECK_E( ZSTD_loadEntropy(&ddict->entropy, ddict->dictContent, ddict->dictSize), dictionary_corrupted ); @@ -1984,9 +2078,9 @@ static size_t ZSTD_loadEntropy_inDDict(ZSTD_DDict* ddict) } -static size_t ZSTD_initDDict_internal(ZSTD_DDict* ddict, const void* dict, size_t dictSize, unsigned byReference) +static size_t ZSTD_initDDict_internal(ZSTD_DDict* ddict, const void* dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod) { - if ((byReference) || (!dict) || (!dictSize)) { + if ((dictLoadMethod == ZSTD_dlm_byRef) || (!dict) || (!dictSize)) { ddict->dictBuffer = NULL; ddict->dictContent = dict; } else { @@ -2005,7 +2099,7 @@ static size_t ZSTD_initDDict_internal(ZSTD_DDict* ddict, const void* dict, size_ return 0; } -ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize, unsigned byReference, ZSTD_customMem customMem) +ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_customMem customMem) { if (!customMem.customAlloc ^ !customMem.customFree) return NULL; @@ -2013,7 +2107,7 @@ ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize, unsigne if (!ddict) return NULL; ddict->cMem = customMem; - if (ZSTD_isError( ZSTD_initDDict_internal(ddict, dict, dictSize, byReference) )) { + if (ZSTD_isError( ZSTD_initDDict_internal(ddict, dict, dictSize, dictLoadMethod) )) { ZSTD_freeDDict(ddict); return NULL; } @@ -2029,7 +2123,7 @@ ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize, unsigne ZSTD_DDict* ZSTD_createDDict(const void* dict, size_t dictSize) { ZSTD_customMem const allocator = { NULL, NULL, NULL }; - return ZSTD_createDDict_advanced(dict, dictSize, 0, allocator); + return ZSTD_createDDict_advanced(dict, dictSize, ZSTD_dlm_byCopy, allocator); } /*! ZSTD_createDDict_byReference() : @@ -2039,25 +2133,26 @@ ZSTD_DDict* ZSTD_createDDict(const void* dict, size_t dictSize) ZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, size_t dictSize) { ZSTD_customMem const allocator = { NULL, NULL, NULL }; - return ZSTD_createDDict_advanced(dictBuffer, dictSize, 1, allocator); + return ZSTD_createDDict_advanced(dictBuffer, dictSize, ZSTD_dlm_byRef, allocator); } ZSTD_DDict* ZSTD_initStaticDDict(void* workspace, size_t workspaceSize, const void* dict, size_t dictSize, - unsigned byReference) + ZSTD_dictLoadMethod_e dictLoadMethod) { - size_t const neededSpace = sizeof(ZSTD_DDict) + (byReference ? 0 : dictSize); + size_t const neededSpace = + sizeof(ZSTD_DDict) + (dictLoadMethod == ZSTD_dlm_byRef ? 0 : dictSize); ZSTD_DDict* const ddict = (ZSTD_DDict*)workspace; assert(workspace != NULL); assert(dict != NULL); if ((size_t)workspace & 7) return NULL; /* 8-aligned */ if (workspaceSize < neededSpace) return NULL; - if (!byReference) { + if (dictLoadMethod == ZSTD_dlm_byCopy) { memcpy(ddict+1, dict, dictSize); /* local copy */ dict = ddict+1; } - if (ZSTD_isError( ZSTD_initDDict_internal(ddict, dict, dictSize, 1 /* byRef */) )) + if (ZSTD_isError( ZSTD_initDDict_internal(ddict, dict, dictSize, ZSTD_dlm_byRef) )) return NULL; return ddict; } @@ -2075,10 +2170,10 @@ size_t ZSTD_freeDDict(ZSTD_DDict* ddict) /*! ZSTD_estimateDDictSize() : * Estimate amount of memory that will be needed to create a dictionary for decompression. - * Note : dictionary created "byReference" are smaller */ -size_t ZSTD_estimateDDictSize(size_t dictSize, unsigned byReference) + * Note : dictionary created by reference using ZSTD_dlm_byRef are smaller */ +size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod) { - return sizeof(ZSTD_DDict) + (byReference ? 0 : dictSize); + return sizeof(ZSTD_DDict) + (dictLoadMethod == ZSTD_dlm_byRef ? 0 : dictSize); } size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict) @@ -2095,7 +2190,7 @@ unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize) { if (dictSize < 8) return 0; if (MEM_readLE32(dict) != ZSTD_MAGIC_DICTIONARY) return 0; - return MEM_readLE32((const char*)dict + 4); + return MEM_readLE32((const char*)dict + ZSTD_frameIdSize); } /*! ZSTD_getDictID_fromDDict() : @@ -2123,7 +2218,7 @@ unsigned ZSTD_getDictID_fromDDict(const ZSTD_DDict* ddict) * ZSTD_getFrameHeader(), which will provide a more precise error code. */ unsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize) { - ZSTD_frameHeader zfp = { 0, 0, ZSTD_frame, 0, 0, 0 }; + ZSTD_frameHeader zfp = { 0, 0, 0, ZSTD_frame, 0, 0, 0 }; size_t const hError = ZSTD_getFrameHeader(&zfp, src, srcSize); if (ZSTD_isError(hError)) return 0; return zfp.dictID; @@ -2190,13 +2285,15 @@ size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t di return ZSTD_frameHeaderSize_prefix; } +/* note : this variant can't fail */ size_t ZSTD_initDStream(ZSTD_DStream* zds) { return ZSTD_initDStream_usingDict(zds, NULL, 0); } /* ZSTD_initDStream_usingDDict() : - * ddict will just be referenced, and must outlive decompression session */ + * ddict will just be referenced, and must outlive decompression session + * this function cannot fail */ size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict) { size_t const initResult = ZSTD_initDStream(zds); @@ -2216,31 +2313,66 @@ size_t ZSTD_resetDStream(ZSTD_DStream* zds) size_t ZSTD_setDStreamParameter(ZSTD_DStream* zds, ZSTD_DStreamParameter_e paramType, unsigned paramValue) { + ZSTD_STATIC_ASSERT((unsigned)zdss_loadHeader >= (unsigned)zdss_init); + if ((unsigned)zds->streamStage > (unsigned)zdss_loadHeader) + return ERROR(stage_wrong); switch(paramType) { default : return ERROR(parameter_unsupported); - case DStream_p_maxWindowSize : zds->maxWindowSize = paramValue ? paramValue : (U32)(-1); break; + case DStream_p_maxWindowSize : + DEBUGLOG(4, "setting maxWindowSize = %u KB", paramValue >> 10); + zds->maxWindowSize = paramValue ? paramValue : (U32)(-1); + break; } return 0; } +size_t ZSTD_DCtx_setMaxWindowSize(ZSTD_DCtx* dctx, size_t maxWindowSize) +{ + ZSTD_STATIC_ASSERT((unsigned)zdss_loadHeader >= (unsigned)zdss_init); + if ((unsigned)dctx->streamStage > (unsigned)zdss_loadHeader) + return ERROR(stage_wrong); + dctx->maxWindowSize = maxWindowSize; + return 0; +} + +size_t ZSTD_DCtx_setFormat(ZSTD_DCtx* dctx, ZSTD_format_e format) +{ + DEBUGLOG(4, "ZSTD_DCtx_setFormat : %u", (unsigned)format); + ZSTD_STATIC_ASSERT((unsigned)zdss_loadHeader >= (unsigned)zdss_init); + if ((unsigned)dctx->streamStage > (unsigned)zdss_loadHeader) + return ERROR(stage_wrong); + dctx->format = format; + return 0; +} + size_t ZSTD_sizeof_DStream(const ZSTD_DStream* zds) { return ZSTD_sizeof_DCtx(zds); } +size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize) +{ + size_t const blockSize = (size_t) MIN(windowSize, ZSTD_BLOCKSIZE_MAX); + unsigned long long const neededRBSize = windowSize + blockSize + (WILDCOPY_OVERLENGTH * 2); + unsigned long long const neededSize = MIN(frameContentSize, neededRBSize); + size_t const minRBSize = (size_t) neededSize; + if ((unsigned long long)minRBSize != neededSize) return ERROR(frameParameter_windowTooLarge); + return minRBSize; +} + size_t ZSTD_estimateDStreamSize(size_t windowSize) { size_t const blockSize = MIN(windowSize, ZSTD_BLOCKSIZE_MAX); size_t const inBuffSize = blockSize; /* no block can be larger */ - size_t const outBuffSize = windowSize + blockSize + (WILDCOPY_OVERLENGTH * 2); + size_t const outBuffSize = ZSTD_decodingBufferSize_min(windowSize, ZSTD_CONTENTSIZE_UNKNOWN); return ZSTD_estimateDCtxSize() + inBuffSize + outBuffSize; } -ZSTDLIB_API size_t ZSTD_estimateDStreamSize_fromFrame(const void* src, size_t srcSize) +size_t ZSTD_estimateDStreamSize_fromFrame(const void* src, size_t srcSize) { - U32 const windowSizeMax = 1U << ZSTD_WINDOWLOG_MAX; + U32 const windowSizeMax = 1U << ZSTD_WINDOWLOG_MAX; /* note : should be user-selectable */ ZSTD_frameHeader zfh; size_t const err = ZSTD_getFrameHeader(&zfh, src, srcSize); if (ZSTD_isError(err)) return err; @@ -2272,7 +2404,18 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB U32 someMoreWork = 1; DEBUGLOG(5, "ZSTD_decompressStream"); + if (input->pos > input->size) { /* forbidden */ + DEBUGLOG(5, "in: pos: %u vs size: %u", + (U32)input->pos, (U32)input->size); + return ERROR(srcSize_wrong); + } + if (output->pos > output->size) { /* forbidden */ + DEBUGLOG(5, "out: pos: %u vs size: %u", + (U32)output->pos, (U32)output->size); + return ERROR(dstSize_tooSmall); + } DEBUGLOG(5, "input size : %u", (U32)(input->size - input->pos)); + #if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1) if (zds->legacyVersion) { /* legacy support is incompatible with static dctx */ @@ -2289,7 +2432,9 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB /* fall-through */ case zdss_loadHeader : - { size_t const hSize = ZSTD_getFrameHeader(&zds->fParams, zds->headerBuffer, zds->lhSize); + DEBUGLOG(5, "stage zdss_loadHeader (srcSize : %u)", (U32)(iend - ip)); + { size_t const hSize = ZSTD_getFrameHeader_internal(&zds->fParams, zds->headerBuffer, zds->lhSize, zds->format); + DEBUGLOG(5, "header size : %u", (U32)hSize); if (ZSTD_isError(hSize)) { #if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1) U32 const legacyVersion = ZSTD_isLegacy(istart, iend-istart); @@ -2342,7 +2487,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB CHECK_F(ZSTD_decompressBegin_usingDDict(zds, zds->ddict)); if ((MEM_readLE32(zds->headerBuffer) & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START) { /* skippable frame */ - zds->expected = MEM_readLE32(zds->headerBuffer + 4); + zds->expected = MEM_readLE32(zds->headerBuffer + ZSTD_frameIdSize); zds->stage = ZSTDds_skipFrame; } else { CHECK_F(ZSTD_decodeFrameHeader(zds, zds->headerBuffer, zds->lhSize)); @@ -2351,20 +2496,20 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB } /* control buffer memory usage */ - DEBUGLOG(4, "Control max buffer memory usage"); + DEBUGLOG(4, "Control max buffer memory usage (max %u KB)", + (U32)(zds->maxWindowSize >> 10)); zds->fParams.windowSize = MAX(zds->fParams.windowSize, 1U << ZSTD_WINDOWLOG_ABSOLUTEMIN); if (zds->fParams.windowSize > zds->maxWindowSize) return ERROR(frameParameter_windowTooLarge); /* Adapt buffer sizes to frame header instructions */ - { size_t const blockSize = (size_t)(MIN(zds->fParams.windowSize, ZSTD_BLOCKSIZE_MAX)); - size_t const neededOutSize = (size_t)(zds->fParams.windowSize + blockSize + WILDCOPY_OVERLENGTH * 2); - zds->blockSize = blockSize; - if ((zds->inBuffSize < blockSize) || (zds->outBuffSize < neededOutSize)) { - size_t const bufferSize = blockSize + neededOutSize; + { size_t const neededInBuffSize = MAX(zds->fParams.blockSizeMax, 4 /* frame checksum */); + size_t const neededOutBuffSize = ZSTD_decodingBufferSize_min(zds->fParams.windowSize, zds->fParams.frameContentSize); + if ((zds->inBuffSize < neededInBuffSize) || (zds->outBuffSize < neededOutBuffSize)) { + size_t const bufferSize = neededInBuffSize + neededOutBuffSize; DEBUGLOG(4, "inBuff : from %u to %u", - (U32)zds->inBuffSize, (U32)blockSize); + (U32)zds->inBuffSize, (U32)neededInBuffSize); DEBUGLOG(4, "outBuff : from %u to %u", - (U32)zds->outBuffSize, (U32)neededOutSize); + (U32)zds->outBuffSize, (U32)neededOutBuffSize); if (zds->staticSize) { /* static DCtx */ DEBUGLOG(4, "staticSize : %u", (U32)zds->staticSize); assert(zds->staticSize >= sizeof(ZSTD_DCtx)); /* controlled at init */ @@ -2377,9 +2522,9 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB zds->inBuff = (char*)ZSTD_malloc(bufferSize, zds->customMem); if (zds->inBuff == NULL) return ERROR(memory_allocation); } - zds->inBuffSize = blockSize; + zds->inBuffSize = neededInBuffSize; zds->outBuff = zds->inBuff + zds->inBuffSize; - zds->outBuffSize = neededOutSize; + zds->outBuffSize = neededOutBuffSize; } } zds->streamStage = zdss_read; /* fall-through */ @@ -2437,8 +2582,13 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB zds->outStart += flushedSize; if (flushedSize == toFlushSize) { /* flush completed */ zds->streamStage = zdss_read; - if (zds->outStart + zds->blockSize > zds->outBuffSize) + if ( (zds->outBuffSize < zds->fParams.frameContentSize) + && (zds->outStart + zds->fParams.blockSizeMax > zds->outBuffSize) ) { + DEBUGLOG(5, "restart filling outBuff from beginning (left:%i, needed:%u)", + (int)(zds->outBuffSize - zds->outStart), + (U32)zds->fParams.blockSizeMax); zds->outStart = zds->outEnd = 0; + } break; } } /* cannot complete flush */ @@ -2476,3 +2626,30 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB return nextSrcSizeHint; } } + + +size_t ZSTD_decompress_generic(ZSTD_DCtx* dctx, ZSTD_outBuffer* output, ZSTD_inBuffer* input) +{ + return ZSTD_decompressStream(dctx, output, input); +} + +size_t ZSTD_decompress_generic_simpleArgs ( + ZSTD_DCtx* dctx, + void* dst, size_t dstCapacity, size_t* dstPos, + const void* src, size_t srcSize, size_t* srcPos) +{ + ZSTD_outBuffer output = { dst, dstCapacity, *dstPos }; + ZSTD_inBuffer input = { src, srcSize, *srcPos }; + /* ZSTD_compress_generic() will check validity of dstPos and srcPos */ + size_t const cErr = ZSTD_decompress_generic(dctx, &output, &input); + *dstPos = output.pos; + *srcPos = input.pos; + return cErr; +} + +void ZSTD_DCtx_reset(ZSTD_DCtx* dctx) +{ + (void)ZSTD_initDStream(dctx); + dctx->format = ZSTD_f_zstd1; + dctx->maxWindowSize = ZSTD_MAXWINDOWSIZE_DEFAULT; +} diff --git a/contrib/zstd/lib/deprecated/zbuff.h b/sys/contrib/zstd/lib/deprecated/zbuff.h similarity index 99% rename from contrib/zstd/lib/deprecated/zbuff.h rename to sys/contrib/zstd/lib/deprecated/zbuff.h index e6ea84ad3b45..a93115da4a1c 100644 --- a/contrib/zstd/lib/deprecated/zbuff.h +++ b/sys/contrib/zstd/lib/deprecated/zbuff.h @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ /* *************************************************************** diff --git a/contrib/zstd/lib/deprecated/zbuff_common.c b/sys/contrib/zstd/lib/deprecated/zbuff_common.c similarity index 93% rename from contrib/zstd/lib/deprecated/zbuff_common.c rename to sys/contrib/zstd/lib/deprecated/zbuff_common.c index 2de45bec1705..661b9b0e18c5 100644 --- a/contrib/zstd/lib/deprecated/zbuff_common.c +++ b/sys/contrib/zstd/lib/deprecated/zbuff_common.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ /*-************************************* diff --git a/contrib/zstd/lib/deprecated/zbuff_compress.c b/sys/contrib/zstd/lib/deprecated/zbuff_compress.c similarity index 98% rename from contrib/zstd/lib/deprecated/zbuff_compress.c rename to sys/contrib/zstd/lib/deprecated/zbuff_compress.c index 4444e95d8fd1..8adbaec260d5 100644 --- a/contrib/zstd/lib/deprecated/zbuff_compress.c +++ b/sys/contrib/zstd/lib/deprecated/zbuff_compress.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ diff --git a/contrib/zstd/lib/deprecated/zbuff_decompress.c b/sys/contrib/zstd/lib/deprecated/zbuff_decompress.c similarity index 96% rename from contrib/zstd/lib/deprecated/zbuff_decompress.c rename to sys/contrib/zstd/lib/deprecated/zbuff_decompress.c index a819d7f40429..923c22b73c57 100644 --- a/contrib/zstd/lib/deprecated/zbuff_decompress.c +++ b/sys/contrib/zstd/lib/deprecated/zbuff_decompress.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ diff --git a/contrib/zstd/lib/dictBuilder/cover.c b/sys/contrib/zstd/lib/dictBuilder/cover.c similarity index 95% rename from contrib/zstd/lib/dictBuilder/cover.c rename to sys/contrib/zstd/lib/dictBuilder/cover.c index 3d445ae8b81d..efdffddbf930 100644 --- a/contrib/zstd/lib/dictBuilder/cover.c +++ b/sys/contrib/zstd/lib/dictBuilder/cover.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ /* ***************************************************************************** @@ -382,7 +383,7 @@ static void COVER_group(COVER_ctx_t *ctx, const void *group, typedef struct { U32 begin; U32 end; - double score; + U32 score; } COVER_segment_t; /** @@ -479,11 +480,16 @@ static COVER_segment_t COVER_selectSegment(const COVER_ctx_t *ctx, U32 *freqs, * Check the validity of the parameters. * Returns non-zero if the parameters are valid and 0 otherwise. */ -static int COVER_checkParameters(ZDICT_cover_params_t parameters) { +static int COVER_checkParameters(ZDICT_cover_params_t parameters, + size_t maxDictSize) { /* k and d are required parameters */ if (parameters.d == 0 || parameters.k == 0) { return 0; } + /* k <= maxDictSize */ + if (parameters.k > maxDictSize) { + return 0; + } /* d <= k */ if (parameters.d > parameters.k) { return 0; @@ -622,9 +628,13 @@ static size_t COVER_buildDictionary(const COVER_ctx_t *ctx, U32 *freqs, /* Select a segment */ COVER_segment_t segment = COVER_selectSegment( ctx, freqs, activeDmers, epochBegin, epochEnd, parameters); - /* Trim the segment if necessary and if it is empty then we are done */ + /* If the segment covers no dmers, then we are out of content */ + if (segment.score == 0) { + break; + } + /* Trim the segment if necessary and if it is too small then we are done */ segmentSize = MIN(segment.end - segment.begin + parameters.d - 1, tail); - if (segmentSize == 0) { + if (segmentSize < parameters.d) { break; } /* We fill the dictionary from the back to allow the best segments to be @@ -648,7 +658,7 @@ ZDICTLIB_API size_t ZDICT_trainFromBuffer_cover( COVER_ctx_t ctx; COVER_map_t activeDmers; /* Checks */ - if (!COVER_checkParameters(parameters)) { + if (!COVER_checkParameters(parameters, dictBufferCapacity)) { DISPLAYLEVEL(1, "Cover parameters incorrect\n"); return ERROR(GENERIC); } @@ -701,8 +711,8 @@ ZDICTLIB_API size_t ZDICT_trainFromBuffer_cover( * compiled with multithreaded support. */ typedef struct COVER_best_s { - pthread_mutex_t mutex; - pthread_cond_t cond; + ZSTD_pthread_mutex_t mutex; + ZSTD_pthread_cond_t cond; size_t liveJobs; void *dict; size_t dictSize; @@ -715,8 +725,8 @@ typedef struct COVER_best_s { */ static void COVER_best_init(COVER_best_t *best) { if (best==NULL) return; /* compatible with init on NULL */ - (void)pthread_mutex_init(&best->mutex, NULL); - (void)pthread_cond_init(&best->cond, NULL); + (void)ZSTD_pthread_mutex_init(&best->mutex, NULL); + (void)ZSTD_pthread_cond_init(&best->cond, NULL); best->liveJobs = 0; best->dict = NULL; best->dictSize = 0; @@ -731,11 +741,11 @@ static void COVER_best_wait(COVER_best_t *best) { if (!best) { return; } - pthread_mutex_lock(&best->mutex); + ZSTD_pthread_mutex_lock(&best->mutex); while (best->liveJobs != 0) { - pthread_cond_wait(&best->cond, &best->mutex); + ZSTD_pthread_cond_wait(&best->cond, &best->mutex); } - pthread_mutex_unlock(&best->mutex); + ZSTD_pthread_mutex_unlock(&best->mutex); } /** @@ -749,8 +759,8 @@ static void COVER_best_destroy(COVER_best_t *best) { if (best->dict) { free(best->dict); } - pthread_mutex_destroy(&best->mutex); - pthread_cond_destroy(&best->cond); + ZSTD_pthread_mutex_destroy(&best->mutex); + ZSTD_pthread_cond_destroy(&best->cond); } /** @@ -761,9 +771,9 @@ static void COVER_best_start(COVER_best_t *best) { if (!best) { return; } - pthread_mutex_lock(&best->mutex); + ZSTD_pthread_mutex_lock(&best->mutex); ++best->liveJobs; - pthread_mutex_unlock(&best->mutex); + ZSTD_pthread_mutex_unlock(&best->mutex); } /** @@ -779,7 +789,7 @@ static void COVER_best_finish(COVER_best_t *best, size_t compressedSize, } { size_t liveJobs; - pthread_mutex_lock(&best->mutex); + ZSTD_pthread_mutex_lock(&best->mutex); --best->liveJobs; liveJobs = best->liveJobs; /* If the new dictionary is better */ @@ -802,9 +812,9 @@ static void COVER_best_finish(COVER_best_t *best, size_t compressedSize, best->parameters = parameters; best->compressedSize = compressedSize; } - pthread_mutex_unlock(&best->mutex); + ZSTD_pthread_mutex_unlock(&best->mutex); if (liveJobs == 0) { - pthread_cond_broadcast(&best->cond); + ZSTD_pthread_cond_broadcast(&best->cond); } } } @@ -884,7 +894,7 @@ static void COVER_tryParameters(void *opaque) { goto _compressCleanup; } /* Compress each sample and sum their sizes (or error) */ - totalCompressedSize = 0; + totalCompressedSize = dictBufferCapacity; for (i = 0; i < ctx->nbSamples; ++i) { const size_t size = ZSTD_compress_usingCDict( cctx, dst, dstCapacity, ctx->samples + ctx->offsets[i], @@ -960,7 +970,7 @@ ZDICTLIB_API size_t ZDICT_optimizeTrainFromBuffer_cover( /* Initialization */ COVER_best_init(&best); /* Turn down global display level to clean up display at level 2 and below */ - g_displayLevel = parameters->zParams.notificationLevel - 1; + g_displayLevel = displayLevel == 0 ? 0 : displayLevel - 1; /* Loop through d first because each new value needs a new context */ LOCALDISPLAYLEVEL(displayLevel, 2, "Trying %u different sets of parameters\n", kIterations); @@ -994,8 +1004,9 @@ ZDICTLIB_API size_t ZDICT_optimizeTrainFromBuffer_cover( data->parameters.k = k; data->parameters.d = d; data->parameters.steps = kSteps; + data->parameters.zParams.notificationLevel = g_displayLevel; /* Check the parameters */ - if (!COVER_checkParameters(data->parameters)) { + if (!COVER_checkParameters(data->parameters, dictBufferCapacity)) { DISPLAYLEVEL(1, "Cover parameters incorrect\n"); free(data); continue; diff --git a/contrib/zstd/lib/dictBuilder/divsufsort.c b/sys/contrib/zstd/lib/dictBuilder/divsufsort.c similarity index 100% rename from contrib/zstd/lib/dictBuilder/divsufsort.c rename to sys/contrib/zstd/lib/dictBuilder/divsufsort.c diff --git a/contrib/zstd/lib/dictBuilder/divsufsort.h b/sys/contrib/zstd/lib/dictBuilder/divsufsort.h similarity index 100% rename from contrib/zstd/lib/dictBuilder/divsufsort.h rename to sys/contrib/zstd/lib/dictBuilder/divsufsort.h diff --git a/contrib/zstd/lib/dictBuilder/zdict.c b/sys/contrib/zstd/lib/dictBuilder/zdict.c similarity index 99% rename from contrib/zstd/lib/dictBuilder/zdict.c rename to sys/contrib/zstd/lib/dictBuilder/zdict.c index c2871c2ccfbc..1bb8b0683d04 100644 --- a/contrib/zstd/lib/dictBuilder/zdict.c +++ b/sys/contrib/zstd/lib/dictBuilder/zdict.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ @@ -60,7 +61,7 @@ #define NOISELENGTH 32 -static const int g_compressionLevel_default = 6; +static const int g_compressionLevel_default = 3; static const U32 g_selectivity_default = 9; @@ -374,7 +375,7 @@ static int isIncluded(const void* in, const void* container, size_t length) return u==length; } -/*! ZDICT_checkMerge +/*! ZDICT_tryMerge() : check if dictItem can be merged, do it if possible @return : id of destination elt, 0 if not merged */ @@ -439,8 +440,8 @@ static U32 ZDICT_tryMerge(dictItem* table, dictItem elt, U32 eltNbToSkip, const static void ZDICT_removeDictItem(dictItem* table, U32 id) { - /* convention : first element is nb of elts */ - U32 const max = table->pos; + /* convention : table[0].pos stores nb of elts */ + U32 const max = table[0].pos; U32 u; if (!id) return; /* protection, should never happen */ for (u=id; u>8) + (((srcSize) < 128 KB) ? ((128 KB - (srcSize)) >> 11) /* margin, from 64 to 0 */ : 0)) /* this formula ensures that bound(A) + bound(B) <= bound(A+B) as long as A and B >= 128 KB */ ZSTDLIB_API size_t ZSTD_compressBound(size_t srcSize); /*!< maximum compressed size in worst case scenario */ ZSTDLIB_API unsigned ZSTD_isError(size_t code); /*!< tells if a `size_t` function result is an error code */ ZSTDLIB_API const char* ZSTD_getErrorName(size_t code); /*!< provides readable string from an error code */ +ZSTDLIB_API int ZSTD_maxCLevel(void); /*!< maximum compression level available */ /*************************************** @@ -375,27 +377,31 @@ ZSTDLIB_API size_t ZSTD_DStreamOutSize(void); /*!< recommended size for output #define ZSTD_MAGIC_SKIPPABLE_START 0x184D2A50U #define ZSTD_MAGIC_DICTIONARY 0xEC30A437 /* v0.7+ */ -#define ZSTD_WINDOWLOG_MAX_32 27 -#define ZSTD_WINDOWLOG_MAX_64 27 +#define ZSTD_WINDOWLOG_MAX_32 30 +#define ZSTD_WINDOWLOG_MAX_64 31 #define ZSTD_WINDOWLOG_MAX ((unsigned)(sizeof(size_t) == 4 ? ZSTD_WINDOWLOG_MAX_32 : ZSTD_WINDOWLOG_MAX_64)) -#define ZSTD_WINDOWLOG_MIN 10 -#define ZSTD_HASHLOG_MAX ZSTD_WINDOWLOG_MAX -#define ZSTD_HASHLOG_MIN 6 -#define ZSTD_CHAINLOG_MAX (ZSTD_WINDOWLOG_MAX+1) -#define ZSTD_CHAINLOG_MIN ZSTD_HASHLOG_MIN -#define ZSTD_HASHLOG3_MAX 17 -#define ZSTD_SEARCHLOG_MAX (ZSTD_WINDOWLOG_MAX-1) -#define ZSTD_SEARCHLOG_MIN 1 -#define ZSTD_SEARCHLENGTH_MAX 7 /* only for ZSTD_fast, other strategies are limited to 6 */ -#define ZSTD_SEARCHLENGTH_MIN 3 /* only for ZSTD_btopt, other strategies are limited to 4 */ -#define ZSTD_TARGETLENGTH_MIN 4 -#define ZSTD_TARGETLENGTH_MAX 999 +#define ZSTD_WINDOWLOG_MIN 10 +#define ZSTD_HASHLOG_MAX MIN(ZSTD_WINDOWLOG_MAX, 30) +#define ZSTD_HASHLOG_MIN 6 +#define ZSTD_CHAINLOG_MAX MIN(ZSTD_WINDOWLOG_MAX+1, 30) +#define ZSTD_CHAINLOG_MIN ZSTD_HASHLOG_MIN +#define ZSTD_HASHLOG3_MAX 17 +#define ZSTD_SEARCHLOG_MAX (ZSTD_WINDOWLOG_MAX-1) +#define ZSTD_SEARCHLOG_MIN 1 +#define ZSTD_SEARCHLENGTH_MAX 7 /* only for ZSTD_fast, other strategies are limited to 6 */ +#define ZSTD_SEARCHLENGTH_MIN 3 /* only for ZSTD_btopt, other strategies are limited to 4 */ +#define ZSTD_TARGETLENGTH_MIN 4 /* only useful for btopt */ +#define ZSTD_TARGETLENGTH_MAX 999 /* only useful for btopt */ +#define ZSTD_LDM_MINMATCH_MIN 4 +#define ZSTD_LDM_MINMATCH_MAX 4096 +#define ZSTD_LDM_BUCKETSIZELOG_MAX 8 -#define ZSTD_FRAMEHEADERSIZE_MAX 18 /* for static allocation */ -#define ZSTD_FRAMEHEADERSIZE_MIN 6 -static const size_t ZSTD_frameHeaderSize_prefix = 5; /* minimum input size to know frame header size */ -static const size_t ZSTD_frameHeaderSize_max = ZSTD_FRAMEHEADERSIZE_MAX; +#define ZSTD_FRAMEHEADERSIZE_PREFIX 5 /* minimum input size to know frame header size */ +#define ZSTD_FRAMEHEADERSIZE_MIN 6 +#define ZSTD_FRAMEHEADERSIZE_MAX 18 /* for static allocation */ +static const size_t ZSTD_frameHeaderSize_prefix = ZSTD_FRAMEHEADERSIZE_PREFIX; static const size_t ZSTD_frameHeaderSize_min = ZSTD_FRAMEHEADERSIZE_MIN; +static const size_t ZSTD_frameHeaderSize_max = ZSTD_FRAMEHEADERSIZE_MAX; static const size_t ZSTD_skippableHeaderSize = 8; /* magic number + skippable frame length */ @@ -424,6 +430,8 @@ typedef struct { ZSTD_frameParameters fParams; } ZSTD_parameters; +typedef struct ZSTD_CCtx_params_s ZSTD_CCtx_params; + /*= Custom memory allocation functions */ typedef void* (*ZSTD_allocFunction) (void* opaque, size_t size); typedef void (*ZSTD_freeFunction) (void* opaque, void* address); @@ -480,7 +488,7 @@ ZSTDLIB_API size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize); /*! ZSTD_sizeof_*() : * These functions give the current memory usage of selected object. - * Object memory usage can evolve if it's re-used multiple times. */ + * Object memory usage can evolve when re-used multiple times. */ ZSTDLIB_API size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx); ZSTDLIB_API size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx); ZSTDLIB_API size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs); @@ -493,18 +501,21 @@ ZSTDLIB_API size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict); * of a future {D,C}Ctx, before its creation. * ZSTD_estimateCCtxSize() will provide a budget large enough for any compression level up to selected one. * It will also consider src size to be arbitrarily "large", which is worst case. - * If srcSize is known to always be small, ZSTD_estimateCCtxSize_advanced() can provide a tighter estimation. - * ZSTD_estimateCCtxSize_advanced() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel. + * If srcSize is known to always be small, ZSTD_estimateCCtxSize_usingCParams() can provide a tighter estimation. + * ZSTD_estimateCCtxSize_usingCParams() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel. + * ZSTD_estimateCCtxSize_usingCCtxParams() can be used in tandem with ZSTD_CCtxParam_setParameter(). Only single-threaded compression is supported. This function will return an error code if ZSTD_p_nbThreads is > 1. * Note : CCtx estimation is only correct for single-threaded compression */ ZSTDLIB_API size_t ZSTD_estimateCCtxSize(int compressionLevel); -ZSTDLIB_API size_t ZSTD_estimateCCtxSize_advanced(ZSTD_compressionParameters cParams); +ZSTDLIB_API size_t ZSTD_estimateCCtxSize_usingCParams(ZSTD_compressionParameters cParams); +ZSTDLIB_API size_t ZSTD_estimateCCtxSize_usingCCtxParams(const ZSTD_CCtx_params* params); ZSTDLIB_API size_t ZSTD_estimateDCtxSize(void); -/*! ZSTD_estimate?StreamSize() : +/*! ZSTD_estimateCStreamSize() : * ZSTD_estimateCStreamSize() will provide a budget large enough for any compression level up to selected one. * It will also consider src size to be arbitrarily "large", which is worst case. - * If srcSize is known to always be small, ZSTD_estimateCStreamSize_advanced() can provide a tighter estimation. - * ZSTD_estimateCStreamSize_advanced() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel. + * If srcSize is known to always be small, ZSTD_estimateCStreamSize_usingCParams() can provide a tighter estimation. + * ZSTD_estimateCStreamSize_usingCParams() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel. + * ZSTD_estimateCStreamSize_usingCCtxParams() can be used in tandem with ZSTD_CCtxParam_setParameter(). Only single-threaded compression is supported. This function will return an error code if ZSTD_p_nbThreads is set to a value > 1. * Note : CStream estimation is only correct for single-threaded compression. * ZSTD_DStream memory budget depends on window Size. * This information can be passed manually, using ZSTD_estimateDStreamSize, @@ -513,17 +524,24 @@ ZSTDLIB_API size_t ZSTD_estimateDCtxSize(void); * an internal ?Dict will be created, which additional size is not estimated here. * In this case, get total size by adding ZSTD_estimate?DictSize */ ZSTDLIB_API size_t ZSTD_estimateCStreamSize(int compressionLevel); -ZSTDLIB_API size_t ZSTD_estimateCStreamSize_advanced(ZSTD_compressionParameters cParams); +ZSTDLIB_API size_t ZSTD_estimateCStreamSize_usingCParams(ZSTD_compressionParameters cParams); +ZSTDLIB_API size_t ZSTD_estimateCStreamSize_usingCCtxParams(const ZSTD_CCtx_params* params); ZSTDLIB_API size_t ZSTD_estimateDStreamSize(size_t windowSize); ZSTDLIB_API size_t ZSTD_estimateDStreamSize_fromFrame(const void* src, size_t srcSize); +typedef enum { + ZSTD_dlm_byCopy = 0, /**< Copy dictionary content internally */ + ZSTD_dlm_byRef, /**< Reference dictionary content -- the dictionary buffer must outlive its users. */ +} ZSTD_dictLoadMethod_e; + /*! ZSTD_estimate?DictSize() : * ZSTD_estimateCDictSize() will bet that src size is relatively "small", and content is copied, like ZSTD_createCDict(). - * ZSTD_estimateCStreamSize_advanced() makes it possible to control precisely compression parameters, like ZSTD_createCDict_advanced(). - * Note : dictionary created "byReference" are smaller */ + * ZSTD_estimateCStreamSize_advanced_usingCParams() makes it possible to control precisely compression parameters, like ZSTD_createCDict_advanced(). + * Note : dictionary created by reference using ZSTD_dlm_byRef are smaller + */ ZSTDLIB_API size_t ZSTD_estimateCDictSize(size_t dictSize, int compressionLevel); -ZSTDLIB_API size_t ZSTD_estimateCDictSize_advanced(size_t dictSize, ZSTD_compressionParameters cParams, unsigned byReference); -ZSTDLIB_API size_t ZSTD_estimateDDictSize(size_t dictSize, unsigned byReference); +ZSTDLIB_API size_t ZSTD_estimateCDictSize_advanced(size_t dictSize, ZSTD_compressionParameters cParams, ZSTD_dictLoadMethod_e dictLoadMethod); +ZSTDLIB_API size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod); /*************************************** @@ -551,24 +569,12 @@ ZSTDLIB_API ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem); ZSTDLIB_API ZSTD_CCtx* ZSTD_initStaticCCtx(void* workspace, size_t workspaceSize); -/* !!! To be deprecated !!! */ -typedef enum { - ZSTD_p_forceWindow, /* Force back-references to remain < windowSize, even when referencing Dictionary content (default:0) */ - ZSTD_p_forceRawDict /* Force loading dictionary in "content-only" mode (no header analysis) */ -} ZSTD_CCtxParameter; -/*! ZSTD_setCCtxParameter() : - * Set advanced parameters, selected through enum ZSTD_CCtxParameter - * @result : 0, or an error code (which can be tested with ZSTD_isError()) */ -ZSTDLIB_API size_t ZSTD_setCCtxParameter(ZSTD_CCtx* cctx, ZSTD_CCtxParameter param, unsigned value); - - /*! ZSTD_createCDict_byReference() : * Create a digested dictionary for compression * Dictionary content is simply referenced, and therefore stays in dictBuffer. * It is important that dictBuffer outlives CDict, it must remain read accessible throughout the lifetime of CDict */ ZSTDLIB_API ZSTD_CDict* ZSTD_createCDict_byReference(const void* dictBuffer, size_t dictSize, int compressionLevel); - typedef enum { ZSTD_dm_auto=0, /* dictionary is "full" if it starts with ZSTD_MAGIC_DICTIONARY, otherwise it is "rawContent" */ ZSTD_dm_rawContent, /* ensures dictionary is always loaded as rawContent, even if it starts with ZSTD_MAGIC_DICTIONARY */ ZSTD_dm_fullDict /* refuses to load a dictionary if it does not respect Zstandard's specification */ @@ -576,7 +582,8 @@ typedef enum { ZSTD_dm_auto=0, /* dictionary is "full" if it starts with /*! ZSTD_createCDict_advanced() : * Create a ZSTD_CDict using external alloc and free, and customized compression parameters */ ZSTDLIB_API ZSTD_CDict* ZSTD_createCDict_advanced(const void* dict, size_t dictSize, - unsigned byReference, ZSTD_dictMode_e dictMode, + ZSTD_dictLoadMethod_e dictLoadMethod, + ZSTD_dictMode_e dictMode, ZSTD_compressionParameters cParams, ZSTD_customMem customMem); @@ -596,7 +603,7 @@ ZSTDLIB_API ZSTD_CDict* ZSTD_createCDict_advanced(const void* dict, size_t dictS ZSTDLIB_API ZSTD_CDict* ZSTD_initStaticCDict( void* workspace, size_t workspaceSize, const void* dict, size_t dictSize, - unsigned byReference, ZSTD_dictMode_e dictMode, + ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictMode_e dictMode, ZSTD_compressionParameters cParams); /*! ZSTD_getCParams() : @@ -674,7 +681,8 @@ ZSTDLIB_API ZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, siz /*! ZSTD_createDDict_advanced() : * Create a ZSTD_DDict using external alloc and free, optionally by reference */ ZSTDLIB_API ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize, - unsigned byReference, ZSTD_customMem customMem); + ZSTD_dictLoadMethod_e dictLoadMethod, + ZSTD_customMem customMem); /*! ZSTD_initStaticDDict() : * Generate a digested dictionary in provided memory area. @@ -689,7 +697,7 @@ ZSTDLIB_API ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictS */ ZSTDLIB_API ZSTD_DDict* ZSTD_initStaticDDict(void* workspace, size_t workspaceSize, const void* dict, size_t dictSize, - unsigned byReference); + ZSTD_dictLoadMethod_e dictLoadMethod); /*! ZSTD_getDictID_fromDict() : * Provides the dictID stored within dictionary. @@ -724,9 +732,9 @@ ZSTDLIB_API unsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize); ZSTDLIB_API ZSTD_CStream* ZSTD_createCStream_advanced(ZSTD_customMem customMem); ZSTDLIB_API ZSTD_CStream* ZSTD_initStaticCStream(void* workspace, size_t workspaceSize); /**< same as ZSTD_initStaticCCtx() */ ZSTDLIB_API size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLevel, unsigned long long pledgedSrcSize); /**< pledgedSrcSize must be correct, a size of 0 means unknown. for a frame size of 0 use initCStream_advanced */ -ZSTDLIB_API size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compressionLevel); /**< creates of an internal CDict (incompatible with static CCtx), except if dict == NULL or dictSize < 8, in which case no dict is used. */ +ZSTDLIB_API size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compressionLevel); /**< creates of an internal CDict (incompatible with static CCtx), except if dict == NULL or dictSize < 8, in which case no dict is used. Note: dict is loaded with ZSTD_dm_auto (treated as a full zstd dictionary if it begins with ZSTD_MAGIC_DICTIONARY, else as raw content) and ZSTD_dlm_byCopy.*/ ZSTDLIB_API size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, const void* dict, size_t dictSize, - ZSTD_parameters params, unsigned long long pledgedSrcSize); /**< pledgedSrcSize is optional and can be 0 (meaning unknown). note: if the contentSizeFlag is set, pledgedSrcSize == 0 means the source size is actually 0 */ + ZSTD_parameters params, unsigned long long pledgedSrcSize); /**< pledgedSrcSize is optional and can be 0 (meaning unknown). note: if the contentSizeFlag is set, pledgedSrcSize == 0 means the source size is actually 0. dict is loaded with ZSTD_dm_auto and ZSTD_dlm_byCopy. */ ZSTDLIB_API size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict); /**< note : cdict will just be referenced, and must outlive compression session */ ZSTDLIB_API size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, const ZSTD_CDict* cdict, ZSTD_frameParameters fParams, unsigned long long pledgedSrcSize); /**< same as ZSTD_initCStream_usingCDict(), with control over frame parameters */ @@ -741,12 +749,12 @@ ZSTDLIB_API size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledg /*===== Advanced Streaming decompression functions =====*/ -typedef enum { DStream_p_maxWindowSize } ZSTD_DStreamParameter_e; ZSTDLIB_API ZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem); ZSTDLIB_API ZSTD_DStream* ZSTD_initStaticDStream(void* workspace, size_t workspaceSize); /**< same as ZSTD_initStaticDCtx() */ -ZSTDLIB_API size_t ZSTD_setDStreamParameter(ZSTD_DStream* zds, ZSTD_DStreamParameter_e paramType, unsigned paramValue); -ZSTDLIB_API size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize); /**< note: a dict will not be used if dict == NULL or dictSize < 8 */ -ZSTDLIB_API size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict); /**< note : ddict will just be referenced, and must outlive decompression session */ +typedef enum { DStream_p_maxWindowSize } ZSTD_DStreamParameter_e; +ZSTDLIB_API size_t ZSTD_setDStreamParameter(ZSTD_DStream* zds, ZSTD_DStreamParameter_e paramType, unsigned paramValue); /* obsolete : this API will be removed in a future version */ +ZSTDLIB_API size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize); /**< note: no dictionary will be used if dict == NULL or dictSize < 8 */ +ZSTDLIB_API size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict); /**< note : ddict is referenced, it must outlive decompression session */ ZSTDLIB_API size_t ZSTD_resetDStream(ZSTD_DStream* zds); /**< re-use decompression parameters from previous init; saves dictionary loading */ @@ -754,8 +762,8 @@ ZSTDLIB_API size_t ZSTD_resetDStream(ZSTD_DStream* zds); /**< re-use decompress * Buffer-less and synchronous inner streaming functions * * This is an advanced API, giving full control over buffer management, for users which need direct control over memory. -* But it's also a complex one, with many restrictions (documented below). -* Prefer using normal streaming API for an easier experience +* But it's also a complex one, with several restrictions, documented below. +* Prefer normal streaming API for an easier experience. ********************************************************************* */ /** @@ -772,8 +780,8 @@ ZSTDLIB_API size_t ZSTD_resetDStream(ZSTD_DStream* zds); /**< re-use decompress Then, consume your input using ZSTD_compressContinue(). There are some important considerations to keep in mind when using this advanced function : - - ZSTD_compressContinue() has no internal buffer. It uses externally provided buffer only. - - Interface is synchronous : input is consumed entirely and produce 1+ (or more) compressed blocks. + - ZSTD_compressContinue() has no internal buffer. It uses externally provided buffers only. + - Interface is synchronous : input is consumed entirely and produces 1+ compressed blocks. - Caller must ensure there is enough space in `dst` to store compressed data under worst case scenario. Worst case evaluation is provided by ZSTD_compressBound(). ZSTD_compressContinue() doesn't guarantee recover after a failed compression. @@ -784,9 +792,9 @@ ZSTDLIB_API size_t ZSTD_resetDStream(ZSTD_DStream* zds); /**< re-use decompress Finish a frame with ZSTD_compressEnd(), which will write the last block(s) and optional checksum. It's possible to use srcSize==0, in which case, it will write a final empty block to end the frame. - Without last block mark, frames will be considered unfinished (corrupted) by decoders. + Without last block mark, frames are considered unfinished (hence corrupted) by compliant decoders. - `ZSTD_CCtx` object can be re-used (ZSTD_compressBegin()) to compress some new frame. + `ZSTD_CCtx` object can be re-used (ZSTD_compressBegin()) to compress again. */ /*===== Buffer-less streaming compression functions =====*/ @@ -809,40 +817,53 @@ ZSTDLIB_API size_t ZSTD_compressEnd(ZSTD_CCtx* cctx, void* dst, size_t dstCapaci A ZSTD_DCtx object can be re-used multiple times. First typical operation is to retrieve frame parameters, using ZSTD_getFrameHeader(). - It fills a ZSTD_frameHeader structure with important information to correctly decode the frame, - such as minimum rolling buffer size to allocate to decompress data (`windowSize`), - and the dictionary ID in use. - (Note : content size is optional, it may not be present. 0 means : content size unknown). - Note that these values could be wrong, either because of data malformation, or because an attacker is spoofing deliberate false information. - As a consequence, check that values remain within valid application range, especially `windowSize`, before allocation. - Each application can set its own limit, depending on local restrictions. - For extended interoperability, it is recommended to support windowSize of at least 8 MB. Frame header is extracted from the beginning of compressed frame, so providing only the frame's beginning is enough. Data fragment must be large enough to ensure successful decoding. - `ZSTD_frameHeaderSize_max` bytes is guaranteed to always be large enough. + `ZSTD_frameHeaderSize_max` bytes is guaranteed to always be large enough. @result : 0 : successful decoding, the `ZSTD_frameHeader` structure is correctly filled. >0 : `srcSize` is too small, please provide at least @result bytes on next attempt. errorCode, which can be tested using ZSTD_isError(). - Start decompression, with ZSTD_decompressBegin(). + It fills a ZSTD_frameHeader structure with important information to correctly decode the frame, + such as the dictionary ID, content size, or maximum back-reference distance (`windowSize`). + Note that these values could be wrong, either because of data corruption, or because a 3rd party deliberately spoofs false information. + As a consequence, check that values remain within valid application range. + For example, do not allocate memory blindly, check that `windowSize` is within expectation. + Each application can set its own limits, depending on local restrictions. + For extended interoperability, it is recommended to support `windowSize` of at least 8 MB. + + ZSTD_decompressContinue() needs previous data blocks during decompression, up to `windowSize` bytes. + ZSTD_decompressContinue() is very sensitive to contiguity, + if 2 blocks don't follow each other, make sure that either the compressor breaks contiguity at the same place, + or that previous contiguous segment is large enough to properly handle maximum back-reference distance. + There are multiple ways to guarantee this condition. + + The most memory efficient way is to use a round buffer of sufficient size. + Sufficient size is determined by invoking ZSTD_decodingBufferSize_min(), + which can @return an error code if required value is too large for current system (in 32-bits mode). + In a round buffer methodology, ZSTD_decompressContinue() decompresses each block next to previous one, + up to the moment there is not enough room left in the buffer to guarantee decoding another full block, + which maximum size is provided in `ZSTD_frameHeader` structure, field `blockSizeMax`. + At which point, decoding can resume from the beginning of the buffer. + Note that already decoded data stored in the buffer should be flushed before being overwritten. + + There are alternatives possible, for example using two or more buffers of size `windowSize` each, though they consume more memory. + + Finally, if you control the compression process, you can also ignore all buffer size rules, + as long as the encoder and decoder progress in "lock-step", + aka use exactly the same buffer sizes, break contiguity at the same place, etc. + + Once buffers are setup, start decompression, with ZSTD_decompressBegin(). If decompression requires a dictionary, use ZSTD_decompressBegin_usingDict() or ZSTD_decompressBegin_usingDDict(). - Alternatively, you can copy a prepared context, using ZSTD_copyDCtx(). Then use ZSTD_nextSrcSizeToDecompress() and ZSTD_decompressContinue() alternatively. ZSTD_nextSrcSizeToDecompress() tells how many bytes to provide as 'srcSize' to ZSTD_decompressContinue(). ZSTD_decompressContinue() requires this _exact_ amount of bytes, or it will fail. - @result of ZSTD_decompressContinue() is the number of bytes regenerated within 'dst' (necessarily <= dstCapacity). - It can be zero, which is not an error; it just means ZSTD_decompressContinue() has decoded some metadata item. + @result of ZSTD_decompressContinue() is the number of bytes regenerated within 'dst' (necessarily <= dstCapacity). + It can be zero : it just means ZSTD_decompressContinue() has decoded some metadata item. It can also be an error code, which can be tested with ZSTD_isError(). - ZSTD_decompressContinue() needs previous data blocks during decompression, up to `windowSize`. - They should preferably be located contiguously, prior to current block. - Alternatively, a round buffer of sufficient size is also possible. Sufficient size is determined by frame parameters. - ZSTD_decompressContinue() is very sensitive to contiguity, - if 2 blocks don't follow each other, make sure that either the compressor breaks contiguity at the same place, - or that previous contiguous segment is large enough to properly handle maximum back-reference. - A frame is fully decoded when ZSTD_nextSrcSizeToDecompress() returns zero. Context can then be reset to start a new decompression. @@ -852,75 +873,101 @@ ZSTDLIB_API size_t ZSTD_compressEnd(ZSTD_CCtx* cctx, void* dst, size_t dstCapaci == Special case : skippable frames == Skippable frames allow integration of user-defined data into a flow of concatenated frames. - Skippable frames will be ignored (skipped) by a decompressor. The format of skippable frames is as follows : + Skippable frames will be ignored (skipped) by decompressor. + The format of skippable frames is as follows : a) Skippable frame ID - 4 Bytes, Little endian format, any value from 0x184D2A50 to 0x184D2A5F b) Frame Size - 4 Bytes, Little endian format, unsigned 32-bits c) Frame Content - any content (User Data) of length equal to Frame Size - For skippable frames ZSTD_decompressContinue() always returns 0. - For skippable frames ZSTD_getFrameHeader() returns fparamsPtr->windowLog==0 what means that a frame is skippable. - Note : If fparamsPtr->frameContentSize==0, it is ambiguous: the frame might actually be a Zstd encoded frame with no content. - For purposes of decompression, it is valid in both cases to skip the frame using - ZSTD_findFrameCompressedSize to find its size in bytes. - It also returns Frame Size as fparamsPtr->frameContentSize. + For skippable frames ZSTD_getFrameHeader() returns zfhPtr->frameType==ZSTD_skippableFrame. + For skippable frames ZSTD_decompressContinue() always returns 0 : it only skips the content. */ /*===== Buffer-less streaming decompression functions =====*/ typedef enum { ZSTD_frame, ZSTD_skippableFrame } ZSTD_frameType_e; typedef struct { - unsigned long long frameContentSize; /* ZSTD_CONTENTSIZE_UNKNOWN means this field is not available. 0 means "empty" */ + unsigned long long frameContentSize; /* if == ZSTD_CONTENTSIZE_UNKNOWN, it means this field is not available. 0 means "empty" */ unsigned long long windowSize; /* can be very large, up to <= frameContentSize */ + unsigned blockSizeMax; ZSTD_frameType_e frameType; /* if == ZSTD_skippableFrame, frameContentSize is the size of skippable content */ unsigned headerSize; unsigned dictID; unsigned checksumFlag; } ZSTD_frameHeader; ZSTDLIB_API size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize); /**< doesn't consume input */ +ZSTDLIB_API size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize); /**< when frame content size is not known, pass in frameContentSize == ZSTD_CONTENTSIZE_UNKNOWN */ + ZSTDLIB_API size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx); ZSTDLIB_API size_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize); ZSTDLIB_API size_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict); -ZSTDLIB_API void ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx); ZSTDLIB_API size_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx); ZSTDLIB_API size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize); + +/* misc */ +ZSTDLIB_API void ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx); typedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e; ZSTDLIB_API ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx); -/*=== New advanced API (experimental, and compression only) ===*/ +/* ============================================ */ +/** New advanced API (experimental) */ +/* ============================================ */ /* notes on API design : - * In this proposal, parameters are pushed one by one into an existing CCtx, + * In this proposal, parameters are pushed one by one into an existing context, * and then applied on all subsequent compression jobs. * When no parameter is ever provided, CCtx is created with compression level ZSTD_CLEVEL_DEFAULT. * * This API is intended to replace all others experimental API. * It can basically do all other use cases, and even new ones. - * It stands a good chance to become "stable", - * after a reasonable testing period. + * In constrast with _advanced() variants, it stands a reasonable chance to become "stable", + * after a good testing period. */ /* note on naming convention : * Initially, the API favored names like ZSTD_setCCtxParameter() . * In this proposal, convention is changed towards ZSTD_CCtx_setParameter() . * The main driver is that it identifies more clearly the target object type. - * It feels clearer in light of potential variants : + * It feels clearer when considering multiple targets : * ZSTD_CDict_setParameter() (rather than ZSTD_setCDictParameter()) - * ZSTD_DCtx_setParameter() (rather than ZSTD_setDCtxParameter() ) - * Left variant feels easier to distinguish. + * ZSTD_CCtxParams_setParameter() (rather than ZSTD_setCCtxParamsParameter() ) + * etc... */ /* note on enum design : - * All enum will be manually set to explicit values before reaching "stable API" status */ + * All enum will be pinned to explicit values before reaching "stable API" status */ typedef enum { + /* Question : should we have a format ZSTD_f_auto ? + * For the time being, it would mean exactly the same as ZSTD_f_zstd1. + * But, in the future, should several formats be supported, + * on the compression side, it would mean "default format". + * On the decompression side, it would mean "multi format", + * and ZSTD_f_zstd1 could be reserved to mean "accept *only* zstd frames". + * Since meaning is a little different, another option could be to define different enums for compression and decompression. + * This question could be kept for later, when there are actually multiple formats to support, + * but there is also the question of pinning enum values, and pinning value `0` is especially important */ + ZSTD_f_zstd1 = 0, /* zstd frame format, specified in zstd_compression_format.md (default) */ + ZSTD_f_zstd1_magicless, /* Variant of zstd frame format, without initial 4-bytes magic number. + * Useful to save 4 bytes per generated frame. + * Decoder cannot recognise automatically this format, requiring instructions. */ +} ZSTD_format_e; + +typedef enum { + /* compression format */ + ZSTD_p_format = 10, /* See ZSTD_format_e enum definition. + * Cast selected format as unsigned for ZSTD_CCtx_setParameter() compatibility. */ + /* compression parameters */ ZSTD_p_compressionLevel=100, /* Update all compression parameters according to pre-defined cLevel table * Default level is ZSTD_CLEVEL_DEFAULT==3. * Special: value 0 means "do not change cLevel". */ ZSTD_p_windowLog, /* Maximum allowed back-reference distance, expressed as power of 2. * Must be clamped between ZSTD_WINDOWLOG_MIN and ZSTD_WINDOWLOG_MAX. - * Special: value 0 means "do not change windowLog". */ + * Special: value 0 means "do not change windowLog". + * Note: Using a window size greater than ZSTD_MAXWINDOWSIZE_DEFAULT (default: 2^27) + * requires setting the maximum window size at least as large during decompression. */ ZSTD_p_hashLog, /* Size of the probe table, as a power of 2. * Resulting table size is (1 << (hashLog+2)). * Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX. @@ -959,12 +1006,6 @@ typedef enum { ZSTD_p_checksumFlag, /* A 32-bits checksum of content is written at end of frame (default:0) */ ZSTD_p_dictIDFlag, /* When applicable, dictID of dictionary is provided in frame header (default:1) */ - /* dictionary parameters (must be set before ZSTD_CCtx_loadDictionary) */ - ZSTD_p_dictMode=300, /* Select how dictionary content must be interpreted. Value must be from type ZSTD_dictMode_e. - * default : 0==auto : dictionary will be "full" if it respects specification, otherwise it will be "rawContent" */ - ZSTD_p_refDictContent, /* Dictionary content will be referenced, instead of copied (default:0==byCopy). - * It requires that dictionary buffer outlives its users */ - /* multi-threading parameters */ ZSTD_p_nbThreads=400, /* Select how many threads a compression job can spawn (default:1) * More threads improve speed, but also increase memory usage. @@ -980,6 +1021,35 @@ typedef enum { /* advanced parameters - may not remain available after API update */ ZSTD_p_forceMaxWindow=1100, /* Force back-reference distances to remain < windowSize, * even when referencing into Dictionary content (default:0) */ + ZSTD_p_enableLongDistanceMatching=1200, /* Enable long distance matching. + * This parameter is designed to improve the compression + * ratio for large inputs with long distance matches. + * This increases the memory usage as well as window size. + * Note: setting this parameter sets all the LDM parameters + * as well as ZSTD_p_windowLog. It should be set after + * ZSTD_p_compressionLevel and before ZSTD_p_windowLog and + * other LDM parameters. Setting the compression level + * after this parameter overrides the window log, though LDM + * will remain enabled until explicitly disabled. */ + ZSTD_p_ldmHashLog, /* Size of the table for long distance matching, as a power of 2. + * Larger values increase memory usage and compression ratio, but decrease + * compression speed. + * Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX + * (default: windowlog - 7). */ + ZSTD_p_ldmMinMatch, /* Minimum size of searched matches for long distance matcher. + * Larger/too small values usually decrease compression ratio. + * Must be clamped between ZSTD_LDM_MINMATCH_MIN + * and ZSTD_LDM_MINMATCH_MAX (default: 64). */ + ZSTD_p_ldmBucketSizeLog, /* Log size of each bucket in the LDM hash table for collision resolution. + * Larger values usually improve collision resolution but may decrease + * compression speed. + * The maximum value is ZSTD_LDM_BUCKETSIZELOG_MAX (default: 3). */ + ZSTD_p_ldmHashEveryLog, /* Frequency of inserting/looking up entries in the LDM hash table. + * The default is MAX(0, (windowLog - ldmHashLog)) to + * optimize hash table usage. + * Larger values improve compression speed. Deviating far from the + * default value will likely result in a decrease in compression ratio. + * Must be clamped between 0 and ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN. */ } ZSTD_cParameter; @@ -1007,14 +1077,22 @@ ZSTDLIB_API size_t ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx* cctx, unsigned long lo * @result : 0, or an error code (which can be tested with ZSTD_isError()). * Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary, * meaning "return to no-dictionary mode". - * Note 1 : `dict` content will be copied internally, - * except if ZSTD_p_refDictContent is set before loading. + * Note 1 : `dict` content will be copied internally. Use + * ZSTD_CCtx_loadDictionary_byReference() to reference dictionary + * content instead. The dictionary buffer must then outlive its + * users. * Note 2 : Loading a dictionary involves building tables, which are dependent on compression parameters. * For this reason, compression parameters cannot be changed anymore after loading a dictionary. * It's also a CPU-heavy operation, with non-negligible impact on latency. * Note 3 : Dictionary will be used for all future compression jobs. - * To return to "no-dictionary" situation, load a NULL dictionary */ + * To return to "no-dictionary" situation, load a NULL dictionary + * Note 5 : Use ZSTD_CCtx_loadDictionary_advanced() to select how dictionary + * content will be interpreted. + */ ZSTDLIB_API size_t ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, const void* dict, size_t dictSize); +ZSTDLIB_API size_t ZSTD_CCtx_loadDictionary_byReference(ZSTD_CCtx* cctx, const void* dict, size_t dictSize); +ZSTDLIB_API size_t ZSTD_CCtx_loadDictionary_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictMode_e dictMode); + /*! ZSTD_CCtx_refCDict() : * Reference a prepared dictionary, to be used for all next compression jobs. @@ -1040,23 +1118,26 @@ ZSTDLIB_API size_t ZSTD_CCtx_refCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict); * Note 1 : Prefix buffer is referenced. It must outlive compression job. * Note 2 : Referencing a prefix involves building tables, which are dependent on compression parameters. * It's a CPU-heavy operation, with non-negligible impact on latency. - * Note 3 : it's possible to alter ZSTD_p_dictMode using ZSTD_CCtx_setParameter() */ + * Note 3 : By default, the prefix is treated as raw content + * (ZSTD_dm_rawContent). Use ZSTD_CCtx_refPrefix_advanced() to alter + * dictMode. */ ZSTDLIB_API size_t ZSTD_CCtx_refPrefix(ZSTD_CCtx* cctx, const void* prefix, size_t prefixSize); +ZSTDLIB_API size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, const void* prefix, size_t prefixSize, ZSTD_dictMode_e dictMode); typedef enum { ZSTD_e_continue=0, /* collect more data, encoder transparently decides when to output result, for optimal conditions */ ZSTD_e_flush, /* flush any data provided so far - frame will continue, future data can still reference previous data for better compression */ - ZSTD_e_end /* flush any remaining data and ends current frame. Any future compression starts a new frame. */ + ZSTD_e_end /* flush any remaining data and close current frame. Any additional data starts a new frame. */ } ZSTD_EndDirective; /*! ZSTD_compress_generic() : * Behave about the same as ZSTD_compressStream. To note : * - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_setParameter() * - Compression parameters cannot be changed once compression is started. - * - *dstPos must be <= dstCapacity, *srcPos must be <= srcSize - * - *dspPos and *srcPos will be updated. They are guaranteed to remain below their respective limit. + * - outpot->pos must be <= dstCapacity, input->pos must be <= srcSize + * - outpot->pos and input->pos will be updated. They are guaranteed to remain below their respective limit. * - @return provides the minimum amount of data still to flush from internal buffers * or an error code, which can be tested using ZSTD_isError(). * if @return != 0, flush is not fully completed, there is some data left within internal buffers. @@ -1075,6 +1156,7 @@ ZSTDLIB_API size_t ZSTD_compress_generic (ZSTD_CCtx* cctx, * Useful after an error, or to interrupt an ongoing compression job and start a new one. * Any internal data not yet flushed is cancelled. * Dictionary (if any) is dropped. + * All parameters are back to default values. * It's possible to modify compression parameters after a reset. */ ZSTDLIB_API void ZSTD_CCtx_reset(ZSTD_CCtx* cctx); /* Not ready yet ! */ @@ -1083,21 +1165,187 @@ ZSTDLIB_API void ZSTD_CCtx_reset(ZSTD_CCtx* cctx); /* Not ready yet ! */ /*! ZSTD_compress_generic_simpleArgs() : * Same as ZSTD_compress_generic(), * but using only integral types as arguments. - * Argument list is larger and less expressive than ZSTD_{in,out}Buffer, + * Argument list is larger than ZSTD_{in,out}Buffer, * but can be helpful for binders from dynamic languages * which have troubles handling structures containing memory pointers. */ -size_t ZSTD_compress_generic_simpleArgs ( +ZSTDLIB_API size_t ZSTD_compress_generic_simpleArgs ( ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, size_t* dstPos, const void* src, size_t srcSize, size_t* srcPos, ZSTD_EndDirective endOp); +/*! ZSTD_CCtx_params : + * Quick howto : + * - ZSTD_createCCtxParams() : Create a ZSTD_CCtx_params structure + * - ZSTD_CCtxParam_setParameter() : Push parameters one by one into + * an existing ZSTD_CCtx_params structure. + * This is similar to + * ZSTD_CCtx_setParameter(). + * - ZSTD_CCtx_setParametersUsingCCtxParams() : Apply parameters to + * an existing CCtx. + * These parameters will be applied to + * all subsequent compression jobs. + * - ZSTD_compress_generic() : Do compression using the CCtx. + * - ZSTD_freeCCtxParams() : Free the memory. + * + * This can be used with ZSTD_estimateCCtxSize_advanced_usingCCtxParams() + * for static allocation for single-threaded compression. + */ +ZSTDLIB_API ZSTD_CCtx_params* ZSTD_createCCtxParams(void); -/** - Block functions +/*! ZSTD_resetCCtxParams() : + * Reset params to default, with the default compression level. + */ +ZSTDLIB_API size_t ZSTD_resetCCtxParams(ZSTD_CCtx_params* params); +/*! ZSTD_initCCtxParams() : + * Initializes the compression parameters of cctxParams according to + * compression level. All other parameters are reset to their default values. + */ +ZSTDLIB_API size_t ZSTD_initCCtxParams(ZSTD_CCtx_params* cctxParams, int compressionLevel); + +/*! ZSTD_initCCtxParams_advanced() : + * Initializes the compression and frame parameters of cctxParams according to + * params. All other parameters are reset to their default values. + */ +ZSTDLIB_API size_t ZSTD_initCCtxParams_advanced(ZSTD_CCtx_params* cctxParams, ZSTD_parameters params); + +ZSTDLIB_API size_t ZSTD_freeCCtxParams(ZSTD_CCtx_params* params); + +/*! ZSTD_CCtxParam_setParameter() : + * Similar to ZSTD_CCtx_setParameter. + * Set one compression parameter, selected by enum ZSTD_cParameter. + * Parameters must be applied to a ZSTD_CCtx using ZSTD_CCtx_setParametersUsingCCtxParams(). + * Note : when `value` is an enum, cast it to unsigned for proper type checking. + * @result : 0, or an error code (which can be tested with ZSTD_isError()). + */ +ZSTDLIB_API size_t ZSTD_CCtxParam_setParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, unsigned value); + +/*! ZSTD_CCtx_setParametersUsingCCtxParams() : + * Apply a set of ZSTD_CCtx_params to the compression context. + * This must be done before the dictionary is loaded. + * The pledgedSrcSize is treated as unknown. + * Multithreading parameters are applied only if nbThreads > 1. + */ +ZSTDLIB_API size_t ZSTD_CCtx_setParametersUsingCCtxParams( + ZSTD_CCtx* cctx, const ZSTD_CCtx_params* params); + + +/*=== Advanced parameters for decompression API ===*/ + +/* The following parameters must be set after creating a ZSTD_DCtx* (or ZSTD_DStream*) object, + * but before starting decompression of a frame. + */ + +/*! ZSTD_DCtx_loadDictionary() : + * Create an internal DDict from dict buffer, + * to be used to decompress next frames. + * @result : 0, or an error code (which can be tested with ZSTD_isError()). + * Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary, + * meaning "return to no-dictionary mode". + * Note 1 : `dict` content will be copied internally. + * Use ZSTD_DCtx_loadDictionary_byReference() + * to reference dictionary content instead. + * In which case, the dictionary buffer must outlive its users. + * Note 2 : Loading a dictionary involves building tables, + * which has a non-negligible impact on CPU usage and latency. + * Note 3 : Use ZSTD_DCtx_loadDictionary_advanced() to select + * how dictionary content will be interpreted and loaded. + */ +ZSTDLIB_API size_t ZSTD_DCtx_loadDictionary(ZSTD_DCtx* dctx, const void* dict, size_t dictSize); /* not implemented */ +ZSTDLIB_API size_t ZSTD_DCtx_loadDictionary_byReference(ZSTD_DCtx* dctx, const void* dict, size_t dictSize); /* not implemented */ +ZSTDLIB_API size_t ZSTD_DCtx_loadDictionary_advanced(ZSTD_DCtx* dctx, const void* dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictMode_e dictMode); /* not implemented */ + + +/*! ZSTD_DCtx_refDDict() : + * Reference a prepared dictionary, to be used to decompress next frames. + * The dictionary remains active for decompression of future frames using same DCtx. + * @result : 0, or an error code (which can be tested with ZSTD_isError()). + * Note 1 : Currently, only one dictionary can be managed. + * Referencing a new dictionary effectively "discards" any previous one. + * Special : adding a NULL DDict means "return to no-dictionary mode". + * Note 2 : DDict is just referenced, its lifetime must outlive its usage from DCtx. + */ +ZSTDLIB_API size_t ZSTD_DCtx_refDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict); /* not implemented */ + + +/*! ZSTD_DCtx_refPrefix() : + * Reference a prefix (single-usage dictionary) for next compression job. + * Prefix is **only used once**. It must be explicitly referenced before each frame. + * If there is a need to use same prefix multiple times, consider embedding it into a ZSTD_DDict instead. + * @result : 0, or an error code (which can be tested with ZSTD_isError()). + * Note 1 : Adding any prefix (including NULL) invalidates any previously set prefix or dictionary + * Note 2 : Prefix buffer is referenced. It must outlive compression job. + * Note 3 : By default, the prefix is treated as raw content (ZSTD_dm_rawContent). + * Use ZSTD_CCtx_refPrefix_advanced() to alter dictMode. + * Note 4 : Referencing a raw content prefix has almost no cpu nor memory cost. + */ +ZSTDLIB_API size_t ZSTD_DCtx_refPrefix(ZSTD_DCtx* dctx, const void* prefix, size_t prefixSize); /* not implemented */ +ZSTDLIB_API size_t ZSTD_DCtx_refPrefix_advanced(ZSTD_DCtx* dctx, const void* prefix, size_t prefixSize, ZSTD_dictMode_e dictMode); /* not implemented */ + + +/*! ZSTD_DCtx_setMaxWindowSize() : + * Refuses allocating internal buffers for frames requiring a window size larger than provided limit. + * This is useful to prevent a decoder context from reserving too much memory for itself (potential attack scenario). + * This parameter is only useful in streaming mode, since no internal buffer is allocated in direct mode. + * By default, a decompression context accepts all window sizes <= (1 << ZSTD_WINDOWLOG_MAX) + * @return : 0, or an error code (which can be tested using ZSTD_isError()). + */ +ZSTDLIB_API size_t ZSTD_DCtx_setMaxWindowSize(ZSTD_DCtx* dctx, size_t maxWindowSize); + + +/*! ZSTD_DCtx_setFormat() : + * Instruct the decoder context about what kind of data to decode next. + * This instruction is mandatory to decode data without a fully-formed header, + * such ZSTD_f_zstd1_magicless for example. + * @return : 0, or an error code (which can be tested using ZSTD_isError()). + */ +ZSTDLIB_API size_t ZSTD_DCtx_setFormat(ZSTD_DCtx* dctx, ZSTD_format_e format); + + +/*! ZSTD_decompress_generic() : + * Behave the same as ZSTD_decompressStream. + * Decompression parameters cannot be changed once decompression is started. + * @return : an error code, which can be tested using ZSTD_isError() + * if >0, a hint, nb of expected input bytes for next invocation. + * `0` means : a frame has just been fully decoded and flushed. + */ +ZSTDLIB_API size_t ZSTD_decompress_generic(ZSTD_DCtx* dctx, + ZSTD_outBuffer* output, + ZSTD_inBuffer* input); + + +/*! ZSTD_decompress_generic_simpleArgs() : + * Same as ZSTD_decompress_generic(), + * but using only integral types as arguments. + * Argument list is larger than ZSTD_{in,out}Buffer, + * but can be helpful for binders from dynamic languages + * which have troubles handling structures containing memory pointers. + */ +ZSTDLIB_API size_t ZSTD_decompress_generic_simpleArgs ( + ZSTD_DCtx* dctx, + void* dst, size_t dstCapacity, size_t* dstPos, + const void* src, size_t srcSize, size_t* srcPos); + + +/*! ZSTD_DCtx_reset() : + * Return a DCtx to clean state. + * If a decompression was ongoing, any internal data not yet flushed is cancelled. + * All parameters are back to default values, including sticky ones. + * Dictionary (if any) is dropped. + * Parameters can be modified again after a reset. + */ +ZSTDLIB_API void ZSTD_DCtx_reset(ZSTD_DCtx* dctx); + + + +/* ============================ */ +/** Block level API */ +/* ============================ */ + +/*! Block functions produce and decode raw zstd blocks, without frame metadata. Frame metadata cost is typically ~18 bytes, which can be non-negligible for very small blocks (< 100 bytes). User will have to take in charge required information to regenerate data, such as compressed and content sizes. @@ -1109,7 +1357,7 @@ size_t ZSTD_compress_generic_simpleArgs ( + compression : any ZSTD_compressBegin*() variant, including with dictionary + decompression : any ZSTD_decompressBegin*() variant, including with dictionary + copyCCtx() and copyDCtx() can be used too - - Block size is limited, it must be <= ZSTD_getBlockSize() <= ZSTD_BLOCKSIZE_MAX + - Block size is limited, it must be <= ZSTD_getBlockSize() <= ZSTD_BLOCKSIZE_MAX == 128 KB + If input is larger than a block size, it's necessary to split input data into multiple blocks + For inputs larger than a single block size, consider using the regular ZSTD_compress() instead. Frame metadata is not that costly, and quickly becomes negligible as source size grows larger. @@ -1128,7 +1376,7 @@ size_t ZSTD_compress_generic_simpleArgs ( ZSTDLIB_API size_t ZSTD_getBlockSize (const ZSTD_CCtx* cctx); ZSTDLIB_API size_t ZSTD_compressBlock (ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize); ZSTDLIB_API size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize); -ZSTDLIB_API size_t ZSTD_insertBlock(ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize); /**< insert block into `dctx` history. Useful for uncompressed blocks */ +ZSTDLIB_API size_t ZSTD_insertBlock(ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize); /**< insert uncompressed block into `dctx` history. Useful for multi-blocks decompression */ #endif /* ZSTD_H_ZSTD_STATIC_LINKING_ONLY */ diff --git a/contrib/zstd/programs/.gitignore b/sys/contrib/zstd/programs/.gitignore similarity index 100% rename from contrib/zstd/programs/.gitignore rename to sys/contrib/zstd/programs/.gitignore diff --git a/contrib/zstd/programs/BUCK b/sys/contrib/zstd/programs/BUCK similarity index 100% rename from contrib/zstd/programs/BUCK rename to sys/contrib/zstd/programs/BUCK diff --git a/contrib/zstd/programs/Makefile b/sys/contrib/zstd/programs/Makefile similarity index 88% rename from contrib/zstd/programs/Makefile rename to sys/contrib/zstd/programs/Makefile index c5469cfc4def..cbb67e9fe349 100644 --- a/contrib/zstd/programs/Makefile +++ b/sys/contrib/zstd/programs/Makefile @@ -1,12 +1,10 @@ -# ########################################################################## +# ################################################################ # Copyright (c) 2015-present, Yann Collet, Facebook, Inc. # All rights reserved. # -# This Makefile is validated for Linux, macOS, *BSD, Hurd, Solaris, MSYS2 targets -# -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. An additional grant -# of patent rights can be found in the PATENTS file in the same directory. +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). # ########################################################################## # zstd : Command Line Utility, supporting gzip-like arguments # zstd32 : Same as zstd, but forced to compile in 32-bits mode @@ -42,7 +40,7 @@ CPPFLAGS+= -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \ -DZSTD_NEWAPI \ -DXXH_NAMESPACE=ZSTD_ # because xxhash.o already compiled with this macro from library CFLAGS ?= -O3 -DEBUGFLAGS= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ +DEBUGFLAGS+=-Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \ -Wstrict-prototypes -Wundef -Wpointer-arith -Wformat-security \ -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \ @@ -68,8 +66,7 @@ endif else endif -ZSTDLIB_FILES := $(wildcard $(ZSTD_FILES)) $(wildcard $(ZSTDLEGACY_FILES)) $(wildcard $(ZDICT_FILES)) -ZSTDLIB_OBJ := $(patsubst %.c,%.o,$(ZSTDLIB_FILES)) +ZSTDLIB_FILES := $(sort $(wildcard $(ZSTD_FILES)) $(wildcard $(ZSTDLEGACY_FILES)) $(wildcard $(ZDICT_FILES))) # Define *.exe as extension for Windows systems ifneq (,$(filter Windows%,$(OS))) @@ -143,13 +140,10 @@ allVariants: zstd zstd-compress zstd-decompress zstd-small zstd-nolegacy $(ZSTDDECOMP_O): CFLAGS += $(ALIGN_LOOP) -zstd zstd4 : CPPFLAGS += $(THREAD_CPP) $(ZLIBCPP) $(LZMACPP) -zstd zstd4 : LDFLAGS += $(THREAD_LD) $(ZLIBLD) $(LZMALD) -zstd4 : CPPFLAGS += $(LZ4CPP) -zstd4 : LDFLAGS += $(LZ4LD) -zstd : LZ4_MSG := - lz4 support is disabled -zstd zstd4 : CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT) -zstd zstd4 : $(ZSTDLIB_FILES) zstdcli.o fileio.o bench.o datagen.o dibio.o +zstd : CPPFLAGS += $(THREAD_CPP) $(ZLIBCPP) $(LZMACPP) $(LZ4CPP) +zstd : LDFLAGS += $(THREAD_LD) $(ZLIBLD) $(LZMALD) $(LZ4LD) +zstd : CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT) +zstd : $(ZSTDLIB_FILES) zstdcli.o fileio.o bench.o datagen.o dibio.o @echo "$(THREAD_MSG)" @echo "$(ZLIB_MSG)" @echo "$(LZMA_MSG)" @@ -212,8 +206,8 @@ zstd-decompress: $(ZSTDCOMMON_FILES) $(ZSTDDECOMP_FILES) zstdcli.c fileio.c zstd-compress: $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES) zstdcli.c fileio.c $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NODECOMPRESS $^ -o $@$(EXT) -# zstd is now built with multithreading enabled y default zstdmt: zstd + ln -sf zstd zstdmt .PHONY: generate_res generate_res: @@ -255,25 +249,35 @@ ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD Ne list: @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs +DESTDIR ?= +# directory variables : GNU conventions prefer lowercase +# see https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html +# support both lower and uppercase (BSD), use uppercase in script +prefix ?= /usr/local +PREFIX ?= $(prefix) +exec_prefix ?= $(PREFIX) +bindir ?= $(exec_prefix)/bin +BINDIR ?= $(bindir) +datarootdir ?= $(PREFIX)/share +mandir ?= $(datarootdir)/man +man1dir ?= $(mandir)/man1 + +ifneq (,$(filter $(shell uname),OpenBSD FreeBSD NetBSD DragonFly SunOS)) +MANDIR ?= $(PREFIX)/man/man1 +else +MANDIR ?= $(man1dir) +endif + ifneq (,$(filter $(shell uname),SunOS)) INSTALL ?= ginstall else INSTALL ?= install endif -PREFIX ?= /usr/local -DESTDIR ?= -BINDIR ?= $(PREFIX)/bin - -ifneq (,$(filter $(shell uname),OpenBSD FreeBSD NetBSD DragonFly SunOS)) -MANDIR ?= $(PREFIX)/man/man1 -else -MANDIR ?= $(PREFIX)/share/man/man1 -endif - -INSTALL_PROGRAM ?= $(INSTALL) -m 755 -INSTALL_SCRIPT ?= $(INSTALL) -m 755 -INSTALL_MAN ?= $(INSTALL) -m 644 +INSTALL_PROGRAM ?= $(INSTALL) +INSTALL_SCRIPT ?= $(INSTALL_PROGRAM) +INSTALL_DATA ?= $(INSTALL) -m 644 +INSTALL_MAN ?= $(INSTALL_DATA) .PHONY: install install: zstd diff --git a/contrib/zstd/programs/README.md b/sys/contrib/zstd/programs/README.md similarity index 68% rename from contrib/zstd/programs/README.md rename to sys/contrib/zstd/programs/README.md index 8b65dfdb3f24..2da9a6db1261 100644 --- a/contrib/zstd/programs/README.md +++ b/sys/contrib/zstd/programs/README.md @@ -40,6 +40,16 @@ There are however other Makefile targets that create different variations of CLI In which case, linking stage will fail if `lzma` library cannot be found. This might be useful to prevent silent feature disabling. +- __HAVE_LZ4__ : `zstd` can compress and decompress files in `.lz4` formats. + This is ordered through commands `--format=lz4`. + Alternatively, symlinks named `lz4`, or `unlz4` will mimic intended behavior. + `.lz4` support is automatically enabled when `lz4` library is detected at build time. + It's possible to disable `.lz4` support, by setting HAVE_LZ4=0 . + Example : make zstd HAVE_LZ4=0 + It's also possible to force compilation with lz4 support, using HAVE_LZ4=1. + In which case, linking stage will fail if `lz4` library cannot be found. + This might be useful to prevent silent feature disabling. + - __ZSTD_LEGACY_SUPPORT__ : `zstd` can decompress files compressed by older versions of `zstd`. Starting v0.8.0, all versions of `zstd` produce frames compliant with the [specification](../doc/zstd_compression_format.md), and are therefore compatible. But older versions (< v0.8.0) produced different, incompatible, frames. @@ -113,6 +123,7 @@ Advanced arguments : -c : force write to standard output, even if it is the console -l : print information about zstd compressed files --ultra : enable levels beyond 19, up to 22 (requires more memory) +--long : enable long distance matching (requires more memory) --no-dictID : don't write dictID into header (dictionary compression) --[no-]check : integrity check (default:enabled) -r : operate recursively on directories @@ -139,3 +150,60 @@ Benchmark arguments : -B# : cut file into independent blocks of size # (default: no block) --priority=rt : set process priority to real-time ``` + + +#### Long distance matching mode +The long distance matching mode, enabled with `--long`, is designed to improve +the compression ratio for files with long matches at a large distance (up to the +maximum window size, `128 MiB`) while still maintaining compression speed. + +Enabling this mode sets the window size to `128 MiB` and thus increases the memory +usage for both the compressor and decompressor. Performance in terms of speed is +dependent on long matches being found. Compression speed may degrade if few long +matches are found. Decompression speed usually improves when there are many long +distance matches. + +Below are graphs comparing the compression speed, compression ratio, and +decompression speed with and without long distance matching on an ideal use +case: a tar of four versions of clang (versions `3.4.1`, `3.4.2`, `3.5.0`, +`3.5.1`) with a total size of `244889600 B`. This is an ideal use case as there +are many long distance matches within the maximum window size of `128 MiB` (each +version is less than `128 MiB`). + +Compression Speed vs Ratio | Decompression Speed +---------------------------|--------------------- +![Compression Speed vs Ratio](../doc/images/ldmCspeed.png "Compression Speed vs Ratio") | ![Decompression Speed](../doc/images/ldmDspeed.png "Decompression Speed") + +| Method | Compression ratio | Compression speed | Decompression speed | +|:-------|------------------:|-------------------------:|---------------------------:| +| `zstd -1` | `5.065` | `284.8 MB/s` | `759.3 MB/s` | +| `zstd -5` | `5.826` | `124.9 MB/s` | `674.0 MB/s` | +| `zstd -10` | `6.504` | `29.5 MB/s` | `771.3 MB/s` | +| `zstd -1 --long` | `17.426` | `220.6 MB/s` | `1638.4 MB/s` | +| `zstd -5 --long` | `19.661` | `165.5 MB/s` | `1530.6 MB/s`| +| `zstd -10 --long`| `21.949` | `75.6 MB/s` | `1632.6 MB/s`| + +On this file, the compression ratio improves significantly with minimal impact +on compression speed, and the decompression speed doubles. + +On the other extreme, compressing a file with few long distance matches (such as +the [Silesia compression corpus]) will likely lead to a deterioration in +compression speed (for lower levels) with minimal change in compression ratio. + +The below table illustrates this on the [Silesia compression corpus]. + +[Silesia compression corpus]: http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia + +| Method | Compression ratio | Compression speed | Decompression speed | +|:-------|------------------:|-------------------------:|---------------------------:| +| `zstd -1` | `2.878` | `231.7 MB/s` | `594.4 MB/s` | +| `zstd -1 --long` | `2.929` | `106.5 MB/s` | `517.9 MB/s` | +| `zstd -5` | `3.274` | `77.1 MB/s` | `464.2 MB/s` | +| `zstd -5 --long` | `3.319` | `51.7 MB/s` | `371.9 MB/s` | +| `zstd -10` | `3.523` | `16.4 MB/s` | `489.2 MB/s` | +| `zstd -10 --long`| `3.566` | `16.2 MB/s` | `415.7 MB/s` | + + + + + diff --git a/contrib/zstd/programs/bench.c b/sys/contrib/zstd/programs/bench.c similarity index 92% rename from contrib/zstd/programs/bench.c rename to sys/contrib/zstd/programs/bench.c index 2b48a4663a86..ec99c61cebf6 100644 --- a/contrib/zstd/programs/bench.c +++ b/sys/contrib/zstd/programs/bench.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ @@ -129,6 +130,31 @@ void BMK_setNbThreads(unsigned nbThreads) { #endif g_nbThreads = nbThreads; } +static U32 g_ldmFlag = 0; +void BMK_setLdmFlag(unsigned ldmFlag) { + g_ldmFlag = ldmFlag; +} + +static U32 g_ldmMinMatch = 0; +void BMK_setLdmMinMatch(unsigned ldmMinMatch) { + g_ldmMinMatch = ldmMinMatch; +} + +static U32 g_ldmHashLog = 0; +void BMK_setLdmHashLog(unsigned ldmHashLog) { + g_ldmHashLog = ldmHashLog; +} + +#define BMK_LDM_PARAM_NOTSET 9999 +static U32 g_ldmBucketSizeLog = BMK_LDM_PARAM_NOTSET; +void BMK_setLdmBucketSizeLog(unsigned ldmBucketSizeLog) { + g_ldmBucketSizeLog = ldmBucketSizeLog; +} + +static U32 g_ldmHashEveryLog = BMK_LDM_PARAM_NOTSET; +void BMK_setLdmHashEveryLog(unsigned ldmHashEveryLog) { + g_ldmHashEveryLog = ldmHashEveryLog; +} /* ******************************************************** @@ -170,7 +196,6 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize, size_t cSize = 0; double ratio = 0.; U32 nbBlocks; - UTIL_freq_t ticksPerSecond; /* checks */ if (!compressedBuffer || !resultBuffer || !blockTable || !ctx || !dctx) @@ -178,7 +203,6 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize, /* init */ if (strlen(displayName)>17) displayName += strlen(displayName)-17; /* display last 17 characters */ - UTIL_initTimer(&ticksPerSecond); if (g_decodeOnly) { /* benchmark only decompression : source must be already compressed */ const char* srcPtr = (const char*)srcBuffer; @@ -238,15 +262,15 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize, const char* const marks[NB_MARKS] = { " |", " /", " =", "\\" }; U32 markNb = 0; - UTIL_getTime(&coolTime); + coolTime = UTIL_getTime(); DISPLAYLEVEL(2, "\r%79s\r", ""); while (!cCompleted || !dCompleted) { /* overheat protection */ - if (UTIL_clockSpanMicro(coolTime, ticksPerSecond) > ACTIVEPERIOD_MICROSEC) { + if (UTIL_clockSpanMicro(coolTime) > ACTIVEPERIOD_MICROSEC) { DISPLAYLEVEL(2, "\rcooling down ... \r"); UTIL_sleep(COOLPERIOD_SEC); - UTIL_getTime(&coolTime); + coolTime = UTIL_getTime(); } if (!g_decodeOnly) { @@ -256,8 +280,8 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize, if (!cCompleted) memset(compressedBuffer, 0xE5, maxCompressedSize); /* warm up and erase result buffer */ UTIL_sleepMilli(1); /* give processor time to other processes */ - UTIL_waitForNextTick(ticksPerSecond); - UTIL_getTime(&clockStart); + UTIL_waitForNextTick(); + clockStart = UTIL_getTime(); if (!cCompleted) { /* still some time to do compression tests */ U64 const clockLoop = g_nbSeconds ? TIMELOOP_MICROSEC : 1; @@ -266,6 +290,15 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize, #ifdef ZSTD_NEWAPI ZSTD_CCtx_setParameter(ctx, ZSTD_p_nbThreads, g_nbThreads); ZSTD_CCtx_setParameter(ctx, ZSTD_p_compressionLevel, cLevel); + ZSTD_CCtx_setParameter(ctx, ZSTD_p_enableLongDistanceMatching, g_ldmFlag); + ZSTD_CCtx_setParameter(ctx, ZSTD_p_ldmMinMatch, g_ldmMinMatch); + ZSTD_CCtx_setParameter(ctx, ZSTD_p_ldmHashLog, g_ldmHashLog); + if (g_ldmBucketSizeLog != BMK_LDM_PARAM_NOTSET) { + ZSTD_CCtx_setParameter(ctx, ZSTD_p_ldmBucketSizeLog, g_ldmBucketSizeLog); + } + if (g_ldmHashEveryLog != BMK_LDM_PARAM_NOTSET) { + ZSTD_CCtx_setParameter(ctx, ZSTD_p_ldmHashEveryLog, g_ldmHashEveryLog); + } ZSTD_CCtx_setParameter(ctx, ZSTD_p_windowLog, comprParams->windowLog); ZSTD_CCtx_setParameter(ctx, ZSTD_p_chainLog, comprParams->chainLog); ZSTD_CCtx_setParameter(ctx, ZSTD_p_searchLog, comprParams->searchLog); @@ -284,7 +317,7 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize, if (comprParams->searchLength) zparams.cParams.searchLength = comprParams->searchLength; if (comprParams->targetLength) zparams.cParams.targetLength = comprParams->targetLength; if (comprParams->strategy) zparams.cParams.strategy = comprParams->strategy; - cdict = ZSTD_createCDict_advanced(dictBuffer, dictBufferSize, 1 /*byRef*/, ZSTD_dm_auto, zparams.cParams, cmem); + cdict = ZSTD_createCDict_advanced(dictBuffer, dictBufferSize, ZSTD_dlm_byRef, ZSTD_dm_auto, zparams.cParams, cmem); if (cdict==NULL) EXM_THROW(1, "ZSTD_createCDict_advanced() allocation failure"); #endif do { @@ -329,9 +362,9 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize, blockTable[blockNb].cSize = rSize; } nbLoops++; - } while (UTIL_clockSpanMicro(clockStart, ticksPerSecond) < clockLoop); + } while (UTIL_clockSpanMicro(clockStart) < clockLoop); ZSTD_freeCDict(cdict); - { U64 const clockSpanMicro = UTIL_clockSpanMicro(clockStart, ticksPerSecond); + { U64 const clockSpanMicro = UTIL_clockSpanMicro(clockStart); if (clockSpanMicro < fastestC*nbLoops) fastestC = clockSpanMicro / nbLoops; totalCTime += clockSpanMicro; cCompleted = (totalCTime >= maxTime); @@ -356,15 +389,14 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize, if (!dCompleted) memset(resultBuffer, 0xD6, srcSize); /* warm result buffer */ UTIL_sleepMilli(1); /* give processor time to other processes */ - UTIL_waitForNextTick(ticksPerSecond); + UTIL_waitForNextTick(); if (!dCompleted) { U64 clockLoop = g_nbSeconds ? TIMELOOP_MICROSEC : 1; U32 nbLoops = 0; - UTIL_time_t clockStart; ZSTD_DDict* const ddict = ZSTD_createDDict(dictBuffer, dictBufferSize); + UTIL_time_t const clockStart = UTIL_getTime(); if (!ddict) EXM_THROW(2, "ZSTD_createDDict() allocation failure"); - UTIL_getTime(&clockStart); do { U32 blockNb; for (blockNb=0; blockNb= maxTime); diff --git a/contrib/zstd/programs/bench.h b/sys/contrib/zstd/programs/bench.h similarity index 77% rename from contrib/zstd/programs/bench.h rename to sys/contrib/zstd/programs/bench.h index 5f8d61a25b30..82bb345696a7 100644 --- a/contrib/zstd/programs/bench.h +++ b/sys/contrib/zstd/programs/bench.h @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ @@ -25,5 +26,10 @@ void BMK_setNbThreads(unsigned nbThreads); void BMK_setNotificationLevel(unsigned level); void BMK_setAdditionalParam(int additionalParam); void BMK_setDecodeOnlyMode(unsigned decodeFlag); +void BMK_setLdmFlag(unsigned ldmFlag); +void BMK_setLdmMinMatch(unsigned ldmMinMatch); +void BMK_setLdmHashLog(unsigned ldmHashLog); +void BMK_setLdmBucketSizeLog(unsigned ldmBucketSizeLog); +void BMK_setLdmHashEveryLog(unsigned ldmHashEveryLog); #endif /* BENCH_H_121279284357 */ diff --git a/contrib/zstd/programs/datagen.c b/sys/contrib/zstd/programs/datagen.c similarity index 98% rename from contrib/zstd/programs/datagen.c rename to sys/contrib/zstd/programs/datagen.c index b1da8e78b31e..a489d6af08d7 100644 --- a/contrib/zstd/programs/datagen.c +++ b/sys/contrib/zstd/programs/datagen.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ diff --git a/contrib/zstd/programs/datagen.h b/sys/contrib/zstd/programs/datagen.h similarity index 94% rename from contrib/zstd/programs/datagen.h rename to sys/contrib/zstd/programs/datagen.h index 5b1b7c47cc5d..2fcc980e5e76 100644 --- a/contrib/zstd/programs/datagen.h +++ b/sys/contrib/zstd/programs/datagen.h @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ diff --git a/contrib/zstd/programs/dibio.c b/sys/contrib/zstd/programs/dibio.c similarity index 53% rename from contrib/zstd/programs/dibio.c rename to sys/contrib/zstd/programs/dibio.c index ab2dc285a273..2cb2a42671a0 100644 --- a/contrib/zstd/programs/dibio.c +++ b/sys/contrib/zstd/programs/dibio.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ @@ -13,7 +14,7 @@ * Compiler Warnings ****************************************/ #ifdef _MSC_VER -# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ +# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ #endif @@ -43,7 +44,7 @@ #define SAMPLESIZE_MAX (128 KB) #define MEMMULT 11 /* rough estimation : memory cost to analyze 1 byte of sample */ #define COVER_MEMMULT 9 /* rough estimation : memory cost to analyze 1 byte of sample */ -static const size_t maxMemory = (sizeof(size_t) == 4) ? (2 GB - 64 MB) : ((size_t)(512 MB) << sizeof(size_t)); +static const size_t g_maxMemory = (sizeof(size_t) == 4) ? (2 GB - 64 MB) : ((size_t)(512 MB) << sizeof(size_t)); #define NOISELENGTH 32 @@ -52,13 +53,12 @@ static const size_t maxMemory = (sizeof(size_t) == 4) ? (2 GB - 64 MB) : ((size_ * Console display ***************************************/ #define DISPLAY(...) fprintf(stderr, __VA_ARGS__) -#define DISPLAYLEVEL(l, ...) if (g_displayLevel>=l) { DISPLAY(__VA_ARGS__); } -static int g_displayLevel = 0; /* 0 : no display; 1: errors; 2: default; 4: full information */ +#define DISPLAYLEVEL(l, ...) if (displayLevel>=l) { DISPLAY(__VA_ARGS__); } -#define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \ - if ((DIB_clockSpan(g_time) > refreshRate) || (g_displayLevel>=4)) \ +#define DISPLAYUPDATE(l, ...) if (displayLevel>=l) { \ + if ((DIB_clockSpan(g_time) > refreshRate) || (displayLevel>=4)) \ { g_time = clock(); DISPLAY(__VA_ARGS__); \ - if (g_displayLevel>=4) fflush(stderr); } } + if (displayLevel>=4) fflush(stderr); } } static const clock_t refreshRate = CLOCKS_PER_SEC * 2 / 10; static clock_t g_time = 0; @@ -75,9 +75,9 @@ static clock_t DIB_clockSpan(clock_t nPrevious) { return clock() - nPrevious; } #define EXM_THROW(error, ...) \ { \ DEBUGOUTPUT("Error defined at %s, line %i : \n", __FILE__, __LINE__); \ - DISPLAYLEVEL(1, "Error %i : ", error); \ - DISPLAYLEVEL(1, __VA_ARGS__); \ - DISPLAYLEVEL(1, "\n"); \ + DISPLAY("Error %i : ", error); \ + DISPLAY(__VA_ARGS__); \ + DISPLAY("\n"); \ exit(error); \ } @@ -97,32 +97,55 @@ const char* DiB_getErrorName(size_t errorCode) { return ERR_getErrorName(errorCo * File related operations **********************************************************/ /** DiB_loadFiles() : -* @return : nb of files effectively loaded into `buffer` */ + * load samples from files listed in fileNamesTable into buffer. + * works even if buffer is too small to load all samples. + * Also provides the size of each sample into sampleSizes table + * which must be sized correctly, using DiB_fileStats(). + * @return : nb of samples effectively loaded into `buffer` + * *bufferSizePtr is modified, it provides the amount data loaded within buffer. + * sampleSizes is filled with the size of each sample. + */ static unsigned DiB_loadFiles(void* buffer, size_t* bufferSizePtr, - size_t* fileSizes, - const char** fileNamesTable, unsigned nbFiles) + size_t* sampleSizes, unsigned sstSize, + const char** fileNamesTable, unsigned nbFiles, size_t targetChunkSize, + unsigned displayLevel) { char* const buff = (char*)buffer; size_t pos = 0; - unsigned n; + unsigned nbLoadedChunks = 0, fileIndex; - for (n=0; n *bufferSizePtr-pos) break; - { FILE* const f = fopen(fileName, "rb"); - if (f==NULL) EXM_THROW(10, "zstd: dictBuilder: %s %s ", fileName, strerror(errno)); - DISPLAYUPDATE(2, "Loading %s... \r", fileName); - { size_t const readSize = fread(buff+pos, 1, fileSize, f); - if (readSize != fileSize) EXM_THROW(11, "Pb reading %s", fileName); - pos += readSize; } - fileSizes[n] = fileSize; - fclose(f); - } } + unsigned long long remainingToLoad = fs64; + U32 const nbChunks = targetChunkSize ? (U32)((fs64 + (targetChunkSize-1)) / targetChunkSize) : 1; + U64 const chunkSize = targetChunkSize ? MIN(targetChunkSize, fs64) : fs64; + size_t const maxChunkSize = (size_t)MIN(chunkSize, SAMPLESIZE_MAX); + U32 cnb; + FILE* const f = fopen(fileName, "rb"); + if (f==NULL) EXM_THROW(10, "zstd: dictBuilder: %s %s ", fileName, strerror(errno)); + DISPLAYUPDATE(2, "Loading %s... \r", fileName); + for (cnb=0; cnb *bufferSizePtr-pos) break; + { size_t const readSize = fread(buff+pos, 1, toLoad, f); + if (readSize != toLoad) EXM_THROW(11, "Pb reading %s", fileName); + pos += readSize; + sampleSizes[nbLoadedChunks++] = toLoad; + remainingToLoad -= targetChunkSize; + if (nbLoadedChunks == sstSize) { /* no more space left in sampleSizes table */ + fileIndex = nbFiles; /* stop there */ + break; + } + if (toLoad < targetChunkSize) { + fseek(f, (long)(targetChunkSize - toLoad), SEEK_CUR); + } } } + fclose(f); + } DISPLAYLEVEL(2, "\r%79s\r", ""); *bufferSizePtr = pos; - return n; + DISPLAYLEVEL(4, "loaded : %u KB \n", (U32)(pos >> 10)) + return nbLoadedChunks; } #define DiB_rotl32(x,r) ((x << r) | (x >> (32 - r))) @@ -138,16 +161,19 @@ static U32 DiB_rand(U32* src) return rand32 >> 5; } +/* DiB_shuffle() : + * shuffle a table of file names in a semi-random way + * It improves dictionary quality by reducing "locality" impact, so if sample set is very large, + * it will load random elements from it, instead of just the first ones. */ static void DiB_shuffle(const char** fileNamesTable, unsigned nbFiles) { - /* Initialize the pseudorandom number generator */ - U32 seed = 0xFD2FB528; - unsigned i; - for (i = nbFiles - 1; i > 0; --i) { - unsigned const j = DiB_rand(&seed) % (i + 1); - const char* tmp = fileNamesTable[j]; - fileNamesTable[j] = fileNamesTable[i]; - fileNamesTable[i] = tmp; - } + U32 seed = 0xFD2FB528; + unsigned i; + for (i = nbFiles - 1; i > 0; --i) { + unsigned const j = DiB_rand(&seed) % (i + 1); + const char* const tmp = fileNamesTable[j]; + fileNamesTable[j] = fileNamesTable[i]; + fileNamesTable[i] = tmp; + } } @@ -161,7 +187,7 @@ static size_t DiB_findMaxMem(unsigned long long requiredMem) requiredMem = (((requiredMem >> 23) + 1) << 23); requiredMem += step; - if (requiredMem > maxMemory) requiredMem = maxMemory; + if (requiredMem > g_maxMemory) requiredMem = g_maxMemory; while (!testmem) { testmem = malloc((size_t)requiredMem); @@ -201,18 +227,33 @@ static void DiB_saveDict(const char* dictFileName, } -static int g_tooLargeSamples = 0; -static U64 DiB_getTotalCappedFileSize(const char** fileNamesTable, unsigned nbFiles) +typedef struct { + U64 totalSizeToLoad; + unsigned oneSampleTooLarge; + unsigned nbSamples; +} fileStats; + +/*! DiB_fileStats() : + * Given a list of files, and a chunkSize (0 == no chunk, whole files) + * provides the amount of data to be loaded and the resulting nb of samples. + * This is useful primarily for allocation purpose => sample buffer, and sample sizes table. + */ +static fileStats DiB_fileStats(const char** fileNamesTable, unsigned nbFiles, size_t chunkSize, unsigned displayLevel) { - U64 total = 0; + fileStats fs; unsigned n; + memset(&fs, 0, sizeof(fs)); for (n=0; n 2*SAMPLESIZE_MAX); + U32 const nbSamples = (U32)(chunkSize ? (fileSize + (chunkSize-1)) / chunkSize : 1); + U64 const chunkToLoad = chunkSize ? MIN(chunkSize, fileSize) : fileSize; + size_t const cappedChunkSize = (size_t)MIN(chunkToLoad, SAMPLESIZE_MAX); + fs.totalSizeToLoad += cappedChunkSize * nbSamples; + fs.oneSampleTooLarge |= (chunkSize > 2*SAMPLESIZE_MAX); + fs.nbSamples += nbSamples; } - return total; + DISPLAYLEVEL(4, "Preparing to load : %u KB \n", (U32)(fs.totalSizeToLoad >> 10)); + return fs; } @@ -229,64 +270,66 @@ size_t ZDICT_trainFromBuffer_unsafe_legacy(void* dictBuffer, size_t dictBufferCa int DiB_trainFromFiles(const char* dictFileName, unsigned maxDictSize, - const char** fileNamesTable, unsigned nbFiles, + const char** fileNamesTable, unsigned nbFiles, size_t chunkSize, ZDICT_legacy_params_t *params, ZDICT_cover_params_t *coverParams, int optimizeCover) { + unsigned const displayLevel = params ? params->zParams.notificationLevel : + coverParams ? coverParams->zParams.notificationLevel : + 0; /* should never happen */ void* const dictBuffer = malloc(maxDictSize); - size_t* const fileSizes = (size_t*)malloc(nbFiles * sizeof(size_t)); - unsigned long long const totalSizeToLoad = DiB_getTotalCappedFileSize(fileNamesTable, nbFiles); + fileStats const fs = DiB_fileStats(fileNamesTable, nbFiles, chunkSize, displayLevel); + size_t* const sampleSizes = (size_t*)malloc(fs.nbSamples * sizeof(size_t)); size_t const memMult = params ? MEMMULT : COVER_MEMMULT; - size_t const maxMem = DiB_findMaxMem(totalSizeToLoad * memMult) / memMult; - size_t benchedSize = (size_t) MIN ((unsigned long long)maxMem, totalSizeToLoad); - void* const srcBuffer = malloc(benchedSize+NOISELENGTH); + size_t const maxMem = DiB_findMaxMem(fs.totalSizeToLoad * memMult) / memMult; + size_t loadedSize = (size_t) MIN ((unsigned long long)maxMem, fs.totalSizeToLoad); + void* const srcBuffer = malloc(loadedSize+NOISELENGTH); int result = 0; /* Checks */ - if (params) g_displayLevel = params->zParams.notificationLevel; - else if (coverParams) g_displayLevel = coverParams->zParams.notificationLevel; - else EXM_THROW(13, "Neither dictionary algorith selected"); /* should not happen */ - if ((!fileSizes) || (!srcBuffer) || (!dictBuffer)) EXM_THROW(12, "not enough memory for DiB_trainFiles"); /* should not happen */ - if (g_tooLargeSamples) { - DISPLAYLEVEL(2, "! Warning : some samples are very large \n"); - DISPLAYLEVEL(2, "! Note that dictionary is only useful for small files or beginning of large files. \n"); - DISPLAYLEVEL(2, "! As a consequence, only the first %u bytes of each file are loaded \n", SAMPLESIZE_MAX); + if ((!sampleSizes) || (!srcBuffer) || (!dictBuffer)) + EXM_THROW(12, "not enough memory for DiB_trainFiles"); /* should not happen */ + if (fs.oneSampleTooLarge) { + DISPLAYLEVEL(2, "! Warning : some sample(s) are very large \n"); + DISPLAYLEVEL(2, "! Note that dictionary is only useful for small samples. \n"); + DISPLAYLEVEL(2, "! As a consequence, only the first %u bytes of each sample are loaded \n", SAMPLESIZE_MAX); } - if ((nbFiles < 5) || (totalSizeToLoad < 9 * (unsigned long long)maxDictSize)) { + if (fs.nbSamples < 5) { DISPLAYLEVEL(2, "! Warning : nb of samples too low for proper processing ! \n"); DISPLAYLEVEL(2, "! Please provide _one file per sample_. \n"); - DISPLAYLEVEL(2, "! Do not concatenate samples together into a single file, \n"); - DISPLAYLEVEL(2, "! as dictBuilder will be unable to find the beginning of each sample, \n"); - DISPLAYLEVEL(2, "! resulting in poor dictionary quality. \n"); + DISPLAYLEVEL(2, "! Alternatively, split files into fixed-size blocks representative of samples, with -B# \n"); + EXM_THROW(14, "nb of samples too low"); /* we now clearly forbid this case */ + } + if (fs.totalSizeToLoad < (unsigned long long)(8 * maxDictSize)) { + DISPLAYLEVEL(2, "! Warning : data size of samples too small for target dictionary size \n"); + DISPLAYLEVEL(2, "! Samples should be about 100x larger than target dictionary size \n"); } /* init */ - if (benchedSize < totalSizeToLoad) - DISPLAYLEVEL(1, "Not enough memory; training on %u MB only...\n", (unsigned)(benchedSize >> 20)); + if (loadedSize < fs.totalSizeToLoad) + DISPLAYLEVEL(1, "Not enough memory; training on %u MB only...\n", (unsigned)(loadedSize >> 20)); /* Load input buffer */ DISPLAYLEVEL(3, "Shuffling input files\n"); DiB_shuffle(fileNamesTable, nbFiles); - nbFiles = DiB_loadFiles(srcBuffer, &benchedSize, fileSizes, fileNamesTable, nbFiles); + nbFiles = DiB_loadFiles(srcBuffer, &loadedSize, sampleSizes, fs.nbSamples, fileNamesTable, nbFiles, chunkSize, displayLevel); - { - size_t dictSize; + { size_t dictSize; if (params) { - DiB_fillNoise((char*)srcBuffer + benchedSize, NOISELENGTH); /* guard band, for end of buffer condition */ + DiB_fillNoise((char*)srcBuffer + loadedSize, NOISELENGTH); /* guard band, for end of buffer condition */ dictSize = ZDICT_trainFromBuffer_unsafe_legacy(dictBuffer, maxDictSize, - srcBuffer, fileSizes, nbFiles, + srcBuffer, sampleSizes, fs.nbSamples, *params); } else if (optimizeCover) { dictSize = ZDICT_optimizeTrainFromBuffer_cover(dictBuffer, maxDictSize, - srcBuffer, fileSizes, nbFiles, + srcBuffer, sampleSizes, fs.nbSamples, coverParams); if (!ZDICT_isError(dictSize)) { DISPLAYLEVEL(2, "k=%u\nd=%u\nsteps=%u\n", coverParams->k, coverParams->d, coverParams->steps); } } else { - dictSize = - ZDICT_trainFromBuffer_cover(dictBuffer, maxDictSize, srcBuffer, - fileSizes, nbFiles, *coverParams); + dictSize = ZDICT_trainFromBuffer_cover(dictBuffer, maxDictSize, srcBuffer, + sampleSizes, fs.nbSamples, *coverParams); } if (ZDICT_isError(dictSize)) { DISPLAYLEVEL(1, "dictionary training failed : %s \n", ZDICT_getErrorName(dictSize)); /* should not happen */ @@ -301,7 +344,7 @@ int DiB_trainFromFiles(const char* dictFileName, unsigned maxDictSize, /* clean up */ _cleanup: free(srcBuffer); + free(sampleSizes); free(dictBuffer); - free(fileSizes); return result; } diff --git a/contrib/zstd/programs/dibio.h b/sys/contrib/zstd/programs/dibio.h similarity index 93% rename from contrib/zstd/programs/dibio.h rename to sys/contrib/zstd/programs/dibio.h index 0227239b26db..499e3036520c 100644 --- a/contrib/zstd/programs/dibio.h +++ b/sys/contrib/zstd/programs/dibio.h @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ /* This library is designed for a single-threaded console application. @@ -31,7 +32,7 @@ @return : 0 == ok. Any other : error. */ int DiB_trainFromFiles(const char* dictFileName, unsigned maxDictSize, - const char** fileNamesTable, unsigned nbFiles, + const char** fileNamesTable, unsigned nbFiles, size_t chunkSize, ZDICT_legacy_params_t *params, ZDICT_cover_params_t *coverParams, int optimizeCover); diff --git a/contrib/zstd/programs/fileio.c b/sys/contrib/zstd/programs/fileio.c similarity index 85% rename from contrib/zstd/programs/fileio.c rename to sys/contrib/zstd/programs/fileio.c index 92561edaa71e..dedea009a941 100644 --- a/contrib/zstd/programs/fileio.c +++ b/sys/contrib/zstd/programs/fileio.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ @@ -36,6 +37,7 @@ # include #endif +#include "bitstream.h" #include "mem.h" #include "fileio.h" #define ZSTD_STATIC_LINKING_ONLY /* ZSTD_magicNumber, ZSTD_frameHeaderSize_max */ @@ -55,6 +57,7 @@ #define LZ4_MAGICNUMBER 0x184D2204 #if defined(ZSTD_LZ4COMPRESS) || defined(ZSTD_LZ4DECOMPRESS) +# define LZ4F_ENABLE_OBSOLETE_ENUMS # include # include #endif @@ -104,9 +107,6 @@ static clock_t g_time = 0; #define MIN(a,b) ((a) < (b) ? (a) : (b)) -/*-************************************* -* Errors -***************************************/ /*-************************************* * Debug ***************************************/ @@ -140,6 +140,24 @@ static clock_t g_time = 0; } } +/*-************************************ +* Signal (Ctrl-C trapping) +**************************************/ +#include + +static const char* g_artefact = NULL; +static void INThandler(int sig) +{ + assert(sig==SIGINT); (void)sig; +#if !defined(_MSC_VER) + signal(sig, SIG_IGN); /* this invocation generates a buggy warning in Visual Studio */ +#endif + if (g_artefact) remove(g_artefact); + DISPLAY("\n"); + exit(2); +} + + /* ************************************************************ * Avoid fseek()'s 2GiB barrier with MSVC, MacOS, *BSD, MinGW ***************************************************************/ @@ -213,6 +231,30 @@ void FIO_setOverlapLog(unsigned overlapLog){ DISPLAYLEVEL(2, "Setting overlapLog is useless in single-thread mode \n"); g_overlapLog = overlapLog; } +static U32 g_ldmFlag = 0; +void FIO_setLdmFlag(unsigned ldmFlag) { + g_ldmFlag = (ldmFlag>0); +} +static U32 g_ldmHashLog = 0; +void FIO_setLdmHashLog(unsigned ldmHashLog) { + g_ldmHashLog = ldmHashLog; +} +static U32 g_ldmMinMatch = 0; +void FIO_setLdmMinMatch(unsigned ldmMinMatch) { + g_ldmMinMatch = ldmMinMatch; +} + +#define FIO_LDM_PARAM_NOTSET 9999 +static U32 g_ldmBucketSizeLog = FIO_LDM_PARAM_NOTSET; +void FIO_setLdmBucketSizeLog(unsigned ldmBucketSizeLog) { + g_ldmBucketSizeLog = ldmBucketSizeLog; +} + +static U32 g_ldmHashEveryLog = FIO_LDM_PARAM_NOTSET; +void FIO_setLdmHashEveryLog(unsigned ldmHashEveryLog) { + g_ldmHashEveryLog = ldmHashEveryLog; +} + /*-************************************* @@ -325,13 +367,16 @@ static size_t FIO_createDictBuffer(void** bufferPtr, const char* fileName) fileHandle = fopen(fileName, "rb"); if (fileHandle==0) EXM_THROW(31, "%s: %s", fileName, strerror(errno)); fileSize = UTIL_getFileSize(fileName); - if (fileSize > DICTSIZE_MAX) + if (fileSize > DICTSIZE_MAX) { EXM_THROW(32, "Dictionary file %s is too large (> %u MB)", fileName, DICTSIZE_MAX >> 20); /* avoid extreme cases */ + } *bufferPtr = malloc((size_t)fileSize); if (*bufferPtr==NULL) EXM_THROW(34, "%s", strerror(errno)); - { size_t const readSize = fread(*bufferPtr, 1, (size_t)fileSize, fileHandle); - if (readSize!=fileSize) EXM_THROW(35, "Error reading dictionary file %s", fileName); } + { size_t const readSize = fread(*bufferPtr, 1, (size_t)fileSize, fileHandle); + if (readSize!=fileSize) + EXM_THROW(35, "Error reading dictionary file %s", fileName); + } fclose(fileHandle); return (size_t)fileSize; } @@ -356,7 +401,7 @@ typedef struct { } cRess_t; static cRess_t FIO_createCResources(const char* dictFileName, int cLevel, - U64 srcSize, int srcIsRegularFile, + U64 srcSize, ZSTD_compressionParameters* comprParams) { cRess_t ress; memset(&ress, 0, sizeof(ress)); @@ -394,12 +439,23 @@ static cRess_t FIO_createCResources(const char* dictFileName, int cLevel, #ifdef ZSTD_NEWAPI { /* frame parameters */ - CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_contentSizeFlag, srcIsRegularFile) ); CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_dictIDFlag, g_dictIDFlag) ); CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_checksumFlag, g_checksumFlag) ); - CHECK( ZSTD_CCtx_setPledgedSrcSize(ress.cctx, srcSize) ); - /* compression parameters */ + (void)srcSize; + /* compression level */ CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_compressionLevel, cLevel) ); + /* long distance matching */ + CHECK( ZSTD_CCtx_setParameter( + ress.cctx, ZSTD_p_enableLongDistanceMatching, g_ldmFlag) ); + CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_ldmHashLog, g_ldmHashLog) ); + CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_ldmMinMatch, g_ldmMinMatch) ); + if (g_ldmBucketSizeLog != FIO_LDM_PARAM_NOTSET) { + CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_ldmBucketSizeLog, g_ldmBucketSizeLog) ); + } + if (g_ldmHashEveryLog != FIO_LDM_PARAM_NOTSET) { + CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_ldmHashEveryLog, g_ldmHashEveryLog) ); + } + /* compression parameters */ CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_windowLog, comprParams->windowLog) ); CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_chainLog, comprParams->chainLog) ); CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_hashLog, comprParams->hashLog) ); @@ -408,13 +464,13 @@ static cRess_t FIO_createCResources(const char* dictFileName, int cLevel, CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_targetLength, comprParams->targetLength) ); CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_compressionStrategy, (U32)comprParams->strategy) ); /* multi-threading */ + DISPLAYLEVEL(5,"set nb threads = %u \n", g_nbThreads); CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_nbThreads, g_nbThreads) ); /* dictionary */ CHECK( ZSTD_CCtx_loadDictionary(ress.cctx, dictBuffer, dictBuffSize) ); } #elif defined(ZSTD_MULTITHREAD) { ZSTD_parameters params = ZSTD_getParams(cLevel, srcSize, dictBuffSize); - params.fParams.contentSizeFlag = srcIsRegularFile; params.fParams.checksumFlag = g_checksumFlag; params.fParams.noDictIDFlag = !g_dictIDFlag; if (comprParams->windowLog) params.cParams.windowLog = comprParams->windowLog; @@ -429,7 +485,6 @@ static cRess_t FIO_createCResources(const char* dictFileName, int cLevel, } #else { ZSTD_parameters params = ZSTD_getParams(cLevel, srcSize, dictBuffSize); - params.fParams.contentSizeFlag = srcIsRegularFile; params.fParams.checksumFlag = g_checksumFlag; params.fParams.noDictIDFlag = !g_dictIDFlag; if (comprParams->windowLog) params.cParams.windowLog = comprParams->windowLog; @@ -719,6 +774,7 @@ static int FIO_compressFilename_internal(cRess_t ress, U64 readsize = 0; U64 compressedfilesize = 0; U64 const fileSize = UTIL_getFileSize(srcFileName); + DISPLAYLEVEL(5, "%s: %u bytes \n", srcFileName, (U32)fileSize); switch (g_compressionType) { case FIO_zstdCompression: @@ -758,11 +814,12 @@ static int FIO_compressFilename_internal(cRess_t ress, /* init */ #ifdef ZSTD_NEWAPI - /* nothing, reset is implied */ + if (fileSize!=0) /* when src is stdin, fileSize==0, but is effectively unknown */ + ZSTD_CCtx_setPledgedSrcSize(ress.cctx, fileSize); /* note : fileSize==0 means "empty" */ #elif defined(ZSTD_MULTITHREAD) - CHECK( ZSTDMT_resetCStream(ress.cctx, fileSize) ); + CHECK( ZSTDMT_resetCStream(ress.cctx, fileSize) ); /* note : fileSize==0 means "unknown" */ #else - CHECK( ZSTD_resetCStream(ress.cctx, fileSize) ); + CHECK( ZSTD_resetCStream(ress.cctx, fileSize) ); /* note : fileSize==0 means "unknown" */ #endif /* Main compression loop */ @@ -811,10 +868,10 @@ static int FIO_compressFilename_internal(cRess_t ress, /* End of Frame */ { size_t result = 1; - while (result!=0) { /* note : is there any possibility of endless loop ? */ + while (result != 0) { ZSTD_outBuffer outBuff = { ress.dstBuffer, ress.dstBufferSize, 0 }; #ifdef ZSTD_NEWAPI - ZSTD_inBuffer inBuff = { NULL, 0, 0}; + ZSTD_inBuffer inBuff = { NULL, 0, 0 }; result = ZSTD_compress_generic(ress.cctx, &outBuff, &inBuff, ZSTD_e_end); #elif defined(ZSTD_MULTITHREAD) @@ -822,11 +879,14 @@ static int FIO_compressFilename_internal(cRess_t ress, #else result = ZSTD_endStream(ress.cctx, &outBuff); #endif - if (ZSTD_isError(result)) + if (ZSTD_isError(result)) { EXM_THROW(26, "Compression error during frame end : %s", ZSTD_getErrorName(result)); - { size_t const sizeCheck = fwrite(ress.dstBuffer, 1, outBuff.pos, dstFile); - if (sizeCheck!=outBuff.pos) EXM_THROW(27, "Write error : cannot write frame end into %s", dstFileName); } + } + { size_t const sizeCheck = fwrite(ress.dstBuffer, 1, outBuff.pos, dstFile); + if (sizeCheck!=outBuff.pos) + EXM_THROW(27, "Write error : cannot write frame end into %s", dstFileName); + } compressedfilesize += outBuff.pos; } } @@ -890,6 +950,14 @@ static int FIO_compressFilename_dstFile(cRess_t ress, ress.dstFile = FIO_openDstFile(dstFileName); if (ress.dstFile==NULL) return 1; /* could not open dstFileName */ + if (UTIL_isRegularFile(dstFileName)) { + g_artefact = dstFileName; + signal(SIGINT, INThandler); + } else { + g_artefact = NULL; + } + + if (strcmp (srcFileName, stdinmark) && UTIL_getFileStat(srcFileName, &statbuf)) stat_result = 1; result = FIO_compressFilename_srcFile(ress, dstFileName, srcFileName, compressionLevel); @@ -904,6 +972,9 @@ static int FIO_compressFilename_dstFile(cRess_t ress, } else if (strcmp (dstFileName, stdoutmark) && stat_result) UTIL_setFileStat(dstFileName, &statbuf); + + signal(SIGINT, SIG_DFL); + return result; } @@ -913,9 +984,8 @@ int FIO_compressFilename(const char* dstFileName, const char* srcFileName, { clock_t const start = clock(); U64 const srcSize = UTIL_getFileSize(srcFileName); - int const isRegularFile = UTIL_isRegularFile(srcFileName); - cRess_t const ress = FIO_createCResources(dictFileName, compressionLevel, srcSize, isRegularFile, comprParams); + cRess_t const ress = FIO_createCResources(dictFileName, compressionLevel, srcSize, comprParams); int const result = FIO_compressFilename_dstFile(ress, dstFileName, srcFileName, compressionLevel); double const seconds = (double)(clock() - start) / CLOCKS_PER_SEC; @@ -936,8 +1006,7 @@ int FIO_compressMultipleFilenames(const char** inFileNamesTable, unsigned nbFile char* dstFileName = (char*)malloc(FNSPACE); size_t const suffixSize = suffix ? strlen(suffix) : 0; U64 const srcSize = (nbFiles != 1) ? 0 : UTIL_getFileSize(inFileNamesTable[0]) ; - int const isRegularFile = (nbFiles != 1) ? 0 : UTIL_isRegularFile(inFileNamesTable[0]); - cRess_t ress = FIO_createCResources(dictFileName, compressionLevel, srcSize, isRegularFile, comprParams); + cRess_t ress = FIO_createCResources(dictFileName, compressionLevel, srcSize, comprParams); /* init */ if (dstFileName==NULL) @@ -986,8 +1055,8 @@ int FIO_compressMultipleFilenames(const char** inFileNamesTable, unsigned nbFile ***************************************************************************/ typedef struct { void* srcBuffer; - size_t srcBufferLoaded; size_t srcBufferSize; + size_t srcBufferLoaded; void* dstBuffer; size_t dstBufferSize; ZSTD_DStream* dctx; @@ -1002,7 +1071,7 @@ static dRess_t FIO_createDResources(const char* dictFileName) /* Allocation */ ress.dctx = ZSTD_createDStream(); if (ress.dctx==NULL) EXM_THROW(60, "Can't create ZSTD_DStream"); - ZSTD_setDStreamParameter(ress.dctx, DStream_p_maxWindowSize, g_memLimit); + CHECK( ZSTD_setDStreamParameter(ress.dctx, DStream_p_maxWindowSize, g_memLimit) ); ress.srcBufferSize = ZSTD_DStreamInSize(); ress.srcBuffer = malloc(ress.srcBufferSize); ress.dstBufferSize = ZSTD_DStreamOutSize(); @@ -1133,6 +1202,35 @@ static unsigned FIO_passThrough(FILE* foutput, FILE* finput, void* buffer, size_ return 0; } +static void FIO_zstdErrorHelp(dRess_t* ress, size_t ret, char const* srcFileName) +{ + ZSTD_frameHeader header; + /* No special help for these errors */ + if (ZSTD_getErrorCode(ret) != ZSTD_error_frameParameter_windowTooLarge) + return; + /* Try to decode the frame header */ + ret = ZSTD_getFrameHeader(&header, ress->srcBuffer, ress->srcBufferLoaded); + if (ret == 0) { + U32 const windowSize = (U32)header.windowSize; + U32 const windowLog = BIT_highbit32(windowSize) + ((windowSize & (windowSize - 1)) != 0); + U32 const windowMB = (windowSize >> 20) + (windowSize & ((1 MB) - 1)); + assert(header.windowSize <= (U64)((U32)-1)); + assert(g_memLimit > 0); + DISPLAYLEVEL(1, "%s : Window size larger than maximum : %llu > %u\n", + srcFileName, header.windowSize, g_memLimit); + if (windowLog <= ZSTD_WINDOWLOG_MAX) { + DISPLAYLEVEL(1, "%s : Use --long=%u or --memory=%uMB\n", + srcFileName, windowLog, windowMB); + return; + } + } else if (ZSTD_getErrorCode(ret) != ZSTD_error_frameParameter_windowTooLarge) { + DISPLAYLEVEL(1, "%s : Error decoding frame header to read window size : %s\n", + srcFileName, ZSTD_getErrorName(ret)); + return; + } + DISPLAYLEVEL(1, "%s : Window log larger than ZSTD_WINDOWLOG_MAX=%u not supported\n", + srcFileName, ZSTD_WINDOWLOG_MAX); +} /** FIO_decompressFrame() : * @return : size of decoded zstd frame, or an error code @@ -1146,14 +1244,18 @@ unsigned long long FIO_decompressZstdFrame(dRess_t* ress, U64 frameSize = 0; U32 storedSkips = 0; - ZSTD_resetDStream(ress->dctx); - if (strlen(srcFileName)>20) srcFileName += strlen(srcFileName)-20; /* display last 20 characters */ + size_t const srcFileLength = strlen(srcFileName); + if (srcFileLength>20) srcFileName += srcFileLength-20; /* display last 20 characters only */ - /* Header loading (optional, saves one loop) */ - { size_t const toRead = 9; - if (ress->srcBufferLoaded < toRead) - ress->srcBufferLoaded += fread(((char*)ress->srcBuffer) + ress->srcBufferLoaded, 1, toRead - ress->srcBufferLoaded, finput); - } + ZSTD_resetDStream(ress->dctx); + + /* Header loading : ensures ZSTD_getFrameHeader() will succeed */ + { size_t const toDecode = ZSTD_FRAMEHEADERSIZE_MAX; + if (ress->srcBufferLoaded < toDecode) { + size_t const toRead = toDecode - ress->srcBufferLoaded; + void* const startPosition = (char*)ress->srcBuffer + ress->srcBufferLoaded; + ress->srcBufferLoaded += fread(startPosition, 1, toRead, finput); + } } /* Main decompression Loop */ while (1) { @@ -1163,6 +1265,7 @@ unsigned long long FIO_decompressZstdFrame(dRess_t* ress, if (ZSTD_isError(readSizeHint)) { DISPLAYLEVEL(1, "%s : Decoding error (36) : %s \n", srcFileName, ZSTD_getErrorName(readSizeHint)); + FIO_zstdErrorHelp(ress, readSizeHint, srcFileName); return FIO_ERROR_FRAME_DECODING; } @@ -1185,14 +1288,17 @@ unsigned long long FIO_decompressZstdFrame(dRess_t* ress, } /* Fill input buffer */ - { size_t const toRead = MIN(readSizeHint, ress->srcBufferSize); /* support large skippable frames */ - if (ress->srcBufferLoaded < toRead) - ress->srcBufferLoaded += fread((char*)ress->srcBuffer + ress->srcBufferLoaded, - 1, toRead - ress->srcBufferLoaded, finput); - if (ress->srcBufferLoaded < toRead) { - DISPLAYLEVEL(1, "%s : Read error (39) : premature end \n", - srcFileName); - return FIO_ERROR_FRAME_DECODING; + { size_t const toDecode = MIN(readSizeHint, ress->srcBufferSize); /* support large skippable frames */ + if (ress->srcBufferLoaded < toDecode) { + size_t const toRead = toDecode - ress->srcBufferLoaded; /* > 0 */ + void* const startPosition = (char*)ress->srcBuffer + ress->srcBufferLoaded; + size_t const readSize = fread(startPosition, 1, toRead, finput); + if (readSize==0) { + DISPLAYLEVEL(1, "%s : Read error (39) : premature end \n", + srcFileName); + return FIO_ERROR_FRAME_DECODING; + } + ress->srcBufferLoaded += readSize; } } } FIO_fwriteSparseEnd(ress->dstFile, storedSkips); @@ -1523,11 +1629,11 @@ static int FIO_decompressSrcFile(dRess_t ress, const char* dstFileName, const ch /* Close file */ if (fclose(srcFile)) { - DISPLAYLEVEL(1, "zstd: %s: %s \n", srcFileName, strerror(errno)); /* error should never happen */ + DISPLAYLEVEL(1, "zstd: %s: %s \n", srcFileName, strerror(errno)); /* error should not happen */ return 1; } if ( g_removeSrcFile /* --rm */ - && (result==0) /* decompression successful */ + && (result==0) /* decompression successful */ && strcmp(srcFileName, stdinmark) ) /* not stdin */ { if (remove(srcFileName)) { /* failed to remove src file */ @@ -1553,7 +1659,15 @@ static int FIO_decompressDstFile(dRess_t ress, ress.dstFile = FIO_openDstFile(dstFileName); if (ress.dstFile==0) return 1; - if (strcmp (srcFileName, stdinmark) && UTIL_getFileStat(srcFileName, &statbuf)) + if (UTIL_isRegularFile(dstFileName)) { + g_artefact = dstFileName; + signal(SIGINT, INThandler); + } else { + g_artefact = NULL; + } + + if ( strcmp(srcFileName, stdinmark) + && UTIL_getFileStat(srcFileName, &statbuf) ) stat_result = 1; result = FIO_decompressSrcFile(ress, dstFileName, srcFileName); @@ -1563,11 +1677,18 @@ static int FIO_decompressDstFile(dRess_t ress, } if ( (result != 0) /* operation failure */ - && strcmp(dstFileName, nulmark) /* special case : don't remove() /dev/null (#316) */ - && remove(dstFileName) /* remove artefact */ ) - result=1; /* don't do anything special if remove() fails */ - else if (strcmp (dstFileName, stdoutmark) && stat_result) - UTIL_setFileStat(dstFileName, &statbuf); + && strcmp(dstFileName, nulmark) /* special case : don't remove() /dev/null (#316) */ + && strcmp(dstFileName, stdoutmark) ) /* special case : don't remove() stdout */ + remove(dstFileName); /* remove decompression artefact; note don't do anything special if remove() fails */ + else { /* operation success */ + if ( strcmp(dstFileName, stdoutmark) /* special case : don't chmod stdout */ + && strcmp(dstFileName, nulmark) /* special case : don't chmod /dev/null */ + && stat_result ) /* file permissions correctly extracted from src */ + UTIL_setFileStat(dstFileName, &statbuf); /* transfer file permissions from src into dst */ + } + + signal(SIGINT, SIG_DFL); + return result; } @@ -1659,12 +1780,14 @@ int FIO_decompressMultipleFilenames(const char** srcNamesTable, unsigned nbFiles ***************************************************************************/ typedef struct { + U64 decompressedSize; + U64 compressedSize; + U64 windowSize; int numActualFrames; int numSkippableFrames; - unsigned long long decompressedSize; int decompUnavailable; - unsigned long long compressedSize; int usesCheck; + U32 nbFiles; } fileInfo_t; /** getFileInfo() : @@ -1681,14 +1804,16 @@ static int getFileInfo(fileInfo_t* info, const char* inFileName){ DISPLAY("Error: could not open source file %s\n", inFileName); return 3; } - info->compressedSize = (unsigned long long)UTIL_getFileSize(inFileName); + info->compressedSize = UTIL_getFileSize(inFileName); /* begin analyzing frame */ for ( ; ; ) { BYTE headerBuffer[ZSTD_FRAMEHEADERSIZE_MAX]; size_t const numBytesRead = fread(headerBuffer, 1, sizeof(headerBuffer), srcFile); if (numBytesRead < ZSTD_frameHeaderSize_min) { - if (feof(srcFile) && numBytesRead == 0 && info->compressedSize > 0) { + if ( feof(srcFile) + && (numBytesRead == 0) + && (info->compressedSize > 0) ) { break; } else if (feof(srcFile)) { @@ -1705,12 +1830,19 @@ static int getFileInfo(fileInfo_t* info, const char* inFileName){ { U32 const magicNumber = MEM_readLE32(headerBuffer); /* Zstandard frame */ if (magicNumber == ZSTD_MAGICNUMBER) { + ZSTD_frameHeader header; U64 const frameContentSize = ZSTD_getFrameContentSize(headerBuffer, numBytesRead); if (frameContentSize == ZSTD_CONTENTSIZE_ERROR || frameContentSize == ZSTD_CONTENTSIZE_UNKNOWN) { info->decompUnavailable = 1; } else { info->decompressedSize += frameContentSize; } + if (ZSTD_getFrameHeader(&header, headerBuffer, numBytesRead) != 0) { + DISPLAY("Error: could not decode frame header\n"); + detectError = 1; + break; + } + info->windowSize = header.windowSize; /* move to the end of the frame header */ { size_t const headerSize = ZSTD_frameHeaderSize(headerBuffer, numBytesRead); if (ZSTD_isError(headerSize)) { @@ -1790,37 +1922,45 @@ static int getFileInfo(fileInfo_t* info, const char* inFileName){ } } /* end analyzing frame */ fclose(srcFile); + info->nbFiles = 1; return detectError; } static void displayInfo(const char* inFileName, fileInfo_t* info, int displayLevel){ unsigned const unit = info->compressedSize < (1 MB) ? (1 KB) : (1 MB); const char* const unitStr = info->compressedSize < (1 MB) ? "KB" : "MB"; + double const windowSizeUnit = (double)info->windowSize / unit; double const compressedSizeUnit = (double)info->compressedSize / unit; double const decompressedSizeUnit = (double)info->decompressedSize / unit; double const ratio = (info->compressedSize == 0) ? 0 : ((double)info->decompressedSize)/info->compressedSize; const char* const checkString = (info->usesCheck ? "XXH64" : "None"); if (displayLevel <= 2) { if (!info->decompUnavailable) { - DISPLAYOUT("Skippable Non-Skippable Compressed Uncompressed Ratio Check Filename\n"); - DISPLAYOUT("%9d %13d %7.2f %2s %9.2f %2s %5.3f %5s %s\n", - info->numSkippableFrames, info->numActualFrames, + DISPLAYOUT("%6d %5d %7.2f %2s %9.2f %2s %5.3f %5s %s\n", + info->numSkippableFrames + info->numActualFrames, + info->numSkippableFrames, compressedSizeUnit, unitStr, decompressedSizeUnit, unitStr, ratio, checkString, inFileName); } else { - DISPLAYOUT("Skippable Non-Skippable Compressed Check Filename\n"); - DISPLAYOUT("%9d %13d %7.2f MB %5s %s\n", - info->numSkippableFrames, info->numActualFrames, - compressedSizeUnit, checkString, inFileName); + DISPLAYOUT("%6d %5d %7.2f %2s %5s %s\n", + info->numSkippableFrames + info->numActualFrames, + info->numSkippableFrames, + compressedSizeUnit, unitStr, + checkString, inFileName); } } else { DISPLAYOUT("# Zstandard Frames: %d\n", info->numActualFrames); DISPLAYOUT("# Skippable Frames: %d\n", info->numSkippableFrames); + DISPLAYOUT("Window Size: %.2f %2s (%llu B)\n", + windowSizeUnit, unitStr, + (unsigned long long)info->windowSize); DISPLAYOUT("Compressed Size: %.2f %2s (%llu B)\n", - compressedSizeUnit, unitStr, info->compressedSize); + compressedSizeUnit, unitStr, + (unsigned long long)info->compressedSize); if (!info->decompUnavailable) { DISPLAYOUT("Decompressed Size: %.2f %2s (%llu B)\n", - decompressedSizeUnit, unitStr, info->decompressedSize); + decompressedSizeUnit, unitStr, + (unsigned long long)info->decompressedSize); DISPLAYOUT("Ratio: %.4f\n", ratio); } DISPLAYOUT("Check: %s\n", checkString); @@ -1828,33 +1968,40 @@ static void displayInfo(const char* inFileName, fileInfo_t* info, int displayLev } } +static fileInfo_t FIO_addFInfo(fileInfo_t fi1, fileInfo_t fi2) +{ + fileInfo_t total; + total.numActualFrames = fi1.numActualFrames + fi2.numActualFrames; + total.numSkippableFrames = fi1.numSkippableFrames + fi2.numSkippableFrames; + total.compressedSize = fi1.compressedSize + fi2.compressedSize; + total.decompressedSize = fi1.decompressedSize + fi2.decompressedSize; + total.decompUnavailable = fi1.decompUnavailable | fi2.decompUnavailable; + total.usesCheck = fi1.usesCheck & fi2.usesCheck; + total.nbFiles = fi1.nbFiles + fi2.nbFiles; + return total; +} -static int FIO_listFile(const char* inFileName, int displayLevel, unsigned fileNo, unsigned numFiles){ +static int FIO_listFile(fileInfo_t* total, const char* inFileName, int displayLevel){ /* initialize info to avoid warnings */ fileInfo_t info; memset(&info, 0, sizeof(info)); - DISPLAYOUT("%s (%u/%u):\n", inFileName, fileNo, numFiles); - { - int const error = getFileInfo(&info, inFileName); + { int const error = getFileInfo(&info, inFileName); if (error == 1) { /* display error, but provide output */ - DISPLAY("An error occurred with getting file info\n"); + DISPLAY("An error occurred while getting file info \n"); } else if (error == 2) { - DISPLAYOUT("File %s not compressed with zstd\n", inFileName); - if (displayLevel > 2) { - DISPLAYOUT("\n"); - } + DISPLAYOUT("File %s not compressed by zstd \n", inFileName); + if (displayLevel > 2) DISPLAYOUT("\n"); return 1; } else if (error == 3) { - /* error occurred with opening the file */ - if (displayLevel > 2) { - DISPLAYOUT("\n"); - } + /* error occurred while opening the file */ + if (displayLevel > 2) DISPLAYOUT("\n"); return 1; } displayInfo(inFileName, &info, displayLevel); + *total = FIO_addFInfo(*total, info); return error; } } @@ -1864,15 +2011,38 @@ int FIO_listMultipleFiles(unsigned numFiles, const char** filenameTable, int dis DISPLAYOUT("No files given\n"); return 0; } - DISPLAYOUT("===========================================\n"); - DISPLAYOUT("Printing information about compressed files\n"); - DISPLAYOUT("===========================================\n"); - DISPLAYOUT("Number of files listed: %u\n", numFiles); - { - int error = 0; + if (displayLevel <= 2) { + DISPLAYOUT("Frames Skips Compressed Uncompressed Ratio Check Filename\n"); + } + { int error = 0; unsigned u; + fileInfo_t total; + memset(&total, 0, sizeof(total)); + total.usesCheck = 1; for (u=0; u 1 && displayLevel <= 2) { + unsigned const unit = total.compressedSize < (1 MB) ? (1 KB) : (1 MB); + const char* const unitStr = total.compressedSize < (1 MB) ? "KB" : "MB"; + double const compressedSizeUnit = (double)total.compressedSize / unit; + double const decompressedSizeUnit = (double)total.decompressedSize / unit; + double const ratio = (total.compressedSize == 0) ? 0 : ((double)total.decompressedSize)/total.compressedSize; + const char* const checkString = (total.usesCheck ? "XXH64" : ""); + DISPLAYOUT("----------------------------------------------------------------- \n"); + if (total.decompUnavailable) { + DISPLAYOUT("%6d %5d %7.2f %2s %5s %u files\n", + total.numSkippableFrames + total.numActualFrames, + total.numSkippableFrames, + compressedSizeUnit, unitStr, + checkString, total.nbFiles); + } else { + DISPLAYOUT("%6d %5d %7.2f %2s %9.2f %2s %5.3f %5s %u files\n", + total.numSkippableFrames + total.numActualFrames, + total.numSkippableFrames, + compressedSizeUnit, unitStr, decompressedSizeUnit, unitStr, + ratio, checkString, total.nbFiles); + } } return error; } diff --git a/contrib/zstd/programs/fileio.h b/sys/contrib/zstd/programs/fileio.h similarity index 91% rename from contrib/zstd/programs/fileio.h rename to sys/contrib/zstd/programs/fileio.h index 8008e97dd5f3..aa4484fdce0c 100644 --- a/contrib/zstd/programs/fileio.h +++ b/sys/contrib/zstd/programs/fileio.h @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ @@ -56,6 +57,11 @@ void FIO_setMemLimit(unsigned memLimit); void FIO_setNbThreads(unsigned nbThreads); void FIO_setBlockSize(unsigned blockSize); void FIO_setOverlapLog(unsigned overlapLog); +void FIO_setLdmFlag(unsigned ldmFlag); +void FIO_setLdmHashLog(unsigned ldmHashLog); +void FIO_setLdmMinMatch(unsigned ldmMinMatch); +void FIO_setLdmBucketSizeLog(unsigned ldmBucketSizeLog); +void FIO_setLdmHashEveryLog(unsigned ldmHashEveryLog); /*-************************************* diff --git a/contrib/zstd/programs/platform.h b/sys/contrib/zstd/programs/platform.h similarity index 97% rename from contrib/zstd/programs/platform.h rename to sys/contrib/zstd/programs/platform.h index fb2e9b173d2a..a4d7850fd714 100644 --- a/contrib/zstd/programs/platform.h +++ b/sys/contrib/zstd/programs/platform.h @@ -1,10 +1,11 @@ /* - * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * Copyright (c) 2016-present, Przemyslaw Skibinski, Yann Collet, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ #ifndef PLATFORM_H_MODULE diff --git a/contrib/zstd/programs/util.h b/sys/contrib/zstd/programs/util.h similarity index 81% rename from contrib/zstd/programs/util.h rename to sys/contrib/zstd/programs/util.h index 7b553661cde3..c8be5f5fb574 100644 --- a/contrib/zstd/programs/util.h +++ b/sys/contrib/zstd/programs/util.h @@ -1,10 +1,11 @@ /* - * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * Copyright (c) 2016-present, Przemyslaw Skibinski, Yann Collet, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ #ifndef UTIL_H_MODULE @@ -105,58 +106,128 @@ extern "C" { #endif +/*-**************************************** +* Console log +******************************************/ +static int g_utilDisplayLevel; +#define UTIL_DISPLAY(...) fprintf(stderr, __VA_ARGS__) +#define UTIL_DISPLAYLEVEL(l, ...) { if (g_utilDisplayLevel>=l) { UTIL_DISPLAY(__VA_ARGS__); } } + + /*-**************************************** * Time functions ******************************************/ #if defined(_WIN32) /* Windows */ - typedef LARGE_INTEGER UTIL_freq_t; - typedef LARGE_INTEGER UTIL_time_t; - UTIL_STATIC void UTIL_initTimer(UTIL_freq_t* ticksPerSecond) { if (!QueryPerformanceFrequency(ticksPerSecond)) fprintf(stderr, "ERROR: QueryPerformance not present\n"); } - UTIL_STATIC void UTIL_getTime(UTIL_time_t* x) { QueryPerformanceCounter(x); } - UTIL_STATIC U64 UTIL_getSpanTimeMicro(UTIL_freq_t ticksPerSecond, UTIL_time_t clockStart, UTIL_time_t clockEnd) { return 1000000ULL*(clockEnd.QuadPart - clockStart.QuadPart)/ticksPerSecond.QuadPart; } - UTIL_STATIC U64 UTIL_getSpanTimeNano(UTIL_freq_t ticksPerSecond, UTIL_time_t clockStart, UTIL_time_t clockEnd) { return 1000000000ULL*(clockEnd.QuadPart - clockStart.QuadPart)/ticksPerSecond.QuadPart; } + typedef LARGE_INTEGER UTIL_time_t; + UTIL_STATIC UTIL_time_t UTIL_getTime(void) { UTIL_time_t x; QueryPerformanceCounter(&x); return x; } + UTIL_STATIC U64 UTIL_getSpanTimeMicro(UTIL_time_t clockStart, UTIL_time_t clockEnd) + { + static LARGE_INTEGER ticksPerSecond; + static int init = 0; + if (!init) { + if (!QueryPerformanceFrequency(&ticksPerSecond)) + UTIL_DISPLAYLEVEL(1, "ERROR: QueryPerformanceFrequency() failure\n"); + init = 1; + } + return 1000000ULL*(clockEnd.QuadPart - clockStart.QuadPart)/ticksPerSecond.QuadPart; + } + UTIL_STATIC U64 UTIL_getSpanTimeNano(UTIL_time_t clockStart, UTIL_time_t clockEnd) + { + static LARGE_INTEGER ticksPerSecond; + static int init = 0; + if (!init) { + if (!QueryPerformanceFrequency(&ticksPerSecond)) + UTIL_DISPLAYLEVEL(1, "ERROR: QueryPerformanceFrequency() failure\n"); + init = 1; + } + return 1000000000ULL*(clockEnd.QuadPart - clockStart.QuadPart)/ticksPerSecond.QuadPart; + } #elif defined(__APPLE__) && defined(__MACH__) - #include - typedef mach_timebase_info_data_t UTIL_freq_t; - typedef U64 UTIL_time_t; - UTIL_STATIC void UTIL_initTimer(UTIL_freq_t* rate) { mach_timebase_info(rate); } - UTIL_STATIC void UTIL_getTime(UTIL_time_t* x) { *x = mach_absolute_time(); } - UTIL_STATIC U64 UTIL_getSpanTimeMicro(UTIL_freq_t rate, UTIL_time_t clockStart, UTIL_time_t clockEnd) { return (((clockEnd - clockStart) * (U64)rate.numer) / ((U64)rate.denom))/1000ULL; } - UTIL_STATIC U64 UTIL_getSpanTimeNano(UTIL_freq_t rate, UTIL_time_t clockStart, UTIL_time_t clockEnd) { return ((clockEnd - clockStart) * (U64)rate.numer) / ((U64)rate.denom); } + #include + typedef U64 UTIL_time_t; + UTIL_STATIC UTIL_time_t UTIL_getTime(void) { return mach_absolute_time(); } + UTIL_STATIC U64 UTIL_getSpanTimeMicro(UTIL_time_t clockStart, UTIL_time_t clockEnd) + { + static mach_timebase_info_data_t rate; + static int init = 0; + if (!init) { + mach_timebase_info(&rate); + init = 1; + } + return (((clockEnd - clockStart) * (U64)rate.numer) / ((U64)rate.denom))/1000ULL; + } + UTIL_STATIC U64 UTIL_getSpanTimeNano(UTIL_time_t clockStart, UTIL_time_t clockEnd) + { + static mach_timebase_info_data_t rate; + static int init = 0; + if (!init) { + mach_timebase_info(&rate); + init = 1; + } + return ((clockEnd - clockStart) * (U64)rate.numer) / ((U64)rate.denom); + } #elif (PLATFORM_POSIX_VERSION >= 200112L) - #include /* times */ - typedef U64 UTIL_freq_t; - typedef U64 UTIL_time_t; - UTIL_STATIC void UTIL_initTimer(UTIL_freq_t* ticksPerSecond) { *ticksPerSecond=sysconf(_SC_CLK_TCK); } - UTIL_STATIC void UTIL_getTime(UTIL_time_t* x) { struct tms junk; clock_t newTicks = (clock_t) times(&junk); (void)junk; *x = (UTIL_time_t)newTicks; } - UTIL_STATIC U64 UTIL_getSpanTimeMicro(UTIL_freq_t ticksPerSecond, UTIL_time_t clockStart, UTIL_time_t clockEnd) { return 1000000ULL * (clockEnd - clockStart) / ticksPerSecond; } - UTIL_STATIC U64 UTIL_getSpanTimeNano(UTIL_freq_t ticksPerSecond, UTIL_time_t clockStart, UTIL_time_t clockEnd) { return 1000000000ULL * (clockEnd - clockStart) / ticksPerSecond; } + #include + typedef struct timespec UTIL_freq_t; + typedef struct timespec UTIL_time_t; + UTIL_STATIC UTIL_time_t UTIL_getTime(void) + { + UTIL_time_t time; + if (clock_gettime(CLOCK_MONOTONIC, &time)) + UTIL_DISPLAYLEVEL(1, "ERROR: Failed to get time\n"); /* we could also exit() */ + return time; + } + UTIL_STATIC UTIL_time_t UTIL_getSpanTime(UTIL_time_t begin, UTIL_time_t end) + { + UTIL_time_t diff; + if (end.tv_nsec < begin.tv_nsec) { + diff.tv_sec = (end.tv_sec - 1) - begin.tv_sec; + diff.tv_nsec = (end.tv_nsec + 1000000000ULL) - begin.tv_nsec; + } else { + diff.tv_sec = end.tv_sec - begin.tv_sec; + diff.tv_nsec = end.tv_nsec - begin.tv_nsec; + } + return diff; + } + UTIL_STATIC U64 UTIL_getSpanTimeMicro(UTIL_time_t begin, UTIL_time_t end) + { + UTIL_time_t const diff = UTIL_getSpanTime(begin, end); + U64 micro = 0; + micro += 1000000ULL * diff.tv_sec; + micro += diff.tv_nsec / 1000ULL; + return micro; + } + UTIL_STATIC U64 UTIL_getSpanTimeNano(UTIL_time_t begin, UTIL_time_t end) + { + UTIL_time_t const diff = UTIL_getSpanTime(begin, end); + U64 nano = 0; + nano += 1000000000ULL * diff.tv_sec; + nano += diff.tv_nsec; + return nano; + } #else /* relies on standard C (note : clock_t measurements can be wrong when using multi-threading) */ - typedef clock_t UTIL_freq_t; - typedef clock_t UTIL_time_t; - UTIL_STATIC void UTIL_initTimer(UTIL_freq_t* ticksPerSecond) { *ticksPerSecond=0; } - UTIL_STATIC void UTIL_getTime(UTIL_time_t* x) { *x = clock(); } - UTIL_STATIC U64 UTIL_getSpanTimeMicro(UTIL_freq_t ticksPerSecond, UTIL_time_t clockStart, UTIL_time_t clockEnd) { (void)ticksPerSecond; return 1000000ULL * (clockEnd - clockStart) / CLOCKS_PER_SEC; } - UTIL_STATIC U64 UTIL_getSpanTimeNano(UTIL_freq_t ticksPerSecond, UTIL_time_t clockStart, UTIL_time_t clockEnd) { (void)ticksPerSecond; return 1000000000ULL * (clockEnd - clockStart) / CLOCKS_PER_SEC; } + typedef clock_t UTIL_time_t; + UTIL_STATIC UTIL_time_t UTIL_getTime(void) { return clock(); } + UTIL_STATIC U64 UTIL_getSpanTimeMicro(UTIL_time_t clockStart, UTIL_time_t clockEnd) { return 1000000ULL * (clockEnd - clockStart) / CLOCKS_PER_SEC; } + UTIL_STATIC U64 UTIL_getSpanTimeNano(UTIL_time_t clockStart, UTIL_time_t clockEnd) { return 1000000000ULL * (clockEnd - clockStart) / CLOCKS_PER_SEC; } #endif /* returns time span in microseconds */ -UTIL_STATIC U64 UTIL_clockSpanMicro( UTIL_time_t clockStart, UTIL_freq_t ticksPerSecond ) +UTIL_STATIC U64 UTIL_clockSpanMicro( UTIL_time_t clockStart ) { - UTIL_time_t clockEnd; - UTIL_getTime(&clockEnd); - return UTIL_getSpanTimeMicro(ticksPerSecond, clockStart, clockEnd); + UTIL_time_t const clockEnd = UTIL_getTime(); + return UTIL_getSpanTimeMicro(clockStart, clockEnd); } -UTIL_STATIC void UTIL_waitForNextTick(UTIL_freq_t ticksPerSecond) +UTIL_STATIC void UTIL_waitForNextTick(void) { - UTIL_time_t clockStart, clockEnd; - UTIL_getTime(&clockStart); + UTIL_time_t const clockStart = UTIL_getTime(); + UTIL_time_t clockEnd; do { - UTIL_getTime(&clockEnd); - } while (UTIL_getSpanTimeNano(ticksPerSecond, clockStart, clockEnd) == 0); + clockEnd = UTIL_getTime(); + } while (UTIL_getSpanTimeNano(clockStart, clockEnd) == 0); } @@ -284,10 +355,6 @@ UTIL_STATIC void *UTIL_realloc(void *ptr, size_t size) return NULL; } -static int g_utilDisplayLevel; -#define UTIL_DISPLAY(...) fprintf(stderr, __VA_ARGS__) -#define UTIL_DISPLAYLEVEL(l, ...) { if (g_utilDisplayLevel>=l) { UTIL_DISPLAY(__VA_ARGS__); } } - #ifdef _WIN32 # define UTIL_HAS_CREATEFILELIST @@ -309,7 +376,7 @@ UTIL_STATIC int UTIL_prepareFileList(const char *dirName, char** bufStart, size_ hFile=FindFirstFileA(path, &cFile); if (hFile == INVALID_HANDLE_VALUE) { - fprintf(stderr, "Cannot open directory '%s'\n", dirName); + UTIL_DISPLAYLEVEL(1, "Cannot open directory '%s'\n", dirName); return 0; } free(path); @@ -363,7 +430,7 @@ UTIL_STATIC int UTIL_prepareFileList(const char *dirName, char** bufStart, size_ int dirLength, fnameLength, pathLength, nbFiles = 0; if (!(dir = opendir(dirName))) { - fprintf(stderr, "Cannot open directory '%s': %s\n", dirName, strerror(errno)); + UTIL_DISPLAYLEVEL(1, "Cannot open directory '%s': %s\n", dirName, strerror(errno)); return 0; } @@ -408,7 +475,7 @@ UTIL_STATIC int UTIL_prepareFileList(const char *dirName, char** bufStart, size_ } if (errno != 0) { - fprintf(stderr, "readdir(%s) error: %s\n", dirName, strerror(errno)); + UTIL_DISPLAYLEVEL(1, "readdir(%s) error: %s\n", dirName, strerror(errno)); free(*bufStart); *bufStart = NULL; } @@ -421,7 +488,7 @@ UTIL_STATIC int UTIL_prepareFileList(const char *dirName, char** bufStart, size_ UTIL_STATIC int UTIL_prepareFileList(const char *dirName, char** bufStart, size_t* pos, char** bufEnd, int followLinks) { (void)bufStart; (void)bufEnd; (void)pos; - fprintf(stderr, "Directory %s ignored (compiled without _WIN32 or _POSIX_C_SOURCE)\n", dirName); + UTIL_DISPLAYLEVEL(1, "Directory %s ignored (compiled without _WIN32 or _POSIX_C_SOURCE)\n", dirName); return 0; } diff --git a/contrib/zstd/programs/zstd.1 b/sys/contrib/zstd/programs/zstd.1 similarity index 82% rename from contrib/zstd/programs/zstd.1 rename to sys/contrib/zstd/programs/zstd.1 index 5a91eea281f4..8187c7403509 100644 --- a/contrib/zstd/programs/zstd.1 +++ b/sys/contrib/zstd/programs/zstd.1 @@ -1,5 +1,5 @@ . -.TH "ZSTD" "1" "August 2017" "zstd 1.3.1" "User Commands" +.TH "ZSTD" "1" "September 2017" "zstd 1.3.1" "User Commands" . .SH "NAME" \fBzstd\fR \- zstd, zstdmt, unzstd, zstdcat \- Compress or decompress \.zst files @@ -60,11 +60,11 @@ In most places where an integer argument is expected, an optional suffix is supp . .TP \fBKiB\fR -Multiply the integer by 1,024 (2^10)\. \fBKi\fR, \fBK\fR, and \fBKB\fR are accepted as synonyms for \fBKiB\fR\. +Multiply the integer by 1,024 (2\e \fBKi\fR, \fBK\fR, and \fBKB\fR are accepted as synonyms for \fBKiB\fR\. . .TP \fBMiB\fR -Multiply the integer by 1,048,576 (2^20)\. \fBMi\fR, \fBM\fR, and \fBMB\fR are accepted as synonyms for \fBMiB\fR\. +Multiply the integer by 1,048,576 (2\e \fBMi\fR, \fBM\fR, and \fBMB\fR are accepted as synonyms for \fBMiB\fR\. . .SS "Operation mode" If multiple operation mode options are given, the last one takes effect\. @@ -104,6 +104,13 @@ Display information related to a zstd compressed file, such as size, ratio, and unlocks high compression levels 20+ (maximum 22), using a lot more memory\. Note that decompression will also require more memory when using these levels\. . .TP +\fB\-\-long[=#]\fR +enables long distance matching with \fB#\fR \fBwindowLog\fR, if not \fB#\fR is not present it defaults to \fB27\fR\. This increases the window size (\fBwindowLog\fR) and memory usage for both the compressor and decompressor\. This setting is designed to improve the compression ratio for files with long matches at a large distance\. +. +.IP +Note: If \fBwindowLog\fR is set to larger than 27, \fB\-\-long=windowLog\fR or \fB\-\-memory=windowSize\fR needs to be passed to the decompressor\. +. +.TP \fB\-T#\fR, \fB\-\-threads=#\fR Compress using \fB#\fR threads (default: 1)\. If \fB#\fR is 0, attempt to detect and use the number of physical CPU cores\. In all cases, the nb of threads is capped to ZSTDMT_NBTHREADS_MAX==256\. This modifier does nothing if \fBzstd\fR is compiled without multithread support\. . @@ -144,6 +151,10 @@ keep source file(s) after successful compression or decompression\. This is the operate recursively on dictionaries . .TP +\fB\-\-format=FORMAT\fR +compress and decompress in other formats\. If compiled with support, zstd can compress to or decompress from other compression algorithm formats\. Possibly available options are \fBgzip\fR, \fBxz\fR, \fBlzma\fR, and \fBlz4\fR\. +. +.TP \fB\-h\fR/\fB\-H\fR, \fB\-\-help\fR display help/long help and exit . @@ -186,6 +197,10 @@ Dictionary saved into \fBfile\fR (default name: dictionary)\. Limit dictionary to specified size (default: 112640)\. . .TP +\fB\-B#\fR +Split input files in blocks of size # (default: no split) +. +.TP \fB\-\-dictID=#\fR A dictionary ID is a locally unique ID that a decoder can use to verify it is using the right dictionary\. By default, zstd will create a 4\-bytes random number ID\. It\'s possible to give a precise number instead\. Short numbers have an advantage : an ID < 256 will only need 1 byte in the compressed frame header, and an ID < 65536 will only need 2 bytes\. This compares favorably to 4 bytes default\. However, it\'s up to the dictionary manager to not assign twice the same ID to 2 different dictionaries\. . @@ -263,7 +278,10 @@ There are 8 strategies numbered from 1 to 8, from faster to stronger: 1=ZSTD_fas Specify the maximum number of bits for a match distance\. . .IP -The higher number of increases the chance to find a match which usually improves compression ratio\. It also increases memory requirements for the compressor and decompressor\. The minimum \fIwlog\fR is 10 (1 KiB) and the maximum is 27 (128 MiB)\. +The higher number of increases the chance to find a match which usually improves compression ratio\. It also increases memory requirements for the compressor and decompressor\. The minimum \fIwlog\fR is 10 (1 KiB) and the maximum is 30 (1 GiB) on 32\-bit platforms and 31 (2 GiB) on 64\-bit platforms\. +. +.IP +Note: If \fBwindowLog\fR is set to larger than 27, \fB\-\-long=windowLog\fR or \fB\-\-memory=windowSize\fR needs to be passed to the decompressor\. . .TP \fBhashLog\fR=\fIhlog\fR, \fBhlog\fR=\fIhlog\fR @@ -322,6 +340,58 @@ Determine \fBoverlapSize\fR, amount of data reloaded from previous job\. This pa .IP The minimum \fIovlog\fR is 0, and the maximum is 9\. 0 means "no overlap", hence completely independent jobs\. 9 means "full overlap", meaning up to \fBwindowSize\fR is reloaded from previous job\. Reducing \fIovlog\fR by 1 reduces the amount of reload by a factor 2\. Default \fIovlog\fR is 6, which means "reload \fBwindowSize / 8\fR"\. Exception : the maximum compression level (22) has a default \fIovlog\fR of 9\. . +.TP +\fBldmHashLog\fR=\fIldmhlog\fR, \fBldmhlog\fR=\fIldmhlog\fR +Specify the maximum size for a hash table used for long distance matching\. +. +.IP +This option is ignored unless long distance matching is enabled\. +. +.IP +Bigger hash tables usually improve compression ratio at the expense of more memory during compression and a decrease in compression speed\. +. +.IP +The minimum \fIldmhlog\fR is 6 and the maximum is 26 (default: 20)\. +. +.TP +\fBldmSearchLength\fR=\fIldmslen\fR, \fBldmslen\fR=\fIldmslen\fR +Specify the minimum searched length of a match for long distance matching\. +. +.IP +This option is ignored unless long distance matching is enabled\. +. +.IP +Larger/very small values usually decrease compression ratio\. +. +.IP +The minumum \fIldmslen\fR is 4 and the maximum is 4096 (default: 64)\. +. +.TP +\fBldmBucketSizeLog\fR=\fIldmblog\fR, \fBldmblog\fR=\fIldmblog\fR +Specify the size of each bucket for the hash table used for long distance matching\. +. +.IP +This option is ignored unless long distance matching is enabled\. +. +.IP +Larger bucket sizes improve collision resolution but decrease compression speed\. +. +.IP +The minimum \fIldmblog\fR is 0 and the maximum is 8 (default: 3)\. +. +.TP +\fBldmHashEveryLog\fR=\fIldmhevery\fR, \fBldmhevery\fR=\fIldmhevery\fR +Specify the frequency of inserting entries into the long distance matching hash table\. +. +.IP +This option is ignored unless long distance matching is enabled\. +. +.IP +Larger values will improve compression speed\. Deviating far from the default value will likely result in a decrease in compression ratio\. +. +.IP +The default value is \fBwlog \- ldmhlog\fR\. +. .SS "\-B#:" Select the size of each compression job\. This parameter is available only when multi\-threading is enabled\. Default value is \fB4 * windowSize\fR, which means it varies depending on compression level\. \fB\-B#\fR makes it possible to select a custom value\. Note that job size must respect a minimum value which is enforced transparently\. This minimum is either 1 MB, or \fBoverlapSize\fR, whichever is largest\. . diff --git a/contrib/zstd/programs/zstd.1.md b/sys/contrib/zstd/programs/zstd.1.md similarity index 84% rename from contrib/zstd/programs/zstd.1.md rename to sys/contrib/zstd/programs/zstd.1.md index 4310afa1aaf8..eea68548982e 100644 --- a/contrib/zstd/programs/zstd.1.md +++ b/sys/contrib/zstd/programs/zstd.1.md @@ -105,6 +105,16 @@ the last one takes effect. * `--ultra`: unlocks high compression levels 20+ (maximum 22), using a lot more memory. Note that decompression will also require more memory when using these levels. +* `--long[=#]`: + enables long distance matching with `#` `windowLog`, if not `#` is not + present it defaults to `27`. + This increases the window size (`windowLog`) and memory usage for both the + compressor and decompressor. + This setting is designed to improve the compression ratio for files with + long matches at a large distance. + + Note: If `windowLog` is set to larger than 27, `--long=windowLog` or + `--memory=windowSize` needs to be passed to the decompressor. * `-T#`, `--threads=#`: Compress using `#` threads (default: 1). If `#` is 0, attempt to detect and use the number of physical CPU cores. @@ -137,6 +147,10 @@ the last one takes effect. This is the default behavior. * `-r`: operate recursively on dictionaries +* `--format=FORMAT`: + compress and decompress in other formats. If compiled with + support, zstd can compress to or decompress from other compression algorithm + formats. Possibly available options are `gzip`, `xz`, `lzma`, and `lz4`. * `-h`/`-H`, `--help`: display help/long help and exit * `-V`, `--version`: @@ -178,6 +192,8 @@ Typical gains range from 10% (at 64KB) to x5 better (at <1KB). Dictionary saved into `file` (default name: dictionary). * `--maxdict=#`: Limit dictionary to specified size (default: 112640). +* `-B#`: + Split input files in blocks of size # (default: no split) * `--dictID=#`: A dictionary ID is a locally unique ID that a decoder can use to verify it is using the right dictionary. @@ -267,7 +283,11 @@ The list of available _options_: The higher number of increases the chance to find a match which usually improves compression ratio. It also increases memory requirements for the compressor and decompressor. - The minimum _wlog_ is 10 (1 KiB) and the maximum is 27 (128 MiB). + The minimum _wlog_ is 10 (1 KiB) and the maximum is 30 (1 GiB) on 32-bit + platforms and 31 (2 GiB) on 64-bit platforms. + + Note: If `windowLog` is set to larger than 27, `--long=windowLog` or + `--memory=windowSize` needs to be passed to the decompressor. - `hashLog`=_hlog_, `hlog`=_hlog_: Specify the maximum number of bits for a hash table. @@ -327,6 +347,47 @@ The list of available _options_: Default _ovlog_ is 6, which means "reload `windowSize / 8`". Exception : the maximum compression level (22) has a default _ovlog_ of 9. +- `ldmHashLog`=_ldmhlog_, `ldmhlog`=_ldmhlog_: + Specify the maximum size for a hash table used for long distance matching. + + This option is ignored unless long distance matching is enabled. + + Bigger hash tables usually improve compression ratio at the expense of more + memory during compression and a decrease in compression speed. + + The minimum _ldmhlog_ is 6 and the maximum is 26 (default: 20). + +- `ldmSearchLength`=_ldmslen_, `ldmslen`=_ldmslen_: + Specify the minimum searched length of a match for long distance matching. + + This option is ignored unless long distance matching is enabled. + + Larger/very small values usually decrease compression ratio. + + The minumum _ldmslen_ is 4 and the maximum is 4096 (default: 64). + +- `ldmBucketSizeLog`=_ldmblog_, `ldmblog`=_ldmblog_: + Specify the size of each bucket for the hash table used for long distance + matching. + + This option is ignored unless long distance matching is enabled. + + Larger bucket sizes improve collision resolution but decrease compression + speed. + + The minimum _ldmblog_ is 0 and the maximum is 8 (default: 3). + +- `ldmHashEveryLog`=_ldmhevery_, `ldmhevery`=_ldmhevery_: + Specify the frequency of inserting entries into the long distance matching + hash table. + + This option is ignored unless long distance matching is enabled. + + Larger values will improve compression speed. Deviating far from the + default value will likely result in a decrease in compression ratio. + + The default value is `wlog - ldmhlog`. + ### -B#: Select the size of each compression job. This parameter is available only when multi-threading is enabled. diff --git a/contrib/zstd/programs/zstdcli.c b/sys/contrib/zstd/programs/zstdcli.c similarity index 90% rename from contrib/zstd/programs/zstdcli.c rename to sys/contrib/zstd/programs/zstdcli.c index e7eb71db6e37..e76e6d75a4d1 100644 --- a/contrib/zstd/programs/zstdcli.c +++ b/sys/contrib/zstd/programs/zstdcli.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ @@ -60,19 +61,27 @@ #define ZSTD_UNLZMA "unlzma" #define ZSTD_XZ "xz" #define ZSTD_UNXZ "unxz" +#define ZSTD_LZ4 "lz4" +#define ZSTD_UNLZ4 "unlz4" #define KB *(1 <<10) #define MB *(1 <<20) #define GB *(1U<<30) -#define DISPLAY_LEVEL_DEFAULT 2 +#define DISPLAY_LEVEL_DEFAULT 1 static const char* g_defaultDictName = "dictionary"; static const unsigned g_defaultMaxDictSize = 110 KB; static const int g_defaultDictCLevel = 3; static const unsigned g_defaultSelectivityLevel = 9; +static const unsigned g_defaultMaxWindowLog = 27; #define OVERLAP_LOG_DEFAULT 9999 +#define LDM_PARAM_DEFAULT 9999 /* Default for parameters where 0 is valid */ static U32 g_overlapLog = OVERLAP_LOG_DEFAULT; +static U32 g_ldmHashLog = 0; +static U32 g_ldmMinMatch = 0; +static U32 g_ldmHashEveryLog = LDM_PARAM_DEFAULT; +static U32 g_ldmBucketSizeLog = LDM_PARAM_DEFAULT; /*-************************************ @@ -123,6 +132,7 @@ static int usage_advanced(const char* programName) DISPLAY( " -l : print information about zstd compressed files \n"); #ifndef ZSTD_NOCOMPRESS DISPLAY( "--ultra : enable levels beyond %i, up to %i (requires more memory)\n", ZSTDCLI_CLEVEL_MAX, ZSTD_maxCLevel()); + DISPLAY( "--long[=#] : enable long distance matching with given window log (default : %u)\n", g_defaultMaxWindowLog); #ifdef ZSTD_MULTITHREAD DISPLAY( " -T# : use # threads for compression (default:1) \n"); DISPLAY( " -B# : select size of each job (default:0==automatic) \n"); @@ -304,6 +314,10 @@ static unsigned parseCompressionParameters(const char* stringPtr, ZSTD_compressi if (longCommandWArg(&stringPtr, "targetLength=") || longCommandWArg(&stringPtr, "tlen=")) { params->targetLength = readU32FromChar(&stringPtr); if (stringPtr[0]==',') { stringPtr++; continue; } else break; } if (longCommandWArg(&stringPtr, "strategy=") || longCommandWArg(&stringPtr, "strat=")) { params->strategy = (ZSTD_strategy)(readU32FromChar(&stringPtr)); if (stringPtr[0]==',') { stringPtr++; continue; } else break; } if (longCommandWArg(&stringPtr, "overlapLog=") || longCommandWArg(&stringPtr, "ovlog=")) { g_overlapLog = readU32FromChar(&stringPtr); if (stringPtr[0]==',') { stringPtr++; continue; } else break; } + if (longCommandWArg(&stringPtr, "ldmHashLog=") || longCommandWArg(&stringPtr, "ldmhlog=")) { g_ldmHashLog = readU32FromChar(&stringPtr); if (stringPtr[0]==',') { stringPtr++; continue; } else break; } + if (longCommandWArg(&stringPtr, "ldmSearchLength=") || longCommandWArg(&stringPtr, "ldmslen=")) { g_ldmMinMatch = readU32FromChar(&stringPtr); if (stringPtr[0]==',') { stringPtr++; continue; } else break; } + if (longCommandWArg(&stringPtr, "ldmBucketSizeLog=") || longCommandWArg(&stringPtr, "ldmblog=")) { g_ldmBucketSizeLog = readU32FromChar(&stringPtr); if (stringPtr[0]==',') { stringPtr++; continue; } else break; } + if (longCommandWArg(&stringPtr, "ldmHashEveryLog=") || longCommandWArg(&stringPtr, "ldmhevery=")) { g_ldmHashEveryLog = readU32FromChar(&stringPtr); if (stringPtr[0]==',') { stringPtr++; continue; } else break; } return 0; } @@ -362,7 +376,8 @@ int main(int argCount, const char* argv[]) ultra=0, lastCommand = 0, nbThreads = 1, - setRealTimePrio = 0; + setRealTimePrio = 0, + ldmFlag = 0; unsigned bench_nbSeconds = 3; /* would be better if this value was synchronized from bench */ size_t blockSize = 0; zstd_operation_mode operation = zom_compress; @@ -391,10 +406,11 @@ int main(int argCount, const char* argv[]) int cover = 1; #endif + /* init */ (void)recursive; (void)cLevelLast; /* not used when ZSTD_NOBENCH set */ (void)dictCLevel; (void)dictSelect; (void)dictID; (void)maxDictSize; /* not used when ZSTD_NODICT set */ - (void)ultra; (void)cLevel; /* not used when ZSTD_NOCOMPRESS set */ + (void)ultra; (void)cLevel; (void)ldmFlag; /* not used when ZSTD_NOCOMPRESS set */ (void)memLimit; /* not used when ZSTD_NODECOMPRESS set */ if (filenameTable==NULL) { DISPLAY("zstd: %s \n", strerror(errno)); exit(1); } filenameTable[0] = stdinmark; @@ -413,6 +429,8 @@ int main(int argCount, const char* argv[]) if (exeNameMatch(programName, ZSTD_UNLZMA)) { operation=zom_decompress; FIO_setCompressionType(FIO_lzmaCompression); FIO_setRemoveSrcFile(1); } /* behave like unlzma */ if (exeNameMatch(programName, ZSTD_XZ)) { suffix = XZ_EXTENSION; FIO_setCompressionType(FIO_xzCompression); FIO_setRemoveSrcFile(1); } /* behave like xz */ if (exeNameMatch(programName, ZSTD_UNXZ)) { operation=zom_decompress; FIO_setCompressionType(FIO_xzCompression); FIO_setRemoveSrcFile(1); } /* behave like unxz */ + if (exeNameMatch(programName, ZSTD_LZ4)) { suffix = LZ4_EXTENSION; FIO_setCompressionType(FIO_lz4Compression); FIO_setRemoveSrcFile(1); } /* behave like xz */ + if (exeNameMatch(programName, ZSTD_UNLZ4)) { operation=zom_decompress; FIO_setCompressionType(FIO_lz4Compression); FIO_setRemoveSrcFile(1); } /* behave like unxz */ memset(&compressionParams, 0, sizeof(compressionParams)); /* command switches */ @@ -501,6 +519,22 @@ int main(int argCount, const char* argv[]) if (longCommandWArg(&argument, "--maxdict=")) { maxDictSize = readU32FromChar(&argument); continue; } if (longCommandWArg(&argument, "--dictID=")) { dictID = readU32FromChar(&argument); continue; } if (longCommandWArg(&argument, "--zstd=")) { if (!parseCompressionParameters(argument, &compressionParams)) CLEAN_RETURN(badusage(programName)); continue; } + if (longCommandWArg(&argument, "--long")) { + unsigned ldmWindowLog = 0; + ldmFlag = 1; + /* Parse optional window log */ + if (*argument == '=') { + ++argument; + ldmWindowLog = readU32FromChar(&argument); + } else if (*argument != 0) { + /* Invalid character following --long */ + CLEAN_RETURN(badusage(programName)); + } + /* Only set windowLog if not already set by --zstd */ + if (compressionParams.windowLog == 0) + compressionParams.windowLog = ldmWindowLog; + continue; + } /* fall-through, will trigger bad_usage() later on */ } @@ -720,6 +754,15 @@ int main(int argCount, const char* argv[]) BMK_setBlockSize(blockSize); BMK_setNbThreads(nbThreads); BMK_setNbSeconds(bench_nbSeconds); + BMK_setLdmFlag(ldmFlag); + BMK_setLdmMinMatch(g_ldmMinMatch); + BMK_setLdmHashLog(g_ldmHashLog); + if (g_ldmBucketSizeLog != LDM_PARAM_DEFAULT) { + BMK_setLdmBucketSizeLog(g_ldmBucketSizeLog); + } + if (g_ldmHashEveryLog != LDM_PARAM_DEFAULT) { + BMK_setLdmHashEveryLog(g_ldmHashEveryLog); + } BMK_benchFiles(filenameTable, filenameIdx, dictFileName, cLevel, cLevelLast, &compressionParams, setRealTimePrio); #endif (void)bench_nbSeconds; (void)blockSize; (void)setRealTimePrio; @@ -737,13 +780,13 @@ int main(int argCount, const char* argv[]) int const optimize = !coverParams.k || !coverParams.d; coverParams.nbThreads = nbThreads; coverParams.zParams = zParams; - operationResult = DiB_trainFromFiles(outFileName, maxDictSize, filenameTable, filenameIdx, NULL, &coverParams, optimize); + operationResult = DiB_trainFromFiles(outFileName, maxDictSize, filenameTable, filenameIdx, blockSize, NULL, &coverParams, optimize); } else { ZDICT_legacy_params_t dictParams; memset(&dictParams, 0, sizeof(dictParams)); dictParams.selectivityLevel = dictSelect; dictParams.zParams = zParams; - operationResult = DiB_trainFromFiles(outFileName, maxDictSize, filenameTable, filenameIdx, &dictParams, NULL, 0); + operationResult = DiB_trainFromFiles(outFileName, maxDictSize, filenameTable, filenameIdx, blockSize, &dictParams, NULL, 0); } #endif goto _end; @@ -787,6 +830,16 @@ int main(int argCount, const char* argv[]) #ifndef ZSTD_NOCOMPRESS FIO_setNbThreads(nbThreads); FIO_setBlockSize((U32)blockSize); + FIO_setLdmFlag(ldmFlag); + FIO_setLdmHashLog(g_ldmHashLog); + FIO_setLdmMinMatch(g_ldmMinMatch); + if (g_ldmBucketSizeLog != LDM_PARAM_DEFAULT) { + FIO_setLdmBucketSizeLog(g_ldmBucketSizeLog); + } + if (g_ldmHashEveryLog != LDM_PARAM_DEFAULT) { + FIO_setLdmHashEveryLog(g_ldmHashEveryLog); + } + if (g_overlapLog!=OVERLAP_LOG_DEFAULT) FIO_setOverlapLog(g_overlapLog); if ((filenameIdx==1) && outFileName) operationResult = FIO_compressFilename(outFileName, filenameTable[0], dictFileName, cLevel, &compressionParams); @@ -798,6 +851,13 @@ int main(int argCount, const char* argv[]) #endif } else { /* decompression or test */ #ifndef ZSTD_NODECOMPRESS + if (memLimit == 0) { + if (compressionParams.windowLog == 0) + memLimit = (U32)1 << g_defaultMaxWindowLog; + else { + memLimit = (U32)1 << (compressionParams.windowLog & 31); + } + } FIO_setMemLimit(memLimit); if (filenameIdx==1 && outFileName) operationResult = FIO_decompressFilename(outFileName, filenameTable[0], dictFileName); diff --git a/contrib/zstd/programs/zstdgrep b/sys/contrib/zstd/programs/zstdgrep similarity index 100% rename from contrib/zstd/programs/zstdgrep rename to sys/contrib/zstd/programs/zstdgrep diff --git a/contrib/zstd/programs/zstdless b/sys/contrib/zstd/programs/zstdless similarity index 100% rename from contrib/zstd/programs/zstdless rename to sys/contrib/zstd/programs/zstdless diff --git a/contrib/zstd/tests/.gitignore b/sys/contrib/zstd/tests/.gitignore similarity index 97% rename from contrib/zstd/tests/.gitignore rename to sys/contrib/zstd/tests/.gitignore index f408a7491213..b16e26e3d490 100644 --- a/contrib/zstd/tests/.gitignore +++ b/sys/contrib/zstd/tests/.gitignore @@ -21,6 +21,7 @@ symbols legacy decodecorpus pool +poolTests invalidDictionaries # Tmp test directory @@ -48,6 +49,7 @@ grillResults.txt _* tmp* *.zst +*.gz result out diff --git a/contrib/zstd/tests/Makefile b/sys/contrib/zstd/tests/Makefile similarity index 81% rename from contrib/zstd/tests/Makefile rename to sys/contrib/zstd/tests/Makefile index 3be79c159057..651833bbbaae 100644 --- a/contrib/zstd/tests/Makefile +++ b/sys/contrib/zstd/tests/Makefile @@ -1,13 +1,11 @@ -# ########################################################################## -# Copyright (c) 2016-present, Yann Collet, Facebook, Inc. +# ################################################################ +# Copyright (c) 2015-present, Yann Collet, Facebook, Inc. # All rights reserved. # -# This Makefile is validated for Linux, macOS, *BSD, Hurd, Solaris, MSYS2 targets -# -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. An additional grant -# of patent rights can be found in the PATENTS file in the same directory. -# ########################################################################## +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ # datagen : Synthetic and parametrable data generator, for tests # fullbench : Precisely measure speed for each zstd inner functions # fullbench32: Same as fullbench, but forced to compile in 32-bits mode @@ -25,18 +23,18 @@ PRGDIR = ../programs PYTHON ?= python3 TESTARTEFACT := versionsTest namespaceTest -DEBUGLEVEL= 1 -DEBUGFLAGS= -g -DZSTD_DEBUG=$(DEBUGLEVEL) -CPPFLAGS += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \ - -I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR) -CFLAGS ?= -O3 -CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ - -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \ - -Wstrict-prototypes -Wundef -Wformat-security \ - -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \ - -Wredundant-decls -CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS) -FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) +DEBUGLEVEL ?= 1 +DEBUGFLAGS = -g -DZSTD_DEBUG=$(DEBUGLEVEL) +CPPFLAGS += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \ + -I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR) +CFLAGS ?= -O3 +CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ + -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \ + -Wstrict-prototypes -Wundef -Wformat-security \ + -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \ + -Wredundant-decls +CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS) +FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) ZSTDCOMMON_FILES := $(ZSTDDIR)/common/*.c @@ -46,10 +44,6 @@ ZSTD_FILES := $(ZSTDDECOMP_FILES) $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES) ZBUFF_FILES := $(ZSTDDIR)/deprecated/*.c ZDICT_FILES := $(ZSTDDIR)/dictBuilder/*.c -ZSTD_OBJ := $(patsubst %.c,%.o, $(wildcard $(ZSTD_FILES)) ) -ZBUFF_OBJ := $(patsubst %.c,%.o, $(wildcard $(ZBUFF_FILES)) ) -ZDICT_OBJ := $(patsubst %.c,%.o, $(wildcard $(ZDICT_FILES)) ) - # Define *.exe as extension for Windows systems ifneq (,$(filter Windows%,$(OS))) @@ -64,8 +58,8 @@ endif MULTITHREAD = $(MULTITHREAD_CPP) $(MULTITHREAD_LD) VOID = /dev/null -ZSTREAM_TESTTIME ?= -T2mn -FUZZERTEST ?= -T5mn +ZSTREAM_TESTTIME ?= -T90s +FUZZERTEST ?= -T200s ZSTDRTTEST = --test-large-data DECODECORPUS_TESTTIME ?= -T30 @@ -77,7 +71,7 @@ all: fullbench fuzzer zstreamtest paramgrill datagen decodecorpus all32: fullbench32 fuzzer32 zstreamtest32 -allnothread: fullbench fuzzer paramgrill datagen decodecorpus +allnothread: fullbench fuzzer paramgrill datagen decodecorpus dll: fuzzer-dll zstreamtest-dll @@ -91,7 +85,7 @@ zstd-nolegacy: $(MAKE) -C $(PRGDIR) $@ gzstd: - $(MAKE) -C $(PRGDIR) $@ + $(MAKE) -C $(PRGDIR) zstd HAVE_ZLIB=1 fullbench32: CPPFLAGS += -m32 fullbench fullbench32 : CPPFLAGS += $(MULTITHREAD_CPP) @@ -167,7 +161,7 @@ datagen : $(PRGDIR)/datagen.c datagencli.c $(CC) $(FLAGS) $^ -o $@$(EXT) roundTripCrash : $(ZSTD_FILES) roundTripCrash.c - $(CC) $(FLAGS) $^ -o $@$(EXT) + $(CC) $(FLAGS) $(MULTITHREAD) $^ -o $@$(EXT) longmatch : $(ZSTD_FILES) longmatch.c $(CC) $(FLAGS) $^ -o $@$(EXT) @@ -192,8 +186,8 @@ else $(CC) $(FLAGS) $^ -o $@$(EXT) -Wl,-rpath=$(ZSTDDIR) $(ZSTDDIR)/libzstd.so endif -poolTests : poolTests.c $(ZSTDDIR)/common/pool.c $(ZSTDDIR)/common/threading.c - $(CC) $(FLAGS) $(MULTITHREAD) $^ -o $@$(EXT) +poolTests : poolTests.c $(ZSTDDIR)/common/pool.c $(ZSTDDIR)/common/threading.c $(ZSTDDIR)/common/zstd_common.c $(ZSTDDIR)/common/error_private.c + $(CC) $(FLAGS) $(MULTITHREAD) $^ -o $@$(EXT) namespaceTest: if $(CC) namespaceTest.c ../lib/common/xxhash.c -o $@ ; then echo compilation should fail; exit 1 ; fi @@ -214,7 +208,7 @@ clean: zstreamtest$(EXT) zstreamtest32$(EXT) \ datagen$(EXT) paramgrill$(EXT) roundTripCrash$(EXT) longmatch$(EXT) \ symbols$(EXT) invalidDictionaries$(EXT) legacy$(EXT) poolTests$(EXT) \ - decodecorpus$(EXT) + decodecorpus$(EXT) @echo Cleaning completed @@ -247,7 +241,7 @@ endif #----------------------------------------------------------------------------- -#make tests validated only for MSYS, Linux, OSX, BSD, Hurd and Solaris targets +# make tests validated only for below targets #----------------------------------------------------------------------------- ifneq (,$(filter $(HOST_OS),MSYS POSIX)) @@ -284,13 +278,13 @@ test-zstd-nolegacy: ZSTD = $(PRGDIR)/zstd-nolegacy test-zstd-nolegacy: zstd-nolegacy zstd-playTests test-gzstd: gzstd - $(PRGDIR)/zstd README.md test-zstd-speed.py - gzip README.md test-zstd-speed.py + $(PRGDIR)/zstd -f README.md test-zstd-speed.py + gzip -f README.md test-zstd-speed.py cat README.md.zst test-zstd-speed.py.gz >zstd_gz.zst cat README.md.gz test-zstd-speed.py.zst >gz_zstd.gz - $(PRGDIR)/zstd -d README.md.gz -o README2.md - $(PRGDIR)/zstd -d README.md.gz test-zstd-speed.py.gz - $(PRGDIR)/zstd -d zstd_gz.zst gz_zstd.gz + $(PRGDIR)/zstd -df README.md.gz -o README2.md + $(PRGDIR)/zstd -df README.md.gz test-zstd-speed.py.gz + $(PRGDIR)/zstd -df zstd_gz.zst gz_zstd.gz $(DIFF) -q zstd_gz gz_zstd echo Hello World ZSTD | $(PRGDIR)/zstd -c - >hello.zst echo Hello World GZIP | gzip -c - >hello.gz @@ -298,6 +292,7 @@ test-gzstd: gzstd cat hello.zst hello.gz hello.txt >hello_zst_gz_txt.gz $(PRGDIR)/zstd -dcf hello.* $(PRGDIR)/zstd -dcf - zstd + lz4 < tmp | \ + $(ZSTD) -d | \ + cmp - tmp + lz4 < tmp | \ + $(ZSTD_UNLZ4) | \ + cmp - tmp + # zstd -> lz4 + $(ZSTD) --format=lz4 < tmp | \ + lz4 -d | \ + cmp - tmp + $(ZSTD_LZ4) < tmp | \ + lz4 -d | \ + cmp - tmp + # zstd -> zstd + $(ZSTD) --format=lz4 < tmp | \ + $(ZSTD) -d | \ + cmp - tmp + # zstd -> zstd + $(ZSTD) < tmp | \ + $(ZSTD) -d | \ + cmp - tmp + + rm tmp lz4 unlz4 + endif diff --git a/contrib/zstd/tests/README.md b/sys/contrib/zstd/tests/README.md similarity index 100% rename from contrib/zstd/tests/README.md rename to sys/contrib/zstd/tests/README.md diff --git a/contrib/zstd/tests/datagencli.c b/sys/contrib/zstd/tests/datagencli.c similarity index 97% rename from contrib/zstd/tests/datagencli.c rename to sys/contrib/zstd/tests/datagencli.c index bf9601f20976..4814974e27f5 100644 --- a/contrib/zstd/tests/datagencli.c +++ b/sys/contrib/zstd/tests/datagencli.c @@ -1,10 +1,11 @@ /* - * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * Copyright (c) 2015-present, Yann Collet, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ diff --git a/contrib/zstd/tests/decodecorpus.c b/sys/contrib/zstd/tests/decodecorpus.c similarity index 83% rename from contrib/zstd/tests/decodecorpus.c rename to sys/contrib/zstd/tests/decodecorpus.c index 23166bd67f0a..e697e519cfc1 100644 --- a/contrib/zstd/tests/decodecorpus.c +++ b/sys/contrib/zstd/tests/decodecorpus.c @@ -1,10 +1,11 @@ /* - * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * Copyright (c) 2017-present, Yann Collet, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ #include @@ -44,7 +45,7 @@ **************************************/ #define DISPLAY(...) fprintf(stderr, __VA_ARGS__) #define DISPLAYLEVEL(l, ...) if (g_displayLevel>=l) { DISPLAY(__VA_ARGS__); } -static U32 g_displayLevel = 0; +static U32 g_displayLevel = 2; #define DISPLAYUPDATE(...) \ do { \ @@ -173,20 +174,19 @@ const char *BLOCK_TYPES[] = {"raw", "rle", "compressed"}; #define MAX_DECOMPRESSED_SIZE (1ULL << MAX_DECOMPRESSED_SIZE_LOG) #define MAX_WINDOW_LOG 22 /* Recommended support is 8MB, so limit to 4MB + mantissa */ -#define MAX_BLOCK_SIZE (128ULL * 1024) #define MIN_SEQ_LEN (3) -#define MAX_NB_SEQ ((MAX_BLOCK_SIZE + MIN_SEQ_LEN - 1) / MIN_SEQ_LEN) +#define MAX_NB_SEQ ((ZSTD_BLOCKSIZE_MAX + MIN_SEQ_LEN - 1) / MIN_SEQ_LEN) BYTE CONTENT_BUFFER[MAX_DECOMPRESSED_SIZE]; BYTE FRAME_BUFFER[MAX_DECOMPRESSED_SIZE * 2]; -BYTE LITERAL_BUFFER[MAX_BLOCK_SIZE]; +BYTE LITERAL_BUFFER[ZSTD_BLOCKSIZE_MAX]; seqDef SEQUENCE_BUFFER[MAX_NB_SEQ]; -BYTE SEQUENCE_LITERAL_BUFFER[MAX_BLOCK_SIZE]; /* storeSeq expects a place to copy literals to */ -BYTE SEQUENCE_LLCODE[MAX_BLOCK_SIZE]; -BYTE SEQUENCE_MLCODE[MAX_BLOCK_SIZE]; -BYTE SEQUENCE_OFCODE[MAX_BLOCK_SIZE]; +BYTE SEQUENCE_LITERAL_BUFFER[ZSTD_BLOCKSIZE_MAX]; /* storeSeq expects a place to copy literals to */ +BYTE SEQUENCE_LLCODE[ZSTD_BLOCKSIZE_MAX]; +BYTE SEQUENCE_MLCODE[ZSTD_BLOCKSIZE_MAX]; +BYTE SEQUENCE_OFCODE[ZSTD_BLOCKSIZE_MAX]; unsigned WKSP[1024]; @@ -237,6 +237,18 @@ typedef struct { size_t dictContentSize; BYTE* dictContent; } dictInfo; + +typedef enum { + gt_frame = 0, /* generate frames */ + gt_block, /* generate compressed blocks without block/frame headers */ +} genType_e; + +/*-******************************************************* +* Global variables (set from command line) +*********************************************************/ +U32 g_maxDecompressedSizeLog = MAX_DECOMPRESSED_SIZE_LOG; /* <= 20 */ +U32 g_maxBlockSize = ZSTD_BLOCKSIZE_MAX; /* <= 128 KB */ + /*-******************************************************* * Generator Functions *********************************************************/ @@ -273,12 +285,12 @@ static void writeFrameHeader(U32* seed, frame_t* frame, dictInfo info) { /* Generate random content size */ size_t highBit; - if (RAND(seed) & 7) { + if (RAND(seed) & 7 && g_maxDecompressedSizeLog > 7) { /* do content of at least 128 bytes */ - highBit = 1ULL << RAND_range(seed, 7, MAX_DECOMPRESSED_SIZE_LOG); + highBit = 1ULL << RAND_range(seed, 7, g_maxDecompressedSizeLog); } else if (RAND(seed) & 3) { /* do small content */ - highBit = 1ULL << RAND_range(seed, 0, 7); + highBit = 1ULL << RAND_range(seed, 0, MIN(7, 1U << g_maxDecompressedSizeLog)); } else { /* 0 size frame */ highBit = 0; @@ -342,10 +354,10 @@ static void writeFrameHeader(U32* seed, frame_t* frame, dictInfo info) } } - DISPLAYLEVEL(2, " frame content size:\t%u\n", (U32)fh.contentSize); - DISPLAYLEVEL(2, " frame window size:\t%u\n", fh.windowSize); - DISPLAYLEVEL(2, " content size flag:\t%d\n", contentSizeFlag); - DISPLAYLEVEL(2, " single segment flag:\t%d\n", singleSegment); + DISPLAYLEVEL(3, " frame content size:\t%u\n", (U32)fh.contentSize); + DISPLAYLEVEL(3, " frame window size:\t%u\n", fh.windowSize); + DISPLAYLEVEL(3, " content size flag:\t%d\n", contentSizeFlag); + DISPLAYLEVEL(3, " single segment flag:\t%d\n", singleSegment); frame->data = op + pos; frame->header = fh; @@ -358,7 +370,7 @@ static size_t writeLiteralsBlockSimple(U32* seed, frame_t* frame, size_t content int const type = RAND(seed) % 2; int const sizeFormatDesc = RAND(seed) % 8; size_t litSize; - size_t maxLitSize = MIN(contentSize, MAX_BLOCK_SIZE); + size_t maxLitSize = MIN(contentSize, g_maxBlockSize); if (sizeFormatDesc == 0) { /* Size_FormatDesc = ?0 */ @@ -452,7 +464,7 @@ static size_t writeHufHeader(U32* seed, HUF_CElt* hufTable, void* dst, size_t ds return op - ostart; } -/* Write a Huffman coded literals block and return the litearls size */ +/* Write a Huffman coded literals block and return the literals size */ static size_t writeLiteralsBlockCompressed(U32* seed, frame_t* frame, size_t contentSize) { BYTE* origop = (BYTE*)frame->data; @@ -463,7 +475,7 @@ static size_t writeLiteralsBlockCompressed(U32* seed, frame_t* frame, size_t con size_t litSize; size_t hufHeaderSize = 0; size_t compressedSize = 0; - size_t maxLitSize = MIN(contentSize-3, MAX_BLOCK_SIZE); + size_t maxLitSize = MIN(contentSize-3, g_maxBlockSize); symbolEncodingType_e hType; @@ -867,7 +879,7 @@ static size_t writeSequences(U32* seed, frame_t* frame, seqStore_t* seqStorePtr, frame->stats.offsetSymbolSet, 28)) { Offtype = set_repeat; } else if (!(RAND(seed) & 3)) { - FSE_buildCTable_wksp(CTable_OffsetBits, OF_defaultNorm, MaxOff, OF_defaultNormLog, scratchBuffer, sizeof(scratchBuffer)); + FSE_buildCTable_wksp(CTable_OffsetBits, OF_defaultNorm, DefaultMaxOff, OF_defaultNormLog, scratchBuffer, sizeof(scratchBuffer)); Offtype = set_basic; } else { size_t nbSeq_1 = nbSeq; @@ -1020,9 +1032,9 @@ static void writeBlock(U32* seed, frame_t* frame, size_t contentSize, BYTE *const header = (BYTE*)frame->data; BYTE *op = header + 3; - DISPLAYLEVEL(3, " block:\n"); - DISPLAYLEVEL(3, " block content size: %u\n", (U32)contentSize); - DISPLAYLEVEL(3, " last block: %s\n", lastBlock ? "yes" : "no"); + DISPLAYLEVEL(4, " block:\n"); + DISPLAYLEVEL(4, " block content size: %u\n", (U32)contentSize); + DISPLAYLEVEL(4, " last block: %s\n", lastBlock ? "yes" : "no"); if (blockTypeDesc == 0) { /* Raw data frame */ @@ -1052,7 +1064,7 @@ static void writeBlock(U32* seed, frame_t* frame, size_t contentSize, frame->data = op; compressedSize = writeCompressedBlock(seed, frame, contentSize, info); - if (compressedSize > contentSize) { + if (compressedSize >= contentSize) { /* compressed block must be strictly smaller than uncompressed one */ blockType = 0; memcpy(op, frame->src, contentSize); @@ -1068,8 +1080,8 @@ static void writeBlock(U32* seed, frame_t* frame, size_t contentSize, } frame->src = (BYTE*)frame->src + contentSize; - DISPLAYLEVEL(3, " block type: %s\n", BLOCK_TYPES[blockType]); - DISPLAYLEVEL(3, " block size field: %u\n", (U32)blockSize); + DISPLAYLEVEL(4, " block type: %s\n", BLOCK_TYPES[blockType]); + DISPLAYLEVEL(4, " block size field: %u\n", (U32)blockSize); header[0] = (BYTE) ((lastBlock | (blockType << 1) | (blockSize << 3)) & 0xff); MEM_writeLE16(header + 1, (U16) (blockSize >> 5)); @@ -1080,7 +1092,7 @@ static void writeBlock(U32* seed, frame_t* frame, size_t contentSize, static void writeBlocks(U32* seed, frame_t* frame, dictInfo info) { size_t contentLeft = frame->header.contentSize; - size_t const maxBlockSize = MIN(MAX_BLOCK_SIZE, frame->header.windowSize); + size_t const maxBlockSize = MIN(g_maxBlockSize, frame->header.windowSize); while (1) { /* 1 in 4 chance of ending frame */ int const lastBlock = contentLeft > maxBlockSize ? 0 : !(RAND(seed) & 3); @@ -1089,13 +1101,13 @@ static void writeBlocks(U32* seed, frame_t* frame, dictInfo info) blockContentSize = contentLeft; } else { if (contentLeft > 0 && (RAND(seed) & 7)) { - /* some variable size blocks */ + /* some variable size block */ blockContentSize = RAND(seed) % (MIN(maxBlockSize, contentLeft)+1); } else if (contentLeft > maxBlockSize && (RAND(seed) & 1)) { - /* some full size blocks */ + /* some full size block */ blockContentSize = maxBlockSize; } else { - /* some empty blocks */ + /* some empty block */ blockContentSize = 0; } } @@ -1111,7 +1123,7 @@ static void writeChecksum(frame_t* frame) { /* write checksum so implementations can verify their output */ U64 digest = XXH64(frame->srcStart, (BYTE*)frame->src-(BYTE*)frame->srcStart, 0); - DISPLAYLEVEL(2, " checksum: %08x\n", (U32)digest); + DISPLAYLEVEL(3, " checksum: %08x\n", (U32)digest); MEM_writeLE32(frame->data, (U32)digest); frame->data = (BYTE*)frame->data + 4; } @@ -1132,8 +1144,7 @@ static void outputBuffer(const void* buf, size_t size, const char* const path) exit(1); } - { - size_t fsize = size; + { size_t fsize = size; size_t written = 0; while (written < fsize) { written += fwrite(ip + written, 1, fsize - written, out); @@ -1164,11 +1175,64 @@ static void initFrame(frame_t* fr) fr->stats.rep[2] = 8; } +/** + * Generated a single zstd compressed block with no block/frame header. + * Returns the final seed. + */ +static U32 generateCompressedBlock(U32 seed, frame_t* frame, dictInfo info) +{ + size_t blockContentSize; + int blockWritten = 0; + BYTE* op; + DISPLAYLEVEL(4, "block seed: %u\n", seed); + initFrame(frame); + op = (BYTE*)frame->data; + + while (!blockWritten) { + size_t cSize; + /* generate window size */ + { int const exponent = RAND(&seed) % (MAX_WINDOW_LOG - 10); + int const mantissa = RAND(&seed) % 8; + frame->header.windowSize = (1U << (exponent + 10)); + frame->header.windowSize += (frame->header.windowSize / 8) * mantissa; + } + + /* generate content size */ + { size_t const maxBlockSize = MIN(g_maxBlockSize, frame->header.windowSize); + if (RAND(&seed) & 15) { + /* some full size blocks */ + blockContentSize = maxBlockSize; + } else if (RAND(&seed) & 7 && g_maxBlockSize >= (1U << 7)) { + /* some small blocks <= 128 bytes*/ + blockContentSize = RAND(&seed) % (1U << 7); + } else { + /* some variable size blocks */ + blockContentSize = RAND(&seed) % maxBlockSize; + } + } + + /* try generating a compressed block */ + frame->oldStats = frame->stats; + frame->data = op; + cSize = writeCompressedBlock(&seed, frame, blockContentSize, info); + if (cSize >= blockContentSize) { /* compressed size must be strictly smaller than decompressed size : https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#blocks */ + /* data doesn't compress -- try again */ + frame->stats = frame->oldStats; /* don't update the stats */ + DISPLAYLEVEL(5, " can't compress block : try again \n"); + } else { + blockWritten = 1; + DISPLAYLEVEL(4, " block size: %u \n", (U32)cSize); + frame->src = (BYTE*)frame->src + blockContentSize; + } + } + return seed; +} + /* Return the final seed */ static U32 generateFrame(U32 seed, frame_t* fr, dictInfo info) { /* generate a complete frame */ - DISPLAYLEVEL(1, "frame seed: %u\n", seed); + DISPLAYLEVEL(3, "frame seed: %u\n", seed); initFrame(fr); writeFrameHeader(&seed, fr, info); @@ -1182,7 +1246,8 @@ static U32 generateFrame(U32 seed, frame_t* fr, dictInfo info) * Dictionary Helper Functions *********************************************************/ /* returns 0 if successful, otherwise returns 1 upon error */ -static int genRandomDict(U32 dictID, U32 seed, size_t dictSize, BYTE* fullDict){ +static int genRandomDict(U32 dictID, U32 seed, size_t dictSize, BYTE* fullDict) +{ /* allocate space for samples */ int ret = 0; unsigned const numSamples = 4; @@ -1194,27 +1259,20 @@ static int genRandomDict(U32 dictID, U32 seed, size_t dictSize, BYTE* fullDict){ } /* generate samples */ - { - unsigned literalValue = 1; + { unsigned literalValue = 1; unsigned samplesPos = 0; size_t currSize = 1; while (literalValue <= 4) { sampleSizes[literalValue - 1] = currSize; - { - size_t k; + { size_t k; for (k = 0; k < currSize; k++) { *(samples + (samplesPos++)) = (BYTE)literalValue; - } - } + } } literalValue++; currSize *= 16; - } - } + } } - - { - /* create variables */ - size_t dictWriteSize = 0; + { size_t dictWriteSize = 0; ZDICT_params_t zdictParams; size_t const headerSize = MAX(dictSize/4, 256); size_t const dictContentSize = dictSize - headerSize; @@ -1322,7 +1380,7 @@ static size_t testDecodeStreaming(frame_t* fr) return ret; } -static size_t testDecodeWithDict(U32 seed) +static size_t testDecodeWithDict(U32 seed, genType_e genType) { /* create variables */ size_t const dictSize = RAND(&seed) % (10 << 20) + ZDICT_DICTSIZE_MIN + ZDICT_CONTENTSIZE_MIN; @@ -1334,45 +1392,53 @@ static size_t testDecodeWithDict(U32 seed) } /* generate random dictionary */ - { - int const ret = genRandomDict(dictID, seed, dictSize, fullDict); - if (ret != 0) { - errorDetected = ERROR(GENERIC); - goto dictTestCleanup; - } + if (genRandomDict(dictID, seed, dictSize, fullDict)) { /* return 0 on success */ + errorDetected = ERROR(GENERIC); + goto dictTestCleanup; } - { - frame_t fr; + { frame_t fr; + dictInfo info; + ZSTD_DCtx* const dctx = ZSTD_createDCtx(); + size_t ret; - /* generate frame */ - { - size_t const headerSize = MAX(dictSize/4, 256); + /* get dict info */ + { size_t const headerSize = MAX(dictSize/4, 256); size_t const dictContentSize = dictSize-headerSize; BYTE* const dictContent = fullDict+headerSize; - dictInfo const info = initDictInfo(1, dictContentSize, dictContent, dictID); - seed = generateFrame(seed, &fr, info); + info = initDictInfo(1, dictContentSize, dictContent, dictID); } /* manually decompress and check difference */ - { - ZSTD_DCtx* const dctx = ZSTD_createDCtx(); - { - size_t const returnValue = ZSTD_decompress_usingDict(dctx, DECOMPRESSED_BUFFER, MAX_DECOMPRESSED_SIZE, - fr.dataStart, (BYTE*)fr.data - (BYTE*)fr.dataStart, - fullDict, dictSize); - if (ZSTD_isError(returnValue)) { - errorDetected = returnValue; - goto dictTestCleanup; - } - } - - if (memcmp(DECOMPRESSED_BUFFER, fr.srcStart, (BYTE*)fr.src - (BYTE*)fr.srcStart) != 0) { - errorDetected = ERROR(corruption_detected); + if (genType == gt_frame) { + /* Test frame */ + generateFrame(seed, &fr, info); + ret = ZSTD_decompress_usingDict(dctx, DECOMPRESSED_BUFFER, MAX_DECOMPRESSED_SIZE, + fr.dataStart, (BYTE*)fr.data - (BYTE*)fr.dataStart, + fullDict, dictSize); + } else { + /* Test block */ + generateCompressedBlock(seed, &fr, info); + ret = ZSTD_decompressBegin_usingDict(dctx, fullDict, dictSize); + if (ZSTD_isError(ret)) { + errorDetected = ret; + ZSTD_freeDCtx(dctx); goto dictTestCleanup; } - ZSTD_freeDCtx(dctx); + ret = ZSTD_decompressBlock(dctx, DECOMPRESSED_BUFFER, MAX_DECOMPRESSED_SIZE, + fr.dataStart, (BYTE*)fr.data - (BYTE*)fr.dataStart); + } + ZSTD_freeDCtx(dctx); + + if (ZSTD_isError(ret)) { + errorDetected = ret; + goto dictTestCleanup; + } + + if (memcmp(DECOMPRESSED_BUFFER, fr.srcStart, (BYTE*)fr.src - (BYTE*)fr.srcStart) != 0) { + errorDetected = ERROR(corruption_detected); + goto dictTestCleanup; } } @@ -1381,7 +1447,87 @@ static size_t testDecodeWithDict(U32 seed) return errorDetected; } -static int runTestMode(U32 seed, unsigned numFiles, unsigned const testDurationS) +static size_t testDecodeRawBlock(frame_t* fr) +{ + ZSTD_DCtx* dctx = ZSTD_createDCtx(); + size_t ret = ZSTD_decompressBegin(dctx); + if (ZSTD_isError(ret)) return ret; + + ret = ZSTD_decompressBlock( + dctx, + DECOMPRESSED_BUFFER, MAX_DECOMPRESSED_SIZE, + fr->dataStart, (BYTE*)fr->data - (BYTE*)fr->dataStart); + ZSTD_freeDCtx(dctx); + if (ZSTD_isError(ret)) return ret; + + if (memcmp(DECOMPRESSED_BUFFER, fr->srcStart, + (BYTE*)fr->src - (BYTE*)fr->srcStart) != 0) { + return ERROR(corruption_detected); + } + + return ret; +} + +static int runBlockTest(U32* seed) +{ + frame_t fr; + U32 const seedCopy = *seed; + { dictInfo const info = initDictInfo(0, 0, NULL, 0); + *seed = generateCompressedBlock(*seed, &fr, info); + } + + { size_t const r = testDecodeRawBlock(&fr); + if (ZSTD_isError(r)) { + DISPLAY("Error in block mode on test seed %u: %s\n", seedCopy, + ZSTD_getErrorName(r)); + return 1; + } + } + + { size_t const r = testDecodeWithDict(*seed, gt_block); + if (ZSTD_isError(r)) { + DISPLAY("Error in block mode with dictionary on test seed %u: %s\n", + seedCopy, ZSTD_getErrorName(r)); + return 1; + } + } + return 0; +} + +static int runFrameTest(U32* seed) +{ + frame_t fr; + U32 const seedCopy = *seed; + { dictInfo const info = initDictInfo(0, 0, NULL, 0); + *seed = generateFrame(*seed, &fr, info); + } + + { size_t const r = testDecodeSimple(&fr); + if (ZSTD_isError(r)) { + DISPLAY("Error in simple mode on test seed %u: %s\n", + seedCopy, ZSTD_getErrorName(r)); + return 1; + } + } + { size_t const r = testDecodeStreaming(&fr); + if (ZSTD_isError(r)) { + DISPLAY("Error in streaming mode on test seed %u: %s\n", + seedCopy, ZSTD_getErrorName(r)); + return 1; + } + } + { size_t const r = testDecodeWithDict(*seed, gt_frame); /* avoid big dictionaries */ + if (ZSTD_isError(r)) { + DISPLAY("Error in dictionary mode on test seed %u: %s\n", + seedCopy, ZSTD_getErrorName(r)); + return 1; + } + } + return 0; +} + +static int runTestMode(U32 seed, unsigned numFiles, unsigned const testDurationS, + genType_e genType) { unsigned fnum; @@ -1393,39 +1539,15 @@ static int runTestMode(U32 seed, unsigned numFiles, unsigned const testDurationS DISPLAY("seed: %u\n", seed); for (fnum = 0; fnum < numFiles || clockSpan(startClock) < maxClockSpan; fnum++) { - frame_t fr; - U32 const seedCopy = seed; if (fnum < numFiles) DISPLAYUPDATE("\r%u/%u ", fnum, numFiles); else DISPLAYUPDATE("\r%u ", fnum); - { - dictInfo const info = initDictInfo(0, 0, NULL, 0); - seed = generateFrame(seed, &fr, info); - } - - { size_t const r = testDecodeSimple(&fr); - if (ZSTD_isError(r)) { - DISPLAY("Error in simple mode on test seed %u: %s\n", seedCopy, - ZSTD_getErrorName(r)); - return 1; - } - } - { size_t const r = testDecodeStreaming(&fr); - if (ZSTD_isError(r)) { - DISPLAY("Error in streaming mode on test seed %u: %s\n", seedCopy, - ZSTD_getErrorName(r)); - return 1; - } - } - { - /* don't create a dictionary that is too big */ - size_t const r = testDecodeWithDict(seed); - if (ZSTD_isError(r)) { - DISPLAY("Error in dictionary mode on test seed %u: %s\n", seedCopy, ZSTD_getErrorName(r)); - return 1; - } + { int const ret = (genType == gt_frame) ? + runFrameTest(&seed) : + runBlockTest(&seed); + if (ret) return ret; } } @@ -1440,17 +1562,19 @@ static int runTestMode(U32 seed, unsigned numFiles, unsigned const testDurationS *********************************************************/ static int generateFile(U32 seed, const char* const path, - const char* const origPath) + const char* const origPath, genType_e genType) { frame_t fr; DISPLAY("seed: %u\n", seed); - { - dictInfo const info = initDictInfo(0, 0, NULL, 0); - generateFrame(seed, &fr, info); + { dictInfo const info = initDictInfo(0, 0, NULL, 0); + if (genType == gt_frame) { + generateFrame(seed, &fr, info); + } else { + generateCompressedBlock(seed, &fr, info); + } } - outputBuffer(fr.dataStart, (BYTE*)fr.data - (BYTE*)fr.dataStart, path); if (origPath) { outputBuffer(fr.srcStart, (BYTE*)fr.src - (BYTE*)fr.srcStart, origPath); @@ -1459,7 +1583,7 @@ static int generateFile(U32 seed, const char* const path, } static int generateCorpus(U32 seed, unsigned numFiles, const char* const path, - const char* const origPath) + const char* const origPath, genType_e genType) { char outPath[MAX_PATH]; unsigned fnum; @@ -1471,9 +1595,12 @@ static int generateCorpus(U32 seed, unsigned numFiles, const char* const path, DISPLAYUPDATE("\r%u/%u ", fnum, numFiles); - { - dictInfo const info = initDictInfo(0, 0, NULL, 0); - seed = generateFrame(seed, &fr, info); + { dictInfo const info = initDictInfo(0, 0, NULL, 0); + if (genType == gt_frame) { + seed = generateFrame(seed, &fr, info); + } else { + seed = generateCompressedBlock(seed, &fr, info); + } } if (snprintf(outPath, MAX_PATH, "%s/z%06u.zst", path, fnum) + 1 > MAX_PATH) { @@ -1497,7 +1624,8 @@ static int generateCorpus(U32 seed, unsigned numFiles, const char* const path, } static int generateCorpusWithDict(U32 seed, unsigned numFiles, const char* const path, - const char* const origPath, const size_t dictSize) + const char* const origPath, const size_t dictSize, + genType_e genType) { char outPath[MAX_PATH]; BYTE* fullDict; @@ -1517,8 +1645,7 @@ static int generateCorpusWithDict(U32 seed, unsigned numFiles, const char* const } /* randomly generate the dictionary */ - { - int const ret = genRandomDict(dictID, seed, dictSize, fullDict); + { int const ret = genRandomDict(dictID, seed, dictSize, fullDict); if (ret != 0) { errorDetected = ret; goto dictCleanup; @@ -1539,8 +1666,7 @@ static int generateCorpusWithDict(U32 seed, unsigned numFiles, const char* const } /* generate random compressed/decompressed files */ - { - unsigned fnum; + { unsigned fnum; for (fnum = 0; fnum < MAX(numFiles, 1); fnum++) { frame_t fr; DISPLAYUPDATE("\r%u/%u ", fnum, numFiles); @@ -1549,7 +1675,11 @@ static int generateCorpusWithDict(U32 seed, unsigned numFiles, const char* const size_t const dictContentSize = dictSize-headerSize; BYTE* const dictContent = fullDict+headerSize; dictInfo const info = initDictInfo(1, dictContentSize, dictContent, dictID); - seed = generateFrame(seed, &fr, info); + if (genType == gt_frame) { + seed = generateFrame(seed, &fr, info); + } else { + seed = generateCompressedBlock(seed, &fr, info); + } } if (numFiles != 0) { @@ -1626,9 +1756,13 @@ static void advancedUsage(const char* programName) { usage(programName); DISPLAY( "\n"); - DISPLAY( "Advanced arguments :\n"); - DISPLAY( " --content-size : always include the content size in the frame header\n"); - DISPLAY( " --use-dict=# : include a dictionary used to decompress the corpus\n"); + DISPLAY( "Advanced arguments :\n"); + DISPLAY( " --content-size : always include the content size in the frame header\n"); + DISPLAY( " --use-dict=# : include a dictionary used to decompress the corpus\n"); + DISPLAY( " --gen-blocks : generate raw compressed blocks without block/frame headers\n"); + DISPLAY( " --max-block-size-log=# : max block size log, must be in range [2, 17]\n"); + DISPLAY( " --max-content-size-log=# : max content size log, must be <= 20\n"); + DISPLAY( " (this is ignored with gen-blocks)\n"); } /*! readU32FromChar() : @@ -1675,6 +1809,7 @@ int main(int argc, char** argv) const char* origPath = NULL; int useDict = 0; unsigned dictSize = (10 << 10); /* 10 kB default */ + genType_e genType = gt_frame; int argNb; @@ -1738,6 +1873,17 @@ int main(int argc, char** argv) } else if (longCommandWArg(&argument, "use-dict=")) { dictSize = readU32FromChar(&argument); useDict = 1; + } else if (strcmp(argument, "gen-blocks") == 0) { + genType = gt_block; + } else if (longCommandWArg(&argument, "max-block-size-log=")) { + U32 value = readU32FromChar(&argument); + if (value >= 2 && value <= ZSTD_BLOCKSIZE_MAX) { + g_maxBlockSize = 1U << value; + } + } else if (longCommandWArg(&argument, "max-content-size-log=")) { + U32 value = readU32FromChar(&argument); + g_maxDecompressedSizeLog = + MIN(MAX_DECOMPRESSED_SIZE_LOG, value); } else { advancedUsage(argv[0]); return 1; @@ -1754,7 +1900,7 @@ int main(int argc, char** argv) } if (testMode) { - return runTestMode(seed, numFiles, testDuration); + return runTestMode(seed, numFiles, testDuration, genType); } else { if (testDuration) { DISPLAY("Error: -T requires test mode (-t)\n\n"); @@ -1770,12 +1916,12 @@ int main(int argc, char** argv) } if (numFiles == 0 && useDict == 0) { - return generateFile(seed, path, origPath); + return generateFile(seed, path, origPath, genType); } else if (useDict == 0){ - return generateCorpus(seed, numFiles, path, origPath); + return generateCorpus(seed, numFiles, path, origPath, genType); } else { /* should generate files with a dictionary */ - return generateCorpusWithDict(seed, numFiles, path, origPath, dictSize); + return generateCorpusWithDict(seed, numFiles, path, origPath, dictSize, genType); } } diff --git a/contrib/zstd/tests/files/huffman-compressed-larger b/sys/contrib/zstd/tests/files/huffman-compressed-larger similarity index 100% rename from contrib/zstd/tests/files/huffman-compressed-larger rename to sys/contrib/zstd/tests/files/huffman-compressed-larger diff --git a/contrib/zstd/tests/fullbench.c b/sys/contrib/zstd/tests/fullbench.c similarity index 98% rename from contrib/zstd/tests/fullbench.c rename to sys/contrib/zstd/tests/fullbench.c index 78a70940f9d2..db00ce217b0e 100644 --- a/contrib/zstd/tests/fullbench.c +++ b/sys/contrib/zstd/tests/fullbench.c @@ -1,10 +1,11 @@ /* - * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * Copyright (c) 2015-present, Yann Collet, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ @@ -375,6 +376,7 @@ static size_t benchMem(const void* src, size_t srcSize, U32 benchNb) skippedSize = frameHeaderSize + ZSTD_blockHeaderSize; memcpy(buff2, dstBuff+skippedSize, g_cSize-skippedSize); srcSize = srcSize > 128 KB ? 128 KB : srcSize; /* speed relative to block */ + ZSTD_decompressBegin(g_zdc); break; } case 32: /* ZSTD_decodeSeqHeaders */ @@ -421,8 +423,6 @@ static size_t benchMem(const void* src, size_t srcSize, U32 benchNb) { U32 loopNb; # define TIME_SEC_MICROSEC (1*1000000ULL) /* 1 second */ U64 const clockLoop = TIMELOOP_S * TIME_SEC_MICROSEC; - UTIL_freq_t ticksPerSecond; - UTIL_initTimer(&ticksPerSecond); DISPLAY("%2i- %-30.30s : \r", benchNb, benchName); for (loopNb = 1; loopNb <= g_nbIterations; loopNb++) { UTIL_time_t clockStart; @@ -430,13 +430,13 @@ static size_t benchMem(const void* src, size_t srcSize, U32 benchNb) U32 nbRounds; UTIL_sleepMilli(1); /* give processor time to other processes */ - UTIL_waitForNextTick(ticksPerSecond); - UTIL_getTime(&clockStart); - for (nbRounds=0; UTIL_clockSpanMicro(clockStart, ticksPerSecond) < clockLoop; nbRounds++) { + UTIL_waitForNextTick(); + clockStart = UTIL_getTime(); + for (nbRounds=0; UTIL_clockSpanMicro(clockStart) < clockLoop; nbRounds++) { benchResult = benchFunction(dstBuff, dstBuffSize, buff2, src, srcSize); if (ZSTD_isError(benchResult)) { DISPLAY("ERROR ! %s() => %s !! \n", benchName, ZSTD_getErrorName(benchResult)); exit(1); } } - { U64 const clockSpanMicro = UTIL_clockSpanMicro(clockStart, ticksPerSecond); + { U64 const clockSpanMicro = UTIL_clockSpanMicro(clockStart); double const averageTime = (double)clockSpanMicro / TIME_SEC_MICROSEC / nbRounds; if (averageTime < bestTime) bestTime = averageTime; DISPLAY("%2i- %-30.30s : %7.1f MB/s (%9u)\r", loopNb, benchName, (double)srcSize / (1 MB) / bestTime, (U32)benchResult); diff --git a/sys/contrib/zstd/tests/fuzz/Makefile b/sys/contrib/zstd/tests/fuzz/Makefile new file mode 100644 index 000000000000..d9b00fd2af79 --- /dev/null +++ b/sys/contrib/zstd/tests/fuzz/Makefile @@ -0,0 +1,127 @@ +# ################################################################ +# Copyright (c) 2016-present, Facebook, Inc. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ + +# Optionally user defined flags +CFLAGS ?= -O3 +CXXFLAGS ?= -O3 +CPPFLAGS ?= +LDFLAGS ?= +ARFLAGS ?= +LIB_FUZZING_ENGINE ?= libregression.a +PYTHON ?= python +ifeq ($(shell uname), Darwin) + DOWNLOAD?=curl -L -o +else + DOWNLOAD?=wget -O +endif +CORPORA_URL_PREFIX:=https://github.com/facebook/zstd/releases/download/fuzz-corpora/ + +ZSTDDIR = ../../lib +PRGDIR = ../../programs + +FUZZ_CPPFLAGS := -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \ + -I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR) \ + $(CPPFLAGS) +FUZZ_EXTRA_FLAGS := -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ + -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \ + -Wstrict-prototypes -Wundef -Wformat-security \ + -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \ + -Wredundant-decls \ + -g -fno-omit-frame-pointer +FUZZ_CFLAGS := $(FUZZ_EXTRA_FLAGS) $(CFLAGS) +FUZZ_CXXFLAGS := $(FUZZ_EXTRA_FLAGS) -std=c++11 $(CXXFLAGS) +FUZZ_LDFLAGS := $(LDFLAGS) +FUZZ_ARFLAGS := $(ARFLAGS) +FUZZ_TARGET_FLAGS = $(FUZZ_CPPFLAGS) $(FUZZ_CXXFLAGS) $(FUZZ_LDFLAGS) + +FUZZ_HEADERS := fuzz_helpers.h fuzz.h zstd_helpers.h +FUZZ_SRC := zstd_helpers.c + +ZSTDCOMMON_SRC := $(ZSTDDIR)/common/*.c +ZSTDCOMP_SRC := $(ZSTDDIR)/compress/*.c +ZSTDDECOMP_SRC := $(ZSTDDIR)/decompress/*.c +FUZZ_SRC := \ + $(FUZZ_SRC) \ + $(ZSTDDECOMP_SRC) \ + $(ZSTDCOMMON_SRC) \ + $(ZSTDCOMP_SRC) + +FUZZ_OBJ := $(patsubst %.c,%.o, $(wildcard $(FUZZ_SRC))) + + +.PHONY: default all clean cleanall + +default: all + +FUZZ_TARGETS := \ + simple_round_trip \ + stream_round_trip \ + block_round_trip \ + simple_decompress \ + stream_decompress \ + block_decompress + +all: $(FUZZ_TARGETS) + +%.o: %.c + $(CC) $(FUZZ_CPPFLAGS) $(FUZZ_CFLAGS) $^ -c -o $@ + +simple_round_trip: $(FUZZ_HEADERS) $(FUZZ_OBJ) simple_round_trip.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_OBJ) simple_round_trip.o $(LIB_FUZZING_ENGINE) -o $@ + +stream_round_trip: $(FUZZ_HEADERS) $(FUZZ_OBJ) stream_round_trip.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_OBJ) stream_round_trip.o $(LIB_FUZZING_ENGINE) -o $@ + +block_round_trip: $(FUZZ_HEADERS) $(FUZZ_OBJ) block_round_trip.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_OBJ) block_round_trip.o $(LIB_FUZZING_ENGINE) -o $@ + +simple_decompress: $(FUZZ_HEADERS) $(FUZZ_OBJ) simple_decompress.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_OBJ) simple_decompress.o $(LIB_FUZZING_ENGINE) -o $@ + +stream_decompress: $(FUZZ_HEADERS) $(FUZZ_OBJ) stream_decompress.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_OBJ) stream_decompress.o $(LIB_FUZZING_ENGINE) -o $@ + +block_decompress: $(FUZZ_HEADERS) $(FUZZ_OBJ) block_decompress.o + $(CXX) $(FUZZ_TARGET_FLAGS) $(FUZZ_OBJ) block_decompress.o $(LIB_FUZZING_ENGINE) -o $@ + +libregression.a: $(FUZZ_HEADERS) $(PRGDIR)/util.h regression_driver.o + $(AR) $(FUZZ_ARFLAGS) $@ regression_driver.o + +# Install libfuzzer (not usable for MSAN testing) +# Provided for convienence. To use this library run make libFuzzer and +# set LDFLAGS=-L. +.PHONY: libFuzzer +libFuzzer: + @$(RM) -rf Fuzzer + @git clone https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer + @cd Fuzzer && ./build.sh + +corpora/%_seed_corpus.zip: + @mkdir -p corpora + $(DOWNLOAD) $@ $(CORPORA_URL_PREFIX)$*_seed_corpus.zip + +corpora/%: corpora/%_seed_corpus.zip + unzip -q $^ -d $@ + +.PHONY: corpora +corpora: $(patsubst %,corpora/%,$(FUZZ_TARGETS)) + +regressiontest: corpora + CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" $(PYTHON) ./fuzz.py build all + $(PYTHON) ./fuzz.py regression all + +clean: + @$(MAKE) -C $(ZSTDDIR) clean + @$(RM) *.a *.o + @$(RM) simple_round_trip stream_round_trip simple_decompress \ + stream_decompress block_decompress block_round_trip + +cleanall: + @$(RM) -r Fuzzer + @$(RM) -r corpora diff --git a/sys/contrib/zstd/tests/fuzz/README.md b/sys/contrib/zstd/tests/fuzz/README.md new file mode 100644 index 000000000000..f184be646ef6 --- /dev/null +++ b/sys/contrib/zstd/tests/fuzz/README.md @@ -0,0 +1,96 @@ +# Fuzzing + +Each fuzzing target can be built with multiple engines. +Zstd provides a fuzz corpus for each target that can be downloaded with +the command: + +``` +make corpora +``` + +It will download each corpus into `./corpora/TARGET`. + +## fuzz.py + +`fuzz.py` is a helper script for building and running fuzzers. +Run `./fuzz.py -h` for the commands and run `./fuzz.py COMMAND -h` for +command specific help. + +### Generating Data + +`fuzz.py` provides a utility to generate seed data for each fuzzer. + +``` +make -C ../tests decodecorpus +./fuzz.py gen TARGET +``` + +By default it outputs 100 samples, each at most 8KB into `corpora/TARGET-seed`, +but that can be configured with the `--number`, `--max-size-log` and `--seed` +flags. + +### Build +It respects the usual build environment variables `CC`, `CFLAGS`, etc. +The environment variables can be overridden with the corresponding flags +`--cc`, `--cflags`, etc. +The specific fuzzing engine is selected with `LIB_FUZZING_ENGINE` or +`--lib-fuzzing-engine`, the default is `libregression.a`. +It has flags that can easily set up sanitizers `--enable-{a,ub,m}san`, and +coverage instrumentation `--enable-coverage`. +It sets sane defaults which can be overriden with flags `--debug`, +`--enable-ubsan-pointer-overlow`, etc. +Run `./fuzz.py build -h` for help. + +### Running Fuzzers + +`./fuzz.py` can run `libfuzzer`, `afl`, and `regression` tests. +See the help of the relevant command for options. +Flags not parsed by `fuzz.py` are passed to the fuzzing engine. +The command used to run the fuzzer is printed for debugging. + +## LibFuzzer + +``` +# Build libfuzzer if necessary +make libFuzzer +# Build the fuzz targets +./fuzz.py build all --enable-coverage --enable-asan --enable-ubsan --lib-fuzzing-engine Fuzzer/libFuzzer.a --cc clang --cxx clang++ +# OR equivalently +CC=clang CXX=clang++ LIB_FUZZING_ENGINE=Fuzzer/libFuzzer.a ./fuzz.py build all --enable-coverage --enable-asan --enable-ubsan +# Run the fuzzer +./fuzz.py libfuzzer TARGET -max_len=8192 -jobs=4 +``` + +where `TARGET` could be `simple_decompress`, `stream_round_trip`, etc. + +### MSAN + +Fuzzing with `libFuzzer` and `MSAN` will require building a C++ standard library +and libFuzzer with MSAN. +`fuzz.py` respects the environment variables / flags `MSAN_EXTRA_CPPFLAGS`, +`MSAN_EXTRA_CFLAGS`, `MSAN_EXTRA_CXXFLAGS`, `MSAN_EXTRA_LDFLAGS` to easily pass +the extra parameters only for MSAN. + +## AFL + +The default `LIB_FUZZING_ENGINE` is `libregression.a`, which produces a binary +that AFL can use. + +``` +# Build the fuzz targets +CC=afl-clang CXX=afl-clang++ ./fuzz.py build all --enable-asan --enable-ubsan +# Run the fuzzer without a memory limit because of ASAN +./fuzz.py afl TARGET -m none +``` + +## Regression Testing + +The regression rest supports the `all` target to run all the fuzzers in one +command. + +``` +CC=clang CXX=clang++ ./fuzz.py build all --enable-asan --enable-ubsan +./fuzz.py regression all +CC=clang CXX=clang++ ./fuzz.py build all --enable-msan +./fuzz.py regression all +``` diff --git a/sys/contrib/zstd/tests/fuzz/block_decompress.c b/sys/contrib/zstd/tests/fuzz/block_decompress.c new file mode 100644 index 000000000000..3cccc32f4e52 --- /dev/null +++ b/sys/contrib/zstd/tests/fuzz/block_decompress.c @@ -0,0 +1,51 @@ +/** + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + */ + +/** + * This fuzz target attempts to decompress the fuzzed data with the simple + * decompression function to ensure the decompressor never crashes. + */ + +#define ZSTD_STATIC_LINKING_ONLY + +#include +#include +#include +#include "fuzz_helpers.h" +#include "zstd.h" + +static ZSTD_DCtx *dctx = NULL; +static void* rBuf = NULL; +static size_t bufSize = 0; + +int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size) +{ + size_t const neededBufSize = ZSTD_BLOCKSIZE_MAX; + + FUZZ_seed(&src, &size); + + /* Allocate all buffers and contexts if not already allocated */ + if (neededBufSize > bufSize) { + free(rBuf); + rBuf = malloc(neededBufSize); + bufSize = neededBufSize; + FUZZ_ASSERT(rBuf); + } + if (!dctx) { + dctx = ZSTD_createDCtx(); + FUZZ_ASSERT(dctx); + } + ZSTD_decompressBegin(dctx); + ZSTD_decompressBlock(dctx, rBuf, neededBufSize, src, size); + +#ifndef STATEFUL_FUZZING + ZSTD_freeDCtx(dctx); dctx = NULL; +#endif + return 0; +} diff --git a/contrib/zstd/tests/fuzz/simple_round_trip.c b/sys/contrib/zstd/tests/fuzz/block_round_trip.c similarity index 59% rename from contrib/zstd/tests/fuzz/simple_round_trip.c rename to sys/contrib/zstd/tests/fuzz/block_round_trip.c index 703ea582630a..64ca5fc40f9c 100644 --- a/contrib/zstd/tests/fuzz/simple_round_trip.c +++ b/sys/contrib/zstd/tests/fuzz/block_round_trip.c @@ -2,9 +2,9 @@ * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ /** @@ -12,6 +12,8 @@ * compares the result with the original, and calls abort() on corruption. */ +#define ZSTD_STATIC_LINKING_ONLY + #include #include #include @@ -32,24 +34,33 @@ static size_t roundTripTest(void *result, size_t resultCapacity, void *compressed, size_t compressedCapacity, const void *src, size_t srcSize) { - int const cLevel = FUZZ_rand(&seed) % kMaxClevel; - size_t const cSize = ZSTD_compressCCtx(cctx, compressed, compressedCapacity, - src, srcSize, cLevel); - if (ZSTD_isError(cSize)) { - fprintf(stderr, "Compression error: %s\n", ZSTD_getErrorName(cSize)); - return cSize; - } - return ZSTD_decompressDCtx(dctx, result, resultCapacity, compressed, cSize); + int const cLevel = FUZZ_rand(&seed) % kMaxClevel; + ZSTD_parameters const params = ZSTD_getParams(cLevel, srcSize, 0); + size_t ret = ZSTD_compressBegin_advanced(cctx, NULL, 0, params, srcSize); + FUZZ_ZASSERT(ret); + + ret = ZSTD_compressBlock(cctx, compressed, compressedCapacity, src, srcSize); + FUZZ_ZASSERT(ret); + if (ret == 0) { + FUZZ_ASSERT(resultCapacity >= srcSize); + memcpy(result, src, srcSize); + return srcSize; + } + ZSTD_decompressBegin(dctx); + return ZSTD_decompressBlock(dctx, result, resultCapacity, compressed, ret); } int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size) { - size_t const neededBufSize = ZSTD_compressBound(size); + size_t neededBufSize; - seed = FUZZ_seed(src, size); + seed = FUZZ_seed(&src, &size); + neededBufSize = size; + if (size > ZSTD_BLOCKSIZE_MAX) + return 0; /* Allocate all buffers and contexts if not already allocated */ - if (neededBufSize > bufSize) { + if (neededBufSize > bufSize || !cBuf || !rBuf) { free(cBuf); free(rBuf); cBuf = malloc(neededBufSize); @@ -69,11 +80,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size) { size_t const result = roundTripTest(rBuf, neededBufSize, cBuf, neededBufSize, src, size); - FUZZ_ASSERT_MSG(!ZSTD_isError(result), ZSTD_getErrorName(result)); + FUZZ_ZASSERT(result); FUZZ_ASSERT_MSG(result == size, "Incorrect regenerated size"); FUZZ_ASSERT_MSG(!memcmp(src, rBuf, size), "Corruption!"); } -#ifndef STATEFULL_FUZZING +#ifndef STATEFUL_FUZZING ZSTD_freeCCtx(cctx); cctx = NULL; ZSTD_freeDCtx(dctx); dctx = NULL; #endif diff --git a/sys/contrib/zstd/tests/fuzz/default.options b/sys/contrib/zstd/tests/fuzz/default.options new file mode 100644 index 000000000000..8ea8588375d7 --- /dev/null +++ b/sys/contrib/zstd/tests/fuzz/default.options @@ -0,0 +1,2 @@ +[libfuzzer] +max_len = 8192 diff --git a/contrib/zstd/tests/fuzz/fuzz.h b/sys/contrib/zstd/tests/fuzz/fuzz.h similarity index 73% rename from contrib/zstd/tests/fuzz/fuzz.h rename to sys/contrib/zstd/tests/fuzz/fuzz.h index 5b71aba89b43..a64845473c2b 100644 --- a/contrib/zstd/tests/fuzz/fuzz.h +++ b/sys/contrib/zstd/tests/fuzz/fuzz.h @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ /** @@ -12,15 +12,17 @@ * Fuzz targets have some common parameters passed as macros during compilation. * Check the documentation for each individual fuzzer for more parameters. * - * @param STATEFULL_FUZZING: + * @param STATEFUL_FUZZING: * Define this to reuse state between fuzzer runs. This can be useful to * test code paths which are only executed when contexts are reused. * WARNING: Makes reproducing crashes much harder. * Default: Not defined. * @param FUZZ_RNG_SEED_SIZE: * The number of bytes of the source to look at when constructing a seed - * for the deterministic RNG. - * Default: 128. + * for the deterministic RNG. These bytes are discarded before passing + * the data to zstd functions. Every fuzzer initializes the RNG exactly + * once before doing anything else, even if it is unused. + * Default: 4. * @param ZSTD_DEBUG: * This is a parameter for the zstd library. Defining `ZSTD_DEBUG=1` * enables assert() statements in the zstd library. Higher levels enable @@ -41,12 +43,20 @@ #define FUZZ_H #ifndef FUZZ_RNG_SEED_SIZE -# define FUZZ_RNG_SEED_SIZE 128 +# define FUZZ_RNG_SEED_SIZE 4 #endif #include #include +#ifdef __cplusplus +extern "C" { +#endif + int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size); +#ifdef __cplusplus +} +#endif + #endif diff --git a/sys/contrib/zstd/tests/fuzz/fuzz.py b/sys/contrib/zstd/tests/fuzz/fuzz.py new file mode 100755 index 000000000000..b591e4f6734e --- /dev/null +++ b/sys/contrib/zstd/tests/fuzz/fuzz.py @@ -0,0 +1,818 @@ +#!/usr/bin/env python + +# ################################################################ +# Copyright (c) 2016-present, Facebook, Inc. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ########################################################################## + +import argparse +import contextlib +import os +import re +import shutil +import subprocess +import sys +import tempfile + + +def abs_join(a, *p): + return os.path.abspath(os.path.join(a, *p)) + + +# Constants +FUZZ_DIR = os.path.abspath(os.path.dirname(__file__)) +CORPORA_DIR = abs_join(FUZZ_DIR, 'corpora') +TARGETS = [ + 'simple_round_trip', + 'stream_round_trip', + 'block_round_trip', + 'simple_decompress', + 'stream_decompress', + 'block_decompress', +] +ALL_TARGETS = TARGETS + ['all'] +FUZZ_RNG_SEED_SIZE = 4 + +# Standard environment variables +CC = os.environ.get('CC', 'cc') +CXX = os.environ.get('CXX', 'c++') +CPPFLAGS = os.environ.get('CPPFLAGS', '') +CFLAGS = os.environ.get('CFLAGS', '-O3') +CXXFLAGS = os.environ.get('CXXFLAGS', CFLAGS) +LDFLAGS = os.environ.get('LDFLAGS', '') +MFLAGS = os.environ.get('MFLAGS', '-j') + +# Fuzzing environment variables +LIB_FUZZING_ENGINE = os.environ.get('LIB_FUZZING_ENGINE', 'libregression.a') +AFL_FUZZ = os.environ.get('AFL_FUZZ', 'afl-fuzz') +DECODECORPUS = os.environ.get('DECODECORPUS', + abs_join(FUZZ_DIR, '..', 'decodecorpus')) + +# Sanitizer environment variables +MSAN_EXTRA_CPPFLAGS = os.environ.get('MSAN_EXTRA_CPPFLAGS', '') +MSAN_EXTRA_CFLAGS = os.environ.get('MSAN_EXTRA_CFLAGS', '') +MSAN_EXTRA_CXXFLAGS = os.environ.get('MSAN_EXTRA_CXXFLAGS', '') +MSAN_EXTRA_LDFLAGS = os.environ.get('MSAN_EXTRA_LDFLAGS', '') + + +def create(r): + d = os.path.abspath(r) + if not os.path.isdir(d): + os.mkdir(d) + return d + + +def check(r): + d = os.path.abspath(r) + if not os.path.isdir(d): + return None + return d + + +@contextlib.contextmanager +def tmpdir(): + dirpath = tempfile.mkdtemp() + try: + yield dirpath + finally: + shutil.rmtree(dirpath, ignore_errors=True) + + +def parse_targets(in_targets): + targets = set() + for target in in_targets: + if not target: + continue + if target == 'all': + targets = targets.union(TARGETS) + elif target in TARGETS: + targets.add(target) + else: + raise RuntimeError('{} is not a valid target'.format(target)) + return list(targets) + + +def targets_parser(args, description): + parser = argparse.ArgumentParser(prog=args.pop(0), description=description) + parser.add_argument( + 'TARGET', + nargs='*', + type=str, + help='Fuzz target(s) to build {{{}}}'.format(', '.join(ALL_TARGETS))) + args, extra = parser.parse_known_args(args) + args.extra = extra + + args.TARGET = parse_targets(args.TARGET) + + return args + + +def parse_env_flags(args, flags): + """ + Look for flags set by environment variables. + """ + san_flags = ','.join(re.findall('-fsanitize=((?:[a-z]+,?)+)', flags)) + nosan_flags = ','.join(re.findall('-fno-sanitize=((?:[a-z]+,?)+)', flags)) + + def set_sanitizer(sanitizer, default, san, nosan): + if sanitizer in san and sanitizer in nosan: + raise RuntimeError('-fno-sanitize={s} and -fsanitize={s} passed'. + format(s=sanitizer)) + if sanitizer in san: + return True + if sanitizer in nosan: + return False + return default + + san = set(san_flags.split(',')) + nosan = set(nosan_flags.split(',')) + + args.asan = set_sanitizer('address', args.asan, san, nosan) + args.msan = set_sanitizer('memory', args.msan, san, nosan) + args.ubsan = set_sanitizer('undefined', args.ubsan, san, nosan) + + args.sanitize = args.asan or args.msan or args.ubsan + + return args + + +def compiler_version(cc, cxx): + """ + Determines the compiler and version. + Only works for clang and gcc. + """ + cc_version_bytes = subprocess.check_output([cc, "--version"]) + cxx_version_bytes = subprocess.check_output([cxx, "--version"]) + if cc_version_bytes.startswith(b'clang'): + assert(cxx_version_bytes.startswith(b'clang')) + compiler = 'clang' + if cc_version_bytes.startswith(b'gcc'): + assert(cxx_version_bytes.startswith(b'g++')) + compiler = 'gcc' + version_regex = b'([0-9])+\.([0-9])+\.([0-9])+' + version_match = re.search(version_regex, cc_version_bytes) + version = tuple(int(version_match.group(i)) for i in range(1, 4)) + return compiler, version + + +def overflow_ubsan_flags(cc, cxx): + compiler, version = compiler_version(cc, cxx) + if compiler == 'gcc': + return ['-fno-sanitize=signed-integer-overflow'] + if compiler == 'clang' and version >= (5, 0, 0): + return ['-fno-sanitize=pointer-overflow'] + return [] + + +def build_parser(args): + description = """ + Cleans the repository and builds a fuzz target (or all). + Many flags default to environment variables (default says $X='y'). + Options that aren't enabling features default to the correct values for + zstd. + Enable sanitizers with --enable-*san. + For regression testing just build. + For libFuzzer set LIB_FUZZING_ENGINE and pass --enable-coverage. + For AFL set CC and CXX to AFL's compilers and set + LIB_FUZZING_ENGINE='libregression.a'. + """ + parser = argparse.ArgumentParser(prog=args.pop(0), description=description) + parser.add_argument( + '--lib-fuzzing-engine', + dest='lib_fuzzing_engine', + type=str, + default=LIB_FUZZING_ENGINE, + help=('The fuzzing engine to use e.g. /path/to/libFuzzer.a ' + "(default: $LIB_FUZZING_ENGINE='{})".format(LIB_FUZZING_ENGINE))) + parser.add_argument( + '--enable-coverage', + dest='coverage', + action='store_true', + help='Enable coverage instrumentation (-fsanitize-coverage)') + parser.add_argument( + '--enable-asan', dest='asan', action='store_true', help='Enable UBSAN') + parser.add_argument( + '--enable-ubsan', + dest='ubsan', + action='store_true', + help='Enable UBSAN') + parser.add_argument( + '--enable-ubsan-pointer-overflow', + dest='ubsan_pointer_overflow', + action='store_true', + help='Enable UBSAN pointer overflow check (known failure)') + parser.add_argument( + '--enable-msan', dest='msan', action='store_true', help='Enable MSAN') + parser.add_argument( + '--enable-msan-track-origins', dest='msan_track_origins', + action='store_true', help='Enable MSAN origin tracking') + parser.add_argument( + '--msan-extra-cppflags', + dest='msan_extra_cppflags', + type=str, + default=MSAN_EXTRA_CPPFLAGS, + help="Extra CPPFLAGS for MSAN (default: $MSAN_EXTRA_CPPFLAGS='{}')". + format(MSAN_EXTRA_CPPFLAGS)) + parser.add_argument( + '--msan-extra-cflags', + dest='msan_extra_cflags', + type=str, + default=MSAN_EXTRA_CFLAGS, + help="Extra CFLAGS for MSAN (default: $MSAN_EXTRA_CFLAGS='{}')".format( + MSAN_EXTRA_CFLAGS)) + parser.add_argument( + '--msan-extra-cxxflags', + dest='msan_extra_cxxflags', + type=str, + default=MSAN_EXTRA_CXXFLAGS, + help="Extra CXXFLAGS for MSAN (default: $MSAN_EXTRA_CXXFLAGS='{}')". + format(MSAN_EXTRA_CXXFLAGS)) + parser.add_argument( + '--msan-extra-ldflags', + dest='msan_extra_ldflags', + type=str, + default=MSAN_EXTRA_LDFLAGS, + help="Extra LDFLAGS for MSAN (default: $MSAN_EXTRA_LDFLAGS='{}')". + format(MSAN_EXTRA_LDFLAGS)) + parser.add_argument( + '--enable-sanitize-recover', + dest='sanitize_recover', + action='store_true', + help='Non-fatal sanitizer errors where possible') + parser.add_argument( + '--debug', + dest='debug', + type=int, + default=1, + help='Set ZSTD_DEBUG (default: 1)') + parser.add_argument( + '--force-memory-access', + dest='memory_access', + type=int, + default=0, + help='Set MEM_FORCE_MEMORY_ACCESS (default: 0)') + parser.add_argument( + '--fuzz-rng-seed-size', + dest='fuzz_rng_seed_size', + type=int, + default=4, + help='Set FUZZ_RNG_SEED_SIZE (default: 4)') + parser.add_argument( + '--disable-fuzzing-mode', + dest='fuzzing_mode', + action='store_false', + help='Do not define FUZZING_BUILD_MORE_UNSAFE_FOR_PRODUCTION') + parser.add_argument( + '--enable-stateful-fuzzing', + dest='stateful_fuzzing', + action='store_true', + help='Reuse contexts between runs (makes reproduction impossible)') + parser.add_argument( + '--cc', + dest='cc', + type=str, + default=CC, + help="CC (default: $CC='{}')".format(CC)) + parser.add_argument( + '--cxx', + dest='cxx', + type=str, + default=CXX, + help="CXX (default: $CXX='{}')".format(CXX)) + parser.add_argument( + '--cppflags', + dest='cppflags', + type=str, + default=CPPFLAGS, + help="CPPFLAGS (default: $CPPFLAGS='{}')".format(CPPFLAGS)) + parser.add_argument( + '--cflags', + dest='cflags', + type=str, + default=CFLAGS, + help="CFLAGS (default: $CFLAGS='{}')".format(CFLAGS)) + parser.add_argument( + '--cxxflags', + dest='cxxflags', + type=str, + default=CXXFLAGS, + help="CXXFLAGS (default: $CXXFLAGS='{}')".format(CXXFLAGS)) + parser.add_argument( + '--ldflags', + dest='ldflags', + type=str, + default=LDFLAGS, + help="LDFLAGS (default: $LDFLAGS='{}')".format(LDFLAGS)) + parser.add_argument( + '--mflags', + dest='mflags', + type=str, + default=MFLAGS, + help="Extra Make flags (default: $MFLAGS='{}')".format(MFLAGS)) + parser.add_argument( + 'TARGET', + nargs='*', + type=str, + help='Fuzz target(s) to build {{{}}}'.format(', '.join(ALL_TARGETS)) + ) + args = parser.parse_args(args) + args = parse_env_flags(args, ' '.join( + [args.cppflags, args.cflags, args.cxxflags, args.ldflags])) + + # Check option sanitiy + if args.msan and (args.asan or args.ubsan): + raise RuntimeError('MSAN may not be used with any other sanitizers') + if args.msan_track_origins and not args.msan: + raise RuntimeError('--enable-msan-track-origins requires MSAN') + if args.ubsan_pointer_overflow and not args.ubsan: + raise RuntimeError('--enable-ubsan-pointer-overlow requires UBSAN') + if args.sanitize_recover and not args.sanitize: + raise RuntimeError('--enable-sanitize-recover but no sanitizers used') + + return args + + +def build(args): + try: + args = build_parser(args) + except Exception as e: + print(e) + return 1 + # The compilation flags we are setting + targets = args.TARGET + cc = args.cc + cxx = args.cxx + cppflags = [args.cppflags] + cflags = [args.cflags] + ldflags = [args.ldflags] + cxxflags = [args.cxxflags] + mflags = [args.mflags] if args.mflags else [] + # Flags to be added to both cflags and cxxflags + common_flags = [] + + cppflags += [ + '-DZSTD_DEBUG={}'.format(args.debug), + '-DMEM_FORCE_MEMORY_ACCESS={}'.format(args.memory_access), + '-DFUZZ_RNG_SEED_SIZE={}'.format(args.fuzz_rng_seed_size), + ] + + mflags += ['LIB_FUZZING_ENGINE={}'.format(args.lib_fuzzing_engine)] + + # Set flags for options + if args.coverage: + common_flags += [ + '-fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp' + ] + + if args.sanitize_recover: + recover_flags = ['-fsanitize-recover=all'] + else: + recover_flags = ['-fno-sanitize-recover=all'] + if args.sanitize: + common_flags += recover_flags + + if args.msan: + msan_flags = ['-fsanitize=memory'] + if args.msan_track_origins: + msan_flags += ['-fsanitize-memory-track-origins'] + common_flags += msan_flags + # Append extra MSAN flags (it might require special setup) + cppflags += [args.msan_extra_cppflags] + cflags += [args.msan_extra_cflags] + cxxflags += [args.msan_extra_cxxflags] + ldflags += [args.msan_extra_ldflags] + + if args.asan: + common_flags += ['-fsanitize=address'] + + if args.ubsan: + ubsan_flags = ['-fsanitize=undefined'] + if not args.ubsan_pointer_overflow: + ubsan_flags += overflow_ubsan_flags(cc, cxx) + common_flags += ubsan_flags + + if args.stateful_fuzzing: + cppflags += ['-DSTATEFUL_FUZZING'] + + if args.fuzzing_mode: + cppflags += ['-DFUZZING_BUILD_MORE_UNSAFE_FOR_PRODUCTION'] + + if args.lib_fuzzing_engine == 'libregression.a': + targets = ['libregression.a'] + targets + + # Append the common flags + cflags += common_flags + cxxflags += common_flags + + # Prepare the flags for Make + cc_str = "CC={}".format(cc) + cxx_str = "CXX={}".format(cxx) + cppflags_str = "CPPFLAGS={}".format(' '.join(cppflags)) + cflags_str = "CFLAGS={}".format(' '.join(cflags)) + cxxflags_str = "CXXFLAGS={}".format(' '.join(cxxflags)) + ldflags_str = "LDFLAGS={}".format(' '.join(ldflags)) + + # Print the flags + print('MFLAGS={}'.format(' '.join(mflags))) + print(cc_str) + print(cxx_str) + print(cppflags_str) + print(cflags_str) + print(cxxflags_str) + print(ldflags_str) + + # Clean and build + clean_cmd = ['make', 'clean'] + mflags + print(' '.join(clean_cmd)) + subprocess.check_call(clean_cmd) + build_cmd = [ + 'make', + cc_str, + cxx_str, + cppflags_str, + cflags_str, + cxxflags_str, + ldflags_str, + ] + mflags + targets + print(' '.join(build_cmd)) + subprocess.check_call(build_cmd) + return 0 + + +def libfuzzer_parser(args): + description = """ + Runs a libfuzzer binary. + Passes all extra arguments to libfuzzer. + The fuzzer should have been build with LIB_FUZZING_ENGINE pointing to + libFuzzer.a. + Generates output in the CORPORA directory, puts crashes in the ARTIFACT + directory, and takes extra input from the SEED directory. + To merge AFL's output pass the SEED as AFL's output directory and pass + '-merge=1'. + """ + parser = argparse.ArgumentParser(prog=args.pop(0), description=description) + parser.add_argument( + '--corpora', + type=str, + help='Override the default corpora dir (default: {})'.format( + abs_join(CORPORA_DIR, 'TARGET'))) + parser.add_argument( + '--artifact', + type=str, + help='Override the default artifact dir (default: {})'.format( + abs_join(CORPORA_DIR, 'TARGET-crash'))) + parser.add_argument( + '--seed', + type=str, + help='Override the default seed dir (default: {})'.format( + abs_join(CORPORA_DIR, 'TARGET-seed'))) + parser.add_argument( + 'TARGET', + type=str, + help='Fuzz target(s) to build {{{}}}'.format(', '.join(TARGETS))) + args, extra = parser.parse_known_args(args) + args.extra = extra + + if args.TARGET and args.TARGET not in TARGETS: + raise RuntimeError('{} is not a valid target'.format(args.TARGET)) + + return args + + +def libfuzzer(target, corpora=None, artifact=None, seed=None, extra_args=None): + if corpora is None: + corpora = abs_join(CORPORA_DIR, target) + if artifact is None: + artifact = abs_join(CORPORA_DIR, '{}-crash'.format(target)) + if seed is None: + seed = abs_join(CORPORA_DIR, '{}-seed'.format(target)) + if extra_args is None: + extra_args = [] + + target = abs_join(FUZZ_DIR, target) + + corpora = [create(corpora)] + artifact = create(artifact) + seed = check(seed) + + corpora += [artifact] + if seed is not None: + corpora += [seed] + + cmd = [target, '-artifact_prefix={}/'.format(artifact)] + cmd += corpora + extra_args + print(' '.join(cmd)) + subprocess.check_call(cmd) + + +def libfuzzer_cmd(args): + try: + args = libfuzzer_parser(args) + except Exception as e: + print(e) + return 1 + libfuzzer(args.TARGET, args.corpora, args.artifact, args.seed, args.extra) + return 0 + + +def afl_parser(args): + description = """ + Runs an afl-fuzz job. + Passes all extra arguments to afl-fuzz. + The fuzzer should have been built with CC/CXX set to the AFL compilers, + and with LIB_FUZZING_ENGINE='libregression.a'. + Takes input from CORPORA and writes output to OUTPUT. + Uses AFL_FUZZ as the binary (set from flag or environment variable). + """ + parser = argparse.ArgumentParser(prog=args.pop(0), description=description) + parser.add_argument( + '--corpora', + type=str, + help='Override the default corpora dir (default: {})'.format( + abs_join(CORPORA_DIR, 'TARGET'))) + parser.add_argument( + '--output', + type=str, + help='Override the default AFL output dir (default: {})'.format( + abs_join(CORPORA_DIR, 'TARGET-afl'))) + parser.add_argument( + '--afl-fuzz', + type=str, + default=AFL_FUZZ, + help='AFL_FUZZ (default: $AFL_FUZZ={})'.format(AFL_FUZZ)) + parser.add_argument( + 'TARGET', + type=str, + help='Fuzz target(s) to build {{{}}}'.format(', '.join(TARGETS))) + args, extra = parser.parse_known_args(args) + args.extra = extra + + if args.TARGET and args.TARGET not in TARGETS: + raise RuntimeError('{} is not a valid target'.format(args.TARGET)) + + if not args.corpora: + args.corpora = abs_join(CORPORA_DIR, args.TARGET) + if not args.output: + args.output = abs_join(CORPORA_DIR, '{}-afl'.format(args.TARGET)) + + return args + + +def afl(args): + try: + args = afl_parser(args) + except Exception as e: + print(e) + return 1 + target = abs_join(FUZZ_DIR, args.TARGET) + + corpora = create(args.corpora) + output = create(args.output) + + cmd = [args.afl_fuzz, '-i', corpora, '-o', output] + args.extra + cmd += [target, '@@'] + print(' '.join(cmd)) + subprocess.call(cmd) + return 0 + + +def regression(args): + try: + description = """ + Runs one or more regression tests. + The fuzzer should have been built with with + LIB_FUZZING_ENGINE='libregression.a'. + Takes input from CORPORA. + """ + args = targets_parser(args, description) + except Exception as e: + print(e) + return 1 + for target in args.TARGET: + corpora = create(abs_join(CORPORA_DIR, target)) + target = abs_join(FUZZ_DIR, target) + cmd = [target, corpora] + print(' '.join(cmd)) + subprocess.check_call(cmd) + return 0 + + +def gen_parser(args): + description = """ + Generate a seed corpus appropiate for TARGET with data generated with + decodecorpus. + The fuzz inputs are prepended with a seed before the zstd data, so the + output of decodecorpus shouldn't be used directly. + Generates NUMBER samples prepended with FUZZ_RNG_SEED_SIZE random bytes and + puts the output in SEED. + DECODECORPUS is the decodecorpus binary, and must already be built. + """ + parser = argparse.ArgumentParser(prog=args.pop(0), description=description) + parser.add_argument( + '--number', + '-n', + type=int, + default=100, + help='Number of samples to generate') + parser.add_argument( + '--max-size-log', + type=int, + default=13, + help='Maximum sample size to generate') + parser.add_argument( + '--seed', + type=str, + help='Override the default seed dir (default: {})'.format( + abs_join(CORPORA_DIR, 'TARGET-seed'))) + parser.add_argument( + '--decodecorpus', + type=str, + default=DECODECORPUS, + help="decodecorpus binary (default: $DECODECORPUS='{}')".format( + DECODECORPUS)) + parser.add_argument( + '--fuzz-rng-seed-size', + type=int, + default=4, + help="FUZZ_RNG_SEED_SIZE used for generate the samples (must match)" + ) + parser.add_argument( + 'TARGET', + type=str, + help='Fuzz target(s) to build {{{}}}'.format(', '.join(TARGETS))) + args, extra = parser.parse_known_args(args) + args.extra = extra + + if args.TARGET and args.TARGET not in TARGETS: + raise RuntimeError('{} is not a valid target'.format(args.TARGET)) + + if not args.seed: + args.seed = abs_join(CORPORA_DIR, '{}-seed'.format(args.TARGET)) + + if not os.path.isfile(args.decodecorpus): + raise RuntimeError("{} is not a file run 'make -C {} decodecorpus'". + format(args.decodecorpus, abs_join(FUZZ_DIR, '..'))) + + return args + + +def gen(args): + try: + args = gen_parser(args) + except Exception as e: + print(e) + return 1 + + seed = create(args.seed) + with tmpdir() as compressed: + with tmpdir() as decompressed: + cmd = [ + args.decodecorpus, + '-n{}'.format(args.number), + '-p{}/'.format(compressed), + '-o{}'.format(decompressed), + ] + + if 'block_' in args.TARGET: + cmd += [ + '--gen-blocks', + '--max-block-size-log={}'.format(args.max_size_log) + ] + else: + cmd += ['--max-content-size-log={}'.format(args.max_size_log)] + + print(' '.join(cmd)) + subprocess.check_call(cmd) + + if '_round_trip' in args.TARGET: + print('using decompressed data in {}'.format(decompressed)) + samples = decompressed + elif '_decompress' in args.TARGET: + print('using compressed data in {}'.format(compressed)) + samples = compressed + + # Copy the samples over and prepend the RNG seeds + for name in os.listdir(samples): + samplename = abs_join(samples, name) + outname = abs_join(seed, name) + rng_seed = os.urandom(args.fuzz_rng_seed_size) + with open(samplename, 'rb') as sample: + with open(outname, 'wb') as out: + out.write(rng_seed) + CHUNK_SIZE = 131072 + chunk = sample.read(CHUNK_SIZE) + while len(chunk) > 0: + out.write(chunk) + chunk = sample.read(CHUNK_SIZE) + return 0 + + +def minimize(args): + try: + description = """ + Runs a libfuzzer fuzzer with -merge=1 to build a minimal corpus in + TARGET_seed_corpus. All extra args are passed to libfuzzer. + """ + args = targets_parser(args, description) + except Exception as e: + print(e) + return 1 + + for target in args.TARGET: + # Merge the corpus + anything else into the seed_corpus + corpus = abs_join(CORPORA_DIR, target) + seed_corpus = abs_join(CORPORA_DIR, "{}_seed_corpus".format(target)) + extra_args = [corpus, "-merge=1"] + args.extra + libfuzzer(target, corpora=seed_corpus, extra_args=extra_args) + seeds = set(os.listdir(seed_corpus)) + # Copy all crashes directly into the seed_corpus if not already present + crashes = abs_join(CORPORA_DIR, '{}-crash'.format(target)) + for crash in os.listdir(crashes): + if crash not in seeds: + shutil.copy(abs_join(crashes, crash), seed_corpus) + seeds.add(crash) + + +def zip_cmd(args): + try: + description = """ + Zips up the seed corpus. + """ + args = targets_parser(args, description) + except Exception as e: + print(e) + return 1 + + for target in args.TARGET: + # Zip the seed_corpus + seed_corpus = abs_join(CORPORA_DIR, "{}_seed_corpus".format(target)) + seeds = [abs_join(seed_corpus, f) for f in os.listdir(seed_corpus)] + zip_file = "{}.zip".format(seed_corpus) + cmd = ["zip", "-q", "-j", "-9", zip_file] + print(' '.join(cmd + [abs_join(seed_corpus, '*')])) + subprocess.check_call(cmd + seeds) + + +def list_cmd(args): + print("\n".join(TARGETS)) + + +def short_help(args): + name = args[0] + print("Usage: {} [OPTIONS] COMMAND [ARGS]...\n".format(name)) + + +def help(args): + short_help(args) + print("\tfuzzing helpers (select a command and pass -h for help)\n") + print("Options:") + print("\t-h, --help\tPrint this message") + print("") + print("Commands:") + print("\tbuild\t\tBuild a fuzzer") + print("\tlibfuzzer\tRun a libFuzzer fuzzer") + print("\tafl\t\tRun an AFL fuzzer") + print("\tregression\tRun a regression test") + print("\tgen\t\tGenerate a seed corpus for a fuzzer") + print("\tminimize\tMinimize the test corpora") + print("\tzip\t\tZip the minimized corpora up") + print("\tlist\t\tList the available targets") + + +def main(): + args = sys.argv + if len(args) < 2: + help(args) + return 1 + if args[1] == '-h' or args[1] == '--help' or args[1] == '-H': + help(args) + return 1 + command = args.pop(1) + args[0] = "{} {}".format(args[0], command) + if command == "build": + return build(args) + if command == "libfuzzer": + return libfuzzer_cmd(args) + if command == "regression": + return regression(args) + if command == "afl": + return afl(args) + if command == "gen": + return gen(args) + if command == "minimize": + return minimize(args) + if command == "zip": + return zip_cmd(args) + if command == "list": + return list_cmd(args) + short_help(args) + print("Error: No such command {} (pass -h for help)".format(command)) + return 1 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/contrib/zstd/tests/fuzz/fuzz_helpers.h b/sys/contrib/zstd/tests/fuzz/fuzz_helpers.h similarity index 53% rename from contrib/zstd/tests/fuzz/fuzz_helpers.h rename to sys/contrib/zstd/tests/fuzz/fuzz_helpers.h index 5f07fa4de935..468c39fb42d4 100644 --- a/contrib/zstd/tests/fuzz/fuzz_helpers.h +++ b/sys/contrib/zstd/tests/fuzz/fuzz_helpers.h @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ /** @@ -16,8 +16,14 @@ #include "fuzz.h" #include "xxhash.h" +#include "zstd.h" #include #include +#include + +#ifdef __cplusplus +extern "C" { +#endif #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX(a, b) ((a) > (b) ? (a) : (b)) @@ -34,6 +40,8 @@ __LINE__, FUZZ_QUOTE(cond), (msg)), \ abort())) #define FUZZ_ASSERT(cond) FUZZ_ASSERT_MSG((cond), ""); +#define FUZZ_ZASSERT(code) \ + FUZZ_ASSERT_MSG(!ZSTD_isError(code), ZSTD_getErrorName(code)) #if defined(__GNUC__) #define FUZZ_STATIC static __inline __attribute__((unused)) @@ -48,23 +56,37 @@ /** * Determininistically constructs a seed based on the fuzz input. - * Only looks at the first FUZZ_RNG_SEED_SIZE bytes of the input. + * Consumes up to the first FUZZ_RNG_SEED_SIZE bytes of the input. */ -FUZZ_STATIC uint32_t FUZZ_seed(const uint8_t *src, size_t size) { - size_t const toHash = MIN(FUZZ_RNG_SEED_SIZE, size); - return XXH32(src, toHash, 0); +FUZZ_STATIC uint32_t FUZZ_seed(uint8_t const **src, size_t* size) { + uint8_t const *data = *src; + size_t const toHash = MIN(FUZZ_RNG_SEED_SIZE, *size); + *size -= toHash; + *src += toHash; + return XXH32(data, toHash, 0); } #define FUZZ_rotl32(x, r) (((x) << (r)) | ((x) >> (32 - (r)))) + FUZZ_STATIC uint32_t FUZZ_rand(uint32_t *state) { - static const uint32_t prime1 = 2654435761U; - static const uint32_t prime2 = 2246822519U; - uint32_t rand32 = *state; - rand32 *= prime1; - rand32 += prime2; - rand32 = FUZZ_rotl32(rand32, 13); - *state = rand32; - return rand32 >> 5; + static const uint32_t prime1 = 2654435761U; + static const uint32_t prime2 = 2246822519U; + uint32_t rand32 = *state; + rand32 *= prime1; + rand32 += prime2; + rand32 = FUZZ_rotl32(rand32, 13); + *state = rand32; + return rand32 >> 5; } +/* Returns a random numer in the range [min, max]. */ +FUZZ_STATIC uint32_t FUZZ_rand32(uint32_t *state, uint32_t min, uint32_t max) { + uint32_t random = FUZZ_rand(state); + return min + (random % (max - min + 1)); +} + +#ifdef __cplusplus +} +#endif + #endif diff --git a/contrib/zstd/tests/fuzz/regression_driver.c b/sys/contrib/zstd/tests/fuzz/regression_driver.c similarity index 80% rename from contrib/zstd/tests/fuzz/regression_driver.c rename to sys/contrib/zstd/tests/fuzz/regression_driver.c index eee5f0a2a2b2..2b714d29e9dd 100644 --- a/contrib/zstd/tests/fuzz/regression_driver.c +++ b/sys/contrib/zstd/tests/fuzz/regression_driver.c @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "fuzz.h" @@ -29,9 +29,11 @@ int main(int argc, char const **argv) { #ifdef UTIL_HAS_CREATEFILELIST files = UTIL_createFileList(files, numFiles, &fileNamesBuf, &numFiles, kFollowLinks); - FUZZ_ASSERT(files); + if (!files) + numFiles = 0; #endif - + if (numFiles == 0) + fprintf(stderr, "WARNING: No files passed to %s\n", argv[0]); for (i = 0; i < numFiles; ++i) { char const *fileName = files[i]; size_t const fileSize = UTIL_getFileSize(fileName); @@ -39,7 +41,7 @@ int main(int argc, char const **argv) { FILE *file; /* Check that it is a regular file, and that the fileSize is valid */ - FUZZ_ASSERT_MSG(UTIL_isRegFile(fileName), fileName); + FUZZ_ASSERT_MSG(UTIL_isRegularFile(fileName), fileName); FUZZ_ASSERT_MSG(fileSize <= kMaxFileSize, fileName); /* Ensure we have a large enough buffer allocated */ if (fileSize > bufferSize) { diff --git a/contrib/zstd/tests/fuzz/simple_decompress.c b/sys/contrib/zstd/tests/fuzz/simple_decompress.c similarity index 68% rename from contrib/zstd/tests/fuzz/simple_decompress.c rename to sys/contrib/zstd/tests/fuzz/simple_decompress.c index c22ad7c5301c..bba272c62256 100644 --- a/contrib/zstd/tests/fuzz/simple_decompress.c +++ b/sys/contrib/zstd/tests/fuzz/simple_decompress.c @@ -1,10 +1,10 @@ -/** - * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. +/* + * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ /** @@ -24,7 +24,10 @@ static size_t bufSize = 0; int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size) { - size_t const neededBufSize = MAX(20 * size, (size_t)256 << 10); + size_t neededBufSize; + + FUZZ_seed(&src, &size); + neededBufSize = MAX(20 * size, (size_t)256 << 10); /* Allocate all buffers and contexts if not already allocated */ if (neededBufSize > bufSize) { @@ -39,7 +42,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size) } ZSTD_decompressDCtx(dctx, rBuf, neededBufSize, src, size); -#ifndef STATEFULL_FUZZING +#ifndef STATEFUL_FUZZING ZSTD_freeDCtx(dctx); dctx = NULL; #endif return 0; diff --git a/sys/contrib/zstd/tests/fuzz/simple_round_trip.c b/sys/contrib/zstd/tests/fuzz/simple_round_trip.c new file mode 100644 index 000000000000..0921106dea8e --- /dev/null +++ b/sys/contrib/zstd/tests/fuzz/simple_round_trip.c @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + */ + +/** + * This fuzz target performs a zstd round-trip test (compress & decompress), + * compares the result with the original, and calls abort() on corruption. + */ + +#define ZSTD_STATIC_LINKING_ONLY + +#include +#include +#include +#include +#include "fuzz_helpers.h" +#include "zstd_helpers.h" + +static const int kMaxClevel = 19; + +static ZSTD_CCtx *cctx = NULL; +static ZSTD_DCtx *dctx = NULL; +static void* cBuf = NULL; +static void* rBuf = NULL; +static size_t bufSize = 0; +static uint32_t seed; + +static size_t roundTripTest(void *result, size_t resultCapacity, + void *compressed, size_t compressedCapacity, + const void *src, size_t srcSize) +{ + size_t cSize; + if (FUZZ_rand(&seed) & 1) { + ZSTD_inBuffer in = {src, srcSize, 0}; + ZSTD_outBuffer out = {compressed, compressedCapacity, 0}; + size_t err; + + ZSTD_CCtx_reset(cctx); + FUZZ_setRandomParameters(cctx, srcSize, &seed); + err = ZSTD_compress_generic(cctx, &out, &in, ZSTD_e_end); + FUZZ_ZASSERT(err); + FUZZ_ASSERT(err == 0); + cSize = out.pos; + } else { + int const cLevel = FUZZ_rand(&seed) % kMaxClevel; + cSize = ZSTD_compressCCtx( + cctx, compressed, compressedCapacity, src, srcSize, cLevel); + } + FUZZ_ZASSERT(cSize); + return ZSTD_decompressDCtx(dctx, result, resultCapacity, compressed, cSize); +} + +int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size) +{ + size_t neededBufSize; + + seed = FUZZ_seed(&src, &size); + neededBufSize = ZSTD_compressBound(size); + + /* Allocate all buffers and contexts if not already allocated */ + if (neededBufSize > bufSize) { + free(cBuf); + free(rBuf); + cBuf = malloc(neededBufSize); + rBuf = malloc(neededBufSize); + bufSize = neededBufSize; + FUZZ_ASSERT(cBuf && rBuf); + } + if (!cctx) { + cctx = ZSTD_createCCtx(); + FUZZ_ASSERT(cctx); + } + if (!dctx) { + dctx = ZSTD_createDCtx(); + FUZZ_ASSERT(dctx); + } + + { + size_t const result = + roundTripTest(rBuf, neededBufSize, cBuf, neededBufSize, src, size); + FUZZ_ZASSERT(result); + FUZZ_ASSERT_MSG(result == size, "Incorrect regenerated size"); + FUZZ_ASSERT_MSG(!memcmp(src, rBuf, size), "Corruption!"); + } +#ifndef STATEFUL_FUZZING + ZSTD_freeCCtx(cctx); cctx = NULL; + ZSTD_freeDCtx(dctx); dctx = NULL; +#endif + return 0; +} diff --git a/contrib/zstd/tests/fuzz/stream_decompress.c b/sys/contrib/zstd/tests/fuzz/stream_decompress.c similarity index 81% rename from contrib/zstd/tests/fuzz/stream_decompress.c rename to sys/contrib/zstd/tests/fuzz/stream_decompress.c index 778a426dec7c..7ad571221dff 100644 --- a/contrib/zstd/tests/fuzz/stream_decompress.c +++ b/sys/contrib/zstd/tests/fuzz/stream_decompress.c @@ -1,10 +1,10 @@ -/** - * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. +/* + * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ /** @@ -20,7 +20,7 @@ #include "fuzz_helpers.h" #include "zstd.h" -static size_t const kBufSize = ZSTD_BLOCKSIZE_ABSOLUTEMAX; +static size_t const kBufSize = ZSTD_BLOCKSIZE_MAX; static ZSTD_DStream *dstream = NULL; static void* buf = NULL; @@ -51,7 +51,7 @@ static ZSTD_inBuffer makeInBuffer(const uint8_t **src, size_t *size) int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size) { - seed = FUZZ_seed(src, size); + seed = FUZZ_seed(&src, &size); /* Allocate all buffers and contexts if not already allocated */ if (!buf) { @@ -78,7 +78,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size) } error: -#ifndef STATEFULL_FUZZING +#ifndef STATEFUL_FUZZING ZSTD_freeDStream(dstream); dstream = NULL; #endif return 0; diff --git a/sys/contrib/zstd/tests/fuzz/stream_round_trip.c b/sys/contrib/zstd/tests/fuzz/stream_round_trip.c new file mode 100644 index 000000000000..72d70495f836 --- /dev/null +++ b/sys/contrib/zstd/tests/fuzz/stream_round_trip.c @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + */ + +/** + * This fuzz target performs a zstd round-trip test (compress & decompress), + * compares the result with the original, and calls abort() on corruption. + */ + +#define ZSTD_STATIC_LINKING_ONLY + +#include +#include +#include +#include +#include "fuzz_helpers.h" +#include "zstd_helpers.h" + +ZSTD_CCtx *cctx = NULL; +static ZSTD_DCtx *dctx = NULL; +static uint8_t* cBuf = NULL; +static uint8_t* rBuf = NULL; +static size_t bufSize = 0; +static uint32_t seed; + +static ZSTD_outBuffer makeOutBuffer(uint8_t *dst, size_t capacity) +{ + ZSTD_outBuffer buffer = { dst, 0, 0 }; + + FUZZ_ASSERT(capacity > 0); + buffer.size = (FUZZ_rand(&seed) % capacity) + 1; + FUZZ_ASSERT(buffer.size <= capacity); + + return buffer; +} + +static ZSTD_inBuffer makeInBuffer(const uint8_t **src, size_t *size) +{ + ZSTD_inBuffer buffer = { *src, 0, 0 }; + + FUZZ_ASSERT(*size > 0); + buffer.size = (FUZZ_rand(&seed) % *size) + 1; + FUZZ_ASSERT(buffer.size <= *size); + *src += buffer.size; + *size -= buffer.size; + + return buffer; +} + +static size_t compress(uint8_t *dst, size_t capacity, + const uint8_t *src, size_t srcSize) +{ + size_t dstSize = 0; + ZSTD_CCtx_reset(cctx); + FUZZ_setRandomParameters(cctx, srcSize, &seed); + + while (srcSize > 0) { + ZSTD_inBuffer in = makeInBuffer(&src, &srcSize); + /* Mode controls the action. If mode == -1 we pick a new mode */ + int mode = -1; + while (in.pos < in.size) { + ZSTD_outBuffer out = makeOutBuffer(dst, capacity); + /* Previous action finished, pick a new mode. */ + if (mode == -1) mode = FUZZ_rand(&seed) % 10; + switch (mode) { + case 0: /* fall-though */ + case 1: /* fall-though */ + case 2: { + size_t const ret = + ZSTD_compress_generic(cctx, &out, &in, ZSTD_e_flush); + FUZZ_ZASSERT(ret); + if (ret == 0) + mode = -1; + break; + } + case 3: { + size_t ret = + ZSTD_compress_generic(cctx, &out, &in, ZSTD_e_end); + FUZZ_ZASSERT(ret); + /* Reset the compressor when the frame is finished */ + if (ret == 0) { + ZSTD_CCtx_reset(cctx); + if ((FUZZ_rand(&seed) & 7) == 0) { + size_t const remaining = in.size - in.pos; + FUZZ_setRandomParameters(cctx, remaining, &seed); + } + mode = -1; + } + break; + } + default: { + size_t const ret = + ZSTD_compress_generic(cctx, &out, &in, ZSTD_e_continue); + FUZZ_ZASSERT(ret); + mode = -1; + } + } + dst += out.pos; + dstSize += out.pos; + capacity -= out.pos; + } + } + for (;;) { + ZSTD_inBuffer in = {NULL, 0, 0}; + ZSTD_outBuffer out = makeOutBuffer(dst, capacity); + size_t const ret = ZSTD_compress_generic(cctx, &out, &in, ZSTD_e_end); + FUZZ_ZASSERT(ret); + + dst += out.pos; + dstSize += out.pos; + capacity -= out.pos; + if (ret == 0) + break; + } + return dstSize; +} + +int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size) +{ + size_t neededBufSize; + + seed = FUZZ_seed(&src, &size); + neededBufSize = ZSTD_compressBound(size) * 2; + + /* Allocate all buffers and contexts if not already allocated */ + if (neededBufSize > bufSize) { + free(cBuf); + free(rBuf); + cBuf = (uint8_t*)malloc(neededBufSize); + rBuf = (uint8_t*)malloc(neededBufSize); + bufSize = neededBufSize; + FUZZ_ASSERT(cBuf && rBuf); + } + if (!cctx) { + cctx = ZSTD_createCCtx(); + FUZZ_ASSERT(cctx); + } + if (!dctx) { + dctx = ZSTD_createDCtx(); + FUZZ_ASSERT(dctx); + } + + { + size_t const cSize = compress(cBuf, neededBufSize, src, size); + size_t const rSize = + ZSTD_decompressDCtx(dctx, rBuf, neededBufSize, cBuf, cSize); + FUZZ_ZASSERT(rSize); + FUZZ_ASSERT_MSG(rSize == size, "Incorrect regenerated size"); + FUZZ_ASSERT_MSG(!memcmp(src, rBuf, size), "Corruption!"); + } + +#ifndef STATEFUL_FUZZING + ZSTD_freeCCtx(cctx); cctx = NULL; + ZSTD_freeDCtx(dctx); dctx = NULL; +#endif + return 0; +} diff --git a/sys/contrib/zstd/tests/fuzz/zstd_helpers.c b/sys/contrib/zstd/tests/fuzz/zstd_helpers.c new file mode 100644 index 000000000000..602898479bc2 --- /dev/null +++ b/sys/contrib/zstd/tests/fuzz/zstd_helpers.c @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + */ + +#define ZSTD_STATIC_LINKING_ONLY + +#include "zstd_helpers.h" +#include "fuzz_helpers.h" +#include "zstd.h" + +static void set(ZSTD_CCtx *cctx, ZSTD_cParameter param, unsigned value) +{ + FUZZ_ZASSERT(ZSTD_CCtx_setParameter(cctx, param, value)); +} + +static void setRand(ZSTD_CCtx *cctx, ZSTD_cParameter param, unsigned min, + unsigned max, uint32_t *state) { + unsigned const value = FUZZ_rand32(state, min, max); + set(cctx, param, value); +} + +ZSTD_compressionParameters FUZZ_randomCParams(size_t srcSize, uint32_t *state) +{ + /* Select compression parameters */ + ZSTD_compressionParameters cParams; + cParams.windowLog = FUZZ_rand32(state, ZSTD_WINDOWLOG_MIN, 15); + cParams.hashLog = FUZZ_rand32(state, ZSTD_HASHLOG_MIN, 15); + cParams.chainLog = FUZZ_rand32(state, ZSTD_CHAINLOG_MIN, 16); + cParams.searchLog = FUZZ_rand32(state, ZSTD_SEARCHLOG_MIN, 9); + cParams.searchLength = FUZZ_rand32(state, ZSTD_SEARCHLENGTH_MIN, + ZSTD_SEARCHLENGTH_MAX); + cParams.targetLength = FUZZ_rand32(state, ZSTD_TARGETLENGTH_MIN, + ZSTD_TARGETLENGTH_MAX); + cParams.strategy = FUZZ_rand32(state, ZSTD_fast, ZSTD_btultra); + return ZSTD_adjustCParams(cParams, srcSize, 0); +} + +ZSTD_frameParameters FUZZ_randomFParams(uint32_t *state) +{ + /* Select frame parameters */ + ZSTD_frameParameters fParams; + fParams.contentSizeFlag = FUZZ_rand32(state, 0, 1); + fParams.checksumFlag = FUZZ_rand32(state, 0, 1); + fParams.noDictIDFlag = FUZZ_rand32(state, 0, 1); + return fParams; +} + +ZSTD_parameters FUZZ_randomParams(size_t srcSize, uint32_t *state) +{ + ZSTD_parameters params; + params.cParams = FUZZ_randomCParams(srcSize, state); + params.fParams = FUZZ_randomFParams(state); + return params; +} + +void FUZZ_setRandomParameters(ZSTD_CCtx *cctx, size_t srcSize, uint32_t *state) +{ + ZSTD_compressionParameters cParams = FUZZ_randomCParams(srcSize, state); + set(cctx, ZSTD_p_windowLog, cParams.windowLog); + set(cctx, ZSTD_p_hashLog, cParams.hashLog); + set(cctx, ZSTD_p_chainLog, cParams.chainLog); + set(cctx, ZSTD_p_searchLog, cParams.searchLog); + set(cctx, ZSTD_p_minMatch, cParams.searchLength); + set(cctx, ZSTD_p_targetLength, cParams.targetLength); + set(cctx, ZSTD_p_compressionStrategy, cParams.strategy); + /* Select frame parameters */ + setRand(cctx, ZSTD_p_contentSizeFlag, 0, 1, state); + setRand(cctx, ZSTD_p_checksumFlag, 0, 1, state); + setRand(cctx, ZSTD_p_dictIDFlag, 0, 1, state); + /* Select long distance matchig parameters */ + setRand(cctx, ZSTD_p_enableLongDistanceMatching, 0, 1, state); + setRand(cctx, ZSTD_p_ldmHashLog, ZSTD_HASHLOG_MIN, 16, state); + setRand(cctx, ZSTD_p_ldmMinMatch, ZSTD_LDM_MINMATCH_MIN, + ZSTD_LDM_MINMATCH_MAX, state); + setRand(cctx, ZSTD_p_ldmBucketSizeLog, 0, ZSTD_LDM_BUCKETSIZELOG_MAX, + state); + setRand(cctx, ZSTD_p_ldmHashEveryLog, 0, + ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN, state); +} diff --git a/sys/contrib/zstd/tests/fuzz/zstd_helpers.h b/sys/contrib/zstd/tests/fuzz/zstd_helpers.h new file mode 100644 index 000000000000..3856bebecf7e --- /dev/null +++ b/sys/contrib/zstd/tests/fuzz/zstd_helpers.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + */ + +/** + * Helper functions for fuzzing. + */ + +#ifndef ZSTD_HELPERS_H +#define ZSTD_HELPERS_H + +#include "zstd.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void FUZZ_setRandomParameters(ZSTD_CCtx *cctx, size_t srcSize, uint32_t *state); + +ZSTD_compressionParameters FUZZ_randomCParams(size_t srcSize, uint32_t *state); +ZSTD_frameParameters FUZZ_randomFParams(uint32_t *state); +ZSTD_parameters FUZZ_randomParams(size_t srcSize, uint32_t *state); + + +#ifdef __cplusplus +} +#endif + +#endif /* ZSTD_HELPERS_H */ diff --git a/contrib/zstd/tests/fuzzer.c b/sys/contrib/zstd/tests/fuzzer.c similarity index 94% rename from contrib/zstd/tests/fuzzer.c rename to sys/contrib/zstd/tests/fuzzer.c index 0c13a6e488ad..76df77af9015 100644 --- a/contrib/zstd/tests/fuzzer.c +++ b/sys/contrib/zstd/tests/fuzzer.c @@ -1,10 +1,11 @@ /* - * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * Copyright (c) 2015-present, Yann Collet, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ @@ -509,8 +510,7 @@ static int basicUnitTests(U32 seed, double compressibility) /* only use the first half so we don't push against size limit of compressedBuffer */ size_t const segSize = (CNBuffSize / 2) / segs; for (i = 0; i < segs; i++) { - CHECK_V(r, - ZSTD_compress( + CHECK_V(r, ZSTD_compress( (BYTE *)compressedBuffer + off, CNBuffSize - off, (BYTE *)CNBuffer + segSize * i, segSize, 5)); @@ -598,10 +598,10 @@ static int basicUnitTests(U32 seed, double compressibility) } DISPLAYLEVEL(4, "test%3i : decompress with static DDict : ", testNb++); - { size_t const ddictBufferSize = ZSTD_estimateDDictSize(dictSize, 0); + { size_t const ddictBufferSize = ZSTD_estimateDDictSize(dictSize, ZSTD_dlm_byCopy); void* ddictBuffer = malloc(ddictBufferSize); if (ddictBuffer == NULL) goto _output_error; - { ZSTD_DDict* const ddict = ZSTD_initStaticDDict(ddictBuffer, ddictBufferSize, CNBuffer, dictSize, 0); + { ZSTD_DDict* const ddict = ZSTD_initStaticDDict(ddictBuffer, ddictBufferSize, CNBuffer, dictSize, ZSTD_dlm_byCopy); size_t const r = ZSTD_decompress_usingDDict(dctx, decodedBuffer, CNBuffSize, compressedBuffer, cSize, ddict); if (r != CNBuffSize - dictSize) goto _output_error; } @@ -687,14 +687,14 @@ static int basicUnitTests(U32 seed, double compressibility) DISPLAYLEVEL(4, "test%3i : estimate CDict size : ", testNb++); { ZSTD_compressionParameters const cParams = ZSTD_getCParams(1, CNBuffSize, dictSize); - size_t const estimatedSize = ZSTD_estimateCDictSize_advanced(dictSize, cParams, 1 /*byReference*/); + size_t const estimatedSize = ZSTD_estimateCDictSize_advanced(dictSize, cParams, ZSTD_dlm_byRef); DISPLAYLEVEL(4, "OK : %u \n", (U32)estimatedSize); } DISPLAYLEVEL(4, "test%3i : compress with CDict ", testNb++); { ZSTD_compressionParameters const cParams = ZSTD_getCParams(1, CNBuffSize, dictSize); ZSTD_CDict* const cdict = ZSTD_createCDict_advanced(dictBuffer, dictSize, - 1 /* byReference */, ZSTD_dm_auto, + ZSTD_dlm_byRef, ZSTD_dm_auto, cParams, ZSTD_defaultCMem); DISPLAYLEVEL(4, "(size : %u) : ", (U32)ZSTD_sizeof_CDict(cdict)); cSize = ZSTD_compress_usingCDict(cctx, compressedBuffer, compressedBufferSize, @@ -720,12 +720,12 @@ static int basicUnitTests(U32 seed, double compressibility) DISPLAYLEVEL(4, "test%3i : compress with static CDict : ", testNb++); { ZSTD_compressionParameters const cParams = ZSTD_getCParams(1, CNBuffSize, dictSize); - size_t const cdictSize = ZSTD_estimateCDictSize_advanced(dictSize, cParams, 0); + size_t const cdictSize = ZSTD_estimateCDictSize_advanced(dictSize, cParams, ZSTD_dlm_byCopy); void* const cdictBuffer = malloc(cdictSize); if (cdictBuffer==NULL) goto _output_error; { ZSTD_CDict* const cdict = ZSTD_initStaticCDict(cdictBuffer, cdictSize, dictBuffer, dictSize, - 0 /* by Reference */, ZSTD_dm_auto, + ZSTD_dlm_byCopy, ZSTD_dm_auto, cParams); if (cdict == NULL) { DISPLAY("ZSTD_initStaticCDict failed "); @@ -745,7 +745,7 @@ static int basicUnitTests(U32 seed, double compressibility) DISPLAYLEVEL(4, "test%3i : ZSTD_compress_usingCDict_advanced, no contentSize, no dictID : ", testNb++); { ZSTD_frameParameters const fParams = { 0 /* frameSize */, 1 /* checksum */, 1 /* noDictID*/ }; ZSTD_compressionParameters const cParams = ZSTD_getCParams(1, CNBuffSize, dictSize); - ZSTD_CDict* const cdict = ZSTD_createCDict_advanced(dictBuffer, dictSize, 1 /*byRef*/, ZSTD_dm_auto, cParams, ZSTD_defaultCMem); + ZSTD_CDict* const cdict = ZSTD_createCDict_advanced(dictBuffer, dictSize, ZSTD_dlm_byRef, ZSTD_dm_auto, cParams, ZSTD_defaultCMem); cSize = ZSTD_compress_usingCDict_advanced(cctx, compressedBuffer, compressedBufferSize, CNBuffer, CNBuffSize, cdict, fParams); ZSTD_freeCDict(cdict); @@ -796,7 +796,7 @@ static int basicUnitTests(U32 seed, double compressibility) DISPLAYLEVEL(4, "test%3i : Building cdict w/ ZSTD_dm_fullDict on a good dictionary : ", testNb++); { ZSTD_compressionParameters const cParams = ZSTD_getCParams(1, CNBuffSize, dictSize); - ZSTD_CDict* const cdict = ZSTD_createCDict_advanced(dictBuffer, dictSize, 1 /*byRef*/, ZSTD_dm_fullDict, cParams, ZSTD_defaultCMem); + ZSTD_CDict* const cdict = ZSTD_createCDict_advanced(dictBuffer, dictSize, ZSTD_dlm_byRef, ZSTD_dm_fullDict, cParams, ZSTD_defaultCMem); if (cdict==NULL) goto _output_error; ZSTD_freeCDict(cdict); } @@ -804,12 +804,32 @@ static int basicUnitTests(U32 seed, double compressibility) DISPLAYLEVEL(4, "test%3i : Building cdict w/ ZSTD_dm_fullDict on a rawContent (must fail) : ", testNb++); { ZSTD_compressionParameters const cParams = ZSTD_getCParams(1, CNBuffSize, dictSize); - ZSTD_CDict* const cdict = ZSTD_createCDict_advanced((const char*)dictBuffer+1, dictSize-1, 1 /*byRef*/, ZSTD_dm_fullDict, cParams, ZSTD_defaultCMem); + ZSTD_CDict* const cdict = ZSTD_createCDict_advanced((const char*)dictBuffer+1, dictSize-1, ZSTD_dlm_byRef, ZSTD_dm_fullDict, cParams, ZSTD_defaultCMem); if (cdict!=NULL) goto _output_error; ZSTD_freeCDict(cdict); } DISPLAYLEVEL(4, "OK \n"); + DISPLAYLEVEL(4, "test%3i : Loading rawContent starting with dict header w/ ZSTD_dm_auto should fail : ", testNb++); + { + size_t ret; + MEM_writeLE32((char*)dictBuffer+2, ZSTD_MAGIC_DICTIONARY); + ret = ZSTD_CCtx_loadDictionary_advanced( + cctx, (const char*)dictBuffer+2, dictSize-2, ZSTD_dlm_byRef, ZSTD_dm_auto); + if (!ZSTD_isError(ret)) goto _output_error; + } + DISPLAYLEVEL(4, "OK \n"); + + DISPLAYLEVEL(4, "test%3i : Loading rawContent starting with dict header w/ ZSTD_dm_rawContent should pass : ", testNb++); + { + size_t ret; + MEM_writeLE32((char*)dictBuffer+2, ZSTD_MAGIC_DICTIONARY); + ret = ZSTD_CCtx_loadDictionary_advanced( + cctx, (const char*)dictBuffer+2, dictSize-2, ZSTD_dlm_byRef, ZSTD_dm_rawContent); + if (ZSTD_isError(ret)) goto _output_error; + } + DISPLAYLEVEL(4, "OK \n"); + ZSTD_freeCCtx(cctx); free(dictBuffer); free(samplesSizes); @@ -897,6 +917,43 @@ static int basicUnitTests(U32 seed, double compressibility) ZSTD_freeCCtx(cctx); } + /* custom formats tests */ + { ZSTD_CCtx* const cctx = ZSTD_createCCtx(); + size_t const inputSize = CNBuffSize / 2; /* won't cause pb with small dict size */ + + /* basic block compression */ + DISPLAYLEVEL(4, "test%3i : magic-less format test : ", testNb++); + CHECK( ZSTD_CCtx_setParameter(cctx, ZSTD_p_format, ZSTD_f_zstd1_magicless) ); + { ZSTD_inBuffer in = { CNBuffer, inputSize, 0 }; + ZSTD_outBuffer out = { compressedBuffer, ZSTD_compressBound(inputSize), 0 }; + size_t const result = ZSTD_compress_generic(cctx, &out, &in, ZSTD_e_end); + if (result != 0) goto _output_error; + if (in.pos != in.size) goto _output_error; + cSize = out.pos; + } + DISPLAYLEVEL(4, "OK (compress : %u -> %u bytes)\n", (U32)inputSize, (U32)cSize); + + DISPLAYLEVEL(4, "test%3i : decompress normally (should fail) : ", testNb++); + { size_t const decodeResult = ZSTD_decompressDCtx(dctx, decodedBuffer, CNBuffSize, compressedBuffer, cSize); + if (ZSTD_getErrorCode(decodeResult) != ZSTD_error_prefix_unknown) goto _output_error; + DISPLAYLEVEL(4, "OK : %s \n", ZSTD_getErrorName(decodeResult)); + } + + DISPLAYLEVEL(4, "test%3i : decompress with magic-less instruction : ", testNb++); + ZSTD_DCtx_reset(dctx); + CHECK( ZSTD_DCtx_setFormat(dctx, ZSTD_f_zstd1_magicless) ); + { ZSTD_inBuffer in = { compressedBuffer, cSize, 0 }; + ZSTD_outBuffer out = { decodedBuffer, CNBuffSize, 0 }; + size_t const result = ZSTD_decompress_generic(dctx, &out, &in); + if (result != 0) goto _output_error; + if (in.pos != in.size) goto _output_error; + if (out.pos != inputSize) goto _output_error; + DISPLAYLEVEL(4, "OK : regenerated %u bytes \n", (U32)out.pos); + } + + ZSTD_freeCCtx(cctx); + } + /* block API tests */ { ZSTD_CCtx* const cctx = ZSTD_createCCtx(); static const size_t dictSize = 65 KB; @@ -940,8 +997,8 @@ static int basicUnitTests(U32 seed, double compressibility) DISPLAYLEVEL(4, "OK \n"); ZSTD_freeCCtx(cctx); - ZSTD_freeDCtx(dctx); } + ZSTD_freeDCtx(dctx); /* long rle test */ { size_t sampleSize = 0; @@ -1334,7 +1391,6 @@ static int fuzzerTests(U32 seed, U32 nbTests, unsigned startTest, U32 const maxD } CHECK_Z( ZSTD_copyCCtx(ctx, refCtx, 0) ); } - ZSTD_setCCtxParameter(ctx, ZSTD_p_forceWindow, FUZ_rand(&lseed) & 1); { U32 const nbChunks = (FUZ_rand(&lseed) & 127) + 2; U32 n; @@ -1364,6 +1420,16 @@ static int fuzzerTests(U32 seed, U32 nbTests, unsigned startTest, U32 const maxD } /* streaming decompression test */ + /* ensure memory requirement is good enough (should always be true) */ + { ZSTD_frameHeader zfh; + CHECK( ZSTD_getFrameHeader(&zfh, cBuffer, ZSTD_frameHeaderSize_max), + "ZSTD_getFrameHeader(): error retrieving frame information"); + { size_t const roundBuffSize = ZSTD_decodingBufferSize_min(zfh.windowSize, zfh.frameContentSize); + CHECK_Z(roundBuffSize); + CHECK((roundBuffSize > totalTestSize) && (zfh.frameContentSize!=ZSTD_CONTENTSIZE_UNKNOWN), + "ZSTD_decodingBufferSize_min() requires more memory (%u) than necessary (%u)", + (U32)roundBuffSize, (U32)totalTestSize ); + } } if (dictSize<8) dictSize=0, dict=NULL; /* disable dictionary */ CHECK_Z( ZSTD_decompressBegin_usingDict(dctx, dict, dictSize) ); totalCSize = 0; diff --git a/contrib/zstd/tests/gzip/Makefile b/sys/contrib/zstd/tests/gzip/Makefile similarity index 80% rename from contrib/zstd/tests/gzip/Makefile rename to sys/contrib/zstd/tests/gzip/Makefile index b02fb693f329..40a0ba97d2b3 100644 --- a/contrib/zstd/tests/gzip/Makefile +++ b/sys/contrib/zstd/tests/gzip/Makefile @@ -1,10 +1,10 @@ # ################################################################ -# Copyright (c) 2017-present, Yann Collet, Facebook, Inc. +# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. An additional grant -# of patent rights can be found in the PATENTS file in the same directory. +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). # ################################################################ PRGDIR = ../../programs @@ -12,7 +12,7 @@ VOID = /dev/null export PATH := .:$(PATH) .PHONY: all -#all: test-gzip-env +#all: test-gzip-env all: test-helin-segv test-hufts test-keep test-list test-memcpy-abuse test-mixed all: test-null-suffix-clobber test-stdin test-trailing-nul test-unpack-invalid all: test-zdiff test-zgrep-context test-zgrep-f test-zgrep-signal test-znew-k test-z-suffix diff --git a/contrib/zstd/tests/gzip/gzip-env.sh b/sys/contrib/zstd/tests/gzip/gzip-env.sh similarity index 100% rename from contrib/zstd/tests/gzip/gzip-env.sh rename to sys/contrib/zstd/tests/gzip/gzip-env.sh diff --git a/contrib/zstd/tests/gzip/helin-segv.sh b/sys/contrib/zstd/tests/gzip/helin-segv.sh similarity index 100% rename from contrib/zstd/tests/gzip/helin-segv.sh rename to sys/contrib/zstd/tests/gzip/helin-segv.sh diff --git a/contrib/zstd/tests/gzip/help-version.sh b/sys/contrib/zstd/tests/gzip/help-version.sh similarity index 100% rename from contrib/zstd/tests/gzip/help-version.sh rename to sys/contrib/zstd/tests/gzip/help-version.sh diff --git a/contrib/zstd/tests/gzip/hufts-segv.gz b/sys/contrib/zstd/tests/gzip/hufts-segv.gz similarity index 100% rename from contrib/zstd/tests/gzip/hufts-segv.gz rename to sys/contrib/zstd/tests/gzip/hufts-segv.gz diff --git a/contrib/zstd/tests/gzip/hufts.sh b/sys/contrib/zstd/tests/gzip/hufts.sh similarity index 100% rename from contrib/zstd/tests/gzip/hufts.sh rename to sys/contrib/zstd/tests/gzip/hufts.sh diff --git a/contrib/zstd/tests/gzip/init.cfg b/sys/contrib/zstd/tests/gzip/init.cfg similarity index 100% rename from contrib/zstd/tests/gzip/init.cfg rename to sys/contrib/zstd/tests/gzip/init.cfg diff --git a/contrib/zstd/tests/gzip/init.sh b/sys/contrib/zstd/tests/gzip/init.sh similarity index 100% rename from contrib/zstd/tests/gzip/init.sh rename to sys/contrib/zstd/tests/gzip/init.sh diff --git a/contrib/zstd/tests/gzip/keep.sh b/sys/contrib/zstd/tests/gzip/keep.sh similarity index 100% rename from contrib/zstd/tests/gzip/keep.sh rename to sys/contrib/zstd/tests/gzip/keep.sh diff --git a/contrib/zstd/tests/gzip/list.sh b/sys/contrib/zstd/tests/gzip/list.sh similarity index 100% rename from contrib/zstd/tests/gzip/list.sh rename to sys/contrib/zstd/tests/gzip/list.sh diff --git a/contrib/zstd/tests/gzip/memcpy-abuse.sh b/sys/contrib/zstd/tests/gzip/memcpy-abuse.sh similarity index 100% rename from contrib/zstd/tests/gzip/memcpy-abuse.sh rename to sys/contrib/zstd/tests/gzip/memcpy-abuse.sh diff --git a/contrib/zstd/tests/gzip/mixed.sh b/sys/contrib/zstd/tests/gzip/mixed.sh similarity index 100% rename from contrib/zstd/tests/gzip/mixed.sh rename to sys/contrib/zstd/tests/gzip/mixed.sh diff --git a/contrib/zstd/tests/gzip/null-suffix-clobber.sh b/sys/contrib/zstd/tests/gzip/null-suffix-clobber.sh similarity index 100% rename from contrib/zstd/tests/gzip/null-suffix-clobber.sh rename to sys/contrib/zstd/tests/gzip/null-suffix-clobber.sh diff --git a/contrib/zstd/tests/gzip/stdin.sh b/sys/contrib/zstd/tests/gzip/stdin.sh similarity index 100% rename from contrib/zstd/tests/gzip/stdin.sh rename to sys/contrib/zstd/tests/gzip/stdin.sh diff --git a/contrib/zstd/tests/gzip/test-driver.sh b/sys/contrib/zstd/tests/gzip/test-driver.sh similarity index 100% rename from contrib/zstd/tests/gzip/test-driver.sh rename to sys/contrib/zstd/tests/gzip/test-driver.sh diff --git a/contrib/zstd/tests/gzip/trailing-nul.sh b/sys/contrib/zstd/tests/gzip/trailing-nul.sh similarity index 100% rename from contrib/zstd/tests/gzip/trailing-nul.sh rename to sys/contrib/zstd/tests/gzip/trailing-nul.sh diff --git a/contrib/zstd/tests/gzip/unpack-invalid.sh b/sys/contrib/zstd/tests/gzip/unpack-invalid.sh similarity index 100% rename from contrib/zstd/tests/gzip/unpack-invalid.sh rename to sys/contrib/zstd/tests/gzip/unpack-invalid.sh diff --git a/contrib/zstd/tests/gzip/z-suffix.sh b/sys/contrib/zstd/tests/gzip/z-suffix.sh similarity index 100% rename from contrib/zstd/tests/gzip/z-suffix.sh rename to sys/contrib/zstd/tests/gzip/z-suffix.sh diff --git a/contrib/zstd/tests/gzip/zdiff.sh b/sys/contrib/zstd/tests/gzip/zdiff.sh similarity index 100% rename from contrib/zstd/tests/gzip/zdiff.sh rename to sys/contrib/zstd/tests/gzip/zdiff.sh diff --git a/contrib/zstd/tests/gzip/zgrep-context.sh b/sys/contrib/zstd/tests/gzip/zgrep-context.sh similarity index 100% rename from contrib/zstd/tests/gzip/zgrep-context.sh rename to sys/contrib/zstd/tests/gzip/zgrep-context.sh diff --git a/contrib/zstd/tests/gzip/zgrep-f.sh b/sys/contrib/zstd/tests/gzip/zgrep-f.sh similarity index 100% rename from contrib/zstd/tests/gzip/zgrep-f.sh rename to sys/contrib/zstd/tests/gzip/zgrep-f.sh diff --git a/contrib/zstd/tests/gzip/zgrep-signal.sh b/sys/contrib/zstd/tests/gzip/zgrep-signal.sh similarity index 100% rename from contrib/zstd/tests/gzip/zgrep-signal.sh rename to sys/contrib/zstd/tests/gzip/zgrep-signal.sh diff --git a/contrib/zstd/tests/gzip/znew-k.sh b/sys/contrib/zstd/tests/gzip/znew-k.sh similarity index 100% rename from contrib/zstd/tests/gzip/znew-k.sh rename to sys/contrib/zstd/tests/gzip/znew-k.sh diff --git a/contrib/zstd/tests/invalidDictionaries.c b/sys/contrib/zstd/tests/invalidDictionaries.c similarity index 96% rename from contrib/zstd/tests/invalidDictionaries.c rename to sys/contrib/zstd/tests/invalidDictionaries.c index 83fe439d4c43..b23db036f489 100644 --- a/contrib/zstd/tests/invalidDictionaries.c +++ b/sys/contrib/zstd/tests/invalidDictionaries.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ #include diff --git a/contrib/zstd/tests/legacy.c b/sys/contrib/zstd/tests/legacy.c similarity index 99% rename from contrib/zstd/tests/legacy.c rename to sys/contrib/zstd/tests/legacy.c index 962b2c9c3c9d..46a8206c4422 100644 --- a/contrib/zstd/tests/legacy.c +++ b/sys/contrib/zstd/tests/legacy.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ /* diff --git a/contrib/zstd/tests/longmatch.c b/sys/contrib/zstd/tests/longmatch.c similarity index 95% rename from contrib/zstd/tests/longmatch.c rename to sys/contrib/zstd/tests/longmatch.c index ef79337f56d5..ed3861571d9b 100644 --- a/contrib/zstd/tests/longmatch.c +++ b/sys/contrib/zstd/tests/longmatch.c @@ -1,10 +1,11 @@ /* - * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * Copyright (c) 2017-present, Yann Collet, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ diff --git a/contrib/zstd/tests/namespaceTest.c b/sys/contrib/zstd/tests/namespaceTest.c similarity index 90% rename from contrib/zstd/tests/namespaceTest.c rename to sys/contrib/zstd/tests/namespaceTest.c index 6f6c74fd63d9..5b7095f67c80 100644 --- a/contrib/zstd/tests/namespaceTest.c +++ b/sys/contrib/zstd/tests/namespaceTest.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ diff --git a/contrib/zstd/tests/paramgrill.c b/sys/contrib/zstd/tests/paramgrill.c similarity index 99% rename from contrib/zstd/tests/paramgrill.c rename to sys/contrib/zstd/tests/paramgrill.c index ed13e1dacca8..317ec461ca91 100644 --- a/contrib/zstd/tests/paramgrill.c +++ b/sys/contrib/zstd/tests/paramgrill.c @@ -1,10 +1,11 @@ /* - * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * Copyright (c) 2015-present, Yann Collet, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ @@ -390,8 +391,8 @@ static int BMK_seed(winnerInfo_t* winners, const ZSTD_compressionParameters para double W_DMemUsed_note = W_ratioNote * ( 40 + 9*cLevel) - log((double)W_DMemUsed); double O_DMemUsed_note = O_ratioNote * ( 40 + 9*cLevel) - log((double)O_DMemUsed); - size_t W_CMemUsed = (1 << params.windowLog) + ZSTD_estimateCCtxSize_advanced(params); - size_t O_CMemUsed = (1 << winners[cLevel].params.windowLog) + ZSTD_estimateCCtxSize_advanced(winners[cLevel].params); + size_t W_CMemUsed = (1 << params.windowLog) + ZSTD_estimateCCtxSize_usingCParams(params); + size_t O_CMemUsed = (1 << winners[cLevel].params.windowLog) + ZSTD_estimateCCtxSize_usingCParams(winners[cLevel].params); double W_CMemUsed_note = W_ratioNote * ( 50 + 13*cLevel) - log((double)W_CMemUsed); double O_CMemUsed_note = O_ratioNote * ( 50 + 13*cLevel) - log((double)O_CMemUsed); diff --git a/contrib/zstd/tests/playTests.sh b/sys/contrib/zstd/tests/playTests.sh similarity index 87% rename from contrib/zstd/tests/playTests.sh rename to sys/contrib/zstd/tests/playTests.sh index bc8584e7a9f0..bc021648cfcb 100755 --- a/contrib/zstd/tests/playTests.sh +++ b/sys/contrib/zstd/tests/playTests.sh @@ -13,11 +13,16 @@ roundTripTest() { cLevel="$2" proba="" fi + if [ -n "$4" ]; then + dLevel="$4" + else + dLevel="$cLevel" + fi rm -f tmp1 tmp2 - $ECHO "roundTripTest: ./datagen $1 $proba | $ZSTD -v$cLevel | $ZSTD -d" + $ECHO "roundTripTest: ./datagen $1 $proba | $ZSTD -v$cLevel | $ZSTD -d$dLevel" ./datagen $1 $proba | $MD5SUM > tmp1 - ./datagen $1 $proba | $ZSTD --ultra -v$cLevel | $ZSTD -d | $MD5SUM > tmp2 + ./datagen $1 $proba | $ZSTD --ultra -v$cLevel | $ZSTD -d$dLevel | $MD5SUM > tmp2 $DIFF -q tmp1 tmp2 } @@ -29,12 +34,17 @@ fileRoundTripTest() { local_c="$2" local_p="" fi + if [ -n "$4" ]; then + local_d="$4" + else + local_d="$local_c" + fi rm -f tmp.zstd tmp.md5.1 tmp.md5.2 - $ECHO "fileRoundTripTest: ./datagen $1 $local_p > tmp && $ZSTD -v$local_c -c tmp | $ZSTD -d" + $ECHO "fileRoundTripTest: ./datagen $1 $local_p > tmp && $ZSTD -v$local_c -c tmp | $ZSTD -d$local_d" ./datagen $1 $local_p > tmp - cat tmp | $MD5SUM > tmp.md5.1 - $ZSTD --ultra -v$local_c -c tmp | $ZSTD -d | $MD5SUM > tmp.md5.2 + < tmp $MD5SUM > tmp.md5.1 + $ZSTD --ultra -v$local_c -c tmp | $ZSTD -d$local_d | $MD5SUM > tmp.md5.2 $DIFF -q tmp.md5.1 tmp.md5.2 } @@ -45,7 +55,6 @@ then fi isWindows=false -ECHO="echo -e" INTOVOID="/dev/null" case "$OS" in Windows*) @@ -66,6 +75,11 @@ case "$UNAME" in SunOS) DIFF="gdiff" ;; esac +ECHO="echo -e" +case "$UNAME" in + Darwin) ECHO="echo" ;; +esac + $ECHO "\nStarting playTests.sh isWindows=$isWindows ZSTD='$ZSTD'" [ -n "$ZSTD" ] || die "ZSTD variable must be defined!" @@ -161,6 +175,8 @@ roundTripTest -g512K roundTripTest -g512K " --zstd=slen=3,tlen=48,strat=6" roundTripTest -g512K " --zstd=strat=6,wlog=23,clog=23,hlog=22,slog=6" roundTripTest -g512K " --zstd=windowLog=23,chainLog=23,hashLog=22,searchLog=6,searchLength=3,targetLength=48,strategy=6" +roundTripTest -g512K " --long --zstd=ldmHashLog=20,ldmSearchLength=64,ldmBucketSizeLog=1,ldmHashEveryLog=7" +roundTripTest -g512K " --long --zstd=ldmhlog=20,ldmslen=64,ldmblog=1,ldmhevery=7" roundTripTest -g512K 19 @@ -291,8 +307,10 @@ $ECHO "- Create dictionary with wrong dictID parameter order (must fail)" $ZSTD --train *.c ../programs/*.c --dictID -o 1 tmpDict1 && die "wrong order : --dictID must be followed by argument " $ECHO "- Create dictionary with size limit" $ZSTD --train *.c ../programs/*.c -o tmpDict2 --maxdict=4K -v +$ECHO "- Create dictionary with small size limit" +$ZSTD --train *.c ../programs/*.c -o tmpDict3 --maxdict=1K -v $ECHO "- Create dictionary with wrong parameter order (must fail)" -$ZSTD --train *.c ../programs/*.c -o tmpDict2 --maxdict -v 4K && die "wrong order : --maxdict must be followed by argument " +$ZSTD --train *.c ../programs/*.c -o tmpDict3 --maxdict -v 4K && die "wrong order : --maxdict must be followed by argument " $ECHO "- Compress without dictID" $ZSTD -f tmp -D tmpDict1 --no-dictID $ZSTD -d tmp.zst -D tmpDict -fo result @@ -551,6 +569,15 @@ roundTripTest -g516K 19 # btopt fileRoundTripTest -g500K +$ECHO "\n**** zstd long distance matching round-trip tests **** " +roundTripTest -g0 "2 --long" +roundTripTest -g1000K "1 --long" +roundTripTest -g517K "6 --long" +roundTripTest -g516K "16 --long" +roundTripTest -g518K "19 --long" +fileRoundTripTest -g5M "3 --long" + + if [ -n "$hasMT" ] then $ECHO "\n**** zstdmt round-trip tests **** " @@ -558,6 +585,9 @@ then roundTripTest -g8M "3 -T2" roundTripTest -g8000K "2 --threads=2" fileRoundTripTest -g4M "19 -T2 -B1M" + + $ECHO "\n**** zstdmt long distance matching round-trip tests **** " + roundTripTest -g8M "3 --long -T2" else $ECHO "\n**** no multithreading, skipping zstdmt tests **** " fi @@ -568,7 +598,6 @@ $ECHO "\n**** zstd --list/-l single frame tests ****" ./datagen > tmp1 ./datagen > tmp2 ./datagen > tmp3 -./datagen > tmp4 $ZSTD tmp* $ZSTD -l *.zst $ZSTD -lv *.zst @@ -577,9 +606,7 @@ $ZSTD --list -v *.zst $ECHO "\n**** zstd --list/-l multiple frame tests ****" cat tmp1.zst tmp2.zst > tmp12.zst -cat tmp3.zst tmp4.zst > tmp34.zst -cat tmp12.zst tmp34.zst > tmp1234.zst -cat tmp12.zst tmp4.zst > tmp124.zst +cat tmp12.zst tmp3.zst > tmp123.zst $ZSTD -l *.zst $ZSTD -lv *.zst $ZSTD --list *.zst @@ -589,7 +616,7 @@ $ECHO "\n**** zstd --list/-l error detection tests ****" ! $ZSTD -l tmp1 tmp1.zst ! $ZSTD --list tmp* ! $ZSTD -lv tmp1* -! $ZSTD --list -v tmp2 tmp23.zst +! $ZSTD --list -v tmp2 tmp12.zst $ECHO "\n**** zstd --list/-l test with null files ****" ./datagen -g0 > tmp5 @@ -612,47 +639,70 @@ $ZSTD -lv tmp1.zst rm tmp* +$ECHO "\n**** zstd long distance matching tests **** " +roundTripTest -g0 " --long" +roundTripTest -g9M "2 --long" +# Test parameter parsing +roundTripTest -g1M -P50 "1 --long=29" " --memory=512MB" +roundTripTest -g1M -P50 "1 --long=29 --zstd=wlog=28" " --memory=256MB" +roundTripTest -g1M -P50 "1 --long=29" " --long=28 --memory=512MB" +roundTripTest -g1M -P50 "1 --long=29" " --zstd=wlog=28 --memory=512MB" + + if [ "$1" != "--test-large-data" ]; then $ECHO "Skipping large data tests" exit 0 fi +$ECHO "\n**** large files tests **** " + roundTripTest -g270000000 1 -roundTripTest -g270000000 2 -roundTripTest -g270000000 3 +roundTripTest -g250000000 2 +roundTripTest -g230000000 3 roundTripTest -g140000000 -P60 4 -roundTripTest -g140000000 -P60 5 -roundTripTest -g140000000 -P60 6 +roundTripTest -g130000000 -P62 5 +roundTripTest -g120000000 -P65 6 roundTripTest -g70000000 -P70 7 -roundTripTest -g70000000 -P70 8 -roundTripTest -g70000000 -P70 9 +roundTripTest -g60000000 -P71 8 +roundTripTest -g50000000 -P73 9 roundTripTest -g35000000 -P75 10 -roundTripTest -g35000000 -P75 11 -roundTripTest -g35000000 -P75 12 +roundTripTest -g30000000 -P76 11 +roundTripTest -g25000000 -P78 12 roundTripTest -g18000013 -P80 13 roundTripTest -g18000014 -P80 14 -roundTripTest -g18000015 -P80 15 -roundTripTest -g18000016 -P80 16 -roundTripTest -g18000017 -P80 17 +roundTripTest -g18000015 -P81 15 +roundTripTest -g18000016 -P84 16 +roundTripTest -g18000017 -P88 17 roundTripTest -g18000018 -P94 18 -roundTripTest -g18000019 -P94 19 +roundTripTest -g18000019 -P96 19 -roundTripTest -g68000020 -P99 20 -roundTripTest -g6000000000 -P99 1 +roundTripTest -g5000000000 -P99 1 fileRoundTripTest -g4193M -P99 1 + +$ECHO "\n**** zstd long, long distance matching round-trip tests **** " +roundTripTest -g270000000 "1 --long" +roundTripTest -g130000000 -P60 "5 --long" +roundTripTest -g35000000 -P70 "8 --long" +roundTripTest -g18000001 -P80 "18 --long" +# Test large window logs +roundTripTest -g700M -P50 "1 --long=29" +roundTripTest -g600M -P50 "1 --long --zstd=wlog=29,clog=28" + + if [ -n "$hasMT" ] then $ECHO "\n**** zstdmt long round-trip tests **** " - roundTripTest -g99000000 -P99 "20 -T2" - roundTripTest -g6000000000 -P99 "1 -T2" - roundTripTest -g1500000000 -P97 "1 -T999" - fileRoundTripTest -g4195M -P98 " -T0" + roundTripTest -g80000000 -P99 "19 -T2" " " + roundTripTest -g5000000000 -P99 "1 -T2" " " + roundTripTest -g500000000 -P97 "1 -T999" " " + fileRoundTripTest -g4103M -P98 " -T0" " " + roundTripTest -g400000000 -P97 "1 --long=24 -T2" " " else $ECHO "\n**** no multithreading, skipping zstdmt tests **** " fi diff --git a/contrib/zstd/tests/poolTests.c b/sys/contrib/zstd/tests/poolTests.c similarity index 97% rename from contrib/zstd/tests/poolTests.c rename to sys/contrib/zstd/tests/poolTests.c index f3d5c382ae57..00ee830154c9 100644 --- a/contrib/zstd/tests/poolTests.c +++ b/sys/contrib/zstd/tests/poolTests.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ diff --git a/contrib/zstd/tests/roundTripCrash.c b/sys/contrib/zstd/tests/roundTripCrash.c similarity index 68% rename from contrib/zstd/tests/roundTripCrash.c rename to sys/contrib/zstd/tests/roundTripCrash.c index 0b478f6cab3e..180fa9b6f6dc 100644 --- a/contrib/zstd/tests/roundTripCrash.c +++ b/sys/contrib/zstd/tests/roundTripCrash.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ /* @@ -20,9 +21,12 @@ #include /* size_t */ #include /* malloc, free, exit */ #include /* fprintf */ +#include /* strcmp */ #include /* stat */ #include /* stat */ #include "xxhash.h" + +#define ZSTD_STATIC_LINKING_ONLY #include "zstd.h" /*=========================================== @@ -30,6 +34,24 @@ *==========================================*/ #define MIN(a,b) ( (a) < (b) ? (a) : (b) ) +static void crash(int errorCode){ + /* abort if AFL/libfuzzer, exit otherwise */ + #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION /* could also use __AFL_COMPILER */ + abort(); + #else + exit(errorCode); + #endif +} + +#define CHECK_Z(f) { \ + size_t const err = f; \ + if (ZSTD_isError(err)) { \ + fprintf(stderr, \ + "Error=> %s: %s", \ + #f, ZSTD_getErrorName(err)); \ + crash(1); \ +} } + /** roundTripTest() : * Compresses `srcBuff` into `compressedBuff`, * then decompresses `compressedBuff` into `resultBuff`. @@ -54,6 +76,38 @@ static size_t roundTripTest(void* resultBuff, size_t resultBuffCapacity, return ZSTD_decompress(resultBuff, resultBuffCapacity, compressedBuff, cSize); } +/** cctxParamRoundTripTest() : + * Same as roundTripTest() except allows experimenting with ZSTD_CCtx_params. */ +static size_t cctxParamRoundTripTest(void* resultBuff, size_t resultBuffCapacity, + void* compressedBuff, size_t compressedBuffCapacity, + const void* srcBuff, size_t srcBuffSize) +{ + ZSTD_CCtx* const cctx = ZSTD_createCCtx(); + ZSTD_CCtx_params* const cctxParams = ZSTD_createCCtxParams(); + ZSTD_inBuffer inBuffer = { srcBuff, srcBuffSize, 0 }; + ZSTD_outBuffer outBuffer = {compressedBuff, compressedBuffCapacity, 0 }; + + static const int maxClevel = 19; + size_t const hashLength = MIN(128, srcBuffSize); + unsigned const h32 = XXH32(srcBuff, hashLength, 0); + int const cLevel = h32 % maxClevel; + + /* Set parameters */ + CHECK_Z( ZSTD_CCtxParam_setParameter(cctxParams, ZSTD_p_compressionLevel, cLevel) ); + CHECK_Z( ZSTD_CCtxParam_setParameter(cctxParams, ZSTD_p_nbThreads, 2) ); + CHECK_Z( ZSTD_CCtxParam_setParameter(cctxParams, ZSTD_p_overlapSizeLog, 5) ); + + + /* Apply parameters */ + CHECK_Z( ZSTD_CCtx_setParametersUsingCCtxParams(cctx, cctxParams) ); + + CHECK_Z (ZSTD_compress_generic(cctx, &outBuffer, &inBuffer, ZSTD_e_end) ); + + ZSTD_freeCCtxParams(cctxParams); + ZSTD_freeCCtx(cctx); + + return ZSTD_decompress(resultBuff, resultBuffCapacity, compressedBuff, outBuffer.pos); +} static size_t checkBuffers(const void* buff1, const void* buff2, size_t buffSize) { @@ -68,16 +122,7 @@ static size_t checkBuffers(const void* buff1, const void* buff2, size_t buffSize return pos; } -static void crash(int errorCode){ - /* abort if AFL/libfuzzer, exit otherwise */ - #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION /* could also use __AFL_COMPILER */ - abort(); - #else - exit(errorCode); - #endif -} - -static void roundTripCheck(const void* srcBuff, size_t srcBuffSize) +static void roundTripCheck(const void* srcBuff, size_t srcBuffSize, int testCCtxParams) { size_t const cBuffSize = ZSTD_compressBound(srcBuffSize); void* cBuff = malloc(cBuffSize); @@ -88,7 +133,9 @@ static void roundTripCheck(const void* srcBuff, size_t srcBuffSize) exit (1); } - { size_t const result = roundTripTest(rBuff, cBuffSize, cBuff, cBuffSize, srcBuff, srcBuffSize); + { size_t const result = testCCtxParams ? + cctxParamRoundTripTest(rBuff, cBuffSize, cBuff, cBuffSize, srcBuff, srcBuffSize) + : roundTripTest(rBuff, cBuffSize, cBuff, cBuffSize, srcBuff, srcBuffSize); if (ZSTD_isError(result)) { fprintf(stderr, "roundTripTest error : %s \n", ZSTD_getErrorName(result)); crash(1); @@ -162,7 +209,7 @@ static void loadFile(void* buffer, const char* fileName, size_t fileSize) } -static void fileCheck(const char* fileName) +static void fileCheck(const char* fileName, int testCCtxParams) { size_t const fileSize = getFileSize(fileName); void* buffer = malloc(fileSize); @@ -171,16 +218,24 @@ static void fileCheck(const char* fileName) exit(4); } loadFile(buffer, fileName, fileSize); - roundTripCheck(buffer, fileSize); + roundTripCheck(buffer, fileSize, testCCtxParams); free (buffer); } int main(int argCount, const char** argv) { + int argNb = 1; + int testCCtxParams = 0; if (argCount < 2) { fprintf(stderr, "Error : no argument : need input file \n"); exit(9); } - fileCheck(argv[1]); + + if (!strcmp(argv[argNb], "--cctxParams")) { + testCCtxParams = 1; + argNb++; + } + + fileCheck(argv[argNb], testCCtxParams); fprintf(stderr, "no pb detected\n"); return 0; } diff --git a/contrib/zstd/tests/symbols.c b/sys/contrib/zstd/tests/symbols.c similarity index 98% rename from contrib/zstd/tests/symbols.c rename to sys/contrib/zstd/tests/symbols.c index f08542dbf669..c0bed2e5d96e 100644 --- a/contrib/zstd/tests/symbols.c +++ b/sys/contrib/zstd/tests/symbols.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ diff --git a/contrib/zstd/tests/test-zstd-speed.py b/sys/contrib/zstd/tests/test-zstd-speed.py similarity index 97% rename from contrib/zstd/tests/test-zstd-speed.py rename to sys/contrib/zstd/tests/test-zstd-speed.py index 56108a5cae4c..1096d5e4e224 100755 --- a/contrib/zstd/tests/test-zstd-speed.py +++ b/sys/contrib/zstd/tests/test-zstd-speed.py @@ -1,13 +1,13 @@ #! /usr/bin/env python3 -# +# ################################################################ # Copyright (c) 2016-present, Przemyslaw Skibinski, Yann Collet, Facebook, Inc. # All rights reserved. # -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. An additional grant -# of patent rights can be found in the PATENTS file in the same directory. -# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ########################################################################## # Limitations: # - doesn't support filenames with spaces diff --git a/contrib/zstd/tests/test-zstd-versions.py b/sys/contrib/zstd/tests/test-zstd-versions.py similarity index 96% rename from contrib/zstd/tests/test-zstd-versions.py rename to sys/contrib/zstd/tests/test-zstd-versions.py index a5a713009a93..f2deac1f28da 100755 --- a/contrib/zstd/tests/test-zstd-versions.py +++ b/sys/contrib/zstd/tests/test-zstd-versions.py @@ -1,14 +1,14 @@ #!/usr/bin/env python3 """Test zstd interoperability between versions""" -# +# ################################################################ # Copyright (c) 2016-present, Yann Collet, Facebook, Inc. # All rights reserved. # -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. An additional grant -# of patent rights can be found in the PATENTS file in the same directory. -# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ import filecmp import glob diff --git a/contrib/zstd/tests/zbufftest.c b/sys/contrib/zstd/tests/zbufftest.c similarity index 99% rename from contrib/zstd/tests/zbufftest.c rename to sys/contrib/zstd/tests/zbufftest.c index fe08fdab5bed..e64c886a5e75 100644 --- a/contrib/zstd/tests/zbufftest.c +++ b/sys/contrib/zstd/tests/zbufftest.c @@ -1,10 +1,11 @@ /* - * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * Copyright (c) 2015-present, Yann Collet, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ diff --git a/contrib/zstd/tests/zstreamtest.c b/sys/contrib/zstd/tests/zstreamtest.c similarity index 84% rename from contrib/zstd/tests/zstreamtest.c rename to sys/contrib/zstd/tests/zstreamtest.c index dd044342ea80..8b4c836940a6 100644 --- a/contrib/zstd/tests/zstreamtest.c +++ b/sys/contrib/zstd/tests/zstreamtest.c @@ -5,6 +5,7 @@ * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ @@ -95,6 +96,15 @@ unsigned int FUZ_rand(unsigned int* seedPtr) return rand32 >> 5; } +#define CHECK_Z(f) { \ + size_t const err = f; \ + if (ZSTD_isError(err)) { \ + DISPLAY("Error => %s : %s ", \ + #f, ZSTD_getErrorName(err)); \ + DISPLAY(" (seed %u, test nb %u) \n", seed, testNb); \ + goto _output_error; \ +} } + /*====================================================== * Basic Unit tests @@ -149,6 +159,8 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo U32 testNb = 1; ZSTD_CStream* zc = ZSTD_createCStream_advanced(customMem); ZSTD_DStream* zd = ZSTD_createDStream_advanced(customMem); + ZSTDMT_CCtx* mtctx = ZSTDMT_createCCtx(2); + ZSTD_inBuffer inBuff, inBuff2; ZSTD_outBuffer outBuff; buffer_t dictionary = g_nullBuffer; @@ -163,8 +175,8 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo RDG_genBuffer(CNBuffer, CNBufferSize, compressibility, 0., seed); /* Create dictionary */ - MEM_STATIC_ASSERT(COMPRESSIBLE_NOISE_LENGTH >= 4 MB); - dictionary = FUZ_createDictionary(CNBuffer, 4 MB, 4 KB, 40 KB); + DISPLAYLEVEL(3, "creating dictionary for unit tests \n"); + dictionary = FUZ_createDictionary(CNBuffer, CNBufferSize / 2, 8 KB, 40 KB); if (!dictionary.start) { DISPLAY("Error creating dictionary, aborting \n"); goto _output_error; @@ -178,16 +190,14 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo /* Basic compression test */ DISPLAYLEVEL(3, "test%3i : compress %u bytes : ", testNb++, COMPRESSIBLE_NOISE_LENGTH); - { size_t const r = ZSTD_initCStream_usingDict(zc, CNBuffer, dictSize, 1); - if (ZSTD_isError(r)) goto _output_error; } + CHECK_Z( ZSTD_initCStream_usingDict(zc, CNBuffer, dictSize, 1) ); outBuff.dst = (char*)(compressedBuffer)+cSize; outBuff.size = compressedBufferSize; outBuff.pos = 0; inBuff.src = CNBuffer; inBuff.size = CNBufferSize; inBuff.pos = 0; - { size_t const r = ZSTD_compressStream(zc, &outBuff, &inBuff); - if (ZSTD_isError(r)) goto _output_error; } + CHECK_Z( ZSTD_compressStream(zc, &outBuff, &inBuff) ); if (inBuff.pos != inBuff.size) goto _output_error; /* entire input should be consumed */ { size_t const r = ZSTD_endStream(zc, &outBuff); if (r != 0) goto _output_error; } /* error, or some data not flushed */ @@ -197,11 +207,11 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo /* context size functions */ DISPLAYLEVEL(3, "test%3i : estimate CStream size : ", testNb++); { ZSTD_compressionParameters const cParams = ZSTD_getCParams(1, CNBufferSize, dictSize); - size_t const s = ZSTD_estimateCStreamSize_advanced(cParams) - /* uses ZSTD_initCStream_usingDict() */ - + ZSTD_estimateCDictSize_advanced(dictSize, cParams, 0); - if (ZSTD_isError(s)) goto _output_error; - DISPLAYLEVEL(3, "OK (%u bytes) \n", (U32)s); + size_t const cstreamSize = ZSTD_estimateCStreamSize_usingCParams(cParams); + size_t const cdictSize = ZSTD_estimateCDictSize_advanced(dictSize, cParams, ZSTD_dlm_byCopy); /* uses ZSTD_initCStream_usingDict() */ + if (ZSTD_isError(cstreamSize)) goto _output_error; + if (ZSTD_isError(cdictSize)) goto _output_error; + DISPLAYLEVEL(3, "OK (%u bytes) \n", (U32)(cstreamSize + cdictSize)); } DISPLAYLEVEL(3, "test%3i : check actual CStream size : ", testNb++); @@ -222,8 +232,7 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo /* skippable frame test */ DISPLAYLEVEL(3, "test%3i : decompress skippable frame : ", testNb++); - if (ZSTD_isError( ZSTD_initDStream_usingDict(zd, CNBuffer, dictSize) )) - goto _output_error; + CHECK_Z( ZSTD_initDStream_usingDict(zd, CNBuffer, dictSize) ); inBuff.src = compressedBuffer; inBuff.size = cSize; inBuff.pos = 0; @@ -241,8 +250,7 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo inBuff2 = inBuff; DISPLAYLEVEL(3, "test%3i : decompress %u bytes : ", testNb++, COMPRESSIBLE_NOISE_LENGTH); ZSTD_initDStream_usingDict(zd, CNBuffer, dictSize); - { size_t const r = ZSTD_setDStreamParameter(zd, DStream_p_maxWindowSize, 1000000000); /* large limit */ - if (ZSTD_isError(r)) goto _output_error; } + CHECK_Z( ZSTD_setDStreamParameter(zd, DStream_p_maxWindowSize, 1000000000) ); /* large limit */ { size_t const remaining = ZSTD_decompressStream(zd, &outBuff, &inBuff); if (remaining != 0) goto _output_error; } /* should reach end of frame == 0; otherwise, some data left, or an error */ if (outBuff.pos != CNBufferSize) goto _output_error; /* should regenerate the same amount */ @@ -275,7 +283,7 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo DISPLAYLEVEL(5, " (windowSize : %u) ", (U32)fhi.windowSize); { size_t const s = ZSTD_estimateDStreamSize(fhi.windowSize) /* uses ZSTD_initDStream_usingDict() */ - + ZSTD_estimateDDictSize(dictSize, 0); + + ZSTD_estimateDDictSize(dictSize, ZSTD_dlm_byCopy); if (ZSTD_isError(s)) goto _output_error; DISPLAYLEVEL(3, "OK (%u bytes) \n", (U32)s); } } @@ -332,8 +340,7 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo inBuff.src = CNBuffer; inBuff.size = CNBufferSize; inBuff.pos = 0; - { size_t const r = ZSTD_compressStream(zc, &outBuff, &inBuff); - if (ZSTD_isError(r)) goto _output_error; } + CHECK_Z( ZSTD_compressStream(zc, &outBuff, &inBuff) ); if (inBuff.pos != inBuff.size) goto _output_error; /* entire input should be consumed */ { size_t const r = ZSTD_endStream(zc, &outBuff); if (r != 0) goto _output_error; } /* error, or some data not flushed */ @@ -350,8 +357,7 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo inBuff.src = CNBuffer; inBuff.size = CNBufferSize; inBuff.pos = 0; - { size_t const r = ZSTD_compressStream(zc, &outBuff, &inBuff); - if (ZSTD_isError(r)) goto _output_error; } + CHECK_Z( ZSTD_compressStream(zc, &outBuff, &inBuff) ); if (inBuff.pos != inBuff.size) goto _output_error; /* entire input should be consumed */ { size_t const r = ZSTD_endStream(zc, &outBuff); if (ZSTD_getErrorCode(r) != ZSTD_error_srcSize_wrong) goto _output_error; /* must fail : wrong srcSize */ @@ -373,8 +379,7 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo outBuff.size = ZSTD_compressBound(inSize); outBuff.pos = 0; DISPLAYLEVEL(5, "compress1 "); - { size_t const r = ZSTD_compressStream(zc, &outBuff, &inBuff); - if (ZSTD_isError(r)) goto _output_error; } + CHECK_Z( ZSTD_compressStream(zc, &outBuff, &inBuff) ); if (inBuff.pos != inBuff.size) goto _output_error; /* entire input should be consumed */ DISPLAYLEVEL(5, "end1 "); { size_t const r = ZSTD_endStream(zc, &outBuff); @@ -391,8 +396,7 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo outBuff.size = ZSTD_compressBound(inSize); outBuff.pos = 0; DISPLAYLEVEL(5, "compress2 "); - { size_t const r = ZSTD_compressStream(zc, &outBuff, &inBuff); - if (ZSTD_isError(r)) goto _output_error; } + CHECK_Z( ZSTD_compressStream(zc, &outBuff, &inBuff) ); if (inBuff.pos != inBuff.size) goto _output_error; /* entire input should be consumed */ DISPLAYLEVEL(5, "end2 "); { size_t const r = ZSTD_endStream(zc, &outBuff); @@ -412,8 +416,7 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo inBuff.src = CNBuffer; inBuff.size = CNBufferSize; inBuff.pos = 0; - { size_t const r = ZSTD_compressStream(zc, &outBuff, &inBuff); - if (ZSTD_isError(r)) goto _output_error; } + CHECK_Z( ZSTD_compressStream(zc, &outBuff, &inBuff) ); if (inBuff.pos != inBuff.size) goto _output_error; /* entire input should be consumed */ { size_t const r = ZSTD_endStream(zc, &outBuff); if (r != 0) goto _output_error; } /* error, or some data not flushed */ @@ -462,8 +465,7 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo /* Memory restriction */ DISPLAYLEVEL(3, "test%3i : maxWindowSize < frame requirement : ", testNb++); ZSTD_initDStream_usingDict(zd, CNBuffer, dictSize); - { size_t const r = ZSTD_setDStreamParameter(zd, DStream_p_maxWindowSize, 1000); /* too small limit */ - if (ZSTD_isError(r)) goto _output_error; } + CHECK_Z( ZSTD_setDStreamParameter(zd, DStream_p_maxWindowSize, 1000) ); /* too small limit */ inBuff.src = compressedBuffer; inBuff.size = cSize; inBuff.pos = 0; @@ -477,7 +479,7 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo DISPLAYLEVEL(3, "test%3i : ZSTD_initCStream_usingCDict_advanced with masked dictID : ", testNb++); { ZSTD_compressionParameters const cParams = ZSTD_getCParams(1, CNBufferSize, dictionary.filled); ZSTD_frameParameters const fParams = { 1 /* contentSize */, 1 /* checksum */, 1 /* noDictID */}; - ZSTD_CDict* const cdict = ZSTD_createCDict_advanced(dictionary.start, dictionary.filled, 1 /* byReference */, ZSTD_dm_auto, cParams, customMem); + ZSTD_CDict* const cdict = ZSTD_createCDict_advanced(dictionary.start, dictionary.filled, ZSTD_dlm_byRef, ZSTD_dm_auto, cParams, customMem); size_t const initError = ZSTD_initCStream_usingCDict_advanced(zc, cdict, fParams, CNBufferSize); if (ZSTD_isError(initError)) goto _output_error; cSize = 0; @@ -487,8 +489,7 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo inBuff.src = CNBuffer; inBuff.size = CNBufferSize; inBuff.pos = 0; - { size_t const r = ZSTD_compressStream(zc, &outBuff, &inBuff); - if (ZSTD_isError(r)) goto _output_error; } + CHECK_Z( ZSTD_compressStream(zc, &outBuff, &inBuff) ); if (inBuff.pos != inBuff.size) goto _output_error; /* entire input should be consumed */ { size_t const r = ZSTD_endStream(zc, &outBuff); if (r != 0) goto _output_error; } /* error, or some data not flushed */ @@ -510,16 +511,14 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo } DISPLAYLEVEL(3, "test%3i : compress with ZSTD_CCtx_refPrefix : ", testNb++); - { size_t const refErr = ZSTD_CCtx_refPrefix(zc, dictionary.start, dictionary.filled); - if (ZSTD_isError(refErr)) goto _output_error; } + CHECK_Z( ZSTD_CCtx_refPrefix(zc, dictionary.start, dictionary.filled) ); outBuff.dst = compressedBuffer; outBuff.size = compressedBufferSize; outBuff.pos = 0; inBuff.src = CNBuffer; inBuff.size = CNBufferSize; inBuff.pos = 0; - { size_t const r = ZSTD_compress_generic(zc, &outBuff, &inBuff, ZSTD_e_end); - if (ZSTD_isError(r)) goto _output_error; } + CHECK_Z( ZSTD_compress_generic(zc, &outBuff, &inBuff, ZSTD_e_end) ); if (inBuff.pos != inBuff.size) goto _output_error; /* entire input should be consumed */ cSize = outBuff.pos; DISPLAYLEVEL(3, "OK (%u bytes : %.2f%%)\n", (U32)cSize, (double)cSize/CNBufferSize*100); @@ -546,23 +545,20 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo inBuff.src = CNBuffer; inBuff.size = CNBufferSize; inBuff.pos = 0; - { size_t const r = ZSTD_compress_generic(zc, &outBuff, &inBuff, ZSTD_e_end); - if (ZSTD_isError(r)) goto _output_error; } + CHECK_Z( ZSTD_compress_generic(zc, &outBuff, &inBuff, ZSTD_e_end) ); if (inBuff.pos != inBuff.size) goto _output_error; /* entire input should be consumed */ cSize = outBuff.pos; DISPLAYLEVEL(3, "OK (%u bytes : %.2f%%)\n", (U32)cSize, (double)cSize/CNBufferSize*100); DISPLAYLEVEL(3, "test%3i : decompress without dictionary (should work): ", testNb++); - { size_t const r = ZSTD_decompress(decodedBuffer, CNBufferSize, compressedBuffer, cSize); - if (ZSTD_isError(r)) goto _output_error; /* must fail : dictionary not used */ - DISPLAYLEVEL(3, "OK \n"); - } + CHECK_Z( ZSTD_decompress(decodedBuffer, CNBufferSize, compressedBuffer, cSize) ); + DISPLAYLEVEL(3, "OK \n"); /* Empty srcSize */ DISPLAYLEVEL(3, "test%3i : ZSTD_initCStream_advanced with pledgedSrcSize=0 and dict : ", testNb++); { ZSTD_parameters params = ZSTD_getParams(5, 0, 0); params.fParams.contentSizeFlag = 1; - ZSTD_initCStream_advanced(zc, dictionary.start, dictionary.filled, params, 0); + CHECK_Z( ZSTD_initCStream_advanced(zc, dictionary.start, dictionary.filled, params, 0) ); } /* cstream advanced shall write content size = 0 */ inBuff.src = CNBuffer; inBuff.size = 0; @@ -570,7 +566,7 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo outBuff.dst = compressedBuffer; outBuff.size = compressedBufferSize; outBuff.pos = 0; - if (ZSTD_isError(ZSTD_compressStream(zc, &outBuff, &inBuff))) goto _output_error; + CHECK_Z( ZSTD_compressStream(zc, &outBuff, &inBuff) ); if (ZSTD_endStream(zc, &outBuff) != 0) goto _output_error; cSize = outBuff.pos; if (ZSTD_findDecompressedSize(compressedBuffer, cSize) != 0) goto _output_error; @@ -579,7 +575,7 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo DISPLAYLEVEL(3, "test%3i : pledgedSrcSize == 0 behaves properly : ", testNb++); { ZSTD_parameters params = ZSTD_getParams(5, 0, 0); params.fParams.contentSizeFlag = 1; - ZSTD_initCStream_advanced(zc, NULL, 0, params, 0); + CHECK_Z( ZSTD_initCStream_advanced(zc, NULL, 0, params, 0) ); } /* cstream advanced shall write content size = 0 */ inBuff.src = CNBuffer; inBuff.size = 0; @@ -587,7 +583,7 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo outBuff.dst = compressedBuffer; outBuff.size = compressedBufferSize; outBuff.pos = 0; - if (ZSTD_isError(ZSTD_compressStream(zc, &outBuff, &inBuff))) goto _output_error; + CHECK_Z( ZSTD_compressStream(zc, &outBuff, &inBuff) ); if (ZSTD_endStream(zc, &outBuff) != 0) goto _output_error; cSize = outBuff.pos; if (ZSTD_findDecompressedSize(compressedBuffer, cSize) != 0) goto _output_error; @@ -599,12 +595,30 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo outBuff.dst = compressedBuffer; outBuff.size = compressedBufferSize; outBuff.pos = 0; - if (ZSTD_isError(ZSTD_compressStream(zc, &outBuff, &inBuff))) goto _output_error; + CHECK_Z( ZSTD_compressStream(zc, &outBuff, &inBuff) ); if (ZSTD_endStream(zc, &outBuff) != 0) goto _output_error; cSize = outBuff.pos; if (ZSTD_findDecompressedSize(compressedBuffer, cSize) != ZSTD_CONTENTSIZE_UNKNOWN) goto _output_error; DISPLAYLEVEL(3, "OK \n"); + /* Basic multithreading compression test */ + DISPLAYLEVEL(3, "test%3i : compress %u bytes with multiple threads : ", testNb++, COMPRESSIBLE_NOISE_LENGTH); + { ZSTD_parameters const params = ZSTD_getParams(1, 0, 0); + CHECK_Z( ZSTDMT_initCStream_advanced(mtctx, CNBuffer, dictSize, params, CNBufferSize) ); + } + outBuff.dst = (char*)(compressedBuffer); + outBuff.size = compressedBufferSize; + outBuff.pos = 0; + inBuff.src = CNBuffer; + inBuff.size = CNBufferSize; + inBuff.pos = 0; + CHECK_Z( ZSTDMT_compressStream_generic(mtctx, &outBuff, &inBuff, ZSTD_e_end) ); + if (inBuff.pos != inBuff.size) goto _output_error; /* entire input should be consumed */ + { size_t const r = ZSTDMT_endStream(mtctx, &outBuff); + if (r != 0) goto _output_error; } /* error, or some data not flushed */ + DISPLAYLEVEL(3, "OK \n"); + + /* Overlen overwriting window data bug */ DISPLAYLEVEL(3, "test%3i : wildcopy doesn't overwrite potential match data : ", testNb++); { /* This test has a window size of 1024 bytes and consists of 3 blocks: @@ -619,9 +633,10 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo "\x28\xB5\x2F\xFD\x04\x00\x4C\x00\x00\x10\x61\x61\x01\x00\x00\x2A" "\x80\x05\x44\x00\x00\x08\x62\x01\x00\x00\x2A\x20\x04\x5D\x00\x00" "\x00\x03\x40\x00\x00\x64\x60\x27\xB0\xE0\x0C\x67\x62\xCE\xE0"; - ZSTD_DStream* zds = ZSTD_createDStream(); + ZSTD_DStream* const zds = ZSTD_createDStream(); + if (zds==NULL) goto _output_error; - ZSTD_initDStream(zds); + CHECK_Z( ZSTD_initDStream(zds) ); inBuff.src = testCase; inBuff.size = 47; inBuff.pos = 0; @@ -630,9 +645,7 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo outBuff.pos = 0; while (inBuff.pos < inBuff.size) { - size_t const r = ZSTD_decompressStream(zds, &outBuff, &inBuff); - /* Bug will cause checksum to fail */ - if (ZSTD_isError(r)) goto _output_error; + CHECK_Z( ZSTD_decompressStream(zds, &outBuff, &inBuff) ); } ZSTD_freeDStream(zds); @@ -643,6 +656,7 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo FUZ_freeDictionary(dictionary); ZSTD_freeCStream(zc); ZSTD_freeDStream(zd); + ZSTDMT_freeCCtx(mtctx); free(CNBuffer); free(compressedBuffer); free(decodedBuffer); @@ -687,6 +701,13 @@ static size_t FUZ_randomLength(U32* seed, U32 maxLog) #define MIN(a,b) ( (a) < (b) ? (a) : (b) ) +/* Return value in range minVal <= v <= maxVal */ +static U32 FUZ_randomClampedLength(U32* seed, U32 minVal, U32 maxVal) +{ + U32 const mod = maxVal < minVal ? 1 : (maxVal + 1) - minVal; + return (U32)((FUZ_rand(seed) % mod) + minVal); +} + #define CHECK(cond, ...) { \ if (cond) { \ DISPLAY("Error => "); \ @@ -695,35 +716,26 @@ static size_t FUZ_randomLength(U32* seed, U32 maxLog) goto _output_error; \ } } -#define CHECK_Z(f) { \ - size_t const err = f; \ - if (ZSTD_isError(err)) { \ - DISPLAY("Error => %s : %s ", \ - #f, ZSTD_getErrorName(err)); \ - DISPLAY(" (seed %u, test nb %u) \n", seed, testNb); \ - goto _output_error; \ -} } - static int fuzzerTests(U32 seed, U32 nbTests, unsigned startTest, double compressibility, int bigTests) { U32 const maxSrcLog = bigTests ? 24 : 22; static const U32 maxSampleLog = 19; size_t const srcBufferSize = (size_t)1<= srcBufferSize) - maxTestSize = srcBufferSize-1; + maxTestSize = MIN(maxTestSize, srcBufferSize-16); { U64 const pledgedSrcSize = (FUZ_rand(&lseed) & 3) ? 0 : maxTestSize; CHECK_Z( ZSTD_resetCStream(zc, pledgedSrcSize) ); } @@ -884,12 +895,18 @@ static int fuzzerTests(U32 seed, U32 nbTests, unsigned startTest, double compres size_t const randomDstSize = FUZ_randomLength(&lseed, maxSampleLog); size_t const dstBuffSize = MIN(dstBufferSize - totalGenSize, randomDstSize); inBuff.size = inBuff.pos + readCSrcSize; - outBuff.size = inBuff.pos + dstBuffSize; + outBuff.size = outBuff.pos + dstBuffSize; decompressionResult = ZSTD_decompressStream(zd, &outBuff, &inBuff); - CHECK (ZSTD_isError(decompressionResult), "decompression error : %s", ZSTD_getErrorName(decompressionResult)); + if (ZSTD_getErrorCode(decompressionResult) == ZSTD_error_checksum_wrong) { + DISPLAY("checksum error : \n"); + findDiff(copyBuffer, dstBuffer, totalTestSize); + } + CHECK( ZSTD_isError(decompressionResult), "decompression error : %s", + ZSTD_getErrorName(decompressionResult) ); } CHECK (decompressionResult != 0, "frame not fully decoded"); - CHECK (outBuff.pos != totalTestSize, "decompressed data : wrong size") + CHECK (outBuff.pos != totalTestSize, "decompressed data : wrong size (%u != %u)", + (U32)outBuff.pos, (U32)totalTestSize); CHECK (inBuff.pos != cSize, "compressed data should be fully read") { U64 const crcDest = XXH64(dstBuffer, totalTestSize, 0); if (crcDest!=crcOrig) findDiff(copyBuffer, dstBuffer, totalTestSize); @@ -962,15 +979,16 @@ static int fuzzerTests_MT(U32 seed, U32 nbTests, unsigned startTest, double comp U32 result = 0; U32 testNb = 0; U32 coreSeed = seed; - ZSTDMT_CCtx* zc = ZSTDMT_createCCtx(2); /* will be reset sometimes */ + U32 nbThreads = 2; + ZSTDMT_CCtx* zc = ZSTDMT_createCCtx(nbThreads); /* will be reset sometimes */ ZSTD_DStream* zd = ZSTD_createDStream(); /* will be reset sometimes */ ZSTD_DStream* const zd_noise = ZSTD_createDStream(); clock_t const startClock = clock(); const BYTE* dict=NULL; /* can keep same dict on 2 consecutive tests */ size_t dictSize = 0; U32 oldTestLog = 0; - U32 const cLevelMax = bigTests ? (U32)ZSTD_maxCLevel() : g_cLevelMax_smallTests; - U32 const nbThreadsMax = bigTests ? 5 : 2; + int const cLevelMax = bigTests ? (U32)ZSTD_maxCLevel()-1 : g_cLevelMax_smallTests; + U32 const nbThreadsMax = bigTests ? 4 : 2; /* allocations */ cNoiseBuffer[0] = (BYTE*)malloc (srcBufferSize); @@ -1006,16 +1024,16 @@ static int fuzzerTests_MT(U32 seed, U32 nbTests, unsigned startTest, double comp size_t maxTestSize; /* init */ - if (nbTests >= testNb) { DISPLAYUPDATE(2, "\r%6u/%6u ", testNb, nbTests); } - else { DISPLAYUPDATE(2, "\r%6u ", testNb); } + if (testNb < nbTests) { + DISPLAYUPDATE(2, "\r%6u/%6u ", testNb, nbTests); + } else { DISPLAYUPDATE(2, "\r%6u ", testNb); } FUZ_rand(&coreSeed); lseed = coreSeed ^ prime32; /* states full reset (deliberately not synchronized) */ /* some issues can only happen when reusing states */ if ((FUZ_rand(&lseed) & 0xFF) == 131) { - U32 const nbThreadsCandidate = (FUZ_rand(&lseed) % 6) + 1; - U32 const nbThreads = MIN(nbThreadsCandidate, nbThreadsMax); + nbThreads = (FUZ_rand(&lseed) % nbThreadsMax) + 1; DISPLAYLEVEL(5, "Creating new context with %u threads \n", nbThreads); ZSTDMT_freeCCtx(zc); zc = ZSTDMT_createCCtx(nbThreads); @@ -1055,11 +1073,12 @@ static int fuzzerTests_MT(U32 seed, U32 nbTests, unsigned startTest, double comp } else { U32 const testLog = FUZ_rand(&lseed) % maxSrcLog; U32 const dictLog = FUZ_rand(&lseed) % maxSrcLog; - U32 const cLevelCandidate = (FUZ_rand(&lseed) % - (ZSTD_maxCLevel() - - (MAX(testLog, dictLog) / 3))) + - 1; - U32 const cLevel = MIN(cLevelCandidate, cLevelMax); + int const cLevelCandidate = ( FUZ_rand(&lseed) + % (ZSTD_maxCLevel() - (MAX(testLog, dictLog) / 2)) ) + + 1; + int const cLevelThreadAdjusted = cLevelCandidate - (nbThreads * 2) + 2; /* reduce cLevel when multiple threads to reduce memory consumption */ + int const cLevelMin = MAX(cLevelThreadAdjusted, 1); /* no negative cLevel yet */ + int const cLevel = MIN(cLevelMin, cLevelMax); maxTestSize = FUZ_rLogLength(&lseed, testLog); oldTestLog = testLog; /* random dictionary selection */ @@ -1142,7 +1161,7 @@ static int fuzzerTests_MT(U32 seed, U32 nbTests, unsigned startTest, double comp size_t const randomDstSize = FUZ_randomLength(&lseed, maxSampleLog); size_t const dstBuffSize = MIN(dstBufferSize - totalGenSize, randomDstSize); inBuff.size = inBuff.pos + readCSrcSize; - outBuff.size = inBuff.pos + dstBuffSize; + outBuff.size = outBuff.pos + dstBuffSize; DISPLAYLEVEL(5, "ZSTD_decompressStream input %u bytes \n", (U32)readCSrcSize); decompressionResult = ZSTD_decompressStream(zd, &outBuff, &inBuff); CHECK (ZSTD_isError(decompressionResult), "decompression error : %s", ZSTD_getErrorName(decompressionResult)); @@ -1204,9 +1223,21 @@ static int fuzzerTests_MT(U32 seed, U32 nbTests, unsigned startTest, double comp goto _cleanup; } +/** If useOpaqueAPI, sets param in cctxParams. + * Otherwise, sets the param in zc. */ +static size_t setCCtxParameter(ZSTD_CCtx* zc, ZSTD_CCtx_params* cctxParams, + ZSTD_cParameter param, unsigned value, + U32 useOpaqueAPI) +{ + if (useOpaqueAPI) { + return ZSTD_CCtxParam_setParameter(cctxParams, param, value); + } else { + return ZSTD_CCtx_setParameter(zc, param, value); + } +} /* Tests for ZSTD_compress_generic() API */ -static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest, double compressibility, int bigTests) +static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest, double compressibility, int bigTests, U32 const useOpaqueAPI) { U32 const maxSrcLog = bigTests ? 24 : 22; static const U32 maxSampleLog = 19; @@ -1228,8 +1259,10 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest, double const BYTE* dict = NULL; /* can keep same dict on 2 consecutive tests */ size_t dictSize = 0; U32 oldTestLog = 0; - U32 const cLevelMax = bigTests ? (U32)ZSTD_maxCLevel() : g_cLevelMax_smallTests; - U32 const nbThreadsMax = bigTests ? 5 : 1; + U32 windowLogMalus = 0; /* can survive between 2 loops */ + U32 const cLevelMax = bigTests ? (U32)ZSTD_maxCLevel()-1 : g_cLevelMax_smallTests; + U32 const nbThreadsMax = bigTests ? 4 : 2; + ZSTD_CCtx_params* cctxParams = ZSTD_createCCtxParams(); /* allocations */ cNoiseBuffer[0] = (BYTE*)malloc (srcBufferSize); @@ -1269,6 +1302,7 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest, double else { DISPLAYUPDATE(2, "\r%6u ", testNb); } FUZ_rand(&coreSeed); lseed = coreSeed ^ prime32; + DISPLAYLEVEL(5, " *** Test %u *** \n", testNb); /* states full reset (deliberately not synchronized) */ /* some issues can only happen when reusing states */ @@ -1308,17 +1342,19 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest, double maxTestSize = FUZ_randomLength(&lseed, oldTestLog+2); if (maxTestSize >= srcBufferSize) maxTestSize = srcBufferSize-1; { int const compressionLevel = (FUZ_rand(&lseed) % 5) + 1; - CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_p_compressionLevel, compressionLevel) ); + CHECK_Z (setCCtxParameter(zc, cctxParams, ZSTD_p_compressionLevel, compressionLevel, useOpaqueAPI) ); } } else { U32 const testLog = FUZ_rand(&lseed) % maxSrcLog; U32 const dictLog = FUZ_rand(&lseed) % maxSrcLog; U32 const cLevelCandidate = (FUZ_rand(&lseed) % (ZSTD_maxCLevel() - - (MAX(testLog, dictLog) / 3))) + + (MAX(testLog, dictLog) / 2))) + 1; U32 const cLevel = MIN(cLevelCandidate, cLevelMax); + DISPLAYLEVEL(5, "t%u: cLevel : %u \n", testNb, cLevel); maxTestSize = FUZ_rLogLength(&lseed, testLog); + DISPLAYLEVEL(5, "t%u: maxTestSize : %u \n", testNb, (U32)maxTestSize); oldTestLog = testLog; /* random dictionary selection */ dictSize = ((FUZ_rand(&lseed)&63)==1) ? FUZ_rLogLength(&lseed, dictLog) : 0; @@ -1328,51 +1364,90 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest, double } { U64 const pledgedSrcSize = (FUZ_rand(&lseed) & 3) ? ZSTD_CONTENTSIZE_UNKNOWN : maxTestSize; ZSTD_compressionParameters cParams = ZSTD_getCParams(cLevel, pledgedSrcSize, dictSize); + static const U32 windowLogMax = 24; /* mess with compression parameters */ cParams.windowLog += (FUZ_rand(&lseed) & 3) - 1; + cParams.windowLog = MIN(windowLogMax, cParams.windowLog); cParams.hashLog += (FUZ_rand(&lseed) & 3) - 1; cParams.chainLog += (FUZ_rand(&lseed) & 3) - 1; cParams.searchLog += (FUZ_rand(&lseed) & 3) - 1; cParams.searchLength += (FUZ_rand(&lseed) & 3) - 1; - cParams.targetLength = (U32)(cParams.targetLength * (0.5 + ((double)(FUZ_rand(&lseed) & 127) / 128))); + cParams.targetLength = (U32)((cParams.targetLength + 1 ) * (0.5 + ((double)(FUZ_rand(&lseed) & 127) / 128))); cParams = ZSTD_adjustCParams(cParams, 0, 0); - if (FUZ_rand(&lseed) & 1) CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_p_windowLog, cParams.windowLog) ); - if (FUZ_rand(&lseed) & 1) CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_p_hashLog, cParams.hashLog) ); - if (FUZ_rand(&lseed) & 1) CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_p_chainLog, cParams.chainLog) ); - if (FUZ_rand(&lseed) & 1) CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_p_searchLog, cParams.searchLog) ); - if (FUZ_rand(&lseed) & 1) CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_p_minMatch, cParams.searchLength) ); - if (FUZ_rand(&lseed) & 1) CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_p_targetLength, cParams.targetLength) ); - - /* unconditionally set, to be sync with decoder */ - if (FUZ_rand(&lseed) & 1) CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_p_refDictContent, FUZ_rand(&lseed) & 1) ); if (FUZ_rand(&lseed) & 1) { - CHECK_Z( ZSTD_CCtx_loadDictionary(zc, dict, dictSize) ); - if (dict && dictSize) { - /* test that compression parameters are rejected (correctly) after loading a non-NULL dictionary */ - size_t const setError = ZSTD_CCtx_setParameter(zc, ZSTD_p_windowLog, cParams.windowLog-1) ; - CHECK(!ZSTD_isError(setError), "ZSTD_CCtx_setParameter should have failed"); - } } else { - CHECK_Z( ZSTD_CCtx_refPrefix(zc, dict, dictSize) ); + CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_windowLog, cParams.windowLog, useOpaqueAPI) ); + assert(cParams.windowLog >= ZSTD_WINDOWLOG_MIN); /* guaranteed by ZSTD_adjustCParams() */ + windowLogMalus = (cParams.windowLog - ZSTD_WINDOWLOG_MIN) / 5; + DISPLAYLEVEL(5, "t%u: windowLog : %u \n", testNb, cParams.windowLog); } + if (FUZ_rand(&lseed) & 1) { + CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_hashLog, cParams.hashLog, useOpaqueAPI) ); + DISPLAYLEVEL(5, "t%u: hashLog : %u \n", testNb, cParams.hashLog); + } + if (FUZ_rand(&lseed) & 1) { + CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_chainLog, cParams.chainLog, useOpaqueAPI) ); + DISPLAYLEVEL(5, "t%u: chainLog : %u \n", testNb, cParams.chainLog); + } + if (FUZ_rand(&lseed) & 1) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_searchLog, cParams.searchLog, useOpaqueAPI) ); + if (FUZ_rand(&lseed) & 1) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_minMatch, cParams.searchLength, useOpaqueAPI) ); + if (FUZ_rand(&lseed) & 1) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_targetLength, cParams.targetLength, useOpaqueAPI) ); + + /* mess with long distance matching parameters */ + if (FUZ_rand(&lseed) & 1) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_enableLongDistanceMatching, FUZ_rand(&lseed) & 63, useOpaqueAPI) ); + if (FUZ_rand(&lseed) & 3) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_ldmHashLog, FUZ_randomClampedLength(&lseed, ZSTD_HASHLOG_MIN, 23), useOpaqueAPI) ); + if (FUZ_rand(&lseed) & 3) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_ldmMinMatch, FUZ_randomClampedLength(&lseed, ZSTD_LDM_MINMATCH_MIN, ZSTD_LDM_MINMATCH_MAX), useOpaqueAPI) ); + if (FUZ_rand(&lseed) & 3) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_ldmBucketSizeLog, FUZ_randomClampedLength(&lseed, 0, ZSTD_LDM_BUCKETSIZELOG_MAX), useOpaqueAPI) ); + if (FUZ_rand(&lseed) & 3) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_ldmHashEveryLog, FUZ_randomClampedLength(&lseed, 0, ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN), useOpaqueAPI) ); /* mess with frame parameters */ - if (FUZ_rand(&lseed) & 1) CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_p_checksumFlag, FUZ_rand(&lseed) & 1) ); - if (FUZ_rand(&lseed) & 1) CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_p_dictIDFlag, FUZ_rand(&lseed) & 1) ); - if (FUZ_rand(&lseed) & 1) CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_p_contentSizeFlag, FUZ_rand(&lseed) & 1) ); + if (FUZ_rand(&lseed) & 1) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_checksumFlag, FUZ_rand(&lseed) & 1, useOpaqueAPI) ); + if (FUZ_rand(&lseed) & 1) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_dictIDFlag, FUZ_rand(&lseed) & 1, useOpaqueAPI) ); + if (FUZ_rand(&lseed) & 1) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_contentSizeFlag, FUZ_rand(&lseed) & 1, useOpaqueAPI) ); if (FUZ_rand(&lseed) & 1) CHECK_Z( ZSTD_CCtx_setPledgedSrcSize(zc, pledgedSrcSize) ); - DISPLAYLEVEL(5, "pledgedSrcSize : %u \n", (U32)pledgedSrcSize); + DISPLAYLEVEL(5, "t%u: pledgedSrcSize : %u \n", testNb, (U32)pledgedSrcSize); /* multi-threading parameters */ { U32 const nbThreadsCandidate = (FUZ_rand(&lseed) & 4) + 1; - U32 const nbThreads = MIN(nbThreadsCandidate, nbThreadsMax); - CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_p_nbThreads, nbThreads) ); + U32 const nbThreadsAdjusted = (windowLogMalus < nbThreadsCandidate) ? nbThreadsCandidate - windowLogMalus : 1; + U32 const nbThreads = MIN(nbThreadsAdjusted, nbThreadsMax); + CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_nbThreads, nbThreads, useOpaqueAPI) ); + DISPLAYLEVEL(5, "t%u: nbThreads : %u \n", testNb, nbThreads); if (nbThreads > 1) { U32 const jobLog = FUZ_rand(&lseed) % (testLog+1); - CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_p_overlapSizeLog, FUZ_rand(&lseed) % 10) ); - CHECK_Z( ZSTD_CCtx_setParameter(zc, ZSTD_p_jobSize, (U32)FUZ_rLogLength(&lseed, jobLog)) ); - } } } } + CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_overlapSizeLog, FUZ_rand(&lseed) % 10, useOpaqueAPI) ); + CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_jobSize, (U32)FUZ_rLogLength(&lseed, jobLog), useOpaqueAPI) ); + } + } + + if (FUZ_rand(&lseed) & 1) CHECK_Z (setCCtxParameter(zc, cctxParams, ZSTD_p_forceMaxWindow, FUZ_rand(&lseed) & 1, useOpaqueAPI) ); + + /* Apply parameters */ + if (useOpaqueAPI) { + CHECK_Z (ZSTD_CCtx_setParametersUsingCCtxParams(zc, cctxParams) ); + } + + if (FUZ_rand(&lseed) & 1) { + if (FUZ_rand(&lseed) & 1) { + CHECK_Z( ZSTD_CCtx_loadDictionary(zc, dict, dictSize) ); + } else { + CHECK_Z( ZSTD_CCtx_loadDictionary_byReference(zc, dict, dictSize) ); + } + if (dict && dictSize) { + /* test that compression parameters are rejected (correctly) after loading a non-NULL dictionary */ + if (useOpaqueAPI) { + size_t const setError = ZSTD_CCtx_setParametersUsingCCtxParams(zc, cctxParams); + CHECK(!ZSTD_isError(setError), "ZSTD_CCtx_setParametersUsingCCtxParams should have failed"); + } else { + size_t const setError = ZSTD_CCtx_setParameter(zc, ZSTD_p_windowLog, cParams.windowLog-1); + CHECK(!ZSTD_isError(setError), "ZSTD_CCtx_setParameter should have failed"); + } + } + } else { + CHECK_Z( ZSTD_CCtx_refPrefix(zc, dict, dictSize) ); + } + } } /* multi-segments compression test */ XXH64_reset(&xxhState, 0); @@ -1389,7 +1464,7 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest, double outBuff.size = outBuff.pos + dstBuffSize; CHECK_Z( ZSTD_compress_generic(zc, &outBuff, &inBuff, flush) ); - DISPLAYLEVEL(5, "compress consumed %u bytes (total : %u) \n", + DISPLAYLEVEL(6, "compress consumed %u bytes (total : %u) \n", (U32)inBuff.pos, (U32)(totalTestSize + inBuff.pos)); XXH64_update(&xxhState, srcBuffer+srcStart, inBuff.pos); @@ -1404,11 +1479,11 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest, double size_t const randomDstSize = FUZ_randomLength(&lseed, maxSampleLog+1); size_t const adjustedDstSize = MIN(cBufferSize - cSize, randomDstSize); outBuff.size = outBuff.pos + adjustedDstSize; - DISPLAYLEVEL(5, "End-flush into dst buffer of size %u \n", (U32)adjustedDstSize); + DISPLAYLEVEL(6, "End-flush into dst buffer of size %u \n", (U32)adjustedDstSize); remainingToFlush = ZSTD_compress_generic(zc, &outBuff, &inBuff, ZSTD_e_end); - CHECK(ZSTD_isError(remainingToFlush), - "ZSTD_compress_generic w/ ZSTD_e_end error : %s", - ZSTD_getErrorName(remainingToFlush) ); + CHECK( ZSTD_isError(remainingToFlush), + "ZSTD_compress_generic w/ ZSTD_e_end error : %s", + ZSTD_getErrorName(remainingToFlush) ); } } crcOrig = XXH64_digest(&xxhState); cSize = outBuff.pos; @@ -1431,12 +1506,12 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest, double size_t const randomDstSize = FUZ_randomLength(&lseed, maxSampleLog); size_t const dstBuffSize = MIN(dstBufferSize - totalGenSize, randomDstSize); inBuff.size = inBuff.pos + readCSrcSize; - outBuff.size = inBuff.pos + dstBuffSize; - DISPLAYLEVEL(5, "ZSTD_decompressStream input %u bytes (pos:%u/%u)\n", + outBuff.size = outBuff.pos + dstBuffSize; + DISPLAYLEVEL(6, "ZSTD_decompressStream input %u bytes (pos:%u/%u)\n", (U32)readCSrcSize, (U32)inBuff.pos, (U32)cSize); decompressionResult = ZSTD_decompressStream(zd, &outBuff, &inBuff); CHECK (ZSTD_isError(decompressionResult), "decompression error : %s", ZSTD_getErrorName(decompressionResult)); - DISPLAYLEVEL(5, "inBuff.pos = %u \n", (U32)readCSrcSize); + DISPLAYLEVEL(6, "inBuff.pos = %u \n", (U32)readCSrcSize); } CHECK (outBuff.pos != totalTestSize, "decompressed data : wrong size (%u != %u)", (U32)outBuff.pos, (U32)totalTestSize); CHECK (inBuff.pos != cSize, "compressed data should be fully read (%u != %u)", (U32)inBuff.pos, (U32)cSize); @@ -1479,6 +1554,7 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest, double ZSTD_freeCCtx(zc); ZSTD_freeDStream(zd); ZSTD_freeDStream(zd_noise); + ZSTD_freeCCtxParams(cctxParams); free(cNoiseBuffer[0]); free(cNoiseBuffer[1]); free(cNoiseBuffer[2]); @@ -1494,7 +1570,6 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest, double goto _cleanup; } - /*-******************************************************* * Command line *********************************************************/ @@ -1530,6 +1605,7 @@ int main(int argc, const char** argv) e_api selected_api = simple_api; const char* const programName = argv[0]; ZSTD_customMem const customNULL = ZSTD_defaultCMem; + U32 useOpaqueAPI = 0; /* Check command line */ for(argNb=1; argNb17) displayName += strlen(displayName)-17; /* can only display 17 characters */ - UTIL_initTimer(&ticksPerSecond); /* Init blockTable data */ { z_const char* srcPtr = (z_const char*)srcBuffer; @@ -210,17 +207,17 @@ static int BMK_benchMem(z_const void* srcBuffer, size_t srcSize, size_t cSize = 0; double ratio = 0.; - UTIL_getTime(&coolTime); + coolTime = UTIL_getTime(); DISPLAYLEVEL(2, "\r%79s\r", ""); while (!cCompleted | !dCompleted) { UTIL_time_t clockStart; U64 clockLoop = g_nbIterations ? TIMELOOP_MICROSEC : 1; /* overheat protection */ - if (UTIL_clockSpanMicro(coolTime, ticksPerSecond) > ACTIVEPERIOD_MICROSEC) { + if (UTIL_clockSpanMicro(coolTime) > ACTIVEPERIOD_MICROSEC) { DISPLAYLEVEL(2, "\rcooling down ... \r"); UTIL_sleep(COOLPERIOD_SEC); - UTIL_getTime(&coolTime); + coolTime = UTIL_getTime(); } /* Compression */ @@ -228,15 +225,15 @@ static int BMK_benchMem(z_const void* srcBuffer, size_t srcSize, if (!cCompleted) memset(compressedBuffer, 0xE5, maxCompressedSize); /* warm up and erase result buffer */ UTIL_sleepMilli(1); /* give processor time to other processes */ - UTIL_waitForNextTick(ticksPerSecond); - UTIL_getTime(&clockStart); + UTIL_waitForNextTick(); + clockStart = UTIL_getTime(); if (!cCompleted) { /* still some time to do compression tests */ U32 nbLoops = 0; if (compressor == BMK_ZSTD) { ZSTD_parameters const zparams = ZSTD_getParams(cLevel, avgSize, dictBufferSize); ZSTD_customMem const cmem = { NULL, NULL, NULL }; - ZSTD_CDict* const cdict = ZSTD_createCDict_advanced(dictBuffer, dictBufferSize, 1 /*byRef*/, ZSTD_dm_auto, zparams.cParams, cmem); + ZSTD_CDict* const cdict = ZSTD_createCDict_advanced(dictBuffer, dictBufferSize, ZSTD_dlm_byRef, ZSTD_dm_auto, zparams.cParams, cmem); if (cdict==NULL) EXM_THROW(1, "ZSTD_createCDict_advanced() allocation failure"); do { @@ -257,7 +254,7 @@ static int BMK_benchMem(z_const void* srcBuffer, size_t srcSize, blockTable[blockNb].cSize = rSize; } nbLoops++; - } while (UTIL_clockSpanMicro(clockStart, ticksPerSecond) < clockLoop); + } while (UTIL_clockSpanMicro(clockStart) < clockLoop); ZSTD_freeCDict(cdict); } else if (compressor == BMK_ZSTD_STREAM) { ZSTD_parameters const zparams = ZSTD_getParams(cLevel, avgSize, dictBufferSize); @@ -286,7 +283,7 @@ static int BMK_benchMem(z_const void* srcBuffer, size_t srcSize, blockTable[blockNb].cSize = outBuffer.pos; } nbLoops++; - } while (UTIL_clockSpanMicro(clockStart, ticksPerSecond) < clockLoop); + } while (UTIL_clockSpanMicro(clockStart) < clockLoop); ZSTD_freeCStream(zbc); } else if (compressor == BMK_ZWRAP_ZLIB_REUSE || compressor == BMK_ZWRAP_ZSTD_REUSE || compressor == BMK_ZLIB_REUSE) { z_stream def; @@ -327,7 +324,7 @@ static int BMK_benchMem(z_const void* srcBuffer, size_t srcSize, blockTable[blockNb].cSize = def.total_out; } nbLoops++; - } while (UTIL_clockSpanMicro(clockStart, ticksPerSecond) < clockLoop); + } while (UTIL_clockSpanMicro(clockStart) < clockLoop); ret = deflateEnd(&def); if (ret != Z_OK) EXM_THROW(1, "deflateEnd failure"); } else { @@ -360,9 +357,9 @@ static int BMK_benchMem(z_const void* srcBuffer, size_t srcSize, blockTable[blockNb].cSize = def.total_out; } nbLoops++; - } while (UTIL_clockSpanMicro(clockStart, ticksPerSecond) < clockLoop); + } while (UTIL_clockSpanMicro(clockStart) < clockLoop); } - { U64 const clockSpan = UTIL_clockSpanMicro(clockStart, ticksPerSecond); + { U64 const clockSpan = UTIL_clockSpanMicro(clockStart); if (clockSpan < fastestC*nbLoops) fastestC = clockSpan / nbLoops; totalCTime += clockSpan; cCompleted = totalCTime>maxTime; @@ -382,8 +379,8 @@ static int BMK_benchMem(z_const void* srcBuffer, size_t srcSize, if (!dCompleted) memset(resultBuffer, 0xD6, srcSize); /* warm result buffer */ UTIL_sleepMilli(1); /* give processor time to other processes */ - UTIL_waitForNextTick(ticksPerSecond); - UTIL_getTime(&clockStart); + UTIL_waitForNextTick(); + clockStart = UTIL_getTime(); if (!dCompleted) { U32 nbLoops = 0; @@ -406,7 +403,7 @@ static int BMK_benchMem(z_const void* srcBuffer, size_t srcSize, blockTable[blockNb].resSize = regenSize; } nbLoops++; - } while (UTIL_clockSpanMicro(clockStart, ticksPerSecond) < clockLoop); + } while (UTIL_clockSpanMicro(clockStart) < clockLoop); ZSTD_freeDDict(ddict); } else if (compressor == BMK_ZSTD_STREAM) { ZSTD_inBuffer inBuffer; @@ -432,7 +429,7 @@ static int BMK_benchMem(z_const void* srcBuffer, size_t srcSize, blockTable[blockNb].resSize = outBuffer.pos; } nbLoops++; - } while (UTIL_clockSpanMicro(clockStart, ticksPerSecond) < clockLoop); + } while (UTIL_clockSpanMicro(clockStart) < clockLoop); ZSTD_freeDStream(zbd); } else if (compressor == BMK_ZWRAP_ZLIB_REUSE || compressor == BMK_ZWRAP_ZSTD_REUSE || compressor == BMK_ZLIB_REUSE) { z_stream inf; @@ -468,7 +465,7 @@ static int BMK_benchMem(z_const void* srcBuffer, size_t srcSize, blockTable[blockNb].resSize = inf.total_out; } nbLoops++; - } while (UTIL_clockSpanMicro(clockStart, ticksPerSecond) < clockLoop); + } while (UTIL_clockSpanMicro(clockStart) < clockLoop); ret = inflateEnd(&inf); if (ret != Z_OK) EXM_THROW(1, "inflateEnd failure"); } else { @@ -502,9 +499,9 @@ static int BMK_benchMem(z_const void* srcBuffer, size_t srcSize, blockTable[blockNb].resSize = inf.total_out; } nbLoops++; - } while (UTIL_clockSpanMicro(clockStart, ticksPerSecond) < clockLoop); + } while (UTIL_clockSpanMicro(clockStart) < clockLoop); } - { U64 const clockSpan = UTIL_clockSpanMicro(clockStart, ticksPerSecond); + { U64 const clockSpan = UTIL_clockSpanMicro(clockStart); if (clockSpan < fastestD*nbLoops) fastestD = clockSpan / nbLoops; totalDTime += clockSpan; dCompleted = totalDTime>maxTime; diff --git a/contrib/zstd/zlibWrapper/gzclose.c b/sys/contrib/zstd/zlibWrapper/gzclose.c similarity index 100% rename from contrib/zstd/zlibWrapper/gzclose.c rename to sys/contrib/zstd/zlibWrapper/gzclose.c diff --git a/contrib/zstd/zlibWrapper/gzcompatibility.h b/sys/contrib/zstd/zlibWrapper/gzcompatibility.h similarity index 92% rename from contrib/zstd/zlibWrapper/gzcompatibility.h rename to sys/contrib/zstd/zlibWrapper/gzcompatibility.h index ac9020acc15b..ea8d50c8238a 100644 --- a/contrib/zstd/zlibWrapper/gzcompatibility.h +++ b/sys/contrib/zstd/zlibWrapper/gzcompatibility.h @@ -1,10 +1,11 @@ /* - * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * Copyright (c) 2016-present, Przemyslaw Skibinski, Yann Collet, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ diff --git a/contrib/zstd/zlibWrapper/gzguts.h b/sys/contrib/zstd/zlibWrapper/gzguts.h similarity index 100% rename from contrib/zstd/zlibWrapper/gzguts.h rename to sys/contrib/zstd/zlibWrapper/gzguts.h diff --git a/contrib/zstd/zlibWrapper/gzlib.c b/sys/contrib/zstd/zlibWrapper/gzlib.c similarity index 100% rename from contrib/zstd/zlibWrapper/gzlib.c rename to sys/contrib/zstd/zlibWrapper/gzlib.c diff --git a/contrib/zstd/zlibWrapper/gzread.c b/sys/contrib/zstd/zlibWrapper/gzread.c similarity index 100% rename from contrib/zstd/zlibWrapper/gzread.c rename to sys/contrib/zstd/zlibWrapper/gzread.c diff --git a/contrib/zstd/zlibWrapper/gzwrite.c b/sys/contrib/zstd/zlibWrapper/gzwrite.c similarity index 100% rename from contrib/zstd/zlibWrapper/gzwrite.c rename to sys/contrib/zstd/zlibWrapper/gzwrite.c diff --git a/contrib/zstd/zlibWrapper/zstd_zlibwrapper.c b/sys/contrib/zstd/zlibWrapper/zstd_zlibwrapper.c similarity index 99% rename from contrib/zstd/zlibWrapper/zstd_zlibwrapper.c rename to sys/contrib/zstd/zlibWrapper/zstd_zlibwrapper.c index 272369a2874c..c5fbdf98e19d 100644 --- a/contrib/zstd/zlibWrapper/zstd_zlibwrapper.c +++ b/sys/contrib/zstd/zlibWrapper/zstd_zlibwrapper.c @@ -1,10 +1,11 @@ /* - * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * Copyright (c) 2016-present, Przemyslaw Skibinski, Yann Collet, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ diff --git a/contrib/zstd/zlibWrapper/zstd_zlibwrapper.h b/sys/contrib/zstd/zlibWrapper/zstd_zlibwrapper.h similarity index 95% rename from contrib/zstd/zlibWrapper/zstd_zlibwrapper.h rename to sys/contrib/zstd/zlibWrapper/zstd_zlibwrapper.h index f8f36800928e..f828d3191b87 100644 --- a/contrib/zstd/zlibWrapper/zstd_zlibwrapper.h +++ b/sys/contrib/zstd/zlibWrapper/zstd_zlibwrapper.h @@ -1,10 +1,11 @@ /* - * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * Copyright (c) 2016-present, Przemyslaw Skibinski, Yann Collet, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ #ifndef ZSTD_ZLIBWRAPPER_H diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index a297e08738e6..246b65384fec 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -424,7 +424,7 @@ struct sge_eq { struct mtx eq_lock; struct tx_desc *desc; /* KVA of descriptor ring */ - uint16_t doorbells; + uint8_t doorbells; volatile uint32_t *udb; /* KVA of doorbell (lies within BAR2) */ u_int udb_qid; /* relative qid within the doorbell page */ uint16_t sidx; /* index of the entry with the status page */ @@ -695,7 +695,7 @@ struct sge_nm_txq { uint16_t equiqidx; /* EQUIQ last requested at this pidx */ uint16_t equeqidx; /* EQUEQ last requested at this pidx */ uint16_t dbidx; /* pidx of the most recent doorbell */ - uint16_t doorbells; + uint8_t doorbells; volatile uint32_t *udb; u_int udb_qid; u_int cntxt_id; @@ -808,7 +808,7 @@ struct adapter { struct l2t_data *l2t; /* L2 table */ struct tid_info tids; - uint16_t doorbells; + uint8_t doorbells; int offload_map; /* ports with IFCAP_TOE enabled */ int active_ulds; /* ULDs activated on this adapter */ int flags; diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index 34607af04327..c5c88c4563a2 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -3727,12 +3727,13 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int mbox, unsigned int port, V_FW_PORT_CAP_SPEED(M_FW_PORT_CAP_SPEED); } - rcap = aneg | speed | fc | fec | mdi; + rcap = aneg | speed | fc | fec; if ((rcap | lc->supported) != lc->supported) { CH_WARN(adap, "rcap 0x%08x, pcap 0x%08x\n", rcap, lc->supported); rcap &= lc->supported; } + rcap |= mdi; memset(&c, 0, sizeof(c)); c.op_to_portid = cpu_to_be32(V_FW_CMD_OP(FW_PORT_CMD) | diff --git a/sys/dev/hwpmc/hwpmc_logging.c b/sys/dev/hwpmc/hwpmc_logging.c index 2ed5e5ea4809..d06db4d00650 100644 --- a/sys/dev/hwpmc/hwpmc_logging.c +++ b/sys/dev/hwpmc/hwpmc_logging.c @@ -683,6 +683,7 @@ pmclog_configure_log(struct pmc_mdep *md, struct pmc_owner *po, int logfd) (void) fdrop(po->po_file, curthread); po->po_file = NULL; /* clear file and error state */ po->po_error = 0; + po->po_flags &= ~PMC_PO_OWNS_LOGFILE; return (error); } @@ -735,7 +736,7 @@ pmclog_deconfigure_log(struct pmc_owner *po) /* drop a reference to the fd */ if (po->po_file != NULL) { error = fdrop(po->po_file, curthread); - po->po_file = NULL; + po->po_file = NULL; } else error = 0; po->po_error = 0; diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index 7cf3e1f634b9..b715b54294fd 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -2578,10 +2578,9 @@ pmc_find_pmc(pmc_id_t pmcid, struct pmc **pmc) struct pmc_owner *po; struct pmc_process *pp; - KASSERT(PMC_ID_TO_ROWINDEX(pmcid) < md->pmd_npmc, - ("[pmc,%d] Illegal pmc index %d (max %d)", __LINE__, - PMC_ID_TO_ROWINDEX(pmcid), md->pmd_npmc)); PMCDBG1(PMC,FND,1, "find-pmc id=%d", pmcid); + if (PMC_ID_TO_ROWINDEX(pmcid) >= md->pmd_npmc) + return (EINVAL); if ((po = pmc_find_owner_descriptor(curthread->td_proc)) == NULL) { /* diff --git a/sys/dev/mlx4/cmd.h b/sys/dev/mlx4/cmd.h index e2d41bcf417a..fe33e7287f6f 100644 --- a/sys/dev/mlx4/cmd.h +++ b/sys/dev/mlx4/cmd.h @@ -36,6 +36,8 @@ #include #include +struct mlx4_counter; + enum { /* initialization and general commands */ MLX4_CMD_SYS_EN = 0x1, @@ -67,8 +69,13 @@ enum { MLX4_CMD_MAP_ICM_AUX = 0xffc, MLX4_CMD_UNMAP_ICM_AUX = 0xffb, MLX4_CMD_SET_ICM_SIZE = 0xffd, + MLX4_CMD_ACCESS_REG = 0x3b, + MLX4_CMD_ALLOCATE_VPP = 0x80, + MLX4_CMD_SET_VPORT_QOS = 0x81, + /*master notify fw on finish for slave's flr*/ MLX4_CMD_INFORM_FLR_DONE = 0x5b, + MLX4_CMD_VIRT_PORT_MAP = 0x5c, MLX4_CMD_GET_OP_REQ = 0x59, /* TPT commands */ @@ -116,6 +123,7 @@ enum { /* special QP and management commands */ MLX4_CMD_CONF_SPECIAL_QP = 0x23, MLX4_CMD_MAD_IFC = 0x24, + MLX4_CMD_MAD_DEMUX = 0x203, /* multicast commands */ MLX4_CMD_READ_MCG = 0x25, @@ -125,6 +133,7 @@ enum { /* miscellaneous commands */ MLX4_CMD_DIAG_RPRT = 0x30, MLX4_CMD_NOP = 0x31, + MLX4_CMD_CONFIG_DEV = 0x3a, MLX4_CMD_ACCESS_MEM = 0x2e, MLX4_CMD_SET_VEP = 0x52, @@ -158,6 +167,9 @@ enum { MLX4_QP_FLOW_STEERING_ATTACH = 0x65, MLX4_QP_FLOW_STEERING_DETACH = 0x66, MLX4_FLOW_STEERING_IB_UC_QP_RANGE = 0x64, + + /* Update and read QCN parameters */ + MLX4_CMD_CONGESTION_CTRL_OPCODE = 0x68, }; enum { @@ -166,21 +178,42 @@ enum { MLX4_CMD_TIME_CLASS_C = 60000, }; +enum { + /* virtual to physical port mapping opcode modifiers */ + MLX4_GET_PORT_VIRT2PHY = 0x0, + MLX4_SET_PORT_VIRT2PHY = 0x1, +}; + enum { MLX4_MAILBOX_SIZE = 4096, MLX4_ACCESS_MEM_ALIGN = 256, }; enum { - /* set port opcode modifiers */ - MLX4_SET_PORT_GENERAL = 0x0, - MLX4_SET_PORT_RQP_CALC = 0x1, - MLX4_SET_PORT_MAC_TABLE = 0x2, - MLX4_SET_PORT_VLAN_TABLE = 0x3, - MLX4_SET_PORT_PRIO_MAP = 0x4, - MLX4_SET_PORT_GID_TABLE = 0x5, - MLX4_SET_PORT_PRIO2TC = 0x8, - MLX4_SET_PORT_SCHEDULER = 0x9 + /* Set port opcode modifiers */ + MLX4_SET_PORT_IB_OPCODE = 0x0, + MLX4_SET_PORT_ETH_OPCODE = 0x1, + MLX4_SET_PORT_BEACON_OPCODE = 0x4, +}; + +enum { + /* Set port Ethernet input modifiers */ + MLX4_SET_PORT_GENERAL = 0x0, + MLX4_SET_PORT_RQP_CALC = 0x1, + MLX4_SET_PORT_MAC_TABLE = 0x2, + MLX4_SET_PORT_VLAN_TABLE = 0x3, + MLX4_SET_PORT_PRIO_MAP = 0x4, + MLX4_SET_PORT_GID_TABLE = 0x5, + MLX4_SET_PORT_PRIO2TC = 0x8, + MLX4_SET_PORT_SCHEDULER = 0x9, + MLX4_SET_PORT_VXLAN = 0xB, + MLX4_SET_PORT_ROCE_ADDR = 0xD +}; + +enum { + MLX4_CMD_MAD_DEMUX_CONFIG = 0, + MLX4_CMD_MAD_DEMUX_QUERY_STATE = 1, + MLX4_CMD_MAD_DEMUX_QUERY_RESTR = 2, /* Query mad demux restrictions */ }; enum { @@ -188,6 +221,43 @@ enum { MLX4_CMD_NATIVE }; +/* + * MLX4_RX_CSUM_MODE_VAL_NON_TCP_UDP - + * Receive checksum value is reported in CQE also for non TCP/UDP packets. + * + * MLX4_RX_CSUM_MODE_L4 - + * L4_CSUM bit in CQE, which indicates whether or not L4 checksum + * was validated correctly, is supported. + * + * MLX4_RX_CSUM_MODE_IP_OK_IP_NON_TCP_UDP - + * IP_OK CQE's field is supported also for non TCP/UDP IP packets. + * + * MLX4_RX_CSUM_MODE_MULTI_VLAN - + * Receive Checksum offload is supported for packets with more than 2 vlan headers. + */ +enum mlx4_rx_csum_mode { + MLX4_RX_CSUM_MODE_VAL_NON_TCP_UDP = 1UL << 0, + MLX4_RX_CSUM_MODE_L4 = 1UL << 1, + MLX4_RX_CSUM_MODE_IP_OK_IP_NON_TCP_UDP = 1UL << 2, + MLX4_RX_CSUM_MODE_MULTI_VLAN = 1UL << 3 +}; + +struct mlx4_config_dev_params { + u16 vxlan_udp_dport; + u8 rx_csum_flags_port_1; + u8 rx_csum_flags_port_2; +}; + +enum mlx4_en_congestion_control_algorithm { + MLX4_CTRL_ALGO_802_1_QAU_REACTION_POINT = 0, +}; + +enum mlx4_en_congestion_control_opmod { + MLX4_CONGESTION_CONTROL_GET_PARAMS, + MLX4_CONGESTION_CONTROL_GET_STATISTICS, + MLX4_CONGESTION_CONTROL_SET_PARAMS = 4, +}; + struct mlx4_dev; struct mlx4_cmd_mailbox { @@ -233,26 +303,28 @@ static inline int mlx4_cmd_imm(struct mlx4_dev *dev, u64 in_param, u64 *out_para struct mlx4_cmd_mailbox *mlx4_alloc_cmd_mailbox(struct mlx4_dev *dev); void mlx4_free_cmd_mailbox(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox); +int mlx4_get_counter_stats(struct mlx4_dev *dev, int counter_index, + struct mlx4_counter *counter_stats, int reset); u32 mlx4_comm_get_version(void); -int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u8 *mac); -int mlx4_set_vf_vlan(struct mlx4_dev *dev, int port, int vf, u16 vlan, u8 qos); +int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u64 mac); +int mlx4_set_vf_vlan(struct mlx4_dev *dev, int port, int vf, u16 vlan, + u8 qos, __be16 proto); +int mlx4_set_vf_rate(struct mlx4_dev *dev, int port, int vf, int min_tx_rate, + int max_tx_rate); int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting); -int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_state); -int mlx4_get_vf_link_state(struct mlx4_dev *dev, int port, int vf); +int mlx4_config_dev_retrieval(struct mlx4_dev *dev, + struct mlx4_config_dev_params *params); +void mlx4_cmd_wake_completions(struct mlx4_dev *dev); +void mlx4_report_internal_err_comm_event(struct mlx4_dev *dev); /* * mlx4_get_slave_default_vlan - - * retrun true if VST ( default vlan) - * if VST will fill vlan & qos (if not NULL) + * return true if VST ( default vlan) + * if VST, will return vlan & qos (if not NULL) */ -bool mlx4_get_slave_default_vlan(struct mlx4_dev *dev, int port, int slave, u16 *vlan, u8 *qos); - -enum { - IFLA_VF_LINK_STATE_AUTO, /* link state of the uplink */ - IFLA_VF_LINK_STATE_ENABLE, /* link always up */ - IFLA_VF_LINK_STATE_DISABLE, /* link always down */ - __IFLA_VF_LINK_STATE_MAX, -}; +bool mlx4_get_slave_default_vlan(struct mlx4_dev *dev, int port, int slave, + u16 *vlan, u8 *qos); #define MLX4_COMM_GET_IF_REV(cmd_chan_ver) (u8)((cmd_chan_ver) >> 8) +#define COMM_CHAN_EVENT_INTERNAL_ERR (1 << 17) #endif /* MLX4_CMD_H */ diff --git a/sys/dev/mlx4/cq.h b/sys/dev/mlx4/cq.h index e7d6ddd7538f..6b338d842139 100644 --- a/sys/dev/mlx4/cq.h +++ b/sys/dev/mlx4/cq.h @@ -42,31 +42,22 @@ struct mlx4_cqe { __be32 vlan_my_qpn; __be32 immed_rss_invalid; __be32 g_mlpath_rqpn; + __be16 sl_vid; union { struct { - union { - struct { - __be16 sl_vid; - __be16 rlid; - }; - __be32 timestamp_16_47; - }; + __be16 rlid; __be16 status; u8 ipv6_ext_mask; u8 badfcs_enc; }; - struct { - __be16 reserved1; - u8 smac[6]; - }; + u8 smac[ETH_ALEN]; }; __be32 byte_cnt; __be16 wqe_index; __be16 checksum; - u8 reserved2[1]; - __be16 timestamp_0_15; + u8 reserved[3]; u8 owner_sr_opcode; -} __packed; +}; struct mlx4_err_cqe { __be32 my_qpn; @@ -95,7 +86,13 @@ struct mlx4_ts_cqe { } __packed; enum { - MLX4_CQE_VLAN_PRESENT_MASK = 1 << 29, + MLX4_CQE_L2_TUNNEL_IPOK = 1 << 31, + MLX4_CQE_CVLAN_PRESENT_MASK = 1 << 29, + MLX4_CQE_SVLAN_PRESENT_MASK = 1 << 30, + MLX4_CQE_L2_TUNNEL = 1 << 27, + MLX4_CQE_L2_TUNNEL_CSUM = 1 << 26, + MLX4_CQE_L2_TUNNEL_IPV4 = 1 << 25, + MLX4_CQE_QPN_MASK = 0xffffff, MLX4_CQE_VID_MASK = 0xfff, }; @@ -177,5 +174,5 @@ int mlx4_cq_modify(struct mlx4_dev *dev, struct mlx4_cq *cq, u16 count, u16 period); int mlx4_cq_resize(struct mlx4_dev *dev, struct mlx4_cq *cq, int entries, struct mlx4_mtt *mtt); -int mlx4_cq_ignore_overrun(struct mlx4_dev *dev, struct mlx4_cq *cq); + #endif /* MLX4_CQ_H */ diff --git a/sys/dev/mlx4/device.h b/sys/dev/mlx4/device.h index c9c9dc3bb1cc..9d4c461ada4a 100644 --- a/sys/dev/mlx4/device.h +++ b/sys/dev/mlx4/device.h @@ -39,20 +39,21 @@ #include #include #include +#include +#include + #include #include +#define DEFAULT_UAR_PAGE_SHIFT 12 + #define MAX_MSIX_P_PORT 17 #define MAX_MSIX 64 -#define MSIX_LEGACY_SZ 4 #define MIN_MSIX_P_PORT 5 +#define MLX4_IS_LEGACY_EQ_MODE(dev_cap) ((dev_cap).num_comp_vectors < \ + (dev_cap).num_ports * MIN_MSIX_P_PORT) -#define MLX4_ROCE_MAX_GIDS 128 -#define MLX4_ROCE_PF_GIDS 16 - -#define MLX4_NUM_UP 8 -#define MLX4_NUM_TC 8 #define MLX4_MAX_100M_UNITS_VAL 255 /* * work around: can't set values * greater then this value when @@ -62,6 +63,9 @@ #define MLX4_RATELIMIT_1G_UNITS 4 /* 1 Gbps */ #define MLX4_RATELIMIT_DEFAULT 0x00ff +#define MLX4_ROCE_MAX_GIDS 128 +#define MLX4_ROCE_PF_GIDS 16 + #define CORE_CLOCK_MASK 0xffffffffffffULL enum { @@ -70,8 +74,9 @@ enum { MLX4_FLAG_MASTER = 1 << 2, MLX4_FLAG_SLAVE = 1 << 3, MLX4_FLAG_SRIOV = 1 << 4, - MLX4_FLAG_DEV_NUM_STR = 1 << 5, - MLX4_FLAG_OLD_REG_MAC = 1 << 6, + MLX4_FLAG_OLD_REG_MAC = 1 << 6, + MLX4_FLAG_BONDED = 1 << 7, + MLX4_FLAG_SECURE_HOST = 1 << 8, }; enum { @@ -81,7 +86,8 @@ enum { enum { MLX4_MAX_PORTS = 2, - MLX4_MAX_PORT_PKEYS = 128 + MLX4_MAX_PORT_PKEYS = 128, + MLX4_MAX_PORT_GIDS = 128 }; /* base qkey for use in sriov tunnel-qp/proxy-qp communication. @@ -92,14 +98,14 @@ enum { #define MLX4_RESERVED_QKEY_MASK (0xFFFF0000) enum { - MLX4_BOARD_ID_LEN = 64, - MLX4_VSD_LEN = 208 + MLX4_BOARD_ID_LEN = 64 }; enum { MLX4_MAX_NUM_PF = 16, - MLX4_MAX_NUM_VF = 64, - MLX4_MFUNC_MAX = 80, + MLX4_MAX_NUM_VF = 126, + MLX4_MAX_NUM_VF_P_PORT = 64, + MLX4_MFUNC_MAX = 128, MLX4_MAX_EQ_NUM = 1024, MLX4_MFUNC_EQ_NUM = 4, MLX4_MFUNC_MAX_EQES = 8, @@ -119,6 +125,14 @@ enum { MLX4_STEERING_MODE_DEVICE_MANAGED }; +enum { + MLX4_STEERING_DMFS_A0_DEFAULT, + MLX4_STEERING_DMFS_A0_DYNAMIC, + MLX4_STEERING_DMFS_A0_STATIC, + MLX4_STEERING_DMFS_A0_DISABLE, + MLX4_STEERING_DMFS_A0_NOT_SUPPORTED +}; + static inline const char *mlx4_steering_mode_str(int steering_mode) { switch (steering_mode) { @@ -136,6 +150,11 @@ static inline const char *mlx4_steering_mode_str(int steering_mode) } } +enum { + MLX4_TUNNEL_OFFLOAD_MODE_NONE, + MLX4_TUNNEL_OFFLOAD_MODE_VXLAN +}; + enum { MLX4_DEV_CAP_FLAG_RC = 1LL << 0, MLX4_DEV_CAP_FLAG_UC = 1LL << 1, @@ -161,12 +180,10 @@ enum { MLX4_DEV_CAP_FLAG_UDP_RSS = 1LL << 40, MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41, MLX4_DEV_CAP_FLAG_VEP_MC_STEER = 1LL << 42, - MLX4_DEV_CAP_FLAG_CROSS_CHANNEL = 1LL << 44, MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48, - MLX4_DEV_CAP_FLAG_COUNTERS_EXT = 1LL << 49, - MLX4_DEV_CAP_FLAG_SET_PORT_ETH_SCHED = 1LL << 53, + MLX4_DEV_CAP_FLAG_RSS_IP_FRAG = 1LL << 52, + MLX4_DEV_CAP_FLAG_SET_ETH_SCHED = 1LL << 53, MLX4_DEV_CAP_FLAG_SENSE_SUPPORT = 1LL << 55, - MLX4_DEV_CAP_FLAG_FAST_DROP = 1LL << 57, MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV = 1LL << 59, MLX4_DEV_CAP_FLAG_64B_EQE = 1LL << 61, MLX4_DEV_CAP_FLAG_64B_CQE = 1LL << 62 @@ -177,29 +194,49 @@ enum { MLX4_DEV_CAP_FLAG2_RSS_TOP = 1LL << 1, MLX4_DEV_CAP_FLAG2_RSS_XOR = 1LL << 2, MLX4_DEV_CAP_FLAG2_FS_EN = 1LL << 3, - MLX4_DEV_CAP_FLAG2_FSM = 1LL << 4, - MLX4_DEV_CAP_FLAG2_VLAN_CONTROL = 1LL << 5, - MLX4_DEV_CAP_FLAG2_UPDATE_QP = 1LL << 6, - MLX4_DEV_CAP_FLAG2_LB_SRC_CHK = 1LL << 7, - MLX4_DEV_CAP_FLAG2_DMFS_IPOIB = 1LL << 8, - MLX4_DEV_CAP_FLAG2_ETS_CFG = 1LL << 9, - MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP = 1LL << 10, - MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN = 1LL << 11, - MLX4_DEV_CAP_FLAG2_RECOVERABLE_ERROR_EVENT = 1LL << 12, - MLX4_DEV_CAP_FLAG2_TS = 1LL << 13, - MLX4_DEV_CAP_FLAG2_DRIVER_VERSION_TO_FW = 1LL << 14, - MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN = 1LL << 15, - MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS = 1LL << 16, - MLX4_DEV_CAP_FLAG2_FS_EN_NCSI = 1LL << 17, + MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN = 1LL << 4, + MLX4_DEV_CAP_FLAG2_TS = 1LL << 5, + MLX4_DEV_CAP_FLAG2_VLAN_CONTROL = 1LL << 6, + MLX4_DEV_CAP_FLAG2_FSM = 1LL << 7, + MLX4_DEV_CAP_FLAG2_UPDATE_QP = 1LL << 8, + MLX4_DEV_CAP_FLAG2_DMFS_IPOIB = 1LL << 9, + MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS = 1LL << 10, + MLX4_DEV_CAP_FLAG2_MAD_DEMUX = 1LL << 11, + MLX4_DEV_CAP_FLAG2_CQE_STRIDE = 1LL << 12, + MLX4_DEV_CAP_FLAG2_EQE_STRIDE = 1LL << 13, + MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL = 1LL << 14, + MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP = 1LL << 15, + MLX4_DEV_CAP_FLAG2_CONFIG_DEV = 1LL << 16, + MLX4_DEV_CAP_FLAG2_SYS_EQS = 1LL << 17, MLX4_DEV_CAP_FLAG2_80_VFS = 1LL << 18, - MLX4_DEV_CAP_FLAG2_DMFS_TAG_MODE = 1LL << 19, - MLX4_DEV_CAP_FLAG2_ROCEV2 = 1LL << 20, - MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL = 1LL << 21, - MLX4_DEV_CAP_FLAG2_CQE_STRIDE = 1LL << 22, - MLX4_DEV_CAP_FLAG2_EQE_STRIDE = 1LL << 23, - MLX4_DEV_CAP_FLAG2_UPDATE_QP_SRC_CHECK_LB = 1LL << 24, - MLX4_DEV_CAP_FLAG2_RX_CSUM_MODE = 1LL << 25, - MLX4_DEV_CAP_FLAG2_SYS_EQS = 1LL << 26, + MLX4_DEV_CAP_FLAG2_FS_A0 = 1LL << 19, + MLX4_DEV_CAP_FLAG2_RECOVERABLE_ERROR_EVENT = 1LL << 20, + MLX4_DEV_CAP_FLAG2_PORT_REMAP = 1LL << 21, + MLX4_DEV_CAP_FLAG2_QCN = 1LL << 22, + MLX4_DEV_CAP_FLAG2_QP_RATE_LIMIT = 1LL << 23, + MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN = 1LL << 24, + MLX4_DEV_CAP_FLAG2_QOS_VPP = 1LL << 25, + MLX4_DEV_CAP_FLAG2_ETS_CFG = 1LL << 26, + MLX4_DEV_CAP_FLAG2_PORT_BEACON = 1LL << 27, + MLX4_DEV_CAP_FLAG2_IGNORE_FCS = 1LL << 28, + MLX4_DEV_CAP_FLAG2_PHV_EN = 1LL << 29, + MLX4_DEV_CAP_FLAG2_SKIP_OUTER_VLAN = 1LL << 30, + MLX4_DEV_CAP_FLAG2_UPDATE_QP_SRC_CHECK_LB = 1ULL << 31, + MLX4_DEV_CAP_FLAG2_LB_SRC_CHK = 1ULL << 32, + MLX4_DEV_CAP_FLAG2_ROCE_V1_V2 = 1ULL << 33, + MLX4_DEV_CAP_FLAG2_DMFS_UC_MC_SNIFFER = 1ULL << 34, + MLX4_DEV_CAP_FLAG2_DIAG_PER_PORT = 1ULL << 35, + MLX4_DEV_CAP_FLAG2_SVLAN_BY_QP = 1ULL << 36, + MLX4_DEV_CAP_FLAG2_SL_TO_VL_CHANGE_EVENT = 1ULL << 37, +}; + +enum { + MLX4_QUERY_FUNC_FLAGS_BF_RES_QP = 1LL << 0, + MLX4_QUERY_FUNC_FLAGS_A0_RES_QP = 1LL << 1 +}; + +enum { + MLX4_VF_CAP_FLAG_RESET = 1 << 0 }; /* bit enums for an 8-bit flags field indicating special use @@ -211,53 +248,45 @@ enum { * This enum may use only bits 0..7. */ enum { - MLX4_RESERVE_BF_QP = 1 << 7, + MLX4_RESERVE_A0_QP = 1 << 6, + MLX4_RESERVE_ETH_BF_QP = 1 << 7, }; -enum { - MLX4_DEV_CAP_CQ_FLAG_IO = 1 << 0 -}; - -enum { - MLX4_QUERY_FUNC_FLAGS_BF_RES_QP = 1LL << 0 -}; - -/* bit enums for an 8-bit flags field indicating special use - * QPs which require special handling in qp_reserve_range. - * Currently, this only includes QPs used by the ETH interface, - * where we expect to use blueflame. These QPs must not have - * bits 6 and 7 set in their qp number. - * - * This enum may use only bits 0..7. - */ -enum { - MLX4_RESERVE_ETH_BF_QP = 1 << 7, -}; - - enum { MLX4_DEV_CAP_64B_EQE_ENABLED = 1LL << 0, - MLX4_DEV_CAP_64B_CQE_ENABLED = 1LL << 1 + MLX4_DEV_CAP_64B_CQE_ENABLED = 1LL << 1, + MLX4_DEV_CAP_CQE_STRIDE_ENABLED = 1LL << 2, + MLX4_DEV_CAP_EQE_STRIDE_ENABLED = 1LL << 3 }; enum { - MLX4_USER_DEV_CAP_64B_CQE = 1L << 0 + MLX4_USER_DEV_CAP_LARGE_CQE = 1L << 0 }; enum { - MLX4_FUNC_CAP_64B_EQE_CQE = 1L << 0 + MLX4_FUNC_CAP_64B_EQE_CQE = 1L << 0, + MLX4_FUNC_CAP_EQE_CQE_STRIDE = 1L << 1, + MLX4_FUNC_CAP_DMFS_A0_STATIC = 1L << 2 }; #define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) enum { - MLX4_BMME_FLAG_WIN_TYPE_2B = 1 << 1, + MLX4_BMME_FLAG_WIN_TYPE_2B = 1 << 1, MLX4_BMME_FLAG_LOCAL_INV = 1 << 6, MLX4_BMME_FLAG_REMOTE_INV = 1 << 7, MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9, MLX4_BMME_FLAG_RESERVED_LKEY = 1 << 10, MLX4_BMME_FLAG_FAST_REG_WR = 1 << 11, + MLX4_BMME_FLAG_ROCE_V1_V2 = 1 << 19, + MLX4_BMME_FLAG_PORT_REMAP = 1 << 24, + MLX4_BMME_FLAG_VSD_INIT2RTR = 1 << 28, +}; + +enum { + MLX4_FLAG_PORT_REMAP = MLX4_BMME_FLAG_PORT_REMAP, + MLX4_FLAG_ROCE_V1_V2 = MLX4_BMME_FLAG_ROCE_V1_V2 }; enum mlx4_event { @@ -329,6 +358,7 @@ enum { MLX4_PERM_REMOTE_WRITE = 1 << 13, MLX4_PERM_ATOMIC = 1 << 14, MLX4_PERM_BIND_MW = 1 << 15, + MLX4_PERM_MASK = 0xFC00 }; enum { @@ -373,12 +403,10 @@ enum { MLX4_MTT_FLAG_PRESENT = 1 }; -enum { - MLX4_MAX_MTT_SHIFT = 31 -}; - enum mlx4_qp_region { MLX4_QP_REGION_FW = 0, + MLX4_QP_REGION_RSS_RAW_ETH, + MLX4_QP_REGION_BOTTOM = MLX4_QP_REGION_RSS_RAW_ETH, MLX4_QP_REGION_ETH_ADDR, MLX4_QP_REGION_FC_ADDR, MLX4_QP_REGION_FC_EXCH, @@ -389,8 +417,7 @@ enum mlx4_port_type { MLX4_PORT_TYPE_NONE = 0, MLX4_PORT_TYPE_IB = 1, MLX4_PORT_TYPE_ETH = 2, - MLX4_PORT_TYPE_AUTO = 3, - MLX4_PORT_TYPE_NA = 4 + MLX4_PORT_TYPE_AUTO = 3 }; enum mlx4_special_vlan_idx { @@ -413,10 +440,22 @@ enum { MLX4_MAX_FAST_REG_PAGES = 511, }; +enum { + /* + * Max wqe size for rdma read is 512 bytes, so this + * limits our max_sge_rd as the wqe needs to fit: + * - ctrl segment (16 bytes) + * - rdma segment (16 bytes) + * - scatter elements (16 bytes each) + */ + MLX4_MAX_SGE_RD = (512 - 16 - 16) / 16 +}; + enum { MLX4_DEV_PMC_SUBTYPE_GUID_INFO = 0x14, MLX4_DEV_PMC_SUBTYPE_PORT_INFO = 0x15, MLX4_DEV_PMC_SUBTYPE_PKEY_TABLE = 0x16, + MLX4_DEV_PMC_SUBTYPE_SL_TO_VL_MAP = 0x17, }; /* Port mgmt change event handling */ @@ -428,14 +467,44 @@ enum { MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK = 1 << 4, }; +union sl2vl_tbl_to_u64 { + u8 sl8[8]; + u64 sl64; +}; + +enum { + MLX4_DEVICE_STATE_UP = 1 << 0, + MLX4_DEVICE_STATE_INTERNAL_ERROR = 1 << 1, +}; + +enum { + MLX4_INTERFACE_STATE_UP = 1 << 0, + MLX4_INTERFACE_STATE_DELETION = 1 << 1, +}; + #define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \ MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK) enum mlx4_module_id { - MLX4_MODULE_ID_SFP = 0x3, - MLX4_MODULE_ID_QSFP = 0xC, - MLX4_MODULE_ID_QSFP_PLUS = 0xD, - MLX4_MODULE_ID_QSFP28 = 0x11, + MLX4_MODULE_ID_SFP = 0x3, + MLX4_MODULE_ID_QSFP = 0xC, + MLX4_MODULE_ID_QSFP_PLUS = 0xD, + MLX4_MODULE_ID_QSFP28 = 0x11, +}; + +enum { /* rl */ + MLX4_QP_RATE_LIMIT_NONE = 0, + MLX4_QP_RATE_LIMIT_KBS = 1, + MLX4_QP_RATE_LIMIT_MBS = 2, + MLX4_QP_RATE_LIMIT_GBS = 3 +}; + +struct mlx4_rate_limit_caps { + u16 num_rates; /* Number of different rates */ + u8 min_unit; + u16 min_val; + u8 max_unit; + u16 max_val; }; static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) @@ -480,6 +549,8 @@ struct mlx4_caps { int max_rq_desc_sz; int max_qp_init_rdma; int max_qp_dest_rdma; + int max_tc_eth; + u32 *qp0_qkey; u32 *qp0_proxy; u32 *qp1_proxy; u32 *qp0_tunnel; @@ -495,10 +566,9 @@ struct mlx4_caps { int num_eqs; int reserved_eqs; int num_comp_vectors; - int comp_pool; int num_mpts; int max_fmr_maps; - u64 num_mtts; + int num_mtts; int fmr_reserved_mtts; int reserved_mtts; int reserved_mrws; @@ -508,6 +578,8 @@ struct mlx4_caps { int reserved_mcgs; int num_qp_per_mgm; int steering_mode; + int dmfs_high_steer_mode; + int fs_log_max_ucast_qp_range_size; int num_pds; int reserved_pds; int max_xrcds; @@ -520,7 +592,6 @@ struct mlx4_caps { u32 bmme_flags; u32 reserved_lkey; u16 stat_rate_support; - u8 cq_timestamp; u8 port_width_cap[MLX4_MAX_PORTS + 1]; int max_gso_sz; int max_rss_tbl_sz; @@ -538,19 +609,21 @@ struct mlx4_caps { u32 max_counters; u8 port_ib_mtu[MLX4_MAX_PORTS + 1]; u16 sqp_demux; - u32 sync_qp; - u32 cq_flags; u32 eqe_size; u32 cqe_size; u8 eqe_factor; - u32 userspace_caps; /* userspace must be aware to */ - u32 function_caps; /* functions must be aware to */ - u8 fast_drop; + u32 userspace_caps; /* userspace must be aware of these */ + u32 function_caps; /* VFs must be aware of these */ u16 hca_core_clock; - u32 max_basic_counters; - u32 max_extended_counters; - u8 def_counter_index[MLX4_MAX_PORTS + 1]; + u64 phys_port_id[MLX4_MAX_PORTS + 1]; + int tunnel_offload_mode; + u8 rx_checksum_flags_port[MLX4_MAX_PORTS + 1]; + u8 phv_bit[MLX4_MAX_PORTS + 1]; u8 alloc_res_qp_mask; + u32 dmfs_high_rate_qpn_base; + u32 dmfs_high_rate_qpn_range; + u32 vf_caps; + struct mlx4_rate_limit_caps rl_caps; }; struct mlx4_buf_list { @@ -647,7 +720,7 @@ struct mlx4_uar { }; struct mlx4_bf { - unsigned long offset; + unsigned int offset; int buf_size; struct mlx4_uar *uar; void __iomem *reg; @@ -661,6 +734,7 @@ struct mlx4_cq { u32 cons_index; + u16 irq; __be32 *set_ci_db; __be32 *arm_db; int arm_sn; @@ -670,8 +744,8 @@ struct mlx4_cq { atomic_t refcount; struct completion free; - int eqn; - u16 irq; + int reset_notify_added; + struct list_head reset_notify; }; struct mlx4_qp { @@ -720,9 +794,9 @@ struct mlx4_eth_av { __be32 sl_tclass_flowlabel; u8 dgid[16]; u8 s_mac[6]; - u8 reserved4[2]; + u8 reserved4[2]; __be16 vlan; - u8 mac[6]; + u8 mac[ETH_ALEN]; }; union mlx4_ext_av { @@ -730,65 +804,24 @@ union mlx4_ext_av { struct mlx4_eth_av eth; }; -struct mlx4_if_stat_control { - u8 reserved1[3]; - /* Extended counters enabled */ - u8 cnt_mode; - /* Number of interfaces */ - __be32 num_of_if; - __be32 reserved[2]; -}; +/* Counters should be saturate once they reach their maximum value */ +#define ASSIGN_32BIT_COUNTER(counter, value) do { \ + if ((value) > U32_MAX) \ + counter = cpu_to_be32(U32_MAX); \ + else \ + counter = cpu_to_be32(value); \ +} while (0) -struct mlx4_if_stat_basic { - struct mlx4_if_stat_control control; - struct { - __be64 IfRxFrames; - __be64 IfRxOctets; - __be64 IfTxFrames; - __be64 IfTxOctets; - } counters[]; +struct mlx4_counter { + u8 reserved1[3]; + u8 counter_mode; + __be32 num_ifc; + u32 reserved2[2]; + __be64 rx_frames; + __be64 rx_bytes; + __be64 tx_frames; + __be64 tx_bytes; }; -#define MLX4_IF_STAT_BSC_SZ(ports)(sizeof(struct mlx4_if_stat_extended) +\ - sizeof(((struct mlx4_if_stat_extended *)0)->\ - counters[0]) * ports) - -struct mlx4_if_stat_extended { - struct mlx4_if_stat_control control; - struct { - __be64 IfRxUnicastFrames; - __be64 IfRxUnicastOctets; - __be64 IfRxMulticastFrames; - __be64 IfRxMulticastOctets; - __be64 IfRxBroadcastFrames; - __be64 IfRxBroadcastOctets; - __be64 IfRxNoBufferFrames; - __be64 IfRxNoBufferOctets; - __be64 IfRxErrorFrames; - __be64 IfRxErrorOctets; - __be32 reserved[39]; - __be64 IfTxUnicastFrames; - __be64 IfTxUnicastOctets; - __be64 IfTxMulticastFrames; - __be64 IfTxMulticastOctets; - __be64 IfTxBroadcastFrames; - __be64 IfTxBroadcastOctets; - __be64 IfTxDroppedFrames; - __be64 IfTxDroppedOctets; - __be64 IfTxRequestedFramesSent; - __be64 IfTxGeneratedFramesSent; - __be64 IfTxTsoOctets; - } __packed counters[]; -}; -#define MLX4_IF_STAT_EXT_SZ(ports) (sizeof(struct mlx4_if_stat_extended) +\ - sizeof(((struct mlx4_if_stat_extended *)\ - 0)->counters[0]) * ports) - -union mlx4_counter { - struct mlx4_if_stat_control control; - struct mlx4_if_stat_basic basic; - struct mlx4_if_stat_extended ext; -}; -#define MLX4_IF_STAT_SZ(ports) MLX4_IF_STAT_EXT_SZ(ports) struct mlx4_quotas { int qp; @@ -800,8 +833,35 @@ struct mlx4_quotas { int xrcd; }; -struct mlx4_dev { +struct mlx4_vf_dev { + u8 min_port; + u8 n_ports; +}; + +enum mlx4_pci_status { + MLX4_PCI_STATUS_DISABLED, + MLX4_PCI_STATUS_ENABLED, +}; + +struct mlx4_dev_persistent { struct pci_dev *pdev; + struct mlx4_dev *dev; + int nvfs[MLX4_MAX_PORTS + 1]; + int num_vfs; + enum mlx4_port_type curr_port_type[MLX4_MAX_PORTS + 1]; + enum mlx4_port_type curr_port_poss_type[MLX4_MAX_PORTS + 1]; + struct work_struct catas_work; + struct workqueue_struct *catas_wq; + struct mutex device_state_mutex; /* protect HW state */ + u8 state; + struct mutex interface_state_mutex; /* protect SW state */ + u8 interface_state; + struct mutex pci_status_mutex; /* sync pci state */ + enum mlx4_pci_status pci_status; +}; + +struct mlx4_dev { + struct mlx4_dev_persistent *persist; unsigned long flags; unsigned long num_slaves; struct mlx4_caps caps; @@ -809,14 +869,14 @@ struct mlx4_dev { struct mlx4_quotas quotas; struct radix_tree_root qp_table_tree; u8 rev_id; + u8 port_random_macs; char board_id[MLX4_BOARD_ID_LEN]; - u16 vsd_vendor_id; - char vsd[MLX4_VSD_LEN]; - int num_vfs; int numa_node; int oper_log_mgm_entry_size; u64 regid_promisc_array[MLX4_MAX_PORTS + 1]; u64 regid_allmulti_array[MLX4_MAX_PORTS + 1]; + struct mlx4_vf_dev *dev_vfs; + u8 uar_page_shift; }; struct mlx4_clock_params { @@ -892,6 +952,9 @@ struct mlx4_eqe { __be32 block_ptr; __be32 tbl_entries_mask; } __packed tbl_change_info; + struct { + u8 sl2vl_table[8]; + } __packed sl2vl_tbl_change_info; } params; } __packed port_mgmt_change; struct { @@ -922,39 +985,35 @@ struct mlx4_init_port_param { #define MAD_IFC_DATA_SZ 192 /* MAD IFC Mailbox */ struct mlx4_mad_ifc { - u8 base_version; - u8 mgmt_class; - u8 class_version; - u8 method; - __be16 status; - __be16 class_specific; - __be64 tid; - __be16 attr_id; - __be16 resv; - __be32 attr_mod; - __be64 mkey; - __be16 dr_slid; - __be16 dr_dlid; - u8 reserved[28]; - u8 data[MAD_IFC_DATA_SZ]; + u8 base_version; + u8 mgmt_class; + u8 class_version; + u8 method; + __be16 status; + __be16 class_specific; + __be64 tid; + __be16 attr_id; + __be16 resv; + __be32 attr_mod; + __be64 mkey; + __be16 dr_slid; + __be16 dr_dlid; + u8 reserved[28]; + u8 data[MAD_IFC_DATA_SZ]; } __packed; #define mlx4_foreach_port(port, dev, type) \ for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ if ((type) == (dev)->caps.port_mask[(port)]) -#define mlx4_foreach_non_ib_transport_port(port, dev) \ - for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ - if (((dev)->caps.port_mask[port] != MLX4_PORT_TYPE_IB)) - #define mlx4_foreach_ib_transport_port(port, dev) \ - for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ + for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \ - ((dev)->caps.flags & MLX4_DEV_CAP_FLAG_IBOE)) + ((dev)->caps.flags & MLX4_DEV_CAP_FLAG_IBOE) || \ + ((dev)->caps.flags2 & MLX4_DEV_CAP_FLAG2_ROCE_V1_V2)) #define MLX4_INVALID_SLAVE_ID 0xFF - -#define MLX4_SINK_COUNTER_INDEX 0xff +#define MLX4_SINK_COUNTER_INDEX(dev) (dev->caps.max_counters - 1) void handle_port_mgmt_change_event(struct work_struct *work); @@ -977,7 +1036,9 @@ static inline int mlx4_num_reserved_sqps(struct mlx4_dev *dev) static inline int mlx4_is_qp_reserved(struct mlx4_dev *dev, u32 qpn) { return (qpn < dev->phys_caps.base_sqpn + 8 + - 16 * MLX4_MFUNC_MAX * !!mlx4_is_master(dev)); + 16 * MLX4_MFUNC_MAX * !!mlx4_is_master(dev) && + qpn >= dev->phys_caps.base_sqpn) || + (qpn < dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW]); } static inline int mlx4_is_guest_proxy(struct mlx4_dev *dev, int slave, u32 qpn) @@ -1000,8 +1061,13 @@ static inline int mlx4_is_slave(struct mlx4_dev *dev) return dev->flags & MLX4_FLAG_SLAVE; } +static inline int mlx4_is_eth(struct mlx4_dev *dev, int port) +{ + return dev->caps.port_type[port] == MLX4_PORT_TYPE_IB ? 0 : 1; +} + int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, - struct mlx4_buf *buf); + struct mlx4_buf *buf, gfp_t gfp); void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf); static inline void *mlx4_buf_offset(struct mlx4_buf *buf, int offset) { @@ -1038,9 +1104,10 @@ int mlx4_mw_enable(struct mlx4_dev *dev, struct mlx4_mw *mw); int mlx4_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, int start_index, int npages, u64 *page_list); int mlx4_buf_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, - struct mlx4_buf *buf); + struct mlx4_buf *buf, gfp_t gfp); -int mlx4_db_alloc(struct mlx4_dev *dev, struct mlx4_db *db, int order); +int mlx4_db_alloc(struct mlx4_dev *dev, struct mlx4_db *db, int order, + gfp_t gfp); void mlx4_db_free(struct mlx4_dev *dev, struct mlx4_db *db); int mlx4_alloc_hwq_res(struct mlx4_dev *dev, struct mlx4_hwq_resources *wqres, @@ -1052,12 +1119,12 @@ int mlx4_cq_alloc(struct mlx4_dev *dev, int nent, struct mlx4_mtt *mtt, struct mlx4_uar *uar, u64 db_rec, struct mlx4_cq *cq, unsigned vector, int collapsed, int timestamp_en); void mlx4_cq_free(struct mlx4_dev *dev, struct mlx4_cq *cq); - int mlx4_qp_reserve_range(struct mlx4_dev *dev, int cnt, int align, int *base, u8 flags); void mlx4_qp_release_range(struct mlx4_dev *dev, int base_qpn, int cnt); -int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp); +int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp, + gfp_t gfp); void mlx4_qp_free(struct mlx4_dev *dev, struct mlx4_qp *qp); int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, u32 cqn, u16 xrcdn, @@ -1093,6 +1160,7 @@ enum mlx4_net_trans_rule_id { MLX4_NET_TRANS_RULE_ID_IPV4, MLX4_NET_TRANS_RULE_ID_TCP, MLX4_NET_TRANS_RULE_ID_UDP, + MLX4_NET_TRANS_RULE_ID_VXLAN, MLX4_NET_TRANS_RULE_NUM, /* should be last */ MLX4_NET_TRANS_RULE_DUMMY = -1, /* force enum to be signed */ }; @@ -1111,9 +1179,11 @@ static inline int map_hw_to_sw_id(u16 header_id) } enum mlx4_net_trans_promisc_mode { - MLX4_FS_REGULAR = 1, + MLX4_FS_REGULAR = 1, MLX4_FS_ALL_DEFAULT, MLX4_FS_MC_DEFAULT, + MLX4_FS_MIRROR_RX_PORT, + MLX4_FS_MIRROR_SX_PORT, MLX4_FS_UC_SNIFFER, MLX4_FS_MC_SNIFFER, MLX4_FS_MODE_NUM, /* should be last */ @@ -1121,10 +1191,10 @@ enum mlx4_net_trans_promisc_mode { }; struct mlx4_spec_eth { - u8 dst_mac[6]; - u8 dst_mac_msk[6]; - u8 src_mac[6]; - u8 src_mac_msk[6]; + u8 dst_mac[ETH_ALEN]; + u8 dst_mac_msk[ETH_ALEN]; + u8 src_mac[ETH_ALEN]; + u8 src_mac_msk[ETH_ALEN]; u8 ether_type_enable; __be16 ether_type; __be16 vlan_id_msk; @@ -1146,10 +1216,16 @@ struct mlx4_spec_ipv4 { }; struct mlx4_spec_ib { - __be32 l3_qpn; - __be32 qpn_msk; - u8 dst_gid[16]; - u8 dst_gid_msk[16]; + __be32 l3_qpn; + __be32 qpn_msk; + u8 dst_gid[16]; + u8 dst_gid_msk[16]; +}; + +struct mlx4_spec_vxlan { + __be32 vni; + __be32 vni_mask; + }; struct mlx4_spec_list { @@ -1160,6 +1236,7 @@ struct mlx4_spec_list { struct mlx4_spec_ib ib; struct mlx4_spec_ipv4 ipv4; struct mlx4_spec_tcp_udp tcp_udp; + struct mlx4_spec_vxlan vxlan; }; }; @@ -1246,6 +1323,15 @@ struct mlx4_net_trans_rule_hw_ipv4 { __be32 src_ip_msk; } __packed; +struct mlx4_net_trans_rule_hw_vxlan { + u8 size; + u8 rsvd; + __be16 id; + __be32 rsvd1; + __be32 vni; + __be32 vni_mask; +} __packed; + struct _rule_hw { union { struct { @@ -1257,9 +1343,22 @@ struct _rule_hw { struct mlx4_net_trans_rule_hw_ib ib; struct mlx4_net_trans_rule_hw_ipv4 ipv4; struct mlx4_net_trans_rule_hw_tcp_udp tcp_udp; + struct mlx4_net_trans_rule_hw_vxlan vxlan; }; }; +enum { + VXLAN_STEER_BY_OUTER_MAC = 1 << 0, + VXLAN_STEER_BY_OUTER_VLAN = 1 << 1, + VXLAN_STEER_BY_VSID_VNI = 1 << 2, + VXLAN_STEER_BY_INNER_MAC = 1 << 3, + VXLAN_STEER_BY_INNER_VLAN = 1 << 4, +}; + +enum { + MLX4_OP_MOD_QUERY_TRANSPORT_CI_ERRORS = 0x2, +}; + int mlx4_flow_steer_promisc_add(struct mlx4_dev *dev, u8 port, u32 qpn, enum mlx4_net_trans_promisc_mode mode); int mlx4_flow_steer_promisc_remove(struct mlx4_dev *dev, u8 port, @@ -1268,6 +1367,7 @@ int mlx4_multicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port); int mlx4_multicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port); int mlx4_unicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port); int mlx4_unicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port); +int mlx4_SET_MCAST_FLTR(struct mlx4_dev *dev, u8 port, u64 mac, u64 clear, u8 mode); int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac); void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac); @@ -1277,9 +1377,15 @@ int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu, u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx); int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn, u8 promisc); -int mlx4_SET_PORT_PRIO2TC(struct mlx4_dev *dev, u8 port, u8 *prio2tc); -int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw, - u8 *pg, u16 *ratelimit); +int mlx4_SET_PORT_BEACON(struct mlx4_dev *dev, u8 port, u16 time); +int mlx4_SET_PORT_fcs_check(struct mlx4_dev *dev, u8 port, + u8 ignore_fcs_value); +int mlx4_SET_PORT_VXLAN(struct mlx4_dev *dev, u8 port, u8 steering, int enable); +int set_phv_bit(struct mlx4_dev *dev, u8 port, int new_val); +int get_phv_bit(struct mlx4_dev *dev, u8 port, int *phv); +int mlx4_get_is_vlan_offload_disabled(struct mlx4_dev *dev, u8 port, + bool *vlan_offload_disabled); +int mlx4_find_cached_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *idx); int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, u16 vlan); @@ -1293,28 +1399,42 @@ void mlx4_fmr_unmap(struct mlx4_dev *dev, struct mlx4_fmr *fmr, u32 *lkey, u32 *rkey); int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr); int mlx4_SYNC_TPT(struct mlx4_dev *dev); -int mlx4_query_diag_counters(struct mlx4_dev *mlx4_dev, int array_length, - u8 op_modifier, u32 in_offset[], - u32 counter_out[]); - -int mlx4_test_interrupts(struct mlx4_dev *dev); -int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector); +int mlx4_test_interrupt(struct mlx4_dev *dev, int vector); +int mlx4_test_async(struct mlx4_dev *dev); +int mlx4_query_diag_counters(struct mlx4_dev *dev, u8 op_modifier, + const u32 offset[], u32 value[], + size_t array_len, u8 port); +u32 mlx4_get_eqs_per_port(struct mlx4_dev *dev, u8 port); +bool mlx4_is_eq_vector_valid(struct mlx4_dev *dev, u8 port, int vector); +int mlx4_assign_eq(struct mlx4_dev *dev, u8 port, int *vector); void mlx4_release_eq(struct mlx4_dev *dev, int vec); +int mlx4_is_eq_shared(struct mlx4_dev *dev, int vector); +int mlx4_eq_get_irq(struct mlx4_dev *dev, int vec); + +int mlx4_get_phys_port_id(struct mlx4_dev *dev); int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port); int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port); -int mlx4_counter_alloc(struct mlx4_dev *dev, u8 port, u32 *idx); -void mlx4_counter_free(struct mlx4_dev *dev, u8 port, u32 idx); +int mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx); +void mlx4_counter_free(struct mlx4_dev *dev, u32 idx); +int mlx4_get_default_counter_index(struct mlx4_dev *dev, int port); +void mlx4_set_admin_guid(struct mlx4_dev *dev, __be64 guid, int entry, + int port); +__be64 mlx4_get_admin_guid(struct mlx4_dev *dev, int entry, int port); +void mlx4_set_random_admin_guid(struct mlx4_dev *dev, int entry, int port); int mlx4_flow_attach(struct mlx4_dev *dev, struct mlx4_net_trans_rule *rule, u64 *reg_id); int mlx4_flow_detach(struct mlx4_dev *dev, u64 reg_id); -int map_sw_to_hw_steering_mode(struct mlx4_dev *dev, - enum mlx4_net_trans_promisc_mode flow_type); -int map_sw_to_hw_steering_id(struct mlx4_dev *dev, - enum mlx4_net_trans_rule_id id); -int hw_rule_sz(struct mlx4_dev *dev, enum mlx4_net_trans_rule_id id); +int mlx4_map_sw_to_hw_steering_mode(struct mlx4_dev *dev, + enum mlx4_net_trans_promisc_mode flow_type); +int mlx4_map_sw_to_hw_steering_id(struct mlx4_dev *dev, + enum mlx4_net_trans_rule_id id); +int mlx4_hw_rule_sz(struct mlx4_dev *dev, enum mlx4_net_trans_rule_id id); + +int mlx4_tunnel_steer_add(struct mlx4_dev *dev, unsigned char *addr, + int port, int qpn, u16 prio, u64 *reg_id); void mlx4_sync_pkey_table(struct mlx4_dev *dev, int slave, int port, int i, int val); @@ -1324,23 +1444,135 @@ int mlx4_get_parav_qkey(struct mlx4_dev *dev, u32 qpn, u32 *qkey); int mlx4_is_slave_active(struct mlx4_dev *dev, int slave); int mlx4_gen_pkey_eqe(struct mlx4_dev *dev, int slave, u8 port); int mlx4_gen_guid_change_eqe(struct mlx4_dev *dev, int slave, u8 port); -int mlx4_gen_slaves_port_mgt_ev(struct mlx4_dev *dev, u8 port, int attr, u16 lid, u8 sl); +int mlx4_gen_slaves_port_mgt_ev(struct mlx4_dev *dev, u8 port, int attr); int mlx4_gen_port_state_change_eqe(struct mlx4_dev *dev, int slave, u8 port, u8 port_subtype_change); enum slave_port_state mlx4_get_slave_port_state(struct mlx4_dev *dev, int slave, u8 port); int set_and_calc_slave_port_state(struct mlx4_dev *dev, int slave, u8 port, int event, enum slave_port_gen_event *gen_event); void mlx4_put_slave_node_guid(struct mlx4_dev *dev, int slave, __be64 guid); __be64 mlx4_get_slave_node_guid(struct mlx4_dev *dev, int slave); -int mlx4_get_slave_from_roce_gid(struct mlx4_dev *dev, int port, u8 *gid, int *slave_id); -int mlx4_get_roce_gid_from_slave(struct mlx4_dev *dev, int port, int slave_id, u8 *gid); -int mlx4_FLOW_STEERING_IB_UC_QP_RANGE(struct mlx4_dev *dev, u32 min_range_qpn, u32 max_range_qpn); +int mlx4_get_slave_from_roce_gid(struct mlx4_dev *dev, int port, u8 *gid, + int *slave_id); +int mlx4_get_roce_gid_from_slave(struct mlx4_dev *dev, int port, int slave_id, + u8 *gid); + +int mlx4_FLOW_STEERING_IB_UC_QP_RANGE(struct mlx4_dev *dev, u32 min_range_qpn, + u32 max_range_qpn); s64 mlx4_read_clock(struct mlx4_dev *dev); + +struct mlx4_active_ports { + DECLARE_BITMAP(ports, MLX4_MAX_PORTS); +}; +/* Returns a bitmap of the physical ports which are assigned to slave */ +struct mlx4_active_ports mlx4_get_active_ports(struct mlx4_dev *dev, int slave); + +/* Returns the physical port that represents the virtual port of the slave, */ +/* or a value < 0 in case of an error. If a slave has 2 ports, the identity */ +/* mapping is returned. */ +int mlx4_slave_convert_port(struct mlx4_dev *dev, int slave, int port); + +struct mlx4_slaves_pport { + DECLARE_BITMAP(slaves, MLX4_MFUNC_MAX); +}; +/* Returns a bitmap of all slaves that are assigned to port. */ +struct mlx4_slaves_pport mlx4_phys_to_slaves_pport(struct mlx4_dev *dev, + int port); + +/* Returns a bitmap of all slaves that are assigned exactly to all the */ +/* the ports that are set in crit_ports. */ +struct mlx4_slaves_pport mlx4_phys_to_slaves_pport_actv( + struct mlx4_dev *dev, + const struct mlx4_active_ports *crit_ports); + +/* Returns the slave's virtual port that represents the physical port. */ +int mlx4_phys_to_slave_port(struct mlx4_dev *dev, int slave, int port); + +int mlx4_get_base_gid_ix(struct mlx4_dev *dev, int slave, int port); + +int mlx4_config_vxlan_port(struct mlx4_dev *dev, __be16 udp_port); +int mlx4_disable_rx_port_check(struct mlx4_dev *dev, bool dis); +int mlx4_config_roce_v2_port(struct mlx4_dev *dev, u16 udp_port); +int mlx4_virt2phy_port_map(struct mlx4_dev *dev, u32 port1, u32 port2); +int mlx4_vf_smi_enabled(struct mlx4_dev *dev, int slave, int port); +int mlx4_vf_get_enable_smi_admin(struct mlx4_dev *dev, int slave, int port); +int mlx4_vf_set_enable_smi_admin(struct mlx4_dev *dev, int slave, int port, + int enable); +int mlx4_mr_hw_get_mpt(struct mlx4_dev *dev, struct mlx4_mr *mmr, + struct mlx4_mpt_entry ***mpt_entry); +int mlx4_mr_hw_write_mpt(struct mlx4_dev *dev, struct mlx4_mr *mmr, + struct mlx4_mpt_entry **mpt_entry); +int mlx4_mr_hw_change_pd(struct mlx4_dev *dev, struct mlx4_mpt_entry *mpt_entry, + u32 pdn); +int mlx4_mr_hw_change_access(struct mlx4_dev *dev, + struct mlx4_mpt_entry *mpt_entry, + u32 access); +void mlx4_mr_hw_put_mpt(struct mlx4_dev *dev, + struct mlx4_mpt_entry **mpt_entry); +void mlx4_mr_rereg_mem_cleanup(struct mlx4_dev *dev, struct mlx4_mr *mr); +int mlx4_mr_rereg_mem_write(struct mlx4_dev *dev, struct mlx4_mr *mr, + u64 iova, u64 size, int npages, + int page_shift, struct mlx4_mpt_entry *mpt_entry); + +int mlx4_get_module_info(struct mlx4_dev *dev, u8 port, + u16 offset, u16 size, u8 *data); +int mlx4_max_tc(struct mlx4_dev *dev); + +/* Returns true if running in low memory profile (kdump kernel) */ +static inline bool mlx4_low_memory_profile(void) +{ + return false; +} + +/* ACCESS REG commands */ +enum mlx4_access_reg_method { + MLX4_ACCESS_REG_QUERY = 0x1, + MLX4_ACCESS_REG_WRITE = 0x2, +}; + +/* ACCESS PTYS Reg command */ +enum mlx4_ptys_proto { + MLX4_PTYS_IB = 1<<0, + MLX4_PTYS_EN = 1<<2, +}; + +struct mlx4_ptys_reg { + u8 resrvd1; + u8 local_port; + u8 resrvd2; + u8 proto_mask; + __be32 resrvd3[2]; + __be32 eth_proto_cap; + __be16 ib_width_cap; + __be16 ib_speed_cap; + __be32 resrvd4; + __be32 eth_proto_admin; + __be16 ib_width_admin; + __be16 ib_speed_admin; + __be32 resrvd5; + __be32 eth_proto_oper; + __be16 ib_width_oper; + __be16 ib_speed_oper; + __be32 resrvd6; + __be32 eth_proto_lp_adv; +} __packed; + +int mlx4_ACCESS_PTYS_REG(struct mlx4_dev *dev, + enum mlx4_access_reg_method method, + struct mlx4_ptys_reg *ptys_reg); + int mlx4_get_internal_clock_params(struct mlx4_dev *dev, struct mlx4_clock_params *params); -int mlx4_get_module_info(struct mlx4_dev *dev, u8 port, - u16 offset, u16 size, u8 *data); +static inline int mlx4_to_hw_uar_index(struct mlx4_dev *dev, int index) +{ + return (index << (PAGE_SHIFT - dev->uar_page_shift)); +} +static inline int mlx4_get_num_reserved_uar(struct mlx4_dev *dev) +{ + /* The first 128 UARs are used for EQ doorbells */ + return (128 >> (PAGE_SHIFT - dev->uar_page_shift)); +} #endif /* MLX4_DEVICE_H */ diff --git a/sys/dev/mlx4/driver.h b/sys/dev/mlx4/driver.h index b6414572b37a..a12d6a508ef0 100644 --- a/sys/dev/mlx4/driver.h +++ b/sys/dev/mlx4/driver.h @@ -38,8 +38,6 @@ struct mlx4_dev; #define MLX4_MAC_MASK 0xffffffffffffULL -#define MLX4_BE_SHORT_MASK cpu_to_be16(0xffff) -#define MLX4_BE_WORD_MASK cpu_to_be32(0xffffffff) enum mlx4_dev_event { MLX4_DEV_EVENT_CATASTROPHIC_ERROR, @@ -51,76 +49,46 @@ enum mlx4_dev_event { MLX4_DEV_EVENT_SLAVE_SHUTDOWN, }; +enum { + MLX4_INTFF_BONDING = 1 << 0 +}; + struct mlx4_interface { void * (*add) (struct mlx4_dev *dev); void (*remove)(struct mlx4_dev *dev, void *context); void (*event) (struct mlx4_dev *dev, void *context, enum mlx4_dev_event event, unsigned long param); void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port); + void (*activate)(struct mlx4_dev *dev, void *context); struct list_head list; enum mlx4_protocol protocol; + int flags; }; -enum { - MLX4_MAX_DEVICES = 32, - MLX4_DEVS_TBL_SIZE = MLX4_MAX_DEVICES + 1, - MLX4_DBDF2VAL_STR_SIZE = 512, - MLX4_STR_NAME_SIZE = 64, - MLX4_MAX_BDF_VALS = 2, - MLX4_ENDOF_TBL = -1LL -}; - -struct mlx4_dbdf2val { - u64 dbdf; - int val[MLX4_MAX_BDF_VALS]; -}; - -struct mlx4_range { - int min; - int max; -}; - -/* - * mlx4_dbdf2val_lst struct holds all the data needed to convert - * dbdf-to-value-list string into dbdf-to-value table. - * dbdf-to-value-list string is a comma separated list of dbdf-to-value strings. - * the format of dbdf-to-value string is: "[mmmm:]bb:dd.f-v1[;v2]" - * mmmm - Domain number (optional) - * bb - Bus number - * dd - device number - * f - Function number - * v1 - First value related to the domain-bus-device-function. - * v2 - Second value related to the domain-bus-device-function (optional). - * bb, dd - Two hexadecimal digits without preceding 0x. - * mmmm - Four hexadecimal digits without preceding 0x. - * f - One hexadecimal without preceding 0x. - * v1,v2 - Number with normal convention (e.g 100, 0xd3). - * dbdf-to-value-list string format: - * "[mmmm:]bb:dd.f-v1[;v2],[mmmm:]bb:dd.f-v1[;v2],..." - * - */ -struct mlx4_dbdf2val_lst { - char name[MLX4_STR_NAME_SIZE]; /* String name */ - char str[MLX4_DBDF2VAL_STR_SIZE]; /* dbdf2val list str */ - struct mlx4_dbdf2val tbl[MLX4_DEVS_TBL_SIZE];/* dbdf to value table */ - int num_vals; /* # of vals per dbdf */ - int def_val[MLX4_MAX_BDF_VALS]; /* Default values */ - struct mlx4_range range; /* Valid values range */ -}; - -int mlx4_fill_dbdf2val_tbl(struct mlx4_dbdf2val_lst *dbdf2val_lst); -int mlx4_get_val(struct mlx4_dbdf2val *tbl, struct pci_dev *pdev, int idx, - int *val); - int mlx4_register_interface(struct mlx4_interface *intf); void mlx4_unregister_interface(struct mlx4_interface *intf); -void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, - int port); +int mlx4_bond(struct mlx4_dev *dev); +int mlx4_unbond(struct mlx4_dev *dev); +static inline int mlx4_is_bonded(struct mlx4_dev *dev) +{ + return !!(dev->flags & MLX4_FLAG_BONDED); +} + +static inline int mlx4_is_mf_bonded(struct mlx4_dev *dev) +{ + return (mlx4_is_bonded(dev) && mlx4_is_mfunc(dev)); +} + +struct mlx4_port_map { + u8 port1; + u8 port2; +}; + +int mlx4_port_map_set(struct mlx4_dev *dev, struct mlx4_port_map *v2p); + +void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port); -#ifndef ETH_ALEN -#define ETH_ALEN 6 -#endif static inline u64 mlx4_mac_to_u64(const u8 *addr) { u64 mac = 0; diff --git a/sys/dev/mlx4/mlx4_core/fw.h b/sys/dev/mlx4/mlx4_core/fw.h index 748b2841d93d..c4c4883b4d06 100644 --- a/sys/dev/mlx4/mlx4_core/fw.h +++ b/sys/dev/mlx4/mlx4_core/fw.h @@ -43,6 +43,28 @@ struct mlx4_mod_stat_cfg { u8 log_pg_sz_m; }; +struct mlx4_port_cap { + u8 link_state; + u8 supported_port_types; + u8 suggested_type; + u8 default_sense; + u8 log_max_macs; + u8 log_max_vlans; + int ib_mtu; + int max_port_width; + int max_vl; + int max_tc_eth; + int max_gids; + int max_pkeys; + u64 def_mac; + u16 eth_mtu; + int trans_type; + int vendor_oui; + u16 wavelength; + u64 trans_code; + u8 dmfs_optimized_state; +}; + struct mlx4_dev_cap { int max_srq_sz; int max_qp_sz; @@ -58,26 +80,13 @@ struct mlx4_dev_cap { int max_eqs; int num_sys_eqs; int reserved_mtts; - int max_mrw_sz; int reserved_mrws; - int max_mtt_seg; int max_requester_per_qp; int max_responder_per_qp; int max_rdma_global; int local_ca_ack_delay; int num_ports; u32 max_msg_sz; - int ib_mtu[MLX4_MAX_PORTS + 1]; - int max_port_width[MLX4_MAX_PORTS + 1]; - int max_vl[MLX4_MAX_PORTS + 1]; - int max_gids[MLX4_MAX_PORTS + 1]; - int max_pkeys[MLX4_MAX_PORTS + 1]; - u64 def_mac[MLX4_MAX_PORTS + 1]; - u16 eth_mtu[MLX4_MAX_PORTS + 1]; - int trans_type[MLX4_MAX_PORTS + 1]; - int vendor_oui[MLX4_MAX_PORTS + 1]; - u16 wavelength[MLX4_MAX_PORTS + 1]; - u64 trans_code[MLX4_MAX_PORTS + 1]; u16 stat_rate_support; int fs_log_max_ucast_qp_range_size; int fs_max_num_qp_per_entry; @@ -115,15 +124,11 @@ struct mlx4_dev_cap { u64 max_icm_sz; int max_gso_sz; int max_rss_tbl_sz; - u8 supported_port_types[MLX4_MAX_PORTS + 1]; - u8 suggested_type[MLX4_MAX_PORTS + 1]; - u8 default_sense[MLX4_MAX_PORTS + 1]; - u8 log_max_macs[MLX4_MAX_PORTS + 1]; - u8 log_max_vlans[MLX4_MAX_PORTS + 1]; - u32 max_basic_counters; - u32 sync_qp; - u8 timestamp_support; - u32 max_extended_counters; + u32 max_counters; + u32 dmfs_high_rate_qpn_base; + u32 dmfs_high_rate_qpn_range; + struct mlx4_rate_limit_caps rl_caps; + struct mlx4_port_cap port_cap[MLX4_MAX_PORTS + 1]; }; struct mlx4_func_cap { @@ -138,14 +143,17 @@ struct mlx4_func_cap { int max_eq; int reserved_eq; int mcg_quota; + u32 qp0_qkey; u32 qp0_tunnel_qpn; u32 qp0_proxy_qpn; u32 qp1_tunnel_qpn; u32 qp1_proxy_qpn; + u32 reserved_lkey; u8 physical_port; - u8 port_flags; - u8 def_counter_index; - u8 extra_flags; + u8 flags0; + u8 flags1; + u64 phys_port_id; + u32 extra_flags; }; struct mlx4_func { @@ -159,9 +167,7 @@ struct mlx4_func { }; struct mlx4_adapter { - u16 vsd_vendor_id; char board_id[MLX4_BOARD_ID_LEN]; - char vsd[MLX4_VSD_LEN]; u8 inta_pin; }; @@ -180,7 +186,7 @@ struct mlx4_init_hca_param { u64 global_caps; u16 log_mc_entry_sz; u16 log_mc_hash_sz; - u16 hca_core_clock; + u16 hca_core_clock; /* Internal Clock Frequency (in MHz) */ u8 log_num_qps; u8 log_num_srqs; u8 log_num_cqs; @@ -190,11 +196,15 @@ struct mlx4_init_hca_param { u8 log_mc_table_sz; u8 log_mpt_sz; u8 log_uar_sz; + u8 mw_enabled; /* Enable memory windows */ u8 uar_page_sz; /* log pg sz in 4k chunks */ - u8 mw_enable; /* Enable memory windows */ - u8 fs_hash_enable_bits; u8 steering_mode; /* for QUERY_HCA */ + u8 dmfs_high_steer_mode; /* for QUERY_HCA */ u64 dev_cap_enabled; + u16 cqe_size; /* For use only when CQE stride feature enabled */ + u16 eqe_size; /* For use only when EQE stride feature enabled */ + u8 rss_ip_frags; + u8 phv_check_en; /* for QUERY_HCA */ }; struct mlx4_init_ib_param { @@ -218,14 +228,17 @@ struct mlx4_set_ib_param { u32 cap_mask; }; +void mlx4_dev_cap_dump(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap); int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap); -int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u32 gen_or_port, +int mlx4_QUERY_PORT(struct mlx4_dev *dev, int port, struct mlx4_port_cap *port_cap); +int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u8 gen_or_port, struct mlx4_func_cap *func_cap); int mlx4_QUERY_FUNC_CAP_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_vhcr *vhcr, struct mlx4_cmd_mailbox *inbox, struct mlx4_cmd_mailbox *outbox, struct mlx4_cmd_info *cmd); +int mlx4_QUERY_FUNC(struct mlx4_dev *dev, struct mlx4_func *func, int slave); int mlx4_MAP_FA(struct mlx4_dev *dev, struct mlx4_icm *icm); int mlx4_UNMAP_FA(struct mlx4_dev *dev); int mlx4_RUN_FW(struct mlx4_dev *dev); @@ -236,9 +249,10 @@ int mlx4_QUERY_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param); int mlx4_CLOSE_HCA(struct mlx4_dev *dev, int panic); int mlx4_map_cmd(struct mlx4_dev *dev, u16 op, struct mlx4_icm *icm, u64 virt); int mlx4_SET_ICM_SIZE(struct mlx4_dev *dev, u64 icm_size, u64 *aux_pages); +int mlx4_MAP_ICM_AUX(struct mlx4_dev *dev, struct mlx4_icm *icm); +int mlx4_UNMAP_ICM_AUX(struct mlx4_dev *dev); int mlx4_NOP(struct mlx4_dev *dev); int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg); -int mlx4_QUERY_FUNC(struct mlx4_dev *dev, struct mlx4_func *func, int slave); void mlx4_opreq_action(struct work_struct *work); #endif /* MLX4_FW_H */ diff --git a/sys/dev/mlx4/mlx4_core/fw_qos.h b/sys/dev/mlx4/mlx4_core/fw_qos.h new file mode 100644 index 000000000000..fc91926df110 --- /dev/null +++ b/sys/dev/mlx4/mlx4_core/fw_qos.h @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. + * Copyright (c) 2005, 2006, 2007, 2008 Mellanox Technologies. + * All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef MLX4_FW_QOS_H +#define MLX4_FW_QOS_H + +#include +#include + +#define MLX4_NUM_UP 8 +#define MLX4_NUM_TC 8 + +/* Default supported priorities for VPP allocation */ +#define MLX4_DEFAULT_QOS_PRIO (0) + +/* Derived from FW feature definition, 0 is the default vport fo all QPs */ +#define MLX4_VPP_DEFAULT_VPORT (0) + +struct mlx4_vport_qos_param { + u32 bw_share; + u32 max_avg_bw; + u8 enable; +}; + +/** + * mlx4_SET_PORT_PRIO2TC - This routine maps user priorities to traffic + * classes of a given port and device. + * + * @dev: mlx4_dev. + * @port: Physical port number. + * @prio2tc: Array of TC associated with each priorities. + * + * Returns 0 on success or a negative mlx4_core errno code. + **/ +int mlx4_SET_PORT_PRIO2TC(struct mlx4_dev *dev, u8 port, u8 *prio2tc); + +/** + * mlx4_SET_PORT_SCHEDULER - This routine configures the arbitration between + * traffic classes (ETS) and configured rate limit for traffic classes. + * tc_tx_bw, pg and ratelimit are arrays where each index represents a TC. + * The description for those parameters below refers to a single TC. + * + * @dev: mlx4_dev. + * @port: Physical port number. + * @tc_tx_bw: The percentage of the bandwidth allocated for traffic class + * within a TC group. The sum of the bw_percentage of all the traffic + * classes within a TC group must equal 100% for correct operation. + * @pg: The TC group the traffic class is associated with. + * @ratelimit: The maximal bandwidth allowed for the use by this traffic class. + * + * Returns 0 on success or a negative mlx4_core errno code. + **/ +int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw, + u8 *pg, u16 *ratelimit); +/** + * mlx4_ALLOCATE_VPP_get - Query port VPP availible resources and allocation. + * Before distribution of VPPs to priorities, only availible_vpp is returned. + * After initialization it returns the distribution of VPPs among priorities. + * + * @dev: mlx4_dev. + * @port: Physical port number. + * @availible_vpp: Pointer to variable where number of availible VPPs is stored + * @vpp_p_up: Distribution of VPPs to priorities is stored in this array + * + * Returns 0 on success or a negative mlx4_core errno code. + **/ +int mlx4_ALLOCATE_VPP_get(struct mlx4_dev *dev, u8 port, + u16 *availible_vpp, u8 *vpp_p_up); +/** + * mlx4_ALLOCATE_VPP_set - Distribution of VPPs among differnt priorities. + * The total number of VPPs assigned to all for a port must not exceed + * the value reported by availible_vpp in mlx4_ALLOCATE_VPP_get. + * VPP allocation is allowed only after the port type has been set, + * and while no QPs are open for this port. + * + * @dev: mlx4_dev. + * @port: Physical port number. + * @vpp_p_up: Allocation of VPPs to different priorities. + * + * Returns 0 on success or a negative mlx4_core errno code. + **/ +int mlx4_ALLOCATE_VPP_set(struct mlx4_dev *dev, u8 port, u8 *vpp_p_up); + +/** + * mlx4_SET_VPORT_QOS_get - Query QoS proporties of a Vport. + * Each priority allowed for the Vport is assigned with a share of the BW, + * and a BW limitation. This commands query the current QoS values. + * + * @dev: mlx4_dev. + * @port: Physical port number. + * @vport: Vport id. + * @out_param: Array of mlx4_vport_qos_param that will contain the values. + * + * Returns 0 on success or a negative mlx4_core errno code. + **/ +int mlx4_SET_VPORT_QOS_get(struct mlx4_dev *dev, u8 port, u8 vport, + struct mlx4_vport_qos_param *out_param); + +/** + * mlx4_SET_VPORT_QOS_set - Set QoS proporties of a Vport. + * QoS parameters can be modified at any time, but must be initialized + * before any QP is associated with the VPort. + * + * @dev: mlx4_dev. + * @port: Physical port number. + * @vport: Vport id. + * @out_param: Array of mlx4_vport_qos_param which holds the requested values. + * + * Returns 0 on success or a negative mlx4_core errno code. + **/ +int mlx4_SET_VPORT_QOS_set(struct mlx4_dev *dev, u8 port, u8 vport, + struct mlx4_vport_qos_param *in_param); + +#endif /* MLX4_FW_QOS_H */ diff --git a/sys/dev/mlx4/mlx4_core/icm.h b/sys/dev/mlx4/mlx4_core/icm.h index f7a2537bfbc0..82613515be0a 100644 --- a/sys/dev/mlx4/mlx4_core/icm.h +++ b/sys/dev/mlx4/mlx4_core/icm.h @@ -72,14 +72,15 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages, gfp_t gfp_mask, int coherent); void mlx4_free_icm(struct mlx4_dev *dev, struct mlx4_icm *icm, int coherent); -int mlx4_table_get(struct mlx4_dev *dev, struct mlx4_icm_table *table, u32 obj); +int mlx4_table_get(struct mlx4_dev *dev, struct mlx4_icm_table *table, u32 obj, + gfp_t gfp); void mlx4_table_put(struct mlx4_dev *dev, struct mlx4_icm_table *table, u32 obj); int mlx4_table_get_range(struct mlx4_dev *dev, struct mlx4_icm_table *table, u32 start, u32 end); void mlx4_table_put_range(struct mlx4_dev *dev, struct mlx4_icm_table *table, u32 start, u32 end); int mlx4_init_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table, - u64 virt, int obj_size, u64 nobj, int reserved, + u64 virt, int obj_size, u32 nobj, int reserved, int use_lowmem, int use_coherent); void mlx4_cleanup_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table); void *mlx4_table_find(struct mlx4_icm_table *table, u32 obj, dma_addr_t *dma_handle); diff --git a/sys/dev/mlx4/mlx4_core/mlx4.h b/sys/dev/mlx4/mlx4_core/mlx4.h index f29175e7c2ca..4a4f63492df6 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4.h +++ b/sys/dev/mlx4/mlx4_core/mlx4.h @@ -44,18 +44,17 @@ #include #include #include +#include #include #include #include #include +#include #define DRV_NAME "mlx4_core" #define PFX DRV_NAME ": " -#define DRV_VERSION "2.1.6" - -#define DRV_STACK_NAME "Linux-MLNX_OFED" -#define DRV_STACK_VERSION "2.1" -#define DRV_NAME_FOR_FW DRV_STACK_NAME","DRV_STACK_VERSION +#define DRV_VERSION "3.4.1" +#define DRV_RELDATE "October 2017" #define MLX4_FS_UDP_UC_EN (1 << 1) #define MLX4_FS_TCP_UC_EN (1 << 2) @@ -63,20 +62,11 @@ #define MLX4_FS_MGM_LOG_ENTRY_SIZE 7 #define MLX4_FS_NUM_MCG (1 << 17) -struct mlx4_set_port_prio2tc_context { - u8 prio2tc[4]; -}; +#define INIT_HCA_TPT_MW_ENABLE (1 << 7) -struct mlx4_port_scheduler_tc_cfg_be { - __be16 pg; - __be16 bw_precentage; - __be16 max_bw_units; /* 3-100Mbps, 4-1Gbps, other values - reserved */ - __be16 max_bw_value; -}; +#define MLX4_QUERY_IF_STAT_RESET BIT(31) -struct mlx4_set_port_scheduler_context { - struct mlx4_port_scheduler_tc_cfg_be tc[MLX4_NUM_TC]; -}; +#define ETH_P_8021AD 0x88A8 enum { MLX4_HCR_BASE = 0x80680, @@ -84,14 +74,17 @@ enum { MLX4_CLR_INT_SIZE = 0x00008, MLX4_SLAVE_COMM_BASE = 0x0, MLX4_COMM_PAGESIZE = 0x1000, - MLX4_CLOCK_SIZE = 0x00008 + MLX4_CLOCK_SIZE = 0x00008, + MLX4_COMM_CHAN_CAPS = 0x8, + MLX4_COMM_CHAN_FLAGS = 0xc }; enum { MLX4_DEFAULT_MGM_LOG_ENTRY_SIZE = 10, MLX4_MIN_MGM_LOG_ENTRY_SIZE = 7, MLX4_MAX_MGM_LOG_ENTRY_SIZE = 12, - MLX4_MAX_QP_PER_MGM = 4 * ((1 << MLX4_MAX_MGM_LOG_ENTRY_SIZE)/16 - 2), + MLX4_MAX_QP_PER_MGM = 4 * ((1 << MLX4_MAX_MGM_LOG_ENTRY_SIZE) / 16 - 2), + MLX4_MTT_ENTRY_PER_SEG = 8, }; enum { @@ -118,6 +111,10 @@ enum mlx4_mpt_state { }; #define MLX4_COMM_TIME 10000 +#define MLX4_COMM_OFFLINE_TIME_OUT 30000 +#define MLX4_COMM_CMD_NA_OP 0x0 + + enum { MLX4_COMM_CMD_RESET, MLX4_COMM_CMD_VHCR0, @@ -128,6 +125,11 @@ enum { MLX4_COMM_CMD_FLR = 254 }; +enum { + MLX4_VF_SMI_DISABLED, + MLX4_VF_SMI_ENABLED +}; + /*The flag indicates that the slave should delay the RESET cmd*/ #define MLX4_DELAY_RESET_SLAVE 0xbbbbbbb /*indicates how many retries will be done if we are in the middle of FLR*/ @@ -191,7 +193,7 @@ struct mlx4_vhcr_cmd { u8 status; u8 flags; __be16 opcode; -} __packed; +}; struct mlx4_cmd_info { u16 opcode; @@ -199,7 +201,6 @@ struct mlx4_cmd_info { bool has_outbox; bool out_is_imm; bool encode_slave_id; - bool skip_err_print; int (*verify)(struct mlx4_dev *dev, int slave, struct mlx4_vhcr *vhcr, struct mlx4_cmd_mailbox *inbox); int (*wrapper)(struct mlx4_dev *dev, int slave, struct mlx4_vhcr *vhcr, @@ -208,35 +209,33 @@ struct mlx4_cmd_info { struct mlx4_cmd_info *cmd); }; -enum { - MLX4_DEBUG_MASK_CMD_TIME = 0x100, -}; - #ifdef CONFIG_MLX4_DEBUG extern int mlx4_debug_level; #else /* CONFIG_MLX4_DEBUG */ #define mlx4_debug_level (0) #endif /* CONFIG_MLX4_DEBUG */ -#define mlx4_dbg(mdev, format, arg...) \ +#define mlx4_dbg(mdev, format, ...) \ do { \ if (mlx4_debug_level) \ - dev_printk(KERN_DEBUG, &mdev->pdev->dev, format, ##arg); \ + dev_printk(KERN_DEBUG, \ + &(mdev)->persist->pdev->dev, format, \ + ##__VA_ARGS__); \ } while (0) -#define mlx4_err(mdev, format, arg...) \ - dev_err(&mdev->pdev->dev, format, ##arg) -#define mlx4_info(mdev, format, arg...) \ - dev_info(&mdev->pdev->dev, format, ##arg) -#define mlx4_warn(mdev, format, arg...) \ - dev_warn(&mdev->pdev->dev, format, ##arg) +#define mlx4_err(mdev, format, ...) \ + dev_err(&(mdev)->persist->pdev->dev, format, ##__VA_ARGS__) +#define mlx4_info(mdev, format, ...) \ + dev_info(&(mdev)->persist->pdev->dev, format, ##__VA_ARGS__) +#define mlx4_warn(mdev, format, ...) \ + dev_warn(&(mdev)->persist->pdev->dev, format, ##__VA_ARGS__) extern int mlx4_log_num_mgm_entry_size; extern int log_mtts_per_seg; -extern int mlx4_blck_lb; -extern int mlx4_set_4k_mtu; +extern int mlx4_internal_err_reset; -#define MLX4_MAX_NUM_SLAVES (MLX4_MAX_NUM_PF + MLX4_MAX_NUM_VF) +#define MLX4_MAX_NUM_SLAVES (min(MLX4_MAX_NUM_PF + MLX4_MAX_NUM_VF, \ + MLX4_MFUNC_MAX)) #define ALL_SLAVES 0xff struct mlx4_bitmap { @@ -246,6 +245,7 @@ struct mlx4_bitmap { u32 reserved_top; u32 mask; u32 avail; + u32 effective_len; spinlock_t lock; unsigned long *table; }; @@ -277,6 +277,8 @@ struct mlx4_icm_table { #define MLX4_MPT_FLAG_PHYSICAL (1 << 9) #define MLX4_MPT_FLAG_REGION (1 << 8) +#define MLX4_MPT_PD_MASK (0x1FFFFUL) +#define MLX4_MPT_PD_VF_MASK (0xFE0000UL) #define MLX4_MPT_PD_FLAG_FAST_REG (1 << 27) #define MLX4_MPT_PD_FLAG_RAE (1 << 28) #define MLX4_MPT_PD_FLAG_EN_INV (3 << 24) @@ -286,6 +288,15 @@ struct mlx4_icm_table { #define MLX4_MPT_STATUS_SW 0xF0 #define MLX4_MPT_STATUS_HW 0x00 +#define MLX4_CQE_SIZE_MASK_STRIDE 0x3 +#define MLX4_EQE_SIZE_MASK_STRIDE 0x30 + +#define MLX4_EQ_ASYNC 0 +#define MLX4_EQ_TO_CQ_VECTOR(vector) ((vector) - \ + !!((int)(vector) >= MLX4_EQ_ASYNC)) +#define MLX4_CQ_TO_EQ_VECTOR(vector) ((vector) + \ + !!((int)(vector) >= MLX4_EQ_ASYNC)) + /* * Must be packed because mtt_seg is 64 bits but only aligned to 32 bits. */ @@ -381,6 +392,10 @@ struct mlx4_eq { int nent; struct mlx4_buf_list *page_list; struct mlx4_mtt mtt; + u32 ncqs; + struct mlx4_active_ports actv_ports; + u32 ref_count; + int affinity_cpu_id; }; struct mlx4_slave_eqe { @@ -401,7 +416,7 @@ struct mlx4_profile { int num_cq; int num_mcg; int num_mpt; - unsigned num_mtt_segs; + unsigned num_mtt; }; struct mlx4_fw { @@ -460,6 +475,7 @@ struct mlx4_slave_state { u8 init_port_mask; bool active; bool old_vlan_api; + bool vst_qinq_supported; u8 function; dma_addr_t vhcr_dma; u16 mtu[MLX4_MAX_PORTS + 1]; @@ -481,18 +497,20 @@ struct mlx4_slave_state { #define MLX4_VGT 4095 #define NO_INDX (-1) - struct mlx4_vport_state { u64 mac; u16 default_vlan; u8 default_qos; + __be16 vlan_proto; u32 tx_rate; bool spoofchk; - u32 link_state; + u8 qos_vport; + __be64 guid; }; struct mlx4_vf_admin_state { struct mlx4_vport_state vport[MLX4_MAX_PORTS + 1]; + u8 enable_smi[MLX4_MAX_PORTS + 1]; }; struct mlx4_vport_oper_state { @@ -500,8 +518,10 @@ struct mlx4_vport_oper_state { int mac_idx; int vlan_idx; }; + struct mlx4_vf_oper_state { struct mlx4_vport_oper_state vport[MLX4_MAX_PORTS + 1]; + u8 smi_enabled[MLX4_MAX_PORTS + 1]; }; struct slave_list { @@ -510,7 +530,7 @@ struct slave_list { }; struct resource_allocator { - spinlock_t alloc_lock; + spinlock_t alloc_lock; /* protect quotas */ union { int res_reserved; int res_port_rsvd[MLX4_MAX_PORTS]; @@ -542,6 +562,11 @@ struct mlx4_slave_event_eq { struct mlx4_eqe event_eqe[SLAVE_EVENT_EQ_SIZE]; }; +struct mlx4_qos_manager { + int num_of_qos_vfs; + DECLARE_BITMAP(priority_bm, MLX4_NUM_UP); +}; + struct mlx4_master_qp0_state { int proxy_qp0_active; int qp0_active; @@ -555,11 +580,12 @@ struct mlx4_mfunc_master_ctx { struct mlx4_master_qp0_state qp0_state[MLX4_MAX_PORTS + 1]; int init_port_ref[MLX4_MAX_PORTS + 1]; u16 max_mtu[MLX4_MAX_PORTS + 1]; + u8 pptx; + u8 pprx; int disable_mcast_ref[MLX4_MAX_PORTS + 1]; struct mlx4_resource_tracker res_tracker; struct workqueue_struct *comm_wq; struct work_struct comm_work; - struct work_struct arm_comm_work; struct work_struct slave_event_work; struct work_struct slave_flr_event_work; spinlock_t slave_state_lock; @@ -567,6 +593,7 @@ struct mlx4_mfunc_master_ctx { struct mlx4_eqe cmd_eqe; struct mlx4_slave_event_eq slave_eq; struct mutex gen_eqe_mutex[MLX4_MFUNC_MAX]; + struct mlx4_qos_manager qos_ctl[MLX4_MAX_PORTS + 1]; }; struct mlx4_mfunc { @@ -591,10 +618,10 @@ struct mlx4_mgm { struct mlx4_cmd { struct pci_pool *pool; void __iomem *hcr; - struct mutex hcr_mutex; struct mutex slave_cmd_mutex; struct semaphore poll_sem; struct semaphore event_sem; + struct rw_semaphore switch_sem; int max_cmds; spinlock_t context_lock; int free_head; @@ -603,11 +630,13 @@ struct mlx4_cmd { u8 use_events; u8 toggle; u8 comm_toggle; + u8 initialized; }; enum { MLX4_VF_IMMED_VLAN_FLAG_VLAN = 1 << 0, MLX4_VF_IMMED_VLAN_FLAG_QOS = 1 << 1, + MLX4_VF_IMMED_VLAN_FLAG_LINK_DISABLE = 1 << 2, }; struct mlx4_vf_immed_vlan_work { struct work_struct work; @@ -618,8 +647,10 @@ struct mlx4_vf_immed_vlan_work { int orig_vlan_ix; u8 port; u8 qos; + u8 qos_vport; u16 vlan_id; u16 orig_vlan_id; + __be16 vlan_proto; }; @@ -639,7 +670,6 @@ struct mlx4_mr_table { struct mlx4_cq_table { struct mlx4_bitmap bitmap; spinlock_t lock; - rwlock_t cq_table_lock; struct radix_tree_root tree; struct mlx4_icm_table table; struct mlx4_icm_table cmpt_table; @@ -666,8 +696,17 @@ struct mlx4_srq_table { struct mlx4_icm_table cmpt_table; }; +enum mlx4_qp_table_zones { + MLX4_QP_TABLE_ZONE_GENERAL, + MLX4_QP_TABLE_ZONE_RSS, + MLX4_QP_TABLE_ZONE_RAW_ETH, + MLX4_QP_TABLE_ZONE_NUM +}; + struct mlx4_qp_table { - struct mlx4_bitmap bitmap; + struct mlx4_bitmap *bitmap_gen; + struct mlx4_zone_allocator *zones; + u32 zones_uids[MLX4_QP_TABLE_ZONE_NUM]; u32 rdmarc_base; int rdmarc_shift; spinlock_t lock; @@ -696,17 +735,30 @@ struct mlx4_catas_err { struct mlx4_mac_table { __be64 entries[MLX4_MAX_MAC_NUM]; int refs[MLX4_MAX_MAC_NUM]; + bool is_dup[MLX4_MAX_MAC_NUM]; struct mutex mutex; int total; int max; }; +#define MLX4_ROCE_GID_ENTRY_SIZE 16 + +struct mlx4_roce_gid_entry { + u8 raw[MLX4_ROCE_GID_ENTRY_SIZE]; +}; + +struct mlx4_roce_gid_table { + struct mlx4_roce_gid_entry roce_gids[MLX4_ROCE_MAX_GIDS]; + struct mutex mutex; +}; + #define MLX4_MAX_VLAN_NUM 128 #define MLX4_VLAN_TABLE_SIZE (MLX4_MAX_VLAN_NUM << 2) struct mlx4_vlan_table { __be32 entries[MLX4_MAX_VLAN_NUM]; int refs[MLX4_MAX_VLAN_NUM]; + int is_dup[MLX4_MAX_VLAN_NUM]; struct mutex mutex; int total; int max; @@ -722,11 +774,15 @@ enum { MCAST_DEFAULT = 2 }; - struct mlx4_set_port_general_context { - u8 reserved[3]; + u16 reserved1; + u8 v_ignore_fcs; u8 flags; - u16 reserved2; + union { + u8 ignore_fcs; + u8 roce_mode; + }; + u8 reserved2; __be16 mtu; u8 pptx; u8 pfctx; @@ -734,6 +790,9 @@ struct mlx4_set_port_general_context { u8 pprx; u8 pfcrx; u16 reserved4; + u32 reserved5; + u8 phv_en; + u8 reserved6[3]; }; struct mlx4_set_port_rqp_calc_context { @@ -754,13 +813,6 @@ struct mlx4_set_port_rqp_calc_context { __be32 mcast; }; -struct mlx4_hca_info { - struct mlx4_dev *dev; - struct device_attribute firmware_attr; - struct device_attribute hca_attr; - struct device_attribute board_attr; -}; - struct mlx4_port_info { struct mlx4_dev *dev; int port; @@ -771,6 +823,7 @@ struct mlx4_port_info { struct device_attribute port_mtu_attr; struct mlx4_mac_table mac_table; struct mlx4_vlan_table vlan_table; + struct mlx4_roce_gid_table gid_table; int base_qpn; }; @@ -779,10 +832,11 @@ struct mlx4_sense { u8 do_sense_port[MLX4_MAX_PORTS + 1]; u8 sense_allowed[MLX4_MAX_PORTS + 1]; struct delayed_work sense_poll; + int gone; }; struct mlx4_msix_ctl { - u64 pool_bm; + DECLARE_BITMAP(pool_bm, MAX_MSIX); struct mutex pool_lock; }; @@ -796,22 +850,6 @@ enum { MLX4_PCI_DEV_FORCE_SENSE_PORT = 1 << 1, }; -struct mlx4_roce_gid_entry { - u8 raw[16]; -}; - -struct counter_index { - struct list_head list; - u32 index; -}; - -struct mlx4_counters { - struct mlx4_bitmap bitmap; - struct list_head global_port_list[MLX4_MAX_PORTS]; - struct list_head vf_list[MLX4_MAX_NUM_VF][MLX4_MAX_PORTS]; - struct mutex mutex; -}; - enum { MLX4_NO_RR = 0, MLX4_USE_RR = 1, @@ -825,6 +863,7 @@ struct mlx4_priv { spinlock_t ctx_lock; int pci_dev_data; + int removed; struct list_head pgdir_list; struct mutex pgdir_mutex; @@ -842,7 +881,8 @@ struct mlx4_priv { struct mlx4_srq_table srq_table; struct mlx4_qp_table qp_table; struct mlx4_mcg_table mcg_table; - struct mlx4_counters counters_table; + struct mlx4_bitmap counters_bitmap; + int def_counter[MLX4_MAX_PORTS]; struct mlx4_catas_err catas_err; @@ -851,7 +891,6 @@ struct mlx4_priv { struct mlx4_uar driver_uar; void __iomem *kar; struct mlx4_port_info port[MLX4_MAX_PORTS + 1]; - struct mlx4_hca_info hca_info; struct mlx4_sense sense; struct mutex port_mutex; struct mlx4_msix_ctl msix_ctl; @@ -863,8 +902,10 @@ struct mlx4_priv { int reserved_mtts; int fs_hash_mode; u8 virt2phys_pkey[MLX4_MFUNC_MAX][MLX4_MAX_PORTS][MLX4_MAX_PORT_PKEYS]; + struct mlx4_port_map v2p; /* cached port mapping configuration */ + struct mutex bond_mutex; /* for bond mode */ __be64 slave_node_guids[MLX4_MFUNC_MAX]; - struct mlx4_roce_gid_entry roce_gids[MLX4_MAX_PORTS][128]; + atomic_t opreq_count; struct work_struct opreq_task; }; @@ -913,7 +954,7 @@ void mlx4_cleanup_cq_table(struct mlx4_dev *dev); void mlx4_cleanup_qp_table(struct mlx4_dev *dev); void mlx4_cleanup_srq_table(struct mlx4_dev *dev); void mlx4_cleanup_mcg_table(struct mlx4_dev *dev); -int __mlx4_qp_alloc_icm(struct mlx4_dev *dev, int qpn); +int __mlx4_qp_alloc_icm(struct mlx4_dev *dev, int qpn, gfp_t gfp); void __mlx4_qp_free_icm(struct mlx4_dev *dev, int qpn); int __mlx4_cq_alloc_icm(struct mlx4_dev *dev, int *cqn); void __mlx4_cq_free_icm(struct mlx4_dev *dev, int cqn); @@ -921,7 +962,7 @@ int __mlx4_srq_alloc_icm(struct mlx4_dev *dev, int *srqn); void __mlx4_srq_free_icm(struct mlx4_dev *dev, int srqn); int __mlx4_mpt_reserve(struct mlx4_dev *dev); void __mlx4_mpt_release(struct mlx4_dev *dev, u32 index); -int __mlx4_mpt_alloc_icm(struct mlx4_dev *dev, u32 index); +int __mlx4_mpt_alloc_icm(struct mlx4_dev *dev, u32 index, gfp_t gfp); void __mlx4_mpt_free_icm(struct mlx4_dev *dev, u32 index); u32 __mlx4_alloc_mtt_range(struct mlx4_dev *dev, int order); void __mlx4_free_mtt_range(struct mlx4_dev *dev, u32 first_seg, int order); @@ -956,6 +997,11 @@ int mlx4_SW2HW_EQ_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_cmd_mailbox *inbox, struct mlx4_cmd_mailbox *outbox, struct mlx4_cmd_info *cmd); +int mlx4_CONFIG_DEV_wrapper(struct mlx4_dev *dev, int slave, + struct mlx4_vhcr *vhcr, + struct mlx4_cmd_mailbox *inbox, + struct mlx4_cmd_mailbox *outbox, + struct mlx4_cmd_info *cmd); int mlx4_DMA_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_vhcr *vhcr, struct mlx4_cmd_mailbox *inbox, @@ -968,20 +1014,17 @@ int __mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac); void __mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac); int __mlx4_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, int start_index, int npages, u64 *page_list); -int __mlx4_counter_alloc(struct mlx4_dev *dev, int slave, int port, u32 *idx); -void __mlx4_counter_free(struct mlx4_dev *dev, int slave, int port, u32 idx); - -int __mlx4_slave_counters_free(struct mlx4_dev *dev, int slave); -int __mlx4_clear_if_stat(struct mlx4_dev *dev, - u8 counter_index); -u8 mlx4_get_default_counter_index(struct mlx4_dev *dev, int slave, int port); - +int __mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx); +void __mlx4_counter_free(struct mlx4_dev *dev, u32 idx); +int mlx4_calc_vf_counters(struct mlx4_dev *dev, int slave, int port, + struct mlx4_counter *data); int __mlx4_xrcd_alloc(struct mlx4_dev *dev, u32 *xrcdn); void __mlx4_xrcd_free(struct mlx4_dev *dev, u32 xrcdn); void mlx4_start_catas_poll(struct mlx4_dev *dev); void mlx4_stop_catas_poll(struct mlx4_dev *dev); -void mlx4_catas_init(void); +int mlx4_catas_init(struct mlx4_dev *dev); +void mlx4_catas_end(struct mlx4_dev *dev); int mlx4_restart_one(struct pci_dev *pdev); int mlx4_register_device(struct mlx4_dev *dev); void mlx4_unregister_device(struct mlx4_dev *dev); @@ -996,7 +1039,6 @@ u64 mlx4_make_profile(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap, struct mlx4_init_hca_param *init_hca); void mlx4_master_comm_channel(struct work_struct *work); -void mlx4_master_arm_comm_channel(struct work_struct *work); void mlx4_gen_slave_eqe(struct work_struct *work); void mlx4_master_handle_slave_flr(struct work_struct *work); @@ -1137,17 +1179,27 @@ int mlx4_QUERY_QP_wrapper(struct mlx4_dev *dev, int slave, int mlx4_GEN_EQE(struct mlx4_dev *dev, int slave, struct mlx4_eqe *eqe); +enum { + MLX4_CMD_CLEANUP_STRUCT = 1UL << 0, + MLX4_CMD_CLEANUP_POOL = 1UL << 1, + MLX4_CMD_CLEANUP_HCR = 1UL << 2, + MLX4_CMD_CLEANUP_VHCR = 1UL << 3, + MLX4_CMD_CLEANUP_ALL = (MLX4_CMD_CLEANUP_VHCR << 1) - 1 +}; + int mlx4_cmd_init(struct mlx4_dev *dev); -void mlx4_cmd_cleanup(struct mlx4_dev *dev); +void mlx4_cmd_cleanup(struct mlx4_dev *dev, int cleanup_mask); int mlx4_multi_func_init(struct mlx4_dev *dev); +int mlx4_ARM_COMM_CHANNEL(struct mlx4_dev *dev); void mlx4_multi_func_cleanup(struct mlx4_dev *dev); void mlx4_cmd_event(struct mlx4_dev *dev, u16 token, u8 status, u64 out_param); int mlx4_cmd_use_events(struct mlx4_dev *dev); void mlx4_cmd_use_polling(struct mlx4_dev *dev); int mlx4_comm_cmd(struct mlx4_dev *dev, u8 cmd, u16 param, - unsigned long timeout); + u16 op, unsigned long timeout); +void mlx4_cq_tasklet_cb(unsigned long data); void mlx4_cq_completion(struct mlx4_dev *dev, u32 cqn); void mlx4_cq_event(struct mlx4_dev *dev, u32 cqn, int event_type); @@ -1155,7 +1207,7 @@ void mlx4_qp_event(struct mlx4_dev *dev, u32 qpn, int event_type); void mlx4_srq_event(struct mlx4_dev *dev, u32 srqn, int event_type); -void mlx4_handle_catas_err(struct mlx4_dev *dev); +void mlx4_enter_error_state(struct mlx4_dev_persistent *persist); int mlx4_SENSE_PORT(struct mlx4_dev *dev, int port, enum mlx4_port_type *type); @@ -1172,8 +1224,14 @@ int mlx4_change_port_types(struct mlx4_dev *dev, void mlx4_init_mac_table(struct mlx4_dev *dev, struct mlx4_mac_table *table); void mlx4_init_vlan_table(struct mlx4_dev *dev, struct mlx4_vlan_table *table); +void mlx4_init_roce_gid_table(struct mlx4_dev *dev, + struct mlx4_roce_gid_table *table); void __mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, u16 vlan); int __mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); +int mlx4_bond_vlan_table(struct mlx4_dev *dev); +int mlx4_unbond_vlan_table(struct mlx4_dev *dev); +int mlx4_bond_mac_table(struct mlx4_dev *dev); +int mlx4_unbond_mac_table(struct mlx4_dev *dev); int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port, int pkey_tbl_sz); /* resource tracker functions*/ @@ -1181,6 +1239,7 @@ int mlx4_get_slave_from_resource_id(struct mlx4_dev *dev, enum mlx4_resource resource_type, u64 resource_id, int *slave); void mlx4_delete_all_resources_for_slave(struct mlx4_dev *dev, int slave_id); +void mlx4_reset_roce_gids(struct mlx4_dev *dev, int slave); int mlx4_init_resource_tracker(struct mlx4_dev *dev); void mlx4_free_resource_tracker(struct mlx4_dev *dev, @@ -1227,6 +1286,12 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_cmd_mailbox *outbox, struct mlx4_cmd_info *cmd); +int mlx4_UPDATE_QP_wrapper(struct mlx4_dev *dev, int slave, + struct mlx4_vhcr *vhcr, + struct mlx4_cmd_mailbox *inbox, + struct mlx4_cmd_mailbox *outbox, + struct mlx4_cmd_info *cmd); + int mlx4_PROMISC_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_vhcr *vhcr, struct mlx4_cmd_mailbox *inbox, @@ -1241,7 +1306,6 @@ int mlx4_trans_to_dmfs_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], u8 port, int block_mcast_loopback, enum mlx4_protocol prot, u64 *reg_id); -int mlx4_SET_MCAST_FLTR(struct mlx4_dev *dev, u8 port, u64 mac, u64 clear, u8 mode); int mlx4_SET_MCAST_FLTR_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_vhcr *vhcr, struct mlx4_cmd_mailbox *inbox, @@ -1279,11 +1343,11 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_cmd_mailbox *inbox, struct mlx4_cmd_mailbox *outbox, struct mlx4_cmd_info *cmd); -int mlx4_MOD_STAT_CFG_wrapper(struct mlx4_dev *dev, int slave, - struct mlx4_vhcr *vhcr, - struct mlx4_cmd_mailbox *inbox, - struct mlx4_cmd_mailbox *outbox, - struct mlx4_cmd_info *cmd); +int mlx4_ACCESS_REG_wrapper(struct mlx4_dev *dev, int slave, + struct mlx4_vhcr *vhcr, + struct mlx4_cmd_mailbox *inbox, + struct mlx4_cmd_mailbox *outbox, + struct mlx4_cmd_info *cmd); int mlx4_get_mgm_entry_size(struct mlx4_dev *dev); int mlx4_get_qp_per_mgm(struct mlx4_dev *dev); @@ -1315,13 +1379,86 @@ static inline spinlock_t *mlx4_tlock(struct mlx4_dev *dev) #define NOT_MASKED_PD_BITS 17 -void sys_tune_init(void); -void sys_tune_fini(void); +void mlx4_vf_immed_vlan_work_handler(struct work_struct *_work); void mlx4_init_quotas(struct mlx4_dev *dev); -int mlx4_get_slave_num_gids(struct mlx4_dev *dev, int slave); -int mlx4_get_base_gid_ix(struct mlx4_dev *dev, int slave); -void mlx4_vf_immed_vlan_work_handler(struct work_struct *_work); +/* for VFs, replace zero MACs with randomly-generated MACs at driver start */ +void mlx4_replace_zero_macs(struct mlx4_dev *dev); +int mlx4_get_slave_num_gids(struct mlx4_dev *dev, int slave, int port); +/* Returns the VF index of slave */ +int mlx4_get_vf_indx(struct mlx4_dev *dev, int slave); +int mlx4_config_mad_demux(struct mlx4_dev *dev); +int mlx4_do_bond(struct mlx4_dev *dev, bool enable); +int mlx4_bond_fs_rules(struct mlx4_dev *dev); +int mlx4_unbond_fs_rules(struct mlx4_dev *dev); + +enum mlx4_zone_flags { + MLX4_ZONE_ALLOW_ALLOC_FROM_LOWER_PRIO = 1UL << 0, + MLX4_ZONE_ALLOW_ALLOC_FROM_EQ_PRIO = 1UL << 1, + MLX4_ZONE_FALLBACK_TO_HIGHER_PRIO = 1UL << 2, + MLX4_ZONE_USE_RR = 1UL << 3, +}; + +enum mlx4_zone_alloc_flags { + /* No two objects could overlap between zones. UID + * could be left unused. If this flag is given and + * two overlapped zones are used, an object will be free'd + * from the smallest possible matching zone. + */ + MLX4_ZONE_ALLOC_FLAGS_NO_OVERLAP = 1UL << 0, +}; + +struct mlx4_zone_allocator; + +/* Create a new zone allocator */ +struct mlx4_zone_allocator *mlx4_zone_allocator_create(enum mlx4_zone_alloc_flags flags); + +/* Attach a mlx4_bitmap of priority to the zone allocator + * . Allocating an object from this zone adds an offset . + * Similarly, when searching for an object to free, this offset it taken into + * account. The use_rr mlx4_ib parameter for allocating objects from this + * is given through the MLX4_ZONE_USE_RR flag in . + * When an allocation fails, tries to allocate from other zones + * according to the policy set by . is the unique identifier + * received to this zone. + */ +int mlx4_zone_add_one(struct mlx4_zone_allocator *zone_alloc, + struct mlx4_bitmap *bitmap, + u32 flags, + int priority, + int offset, + u32 *puid); + +/* Remove bitmap indicated by from */ +int mlx4_zone_remove_one(struct mlx4_zone_allocator *zone_alloc, u32 uid); + +/* Delete the zone allocator objects with align and skip_mask + * from the mlx4_bitmap whose uid is . The bitmap which we actually + * allocated from is returned in . If the allocation fails, a negative + * number is returned. Otherwise, the offset of the first object is returned. + */ +u32 mlx4_zone_alloc_entries(struct mlx4_zone_allocator *zones, u32 uid, int count, + int align, u32 skip_mask, u32 *puid); + +/* Free objects, start from of the uid from zone_allocator + * . + */ +u32 mlx4_zone_free_entries(struct mlx4_zone_allocator *zones, + u32 uid, u32 obj, u32 count); + +/* If was allocated with MLX4_ZONE_ALLOC_FLAGS_NO_OVERLAP, instead of + * specifying the uid when freeing an object, zone allocator could figure it by + * itself. Other parameters are similar to mlx4_zone_free. + */ +u32 mlx4_zone_free_entries_unique(struct mlx4_zone_allocator *zones, u32 obj, u32 count); + +/* Returns a pointer to mlx4_bitmap that was attached to with */ +struct mlx4_bitmap *mlx4_zone_get_bitmap(struct mlx4_zone_allocator *zones, u32 uid); #endif /* MLX4_H */ diff --git a/sys/dev/mlx4/mlx4_core/mlx4_alloc.c b/sys/dev/mlx4/mlx4_core/mlx4_alloc.c index da36b34d98b5..dcf6204dfc1a 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_alloc.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_alloc.c @@ -116,12 +116,12 @@ u32 mlx4_bitmap_alloc_range(struct mlx4_bitmap *bitmap, int cnt, spin_lock(&bitmap->lock); obj = find_aligned_range(bitmap->table, bitmap->last, - bitmap->max, cnt, align, skip_mask); + bitmap->max, cnt, align, skip_mask); if (obj >= bitmap->max) { bitmap->top = (bitmap->top + bitmap->max + bitmap->reserved_top) & bitmap->mask; obj = find_aligned_range(bitmap->table, 0, bitmap->max, - cnt, align, skip_mask); + cnt, align, skip_mask); } if (obj < bitmap->max) { @@ -148,6 +148,11 @@ u32 mlx4_bitmap_avail(struct mlx4_bitmap *bitmap) return bitmap->avail; } +static u32 mlx4_bitmap_masked_value(struct mlx4_bitmap *bitmap, u32 obj) +{ + return obj & (bitmap->max + bitmap->reserved_top - 1); +} + void mlx4_bitmap_free_range(struct mlx4_bitmap *bitmap, u32 obj, int cnt, int use_rr) { @@ -167,23 +172,17 @@ void mlx4_bitmap_free_range(struct mlx4_bitmap *bitmap, u32 obj, int cnt, int mlx4_bitmap_init(struct mlx4_bitmap *bitmap, u32 num, u32 mask, u32 reserved_bot, u32 reserved_top) { - /* sanity check */ - if (num <= (u64)reserved_top + reserved_bot) - return -EINVAL; - /* num must be a power of 2 */ if (num != roundup_pow_of_two(num)) return -EINVAL; - if (reserved_bot + reserved_top >= num) - return -EINVAL; - bitmap->last = 0; bitmap->top = 0; bitmap->max = num - reserved_top; bitmap->mask = mask; bitmap->reserved_top = reserved_top; bitmap->avail = num - reserved_top - reserved_bot; + bitmap->effective_len = bitmap->avail; spin_lock_init(&bitmap->lock); bitmap->table = kzalloc(BITS_TO_LONGS(bitmap->max) * sizeof (long), GFP_KERNEL); @@ -200,6 +199,382 @@ void mlx4_bitmap_cleanup(struct mlx4_bitmap *bitmap) kfree(bitmap->table); } +struct mlx4_zone_allocator { + struct list_head entries; + struct list_head prios; + u32 last_uid; + u32 mask; + /* protect the zone_allocator from concurrent accesses */ + spinlock_t lock; + enum mlx4_zone_alloc_flags flags; +}; + +struct mlx4_zone_entry { + struct list_head list; + struct list_head prio_list; + u32 uid; + struct mlx4_zone_allocator *allocator; + struct mlx4_bitmap *bitmap; + int use_rr; + int priority; + int offset; + enum mlx4_zone_flags flags; +}; + +struct mlx4_zone_allocator *mlx4_zone_allocator_create(enum mlx4_zone_alloc_flags flags) +{ + struct mlx4_zone_allocator *zones = kmalloc(sizeof(*zones), GFP_KERNEL); + + if (NULL == zones) + return NULL; + + INIT_LIST_HEAD(&zones->entries); + INIT_LIST_HEAD(&zones->prios); + spin_lock_init(&zones->lock); + zones->last_uid = 0; + zones->mask = 0; + zones->flags = flags; + + return zones; +} + +int mlx4_zone_add_one(struct mlx4_zone_allocator *zone_alloc, + struct mlx4_bitmap *bitmap, + u32 flags, + int priority, + int offset, + u32 *puid) +{ + u32 mask = mlx4_bitmap_masked_value(bitmap, (u32)-1); + struct mlx4_zone_entry *it; + struct mlx4_zone_entry *zone = kmalloc(sizeof(*zone), GFP_KERNEL); + + if (NULL == zone) + return -ENOMEM; + + zone->flags = flags; + zone->bitmap = bitmap; + zone->use_rr = (flags & MLX4_ZONE_USE_RR) ? MLX4_USE_RR : 0; + zone->priority = priority; + zone->offset = offset; + + spin_lock(&zone_alloc->lock); + + zone->uid = zone_alloc->last_uid++; + zone->allocator = zone_alloc; + + if (zone_alloc->mask < mask) + zone_alloc->mask = mask; + + list_for_each_entry(it, &zone_alloc->prios, prio_list) + if (it->priority >= priority) + break; + + if (&it->prio_list == &zone_alloc->prios || it->priority > priority) + list_add_tail(&zone->prio_list, &it->prio_list); + list_add_tail(&zone->list, &it->list); + + spin_unlock(&zone_alloc->lock); + + *puid = zone->uid; + + return 0; +} + +/* Should be called under a lock */ +static int __mlx4_zone_remove_one_entry(struct mlx4_zone_entry *entry) +{ + struct mlx4_zone_allocator *zone_alloc = entry->allocator; + + if (!list_empty(&entry->prio_list)) { + /* Check if we need to add an alternative node to the prio list */ + if (!list_is_last(&entry->list, &zone_alloc->entries)) { + struct mlx4_zone_entry *next = list_first_entry(&entry->list, + typeof(*next), + list); + + if (next->priority == entry->priority) + list_add_tail(&next->prio_list, &entry->prio_list); + } + + list_del(&entry->prio_list); + } + + list_del(&entry->list); + + if (zone_alloc->flags & MLX4_ZONE_ALLOC_FLAGS_NO_OVERLAP) { + u32 mask = 0; + struct mlx4_zone_entry *it; + + list_for_each_entry(it, &zone_alloc->prios, prio_list) { + u32 cur_mask = mlx4_bitmap_masked_value(it->bitmap, (u32)-1); + + if (mask < cur_mask) + mask = cur_mask; + } + zone_alloc->mask = mask; + } + + return 0; +} + +void mlx4_zone_allocator_destroy(struct mlx4_zone_allocator *zone_alloc) +{ + struct mlx4_zone_entry *zone, *tmp; + + spin_lock(&zone_alloc->lock); + + list_for_each_entry_safe(zone, tmp, &zone_alloc->entries, list) { + list_del(&zone->list); + list_del(&zone->prio_list); + kfree(zone); + } + + spin_unlock(&zone_alloc->lock); + kfree(zone_alloc); +} + +/* Should be called under a lock */ +static u32 __mlx4_alloc_from_zone(struct mlx4_zone_entry *zone, int count, + int align, u32 skip_mask, u32 *puid) +{ + u32 uid = 0; + u32 res; + struct mlx4_zone_allocator *zone_alloc = zone->allocator; + struct mlx4_zone_entry *curr_node; + + res = mlx4_bitmap_alloc_range(zone->bitmap, count, + align, skip_mask); + + if (res != (u32)-1) { + res += zone->offset; + uid = zone->uid; + goto out; + } + + list_for_each_entry(curr_node, &zone_alloc->prios, prio_list) { + if (unlikely(curr_node->priority == zone->priority)) + break; + } + + if (zone->flags & MLX4_ZONE_ALLOW_ALLOC_FROM_LOWER_PRIO) { + struct mlx4_zone_entry *it = curr_node; + + list_for_each_entry_continue_reverse(it, &zone_alloc->entries, list) { + res = mlx4_bitmap_alloc_range(it->bitmap, count, + align, skip_mask); + if (res != (u32)-1) { + res += it->offset; + uid = it->uid; + goto out; + } + } + } + + if (zone->flags & MLX4_ZONE_ALLOW_ALLOC_FROM_EQ_PRIO) { + struct mlx4_zone_entry *it = curr_node; + + list_for_each_entry_from(it, &zone_alloc->entries, list) { + if (unlikely(it == zone)) + continue; + + if (unlikely(it->priority != curr_node->priority)) + break; + + res = mlx4_bitmap_alloc_range(it->bitmap, count, + align, skip_mask); + if (res != (u32)-1) { + res += it->offset; + uid = it->uid; + goto out; + } + } + } + + if (zone->flags & MLX4_ZONE_FALLBACK_TO_HIGHER_PRIO) { + if (list_is_last(&curr_node->prio_list, &zone_alloc->prios)) + goto out; + + curr_node = list_first_entry(&curr_node->prio_list, + typeof(*curr_node), + prio_list); + + list_for_each_entry_from(curr_node, &zone_alloc->entries, list) { + res = mlx4_bitmap_alloc_range(curr_node->bitmap, count, + align, skip_mask); + if (res != (u32)-1) { + res += curr_node->offset; + uid = curr_node->uid; + goto out; + } + } + } + +out: + if (NULL != puid && res != (u32)-1) + *puid = uid; + return res; +} + +/* Should be called under a lock */ +static void __mlx4_free_from_zone(struct mlx4_zone_entry *zone, u32 obj, + u32 count) +{ + mlx4_bitmap_free_range(zone->bitmap, obj - zone->offset, count, zone->use_rr); +} + +/* Should be called under a lock */ +static struct mlx4_zone_entry *__mlx4_find_zone_by_uid( + struct mlx4_zone_allocator *zones, u32 uid) +{ + struct mlx4_zone_entry *zone; + + list_for_each_entry(zone, &zones->entries, list) { + if (zone->uid == uid) + return zone; + } + + return NULL; +} + +struct mlx4_bitmap *mlx4_zone_get_bitmap(struct mlx4_zone_allocator *zones, u32 uid) +{ + struct mlx4_zone_entry *zone; + struct mlx4_bitmap *bitmap; + + spin_lock(&zones->lock); + + zone = __mlx4_find_zone_by_uid(zones, uid); + + bitmap = zone == NULL ? NULL : zone->bitmap; + + spin_unlock(&zones->lock); + + return bitmap; +} + +int mlx4_zone_remove_one(struct mlx4_zone_allocator *zones, u32 uid) +{ + struct mlx4_zone_entry *zone; + int res; + + spin_lock(&zones->lock); + + zone = __mlx4_find_zone_by_uid(zones, uid); + + if (NULL == zone) { + res = -1; + goto out; + } + + res = __mlx4_zone_remove_one_entry(zone); + +out: + spin_unlock(&zones->lock); + kfree(zone); + + return res; +} + +/* Should be called under a lock */ +static struct mlx4_zone_entry *__mlx4_find_zone_by_uid_unique( + struct mlx4_zone_allocator *zones, u32 obj) +{ + struct mlx4_zone_entry *zone, *zone_candidate = NULL; + u32 dist = (u32)-1; + + /* Search for the smallest zone that this obj could be + * allocated from. This is done in order to handle + * situations when small bitmaps are allocated from bigger + * bitmaps (and the allocated space is marked as reserved in + * the bigger bitmap. + */ + list_for_each_entry(zone, &zones->entries, list) { + if (obj >= zone->offset) { + u32 mobj = (obj - zone->offset) & zones->mask; + + if (mobj < zone->bitmap->max) { + u32 curr_dist = zone->bitmap->effective_len; + + if (curr_dist < dist) { + dist = curr_dist; + zone_candidate = zone; + } + } + } + } + + return zone_candidate; +} + +u32 mlx4_zone_alloc_entries(struct mlx4_zone_allocator *zones, u32 uid, int count, + int align, u32 skip_mask, u32 *puid) +{ + struct mlx4_zone_entry *zone; + int res = -1; + + spin_lock(&zones->lock); + + zone = __mlx4_find_zone_by_uid(zones, uid); + + if (NULL == zone) + goto out; + + res = __mlx4_alloc_from_zone(zone, count, align, skip_mask, puid); + +out: + spin_unlock(&zones->lock); + + return res; +} + +u32 mlx4_zone_free_entries(struct mlx4_zone_allocator *zones, u32 uid, u32 obj, u32 count) +{ + struct mlx4_zone_entry *zone; + int res = 0; + + spin_lock(&zones->lock); + + zone = __mlx4_find_zone_by_uid(zones, uid); + + if (NULL == zone) { + res = -1; + goto out; + } + + __mlx4_free_from_zone(zone, obj, count); + +out: + spin_unlock(&zones->lock); + + return res; +} + +u32 mlx4_zone_free_entries_unique(struct mlx4_zone_allocator *zones, u32 obj, u32 count) +{ + struct mlx4_zone_entry *zone; + int res; + + if (!(zones->flags & MLX4_ZONE_ALLOC_FLAGS_NO_OVERLAP)) + return -EFAULT; + + spin_lock(&zones->lock); + + zone = __mlx4_find_zone_by_uid_unique(zones, obj); + + if (NULL == zone) { + res = -1; + goto out; + } + + __mlx4_free_from_zone(zone, obj, count); + res = 0; + +out: + spin_unlock(&zones->lock); + + return res; +} /* * Handling for queue buffers -- we allocate a bunch of memory and * register it in a memory region at HCA virtual address 0. If the @@ -208,7 +583,7 @@ void mlx4_bitmap_cleanup(struct mlx4_bitmap *bitmap) */ int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, - struct mlx4_buf *buf) + struct mlx4_buf *buf, gfp_t gfp) { dma_addr_t t; @@ -216,8 +591,8 @@ int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, buf->nbufs = 1; buf->npages = 1; buf->page_shift = get_order(size) + PAGE_SHIFT; - buf->direct.buf = dma_alloc_coherent(&dev->pdev->dev, - size, &t, GFP_KERNEL); + buf->direct.buf = dma_alloc_coherent(&dev->persist->pdev->dev, + size, &t, gfp); if (!buf->direct.buf) return -ENOMEM; @@ -237,14 +612,15 @@ int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, buf->npages = buf->nbufs; buf->page_shift = PAGE_SHIFT; buf->page_list = kcalloc(buf->nbufs, sizeof(*buf->page_list), - GFP_KERNEL); + gfp); if (!buf->page_list) return -ENOMEM; for (i = 0; i < buf->nbufs; ++i) { buf->page_list[i].buf = - dma_alloc_coherent(&dev->pdev->dev, PAGE_SIZE, - &t, GFP_KERNEL); + dma_alloc_coherent(&dev->persist->pdev->dev, + PAGE_SIZE, + &t, gfp); if (!buf->page_list[i].buf) goto err_free; @@ -255,7 +631,7 @@ int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, if (BITS_PER_LONG == 64) { struct page **pages; - pages = kmalloc(sizeof *pages * buf->nbufs, GFP_KERNEL); + pages = kmalloc(sizeof *pages * buf->nbufs, gfp); if (!pages) goto err_free; for (i = 0; i < buf->nbufs; ++i) @@ -281,15 +657,17 @@ void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf) int i; if (buf->nbufs == 1) - dma_free_coherent(&dev->pdev->dev, size, buf->direct.buf, + dma_free_coherent(&dev->persist->pdev->dev, size, + buf->direct.buf, buf->direct.map); else { - if (BITS_PER_LONG == 64 && buf->direct.buf) + if (BITS_PER_LONG == 64) vunmap(buf->direct.buf); for (i = 0; i < buf->nbufs; ++i) if (buf->page_list[i].buf) - dma_free_coherent(&dev->pdev->dev, PAGE_SIZE, + dma_free_coherent(&dev->persist->pdev->dev, + PAGE_SIZE, buf->page_list[i].buf, buf->page_list[i].map); kfree(buf->page_list); @@ -297,11 +675,12 @@ void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf) } EXPORT_SYMBOL_GPL(mlx4_buf_free); -static struct mlx4_db_pgdir *mlx4_alloc_db_pgdir(struct device *dma_device) +static struct mlx4_db_pgdir *mlx4_alloc_db_pgdir(struct device *dma_device, + gfp_t gfp) { struct mlx4_db_pgdir *pgdir; - pgdir = kzalloc(sizeof *pgdir, GFP_KERNEL); + pgdir = kzalloc(sizeof *pgdir, gfp); if (!pgdir) return NULL; @@ -309,7 +688,7 @@ static struct mlx4_db_pgdir *mlx4_alloc_db_pgdir(struct device *dma_device) pgdir->bits[0] = pgdir->order0; pgdir->bits[1] = pgdir->order1; pgdir->db_page = dma_alloc_coherent(dma_device, PAGE_SIZE, - &pgdir->db_dma, GFP_KERNEL); + &pgdir->db_dma, gfp); if (!pgdir->db_page) { kfree(pgdir); return NULL; @@ -349,7 +728,7 @@ static int mlx4_alloc_db_from_pgdir(struct mlx4_db_pgdir *pgdir, return 0; } -int mlx4_db_alloc(struct mlx4_dev *dev, struct mlx4_db *db, int order) +int mlx4_db_alloc(struct mlx4_dev *dev, struct mlx4_db *db, int order, gfp_t gfp) { struct mlx4_priv *priv = mlx4_priv(dev); struct mlx4_db_pgdir *pgdir; @@ -361,7 +740,7 @@ int mlx4_db_alloc(struct mlx4_dev *dev, struct mlx4_db *db, int order) if (!mlx4_alloc_db_from_pgdir(pgdir, db, order)) goto out; - pgdir = mlx4_alloc_db_pgdir(&(dev->pdev->dev)); + pgdir = mlx4_alloc_db_pgdir(&dev->persist->pdev->dev, gfp); if (!pgdir) { ret = -ENOMEM; goto out; @@ -398,7 +777,7 @@ void mlx4_db_free(struct mlx4_dev *dev, struct mlx4_db *db) set_bit(i, db->u.pgdir->bits[o]); if (bitmap_full(db->u.pgdir->order1, MLX4_DB_PER_PAGE / 2)) { - dma_free_coherent(&(dev->pdev->dev), PAGE_SIZE, + dma_free_coherent(&dev->persist->pdev->dev, PAGE_SIZE, db->u.pgdir->db_page, db->u.pgdir->db_dma); list_del(&db->u.pgdir->list); kfree(db->u.pgdir); @@ -413,13 +792,13 @@ int mlx4_alloc_hwq_res(struct mlx4_dev *dev, struct mlx4_hwq_resources *wqres, { int err; - err = mlx4_db_alloc(dev, &wqres->db, 1); + err = mlx4_db_alloc(dev, &wqres->db, 1, GFP_KERNEL); if (err) return err; *wqres->db.db = 0; - err = mlx4_buf_alloc(dev, size, max_direct, &wqres->buf); + err = mlx4_buf_alloc(dev, size, max_direct, &wqres->buf, GFP_KERNEL); if (err) goto err_db; @@ -428,7 +807,7 @@ int mlx4_alloc_hwq_res(struct mlx4_dev *dev, struct mlx4_hwq_resources *wqres, if (err) goto err_buf; - err = mlx4_buf_write_mtt(dev, &wqres->mtt, &wqres->buf); + err = mlx4_buf_write_mtt(dev, &wqres->mtt, &wqres->buf, GFP_KERNEL); if (err) goto err_mtt; diff --git a/sys/dev/mlx4/mlx4_core/mlx4_catas.c b/sys/dev/mlx4/mlx4_core/mlx4_catas.c index 497e0ddb8956..165b8faa2896 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_catas.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_catas.c @@ -42,16 +42,177 @@ #define MLX4_CATAS_POLL_INTERVAL (5 * HZ) -static DEFINE_SPINLOCK(catas_lock); -static LIST_HEAD(catas_list); -static struct work_struct catas_work; -static int internal_err_reset = 1; -module_param(internal_err_reset, int, 0644); +int mlx4_internal_err_reset = 1; +module_param_named(internal_err_reset, mlx4_internal_err_reset, int, 0644); MODULE_PARM_DESC(internal_err_reset, - "Reset device on internal errors if non-zero" - " (default 1, in SRIOV mode default is 0)"); + "Reset device on internal errors if non-zero (default 1)"); + +static int read_vendor_id(struct mlx4_dev *dev) +{ + u16 vendor_id = 0; + int ret; + + ret = pci_read_config_word(dev->persist->pdev, 0, &vendor_id); + if (ret) { + mlx4_err(dev, "Failed to read vendor ID, ret=%d\n", ret); + return ret; + } + + if (vendor_id == 0xffff) { + mlx4_err(dev, "PCI can't be accessed to read vendor id\n"); + return -EINVAL; + } + + return 0; +} + +static int mlx4_reset_master(struct mlx4_dev *dev) +{ + int err = 0; + + if (mlx4_is_master(dev)) + mlx4_report_internal_err_comm_event(dev); + + if (!pci_channel_offline(dev->persist->pdev)) { + err = read_vendor_id(dev); + /* If PCI can't be accessed to read vendor ID we assume that its + * link was disabled and chip was already reset. + */ + if (err) + return 0; + + err = mlx4_reset(dev); + if (err) + mlx4_err(dev, "Fail to reset HCA\n"); + } + + return err; +} + +static int mlx4_reset_slave(struct mlx4_dev *dev) +{ +#define COM_CHAN_RST_REQ_OFFSET 0x10 +#define COM_CHAN_RST_ACK_OFFSET 0x08 + + u32 comm_flags; + u32 rst_req; + u32 rst_ack; + unsigned long end; + struct mlx4_priv *priv = mlx4_priv(dev); + + if (pci_channel_offline(dev->persist->pdev)) + return 0; + + comm_flags = swab32(readl((__iomem char *)priv->mfunc.comm + + MLX4_COMM_CHAN_FLAGS)); + if (comm_flags == 0xffffffff) { + mlx4_err(dev, "VF reset is not needed\n"); + return 0; + } + + if (!(dev->caps.vf_caps & MLX4_VF_CAP_FLAG_RESET)) { + mlx4_err(dev, "VF reset is not supported\n"); + return -EOPNOTSUPP; + } + + rst_req = (comm_flags & (u32)(1 << COM_CHAN_RST_REQ_OFFSET)) >> + COM_CHAN_RST_REQ_OFFSET; + rst_ack = (comm_flags & (u32)(1 << COM_CHAN_RST_ACK_OFFSET)) >> + COM_CHAN_RST_ACK_OFFSET; + if (rst_req != rst_ack) { + mlx4_err(dev, "Communication channel isn't sync, fail to send reset\n"); + return -EIO; + } + + rst_req ^= 1; + mlx4_warn(dev, "VF is sending reset request to Firmware\n"); + comm_flags = rst_req << COM_CHAN_RST_REQ_OFFSET; + __raw_writel((__force u32)cpu_to_be32(comm_flags), + (__iomem char *)priv->mfunc.comm + MLX4_COMM_CHAN_FLAGS); + /* Make sure that our comm channel write doesn't + * get mixed in with writes from another CPU. + */ + mmiowb(); + + end = msecs_to_jiffies(MLX4_COMM_TIME) + jiffies; + while (time_before(jiffies, end)) { + comm_flags = swab32(readl((__iomem char *)priv->mfunc.comm + + MLX4_COMM_CHAN_FLAGS)); + rst_ack = (comm_flags & (u32)(1 << COM_CHAN_RST_ACK_OFFSET)) >> + COM_CHAN_RST_ACK_OFFSET; + + /* Reading rst_req again since the communication channel can + * be reset at any time by the PF and all its bits will be + * set to zero. + */ + rst_req = (comm_flags & (u32)(1 << COM_CHAN_RST_REQ_OFFSET)) >> + COM_CHAN_RST_REQ_OFFSET; + + if (rst_ack == rst_req) { + mlx4_warn(dev, "VF Reset succeed\n"); + return 0; + } + cond_resched(); + } + mlx4_err(dev, "Fail to send reset over the communication channel\n"); + return -ETIMEDOUT; +} + +static int mlx4_comm_internal_err(u32 slave_read) +{ + return (u32)COMM_CHAN_EVENT_INTERNAL_ERR == + (slave_read & (u32)COMM_CHAN_EVENT_INTERNAL_ERR) ? 1 : 0; +} + +void mlx4_enter_error_state(struct mlx4_dev_persistent *persist) +{ + int err; + struct mlx4_dev *dev; + + if (!mlx4_internal_err_reset) + return; + + mutex_lock(&persist->device_state_mutex); + if (persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR) + goto out; + + dev = persist->dev; + mlx4_err(dev, "device is going to be reset\n"); + if (mlx4_is_slave(dev)) + err = mlx4_reset_slave(dev); + else + err = mlx4_reset_master(dev); + BUG_ON(err != 0); + + dev->persist->state |= MLX4_DEVICE_STATE_INTERNAL_ERROR; + mlx4_err(dev, "device was reset successfully\n"); + mutex_unlock(&persist->device_state_mutex); + + /* At that step HW was already reset, now notify clients */ + mlx4_dispatch_event(dev, MLX4_DEV_EVENT_CATASTROPHIC_ERROR, 0); + mlx4_cmd_wake_completions(dev); + return; + +out: + mutex_unlock(&persist->device_state_mutex); +} + +static void mlx4_handle_error_state(struct mlx4_dev_persistent *persist) +{ + int err = 0; + + mlx4_enter_error_state(persist); + mutex_lock(&persist->interface_state_mutex); + if (persist->interface_state & MLX4_INTERFACE_STATE_UP && + !(persist->interface_state & MLX4_INTERFACE_STATE_DELETION)) { + err = mlx4_restart_one(persist->pdev); + mlx4_info(persist->dev, "mlx4_restart_one was ended, ret=%d\n", + err); + } + mutex_unlock(&persist->interface_state_mutex); +} static void dump_err_buf(struct mlx4_dev *dev) { @@ -69,58 +230,40 @@ static void poll_catas(unsigned long dev_ptr) { struct mlx4_dev *dev = (struct mlx4_dev *) dev_ptr; struct mlx4_priv *priv = mlx4_priv(dev); + u32 slave_read; - if (readl(priv->catas_err.map)) { - /* If the device is off-line, we cannot try to recover it */ - if (pci_channel_offline(dev->pdev)) - mod_timer(&priv->catas_err.timer, - round_jiffies(jiffies + MLX4_CATAS_POLL_INTERVAL)); - else { - dump_err_buf(dev); - mlx4_dispatch_event(dev, MLX4_DEV_EVENT_CATASTROPHIC_ERROR, 0); - - if (internal_err_reset) { - spin_lock(&catas_lock); - list_add(&priv->catas_err.list, &catas_list); - spin_unlock(&catas_lock); - - queue_work(mlx4_wq, &catas_work); - } + if (mlx4_is_slave(dev)) { + slave_read = swab32(readl(&priv->mfunc.comm->slave_read)); + if (mlx4_comm_internal_err(slave_read)) { + mlx4_warn(dev, "Internal error detected on the communication channel\n"); + goto internal_err; } - } else - mod_timer(&priv->catas_err.timer, - round_jiffies(jiffies + MLX4_CATAS_POLL_INTERVAL)); + } else if (readl(priv->catas_err.map)) { + dump_err_buf(dev); + goto internal_err; + } + + if (dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR) { + mlx4_warn(dev, "Internal error mark was detected on device\n"); + goto internal_err; + } + + mod_timer(&priv->catas_err.timer, + round_jiffies(jiffies + MLX4_CATAS_POLL_INTERVAL)); + return; + +internal_err: + if (mlx4_internal_err_reset) + queue_work(dev->persist->catas_wq, &dev->persist->catas_work); } static void catas_reset(struct work_struct *work) { - struct mlx4_priv *priv, *tmppriv; - struct mlx4_dev *dev; + struct mlx4_dev_persistent *persist = + container_of(work, struct mlx4_dev_persistent, + catas_work); - LIST_HEAD(tlist); - int ret; - - spin_lock_irq(&catas_lock); - list_splice_init(&catas_list, &tlist); - spin_unlock_irq(&catas_lock); - - list_for_each_entry_safe(priv, tmppriv, &tlist, catas_err.list) { - struct pci_dev *pdev = priv->dev.pdev; - - /* If the device is off-line, we cannot reset it */ - if (pci_channel_offline(pdev)) - continue; - - ret = mlx4_restart_one(priv->dev.pdev); - /* 'priv' now is not valid */ - if (ret) - pr_err("mlx4 %s: Reset failed (%d)\n", - pci_name(pdev), ret); - else { - dev = pci_get_drvdata(pdev); - mlx4_dbg(dev, "Reset succeeded\n"); - } - } + mlx4_handle_error_state(persist); } void mlx4_start_catas_poll(struct mlx4_dev *dev) @@ -128,22 +271,21 @@ void mlx4_start_catas_poll(struct mlx4_dev *dev) struct mlx4_priv *priv = mlx4_priv(dev); phys_addr_t addr; - /*If we are in SRIOV the default of the module param must be 0*/ - if (mlx4_is_mfunc(dev)) - internal_err_reset = 0; - INIT_LIST_HEAD(&priv->catas_err.list); init_timer(&priv->catas_err.timer); priv->catas_err.map = NULL; - addr = pci_resource_start(dev->pdev, priv->fw.catas_bar) + - priv->fw.catas_offset; + if (!mlx4_is_slave(dev)) { + addr = pci_resource_start(dev->persist->pdev, + priv->fw.catas_bar) + + priv->fw.catas_offset; - priv->catas_err.map = ioremap(addr, priv->fw.catas_size * 4); - if (!priv->catas_err.map) { - mlx4_warn(dev, "Failed to map internal error buffer at 0x%llx\n", - (unsigned long long) addr); - return; + priv->catas_err.map = ioremap(addr, priv->fw.catas_size * 4); + if (!priv->catas_err.map) { + mlx4_warn(dev, "Failed to map internal error buffer at 0x%llx\n", + (unsigned long long)addr); + return; + } } priv->catas_err.timer.data = (unsigned long) dev; @@ -164,12 +306,24 @@ void mlx4_stop_catas_poll(struct mlx4_dev *dev) priv->catas_err.map = NULL; } - spin_lock_irq(&catas_lock); - list_del_init(&priv->catas_err.list); - spin_unlock_irq(&catas_lock); + if (dev->persist->interface_state & MLX4_INTERFACE_STATE_DELETION) + flush_workqueue(dev->persist->catas_wq); } -void __init mlx4_catas_init(void) +int mlx4_catas_init(struct mlx4_dev *dev) { - INIT_WORK(&catas_work, catas_reset); + INIT_WORK(&dev->persist->catas_work, catas_reset); + dev->persist->catas_wq = create_singlethread_workqueue("mlx4_health"); + if (!dev->persist->catas_wq) + return -ENOMEM; + + return 0; +} + +void mlx4_catas_end(struct mlx4_dev *dev) +{ + if (dev->persist->catas_wq) { + destroy_workqueue(dev->persist->catas_wq); + dev->persist->catas_wq = NULL; + } } diff --git a/sys/dev/mlx4/mlx4_core/mlx4_cmd.c b/sys/dev/mlx4/mlx4_core/mlx4_cmd.c index 8d0b461b8c79..6f972a0f3da1 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_cmd.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_cmd.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -48,6 +49,7 @@ #include "mlx4.h" #include "fw.h" +#include "fw_qos.h" #define CMD_POLL_TOKEN 0xffff #define INBOX_MASK 0xffffffffffffff00ULL @@ -163,131 +165,6 @@ static int mlx4_status_to_errno(u8 status) return trans_table[status]; } -static const char *cmd_to_str(u16 cmd) -{ - switch (cmd) { - case MLX4_CMD_SYS_EN: return "SYS_EN"; - case MLX4_CMD_SYS_DIS: return "SYS_DIS"; - case MLX4_CMD_MAP_FA: return "MAP_FA"; - case MLX4_CMD_UNMAP_FA: return "UNMAP_FA"; - case MLX4_CMD_RUN_FW: return "RUN_FW"; - case MLX4_CMD_MOD_STAT_CFG: return "MOD_STAT_CFG"; - case MLX4_CMD_QUERY_DEV_CAP: return "QUERY_DEV_CAP"; - case MLX4_CMD_QUERY_FW: return "QUERY_FW"; - case MLX4_CMD_ENABLE_LAM: return "ENABLE_LAM"; - case MLX4_CMD_DISABLE_LAM: return "DISABLE_LAM"; - case MLX4_CMD_QUERY_DDR: return "QUERY_DDR"; - case MLX4_CMD_QUERY_ADAPTER: return "QUERY_ADAPTER"; - case MLX4_CMD_INIT_HCA: return "INIT_HCA"; - case MLX4_CMD_CLOSE_HCA: return "CLOSE_HCA"; - case MLX4_CMD_INIT_PORT: return "INIT_PORT"; - case MLX4_CMD_CLOSE_PORT: return "CLOSE_PORT"; - case MLX4_CMD_QUERY_HCA: return "QUERY_HCA"; - case MLX4_CMD_QUERY_PORT: return "QUERY_PORT"; - case MLX4_CMD_SENSE_PORT: return "SENSE_PORT"; - case MLX4_CMD_HW_HEALTH_CHECK: return "HW_HEALTH_CHECK"; - case MLX4_CMD_SET_PORT: return "SET_PORT"; - case MLX4_CMD_SET_NODE: return "SET_NODE"; - case MLX4_CMD_QUERY_FUNC: return "QUERY_FUNC"; - case MLX4_CMD_MAP_ICM: return "MAP_ICM"; - case MLX4_CMD_UNMAP_ICM: return "UNMAP_ICM"; - case MLX4_CMD_MAP_ICM_AUX: return "MAP_ICM_AUX"; - case MLX4_CMD_UNMAP_ICM_AUX: return "UNMAP_ICM_AUX"; - case MLX4_CMD_SET_ICM_SIZE: return "SET_ICM_SIZE"; - /*master notify fw on finish for slave's flr*/ - case MLX4_CMD_INFORM_FLR_DONE: return "INFORM_FLR_DONE"; - case MLX4_CMD_GET_OP_REQ: return "GET_OP_REQ"; - - /* TPT commands */ - case MLX4_CMD_SW2HW_MPT: return "SW2HW_MPT"; - case MLX4_CMD_QUERY_MPT: return "QUERY_MPT"; - case MLX4_CMD_HW2SW_MPT: return "HW2SW_MPT"; - case MLX4_CMD_READ_MTT: return "READ_MTT"; - case MLX4_CMD_WRITE_MTT: return "WRITE_MTT"; - case MLX4_CMD_SYNC_TPT: return "SYNC_TPT"; - - /* EQ commands */ - case MLX4_CMD_MAP_EQ: return "MAP_EQ"; - case MLX4_CMD_SW2HW_EQ: return "SW2HW_EQ"; - case MLX4_CMD_HW2SW_EQ: return "HW2SW_EQ"; - case MLX4_CMD_QUERY_EQ: return "QUERY_EQ"; - - /* CQ commands */ - case MLX4_CMD_SW2HW_CQ: return "SW2HW_CQ"; - case MLX4_CMD_HW2SW_CQ: return "HW2SW_CQ"; - case MLX4_CMD_QUERY_CQ: return "QUERY_CQ:"; - case MLX4_CMD_MODIFY_CQ: return "MODIFY_CQ:"; - - /* SRQ commands */ - case MLX4_CMD_SW2HW_SRQ: return "SW2HW_SRQ"; - case MLX4_CMD_HW2SW_SRQ: return "HW2SW_SRQ"; - case MLX4_CMD_QUERY_SRQ: return "QUERY_SRQ"; - case MLX4_CMD_ARM_SRQ: return "ARM_SRQ"; - - /* QP/EE commands */ - case MLX4_CMD_RST2INIT_QP: return "RST2INIT_QP"; - case MLX4_CMD_INIT2RTR_QP: return "INIT2RTR_QP"; - case MLX4_CMD_RTR2RTS_QP: return "RTR2RTS_QP"; - case MLX4_CMD_RTS2RTS_QP: return "RTS2RTS_QP"; - case MLX4_CMD_SQERR2RTS_QP: return "SQERR2RTS_QP"; - case MLX4_CMD_2ERR_QP: return "2ERR_QP"; - case MLX4_CMD_RTS2SQD_QP: return "RTS2SQD_QP"; - case MLX4_CMD_SQD2SQD_QP: return "SQD2SQD_QP"; - case MLX4_CMD_SQD2RTS_QP: return "SQD2RTS_QP"; - case MLX4_CMD_2RST_QP: return "2RST_QP"; - case MLX4_CMD_QUERY_QP: return "QUERY_QP"; - case MLX4_CMD_INIT2INIT_QP: return "INIT2INIT_QP"; - case MLX4_CMD_SUSPEND_QP: return "SUSPEND_QP"; - case MLX4_CMD_UNSUSPEND_QP: return "UNSUSPEND_QP"; - /* special QP and management commands */ - case MLX4_CMD_CONF_SPECIAL_QP: return "CONF_SPECIAL_QP"; - case MLX4_CMD_MAD_IFC: return "MAD_IFC"; - - /* multicast commands */ - case MLX4_CMD_READ_MCG: return "READ_MCG"; - case MLX4_CMD_WRITE_MCG: return "WRITE_MCG"; - case MLX4_CMD_MGID_HASH: return "MGID_HASH"; - - /* miscellaneous commands */ - case MLX4_CMD_DIAG_RPRT: return "DIAG_RPRT"; - case MLX4_CMD_NOP: return "NOP"; - case MLX4_CMD_ACCESS_MEM: return "ACCESS_MEM"; - case MLX4_CMD_SET_VEP: return "SET_VEP"; - - /* Ethernet specific commands */ - case MLX4_CMD_SET_VLAN_FLTR: return "SET_VLAN_FLTR"; - case MLX4_CMD_SET_MCAST_FLTR: return "SET_MCAST_FLTR"; - case MLX4_CMD_DUMP_ETH_STATS: return "DUMP_ETH_STATS"; - - /* Communication channel commands */ - case MLX4_CMD_ARM_COMM_CHANNEL: return "ARM_COMM_CHANNEL"; - case MLX4_CMD_GEN_EQE: return "GEN_EQE"; - - /* virtual commands */ - case MLX4_CMD_ALLOC_RES: return "ALLOC_RES"; - case MLX4_CMD_FREE_RES: return "FREE_RES"; - case MLX4_CMD_MCAST_ATTACH: return "MCAST_ATTACH"; - case MLX4_CMD_UCAST_ATTACH: return "UCAST_ATTACH"; - case MLX4_CMD_PROMISC: return "PROMISC"; - case MLX4_CMD_QUERY_FUNC_CAP: return "QUERY_FUNC_CAP"; - case MLX4_CMD_QP_ATTACH: return "QP_ATTACH"; - - /* debug commands */ - case MLX4_CMD_QUERY_DEBUG_MSG: return "QUERY_DEBUG_MSG"; - case MLX4_CMD_SET_DEBUG_MSG: return "SET_DEBUG_MSG"; - - /* statistics commands */ - case MLX4_CMD_QUERY_IF_STAT: return "QUERY_IF_STAT"; - case MLX4_CMD_SET_IF_STAT: return "SET_IF_STAT"; - - /* register/delete flow steering network rules */ - case MLX4_QP_FLOW_STEERING_ATTACH: return "QP_FLOW_STEERING_ATTACH"; - case MLX4_QP_FLOW_STEERING_DETACH: return "QP_FLOW_STEERING_DETACH"; - case MLX4_FLOW_STEERING_IB_UC_QP_RANGE: return "FLOW_STEERING_IB_UC_QP_RANGE"; - default: return "OTHER"; - } -} - static u8 mlx4_errno_to_status(int errno) { switch (errno) { @@ -308,6 +185,72 @@ static u8 mlx4_errno_to_status(int errno) } } +static int mlx4_internal_err_ret_value(struct mlx4_dev *dev, u16 op, + u8 op_modifier) +{ + switch (op) { + case MLX4_CMD_UNMAP_ICM: + case MLX4_CMD_UNMAP_ICM_AUX: + case MLX4_CMD_UNMAP_FA: + case MLX4_CMD_2RST_QP: + case MLX4_CMD_HW2SW_EQ: + case MLX4_CMD_HW2SW_CQ: + case MLX4_CMD_HW2SW_SRQ: + case MLX4_CMD_HW2SW_MPT: + case MLX4_CMD_CLOSE_HCA: + case MLX4_QP_FLOW_STEERING_DETACH: + case MLX4_CMD_FREE_RES: + case MLX4_CMD_CLOSE_PORT: + return CMD_STAT_OK; + + case MLX4_CMD_QP_ATTACH: + /* On Detach case return success */ + if (op_modifier == 0) + return CMD_STAT_OK; + return mlx4_status_to_errno(CMD_STAT_INTERNAL_ERR); + + default: + return mlx4_status_to_errno(CMD_STAT_INTERNAL_ERR); + } +} + +static int mlx4_closing_cmd_fatal_error(u16 op, u8 fw_status) +{ + /* Any error during the closing commands below is considered fatal */ + if (op == MLX4_CMD_CLOSE_HCA || + op == MLX4_CMD_HW2SW_EQ || + op == MLX4_CMD_HW2SW_CQ || + op == MLX4_CMD_2RST_QP || + op == MLX4_CMD_HW2SW_SRQ || + op == MLX4_CMD_SYNC_TPT || + op == MLX4_CMD_UNMAP_ICM || + op == MLX4_CMD_UNMAP_ICM_AUX || + op == MLX4_CMD_UNMAP_FA) + return 1; + /* Error on MLX4_CMD_HW2SW_MPT is fatal except when fw status equals + * CMD_STAT_REG_BOUND. + * This status indicates that memory region has memory windows bound to it + * which may result from invalid user space usage and is not fatal. + */ + if (op == MLX4_CMD_HW2SW_MPT && fw_status != CMD_STAT_REG_BOUND) + return 1; + return 0; +} + +static int mlx4_cmd_reset_flow(struct mlx4_dev *dev, u16 op, u8 op_modifier, + int err) +{ + /* Only if reset flow is really active return code is based on + * command, otherwise current error code is returned. + */ + if (mlx4_internal_err_reset) { + mlx4_enter_error_state(dev->persist); + err = mlx4_internal_err_ret_value(dev, op, op_modifier); + } + + return err; +} + static int comm_pending(struct mlx4_dev *dev) { struct mlx4_priv *priv = mlx4_priv(dev); @@ -316,16 +259,30 @@ static int comm_pending(struct mlx4_dev *dev) return (swab32(status) >> 31) != priv->cmd.comm_toggle; } -static void mlx4_comm_cmd_post(struct mlx4_dev *dev, u8 cmd, u16 param) +static int mlx4_comm_cmd_post(struct mlx4_dev *dev, u8 cmd, u16 param) { struct mlx4_priv *priv = mlx4_priv(dev); u32 val; + /* To avoid writing to unknown addresses after the device state was + * changed to internal error and the function was rest, + * check the INTERNAL_ERROR flag which is updated under + * device_state_mutex lock. + */ + mutex_lock(&dev->persist->device_state_mutex); + + if (dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR) { + mutex_unlock(&dev->persist->device_state_mutex); + return -EIO; + } + priv->cmd.comm_toggle ^= 1; val = param | (cmd << 16) | (priv->cmd.comm_toggle << 31); __raw_writel((__force u32) cpu_to_be32(val), &priv->mfunc.comm->slave_write); mmiowb(); + mutex_unlock(&dev->persist->device_state_mutex); + return 0; } static int mlx4_comm_cmd_poll(struct mlx4_dev *dev, u8 cmd, u16 param, @@ -338,15 +295,20 @@ static int mlx4_comm_cmd_poll(struct mlx4_dev *dev, u8 cmd, u16 param, /* First, verify that the master reports correct status */ if (comm_pending(dev)) { - mlx4_warn(dev, "Communication channel is not idle." - "my toggle is %d (cmd:0x%x)\n", + mlx4_warn(dev, "Communication channel is not idle - my toggle is %d (cmd:0x%x)\n", priv->cmd.comm_toggle, cmd); return -EAGAIN; } /* Write command */ down(&priv->cmd.poll_sem); - mlx4_comm_cmd_post(dev, cmd, param); + if (mlx4_comm_cmd_post(dev, cmd, param)) { + /* Only in case the device state is INTERNAL_ERROR, + * mlx4_comm_cmd_post returns with an error + */ + err = mlx4_status_to_errno(CMD_STAT_INTERNAL_ERR); + goto out; + } end = msecs_to_jiffies(timeout) + jiffies; while (comm_pending(dev) && time_before(jiffies, end)) @@ -357,21 +319,24 @@ static int mlx4_comm_cmd_poll(struct mlx4_dev *dev, u8 cmd, u16 param, * FLR process. The only non-zero result in the RESET command * is MLX4_DELAY_RESET_SLAVE*/ if ((MLX4_COMM_CMD_RESET == cmd)) { - mlx4_warn(dev, "Got slave FLRed from Communication" - " channel (ret:0x%x)\n", ret_from_pending); err = MLX4_DELAY_RESET_SLAVE; + goto out; } else { - mlx4_warn(dev, "Communication channel timed out\n"); - err = -ETIMEDOUT; + mlx4_warn(dev, "Communication channel command 0x%x timed out\n", + cmd); + err = mlx4_status_to_errno(CMD_STAT_INTERNAL_ERR); } } + if (err) + mlx4_enter_error_state(dev->persist); +out: up(&priv->cmd.poll_sem); return err; } -static int mlx4_comm_cmd_wait(struct mlx4_dev *dev, u8 op, - u16 param, unsigned long timeout) +static int mlx4_comm_cmd_wait(struct mlx4_dev *dev, u8 vhcr_cmd, + u16 param, u16 op, unsigned long timeout) { struct mlx4_cmd *cmd = &mlx4_priv(dev)->cmd; struct mlx4_cmd_context *context; @@ -380,17 +345,6 @@ static int mlx4_comm_cmd_wait(struct mlx4_dev *dev, u8 op, down(&cmd->event_sem); - end = msecs_to_jiffies(timeout) + jiffies; - while (comm_pending(dev) && time_before(jiffies, end)) - cond_resched(); - if (comm_pending(dev)) { - mlx4_warn(dev, "mlx4_comm_cmd_wait: Comm channel " - "is not idle. My toggle is %d (op: 0x%x)\n", - mlx4_priv(dev)->cmd.comm_toggle, op); - up(&cmd->event_sem); - return -EAGAIN; - } - spin_lock(&cmd->context_lock); BUG_ON(cmd->free_head < 0); context = &cmd->context[cmd->free_head]; @@ -398,29 +352,49 @@ static int mlx4_comm_cmd_wait(struct mlx4_dev *dev, u8 op, cmd->free_head = context->next; spin_unlock(&cmd->context_lock); - init_completion(&context->done); + reinit_completion(&context->done); - mlx4_comm_cmd_post(dev, op, param); + if (mlx4_comm_cmd_post(dev, vhcr_cmd, param)) { + /* Only in case the device state is INTERNAL_ERROR, + * mlx4_comm_cmd_post returns with an error + */ + err = mlx4_status_to_errno(CMD_STAT_INTERNAL_ERR); + goto out; + } - /* In slave, wait unconditionally for completion */ - wait_for_completion(&context->done); + if (!wait_for_completion_timeout(&context->done, + msecs_to_jiffies(timeout))) { + mlx4_warn(dev, "communication channel command 0x%x (op=0x%x) timed out\n", + vhcr_cmd, op); + goto out_reset; + } err = context->result; if (err && context->fw_status != CMD_STAT_MULTI_FUNC_REQ) { mlx4_err(dev, "command 0x%x failed: fw status = 0x%x\n", - op, context->fw_status); - goto out; + vhcr_cmd, context->fw_status); + if (mlx4_closing_cmd_fatal_error(op, context->fw_status)) + goto out_reset; } -out: /* wait for comm channel ready * this is necessary for prevention the race * when switching between event to polling mode + * Skipping this section in case the device is in FATAL_ERROR state, + * In this state, no commands are sent via the comm channel until + * the device has returned from reset. */ - end = msecs_to_jiffies(timeout) + jiffies; - while (comm_pending(dev) && time_before(jiffies, end)) - cond_resched(); + if (!(dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR)) { + end = msecs_to_jiffies(timeout) + jiffies; + while (comm_pending(dev) && time_before(jiffies, end)) + cond_resched(); + } + goto out; +out_reset: + err = mlx4_status_to_errno(CMD_STAT_INTERNAL_ERR); + mlx4_enter_error_state(dev->persist); +out: spin_lock(&cmd->context_lock); context->next = cmd->free_head; cmd->free_head = context - cmd->context; @@ -431,10 +405,13 @@ static int mlx4_comm_cmd_wait(struct mlx4_dev *dev, u8 op, } int mlx4_comm_cmd(struct mlx4_dev *dev, u8 cmd, u16 param, - unsigned long timeout) + u16 op, unsigned long timeout) { + if (dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR) + return mlx4_status_to_errno(CMD_STAT_INTERNAL_ERR); + if (mlx4_priv(dev)->cmd.use_events) - return mlx4_comm_cmd_wait(dev, cmd, param, timeout); + return mlx4_comm_cmd_wait(dev, cmd, param, op, timeout); return mlx4_comm_cmd_poll(dev, cmd, param, timeout); } @@ -442,7 +419,7 @@ static int cmd_pending(struct mlx4_dev *dev) { u32 status; - if (pci_channel_offline(dev->pdev)) + if (pci_channel_offline(dev->persist->pdev)) return -EIO; status = readl(mlx4_priv(dev)->cmd.hcr + HCR_STATUS_OFFSET); @@ -452,38 +429,27 @@ static int cmd_pending(struct mlx4_dev *dev) !!(status & swab32(1 << HCR_T_BIT))); } -static int get_status(struct mlx4_dev *dev, u32 *status, int *go_bit, - int *t_bit) -{ - if (pci_channel_offline(dev->pdev)) - return -EIO; - - *status = readl(mlx4_priv(dev)->cmd.hcr + HCR_STATUS_OFFSET); - *t_bit = !!(*status & swab32(1 << HCR_T_BIT)); - *go_bit = !!(*status & swab32(1 << HCR_GO_BIT)); - - return 0; -} - -static int mlx4_cmd_post(struct mlx4_dev *dev, struct timespec *ts1, - u64 in_param, u64 out_param, u32 in_modifier, - u8 op_modifier, u16 op, u16 token, int event) +static int mlx4_cmd_post(struct mlx4_dev *dev, u64 in_param, u64 out_param, + u32 in_modifier, u8 op_modifier, u16 op, u16 token, + int event) { struct mlx4_cmd *cmd = &mlx4_priv(dev)->cmd; u32 __iomem *hcr = cmd->hcr; - int ret = -EAGAIN; + int ret = -EIO; unsigned long end; - int err, go_bit = 0, t_bit = 0; - u32 status = 0; - mutex_lock(&cmd->hcr_mutex); - - if (pci_channel_offline(dev->pdev)) { + mutex_lock(&dev->persist->device_state_mutex); + /* To avoid writing to unknown addresses after the device state was + * changed to internal error and the chip was reset, + * check the INTERNAL_ERROR flag which is updated under + * device_state_mutex lock. + */ + if (pci_channel_offline(dev->persist->pdev) || + (dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR)) { /* * Device is going through error recovery * and cannot accept commands. */ - ret = -EIO; goto out; } @@ -492,12 +458,11 @@ static int mlx4_cmd_post(struct mlx4_dev *dev, struct timespec *ts1, end += msecs_to_jiffies(GO_BIT_TIMEOUT_MSECS); while (cmd_pending(dev)) { - if (pci_channel_offline(dev->pdev)) { + if (pci_channel_offline(dev->persist->pdev)) { /* * Device is going through error recovery * and cannot accept commands. */ - ret = -EIO; goto out; } @@ -521,9 +486,6 @@ static int mlx4_cmd_post(struct mlx4_dev *dev, struct timespec *ts1, __raw_writel((__force u32) cpu_to_be32(out_param & 0xfffffffful), hcr + 4); __raw_writel((__force u32) cpu_to_be32(token << 16), hcr + 5); - if (ts1) - ktime_get_ts(ts1); - /* __raw_writel may not order writes. */ wmb(); @@ -544,16 +506,11 @@ static int mlx4_cmd_post(struct mlx4_dev *dev, struct timespec *ts1, ret = 0; out: - if (ret) { - err = get_status(dev, &status, &go_bit, &t_bit); - mlx4_warn(dev, "Could not post command %s (0x%x): ret=%d, " - "in_param=0x%llx, in_mod=0x%x, op_mod=0x%x, " - "get_status err=%d, status_reg=0x%x, go_bit=%d, " - "t_bit=%d, toggle=0x%x\n", cmd_to_str(op), op, ret, - (unsigned long long) in_param, in_modifier, op_modifier, err, status, - go_bit, t_bit, cmd->toggle); - } - mutex_unlock(&cmd->hcr_mutex); + if (ret) + mlx4_warn(dev, "Could not post command 0x%x: ret=%d, in_param=0x%llx, in_mod=0x%x, op_mod=0x%x\n", + op, ret, (long long)in_param, in_modifier, op_modifier); + mutex_unlock(&dev->persist->device_state_mutex); + return ret; } @@ -583,16 +540,18 @@ static int mlx4_slave_cmd(struct mlx4_dev *dev, u64 in_param, u64 *out_param, *out_param = be64_to_cpu(vhcr->out_param); else { - mlx4_err(dev, "response expected while" - "output mailbox is NULL for " - "command 0x%x\n", op); + mlx4_err(dev, "response expected while output mailbox is NULL for command 0x%x\n", + op); vhcr->status = CMD_STAT_BAD_PARAM; } } ret = mlx4_status_to_errno(vhcr->status); } + if (ret && + dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR) + ret = mlx4_internal_err_ret_value(dev, op, op_modifier); } else { - ret = mlx4_comm_cmd(dev, MLX4_COMM_CMD_VHCR_POST, 0, + ret = mlx4_comm_cmd(dev, MLX4_COMM_CMD_VHCR_POST, 0, op, MLX4_COMM_TIME + timeout); if (!ret) { if (out_is_imm) { @@ -600,16 +559,20 @@ static int mlx4_slave_cmd(struct mlx4_dev *dev, u64 in_param, u64 *out_param, *out_param = be64_to_cpu(vhcr->out_param); else { - mlx4_err(dev, "response expected while" - "output mailbox is NULL for " - "command 0x%x\n", op); + mlx4_err(dev, "response expected while output mailbox is NULL for command 0x%x\n", + op); vhcr->status = CMD_STAT_BAD_PARAM; } } ret = mlx4_status_to_errno(vhcr->status); - } else - mlx4_err(dev, "failed execution of VHCR_POST command" - "opcode %s (0x%x)\n", cmd_to_str(op), op); + } else { + if (dev->persist->state & + MLX4_DEVICE_STATE_INTERNAL_ERROR) + ret = mlx4_internal_err_ret_value(dev, op, + op_modifier); + else + mlx4_err(dev, "failed execution of VHCR_POST command opcode 0x%x\n", op); + } } mutex_unlock(&priv->cmd.slave_cmd_mutex); @@ -628,28 +591,40 @@ static int mlx4_cmd_poll(struct mlx4_dev *dev, u64 in_param, u64 *out_param, down(&priv->cmd.poll_sem); - if (pci_channel_offline(dev->pdev)) { + if (dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR) { /* * Device is going through error recovery * and cannot accept commands. */ - err = -EIO; + err = mlx4_internal_err_ret_value(dev, op, op_modifier); goto out; } - err = mlx4_cmd_post(dev, NULL, in_param, out_param ? *out_param : 0, + if (out_is_imm && !out_param) { + mlx4_err(dev, "response expected while output mailbox is NULL for command 0x%x\n", + op); + err = -EINVAL; + goto out; + } + + err = mlx4_cmd_post(dev, in_param, out_param ? *out_param : 0, in_modifier, op_modifier, op, CMD_POLL_TOKEN, 0); if (err) - goto out; + goto out_reset; end = msecs_to_jiffies(timeout) + jiffies; while (cmd_pending(dev) && time_before(jiffies, end)) { - if (pci_channel_offline(dev->pdev)) { + if (pci_channel_offline(dev->persist->pdev)) { /* * Device is going through error recovery * and cannot accept commands. */ err = -EIO; + goto out_reset; + } + + if (dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR) { + err = mlx4_internal_err_ret_value(dev, op, op_modifier); goto out; } @@ -657,10 +632,10 @@ static int mlx4_cmd_poll(struct mlx4_dev *dev, u64 in_param, u64 *out_param, } if (cmd_pending(dev)) { - mlx4_warn(dev, "command %s (0x%x) timed out (go bit not cleared)\n", - cmd_to_str(op), op); - err = -ETIMEDOUT; - goto out; + mlx4_warn(dev, "command 0x%x timed out (go bit not cleared)\n", + op); + err = -EIO; + goto out_reset; } if (out_is_imm) @@ -672,10 +647,17 @@ static int mlx4_cmd_poll(struct mlx4_dev *dev, u64 in_param, u64 *out_param, stat = be32_to_cpu((__force __be32) __raw_readl(hcr + HCR_STATUS_OFFSET)) >> 24; err = mlx4_status_to_errno(stat); - if (err) - mlx4_err(dev, "command %s (0x%x) failed: fw status = 0x%x\n", - cmd_to_str(op), op, stat); + if (err) { + mlx4_err(dev, "command 0x%x failed: fw status = 0x%x\n", + op, stat); + if (mlx4_closing_cmd_fatal_error(op, stat)) + goto out_reset; + goto out; + } +out_reset: + if (err) + err = mlx4_cmd_reset_flow(dev, op, op_modifier, err); out: up(&priv->cmd.poll_sem); return err; @@ -704,15 +686,8 @@ static int mlx4_cmd_wait(struct mlx4_dev *dev, u64 in_param, u64 *out_param, { struct mlx4_cmd *cmd = &mlx4_priv(dev)->cmd; struct mlx4_cmd_context *context; + long ret_wait; int err = 0; - int go_bit = 0, t_bit = 0, stat_err; - u32 status = 0; - struct timespec ts1, ts2; - ktime_t t1, t2, delta; - s64 ds; - - if (out_is_imm && !out_param) - return -EINVAL; down(&cmd->event_sem); @@ -723,59 +698,75 @@ static int mlx4_cmd_wait(struct mlx4_dev *dev, u64 in_param, u64 *out_param, cmd->free_head = context->next; spin_unlock(&cmd->context_lock); - init_completion(&context->done); - - err = mlx4_cmd_post(dev, &ts1, in_param, out_param ? *out_param : 0, - in_modifier, op_modifier, op, context->token, 1); - if (err) - goto out; - - if (!wait_for_completion_timeout(&context->done, - msecs_to_jiffies(timeout))) { - stat_err = get_status(dev, &status, &go_bit, &t_bit); - mlx4_warn(dev, "command %s (0x%x) timed out: in_param=0x%llx, " - "in_mod=0x%x, op_mod=0x%x, get_status err=%d, " - "status_reg=0x%x, go_bit=%d, t_bit=%d, toggle=0x%x\n" - , cmd_to_str(op), op, (unsigned long long) in_param, in_modifier, - op_modifier, stat_err, status, go_bit, t_bit, - mlx4_priv(dev)->cmd.toggle); - err = -EBUSY; + if (out_is_imm && !out_param) { + mlx4_err(dev, "response expected while output mailbox is NULL for command 0x%x\n", + op); + err = -EINVAL; goto out; } - if (mlx4_debug_level & MLX4_DEBUG_MASK_CMD_TIME) { - ktime_get_ts(&ts2); - t1 = timespec_to_ktime(ts1); - t2 = timespec_to_ktime(ts2); - delta = ktime_sub(t2, t1); - ds = ktime_to_ns(delta); - pr_info("mlx4: fw exec time for %s is %lld nsec\n", cmd_to_str(op), (long long) ds); + + reinit_completion(&context->done); + + err = mlx4_cmd_post(dev, in_param, out_param ? *out_param : 0, + in_modifier, op_modifier, op, context->token, 1); + if (err) + goto out_reset; + + if (op == MLX4_CMD_SENSE_PORT) { + ret_wait = + wait_for_completion_interruptible_timeout(&context->done, + msecs_to_jiffies(timeout)); + if (ret_wait < 0) { + context->fw_status = 0; + context->out_param = 0; + context->result = 0; + } + } else { + ret_wait = (long)wait_for_completion_timeout(&context->done, + msecs_to_jiffies(timeout)); + } + if (!ret_wait) { + mlx4_warn(dev, "command 0x%x timed out (go bit not cleared)\n", + op); + if (op == MLX4_CMD_NOP) { + err = -EBUSY; + goto out; + } else { + err = -EIO; + goto out_reset; + } } err = context->result; if (err) { - mlx4_err(dev, "command %s (0x%x) failed: in_param=0x%llx, " - "in_mod=0x%x, op_mod=0x%x, fw status = 0x%x\n", - cmd_to_str(op), op, (unsigned long long) in_param, in_modifier, - op_modifier, context->fw_status); + /* Since we do not want to have this error message always + * displayed at driver start when there are ConnectX2 HCAs + * on the host, we deprecate the error message for this + * specific command/input_mod/opcode_mod/fw-status to be debug. + */ + if (op == MLX4_CMD_SET_PORT && + (in_modifier == 1 || in_modifier == 2) && + op_modifier == MLX4_SET_PORT_IB_OPCODE && + context->fw_status == CMD_STAT_BAD_SIZE) + mlx4_dbg(dev, "command 0x%x failed: fw status = 0x%x\n", + op, context->fw_status); + else + mlx4_err(dev, "command 0x%x failed: fw status = 0x%x\n", + op, context->fw_status); + if (dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR) + err = mlx4_internal_err_ret_value(dev, op, op_modifier); + else if (mlx4_closing_cmd_fatal_error(op, context->fw_status)) + goto out_reset; - switch(context->fw_status) { - case CMD_STAT_BAD_PARAM: - mlx4_err(dev, "Parameter is not supported, " - "parameter is out of range\n"); - break; - case CMD_STAT_EXCEED_LIM: - mlx4_err(dev, "Required capability exceeded " - "device limits\n"); - break; - default: - break; - } goto out; } if (out_is_imm) *out_param = context->out_param; +out_reset: + if (err) + err = mlx4_cmd_reset_flow(dev, op, op_modifier, err); out: spin_lock(&cmd->context_lock); context->next = cmd->free_head; @@ -790,18 +781,27 @@ int __mlx4_cmd(struct mlx4_dev *dev, u64 in_param, u64 *out_param, int out_is_imm, u32 in_modifier, u8 op_modifier, u16 op, unsigned long timeout, int native) { - if (pci_channel_offline(dev->pdev)) - return -EIO; + if (pci_channel_offline(dev->persist->pdev)) + return mlx4_cmd_reset_flow(dev, op, op_modifier, -EIO); if (!mlx4_is_mfunc(dev) || (native && mlx4_is_master(dev))) { + int ret; + + if (dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR) + return mlx4_internal_err_ret_value(dev, op, + op_modifier); + down_read(&mlx4_priv(dev)->cmd.switch_sem); if (mlx4_priv(dev)->cmd.use_events) - return mlx4_cmd_wait(dev, in_param, out_param, - out_is_imm, in_modifier, - op_modifier, op, timeout); + ret = mlx4_cmd_wait(dev, in_param, out_param, + out_is_imm, in_modifier, + op_modifier, op, timeout); else - return mlx4_cmd_poll(dev, in_param, out_param, - out_is_imm, in_modifier, - op_modifier, op, timeout); + ret = mlx4_cmd_poll(dev, in_param, out_param, + out_is_imm, in_modifier, + op_modifier, op, timeout); + + up_read(&mlx4_priv(dev)->cmd.switch_sem); + return ret; } return mlx4_slave_cmd(dev, in_param, out_param, out_is_imm, in_modifier, op_modifier, op, timeout); @@ -809,7 +809,7 @@ int __mlx4_cmd(struct mlx4_dev *dev, u64 in_param, u64 *out_param, EXPORT_SYMBOL_GPL(__mlx4_cmd); -static int mlx4_ARM_COMM_CHANNEL(struct mlx4_dev *dev) +int mlx4_ARM_COMM_CHANNEL(struct mlx4_dev *dev) { return mlx4_cmd(dev, 0, 0, 0, MLX4_CMD_ARM_COMM_CHANNEL, MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); @@ -826,7 +826,8 @@ static int mlx4_ACCESS_MEM(struct mlx4_dev *dev, u64 master_addr, (slave & ~0x7f) | (size & 0xff)) { mlx4_err(dev, "Bad access mem params - slave_addr:0x%llx " "master_addr:0x%llx slave_id:%d size:%d\n", - (unsigned long long) slave_addr, (unsigned long long) master_addr, slave, size); + (unsigned long long)slave_addr, + (unsigned long long)master_addr, slave, size); return -EINVAL; } @@ -903,26 +904,37 @@ static int mlx4_MAD_IFC_wrapper(struct mlx4_dev *dev, int slave, { struct ib_smp *smp = inbox->buf; u32 index; - u8 port; + u8 port, slave_port; + u8 opcode_modifier; u16 *table; int err; int vidx, pidx; + int network_view; struct mlx4_priv *priv = mlx4_priv(dev); struct ib_smp *outsmp = outbox->buf; __be16 *outtab = (__be16 *)(outsmp->data); __be32 slave_cap_mask; __be64 slave_node_guid; - port = vhcr->in_modifier; + + slave_port = vhcr->in_modifier; + port = mlx4_slave_convert_port(dev, slave, slave_port); + + /* network-view bit is for driver use only, and should not be passed to FW */ + opcode_modifier = vhcr->op_modifier & ~0x8; /* clear netw view bit */ + network_view = !!(vhcr->op_modifier & 0x8); if (smp->base_version == 1 && smp->mgmt_class == IB_MGMT_CLASS_SUBN_LID_ROUTED && smp->class_version == 1) { - if (smp->method == IB_MGMT_METHOD_GET) { + /* host view is paravirtualized */ + if (!network_view && smp->method == IB_MGMT_METHOD_GET) { if (smp->attr_id == IB_SMP_ATTR_PKEY_TABLE) { index = be32_to_cpu(smp->attr_mod); if (port < 1 || port > dev->caps.num_ports) return -EINVAL; - table = kcalloc(dev->caps.pkey_table_len[port], sizeof *table, GFP_KERNEL); + table = kcalloc((dev->caps.pkey_table_len[port] / 32) + 1, + sizeof(*table) * 32, GFP_KERNEL); + if (!table) return -ENOMEM; /* need to get the full pkey table because the paravirtualized @@ -941,8 +953,9 @@ static int mlx4_MAD_IFC_wrapper(struct mlx4_dev *dev, int slave, if (smp->attr_id == IB_SMP_ATTR_PORT_INFO) { /*get the slave specific caps:*/ /*do the command */ + smp->attr_mod = cpu_to_be32(port); err = mlx4_cmd_box(dev, inbox->dma, outbox->dma, - vhcr->in_modifier, vhcr->op_modifier, + port, opcode_modifier, vhcr->op, MLX4_CMD_TIME_CLASS_C, MLX4_CMD_NATIVE); /* modify the response for slaves */ if (!err && slave != mlx4_master_func_num(dev)) { @@ -955,25 +968,38 @@ static int mlx4_MAD_IFC_wrapper(struct mlx4_dev *dev, int slave, return err; } if (smp->attr_id == IB_SMP_ATTR_GUID_INFO) { - /* compute slave's gid block */ - smp->attr_mod = cpu_to_be32(slave / 8); - /* execute cmd */ - err = mlx4_cmd_box(dev, inbox->dma, outbox->dma, - vhcr->in_modifier, vhcr->op_modifier, - vhcr->op, MLX4_CMD_TIME_CLASS_C, MLX4_CMD_NATIVE); - if (!err) { - /* if needed, move slave gid to index 0 */ - if (slave % 8) - memcpy(outsmp->data, - outsmp->data + (slave % 8) * 8, 8); - /* delete all other gids */ - memset(outsmp->data + 8, 0, 56); + __be64 guid = mlx4_get_admin_guid(dev, slave, + port); + + /* set the PF admin guid to the FW/HW burned + * GUID, if it wasn't yet set + */ + if (slave == 0 && guid == 0) { + smp->attr_mod = 0; + err = mlx4_cmd_box(dev, + inbox->dma, + outbox->dma, + vhcr->in_modifier, + opcode_modifier, + vhcr->op, + MLX4_CMD_TIME_CLASS_C, + MLX4_CMD_NATIVE); + if (err) + return err; + mlx4_set_admin_guid(dev, + *(__be64 *)outsmp-> + data, slave, port); + } else { + memcpy(outsmp->data, &guid, 8); } - return err; + + /* clean all other gids */ + memset(outsmp->data + 8, 0, 56); + return 0; } if (smp->attr_id == IB_SMP_ATTR_NODE_INFO) { err = mlx4_cmd_box(dev, inbox->dma, outbox->dma, - vhcr->in_modifier, vhcr->op_modifier, + port, opcode_modifier, vhcr->op, MLX4_CMD_TIME_CLASS_C, MLX4_CMD_NATIVE); if (!err) { slave_node_guid = mlx4_get_slave_node_guid(dev, slave); @@ -983,32 +1009,28 @@ static int mlx4_MAD_IFC_wrapper(struct mlx4_dev *dev, int slave, } } } + + /* Non-privileged VFs are only allowed "host" view LID-routed 'Get' MADs. + * These are the MADs used by ib verbs (such as ib_query_gids). + */ if (slave != mlx4_master_func_num(dev) && - ((smp->mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) || - (smp->mgmt_class == IB_MGMT_CLASS_SUBN_LID_ROUTED && - smp->method == IB_MGMT_METHOD_SET))) { - mlx4_err(dev, "slave %d is trying to execute a Subnet MGMT MAD, " - "class 0x%x, method 0x%x for attr 0x%x. Rejecting\n", - slave, smp->method, smp->mgmt_class, - be16_to_cpu(smp->attr_id)); - return -EPERM; + !mlx4_vf_smi_enabled(dev, slave, port)) { + if (!(smp->mgmt_class == IB_MGMT_CLASS_SUBN_LID_ROUTED && + smp->method == IB_MGMT_METHOD_GET) || network_view) { + mlx4_err(dev, "Unprivileged slave %d is trying to execute a Subnet MGMT MAD, class 0x%x, method 0x%x, view=%s for attr 0x%x. Rejecting\n", + slave, smp->mgmt_class, smp->method, + network_view ? "Network" : "Host", + be16_to_cpu(smp->attr_id)); + return -EPERM; + } } - /*default:*/ + return mlx4_cmd_box(dev, inbox->dma, outbox->dma, - vhcr->in_modifier, vhcr->op_modifier, + vhcr->in_modifier, opcode_modifier, vhcr->op, MLX4_CMD_TIME_CLASS_C, MLX4_CMD_NATIVE); } -static int MLX4_CMD_DIAG_RPRT_wrapper(struct mlx4_dev *dev, int slave, - struct mlx4_vhcr *vhcr, - struct mlx4_cmd_mailbox *inbox, - struct mlx4_cmd_mailbox *outbox, - struct mlx4_cmd_info *cmd) -{ - return -EPERM; -} - -static int MLX4_CMD_UPDATE_QP_wrapper(struct mlx4_dev *dev, int slave, +static int mlx4_CMD_EPERM_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_vhcr *vhcr, struct mlx4_cmd_mailbox *inbox, struct mlx4_cmd_mailbox *outbox, @@ -1153,16 +1175,6 @@ static struct mlx4_cmd_info cmd_info[] = { .verify = NULL, .wrapper = NULL }, - { - .opcode = MLX4_CMD_DIAG_RPRT, - .has_inbox = false, - .has_outbox = false, - .out_is_imm = false, - .encode_slave_id = false, - .skip_err_print = true, - .verify = NULL, - .wrapper = MLX4_CMD_DIAG_RPRT_wrapper - }, { .opcode = MLX4_CMD_NOP, .has_inbox = false, @@ -1172,6 +1184,15 @@ static struct mlx4_cmd_info cmd_info[] = { .verify = NULL, .wrapper = NULL }, + { + .opcode = MLX4_CMD_CONFIG_DEV, + .has_inbox = false, + .has_outbox = true, + .out_is_imm = false, + .encode_slave_id = false, + .verify = NULL, + .wrapper = mlx4_CONFIG_DEV_wrapper + }, { .opcode = MLX4_CMD_ALLOC_RES, .has_inbox = false, @@ -1247,7 +1268,7 @@ static struct mlx4_cmd_info cmd_info[] = { { .opcode = MLX4_CMD_HW2SW_EQ, .has_inbox = false, - .has_outbox = true, + .has_outbox = false, .out_is_imm = false, .encode_slave_id = true, .verify = NULL, @@ -1462,13 +1483,39 @@ static struct mlx4_cmd_info cmd_info[] = { }, { .opcode = MLX4_CMD_UPDATE_QP, + .has_inbox = true, + .has_outbox = false, + .out_is_imm = false, + .encode_slave_id = false, + .verify = NULL, + .wrapper = mlx4_UPDATE_QP_wrapper + }, + { + .opcode = MLX4_CMD_GET_OP_REQ, .has_inbox = false, .has_outbox = false, .out_is_imm = false, .encode_slave_id = false, - .skip_err_print = true, .verify = NULL, - .wrapper = MLX4_CMD_UPDATE_QP_wrapper + .wrapper = mlx4_CMD_EPERM_wrapper, + }, + { + .opcode = MLX4_CMD_ALLOCATE_VPP, + .has_inbox = false, + .has_outbox = true, + .out_is_imm = false, + .encode_slave_id = false, + .verify = NULL, + .wrapper = mlx4_CMD_EPERM_wrapper, + }, + { + .opcode = MLX4_CMD_SET_VPORT_QOS, + .has_inbox = false, + .has_outbox = true, + .out_is_imm = false, + .encode_slave_id = false, + .verify = NULL, + .wrapper = mlx4_CMD_EPERM_wrapper, }, { .opcode = MLX4_CMD_CONF_SPECIAL_QP, @@ -1488,6 +1535,15 @@ static struct mlx4_cmd_info cmd_info[] = { .verify = NULL, .wrapper = mlx4_MAD_IFC_wrapper }, + { + .opcode = MLX4_CMD_MAD_DEMUX, + .has_inbox = false, + .has_outbox = false, + .out_is_imm = false, + .encode_slave_id = false, + .verify = NULL, + .wrapper = mlx4_CMD_EPERM_wrapper + }, { .opcode = MLX4_CMD_QUERY_IF_STAT, .has_inbox = false, @@ -1497,6 +1553,24 @@ static struct mlx4_cmd_info cmd_info[] = { .verify = NULL, .wrapper = mlx4_QUERY_IF_STAT_wrapper }, + { + .opcode = MLX4_CMD_ACCESS_REG, + .has_inbox = true, + .has_outbox = true, + .out_is_imm = false, + .encode_slave_id = false, + .verify = NULL, + .wrapper = mlx4_ACCESS_REG_wrapper, + }, + { + .opcode = MLX4_CMD_CONGESTION_CTRL_OPCODE, + .has_inbox = false, + .has_outbox = false, + .out_is_imm = false, + .encode_slave_id = false, + .verify = NULL, + .wrapper = mlx4_CMD_EPERM_wrapper, + }, /* Native multicast commands are not available for guests */ { .opcode = MLX4_CMD_QP_ATTACH, @@ -1572,16 +1646,23 @@ static struct mlx4_cmd_info cmd_info[] = { .verify = NULL, .wrapper = mlx4_QP_FLOW_STEERING_DETACH_wrapper }, - /* wol commands */ { - .opcode = MLX4_CMD_MOD_STAT_CFG, + .opcode = MLX4_FLOW_STEERING_IB_UC_QP_RANGE, .has_inbox = false, .has_outbox = false, .out_is_imm = false, .encode_slave_id = false, - .skip_err_print = true, .verify = NULL, - .wrapper = mlx4_MOD_STAT_CFG_wrapper + .wrapper = mlx4_CMD_EPERM_wrapper + }, + { + .opcode = MLX4_CMD_VIRT_PORT_MAP, + .has_inbox = false, + .has_outbox = false, + .out_is_imm = false, + .encode_slave_id = false, + .verify = NULL, + .wrapper = mlx4_CMD_EPERM_wrapper }, }; @@ -1612,8 +1693,10 @@ static int mlx4_master_process_vhcr(struct mlx4_dev *dev, int slave, ALIGN(sizeof(struct mlx4_vhcr_cmd), MLX4_ACCESS_MEM_ALIGN), 1); if (ret) { - mlx4_err(dev, "%s:Failed reading vhcr" - "ret: 0x%x\n", __func__, ret); + if (!(dev->persist->state & + MLX4_DEVICE_STATE_INTERNAL_ERROR)) + mlx4_err(dev, "%s: Failed reading vhcr ret: 0x%x\n", + __func__, ret); kfree(vhcr); return ret; } @@ -1636,8 +1719,8 @@ static int mlx4_master_process_vhcr(struct mlx4_dev *dev, int slave, } } if (!cmd) { - mlx4_err(dev, "unparavirt command: %s (0x%x) accepted from slave:%d\n", - cmd_to_str(vhcr->op), vhcr->op, slave); + mlx4_err(dev, "Unknown command:0x%x accepted from slave:%d\n", + vhcr->op, slave); vhcr_cmd->status = CMD_STAT_BAD_PARAM; goto out_status; } @@ -1652,11 +1735,14 @@ static int mlx4_master_process_vhcr(struct mlx4_dev *dev, int slave, goto out_status; } - if (mlx4_ACCESS_MEM(dev, inbox->dma, slave, - vhcr->in_param, - MLX4_MAILBOX_SIZE, 1)) { - mlx4_err(dev, "%s: Failed reading inbox for cmd %s (0x%x)\n", - __func__, cmd_to_str(cmd->opcode), cmd->opcode); + ret = mlx4_ACCESS_MEM(dev, inbox->dma, slave, + vhcr->in_param, + MLX4_MAILBOX_SIZE, 1); + if (ret) { + if (!(dev->persist->state & + MLX4_DEVICE_STATE_INTERNAL_ERROR)) + mlx4_err(dev, "%s: Failed reading inbox (cmd:0x%x)\n", + __func__, cmd->opcode); vhcr_cmd->status = CMD_STAT_INTERNAL_ERR; goto out_status; } @@ -1664,8 +1750,7 @@ static int mlx4_master_process_vhcr(struct mlx4_dev *dev, int slave, /* Apply permission and bound checks if applicable */ if (cmd->verify && cmd->verify(dev, slave, vhcr, inbox)) { - mlx4_warn(dev, "Command %s (0x%x) from slave: %d failed protection " - "checks for resource_id: %d\n", cmd_to_str(vhcr->op), + mlx4_warn(dev, "Command:0x%x from slave: %d failed protection checks for resource_id:%d\n", vhcr->op, slave, vhcr->in_modifier); vhcr_cmd->status = CMD_STAT_BAD_OP; goto out_status; @@ -1705,13 +1790,9 @@ static int mlx4_master_process_vhcr(struct mlx4_dev *dev, int slave, } if (err) { - if (!cmd->skip_err_print) - mlx4_warn(dev, "vhcr command %s (0x%x) slave:%d " - "in_param 0x%llx in_mod=0x%x, op_mod=0x%x " - "failed with error:%d, status %d\n", - cmd_to_str(vhcr->op), vhcr->op, slave, - (unsigned long long) vhcr->in_param, vhcr->in_modifier, - vhcr->op_modifier, vhcr->errno, err); + if (!(dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR)) + mlx4_warn(dev, "vhcr command:0x%x slave:%d failed with error:%d, status %d\n", + vhcr->op, slave, vhcr->errno, err); vhcr_cmd->status = mlx4_errno_to_status(err); goto out_status; } @@ -1726,7 +1807,9 @@ static int mlx4_master_process_vhcr(struct mlx4_dev *dev, int slave, /* If we failed to write back the outbox after the *command was successfully executed, we must fail this * slave, as it is now in undefined state */ - mlx4_err(dev, "%s: Failed writing outbox\n", __func__); + if (!(dev->persist->state & + MLX4_DEVICE_STATE_INTERNAL_ERROR)) + mlx4_err(dev, "%s:Failed writing outbox\n", __func__); goto out; } } @@ -1744,8 +1827,8 @@ static int mlx4_master_process_vhcr(struct mlx4_dev *dev, int slave, __func__); else if (vhcr->e_bit && mlx4_GEN_EQE(dev, slave, &priv->mfunc.master.cmd_eqe)) - mlx4_warn(dev, "Failed to generate command completion " - "eqe for slave %d\n", slave); + mlx4_warn(dev, "Failed to generate command completion eqe for slave %d\n", + slave); } out: @@ -1761,6 +1844,7 @@ static int mlx4_master_immediate_activate_vlan_qos(struct mlx4_priv *priv, struct mlx4_vport_oper_state *vp_oper; struct mlx4_vport_state *vp_admin; struct mlx4_vf_immed_vlan_work *work; + struct mlx4_dev *dev = &priv->dev; int err; int admin_vlan_ix = NO_INDX; @@ -1768,9 +1852,24 @@ static int mlx4_master_immediate_activate_vlan_qos(struct mlx4_priv *priv, vp_admin = &priv->mfunc.master.vf_admin[slave].vport[port]; if (vp_oper->state.default_vlan == vp_admin->default_vlan && - vp_oper->state.default_qos == vp_admin->default_qos) + vp_oper->state.default_qos == vp_admin->default_qos && + vp_oper->state.vlan_proto == vp_admin->vlan_proto && + vp_oper->state.qos_vport == vp_admin->qos_vport) return 0; + if (!(priv->mfunc.master.slave_state[slave].active && + dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_UPDATE_QP)) { + /* even if the UPDATE_QP command isn't supported, we still want + * to set this VF link according to the admin directive + */ + return -1; + } + + mlx4_dbg(dev, "updating immediately admin params slave %d port %d\n", + slave, port); + mlx4_dbg(dev, "vlan %d QoS %d link down\n", + vp_admin->default_vlan, vp_admin->default_qos); + work = kzalloc(sizeof(*work), GFP_KERNEL); if (!work) return -ENOMEM; @@ -1781,17 +1880,17 @@ static int mlx4_master_immediate_activate_vlan_qos(struct mlx4_priv *priv, vp_admin->default_vlan, &admin_vlan_ix); if (err) { - mlx4_warn((&priv->dev), + kfree(work); + mlx4_warn(&priv->dev, "No vlan resources slave %d, port %d\n", slave, port); - kfree(work); return err; } } else { admin_vlan_ix = NO_INDX; } work->flags |= MLX4_VF_IMMED_VLAN_FLAG_VLAN; - mlx4_dbg((&(priv->dev)), + mlx4_dbg(&priv->dev, "alloc vlan %d idx %d slave %d port %d\n", (int)(vp_admin->default_vlan), admin_vlan_ix, slave, port); @@ -1810,13 +1909,20 @@ static int mlx4_master_immediate_activate_vlan_qos(struct mlx4_priv *priv, vp_oper->state.default_vlan = vp_admin->default_vlan; vp_oper->state.default_qos = vp_admin->default_qos; + vp_oper->state.vlan_proto = vp_admin->vlan_proto; + vp_oper->state.qos_vport = vp_admin->qos_vport; + + if (1 /* vp_admin->link_state == IFLA_VF_LINK_STATE_DISABLE */) + work->flags |= MLX4_VF_IMMED_VLAN_FLAG_LINK_DISABLE; /* iterate over QPs owned by this slave, using UPDATE_QP */ work->port = port; work->slave = slave; work->qos = vp_oper->state.default_qos; + work->qos_vport = vp_oper->state.qos_vport; work->vlan_id = vp_oper->state.default_vlan; work->vlan_ix = vp_oper->vlan_idx; + work->vlan_proto = vp_oper->state.vlan_proto; work->priv = priv; INIT_WORK(&work->work, mlx4_vf_immed_vlan_work_handler); queue_work(priv->mfunc.master.comm_wq, &work->work); @@ -1824,28 +1930,110 @@ static int mlx4_master_immediate_activate_vlan_qos(struct mlx4_priv *priv, return 0; } +static void mlx4_set_default_port_qos(struct mlx4_dev *dev, int port) +{ + struct mlx4_qos_manager *port_qos_ctl; + struct mlx4_priv *priv = mlx4_priv(dev); + + port_qos_ctl = &priv->mfunc.master.qos_ctl[port]; + bitmap_zero(port_qos_ctl->priority_bm, MLX4_NUM_UP); + + /* Enable only default prio at PF init routine */ + set_bit(MLX4_DEFAULT_QOS_PRIO, port_qos_ctl->priority_bm); +} + +static void mlx4_allocate_port_vpps(struct mlx4_dev *dev, int port) +{ + int i; + int err; + int num_vfs; + u16 availible_vpp; + u8 vpp_param[MLX4_NUM_UP]; + struct mlx4_qos_manager *port_qos; + struct mlx4_priv *priv = mlx4_priv(dev); + + err = mlx4_ALLOCATE_VPP_get(dev, port, &availible_vpp, vpp_param); + if (err) { + mlx4_info(dev, "Failed query availible VPPs\n"); + return; + } + + port_qos = &priv->mfunc.master.qos_ctl[port]; + num_vfs = (availible_vpp / + bitmap_weight(port_qos->priority_bm, MLX4_NUM_UP)); + + for (i = 0; i < MLX4_NUM_UP; i++) { + if (test_bit(i, port_qos->priority_bm)) + vpp_param[i] = num_vfs; + } + + err = mlx4_ALLOCATE_VPP_set(dev, port, vpp_param); + if (err) { + mlx4_info(dev, "Failed allocating VPPs\n"); + return; + } + + /* Query actual allocated VPP, just to make sure */ + err = mlx4_ALLOCATE_VPP_get(dev, port, &availible_vpp, vpp_param); + if (err) { + mlx4_info(dev, "Failed query availible VPPs\n"); + return; + } + + port_qos->num_of_qos_vfs = num_vfs; + mlx4_dbg(dev, "Port %d Availible VPPs %d\n", port, availible_vpp); + + for (i = 0; i < MLX4_NUM_UP; i++) + mlx4_dbg(dev, "Port %d UP %d Allocated %d VPPs\n", port, i, + vpp_param[i]); +} static int mlx4_master_activate_admin_state(struct mlx4_priv *priv, int slave) { int port, err; struct mlx4_vport_state *vp_admin; struct mlx4_vport_oper_state *vp_oper; + struct mlx4_slave_state *slave_state = + &priv->mfunc.master.slave_state[slave]; + struct mlx4_active_ports actv_ports = mlx4_get_active_ports( + &priv->dev, slave); + int min_port = find_first_bit(actv_ports.ports, + priv->dev.caps.num_ports) + 1; + int max_port = min_port - 1 + + bitmap_weight(actv_ports.ports, priv->dev.caps.num_ports); - for (port = 1; port <= MLX4_MAX_PORTS; port++) { + for (port = min_port; port <= max_port; port++) { + if (!test_bit(port - 1, actv_ports.ports)) + continue; + priv->mfunc.master.vf_oper[slave].smi_enabled[port] = + priv->mfunc.master.vf_admin[slave].enable_smi[port]; vp_oper = &priv->mfunc.master.vf_oper[slave].vport[port]; vp_admin = &priv->mfunc.master.vf_admin[slave].vport[port]; - vp_oper->state = *vp_admin; + if (vp_admin->vlan_proto != htons(ETH_P_8021AD) || + slave_state->vst_qinq_supported) { + vp_oper->state.vlan_proto = vp_admin->vlan_proto; + vp_oper->state.default_vlan = vp_admin->default_vlan; + vp_oper->state.default_qos = vp_admin->default_qos; + } + vp_oper->state.mac = vp_admin->mac; + vp_oper->state.spoofchk = vp_admin->spoofchk; + vp_oper->state.tx_rate = vp_admin->tx_rate; + vp_oper->state.qos_vport = vp_admin->qos_vport; + vp_oper->state.guid = vp_admin->guid; + if (MLX4_VGT != vp_admin->default_vlan) { err = __mlx4_register_vlan(&priv->dev, port, - vp_admin->default_vlan, &(vp_oper->vlan_idx)); + vp_admin->default_vlan, &(vp_oper->vlan_idx)); if (err) { vp_oper->vlan_idx = NO_INDX; - mlx4_warn((&priv->dev), - "No vlan resorces slave %d, port %d\n", + vp_oper->state.default_vlan = MLX4_VGT; + vp_oper->state.vlan_proto = htons(ETH_P_8021Q); + mlx4_warn(&priv->dev, + "No vlan resources slave %d, port %d\n", slave, port); return err; } - mlx4_dbg((&(priv->dev)), "alloc vlan %d idx %d slave %d port %d\n", + mlx4_dbg(&priv->dev, "alloc vlan %d idx %d slave %d port %d\n", (int)(vp_oper->state.default_vlan), vp_oper->vlan_idx, slave, port); } @@ -1856,12 +2044,12 @@ static int mlx4_master_activate_admin_state(struct mlx4_priv *priv, int slave) if (0 > vp_oper->mac_idx) { err = vp_oper->mac_idx; vp_oper->mac_idx = NO_INDX; - mlx4_warn((&priv->dev), + mlx4_warn(&priv->dev, "No mac resources slave %d, port %d\n", slave, port); return err; } - mlx4_dbg((&(priv->dev)), "alloc mac %llx idx %d slave %d port %d\n", + mlx4_dbg(&priv->dev, "alloc mac %llx idx %d slave %d port %d\n", (unsigned long long) vp_oper->state.mac, vp_oper->mac_idx, slave, port); } } @@ -1872,8 +2060,19 @@ static void mlx4_master_deactivate_admin_state(struct mlx4_priv *priv, int slave { int port; struct mlx4_vport_oper_state *vp_oper; + struct mlx4_active_ports actv_ports = mlx4_get_active_ports( + &priv->dev, slave); + int min_port = find_first_bit(actv_ports.ports, + priv->dev.caps.num_ports) + 1; + int max_port = min_port - 1 + + bitmap_weight(actv_ports.ports, priv->dev.caps.num_ports); - for (port = 1; port <= MLX4_MAX_PORTS; port++) { + + for (port = min_port; port <= max_port; port++) { + if (!test_bit(port - 1, actv_ports.ports)) + continue; + priv->mfunc.master.vf_oper[slave].smi_enabled[port] = + MLX4_VF_SMI_DISABLED; vp_oper = &priv->mfunc.master.vf_oper[slave].vport[port]; if (NO_INDX != vp_oper->vlan_idx) { __mlx4_unregister_vlan(&priv->dev, @@ -1901,14 +2100,15 @@ static void mlx4_master_do_cmd(struct mlx4_dev *dev, int slave, u8 cmd, slave_state[slave].comm_toggle ^= 1; reply = (u32) slave_state[slave].comm_toggle << 31; if (toggle != slave_state[slave].comm_toggle) { - mlx4_warn(dev, "Incorrect toggle %d from slave %d. *** MASTER" - "STATE COMPROMISIED ***\n", toggle, slave); + mlx4_warn(dev, "Incorrect toggle %d from slave %d. *** MASTER STATE COMPROMISED ***\n", + toggle, slave); goto reset_slave; } if (cmd == MLX4_COMM_CMD_RESET) { mlx4_warn(dev, "Received reset from slave:%d\n", slave); slave_state[slave].active = false; slave_state[slave].old_vlan_api = false; + slave_state[slave].vst_qinq_supported = false; mlx4_master_deactivate_admin_state(priv, slave); for (i = 0; i < MLX4_EVENT_TYPES_NUM; ++i) { slave_state[slave].event_eq[i].eqn = -1; @@ -1929,8 +2129,8 @@ static void mlx4_master_do_cmd(struct mlx4_dev *dev, int slave, u8 cmd, /*command from slave in the middle of FLR*/ if (cmd != MLX4_COMM_CMD_RESET && MLX4_COMM_CMD_FLR == slave_state[slave].last_cmd) { - mlx4_warn(dev, "slave:%d is Trying to run cmd (0x%x) " - "in the middle of FLR\n", slave, cmd); + mlx4_warn(dev, "slave:%d is Trying to run cmd(0x%x) in the middle of FLR\n", + slave, cmd); return; } @@ -1962,20 +2162,23 @@ static void mlx4_master_do_cmd(struct mlx4_dev *dev, int slave, u8 cmd, break; case MLX4_COMM_CMD_VHCR_POST: if ((slave_state[slave].last_cmd != MLX4_COMM_CMD_VHCR_EN) && - (slave_state[slave].last_cmd != MLX4_COMM_CMD_VHCR_POST)) + (slave_state[slave].last_cmd != MLX4_COMM_CMD_VHCR_POST)) { + mlx4_warn(dev, "slave:%d is out of sync, cmd=0x%x, last command=0x%x, reset is needed\n", + slave, cmd, slave_state[slave].last_cmd); goto reset_slave; + } mutex_lock(&priv->cmd.slave_cmd_mutex); if (mlx4_master_process_vhcr(dev, slave, NULL)) { - mlx4_err(dev, "Failed processing vhcr for slave: %d," - " resetting slave.\n", slave); + mlx4_err(dev, "Failed processing vhcr for slave:%d, resetting slave\n", + slave); mutex_unlock(&priv->cmd.slave_cmd_mutex); goto reset_slave; } mutex_unlock(&priv->cmd.slave_cmd_mutex); break; default: - mlx4_warn(dev, "Bad comm cmd: %d from slave: %d\n", cmd, slave); + mlx4_warn(dev, "Bad comm cmd:%d from slave:%d\n", cmd, slave); goto reset_slave; } spin_lock_irqsave(&priv->mfunc.master.slave_state_lock, flags); @@ -1985,8 +2188,7 @@ static void mlx4_master_do_cmd(struct mlx4_dev *dev, int slave, u8 cmd, is_going_down = 1; spin_unlock_irqrestore(&priv->mfunc.master.slave_state_lock, flags); if (is_going_down) { - mlx4_warn(dev, "Slave is going down aborting command (%d)" - " executing from slave: %d\n", + mlx4_warn(dev, "Slave is going down aborting command(%d) executing from slave:%d\n", cmd, slave); return; } @@ -1998,13 +2200,26 @@ static void mlx4_master_do_cmd(struct mlx4_dev *dev, int slave, u8 cmd, reset_slave: /* cleanup any slave resources */ - mlx4_delete_all_resources_for_slave(dev, slave); + if (dev->persist->interface_state & MLX4_INTERFACE_STATE_UP) + mlx4_delete_all_resources_for_slave(dev, slave); + + if (cmd != MLX4_COMM_CMD_RESET) { + mlx4_warn(dev, "Turn on internal error to force reset, slave=%d, cmd=0x%x\n", + slave, cmd); + /* Turn on internal error letting slave reset itself immeditaly, + * otherwise it might take till timeout on command is passed + */ + reply |= ((u32)COMM_CHAN_EVENT_INTERNAL_ERR); + } + spin_lock_irqsave(&priv->mfunc.master.slave_state_lock, flags); if (!slave_state[slave].is_slave_going_down) slave_state[slave].last_cmd = MLX4_COMM_CMD_RESET; spin_unlock_irqrestore(&priv->mfunc.master.slave_state_lock, flags); /*with slave in the middle of flr, no need to clean resources again.*/ inform_slave_state: + memset(&slave_state[slave].event_eq, 0, + sizeof(struct mlx4_slave_event_eq_info)); __raw_writel((__force u32) cpu_to_be32(reply), &priv->mfunc.comm[slave].slave_read); wmb(); @@ -2047,10 +2262,9 @@ void mlx4_master_comm_channel(struct work_struct *work) if (toggle != slt) { if (master->slave_state[slave].comm_toggle != slt) { - mlx4_info(dev, "slave %d out of sync." - " read toggle %d, state toggle %d. " - "Resynching.\n", slave, slt, - master->slave_state[slave].comm_toggle); + pr_info("slave %d out of sync. read toggle %d, state toggle %d. Resynching.\n", + slave, slt, + master->slave_state[slave].comm_toggle); master->slave_state[slave].comm_toggle = slt; } @@ -2058,30 +2272,13 @@ void mlx4_master_comm_channel(struct work_struct *work) comm_cmd >> 16 & 0xff, comm_cmd & 0xffff, toggle); ++served; - } else - mlx4_err(dev, "slave %d out of sync." - " read toggle %d, write toggle %d.\n", slave, slt, - toggle); + } } } if (reported && reported != served) - mlx4_warn(dev, "Got command event with bitmask from %d slaves" - " but %d were served\n", + mlx4_warn(dev, "Got command event with bitmask from %d slaves but %d were served\n", reported, served); -} -/* master command processing */ -void mlx4_master_arm_comm_channel(struct work_struct *work) -{ - struct mlx4_mfunc_master_ctx *master = - container_of(work, - struct mlx4_mfunc_master_ctx, - arm_comm_work); - struct mlx4_mfunc *mfunc = - container_of(master, struct mlx4_mfunc, master); - struct mlx4_priv *priv = - container_of(mfunc, struct mlx4_priv, mfunc); - struct mlx4_dev *dev = &priv->dev; if (mlx4_ARM_COMM_CHANNEL(dev)) mlx4_warn(dev, "Failed to arm comm channel events\n"); @@ -2090,17 +2287,28 @@ void mlx4_master_arm_comm_channel(struct work_struct *work) static int sync_toggles(struct mlx4_dev *dev) { struct mlx4_priv *priv = mlx4_priv(dev); - int wr_toggle; - int rd_toggle; + u32 wr_toggle; + u32 rd_toggle; unsigned long end; - wr_toggle = swab32(readl(&priv->mfunc.comm->slave_write)) >> 31; - end = jiffies + msecs_to_jiffies(5000); + wr_toggle = swab32(readl(&priv->mfunc.comm->slave_write)); + if (wr_toggle == 0xffffffff) + end = jiffies + msecs_to_jiffies(30000); + else + end = jiffies + msecs_to_jiffies(5000); while (time_before(jiffies, end)) { - rd_toggle = swab32(readl(&priv->mfunc.comm->slave_read)) >> 31; - if (rd_toggle == wr_toggle) { - priv->cmd.comm_toggle = rd_toggle; + rd_toggle = swab32(readl(&priv->mfunc.comm->slave_read)); + if (wr_toggle == 0xffffffff || rd_toggle == 0xffffffff) { + /* PCI might be offline */ + msleep(100); + wr_toggle = swab32(readl(&priv->mfunc.comm-> + slave_write)); + continue; + } + + if (rd_toggle >> 31 == wr_toggle >> 31) { + priv->cmd.comm_toggle = rd_toggle >> 31; return 0; } @@ -2129,18 +2337,22 @@ int mlx4_multi_func_init(struct mlx4_dev *dev) if (mlx4_is_master(dev)) priv->mfunc.comm = - ioremap(pci_resource_start(dev->pdev, priv->fw.comm_bar) + + ioremap(pci_resource_start(dev->persist->pdev, + priv->fw.comm_bar) + priv->fw.comm_base, MLX4_COMM_PAGESIZE); else priv->mfunc.comm = - ioremap(pci_resource_start(dev->pdev, 2) + + ioremap(pci_resource_start(dev->persist->pdev, 2) + MLX4_SLAVE_COMM_BASE, MLX4_COMM_PAGESIZE); if (!priv->mfunc.comm) { - mlx4_err(dev, "Couldn't map communication vector.\n"); + mlx4_err(dev, "Couldn't map communication vector\n"); goto err_vhcr; } if (mlx4_is_master(dev)) { + struct mlx4_vf_oper_state *vf_oper; + struct mlx4_vf_admin_state *vf_admin; + priv->mfunc.master.slave_state = kzalloc(dev->num_slaves * sizeof(struct mlx4_slave_state), GFP_KERNEL); @@ -2160,8 +2372,11 @@ int mlx4_multi_func_init(struct mlx4_dev *dev) goto err_comm_oper; for (i = 0; i < dev->num_slaves; ++i) { + vf_admin = &priv->mfunc.master.vf_admin[i]; + vf_oper = &priv->mfunc.master.vf_oper[i]; s_state = &priv->mfunc.master.slave_state[i]; s_state->last_cmd = MLX4_COMM_CMD_RESET; + s_state->vst_qinq_supported = false; mutex_init(&priv->mfunc.master.gen_eqe_mutex[i]); for (j = 0; j < MLX4_EVENT_TYPES_NUM; ++j) s_state->event_eq[j].eqn = -1; @@ -2171,6 +2386,9 @@ int mlx4_multi_func_init(struct mlx4_dev *dev) &priv->mfunc.comm[i].slave_read); mmiowb(); for (port = 1; port <= MLX4_MAX_PORTS; port++) { + struct mlx4_vport_state *admin_vport; + struct mlx4_vport_state *oper_vport; + s_state->vlan_filter[port] = kzalloc(sizeof(struct mlx4_vlan_fltr), GFP_KERNEL); @@ -2179,21 +2397,37 @@ int mlx4_multi_func_init(struct mlx4_dev *dev) kfree(s_state->vlan_filter[port]); goto err_slaves; } + + admin_vport = &vf_admin->vport[port]; + oper_vport = &vf_oper->vport[port].state; INIT_LIST_HEAD(&s_state->mcast_filters[port]); - priv->mfunc.master.vf_admin[i].vport[port].default_vlan = MLX4_VGT; - priv->mfunc.master.vf_oper[i].vport[port].state.default_vlan = MLX4_VGT; - priv->mfunc.master.vf_oper[i].vport[port].vlan_idx = NO_INDX; - priv->mfunc.master.vf_oper[i].vport[port].mac_idx = NO_INDX; + admin_vport->default_vlan = MLX4_VGT; + oper_vport->default_vlan = MLX4_VGT; + admin_vport->qos_vport = + MLX4_VPP_DEFAULT_VPORT; + oper_vport->qos_vport = MLX4_VPP_DEFAULT_VPORT; + admin_vport->vlan_proto = htons(ETH_P_8021Q); + oper_vport->vlan_proto = htons(ETH_P_8021Q); + vf_oper->vport[port].vlan_idx = NO_INDX; + vf_oper->vport[port].mac_idx = NO_INDX; + mlx4_set_random_admin_guid(dev, i, port); } spin_lock_init(&s_state->lock); } - memset(&priv->mfunc.master.cmd_eqe, 0, dev->caps.eqe_size); + if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_QOS_VPP) { + for (port = 1; port <= dev->caps.num_ports; port++) { + if (mlx4_is_eth(dev, port)) { + mlx4_set_default_port_qos(dev, port); + mlx4_allocate_port_vpps(dev, port); + } + } + } + + memset(&priv->mfunc.master.cmd_eqe, 0, sizeof(struct mlx4_eqe)); priv->mfunc.master.cmd_eqe.type = MLX4_EVENT_TYPE_CMD; INIT_WORK(&priv->mfunc.master.comm_work, mlx4_master_comm_channel); - INIT_WORK(&priv->mfunc.master.arm_comm_work, - mlx4_master_arm_comm_channel); INIT_WORK(&priv->mfunc.master.slave_event_work, mlx4_gen_slave_eqe); INIT_WORK(&priv->mfunc.master.slave_flr_event_work, @@ -2208,13 +2442,6 @@ int mlx4_multi_func_init(struct mlx4_dev *dev) if (mlx4_init_resource_tracker(dev)) goto err_thread; - err = mlx4_ARM_COMM_CHANNEL(dev); - if (err) { - mlx4_err(dev, " Failed to arm comm channel eq: %x\n", - err); - goto err_resource; - } - } else { err = sync_toggles(dev); if (err) { @@ -2224,13 +2451,11 @@ int mlx4_multi_func_init(struct mlx4_dev *dev) } return 0; -err_resource: - mlx4_free_resource_tracker(dev, RES_TR_FREE_ALL); err_thread: flush_workqueue(priv->mfunc.master.comm_wq); destroy_workqueue(priv->mfunc.master.comm_wq); err_slaves: - while (--i) { + while (i--) { for (port = 1; port <= MLX4_MAX_PORTS; port++) kfree(priv->mfunc.master.slave_state[i].vlan_filter[port]); } @@ -2241,10 +2466,11 @@ int mlx4_multi_func_init(struct mlx4_dev *dev) kfree(priv->mfunc.master.slave_state); err_comm: iounmap(priv->mfunc.comm); + priv->mfunc.comm = NULL; err_vhcr: - dma_free_coherent(&(dev->pdev->dev), PAGE_SIZE, - priv->mfunc.vhcr, - priv->mfunc.vhcr_dma); + dma_free_coherent(&dev->persist->pdev->dev, PAGE_SIZE, + priv->mfunc.vhcr, + priv->mfunc.vhcr_dma); priv->mfunc.vhcr = NULL; return -ENOMEM; } @@ -2252,55 +2478,85 @@ int mlx4_multi_func_init(struct mlx4_dev *dev) int mlx4_cmd_init(struct mlx4_dev *dev) { struct mlx4_priv *priv = mlx4_priv(dev); + int flags = 0; - mutex_init(&priv->cmd.hcr_mutex); - mutex_init(&priv->cmd.slave_cmd_mutex); - sema_init(&priv->cmd.poll_sem, 1); - priv->cmd.use_events = 0; - priv->cmd.toggle = 1; - - priv->cmd.hcr = NULL; - priv->mfunc.vhcr = NULL; - - if (!mlx4_is_slave(dev)) { - priv->cmd.hcr = ioremap(pci_resource_start(dev->pdev, 0) + - MLX4_HCR_BASE, MLX4_HCR_SIZE); - if (!priv->cmd.hcr) { - mlx4_err(dev, "Couldn't map command register.\n"); - return -ENOMEM; - } + if (!priv->cmd.initialized) { + init_rwsem(&priv->cmd.switch_sem); + mutex_init(&priv->cmd.slave_cmd_mutex); + sema_init(&priv->cmd.poll_sem, 1); + priv->cmd.use_events = 0; + priv->cmd.toggle = 1; + priv->cmd.initialized = 1; + flags |= MLX4_CMD_CLEANUP_STRUCT; } - if (mlx4_is_mfunc(dev)) { - priv->mfunc.vhcr = dma_alloc_coherent(&(dev->pdev->dev), PAGE_SIZE, + if (!mlx4_is_slave(dev) && !priv->cmd.hcr) { + priv->cmd.hcr = ioremap(pci_resource_start(dev->persist->pdev, + 0) + MLX4_HCR_BASE, MLX4_HCR_SIZE); + if (!priv->cmd.hcr) { + mlx4_err(dev, "Couldn't map command register\n"); + goto err; + } + flags |= MLX4_CMD_CLEANUP_HCR; + } + + if (mlx4_is_mfunc(dev) && !priv->mfunc.vhcr) { + priv->mfunc.vhcr = dma_alloc_coherent(&dev->persist->pdev->dev, + PAGE_SIZE, &priv->mfunc.vhcr_dma, GFP_KERNEL); - if (!priv->mfunc.vhcr) { - mlx4_err(dev, "Couldn't allocate VHCR.\n"); - goto err_hcr; - } + if (!priv->mfunc.vhcr) + goto err; + + flags |= MLX4_CMD_CLEANUP_VHCR; } - priv->cmd.pool = pci_pool_create("mlx4_cmd", dev->pdev, - MLX4_MAILBOX_SIZE, - MLX4_MAILBOX_SIZE, 0); - if (!priv->cmd.pool) - goto err_vhcr; + if (!priv->cmd.pool) { + priv->cmd.pool = pci_pool_create("mlx4_cmd", + dev->persist->pdev, + MLX4_MAILBOX_SIZE, + MLX4_MAILBOX_SIZE, 0); + if (!priv->cmd.pool) + goto err; + + flags |= MLX4_CMD_CLEANUP_POOL; + } return 0; -err_vhcr: - if (mlx4_is_mfunc(dev)) - dma_free_coherent(&(dev->pdev->dev), PAGE_SIZE, - priv->mfunc.vhcr, priv->mfunc.vhcr_dma); - priv->mfunc.vhcr = NULL; - -err_hcr: - if (!mlx4_is_slave(dev)) - iounmap(priv->cmd.hcr); +err: + mlx4_cmd_cleanup(dev, flags); return -ENOMEM; } +void mlx4_report_internal_err_comm_event(struct mlx4_dev *dev) +{ + struct mlx4_priv *priv = mlx4_priv(dev); + int slave; + u32 slave_read; + + /* If the comm channel has not yet been initialized, + * skip reporting the internal error event to all + * the communication channels. + */ + if (!priv->mfunc.comm) + return; + + /* Report an internal error event to all + * communication channels. + */ + for (slave = 0; slave < dev->num_slaves; slave++) { + slave_read = swab32(readl(&priv->mfunc.comm[slave].slave_read)); + slave_read |= (u32)COMM_CHAN_EVENT_INTERNAL_ERR; + __raw_writel((__force u32)cpu_to_be32(slave_read), + &priv->mfunc.comm[slave].slave_read); + /* Make sure that our comm channel write doesn't + * get mixed in with writes from another CPU. + */ + mmiowb(); + } +} + void mlx4_multi_func_cleanup(struct mlx4_dev *dev) { struct mlx4_priv *priv = mlx4_priv(dev); @@ -2316,23 +2572,35 @@ void mlx4_multi_func_cleanup(struct mlx4_dev *dev) kfree(priv->mfunc.master.slave_state); kfree(priv->mfunc.master.vf_admin); kfree(priv->mfunc.master.vf_oper); + dev->num_slaves = 0; } iounmap(priv->mfunc.comm); + priv->mfunc.comm = NULL; } -void mlx4_cmd_cleanup(struct mlx4_dev *dev) +void mlx4_cmd_cleanup(struct mlx4_dev *dev, int cleanup_mask) { struct mlx4_priv *priv = mlx4_priv(dev); - pci_pool_destroy(priv->cmd.pool); + if (priv->cmd.pool && (cleanup_mask & MLX4_CMD_CLEANUP_POOL)) { + pci_pool_destroy(priv->cmd.pool); + priv->cmd.pool = NULL; + } - if (!mlx4_is_slave(dev)) + if (!mlx4_is_slave(dev) && priv->cmd.hcr && + (cleanup_mask & MLX4_CMD_CLEANUP_HCR)) { iounmap(priv->cmd.hcr); - if (mlx4_is_mfunc(dev)) - dma_free_coherent(&(dev->pdev->dev), PAGE_SIZE, + priv->cmd.hcr = NULL; + } + if (mlx4_is_mfunc(dev) && priv->mfunc.vhcr && + (cleanup_mask & MLX4_CMD_CLEANUP_VHCR)) { + dma_free_coherent(&dev->persist->pdev->dev, PAGE_SIZE, priv->mfunc.vhcr, priv->mfunc.vhcr_dma); - priv->mfunc.vhcr = NULL; + priv->mfunc.vhcr = NULL; + } + if (priv->cmd.initialized && (cleanup_mask & MLX4_CMD_CLEANUP_STRUCT)) + priv->cmd.initialized = 0; } /* @@ -2351,16 +2619,21 @@ int mlx4_cmd_use_events(struct mlx4_dev *dev) if (!priv->cmd.context) return -ENOMEM; + down_write(&priv->cmd.switch_sem); for (i = 0; i < priv->cmd.max_cmds; ++i) { priv->cmd.context[i].token = i; priv->cmd.context[i].next = i + 1; + /* To support fatal error flow, initialize all + * cmd contexts to allow simulating completions + * with complete() at any time. + */ + init_completion(&priv->cmd.context[i].done); } priv->cmd.context[priv->cmd.max_cmds - 1].next = -1; priv->cmd.free_head = 0; sema_init(&priv->cmd.event_sem, priv->cmd.max_cmds); - spin_lock_init(&priv->cmd.context_lock); for (priv->cmd.token_mask = 1; priv->cmd.token_mask < priv->cmd.max_cmds; @@ -2370,6 +2643,7 @@ int mlx4_cmd_use_events(struct mlx4_dev *dev) down(&priv->cmd.poll_sem); priv->cmd.use_events = 1; + up_write(&priv->cmd.switch_sem); return err; } @@ -2382,6 +2656,7 @@ void mlx4_cmd_use_polling(struct mlx4_dev *dev) struct mlx4_priv *priv = mlx4_priv(dev); int i; + down_write(&priv->cmd.switch_sem); priv->cmd.use_events = 0; for (i = 0; i < priv->cmd.max_cmds; ++i) @@ -2390,6 +2665,7 @@ void mlx4_cmd_use_polling(struct mlx4_dev *dev) kfree(priv->cmd.context); up(&priv->cmd.poll_sem); + up_write(&priv->cmd.switch_sem); } struct mlx4_cmd_mailbox *mlx4_alloc_cmd_mailbox(struct mlx4_dev *dev) @@ -2431,14 +2707,254 @@ u32 mlx4_comm_get_version(void) static int mlx4_get_slave_indx(struct mlx4_dev *dev, int vf) { - if ((vf < 0) || (vf >= dev->num_vfs)) { - mlx4_err(dev, "Bad vf number:%d (number of activated vf: %d)\n", vf, dev->num_vfs); + if ((vf < 0) || (vf >= dev->persist->num_vfs)) { + mlx4_err(dev, "Bad vf number:%d (number of activated vf: %d)\n", + vf, dev->persist->num_vfs); return -EINVAL; } - return (vf+1); + + return vf+1; } -int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u8 *mac) +int mlx4_get_vf_indx(struct mlx4_dev *dev, int slave) +{ + if (slave < 1 || slave > dev->persist->num_vfs) { + mlx4_err(dev, + "Bad slave number:%d (number of activated slaves: %lu)\n", + slave, dev->num_slaves); + return -EINVAL; + } + return slave - 1; +} + +void mlx4_cmd_wake_completions(struct mlx4_dev *dev) +{ + struct mlx4_priv *priv = mlx4_priv(dev); + struct mlx4_cmd_context *context; + int i; + + spin_lock(&priv->cmd.context_lock); + if (priv->cmd.context) { + for (i = 0; i < priv->cmd.max_cmds; ++i) { + context = &priv->cmd.context[i]; + context->fw_status = CMD_STAT_INTERNAL_ERR; + context->result = + mlx4_status_to_errno(CMD_STAT_INTERNAL_ERR); + complete(&context->done); + } + } + spin_unlock(&priv->cmd.context_lock); +} + +struct mlx4_active_ports mlx4_get_active_ports(struct mlx4_dev *dev, int slave) +{ + struct mlx4_active_ports actv_ports; + int vf; + + bitmap_zero(actv_ports.ports, MLX4_MAX_PORTS); + + if (slave == 0) { + bitmap_fill(actv_ports.ports, dev->caps.num_ports); + return actv_ports; + } + + vf = mlx4_get_vf_indx(dev, slave); + if (vf < 0) + return actv_ports; + + bitmap_set(actv_ports.ports, dev->dev_vfs[vf].min_port - 1, + min((int)dev->dev_vfs[mlx4_get_vf_indx(dev, slave)].n_ports, + dev->caps.num_ports)); + + return actv_ports; +} +EXPORT_SYMBOL_GPL(mlx4_get_active_ports); + +int mlx4_slave_convert_port(struct mlx4_dev *dev, int slave, int port) +{ + unsigned n; + struct mlx4_active_ports actv_ports = mlx4_get_active_ports(dev, slave); + unsigned m = bitmap_weight(actv_ports.ports, dev->caps.num_ports); + + if (port <= 0 || port > m) + return -EINVAL; + + n = find_first_bit(actv_ports.ports, dev->caps.num_ports); + if (port <= n) + port = n + 1; + + return port; +} +EXPORT_SYMBOL_GPL(mlx4_slave_convert_port); + +int mlx4_phys_to_slave_port(struct mlx4_dev *dev, int slave, int port) +{ + struct mlx4_active_ports actv_ports = mlx4_get_active_ports(dev, slave); + if (test_bit(port - 1, actv_ports.ports)) + return port - + find_first_bit(actv_ports.ports, dev->caps.num_ports); + + return -1; +} +EXPORT_SYMBOL_GPL(mlx4_phys_to_slave_port); + +struct mlx4_slaves_pport mlx4_phys_to_slaves_pport(struct mlx4_dev *dev, + int port) +{ + unsigned i; + struct mlx4_slaves_pport slaves_pport; + + bitmap_zero(slaves_pport.slaves, MLX4_MFUNC_MAX); + + if (port <= 0 || port > dev->caps.num_ports) + return slaves_pport; + + for (i = 0; i < dev->persist->num_vfs + 1; i++) { + struct mlx4_active_ports actv_ports = + mlx4_get_active_ports(dev, i); + if (test_bit(port - 1, actv_ports.ports)) + set_bit(i, slaves_pport.slaves); + } + + return slaves_pport; +} +EXPORT_SYMBOL_GPL(mlx4_phys_to_slaves_pport); + +struct mlx4_slaves_pport mlx4_phys_to_slaves_pport_actv( + struct mlx4_dev *dev, + const struct mlx4_active_ports *crit_ports) +{ + unsigned i; + struct mlx4_slaves_pport slaves_pport; + + bitmap_zero(slaves_pport.slaves, MLX4_MFUNC_MAX); + + for (i = 0; i < dev->persist->num_vfs + 1; i++) { + struct mlx4_active_ports actv_ports = + mlx4_get_active_ports(dev, i); + if (bitmap_equal(crit_ports->ports, actv_ports.ports, + dev->caps.num_ports)) + set_bit(i, slaves_pport.slaves); + } + + return slaves_pport; +} +EXPORT_SYMBOL_GPL(mlx4_phys_to_slaves_pport_actv); + +static int mlx4_slaves_closest_port(struct mlx4_dev *dev, int slave, int port) +{ + struct mlx4_active_ports actv_ports = mlx4_get_active_ports(dev, slave); + int min_port = find_first_bit(actv_ports.ports, dev->caps.num_ports) + + 1; + int max_port = min_port + + bitmap_weight(actv_ports.ports, dev->caps.num_ports); + + if (port < min_port) + port = min_port; + else if (port >= max_port) + port = max_port - 1; + + return port; +} + +static int mlx4_set_vport_qos(struct mlx4_priv *priv, int slave, int port, + int max_tx_rate) +{ + int i; + int err; + struct mlx4_qos_manager *port_qos; + struct mlx4_dev *dev = &priv->dev; + struct mlx4_vport_qos_param vpp_qos[MLX4_NUM_UP]; + + port_qos = &priv->mfunc.master.qos_ctl[port]; + memset(vpp_qos, 0, sizeof(struct mlx4_vport_qos_param) * MLX4_NUM_UP); + + if (slave > port_qos->num_of_qos_vfs) { + mlx4_info(dev, "No availible VPP resources for this VF\n"); + return -EINVAL; + } + + /* Query for default QoS values from Vport 0 is needed */ + err = mlx4_SET_VPORT_QOS_get(dev, port, 0, vpp_qos); + if (err) { + mlx4_info(dev, "Failed to query Vport 0 QoS values\n"); + return err; + } + + for (i = 0; i < MLX4_NUM_UP; i++) { + if (test_bit(i, port_qos->priority_bm) && max_tx_rate) { + vpp_qos[i].max_avg_bw = max_tx_rate; + vpp_qos[i].enable = 1; + } else { + /* if user supplied tx_rate == 0, meaning no rate limit + * configuration is required. so we are leaving the + * value of max_avg_bw as queried from Vport 0. + */ + vpp_qos[i].enable = 0; + } + } + + err = mlx4_SET_VPORT_QOS_set(dev, port, slave, vpp_qos); + if (err) { + mlx4_info(dev, "Failed to set Vport %d QoS values\n", slave); + return err; + } + + return 0; +} + +static bool mlx4_is_vf_vst_and_prio_qos(struct mlx4_dev *dev, int port, + struct mlx4_vport_state *vf_admin) +{ + struct mlx4_qos_manager *info; + struct mlx4_priv *priv = mlx4_priv(dev); + + if (!mlx4_is_master(dev) || + !(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_QOS_VPP)) + return false; + + info = &priv->mfunc.master.qos_ctl[port]; + + if (vf_admin->default_vlan != MLX4_VGT && + test_bit(vf_admin->default_qos, info->priority_bm)) + return true; + + return false; +} + +static bool mlx4_valid_vf_state_change(struct mlx4_dev *dev, int port, + struct mlx4_vport_state *vf_admin, + int vlan, int qos) +{ + struct mlx4_vport_state dummy_admin = {0}; + + if (!mlx4_is_vf_vst_and_prio_qos(dev, port, vf_admin) || + !vf_admin->tx_rate) + return true; + + dummy_admin.default_qos = qos; + dummy_admin.default_vlan = vlan; + + /* VF wants to move to other VST state which is valid with current + * rate limit. Either differnt default vlan in VST or other + * supported QoS priority. Otherwise we don't allow this change when + * the TX rate is still configured. + */ + if (mlx4_is_vf_vst_and_prio_qos(dev, port, &dummy_admin)) + return true; + + mlx4_info(dev, "Cannot change VF state to %s while rate is set\n", + (vlan == MLX4_VGT) ? "VGT" : "VST"); + + if (vlan != MLX4_VGT) + mlx4_info(dev, "VST priority %d not supported for QoS\n", qos); + + mlx4_info(dev, "Please set rate to 0 prior to this VF state change\n"); + + return false; +} + +int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u64 mac) { struct mlx4_priv *priv = mlx4_priv(dev); struct mlx4_vport_state *s_info; @@ -2451,19 +2967,23 @@ int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u8 *mac) if (slave < 0) return -EINVAL; + port = mlx4_slaves_closest_port(dev, slave, port); s_info = &priv->mfunc.master.vf_admin[slave].vport[port]; - s_info->mac = mlx4_mac_to_u64(mac); - mlx4_info(dev, "default mac on vf %d port %d to %llX will take afect only after vf restart\n", - vf, port, (unsigned long long) s_info->mac); + s_info->mac = mac; + mlx4_info(dev, "default mac on vf %d port %d to %llX will take effect only after vf restart\n", + vf, port, (unsigned long long)s_info->mac); return 0; } EXPORT_SYMBOL_GPL(mlx4_set_vf_mac); -int mlx4_set_vf_vlan(struct mlx4_dev *dev, int port, int vf, u16 vlan, u8 qos) + +int mlx4_set_vf_vlan(struct mlx4_dev *dev, int port, int vf, u16 vlan, u8 qos, + __be16 proto) { struct mlx4_priv *priv = mlx4_priv(dev); - struct mlx4_vport_oper_state *vf_oper; struct mlx4_vport_state *vf_admin; + struct mlx4_slave_state *slave_state; + struct mlx4_vport_oper_state *vf_oper; int slave; if ((!mlx4_is_master(dev)) || @@ -2473,38 +2993,137 @@ int mlx4_set_vf_vlan(struct mlx4_dev *dev, int port, int vf, u16 vlan, u8 qos) if ((vlan > 4095) || (qos > 7)) return -EINVAL; + if (proto == htons(ETH_P_8021AD) && + !(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_SVLAN_BY_QP)) + return -EPROTONOSUPPORT; + + if (proto != htons(ETH_P_8021Q) && + proto != htons(ETH_P_8021AD)) + return -EINVAL; + + if ((proto == htons(ETH_P_8021AD)) && + ((vlan == 0) || (vlan == MLX4_VGT))) + return -EINVAL; + slave = mlx4_get_slave_indx(dev, vf); if (slave < 0) return -EINVAL; + slave_state = &priv->mfunc.master.slave_state[slave]; + if ((proto == htons(ETH_P_8021AD)) && (slave_state->active) && + (!slave_state->vst_qinq_supported)) { + mlx4_err(dev, "vf %d does not support VST QinQ mode\n", vf); + return -EPROTONOSUPPORT; + } + port = mlx4_slaves_closest_port(dev, slave, port); vf_admin = &priv->mfunc.master.vf_admin[slave].vport[port]; vf_oper = &priv->mfunc.master.vf_oper[slave].vport[port]; + if (!mlx4_valid_vf_state_change(dev, port, vf_admin, vlan, qos)) + return -EPERM; + if ((0 == vlan) && (0 == qos)) vf_admin->default_vlan = MLX4_VGT; else vf_admin->default_vlan = vlan; vf_admin->default_qos = qos; + vf_admin->vlan_proto = proto; - if (priv->mfunc.master.slave_state[slave].active && - dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_UPDATE_QP) { - mlx4_info(dev, "updating vf %d port %d config params immediately\n", + /* If rate was configured prior to VST, we saved the configured rate + * in vf_admin->rate and now, if priority supported we enforce the QoS + */ + if (mlx4_is_vf_vst_and_prio_qos(dev, port, vf_admin) && + vf_admin->tx_rate) + vf_admin->qos_vport = slave; + + /* Try to activate new vf state without restart, + * this option is not supported while moving to VST QinQ mode. + */ + if ((proto == htons(ETH_P_8021AD) && + vf_oper->state.vlan_proto != proto) || + mlx4_master_immediate_activate_vlan_qos(priv, slave, port)) + mlx4_info(dev, + "updating vf %d port %d config will take effect on next VF restart\n", vf, port); - mlx4_master_immediate_activate_vlan_qos(priv, slave, port); - } return 0; } EXPORT_SYMBOL_GPL(mlx4_set_vf_vlan); +int mlx4_set_vf_rate(struct mlx4_dev *dev, int port, int vf, int min_tx_rate, + int max_tx_rate) +{ + int err; + int slave; + struct mlx4_vport_state *vf_admin; + struct mlx4_priv *priv = mlx4_priv(dev); + + if (!mlx4_is_master(dev) || + !(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_QOS_VPP)) + return -EPROTONOSUPPORT; + + if (min_tx_rate) { + mlx4_info(dev, "Minimum BW share not supported\n"); + return -EPROTONOSUPPORT; + } + + slave = mlx4_get_slave_indx(dev, vf); + if (slave < 0) + return -EINVAL; + + port = mlx4_slaves_closest_port(dev, slave, port); + vf_admin = &priv->mfunc.master.vf_admin[slave].vport[port]; + + err = mlx4_set_vport_qos(priv, slave, port, max_tx_rate); + if (err) { + mlx4_info(dev, "vf %d failed to set rate %d\n", vf, + max_tx_rate); + return err; + } + + vf_admin->tx_rate = max_tx_rate; + /* if VF is not in supported mode (VST with supported prio), + * we do not change vport configuration for its QPs, but save + * the rate, so it will be enforced when it moves to supported + * mode next time. + */ + if (!mlx4_is_vf_vst_and_prio_qos(dev, port, vf_admin)) { + mlx4_info(dev, + "rate set for VF %d when not in valid state\n", vf); + + if (vf_admin->default_vlan != MLX4_VGT) + mlx4_info(dev, "VST priority not supported by QoS\n"); + else + mlx4_info(dev, "VF in VGT mode (needed VST)\n"); + + mlx4_info(dev, + "rate %d take affect when VF moves to valid state\n", + max_tx_rate); + return 0; + } + + /* If user sets rate 0 assigning default vport for its QPs */ + vf_admin->qos_vport = max_tx_rate ? slave : MLX4_VPP_DEFAULT_VPORT; + + if (priv->mfunc.master.slave_state[slave].active && + dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_UPDATE_QP) + mlx4_master_immediate_activate_vlan_qos(priv, slave, port); + + return 0; +} +EXPORT_SYMBOL_GPL(mlx4_set_vf_rate); + /* mlx4_get_slave_default_vlan - - * retrun true if VST ( default vlan) - * if VST will fill vlan & qos (if not NULL) */ -bool mlx4_get_slave_default_vlan(struct mlx4_dev *dev, int port, int slave, u16 *vlan, u8 *qos) + * return true if VST ( default vlan) + * if VST, will return vlan & qos (if not NULL) + */ +bool mlx4_get_slave_default_vlan(struct mlx4_dev *dev, int port, int slave, + u16 *vlan, u8 *qos) { struct mlx4_vport_oper_state *vp_oper; struct mlx4_priv *priv; priv = mlx4_priv(dev); + port = mlx4_slaves_closest_port(dev, slave, port); vp_oper = &priv->mfunc.master.vf_oper[slave].vport[port]; if (MLX4_VGT != vp_oper->state.default_vlan) { @@ -2532,6 +3151,7 @@ int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting) if (slave < 0) return -EINVAL; + port = mlx4_slaves_closest_port(dev, slave, port); s_info = &priv->mfunc.master.vf_admin[slave].vport[port]; s_info->spoofchk = setting; @@ -2539,68 +3159,117 @@ int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting) } EXPORT_SYMBOL_GPL(mlx4_set_vf_spoofchk); -int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_state) +int mlx4_get_counter_stats(struct mlx4_dev *dev, int counter_index, + struct mlx4_counter *counter_stats, int reset) +{ + struct mlx4_cmd_mailbox *mailbox = NULL; + struct mlx4_counter *tmp_counter; + int err; + u32 if_stat_in_mod; + + if (!counter_stats) + return -EINVAL; + + if (counter_index == MLX4_SINK_COUNTER_INDEX(dev)) + return 0; + + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) + return PTR_ERR(mailbox); + + memset(mailbox->buf, 0, sizeof(struct mlx4_counter)); + if_stat_in_mod = counter_index; + if (reset) + if_stat_in_mod |= MLX4_QUERY_IF_STAT_RESET; + err = mlx4_cmd_box(dev, 0, mailbox->dma, + if_stat_in_mod, 0, + MLX4_CMD_QUERY_IF_STAT, + MLX4_CMD_TIME_CLASS_C, + MLX4_CMD_NATIVE); + if (err) { + mlx4_dbg(dev, "%s: failed to read statistics for counter index %d\n", + __func__, counter_index); + goto if_stat_out; + } + tmp_counter = (struct mlx4_counter *)mailbox->buf; + counter_stats->counter_mode = tmp_counter->counter_mode; + if (counter_stats->counter_mode == 0) { + counter_stats->rx_frames = + cpu_to_be64(be64_to_cpu(counter_stats->rx_frames) + + be64_to_cpu(tmp_counter->rx_frames)); + counter_stats->tx_frames = + cpu_to_be64(be64_to_cpu(counter_stats->tx_frames) + + be64_to_cpu(tmp_counter->tx_frames)); + counter_stats->rx_bytes = + cpu_to_be64(be64_to_cpu(counter_stats->rx_bytes) + + be64_to_cpu(tmp_counter->rx_bytes)); + counter_stats->tx_bytes = + cpu_to_be64(be64_to_cpu(counter_stats->tx_bytes) + + be64_to_cpu(tmp_counter->tx_bytes)); + } + +if_stat_out: + mlx4_free_cmd_mailbox(dev, mailbox); + + return err; +} +EXPORT_SYMBOL_GPL(mlx4_get_counter_stats); + +int mlx4_vf_smi_enabled(struct mlx4_dev *dev, int slave, int port) { struct mlx4_priv *priv = mlx4_priv(dev); - struct mlx4_vport_state *s_info; - struct mlx4_vport_oper_state *vp_oper; - int slave; - u8 link_stat_event; - slave = mlx4_get_slave_indx(dev, vf); - if (slave < 0) + if (slave < 1 || slave >= dev->num_slaves || + port < 1 || port > MLX4_MAX_PORTS) + return 0; + + return priv->mfunc.master.vf_oper[slave].smi_enabled[port] == + MLX4_VF_SMI_ENABLED; +} +EXPORT_SYMBOL_GPL(mlx4_vf_smi_enabled); + +int mlx4_vf_get_enable_smi_admin(struct mlx4_dev *dev, int slave, int port) +{ + struct mlx4_priv *priv = mlx4_priv(dev); + + if (slave == mlx4_master_func_num(dev)) + return 1; + + if (slave < 1 || slave >= dev->num_slaves || + port < 1 || port > MLX4_MAX_PORTS) + return 0; + + return priv->mfunc.master.vf_admin[slave].enable_smi[port] == + MLX4_VF_SMI_ENABLED; +} +EXPORT_SYMBOL_GPL(mlx4_vf_get_enable_smi_admin); + +int mlx4_vf_set_enable_smi_admin(struct mlx4_dev *dev, int slave, int port, + int enabled) +{ + struct mlx4_priv *priv = mlx4_priv(dev); + struct mlx4_active_ports actv_ports = mlx4_get_active_ports( + &priv->dev, slave); + int min_port = find_first_bit(actv_ports.ports, + priv->dev.caps.num_ports) + 1; + int max_port = min_port - 1 + + bitmap_weight(actv_ports.ports, priv->dev.caps.num_ports); + + if (slave == mlx4_master_func_num(dev)) + return 0; + + if (slave < 1 || slave >= dev->num_slaves || + port < 1 || port > MLX4_MAX_PORTS || + enabled < 0 || enabled > 1) return -EINVAL; - switch (link_state) { - case IFLA_VF_LINK_STATE_AUTO: - /* get link curent state */ - if (!priv->sense.do_sense_port[port]) - link_stat_event = MLX4_PORT_CHANGE_SUBTYPE_ACTIVE; - else - link_stat_event = MLX4_PORT_CHANGE_SUBTYPE_DOWN; - break; - - case IFLA_VF_LINK_STATE_ENABLE: - link_stat_event = MLX4_PORT_CHANGE_SUBTYPE_ACTIVE; - break; - - case IFLA_VF_LINK_STATE_DISABLE: - link_stat_event = MLX4_PORT_CHANGE_SUBTYPE_DOWN; - break; - - default: - mlx4_warn(dev, "unknown value for link_state %02x on slave %d port %d\n", - link_state, slave, port); - return -EINVAL; + if (min_port == max_port && dev->caps.num_ports > 1) { + mlx4_info(dev, "SMI access disallowed for single ported VFs\n"); + return -EPROTONOSUPPORT; } - /* update the admin & oper state on the link state */ - s_info = &priv->mfunc.master.vf_admin[slave].vport[port]; - vp_oper = &priv->mfunc.master.vf_oper[slave].vport[port]; - s_info->link_state = link_state; - vp_oper->state.link_state = link_state; - /* send event */ - mlx4_gen_port_state_change_eqe(dev, slave, port, link_stat_event); + priv->mfunc.master.vf_admin[slave].enable_smi[port] = enabled; return 0; } -EXPORT_SYMBOL_GPL(mlx4_set_vf_link_state); - -int mlx4_get_vf_link_state(struct mlx4_dev *dev, int port, int vf) -{ - struct mlx4_priv *priv = mlx4_priv(dev); - struct mlx4_vport_state *s_info; - int slave; - - if (!mlx4_is_master(dev)) - return -EPROTONOSUPPORT; - - slave = mlx4_get_slave_indx(dev, vf); - if (slave < 0) - return -EINVAL; - - s_info = &priv->mfunc.master.vf_admin[slave].vport[port]; - - return s_info->link_state; -} -EXPORT_SYMBOL_GPL(mlx4_get_vf_link_state); +EXPORT_SYMBOL_GPL(mlx4_vf_set_enable_smi_admin); diff --git a/sys/dev/mlx4/mlx4_core/mlx4_cq.c b/sys/dev/mlx4/mlx4_core/mlx4_cq.c index 9c13820bfa96..4905c8d0a657 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_cq.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_cq.c @@ -53,18 +53,10 @@ void mlx4_cq_completion(struct mlx4_dev *dev, u32 cqn) { - struct mlx4_cq_table *cq_table = &mlx4_priv(dev)->cq_table; struct mlx4_cq *cq; - read_lock(&cq_table->cq_table_lock); - cq = radix_tree_lookup(&mlx4_priv(dev)->cq_table.tree, cqn & (dev->caps.num_cqs - 1)); - if (cq) - atomic_inc(&cq->refcount); - - read_unlock(&cq_table->cq_table_lock); - if (!cq) { mlx4_dbg(dev, "Completion event for bogus CQ %08x\n", cqn); return; @@ -73,9 +65,6 @@ void mlx4_cq_completion(struct mlx4_dev *dev, u32 cqn) ++cq->arm_sn; cq->comp(cq); - - if (atomic_dec_and_test(&cq->refcount)) - complete(&cq->free); } void mlx4_cq_event(struct mlx4_dev *dev, u32 cqn, int event_type) @@ -83,13 +72,13 @@ void mlx4_cq_event(struct mlx4_dev *dev, u32 cqn, int event_type) struct mlx4_cq_table *cq_table = &mlx4_priv(dev)->cq_table; struct mlx4_cq *cq; - read_lock(&cq_table->cq_table_lock); + spin_lock(&cq_table->lock); cq = radix_tree_lookup(&cq_table->tree, cqn & (dev->caps.num_cqs - 1)); if (cq) atomic_inc(&cq->refcount); - read_unlock(&cq_table->cq_table_lock); + spin_unlock(&cq_table->lock); if (!cq) { mlx4_warn(dev, "Async event for bogus CQ %08x\n", cqn); @@ -137,8 +126,6 @@ int mlx4_cq_modify(struct mlx4_dev *dev, struct mlx4_cq *cq, return PTR_ERR(mailbox); cq_context = mailbox->buf; - memset(cq_context, 0, sizeof *cq_context); - cq_context->cq_max_count = cpu_to_be16(count); cq_context->cq_period = cpu_to_be16(period); @@ -162,8 +149,6 @@ int mlx4_cq_resize(struct mlx4_dev *dev, struct mlx4_cq *cq, return PTR_ERR(mailbox); cq_context = mailbox->buf; - memset(cq_context, 0, sizeof *cq_context); - cq_context->logsize_usrpage = cpu_to_be32(ilog2(entries) << 24); cq_context->log_page_size = mtt->page_shift - 12; mtt_addr = mlx4_mtt_addr(dev, mtt); @@ -177,28 +162,6 @@ int mlx4_cq_resize(struct mlx4_dev *dev, struct mlx4_cq *cq, } EXPORT_SYMBOL_GPL(mlx4_cq_resize); -int mlx4_cq_ignore_overrun(struct mlx4_dev *dev, struct mlx4_cq *cq) -{ - struct mlx4_cmd_mailbox *mailbox; - struct mlx4_cq_context *cq_context; - int err; - - mailbox = mlx4_alloc_cmd_mailbox(dev); - if (IS_ERR(mailbox)) - return PTR_ERR(mailbox); - - cq_context = mailbox->buf; - memset(cq_context, 0, sizeof *cq_context); - - cq_context->flags |= cpu_to_be32(MLX4_CQ_FLAG_OI); - - err = mlx4_MODIFY_CQ(dev, mailbox, cq->cqn, 3); - - mlx4_free_cmd_mailbox(dev, mailbox); - return err; -} -EXPORT_SYMBOL_GPL(mlx4_cq_ignore_overrun); - int __mlx4_cq_alloc_icm(struct mlx4_dev *dev, int *cqn) { struct mlx4_priv *priv = mlx4_priv(dev); @@ -209,11 +172,11 @@ int __mlx4_cq_alloc_icm(struct mlx4_dev *dev, int *cqn) if (*cqn == -1) return -ENOMEM; - err = mlx4_table_get(dev, &cq_table->table, *cqn); + err = mlx4_table_get(dev, &cq_table->table, *cqn, GFP_KERNEL); if (err) goto err_out; - err = mlx4_table_get(dev, &cq_table->cmpt_table, *cqn); + err = mlx4_table_get(dev, &cq_table->cmpt_table, *cqn, GFP_KERNEL); if (err) goto err_put; return 0; @@ -283,7 +246,7 @@ int mlx4_cq_alloc(struct mlx4_dev *dev, int nent, u64 mtt_addr; int err; - if (vector > dev->caps.num_comp_vectors + dev->caps.comp_pool) + if (vector >= dev->caps.num_comp_vectors) return -EINVAL; cq->vector = vector; @@ -305,14 +268,14 @@ int mlx4_cq_alloc(struct mlx4_dev *dev, int nent, } cq_context = mailbox->buf; - memset(cq_context, 0, sizeof *cq_context); - cq_context->flags = cpu_to_be32(!!collapsed << 18); if (timestamp_en) cq_context->flags |= cpu_to_be32(1 << 19); - cq_context->logsize_usrpage = cpu_to_be32((ilog2(nent) << 24) | uar->index); - cq_context->comp_eqn = priv->eq_table.eq[vector].eqn; + cq_context->logsize_usrpage = + cpu_to_be32((ilog2(nent) << 24) | + mlx4_to_hw_uar_index(dev, uar->index)); + cq_context->comp_eqn = priv->eq_table.eq[MLX4_CQ_TO_EQ_VECTOR(vector)].eqn; cq_context->log_page_size = mtt->page_shift - MLX4_ICM_PAGE_SHIFT; mtt_addr = mlx4_mtt_addr(dev, mtt); @@ -331,9 +294,7 @@ int mlx4_cq_alloc(struct mlx4_dev *dev, int nent, atomic_set(&cq->refcount, 1); init_completion(&cq->free); - cq->eqn = priv->eq_table.eq[cq->vector].eqn; - cq->irq = priv->eq_table.eq[cq->vector].irq; - + cq->irq = priv->eq_table.eq[MLX4_CQ_TO_EQ_VECTOR(vector)].irq; return 0; err_radix: @@ -358,7 +319,10 @@ void mlx4_cq_free(struct mlx4_dev *dev, struct mlx4_cq *cq) if (err) mlx4_warn(dev, "HW2SW_CQ failed (%d) for CQN %06x\n", err, cq->cqn); - synchronize_irq(priv->eq_table.eq[cq->vector].irq); + synchronize_irq(priv->eq_table.eq[MLX4_CQ_TO_EQ_VECTOR(cq->vector)].irq); + if (priv->eq_table.eq[MLX4_CQ_TO_EQ_VECTOR(cq->vector)].irq != + priv->eq_table.eq[MLX4_EQ_ASYNC].irq) + synchronize_irq(priv->eq_table.eq[MLX4_EQ_ASYNC].irq); spin_lock_irq(&cq_table->lock); radix_tree_delete(&cq_table->tree, cq->cqn); @@ -378,7 +342,6 @@ int mlx4_init_cq_table(struct mlx4_dev *dev) int err; spin_lock_init(&cq_table->lock); - rwlock_init(&cq_table->cq_table_lock); INIT_RADIX_TREE(&cq_table->tree, GFP_ATOMIC); if (mlx4_is_slave(dev)) return 0; diff --git a/sys/dev/mlx4/mlx4_core/mlx4_eq.c b/sys/dev/mlx4/mlx4_core/mlx4_eq.c index 4765ea1d2437..5b331f9a34b9 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_eq.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_eq.c @@ -36,6 +36,7 @@ #include #include #include +#include #include @@ -102,21 +103,24 @@ static void eq_set_ci(struct mlx4_eq *eq, int req_not) mb(); } -static struct mlx4_eqe *get_eqe(struct mlx4_eq *eq, u32 entry, u8 eqe_factor) +static struct mlx4_eqe *get_eqe(struct mlx4_eq *eq, u32 entry, u8 eqe_factor, + u8 eqe_size) { /* (entry & (eq->nent - 1)) gives us a cyclic array */ - unsigned long offset = (entry & (eq->nent - 1)) * (MLX4_EQ_ENTRY_SIZE << eqe_factor); - /* CX3 is capable of extending the EQE from 32 to 64 bytes. - * When this feature is enabled, the first (in the lower addresses) + unsigned long offset = (entry & (eq->nent - 1)) * eqe_size; + /* CX3 is capable of extending the EQE from 32 to 64 bytes with + * strides of 64B,128B and 256B. + * When 64B EQE is used, the first (in the lower addresses) * 32 bytes in the 64 byte EQE are reserved and the next 32 bytes * contain the legacy EQE information. + * In all other cases, the first 32B contains the legacy EQE info. */ return eq->page_list[offset / PAGE_SIZE].buf + (offset + (eqe_factor ? MLX4_EQ_ENTRY_SIZE : 0)) % PAGE_SIZE; } -static struct mlx4_eqe *next_eqe_sw(struct mlx4_eq *eq, u8 eqe_factor) +static struct mlx4_eqe *next_eqe_sw(struct mlx4_eq *eq, u8 eqe_factor, u8 size) { - struct mlx4_eqe *eqe = get_eqe(eq, eq->cons_index, eqe_factor); + struct mlx4_eqe *eqe = get_eqe(eq, eq->cons_index, eqe_factor, size); return !!(eqe->owner & 0x80) ^ !!(eq->cons_index & eq->nent) ? NULL : eqe; } @@ -141,24 +145,47 @@ void mlx4_gen_slave_eqe(struct work_struct *work) struct mlx4_slave_event_eq *slave_eq = &mfunc->master.slave_eq; struct mlx4_eqe *eqe; u8 slave; - int i; + int i, phys_port, slave_port; for (eqe = next_slave_event_eqe(slave_eq); eqe; eqe = next_slave_event_eqe(slave_eq)) { slave = eqe->slave_id; + if (eqe->type == MLX4_EVENT_TYPE_PORT_CHANGE && + eqe->subtype == MLX4_PORT_CHANGE_SUBTYPE_DOWN && + mlx4_is_bonded(dev)) { + struct mlx4_port_cap port_cap; + + if (!mlx4_QUERY_PORT(dev, 1, &port_cap) && port_cap.link_state) + goto consume; + + if (!mlx4_QUERY_PORT(dev, 2, &port_cap) && port_cap.link_state) + goto consume; + } /* All active slaves need to receive the event */ if (slave == ALL_SLAVES) { - for (i = 0; i < dev->num_slaves; i++) { + for (i = 0; i <= dev->persist->num_vfs; i++) { + phys_port = 0; + if (eqe->type == MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT && + eqe->subtype == MLX4_DEV_PMC_SUBTYPE_PORT_INFO) { + phys_port = eqe->event.port_mgmt_change.port; + slave_port = mlx4_phys_to_slave_port(dev, i, phys_port); + if (slave_port < 0) /* VF doesn't have this port */ + continue; + eqe->event.port_mgmt_change.port = slave_port; + } if (mlx4_GEN_EQE(dev, i, eqe)) - mlx4_warn(dev, "Failed to generate " - "event for slave %d\n", i); + mlx4_warn(dev, "Failed to generate event for slave %d\n", + i); + if (phys_port) + eqe->event.port_mgmt_change.port = phys_port; } } else { if (mlx4_GEN_EQE(dev, slave, eqe)) - mlx4_warn(dev, "Failed to generate event " - "for slave %d\n", slave); + mlx4_warn(dev, "Failed to generate event for slave %d\n", + slave); } +consume: ++slave_eq->cons; } } @@ -175,13 +202,13 @@ static void slave_event(struct mlx4_dev *dev, u8 slave, struct mlx4_eqe *eqe) s_eqe = &slave_eq->event_eqe[slave_eq->prod & (SLAVE_EVENT_EQ_SIZE - 1)]; if ((!!(s_eqe->owner & 0x80)) ^ (!!(slave_eq->prod & SLAVE_EVENT_EQ_SIZE))) { - mlx4_warn(dev, "Master failed to generate an EQE for slave: %d. " - "No free EQE on slave events queue\n", slave); + mlx4_warn(dev, "Master failed to generate an EQE for slave: %d. No free EQE on slave events queue\n", + slave); spin_unlock_irqrestore(&slave_eq->event_lock, flags); return; } - memcpy(s_eqe, eqe, dev->caps.eqe_size - 1); + memcpy(s_eqe, eqe, sizeof(struct mlx4_eqe) - 1); s_eqe->slave_id = slave; /* ensure all information is written before setting the ownersip bit */ wmb(); @@ -198,16 +225,26 @@ static void mlx4_slave_event(struct mlx4_dev *dev, int slave, { struct mlx4_priv *priv = mlx4_priv(dev); - if (slave < 0 || slave >= dev->num_slaves || - slave == dev->caps.function) - return; - - if (!priv->mfunc.master.slave_state[slave].active) + if (slave < 0 || slave > dev->persist->num_vfs || + slave == dev->caps.function || + !priv->mfunc.master.slave_state[slave].active) return; slave_event(dev, slave, eqe); } +static void mlx4_set_eq_affinity_hint(struct mlx4_priv *priv, int vec) +{ + int hint_err; + struct mlx4_dev *dev = &priv->dev; + struct mlx4_eq *eq = &priv->eq_table.eq[vec]; + + hint_err = bind_irq_to_cpu(eq->irq, eq->affinity_cpu_id); + + if (hint_err) + mlx4_warn(dev, "bind_irq_to_cpu failed, err %d\n", hint_err); +} + int mlx4_gen_pkey_eqe(struct mlx4_dev *dev, int slave, u8 port) { struct mlx4_eqe eqe; @@ -222,7 +259,7 @@ int mlx4_gen_pkey_eqe(struct mlx4_dev *dev, int slave, u8 port) eqe.type = MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT; eqe.subtype = MLX4_DEV_PMC_SUBTYPE_PKEY_TABLE; - eqe.event.port_mgmt_change.port = port; + eqe.event.port_mgmt_change.port = mlx4_phys_to_slave_port(dev, slave, port); return mlx4_GEN_EQE(dev, slave, &eqe); } @@ -233,13 +270,13 @@ int mlx4_gen_guid_change_eqe(struct mlx4_dev *dev, int slave, u8 port) struct mlx4_eqe eqe; /*don't send if we don't have the that slave */ - if (dev->num_vfs < slave) + if (dev->persist->num_vfs < slave) return 0; memset(&eqe, 0, sizeof eqe); eqe.type = MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT; eqe.subtype = MLX4_DEV_PMC_SUBTYPE_GUID_INFO; - eqe.event.port_mgmt_change.port = port; + eqe.event.port_mgmt_change.port = mlx4_phys_to_slave_port(dev, slave, port); return mlx4_GEN_EQE(dev, slave, &eqe); } @@ -249,15 +286,16 @@ int mlx4_gen_port_state_change_eqe(struct mlx4_dev *dev, int slave, u8 port, u8 port_subtype_change) { struct mlx4_eqe eqe; + u8 slave_port = mlx4_phys_to_slave_port(dev, slave, port); /*don't send if we don't have the that slave */ - if (dev->num_vfs < slave) + if (dev->persist->num_vfs < slave) return 0; memset(&eqe, 0, sizeof eqe); eqe.type = MLX4_EVENT_TYPE_PORT_CHANGE; eqe.subtype = port_subtype_change; - eqe.event.port_change.port = cpu_to_be32(port << 28); + eqe.event.port_change.port = cpu_to_be32(slave_port << 28); mlx4_dbg(dev, "%s: sending: %d to slave: %d on port: %d\n", __func__, port_subtype_change, slave, port); @@ -269,7 +307,10 @@ enum slave_port_state mlx4_get_slave_port_state(struct mlx4_dev *dev, int slave, { struct mlx4_priv *priv = mlx4_priv(dev); struct mlx4_slave_state *s_state = priv->mfunc.master.slave_state; - if (slave >= dev->num_slaves || port > MLX4_MAX_PORTS) { + struct mlx4_active_ports actv_ports = mlx4_get_active_ports(dev, slave); + + if (slave >= dev->num_slaves || port > dev->caps.num_ports || + port <= 0 || !test_bit(port - 1, actv_ports.ports)) { pr_err("%s: Error: asking for slave:%d, port:%d\n", __func__, slave, port); return SLAVE_PORT_DOWN; @@ -283,8 +324,10 @@ static int mlx4_set_slave_port_state(struct mlx4_dev *dev, int slave, u8 port, { struct mlx4_priv *priv = mlx4_priv(dev); struct mlx4_slave_state *s_state = priv->mfunc.master.slave_state; + struct mlx4_active_ports actv_ports = mlx4_get_active_ports(dev, slave); - if (slave >= dev->num_slaves || port > MLX4_MAX_PORTS || port == 0) { + if (slave >= dev->num_slaves || port > dev->caps.num_ports || + port <= 0 || !test_bit(port - 1, actv_ports.ports)) { pr_err("%s: Error: asking for slave:%d, port:%d\n", __func__, slave, port); return -1; @@ -298,9 +341,13 @@ static void set_all_slave_state(struct mlx4_dev *dev, u8 port, int event) { int i; enum slave_port_gen_event gen_event; + struct mlx4_slaves_pport slaves_pport = mlx4_phys_to_slaves_pport(dev, + port); - for (i = 0; i < dev->num_slaves; i++) - set_and_calc_slave_port_state(dev, i, port, event, &gen_event); + for (i = 0; i < dev->persist->num_vfs + 1; i++) + if (test_bit(i, slaves_pport.slaves)) + set_and_calc_slave_port_state(dev, i, port, + event, &gen_event); } /************************************************************************** The function get as input the new event to that port, @@ -319,12 +366,14 @@ int set_and_calc_slave_port_state(struct mlx4_dev *dev, int slave, struct mlx4_slave_state *ctx = NULL; unsigned long flags; int ret = -1; + struct mlx4_active_ports actv_ports = mlx4_get_active_ports(dev, slave); enum slave_port_state cur_state = mlx4_get_slave_port_state(dev, slave, port); *gen_event = SLAVE_PORT_GEN_EVENT_NONE; - if (slave >= dev->num_slaves || port > MLX4_MAX_PORTS || port == 0) { + if (slave >= dev->num_slaves || port > dev->caps.num_ports || + port <= 0 || !test_bit(port - 1, actv_ports.ports)) { pr_err("%s: Error: asking for slave:%d, port:%d\n", __func__, slave, port); return ret; @@ -362,9 +411,9 @@ int set_and_calc_slave_port_state(struct mlx4_dev *dev, int slave, } break; default: - pr_err("%s: BUG!!! UNKNOWN state: " - "slave:%d, port:%d\n", __func__, slave, port); - goto out; + pr_err("%s: BUG!!! UNKNOWN state: slave:%d, port:%d\n", + __func__, slave, port); + goto out; } ret = mlx4_get_slave_port_state(dev, slave, port); @@ -375,7 +424,7 @@ int set_and_calc_slave_port_state(struct mlx4_dev *dev, int slave, EXPORT_SYMBOL(set_and_calc_slave_port_state); -int mlx4_gen_slaves_port_mgt_ev(struct mlx4_dev *dev, u8 port, int attr, u16 sm_lid, u8 sm_sl) +int mlx4_gen_slaves_port_mgt_ev(struct mlx4_dev *dev, u8 port, int attr) { struct mlx4_eqe eqe; @@ -386,12 +435,6 @@ int mlx4_gen_slaves_port_mgt_ev(struct mlx4_dev *dev, u8 port, int attr, u16 sm_ eqe.event.port_mgmt_change.port = port; eqe.event.port_mgmt_change.params.port_info.changed_attr = cpu_to_be32((u32) attr); - if (attr & MSTR_SM_CHANGE_MASK) { - eqe.event.port_mgmt_change.params.port_info.mstr_sm_lid = - cpu_to_be16(sm_lid); - eqe.event.port_mgmt_change.params.port_info.mstr_sm_sl = - sm_sl; - } slave_event(dev, ALL_SLAVES, &eqe); return 0; @@ -418,10 +461,16 @@ void mlx4_master_handle_slave_flr(struct work_struct *work) for (i = 0 ; i < dev->num_slaves; i++) { if (MLX4_COMM_CMD_FLR == slave_state[i].last_cmd) { - mlx4_dbg(dev, "mlx4_handle_slave_flr: " - "clean slave: %d\n", i); - - mlx4_delete_all_resources_for_slave(dev, i); + mlx4_dbg(dev, "mlx4_handle_slave_flr: clean slave: %d\n", + i); + /* In case of 'Reset flow' FLR can be generated for + * a slave before mlx4_load_one is done. + * make sure interface is up before trying to delete + * slave resources which weren't allocated yet. + */ + if (dev->persist->interface_state & + MLX4_INTERFACE_STATE_UP) + mlx4_delete_all_resources_for_slave(dev, i); /*return the slave to running mode*/ spin_lock_irqsave(&priv->mfunc.master.slave_state_lock, flags); slave_state[i].last_cmd = MLX4_COMM_CMD_RESET; @@ -431,8 +480,8 @@ void mlx4_master_handle_slave_flr(struct work_struct *work) err = mlx4_cmd(dev, 0, i, 0, MLX4_CMD_INFORM_FLR_DONE, MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED); if (err) - mlx4_warn(dev, "Failed to notify FW on " - "FLR done (slave:%d)\n", i); + mlx4_warn(dev, "Failed to notify FW on FLR done (slave:%d)\n", + i); } } } @@ -441,7 +490,7 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq) { struct mlx4_priv *priv = mlx4_priv(dev); struct mlx4_eqe *eqe; - int cqn; + int cqn = -1; int eqes_found = 0; int set_ci = 0; int port; @@ -453,8 +502,9 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq) enum slave_port_gen_event gen_event; unsigned long flags; struct mlx4_vport_state *s_info; + int eqe_size = dev->caps.eqe_size; - while ((eqe = next_eqe_sw(eq, dev->caps.eqe_factor))) { + while ((eqe = next_eqe_sw(eq, dev->caps.eqe_factor, eqe_size))) { /* * Make sure we read EQ entry contents after we've * checked the ownership bit. @@ -483,9 +533,7 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq) be32_to_cpu(eqe->event.qp.qpn) & 0xffffff, &slave); if (ret && ret != -ENOENT) { - mlx4_dbg(dev, "QP event %02x(%02x) on " - "EQ %d at index %u: could " - "not get slave id (%d)\n", + mlx4_dbg(dev, "QP event %02x(%02x) on EQ %d at index %u: could not get slave id (%d)\n", eqe->type, eqe->subtype, eq->eqn, eq->cons_index, ret); break; @@ -504,7 +552,6 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq) case MLX4_EVENT_TYPE_SRQ_LIMIT: mlx4_dbg(dev, "%s: MLX4_EVENT_TYPE_SRQ_LIMIT\n", __func__); - /* fall through */ case MLX4_EVENT_TYPE_SRQ_CATAS_ERROR: if (mlx4_is_master(dev)) { /* forward only to slave owning the SRQ */ @@ -514,22 +561,20 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq) & 0xffffff, &slave); if (ret && ret != -ENOENT) { - mlx4_warn(dev, "SRQ event %02x(%02x) " - "on EQ %d at index %u: could" - " not get slave id (%d)\n", + mlx4_warn(dev, "SRQ event %02x(%02x) on EQ %d at index %u: could not get slave id (%d)\n", eqe->type, eqe->subtype, eq->eqn, eq->cons_index, ret); break; } - mlx4_dbg(dev, "%s: slave:%d, srq_no:0x%x, event: %02x(%02x)\n", - __func__, slave, - be32_to_cpu(eqe->event.srq.srqn), - eqe->type, eqe->subtype); + mlx4_warn(dev, "%s: slave:%d, srq_no:0x%x, event: %02x(%02x)\n", + __func__, slave, + be32_to_cpu(eqe->event.srq.srqn), + eqe->type, eqe->subtype); if (!ret && slave != dev->caps.function) { - mlx4_dbg(dev, "%s: sending event %02x(%02x) to slave:%d\n", - __func__, eqe->type, - eqe->subtype, slave); + mlx4_warn(dev, "%s: sending event %02x(%02x) to slave:%d\n", + __func__, eqe->type, + eqe->subtype, slave); mlx4_slave_event(dev, slave, eqe); break; } @@ -545,24 +590,35 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq) be64_to_cpu(eqe->event.cmd.out_param)); break; - case MLX4_EVENT_TYPE_PORT_CHANGE: + case MLX4_EVENT_TYPE_PORT_CHANGE: { + struct mlx4_slaves_pport slaves_port; port = be32_to_cpu(eqe->event.port_change.port) >> 28; + slaves_port = mlx4_phys_to_slaves_pport(dev, port); if (eqe->subtype == MLX4_PORT_CHANGE_SUBTYPE_DOWN) { mlx4_dispatch_event(dev, MLX4_DEV_EVENT_PORT_DOWN, port); mlx4_priv(dev)->sense.do_sense_port[port] = 1; if (!mlx4_is_master(dev)) break; - for (i = 0; i < dev->num_slaves; i++) { + for (i = 0; i < dev->persist->num_vfs + 1; + i++) { + int reported_port = mlx4_is_bonded(dev) ? 1 : mlx4_phys_to_slave_port(dev, i, port); + + if (!test_bit(i, slaves_port.slaves) && !mlx4_is_bonded(dev)) + continue; if (dev->caps.port_type[port] == MLX4_PORT_TYPE_ETH) { if (i == mlx4_master_func_num(dev)) continue; - mlx4_dbg(dev, "%s: Sending MLX4_PORT_CHANGE_SUBTYPE_DOWN" - " to slave: %d, port:%d\n", + mlx4_dbg(dev, "%s: Sending MLX4_PORT_CHANGE_SUBTYPE_DOWN to slave: %d, port:%d\n", __func__, i, port); - s_info = &priv->mfunc.master.vf_oper[slave].vport[port].state; - if (IFLA_VF_LINK_STATE_AUTO == s_info->link_state) + s_info = &priv->mfunc.master.vf_oper[i].vport[port].state; + if (0 /*IFLA_VF_LINK_STATE_AUTO == s_info->link_state*/) { + eqe->event.port_change.port = + cpu_to_be32( + (be32_to_cpu(eqe->event.port_change.port) & 0xFFFFFFF) + | (reported_port << 28)); mlx4_slave_event(dev, i, eqe); + } } else { /* IB port */ set_and_calc_slave_port_state(dev, i, port, MLX4_PORT_STATE_DEV_EVENT_PORT_DOWN, @@ -571,6 +627,10 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq) if (SLAVE_PORT_GEN_EVENT_DOWN == gen_event) { if (i == mlx4_master_func_num(dev)) continue; + eqe->event.port_change.port = + cpu_to_be32( + (be32_to_cpu(eqe->event.port_change.port) & 0xFFFFFFF) + | (mlx4_phys_to_slave_port(dev, i, port) << 28)); mlx4_slave_event(dev, i, eqe); } } @@ -583,12 +643,23 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq) if (!mlx4_is_master(dev)) break; if (dev->caps.port_type[port] == MLX4_PORT_TYPE_ETH) - for (i = 0; i < dev->num_slaves; i++) { + for (i = 0; + i < dev->persist->num_vfs + 1; + i++) { + int reported_port = mlx4_is_bonded(dev) ? 1 : mlx4_phys_to_slave_port(dev, i, port); + + if (!test_bit(i, slaves_port.slaves) && !mlx4_is_bonded(dev)) + continue; if (i == mlx4_master_func_num(dev)) continue; - s_info = &priv->mfunc.master.vf_oper[slave].vport[port].state; - if (IFLA_VF_LINK_STATE_AUTO == s_info->link_state) + s_info = &priv->mfunc.master.vf_oper[i].vport[port].state; + if (0 /*IFLA_VF_LINK_STATE_AUTO == s_info->link_state*/) { + eqe->event.port_change.port = + cpu_to_be32( + (be32_to_cpu(eqe->event.port_change.port) & 0xFFFFFFF) + | (reported_port << 28)); mlx4_slave_event(dev, i, eqe); + } } else /* IB port */ /* port-up event will be sent to a slave when the @@ -597,6 +668,7 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq) set_all_slave_state(dev, port, MLX4_DEV_EVENT_PORT_UP); } break; + } case MLX4_EVENT_TYPE_CQ_ERROR: mlx4_warn(dev, "CQ %s on CQN %06x\n", @@ -609,11 +681,9 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq) be32_to_cpu(eqe->event.cq_err.cqn) & 0xffffff, &slave); if (ret && ret != -ENOENT) { - mlx4_dbg(dev, "CQ event %02x(%02x) on " - "EQ %d at index %u: could " - "not get slave id (%d)\n", - eqe->type, eqe->subtype, - eq->eqn, eq->cons_index, ret); + mlx4_dbg(dev, "CQ event %02x(%02x) on EQ %d at index %u: could not get slave id (%d)\n", + eqe->type, eqe->subtype, + eq->eqn, eq->cons_index, ret); break; } @@ -635,35 +705,27 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq) case MLX4_EVENT_TYPE_OP_REQUIRED: atomic_inc(&priv->opreq_count); /* FW commands can't be executed from interrupt context - working in deferred task */ + * working in deferred task + */ queue_work(mlx4_wq, &priv->opreq_task); break; case MLX4_EVENT_TYPE_COMM_CHANNEL: if (!mlx4_is_master(dev)) { - mlx4_warn(dev, "Received comm channel event " - "for non master device\n"); + mlx4_warn(dev, "Received comm channel event for non master device\n"); break; } - memcpy(&priv->mfunc.master.comm_arm_bit_vector, eqe->event.comm_channel_arm.bit_vec, sizeof eqe->event.comm_channel_arm.bit_vec); - - if (!queue_work(priv->mfunc.master.comm_wq, - &priv->mfunc.master.comm_work)) - mlx4_warn(dev, "Failed to queue comm channel work\n"); - - if (!queue_work(priv->mfunc.master.comm_wq, - &priv->mfunc.master.arm_comm_work)) - mlx4_warn(dev, "Failed to queue arm comm channel work\n"); + queue_work(priv->mfunc.master.comm_wq, + &priv->mfunc.master.comm_work); break; case MLX4_EVENT_TYPE_FLR_EVENT: flr_slave = be32_to_cpu(eqe->event.flr_event.slave_id); if (!mlx4_is_master(dev)) { - mlx4_warn(dev, "Non-master function received" - "FLR event\n"); + mlx4_warn(dev, "Non-master function received FLR event\n"); break; } @@ -684,6 +746,8 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq) priv->mfunc.master.slave_state[flr_slave].is_slave_going_down = 1; } spin_unlock_irqrestore(&priv->mfunc.master.slave_state_lock, flags); + mlx4_dispatch_event(dev, MLX4_DEV_EVENT_SLAVE_SHUTDOWN, + flr_slave); queue_work(priv->mfunc.master.comm_wq, &priv->mfunc.master.slave_flr_event_work); break; @@ -692,22 +756,17 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq) if (eqe->subtype == MLX4_FATAL_WARNING_SUBTYPE_WARMING) { if (mlx4_is_master(dev)) for (i = 0; i < dev->num_slaves; i++) { - mlx4_dbg(dev, "%s: Sending " - "MLX4_FATAL_WARNING_SUBTYPE_WARMING" - " to slave: %d\n", __func__, i); + mlx4_dbg(dev, "%s: Sending MLX4_FATAL_WARNING_SUBTYPE_WARMING to slave: %d\n", + __func__, i); if (i == dev->caps.function) continue; mlx4_slave_event(dev, i, eqe); } - mlx4_err(dev, "Temperature Threshold was reached! " - "Threshold: %d celsius degrees; " - "Current Temperature: %d\n", - be16_to_cpu(eqe->event.warming.warning_threshold), - be16_to_cpu(eqe->event.warming.current_temperature)); + mlx4_err(dev, "Temperature Threshold was reached! Threshold: %d celsius degrees; Current Temperature: %d\n", + be16_to_cpu(eqe->event.warming.warning_threshold), + be16_to_cpu(eqe->event.warming.current_temperature)); } else - mlx4_warn(dev, "Unhandled event FATAL WARNING (%02x), " - "subtype %02x on EQ %d at index %u. owner=%x, " - "nent=0x%x, slave=%x, ownership=%s\n", + mlx4_warn(dev, "Unhandled event FATAL WARNING (%02x), subtype %02x on EQ %d at index %u. owner=%x, nent=0x%x, slave=%x, ownership=%s\n", eqe->type, eqe->subtype, eq->eqn, eq->cons_index, eqe->owner, eq->nent, eqe->slave_id, @@ -731,9 +790,8 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq) mlx4_warn(dev, "Unsupported cable detected\n"); break; default: - mlx4_dbg(dev, "Unhandled recoverable error event " - "detected: %02x(%02x) on EQ %d at index %u. " - "owner=%x, nent=0x%x, ownership=%s\n", + mlx4_dbg(dev, + "Unhandled recoverable error event detected: %02x(%02x) on EQ %d at index %u. owner=%x, nent=0x%x, ownership=%s\n", eqe->type, eqe->subtype, eq->eqn, eq->cons_index, eqe->owner, eq->nent, !!(eqe->owner & 0x80) ^ @@ -745,9 +803,7 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq) case MLX4_EVENT_TYPE_EEC_CATAS_ERROR: case MLX4_EVENT_TYPE_ECC_DETECT: default: - mlx4_warn(dev, "Unhandled event %02x(%02x) on EQ %d at " - "index %u. owner=%x, nent=0x%x, slave=%x, " - "ownership=%s\n", + mlx4_warn(dev, "Unhandled event %02x(%02x) on EQ %d at index %u. owner=%x, nent=0x%x, slave=%x, ownership=%s\n", eqe->type, eqe->subtype, eq->eqn, eq->cons_index, eqe->owner, eq->nent, eqe->slave_id, @@ -847,12 +903,10 @@ static int mlx4_SW2HW_EQ(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox, MLX4_CMD_WRAPPED); } -static int mlx4_HW2SW_EQ(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox, - int eq_num) +static int mlx4_HW2SW_EQ(struct mlx4_dev *dev, int eq_num) { - return mlx4_cmd_box(dev, 0, mailbox->dma, eq_num, - 0, MLX4_CMD_HW2SW_EQ, MLX4_CMD_TIME_CLASS_A, - MLX4_CMD_WRAPPED); + return mlx4_cmd(dev, 0, eq_num, 1, MLX4_CMD_HW2SW_EQ, + MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED); } static int mlx4_num_eq_uar(struct mlx4_dev *dev) @@ -862,8 +916,8 @@ static int mlx4_num_eq_uar(struct mlx4_dev *dev) * we need to map, take the difference of highest index and * the lowest index we'll use and add 1. */ - return (dev->caps.num_comp_vectors + 1 + dev->caps.reserved_eqs + - dev->caps.comp_pool)/4 - dev->caps.reserved_eqs/4 + 1; + return (dev->caps.num_comp_vectors + 1 + dev->caps.reserved_eqs) / 4 - + dev->caps.reserved_eqs / 4 + 1; } static void __iomem *mlx4_get_eq_uar(struct mlx4_dev *dev, struct mlx4_eq *eq) @@ -875,9 +929,9 @@ static void __iomem *mlx4_get_eq_uar(struct mlx4_dev *dev, struct mlx4_eq *eq) if (!priv->eq_table.uar_map[index]) { priv->eq_table.uar_map[index] = - ioremap(pci_resource_start(dev->pdev, 2) + - ((eq->eqn / 4) << PAGE_SHIFT), - PAGE_SIZE); + ioremap(pci_resource_start(dev->persist->pdev, 2) + + ((eq->eqn / 4) << (dev->uar_page_shift)), + (1 << (dev->uar_page_shift))); if (!priv->eq_table.uar_map[index]) { mlx4_err(dev, "Couldn't map EQ doorbell for EQN 0x%06x\n", eq->eqn); @@ -915,8 +969,10 @@ static int mlx4_create_eq(struct mlx4_dev *dev, int nent, eq->dev = dev; eq->nent = roundup_pow_of_two(max(nent, 2)); - /* CX3 is capable of extending the CQE\EQE from 32 to 64 bytes */ - npages = PAGE_ALIGN(eq->nent * (MLX4_EQ_ENTRY_SIZE << dev->caps.eqe_factor)) / PAGE_SIZE; + /* CX3 is capable of extending the CQE/EQE from 32 to 64 bytes, with + * strides of 64B,128B and 256B. + */ + npages = PAGE_ALIGN(eq->nent * dev->caps.eqe_size) / PAGE_SIZE; eq->page_list = kmalloc(npages * sizeof *eq->page_list, GFP_KERNEL); @@ -936,8 +992,10 @@ static int mlx4_create_eq(struct mlx4_dev *dev, int nent, eq_context = mailbox->buf; for (i = 0; i < npages; ++i) { - eq->page_list[i].buf = dma_alloc_coherent(&dev->pdev->dev, - PAGE_SIZE, &t, GFP_KERNEL); + eq->page_list[i].buf = dma_alloc_coherent(&dev->persist-> + pdev->dev, + PAGE_SIZE, &t, + GFP_KERNEL); if (!eq->page_list[i].buf) goto err_out_free_pages; @@ -965,7 +1023,6 @@ static int mlx4_create_eq(struct mlx4_dev *dev, int nent, if (err) goto err_out_free_mtt; - memset(eq_context, 0, sizeof *eq_context); eq_context->flags = cpu_to_be32(MLX4_EQ_STATUS_OK | MLX4_EQ_STATE_ARMED); eq_context->log_eq_size = ilog2(eq->nent); @@ -998,7 +1055,7 @@ static int mlx4_create_eq(struct mlx4_dev *dev, int nent, err_out_free_pages: for (i = 0; i < npages; ++i) if (eq->page_list[i].buf) - dma_free_coherent(&dev->pdev->dev, PAGE_SIZE, + dma_free_coherent(&dev->persist->pdev->dev, PAGE_SIZE, eq->page_list[i].buf, eq->page_list[i].map); @@ -1016,71 +1073,44 @@ static void mlx4_free_eq(struct mlx4_dev *dev, struct mlx4_eq *eq) { struct mlx4_priv *priv = mlx4_priv(dev); - struct mlx4_cmd_mailbox *mailbox; int err; int i; - /* CX3 is capable of extending the CQE\EQE from 32 to 64 bytes */ - int npages = PAGE_ALIGN((MLX4_EQ_ENTRY_SIZE << dev->caps.eqe_factor) * eq->nent) / PAGE_SIZE; + /* CX3 is capable of extending the CQE/EQE from 32 to 64 bytes, with + * strides of 64B,128B and 256B + */ + int npages = PAGE_ALIGN(dev->caps.eqe_size * eq->nent) / PAGE_SIZE; - mailbox = mlx4_alloc_cmd_mailbox(dev); - if (IS_ERR(mailbox)) - return; - - err = mlx4_HW2SW_EQ(dev, mailbox, eq->eqn); + err = mlx4_HW2SW_EQ(dev, eq->eqn); if (err) mlx4_warn(dev, "HW2SW_EQ failed (%d)\n", err); - if (0) { - mlx4_dbg(dev, "Dumping EQ context %02x:\n", eq->eqn); - for (i = 0; i < sizeof (struct mlx4_eq_context) / 4; ++i) { - if (i % 4 == 0) - pr_cont("[%02x] ", i * 4); - pr_cont(" %08x", be32_to_cpup(mailbox->buf + i * 4)); - if ((i + 1) % 4 == 0) - pr_cont("\n"); - } - } + synchronize_irq(eq->irq); mlx4_mtt_cleanup(dev, &eq->mtt); for (i = 0; i < npages; ++i) - dma_free_coherent(&dev->pdev->dev, PAGE_SIZE, - eq->page_list[i].buf, - eq->page_list[i].map); + dma_free_coherent(&dev->persist->pdev->dev, PAGE_SIZE, + eq->page_list[i].buf, + eq->page_list[i].map); kfree(eq->page_list); mlx4_bitmap_free(&priv->eq_table.bitmap, eq->eqn, MLX4_USE_RR); - mlx4_free_cmd_mailbox(dev, mailbox); } static void mlx4_free_irqs(struct mlx4_dev *dev) { struct mlx4_eq_table *eq_table = &mlx4_priv(dev)->eq_table; - struct mlx4_priv *priv = mlx4_priv(dev); - int i, vec; + int i; if (eq_table->have_irq) - free_irq(dev->pdev->irq, dev); + free_irq(dev->persist->pdev->irq, dev); for (i = 0; i < dev->caps.num_comp_vectors + 1; ++i) if (eq_table->eq[i].have_irq) { + eq_table->eq[i].affinity_cpu_id = NOCPU; free_irq(eq_table->eq[i].irq, eq_table->eq + i); eq_table->eq[i].have_irq = 0; } - for (i = 0; i < dev->caps.comp_pool; i++) { - /* - * Freeing the assigned irq's - * all bits should be 0, but we need to validate - */ - if (priv->msix_ctl.pool_bm & 1ULL << i) { - /* NO need protecting*/ - vec = dev->caps.num_comp_vectors + 1 + i; - free_irq(priv->eq_table.eq[vec].irq, - &priv->eq_table.eq[vec]); - } - } - - kfree(eq_table->irq_names); } @@ -1088,10 +1118,11 @@ static int mlx4_map_clr_int(struct mlx4_dev *dev) { struct mlx4_priv *priv = mlx4_priv(dev); - priv->clr_base = ioremap(pci_resource_start(dev->pdev, priv->fw.clr_int_bar) + + priv->clr_base = ioremap(pci_resource_start(dev->persist->pdev, + priv->fw.clr_int_bar) + priv->fw.clr_int_base, MLX4_CLR_INT_SIZE); if (!priv->clr_base) { - mlx4_err(dev, "Couldn't map interrupt clear register, aborting.\n"); + mlx4_err(dev, "Couldn't map interrupt clear register, aborting\n"); return -ENOMEM; } @@ -1137,11 +1168,11 @@ int mlx4_init_eq_table(struct mlx4_dev *dev) } err = mlx4_bitmap_init(&priv->eq_table.bitmap, - roundup_pow_of_two(dev->caps.num_eqs), - dev->caps.num_eqs - 1, - dev->caps.reserved_eqs, - roundup_pow_of_two(dev->caps.num_eqs) - - dev->caps.num_eqs); + roundup_pow_of_two(dev->caps.num_eqs), + dev->caps.num_eqs - 1, + dev->caps.reserved_eqs, + roundup_pow_of_two(dev->caps.num_eqs) - + dev->caps.num_eqs); if (err) goto err_out_free; @@ -1160,109 +1191,107 @@ int mlx4_init_eq_table(struct mlx4_dev *dev) } priv->eq_table.irq_names = - kmalloc(MLX4_IRQNAME_SIZE * (dev->caps.num_comp_vectors + 1 + - dev->caps.comp_pool), + kmalloc(MLX4_IRQNAME_SIZE * (dev->caps.num_comp_vectors + 1), GFP_KERNEL); if (!priv->eq_table.irq_names) { err = -ENOMEM; goto err_out_clr_int; } - for (i = 0; i < dev->caps.num_comp_vectors; ++i) { - err = mlx4_create_eq(dev, dev->quotas.cq + - MLX4_NUM_SPARE_EQE, - (dev->flags & MLX4_FLAG_MSI_X) ? i : 0, - &priv->eq_table.eq[i]); - if (err) { - --i; - goto err_out_unmap; + for (i = 0; i < dev->caps.num_comp_vectors + 1; ++i) { + if (i == MLX4_EQ_ASYNC) { + err = mlx4_create_eq(dev, + MLX4_NUM_ASYNC_EQE + MLX4_NUM_SPARE_EQE, + 0, &priv->eq_table.eq[MLX4_EQ_ASYNC]); + } else { + struct mlx4_eq *eq = &priv->eq_table.eq[i]; +#ifdef CONFIG_RFS_ACCEL + int port = find_first_bit(eq->actv_ports.ports, + dev->caps.num_ports) + 1; + + if (port <= dev->caps.num_ports) { + struct mlx4_port_info *info = + &mlx4_priv(dev)->port[port]; + + if (!info->rmap) { + info->rmap = alloc_irq_cpu_rmap( + mlx4_get_eqs_per_port(dev, port)); + if (!info->rmap) { + mlx4_warn(dev, "Failed to allocate cpu rmap\n"); + err = -ENOMEM; + goto err_out_unmap; + } + } + + err = irq_cpu_rmap_add( + info->rmap, eq->irq); + if (err) + mlx4_warn(dev, "Failed adding irq rmap\n"); + } +#endif + err = mlx4_create_eq(dev, dev->quotas.cq + + MLX4_NUM_SPARE_EQE, + (dev->flags & MLX4_FLAG_MSI_X) ? + i + 1 - !!(i > MLX4_EQ_ASYNC) : 0, + eq); } - } - - err = mlx4_create_eq(dev, MLX4_NUM_ASYNC_EQE + MLX4_NUM_SPARE_EQE, - (dev->flags & MLX4_FLAG_MSI_X) ? dev->caps.num_comp_vectors : 0, - &priv->eq_table.eq[dev->caps.num_comp_vectors]); - if (err) - goto err_out_comp; - - /*if additional completion vectors poolsize is 0 this loop will not run*/ - for (i = dev->caps.num_comp_vectors + 1; - i < dev->caps.num_comp_vectors + dev->caps.comp_pool + 1; ++i) { - - err = mlx4_create_eq(dev, dev->quotas.cq + - MLX4_NUM_SPARE_EQE, - (dev->flags & MLX4_FLAG_MSI_X) ? i : 0, - &priv->eq_table.eq[i]); - if (err) { - --i; + if (err) goto err_out_unmap; - } } - if (dev->flags & MLX4_FLAG_MSI_X) { const char *eq_name; - for (i = 0; i < dev->caps.num_comp_vectors + 1; ++i) { - if (i < dev->caps.num_comp_vectors) { - snprintf(priv->eq_table.irq_names + - i * MLX4_IRQNAME_SIZE, - MLX4_IRQNAME_SIZE, - "mlx4-comp-%d@pci:%s", i, - pci_name(dev->pdev)); - } else { - snprintf(priv->eq_table.irq_names + - i * MLX4_IRQNAME_SIZE, - MLX4_IRQNAME_SIZE, - "mlx4-async@pci:%s", - pci_name(dev->pdev)); - } + snprintf(priv->eq_table.irq_names + + MLX4_EQ_ASYNC * MLX4_IRQNAME_SIZE, + MLX4_IRQNAME_SIZE, + "mlx4-async@pci:%s", + pci_name(dev->persist->pdev)); + eq_name = priv->eq_table.irq_names + + MLX4_EQ_ASYNC * MLX4_IRQNAME_SIZE; - eq_name = priv->eq_table.irq_names + - i * MLX4_IRQNAME_SIZE; - err = request_irq(priv->eq_table.eq[i].irq, - mlx4_msi_x_interrupt, 0, eq_name, - priv->eq_table.eq + i); - if (err) - goto err_out_async; + err = request_irq(priv->eq_table.eq[MLX4_EQ_ASYNC].irq, + mlx4_msi_x_interrupt, 0, eq_name, + priv->eq_table.eq + MLX4_EQ_ASYNC); + if (err) + goto err_out_unmap; - priv->eq_table.eq[i].have_irq = 1; - } + priv->eq_table.eq[MLX4_EQ_ASYNC].have_irq = 1; } else { snprintf(priv->eq_table.irq_names, MLX4_IRQNAME_SIZE, DRV_NAME "@pci:%s", - pci_name(dev->pdev)); - err = request_irq(dev->pdev->irq, mlx4_interrupt, + pci_name(dev->persist->pdev)); + err = request_irq(dev->persist->pdev->irq, mlx4_interrupt, IRQF_SHARED, priv->eq_table.irq_names, dev); if (err) - goto err_out_async; + goto err_out_unmap; priv->eq_table.have_irq = 1; } err = mlx4_MAP_EQ(dev, get_async_ev_mask(dev), 0, - priv->eq_table.eq[dev->caps.num_comp_vectors].eqn); + priv->eq_table.eq[MLX4_EQ_ASYNC].eqn); if (err) mlx4_warn(dev, "MAP_EQ for async EQ %d failed (%d)\n", - priv->eq_table.eq[dev->caps.num_comp_vectors].eqn, err); + priv->eq_table.eq[MLX4_EQ_ASYNC].eqn, err); - for (i = 0; i < dev->caps.num_comp_vectors + 1; ++i) - eq_set_ci(&priv->eq_table.eq[i], 1); + /* arm ASYNC eq */ + eq_set_ci(&priv->eq_table.eq[MLX4_EQ_ASYNC], 1); return 0; -err_out_async: - mlx4_free_eq(dev, &priv->eq_table.eq[dev->caps.num_comp_vectors]); - -err_out_comp: - i = dev->caps.num_comp_vectors - 1; - err_out_unmap: - while (i >= 0) { - mlx4_free_eq(dev, &priv->eq_table.eq[i]); - --i; + while (i > 0) + mlx4_free_eq(dev, &priv->eq_table.eq[--i]); +#ifdef CONFIG_RFS_ACCEL + for (i = 1; i <= dev->caps.num_ports; i++) { + if (mlx4_priv(dev)->port[i].rmap) { + free_irq_cpu_rmap(mlx4_priv(dev)->port[i].rmap); + mlx4_priv(dev)->port[i].rmap = NULL; + } } +#endif mlx4_free_irqs(dev); err_out_clr_int: @@ -1285,11 +1314,19 @@ void mlx4_cleanup_eq_table(struct mlx4_dev *dev) int i; mlx4_MAP_EQ(dev, get_async_ev_mask(dev), 1, - priv->eq_table.eq[dev->caps.num_comp_vectors].eqn); + priv->eq_table.eq[MLX4_EQ_ASYNC].eqn); +#ifdef CONFIG_RFS_ACCEL + for (i = 1; i <= dev->caps.num_ports; i++) { + if (mlx4_priv(dev)->port[i].rmap) { + free_irq_cpu_rmap(mlx4_priv(dev)->port[i].rmap); + mlx4_priv(dev)->port[i].rmap = NULL; + } + } +#endif mlx4_free_irqs(dev); - for (i = 0; i < dev->caps.num_comp_vectors + dev->caps.comp_pool + 1; ++i) + for (i = 0; i < dev->caps.num_comp_vectors + 1; ++i) mlx4_free_eq(dev, &priv->eq_table.eq[i]); if (!mlx4_is_slave(dev)) @@ -1301,108 +1338,200 @@ void mlx4_cleanup_eq_table(struct mlx4_dev *dev) kfree(priv->eq_table.uar_map); } -/* A test that verifies that we can accept interrupts on all - * the irq vectors of the device. +/* A test that verifies that we can accept interrupts + * on the vector allocated for asynchronous events + */ +int mlx4_test_async(struct mlx4_dev *dev) +{ + return mlx4_NOP(dev); +} +EXPORT_SYMBOL(mlx4_test_async); + +/* A test that verifies that we can accept interrupts + * on the given irq vector of the tested port. * Interrupts are checked using the NOP command. */ -int mlx4_test_interrupts(struct mlx4_dev *dev) +int mlx4_test_interrupt(struct mlx4_dev *dev, int vector) { struct mlx4_priv *priv = mlx4_priv(dev); - int i; int err; - err = mlx4_NOP(dev); - /* When not in MSI_X, there is only one irq to check */ - if (!(dev->flags & MLX4_FLAG_MSI_X) || mlx4_is_slave(dev)) - return err; + /* Temporary use polling for command completions */ + mlx4_cmd_use_polling(dev); - /* A loop over all completion vectors, for each vector we will check - * whether it works by mapping command completions to that vector - * and performing a NOP command - */ - for(i = 0; !err && (i < dev->caps.num_comp_vectors); ++i) { - /* Temporary use polling for command completions */ - mlx4_cmd_use_polling(dev); - - /* Map the new eq to handle all asyncronous events */ - err = mlx4_MAP_EQ(dev, get_async_ev_mask(dev), 0, - priv->eq_table.eq[i].eqn); - if (err) { - mlx4_warn(dev, "Failed mapping eq for interrupt test\n"); - mlx4_cmd_use_events(dev); - break; - } - - /* Go back to using events */ - mlx4_cmd_use_events(dev); - err = mlx4_NOP(dev); + /* Map the new eq to handle all asynchronous events */ + err = mlx4_MAP_EQ(dev, get_async_ev_mask(dev), 0, + priv->eq_table.eq[MLX4_CQ_TO_EQ_VECTOR(vector)].eqn); + if (err) { + mlx4_warn(dev, "Failed mapping eq for interrupt test\n"); + goto out; } + /* Go back to using events */ + mlx4_cmd_use_events(dev); + err = mlx4_NOP(dev); + /* Return to default */ + mlx4_cmd_use_polling(dev); +out: mlx4_MAP_EQ(dev, get_async_ev_mask(dev), 0, - priv->eq_table.eq[dev->caps.num_comp_vectors].eqn); + priv->eq_table.eq[MLX4_EQ_ASYNC].eqn); + mlx4_cmd_use_events(dev); + return err; } -EXPORT_SYMBOL(mlx4_test_interrupts); +EXPORT_SYMBOL(mlx4_test_interrupt); -int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector) +bool mlx4_is_eq_vector_valid(struct mlx4_dev *dev, u8 port, int vector) { - struct mlx4_priv *priv = mlx4_priv(dev); - int vec = 0, err = 0, i; + + vector = MLX4_CQ_TO_EQ_VECTOR(vector); + if (vector < 0 || (vector >= dev->caps.num_comp_vectors + 1) || + (vector == MLX4_EQ_ASYNC)) + return false; + + return test_bit(port - 1, priv->eq_table.eq[vector].actv_ports.ports); +} +EXPORT_SYMBOL(mlx4_is_eq_vector_valid); + +u32 mlx4_get_eqs_per_port(struct mlx4_dev *dev, u8 port) +{ + struct mlx4_priv *priv = mlx4_priv(dev); + unsigned int i; + unsigned int sum = 0; + + for (i = 0; i < dev->caps.num_comp_vectors + 1; i++) + sum += !!test_bit(port - 1, + priv->eq_table.eq[i].actv_ports.ports); + + return sum; +} +EXPORT_SYMBOL(mlx4_get_eqs_per_port); + +int mlx4_is_eq_shared(struct mlx4_dev *dev, int vector) +{ + struct mlx4_priv *priv = mlx4_priv(dev); + + vector = MLX4_CQ_TO_EQ_VECTOR(vector); + if (vector <= 0 || (vector >= dev->caps.num_comp_vectors + 1)) + return -EINVAL; + + return !!(bitmap_weight(priv->eq_table.eq[vector].actv_ports.ports, + dev->caps.num_ports) > 1); +} +EXPORT_SYMBOL(mlx4_is_eq_shared); + +int mlx4_assign_eq(struct mlx4_dev *dev, u8 port, int *vector) +{ + struct mlx4_priv *priv = mlx4_priv(dev); + int err = 0, i = 0; + u32 min_ref_count_val = (u32)-1; + int requested_vector = MLX4_CQ_TO_EQ_VECTOR(*vector); + int *prequested_vector = NULL; + mutex_lock(&priv->msix_ctl.pool_lock); - for (i = 0; !vec && i < dev->caps.comp_pool; i++) { - if (~priv->msix_ctl.pool_bm & 1ULL << i) { - priv->msix_ctl.pool_bm |= 1ULL << i; - vec = dev->caps.num_comp_vectors + 1 + i; - snprintf(priv->eq_table.irq_names + - vec * MLX4_IRQNAME_SIZE, - MLX4_IRQNAME_SIZE, "%s", name); - err = request_irq(priv->eq_table.eq[vec].irq, - mlx4_msi_x_interrupt, 0, - &priv->eq_table.irq_names[vec<<5], - priv->eq_table.eq + vec); - if (err) { - /*zero out bit by fliping it*/ - priv->msix_ctl.pool_bm ^= 1 << i; - vec = 0; - continue; - /*we dont want to break here*/ + if (requested_vector < (dev->caps.num_comp_vectors + 1) && + (requested_vector >= 0) && + (requested_vector != MLX4_EQ_ASYNC)) { + if (test_bit(port - 1, + priv->eq_table.eq[requested_vector].actv_ports.ports)) { + prequested_vector = &requested_vector; + } else { + struct mlx4_eq *eq; + + for (i = 1; i < port; + requested_vector += mlx4_get_eqs_per_port(dev, i++)) + ; + + eq = &priv->eq_table.eq[requested_vector]; + if (requested_vector < dev->caps.num_comp_vectors + 1 && + test_bit(port - 1, eq->actv_ports.ports)) { + prequested_vector = &requested_vector; } - eq_set_ci(&priv->eq_table.eq[vec], 1); } } + + if (!prequested_vector) { + requested_vector = -1; + for (i = 0; min_ref_count_val && i < dev->caps.num_comp_vectors + 1; + i++) { + struct mlx4_eq *eq = &priv->eq_table.eq[i]; + + if (min_ref_count_val > eq->ref_count && + test_bit(port - 1, eq->actv_ports.ports)) { + min_ref_count_val = eq->ref_count; + requested_vector = i; + } + } + + if (requested_vector < 0) { + err = -ENOSPC; + goto err_unlock; + } + + prequested_vector = &requested_vector; + } + + if (!test_bit(*prequested_vector, priv->msix_ctl.pool_bm) && + dev->flags & MLX4_FLAG_MSI_X) { + set_bit(*prequested_vector, priv->msix_ctl.pool_bm); + snprintf(priv->eq_table.irq_names + + *prequested_vector * MLX4_IRQNAME_SIZE, + MLX4_IRQNAME_SIZE, "mlx4-%d@%s", + *prequested_vector, dev_name(&dev->persist->pdev->dev)); + + err = request_irq(priv->eq_table.eq[*prequested_vector].irq, + mlx4_msi_x_interrupt, 0, + &priv->eq_table.irq_names[*prequested_vector << 5], + priv->eq_table.eq + *prequested_vector); + + if (err) { + clear_bit(*prequested_vector, priv->msix_ctl.pool_bm); + *prequested_vector = -1; + } else { + mlx4_set_eq_affinity_hint(priv, *prequested_vector); + eq_set_ci(&priv->eq_table.eq[*prequested_vector], 1); + priv->eq_table.eq[*prequested_vector].have_irq = 1; + } + } + + if (!err && *prequested_vector >= 0) + priv->eq_table.eq[*prequested_vector].ref_count++; + +err_unlock: mutex_unlock(&priv->msix_ctl.pool_lock); - if (vec) { - *vector = vec; - } else { + if (!err && *prequested_vector >= 0) + *vector = MLX4_EQ_TO_CQ_VECTOR(*prequested_vector); + else *vector = 0; - err = (i == dev->caps.comp_pool) ? -ENOSPC : err; - } + return err; } EXPORT_SYMBOL(mlx4_assign_eq); +int mlx4_eq_get_irq(struct mlx4_dev *dev, int cq_vec) +{ + struct mlx4_priv *priv = mlx4_priv(dev); + + return priv->eq_table.eq[MLX4_CQ_TO_EQ_VECTOR(cq_vec)].irq; +} +EXPORT_SYMBOL(mlx4_eq_get_irq); + void mlx4_release_eq(struct mlx4_dev *dev, int vec) { struct mlx4_priv *priv = mlx4_priv(dev); - /*bm index*/ - int i = vec - dev->caps.num_comp_vectors - 1; + int eq_vec = MLX4_CQ_TO_EQ_VECTOR(vec); - if (likely(i >= 0)) { - /*sanity check , making sure were not trying to free irq's - Belonging to a legacy EQ*/ - mutex_lock(&priv->msix_ctl.pool_lock); - if (priv->msix_ctl.pool_bm & 1ULL << i) { - free_irq(priv->eq_table.eq[vec].irq, - &priv->eq_table.eq[vec]); - priv->msix_ctl.pool_bm &= ~(1ULL << i); - } - mutex_unlock(&priv->msix_ctl.pool_lock); - } + mutex_lock(&priv->msix_ctl.pool_lock); + priv->eq_table.eq[eq_vec].ref_count--; + /* once we allocated EQ, we don't release it because it might be binded + * to cpu_rmap. + */ + mutex_unlock(&priv->msix_ctl.pool_lock); } EXPORT_SYMBOL(mlx4_release_eq); diff --git a/sys/dev/mlx4/mlx4_core/mlx4_fw.c b/sys/dev/mlx4/mlx4_core/mlx4_fw.c index 5d137d1637f4..edd76e924e2b 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_fw.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_fw.c @@ -39,6 +39,8 @@ #include #include +#include + #include "fw.h" #include "icm.h" @@ -51,18 +53,21 @@ enum { extern void __buggy_use_of_MLX4_GET(void); extern void __buggy_use_of_MLX4_PUT(void); -static u8 enable_qos; -module_param(enable_qos, byte, 0444); -MODULE_PARM_DESC(enable_qos, "Enable Quality of Service support in the HCA (default: off)"); +static bool enable_qos; +module_param(enable_qos, bool, 0444); +MODULE_PARM_DESC(enable_qos, "Enable Enhanced QoS support (default: off)"); #define MLX4_GET(dest, source, offset) \ do { \ void *__p = (char *) (source) + (offset); \ + typedef struct { u64 value; } __packed u64_p_t; \ + u64 val; \ switch (sizeof (dest)) { \ case 1: (dest) = *(u8 *) __p; break; \ case 2: (dest) = be16_to_cpup(__p); break; \ case 4: (dest) = be32_to_cpup(__p); break; \ - case 8: (dest) = be64_to_cpup(__p); break; \ + case 8: val = ((u64_p_t *)__p)->value; \ + (dest) = be64_to_cpu(val); break; \ default: __buggy_use_of_MLX4_GET(); \ } \ } while (0) @@ -86,14 +91,11 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags) [ 1] = "UC transport", [ 2] = "UD transport", [ 3] = "XRC transport", - [ 4] = "reliable multicast", - [ 5] = "FCoIB support", [ 6] = "SRQ support", [ 7] = "IPoIB checksum offload", [ 8] = "P_Key violation counter", [ 9] = "Q_Key violation counter", - [10] = "VMM", - [12] = "DPDP", + [12] = "Dual Port Different Protocol (DPDP) support", [15] = "Big LSO headers", [16] = "MW support", [17] = "APM support", @@ -101,19 +103,19 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags) [19] = "Raw multicast support", [20] = "Address vector port checking support", [21] = "UD multicast support", - [24] = "Demand paging support", - [25] = "Router support", [30] = "IBoE support", [32] = "Unicast loopback support", [34] = "FCS header control", - [38] = "Wake On LAN support", + [37] = "Wake On LAN (port1) support", + [38] = "Wake On LAN (port2) support", [40] = "UDP RSS support", [41] = "Unicast VEP steering support", [42] = "Multicast VEP steering support", - [44] = "Cross-channel (sync_qp) operations support", [48] = "Counters support", + [52] = "RSS IP fragments support", + [53] = "Port ETS Scheduler support", + [55] = "Port link type sensing support", [59] = "Port management change event support", - [60] = "eSwitch support", [61] = "64 byte EQE support", [62] = "64 byte CQE support", }; @@ -131,18 +133,39 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags) [0] = "RSS support", [1] = "RSS Toeplitz Hash Function support", [2] = "RSS XOR Hash Function support", - [3] = "Device manage flow steering support", - [4] = "FSM (MAC unti-spoofing) support", - [5] = "VST (control vlan insertion/stripping) support", - [6] = "Dynamic QP updates support", - [7] = "Loopback source checks support", - [8] = "Device managed flow steering IPoIB support", - [9] = "ETS configuration support", - [10] = "ETH backplane autoneg report", - [11] = "Ethernet Flow control statistics support", - [12] = "Recoverable error events support", - [13] = "Time stamping support", - [14] = "Report driver version to FW support" + [3] = "Device managed flow steering support", + [4] = "Automatic MAC reassignment support", + [5] = "Time stamping support", + [6] = "VST (control vlan insertion/stripping) support", + [7] = "FSM (MAC anti-spoofing) support", + [8] = "Dynamic QP updates support", + [9] = "Device managed flow steering IPoIB support", + [10] = "TCP/IP offloads/flow-steering for VXLAN support", + [11] = "MAD DEMUX (Secure-Host) support", + [12] = "Large cache line (>64B) CQE stride support", + [13] = "Large cache line (>64B) EQE stride support", + [14] = "Ethernet protocol control support", + [15] = "Ethernet Backplane autoneg support", + [16] = "CONFIG DEV support", + [17] = "Asymmetric EQs support", + [18] = "More than 80 VFs support", + [19] = "Performance optimized for limited rule configuration flow steering support", + [20] = "Recoverable error events support", + [21] = "Port Remap support", + [22] = "QCN support", + [23] = "QP rate limiting support", + [24] = "Ethernet Flow control statistics support", + [25] = "Granular QoS per VF support", + [26] = "Port ETS Scheduler support", + [27] = "Port beacon support", + [28] = "RX-ALL support", + [29] = "802.1ad offload support", + [31] = "Modifying loopback source checks using UPDATE_QP support", + [32] = "Loopback source checks support", + [33] = "RoCEv2 support", + [34] = "DMFS Sniffer support (UC & MC)", + [35] = "QinQ VST mode support", + [36] = "sl to vl mapping table change event support" }; int i; @@ -167,8 +190,6 @@ int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg) return PTR_ERR(mailbox); inbox = mailbox->buf; - memset(inbox, 0, MOD_STAT_CFG_IN_SIZE); - MLX4_PUT(inbox, cfg->log_pg_sz, MOD_STAT_CFG_PG_SZ_OFFSET); MLX4_PUT(inbox, cfg->log_pg_sz_m, MOD_STAT_CFG_PG_SZ_M_OFFSET); @@ -204,11 +225,11 @@ int mlx4_QUERY_FUNC(struct mlx4_dev *dev, struct mlx4_func *func, int slave) in_modifier = slave; err = mlx4_cmd_box(dev, 0, mailbox->dma, in_modifier, 0, - MLX4_CMD_QUERY_FUNC, - MLX4_CMD_TIME_CLASS_A, - MLX4_CMD_NATIVE); + MLX4_CMD_QUERY_FUNC, + MLX4_CMD_TIME_CLASS_A, + MLX4_CMD_NATIVE); if (err) - goto out; + goto out; MLX4_GET(field, outbox, QUERY_FUNC_BUS_OFFSET); func->bus = field & 0xf; @@ -226,13 +247,80 @@ int mlx4_QUERY_FUNC(struct mlx4_dev *dev, struct mlx4_func *func, int slave) func->rsvd_uars = field & 0x0f; mlx4_dbg(dev, "Bus: %d, Device: %d, Function: %d, Physical function: %d, Max EQs: %d, Reserved EQs: %d, Reserved UARs: %d\n", - func->bus, func->device, func->function, func->physical_function, - func->max_eq, func->rsvd_eqs, func->rsvd_uars); + func->bus, func->device, func->function, func->physical_function, + func->max_eq, func->rsvd_eqs, func->rsvd_uars); + out: mlx4_free_cmd_mailbox(dev, mailbox); return err; } +static int mlx4_activate_vst_qinq(struct mlx4_priv *priv, int slave, int port) +{ + struct mlx4_vport_oper_state *vp_oper; + struct mlx4_vport_state *vp_admin; + int err; + + vp_oper = &priv->mfunc.master.vf_oper[slave].vport[port]; + vp_admin = &priv->mfunc.master.vf_admin[slave].vport[port]; + + if (vp_admin->default_vlan != vp_oper->state.default_vlan) { + err = __mlx4_register_vlan(&priv->dev, port, + vp_admin->default_vlan, + &vp_oper->vlan_idx); + if (err) { + vp_oper->vlan_idx = NO_INDX; + mlx4_warn(&priv->dev, + "No vlan resources slave %d, port %d\n", + slave, port); + return err; + } + mlx4_dbg(&priv->dev, "alloc vlan %d idx %d slave %d port %d\n", + (int)(vp_oper->state.default_vlan), + vp_oper->vlan_idx, slave, port); + } + vp_oper->state.vlan_proto = vp_admin->vlan_proto; + vp_oper->state.default_vlan = vp_admin->default_vlan; + vp_oper->state.default_qos = vp_admin->default_qos; + + return 0; +} + +static int mlx4_handle_vst_qinq(struct mlx4_priv *priv, int slave, int port) +{ + struct mlx4_vport_oper_state *vp_oper; + struct mlx4_slave_state *slave_state; + struct mlx4_vport_state *vp_admin; + int err; + + vp_oper = &priv->mfunc.master.vf_oper[slave].vport[port]; + vp_admin = &priv->mfunc.master.vf_admin[slave].vport[port]; + slave_state = &priv->mfunc.master.slave_state[slave]; + + if ((vp_admin->vlan_proto != htons(ETH_P_8021AD)) || + (!slave_state->active)) + return 0; + + if (vp_oper->state.vlan_proto == vp_admin->vlan_proto && + vp_oper->state.default_vlan == vp_admin->default_vlan && + vp_oper->state.default_qos == vp_admin->default_qos) + return 0; + + if (!slave_state->vst_qinq_supported) { + /* Warn and revert the request to set vst QinQ mode */ + vp_admin->vlan_proto = vp_oper->state.vlan_proto; + vp_admin->default_vlan = vp_oper->state.default_vlan; + vp_admin->default_qos = vp_oper->state.default_qos; + + mlx4_warn(&priv->dev, + "Slave %d does not support VST QinQ mode\n", slave); + return 0; + } + + err = mlx4_activate_vst_qinq(priv, slave, port); + return err; +} + int mlx4_QUERY_FUNC_CAP_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_vhcr *vhcr, struct mlx4_cmd_mailbox *inbox, @@ -241,7 +329,7 @@ int mlx4_QUERY_FUNC_CAP_wrapper(struct mlx4_dev *dev, int slave, { struct mlx4_priv *priv = mlx4_priv(dev); u8 field, port; - u32 size; + u32 size, proxy_qp, qkey; int err = 0; struct mlx4_func func; @@ -257,6 +345,7 @@ int mlx4_QUERY_FUNC_CAP_wrapper(struct mlx4_dev *dev, int slave, #define QUERY_FUNC_CAP_MCG_QUOTA_OFFSET_DEP 0x28 #define QUERY_FUNC_CAP_MAX_EQ_OFFSET 0x2c #define QUERY_FUNC_CAP_RESERVED_EQ_OFFSET 0x30 +#define QUERY_FUNC_CAP_QP_RESD_LKEY_OFFSET 0x48 #define QUERY_FUNC_CAP_QP_QUOTA_OFFSET 0x50 #define QUERY_FUNC_CAP_CQ_QUOTA_OFFSET 0x54 @@ -271,46 +360,66 @@ int mlx4_QUERY_FUNC_CAP_wrapper(struct mlx4_dev *dev, int slave, #define QUERY_FUNC_CAP_FLAG_RDMA 0x40 #define QUERY_FUNC_CAP_FLAG_ETH 0x80 #define QUERY_FUNC_CAP_FLAG_QUOTAS 0x10 +#define QUERY_FUNC_CAP_FLAG_RESD_LKEY 0x08 #define QUERY_FUNC_CAP_FLAG_VALID_MAILBOX 0x04 #define QUERY_FUNC_CAP_EXTRA_FLAGS_BF_QP_ALLOC_FLAG (1UL << 31) +#define QUERY_FUNC_CAP_EXTRA_FLAGS_A0_QP_ALLOC_FLAG (1UL << 30) /* when opcode modifier = 1 */ #define QUERY_FUNC_CAP_PHYS_PORT_OFFSET 0x3 +#define QUERY_FUNC_CAP_PRIV_VF_QKEY_OFFSET 0x4 #define QUERY_FUNC_CAP_FLAGS0_OFFSET 0x8 #define QUERY_FUNC_CAP_FLAGS1_OFFSET 0xc -#define QUERY_FUNC_CAP_COUNTER_INDEX_OFFSET 0xd #define QUERY_FUNC_CAP_QP0_TUNNEL 0x10 #define QUERY_FUNC_CAP_QP0_PROXY 0x14 #define QUERY_FUNC_CAP_QP1_TUNNEL 0x18 #define QUERY_FUNC_CAP_QP1_PROXY 0x1c +#define QUERY_FUNC_CAP_PHYS_PORT_ID 0x28 -#define QUERY_FUNC_CAP_ETH_PROPS_FORCE_MAC 0x40 -#define QUERY_FUNC_CAP_ETH_PROPS_FORCE_VLAN 0x80 -#define QUERY_FUNC_CAP_PROPS_DEF_COUNTER 0x20 +#define QUERY_FUNC_CAP_FLAGS1_FORCE_MAC 0x40 +#define QUERY_FUNC_CAP_FLAGS1_FORCE_VLAN 0x80 +#define QUERY_FUNC_CAP_FLAGS1_NIC_INFO 0x10 +#define QUERY_FUNC_CAP_VF_ENABLE_QP0 0x08 -#define QUERY_FUNC_CAP_RDMA_PROPS_FORCE_PHY_WQE_GID 0x80 -#define QUERY_FUNC_CAP_SUPPORTS_NON_POWER_OF_2_NUM_EQS (1 << 31) +#define QUERY_FUNC_CAP_FLAGS0_FORCE_PHY_WQE_GID 0x80 +#define QUERY_FUNC_CAP_PHV_BIT 0x40 +#define QUERY_FUNC_CAP_VLAN_OFFLOAD_DISABLE 0x20 + +#define QUERY_FUNC_CAP_SUPPORTS_VST_QINQ BIT(30) +#define QUERY_FUNC_CAP_SUPPORTS_NON_POWER_OF_2_NUM_EQS BIT(31) if (vhcr->op_modifier == 1) { - port = vhcr->in_modifier; /* phys-port = logical-port */ - MLX4_PUT(outbox->buf, port, QUERY_FUNC_CAP_PHYS_PORT_OFFSET); + struct mlx4_active_ports actv_ports = + mlx4_get_active_ports(dev, slave); + int converted_port = mlx4_slave_convert_port( + dev, slave, vhcr->in_modifier); + struct mlx4_vport_oper_state *vp_oper; - field = 0; - /* ensure that phy_wqe_gid bit is not set */ - MLX4_PUT(outbox->buf, field, QUERY_FUNC_CAP_FLAGS0_OFFSET); + if (converted_port < 0) + return -EINVAL; - /* ensure force vlan and force mac bits are not set - * and that default counter bit is set - */ - field = QUERY_FUNC_CAP_PROPS_DEF_COUNTER; /* def counter */ + vhcr->in_modifier = converted_port; + /* phys-port = logical-port */ + field = vhcr->in_modifier - + find_first_bit(actv_ports.ports, dev->caps.num_ports); + MLX4_PUT(outbox->buf, field, QUERY_FUNC_CAP_PHYS_PORT_OFFSET); + + port = vhcr->in_modifier; + proxy_qp = dev->phys_caps.base_proxy_sqpn + 8 * slave + port - 1; + + /* Set nic_info bit to mark new fields support */ + field = QUERY_FUNC_CAP_FLAGS1_NIC_INFO; + + if (mlx4_vf_smi_enabled(dev, slave, port) && + !mlx4_get_parav_qkey(dev, proxy_qp, &qkey)) { + field |= QUERY_FUNC_CAP_VF_ENABLE_QP0; + MLX4_PUT(outbox->buf, qkey, + QUERY_FUNC_CAP_PRIV_VF_QKEY_OFFSET); + } MLX4_PUT(outbox->buf, field, QUERY_FUNC_CAP_FLAGS1_OFFSET); - /* There is always default counter legal or sink counter */ - field = mlx4_get_default_counter_index(dev, slave, vhcr->in_modifier); - MLX4_PUT(outbox->buf, field, QUERY_FUNC_CAP_COUNTER_INDEX_OFFSET); - /* size is now the QP number */ size = dev->phys_caps.base_tunnel_sqpn + 8 * slave + port - 1; MLX4_PUT(outbox->buf, size, QUERY_FUNC_CAP_QP0_TUNNEL); @@ -318,19 +427,42 @@ int mlx4_QUERY_FUNC_CAP_wrapper(struct mlx4_dev *dev, int slave, size += 2; MLX4_PUT(outbox->buf, size, QUERY_FUNC_CAP_QP1_TUNNEL); - size = dev->phys_caps.base_proxy_sqpn + 8 * slave + port - 1; - MLX4_PUT(outbox->buf, size, QUERY_FUNC_CAP_QP0_PROXY); + MLX4_PUT(outbox->buf, proxy_qp, QUERY_FUNC_CAP_QP0_PROXY); + proxy_qp += 2; + MLX4_PUT(outbox->buf, proxy_qp, QUERY_FUNC_CAP_QP1_PROXY); - size += 2; - MLX4_PUT(outbox->buf, size, QUERY_FUNC_CAP_QP1_PROXY); + MLX4_PUT(outbox->buf, dev->caps.phys_port_id[vhcr->in_modifier], + QUERY_FUNC_CAP_PHYS_PORT_ID); + + vp_oper = &priv->mfunc.master.vf_oper[slave].vport[port]; + err = mlx4_handle_vst_qinq(priv, slave, port); + if (err) + return err; + + field = 0; + if (dev->caps.phv_bit[port]) + field |= QUERY_FUNC_CAP_PHV_BIT; + if (vp_oper->state.vlan_proto == htons(ETH_P_8021AD)) + field |= QUERY_FUNC_CAP_VLAN_OFFLOAD_DISABLE; + MLX4_PUT(outbox->buf, field, QUERY_FUNC_CAP_FLAGS0_OFFSET); } else if (vhcr->op_modifier == 0) { - /* enable rdma and ethernet interfaces, and new quota locations */ + struct mlx4_active_ports actv_ports = + mlx4_get_active_ports(dev, slave); + struct mlx4_slave_state *slave_state = + &priv->mfunc.master.slave_state[slave]; + + /* enable rdma and ethernet interfaces, new quota locations, + * and reserved lkey + */ field = (QUERY_FUNC_CAP_FLAG_ETH | QUERY_FUNC_CAP_FLAG_RDMA | - QUERY_FUNC_CAP_FLAG_QUOTAS | QUERY_FUNC_CAP_FLAG_VALID_MAILBOX); + QUERY_FUNC_CAP_FLAG_QUOTAS | QUERY_FUNC_CAP_FLAG_VALID_MAILBOX | + QUERY_FUNC_CAP_FLAG_RESD_LKEY); MLX4_PUT(outbox->buf, field, QUERY_FUNC_CAP_FLAGS_OFFSET); - field = dev->caps.num_ports; + field = min( + bitmap_weight(actv_ports.ports, dev->caps.num_ports), + dev->caps.num_ports); MLX4_PUT(outbox->buf, field, QUERY_FUNC_CAP_NUM_PORTS_OFFSET); size = dev->caps.function_caps; /* set PF behaviours */ @@ -387,27 +519,37 @@ int mlx4_QUERY_FUNC_CAP_wrapper(struct mlx4_dev *dev, int slave, MLX4_PUT(outbox->buf, size, QUERY_FUNC_CAP_MCG_QUOTA_OFFSET); MLX4_PUT(outbox->buf, size, QUERY_FUNC_CAP_MCG_QUOTA_OFFSET_DEP); - size = QUERY_FUNC_CAP_EXTRA_FLAGS_BF_QP_ALLOC_FLAG; + size = QUERY_FUNC_CAP_EXTRA_FLAGS_BF_QP_ALLOC_FLAG | + QUERY_FUNC_CAP_EXTRA_FLAGS_A0_QP_ALLOC_FLAG; MLX4_PUT(outbox->buf, size, QUERY_FUNC_CAP_EXTRA_FLAGS_OFFSET); + + size = dev->caps.reserved_lkey + ((slave << 8) & 0xFF00); + MLX4_PUT(outbox->buf, size, QUERY_FUNC_CAP_QP_RESD_LKEY_OFFSET); + + if (vhcr->in_modifier & QUERY_FUNC_CAP_SUPPORTS_VST_QINQ) + slave_state->vst_qinq_supported = true; + } else err = -EINVAL; return err; } -int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u32 gen_or_port, +int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u8 gen_or_port, struct mlx4_func_cap *func_cap) { struct mlx4_cmd_mailbox *mailbox; u32 *outbox; u8 field, op_modifier; - u32 size; + u32 size, qkey; int err = 0, quotas = 0; u32 in_modifier; + u32 slave_caps; op_modifier = !!gen_or_port; /* 0 = general, 1 = logical port */ - in_modifier = op_modifier ? gen_or_port : + slave_caps = QUERY_FUNC_CAP_SUPPORTS_VST_QINQ | QUERY_FUNC_CAP_SUPPORTS_NON_POWER_OF_2_NUM_EQS; + in_modifier = op_modifier ? gen_or_port : slave_caps; mailbox = mlx4_alloc_cmd_mailbox(dev); if (IS_ERR(mailbox)) @@ -481,6 +623,13 @@ int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u32 gen_or_port, MLX4_GET(size, outbox, QUERY_FUNC_CAP_RESERVED_EQ_OFFSET); func_cap->reserved_eq = size & 0xFFFFFF; + if (func_cap->flags & QUERY_FUNC_CAP_FLAG_RESD_LKEY) { + MLX4_GET(size, outbox, QUERY_FUNC_CAP_QP_RESD_LKEY_OFFSET); + func_cap->reserved_lkey = size; + } else { + func_cap->reserved_lkey = 0; + } + func_cap->extra_flags = 0; /* Mailbox data from 0x6c and onward should only be treated if @@ -490,6 +639,8 @@ int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u32 gen_or_port, MLX4_GET(size, outbox, QUERY_FUNC_CAP_EXTRA_FLAGS_OFFSET); if (size & QUERY_FUNC_CAP_EXTRA_FLAGS_BF_QP_ALLOC_FLAG) func_cap->extra_flags |= MLX4_QUERY_FUNC_FLAGS_BF_RES_QP; + if (size & QUERY_FUNC_CAP_EXTRA_FLAGS_A0_QP_ALLOC_FLAG) + func_cap->extra_flags |= MLX4_QUERY_FUNC_FLAGS_A0_RES_QP; } goto out; @@ -501,24 +652,23 @@ int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u32 gen_or_port, goto out; } + MLX4_GET(func_cap->flags1, outbox, QUERY_FUNC_CAP_FLAGS1_OFFSET); if (dev->caps.port_type[gen_or_port] == MLX4_PORT_TYPE_ETH) { - MLX4_GET(field, outbox, QUERY_FUNC_CAP_FLAGS1_OFFSET); - if (field & QUERY_FUNC_CAP_ETH_PROPS_FORCE_VLAN) { + if (func_cap->flags1 & QUERY_FUNC_CAP_FLAGS1_FORCE_VLAN) { mlx4_err(dev, "VLAN is enforced on this port\n"); err = -EPROTONOSUPPORT; goto out; } - if (field & QUERY_FUNC_CAP_ETH_PROPS_FORCE_MAC) { + if (func_cap->flags1 & QUERY_FUNC_CAP_FLAGS1_FORCE_MAC) { mlx4_err(dev, "Force mac is enabled on this port\n"); err = -EPROTONOSUPPORT; goto out; } } else if (dev->caps.port_type[gen_or_port] == MLX4_PORT_TYPE_IB) { MLX4_GET(field, outbox, QUERY_FUNC_CAP_FLAGS0_OFFSET); - if (field & QUERY_FUNC_CAP_RDMA_PROPS_FORCE_PHY_WQE_GID) { - mlx4_err(dev, "phy_wqe_gid is " - "enforced on this ib port\n"); + if (field & QUERY_FUNC_CAP_FLAGS0_FORCE_PHY_WQE_GID) { + mlx4_err(dev, "phy_wqe_gid is enforced on this ib port\n"); err = -EPROTONOSUPPORT; goto out; } @@ -531,12 +681,11 @@ int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u32 gen_or_port, goto out; } - MLX4_GET(field, outbox, QUERY_FUNC_CAP_FLAGS1_OFFSET); - if (field & QUERY_FUNC_CAP_PROPS_DEF_COUNTER) { - MLX4_GET(field, outbox, QUERY_FUNC_CAP_COUNTER_INDEX_OFFSET); - func_cap->def_counter_index = field; + if (func_cap->flags1 & QUERY_FUNC_CAP_VF_ENABLE_QP0) { + MLX4_GET(qkey, outbox, QUERY_FUNC_CAP_PRIV_VF_QKEY_OFFSET); + func_cap->qp0_qkey = qkey; } else { - func_cap->def_counter_index = MLX4_SINK_COUNTER_INDEX; + func_cap->qp0_qkey = 0; } MLX4_GET(size, outbox, QUERY_FUNC_CAP_QP0_TUNNEL); @@ -551,6 +700,12 @@ int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u32 gen_or_port, MLX4_GET(size, outbox, QUERY_FUNC_CAP_QP1_PROXY); func_cap->qp1_proxy_qpn = size & 0xFFFFFF; + if (func_cap->flags1 & QUERY_FUNC_CAP_FLAGS1_NIC_INFO) + MLX4_GET(func_cap->phys_port_id, outbox, + QUERY_FUNC_CAP_PHYS_PORT_ID); + + MLX4_GET(func_cap->flags0, outbox, QUERY_FUNC_CAP_FLAGS0_OFFSET); + /* All other resources are allocated by the master, but we still report * 'num' and 'reserved' capabilities as follows: * - num remains the maximum resource index @@ -564,6 +719,8 @@ int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u32 gen_or_port, return err; } +static void disable_unsupported_roce_caps(void *buf); + int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) { struct mlx4_cmd_mailbox *mailbox; @@ -602,6 +759,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) #define QUERY_DEV_CAP_RSS_OFFSET 0x2e #define QUERY_DEV_CAP_MAX_RDMA_OFFSET 0x2f #define QUERY_DEV_CAP_RSZ_SRQ_OFFSET 0x33 +#define QUERY_DEV_CAP_PORT_BEACON_OFFSET 0x34 #define QUERY_DEV_CAP_ACK_DELAY_OFFSET 0x35 #define QUERY_DEV_CAP_MTU_WIDTH_OFFSET 0x36 #define QUERY_DEV_CAP_VL_PORT_OFFSET 0x37 @@ -611,7 +769,6 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) #define QUERY_DEV_CAP_CQ_TS_SUPPORT_OFFSET 0x3e #define QUERY_DEV_CAP_MAX_PKEY_OFFSET 0x3f #define QUERY_DEV_CAP_EXT_FLAGS_OFFSET 0x40 -#define QUERY_DEV_CAP_SYNC_QP_OFFSET 0x42 #define QUERY_DEV_CAP_FLAGS_OFFSET 0x44 #define QUERY_DEV_CAP_RSVD_UAR_OFFSET 0x48 #define QUERY_DEV_CAP_UAR_SZ_OFFSET 0x49 @@ -624,6 +781,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) #define QUERY_DEV_CAP_MAX_DESC_SZ_SQ_OFFSET 0x52 #define QUERY_DEV_CAP_MAX_SG_RQ_OFFSET 0x55 #define QUERY_DEV_CAP_MAX_DESC_SZ_RQ_OFFSET 0x56 +#define QUERY_DEV_CAP_SVLAN_BY_QP_OFFSET 0x5D #define QUERY_DEV_CAP_MAX_QP_MCG_OFFSET 0x61 #define QUERY_DEV_CAP_RSVD_MCG_OFFSET 0x62 #define QUERY_DEV_CAP_MAX_MCG_OFFSET 0x63 @@ -631,13 +789,15 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) #define QUERY_DEV_CAP_MAX_PD_OFFSET 0x65 #define QUERY_DEV_CAP_RSVD_XRC_OFFSET 0x66 #define QUERY_DEV_CAP_MAX_XRC_OFFSET 0x67 -#define QUERY_DEV_CAP_MAX_BASIC_COUNTERS_OFFSET 0x68 -#define QUERY_DEV_CAP_MAX_EXTENDED_COUNTERS_OFFSET 0x6c +#define QUERY_DEV_CAP_MAX_COUNTERS_OFFSET 0x68 #define QUERY_DEV_CAP_PORT_FLOWSTATS_COUNTERS_OFFSET 0x70 -#define QUERY_DEV_CAP_FLOW_STEERING_RANGE_EN_OFFSET 0x76 -#define QUERY_DEV_CAP_EXT_2_FLAGS_OFFSET 0x70 +#define QUERY_DEV_CAP_EXT_2_FLAGS_OFFSET 0x70 #define QUERY_DEV_CAP_FLOW_STEERING_IPOIB_OFFSET 0x74 +#define QUERY_DEV_CAP_FLOW_STEERING_RANGE_EN_OFFSET 0x76 #define QUERY_DEV_CAP_FLOW_STEERING_MAX_QP_OFFSET 0x77 +#define QUERY_DEV_CAP_SL2VL_EVENT_OFFSET 0x78 +#define QUERY_DEV_CAP_CQ_EQ_CACHE_LINE_STRIDE 0x7a +#define QUERY_DEV_CAP_ECN_QCN_VER_OFFSET 0x7b #define QUERY_DEV_CAP_RDMARC_ENTRY_SZ_OFFSET 0x80 #define QUERY_DEV_CAP_QPC_ENTRY_SZ_OFFSET 0x82 #define QUERY_DEV_CAP_AUX_ENTRY_SZ_OFFSET 0x84 @@ -649,9 +809,21 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) #define QUERY_DEV_CAP_MTT_ENTRY_SZ_OFFSET 0x90 #define QUERY_DEV_CAP_D_MPT_ENTRY_SZ_OFFSET 0x92 #define QUERY_DEV_CAP_BMME_FLAGS_OFFSET 0x94 +#define QUERY_DEV_CAP_CONFIG_DEV_OFFSET 0x94 +#define QUERY_DEV_CAP_PHV_EN_OFFSET 0x96 #define QUERY_DEV_CAP_RSVD_LKEY_OFFSET 0x98 -#define QUERY_DEV_CAP_ETS_CFG_OFFSET 0x9c #define QUERY_DEV_CAP_MAX_ICM_SZ_OFFSET 0xa0 +#define QUERY_DEV_CAP_ETH_BACKPL_OFFSET 0x9c +#define QUERY_DEV_CAP_DIAG_RPRT_PER_PORT 0x9c +#define QUERY_DEV_CAP_FW_REASSIGN_MAC 0x9d +#define QUERY_DEV_CAP_VXLAN 0x9e +#define QUERY_DEV_CAP_MAD_DEMUX_OFFSET 0xb0 +#define QUERY_DEV_CAP_DMFS_HIGH_RATE_QPN_BASE_OFFSET 0xa8 +#define QUERY_DEV_CAP_DMFS_HIGH_RATE_QPN_RANGE_OFFSET 0xac +#define QUERY_DEV_CAP_QP_RATE_LIMIT_NUM_OFFSET 0xcc +#define QUERY_DEV_CAP_QP_RATE_LIMIT_MAX_OFFSET 0xd0 +#define QUERY_DEV_CAP_QP_RATE_LIMIT_MIN_OFFSET 0xd2 + dev_cap->flags2 = 0; mailbox = mlx4_alloc_cmd_mailbox(dev); @@ -664,6 +836,8 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) if (err) goto out; + if (mlx4_is_mfunc(dev)) + disable_unsupported_roce_caps(outbox); MLX4_GET(field, outbox, QUERY_DEV_CAP_RSVD_QP_OFFSET); dev_cap->reserved_qps = 1 << (field & 0xf); MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_QP_OFFSET); @@ -681,17 +855,13 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_MPT_OFFSET); dev_cap->max_mpts = 1 << (field & 0x3f); MLX4_GET(field, outbox, QUERY_DEV_CAP_RSVD_EQ_OFFSET); - dev_cap->reserved_eqs = field & 0xf; + dev_cap->reserved_eqs = 1 << (field & 0xf); MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_EQ_OFFSET); dev_cap->max_eqs = 1 << (field & 0xf); MLX4_GET(field, outbox, QUERY_DEV_CAP_RSVD_MTT_OFFSET); dev_cap->reserved_mtts = 1 << (field >> 4); - MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_MRW_SZ_OFFSET); - dev_cap->max_mrw_sz = 1 << field; MLX4_GET(field, outbox, QUERY_DEV_CAP_RSVD_MRW_OFFSET); dev_cap->reserved_mrws = 1 << (field & 0xf); - MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_MTT_SEG_OFFSET); - dev_cap->max_mtt_seg = 1 << (field & 0x3f); MLX4_GET(size, outbox, QUERY_DEV_CAP_NUM_SYS_EQ_OFFSET); dev_cap->num_sys_eqs = size & 0xfff; MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_REQ_QP_OFFSET); @@ -730,12 +900,23 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) MLX4_GET(field, outbox, QUERY_DEV_CAP_FLOW_STEERING_RANGE_EN_OFFSET); if (field & 0x80) dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_FS_EN; + dev_cap->fs_log_max_ucast_qp_range_size = field & 0x1f; + if (field & 0x20) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_DMFS_UC_MC_SNIFFER; + MLX4_GET(field, outbox, QUERY_DEV_CAP_PORT_BEACON_OFFSET); + if (field & 0x80) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_PORT_BEACON; MLX4_GET(field, outbox, QUERY_DEV_CAP_FLOW_STEERING_IPOIB_OFFSET); if (field & 0x80) dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_DMFS_IPOIB; - dev_cap->fs_log_max_ucast_qp_range_size = field & 0x1f; MLX4_GET(field, outbox, QUERY_DEV_CAP_FLOW_STEERING_MAX_QP_OFFSET); dev_cap->fs_max_num_qp_per_entry = field; + MLX4_GET(field, outbox, QUERY_DEV_CAP_SL2VL_EVENT_OFFSET); + if (field & (1 << 5)) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_SL_TO_VL_CHANGE_EVENT; + MLX4_GET(field, outbox, QUERY_DEV_CAP_ECN_QCN_VER_OFFSET); + if (field & 0x1) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_QCN; MLX4_GET(stat_rate, outbox, QUERY_DEV_CAP_RATE_SUPPORT_OFFSET); dev_cap->stat_rate_support = stat_rate; MLX4_GET(field, outbox, QUERY_DEV_CAP_CQ_TS_SUPPORT_OFFSET); @@ -744,8 +925,6 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) MLX4_GET(ext_flags, outbox, QUERY_DEV_CAP_EXT_FLAGS_OFFSET); MLX4_GET(flags, outbox, QUERY_DEV_CAP_FLAGS_OFFSET); dev_cap->flags = flags | (u64)ext_flags << 32; - MLX4_GET(field, outbox, QUERY_DEV_CAP_SYNC_QP_OFFSET); - dev_cap->sync_qp = field & 0x10; MLX4_GET(field, outbox, QUERY_DEV_CAP_RSVD_UAR_OFFSET); dev_cap->reserved_uars = field >> 4; MLX4_GET(field, outbox, QUERY_DEV_CAP_UAR_SZ_OFFSET); @@ -761,11 +940,8 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) if ((1 << (field & 0x3f)) > (PAGE_SIZE / dev_cap->bf_reg_size)) field = 3; dev_cap->bf_regs_per_page = 1 << (field & 0x3f); - mlx4_dbg(dev, "BlueFlame available (reg size %d, regs/page %d)\n", - dev_cap->bf_reg_size, dev_cap->bf_regs_per_page); } else { dev_cap->bf_reg_size = 0; - mlx4_dbg(dev, "BlueFlame not available\n"); } MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_SG_SQ_OFFSET); @@ -773,6 +949,9 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) MLX4_GET(size, outbox, QUERY_DEV_CAP_MAX_DESC_SZ_SQ_OFFSET); dev_cap->max_sq_desc_sz = size; + MLX4_GET(field, outbox, QUERY_DEV_CAP_SVLAN_BY_QP_OFFSET); + if (field & 0x1) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_SVLAN_BY_QP; MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_QP_MCG_OFFSET); dev_cap->max_qp_per_mcg = 1 << field; MLX4_GET(field, outbox, QUERY_DEV_CAP_RSVD_MCG_OFFSET); @@ -819,54 +998,202 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) dev_cap->max_rq_sg = field; MLX4_GET(size, outbox, QUERY_DEV_CAP_MAX_DESC_SZ_RQ_OFFSET); dev_cap->max_rq_desc_sz = size; - + MLX4_GET(field, outbox, QUERY_DEV_CAP_CQ_EQ_CACHE_LINE_STRIDE); + if (field & (1 << 4)) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_QOS_VPP; + if (field & (1 << 5)) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL; + if (field & (1 << 6)) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_CQE_STRIDE; + if (field & (1 << 7)) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_EQE_STRIDE; MLX4_GET(dev_cap->bmme_flags, outbox, QUERY_DEV_CAP_BMME_FLAGS_OFFSET); + if (dev_cap->bmme_flags & MLX4_FLAG_ROCE_V1_V2) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_ROCE_V1_V2; + if (dev_cap->bmme_flags & MLX4_FLAG_PORT_REMAP) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_PORT_REMAP; + MLX4_GET(field, outbox, QUERY_DEV_CAP_CONFIG_DEV_OFFSET); + if (field & 0x20) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_CONFIG_DEV; + if (field & (1 << 2)) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_IGNORE_FCS; + MLX4_GET(field, outbox, QUERY_DEV_CAP_PHV_EN_OFFSET); + if (field & 0x80) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_PHV_EN; + if (field & 0x40) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_SKIP_OUTER_VLAN; + MLX4_GET(dev_cap->reserved_lkey, outbox, QUERY_DEV_CAP_RSVD_LKEY_OFFSET); - MLX4_GET(field32, outbox, QUERY_DEV_CAP_ETS_CFG_OFFSET); + MLX4_GET(field32, outbox, QUERY_DEV_CAP_ETH_BACKPL_OFFSET); if (field32 & (1 << 0)) dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP; if (field32 & (1 << 7)) dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_RECOVERABLE_ERROR_EVENT; - if (field32 & (1 << 8)) - dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_DRIVER_VERSION_TO_FW; - if (field32 & (1 << 13)) + MLX4_GET(field32, outbox, QUERY_DEV_CAP_DIAG_RPRT_PER_PORT); + if (field32 & (1 << 17)) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_DIAG_PER_PORT; + MLX4_GET(field, outbox, QUERY_DEV_CAP_FW_REASSIGN_MAC); + if (field & (1 << 6)) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN; + MLX4_GET(field, outbox, QUERY_DEV_CAP_VXLAN); + if (field & (1 << 3)) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS; + if (field & (1 << 5)) dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_ETS_CFG; - MLX4_GET(dev_cap->max_icm_sz, outbox, QUERY_DEV_CAP_MAX_ICM_SZ_OFFSET); if (dev_cap->flags & MLX4_DEV_CAP_FLAG_COUNTERS) - MLX4_GET(dev_cap->max_basic_counters, outbox, - QUERY_DEV_CAP_MAX_BASIC_COUNTERS_OFFSET); - /* FW reports 256 however real value is 255 */ - dev_cap->max_basic_counters = min_t(u32, dev_cap->max_basic_counters, 255); - if (dev_cap->flags & MLX4_DEV_CAP_FLAG_COUNTERS_EXT) - MLX4_GET(dev_cap->max_extended_counters, outbox, - QUERY_DEV_CAP_MAX_EXTENDED_COUNTERS_OFFSET); + MLX4_GET(dev_cap->max_counters, outbox, + QUERY_DEV_CAP_MAX_COUNTERS_OFFSET); + + MLX4_GET(field32, outbox, + QUERY_DEV_CAP_MAD_DEMUX_OFFSET); + if (field32 & (1 << 0)) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_MAD_DEMUX; + + MLX4_GET(dev_cap->dmfs_high_rate_qpn_base, outbox, + QUERY_DEV_CAP_DMFS_HIGH_RATE_QPN_BASE_OFFSET); + dev_cap->dmfs_high_rate_qpn_base &= MGM_QPN_MASK; + MLX4_GET(dev_cap->dmfs_high_rate_qpn_range, outbox, + QUERY_DEV_CAP_DMFS_HIGH_RATE_QPN_RANGE_OFFSET); + dev_cap->dmfs_high_rate_qpn_range &= MGM_QPN_MASK; + + MLX4_GET(size, outbox, QUERY_DEV_CAP_QP_RATE_LIMIT_NUM_OFFSET); + dev_cap->rl_caps.num_rates = size; + if (dev_cap->rl_caps.num_rates) { + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_QP_RATE_LIMIT; + MLX4_GET(size, outbox, QUERY_DEV_CAP_QP_RATE_LIMIT_MAX_OFFSET); + dev_cap->rl_caps.max_val = size & 0xfff; + dev_cap->rl_caps.max_unit = size >> 14; + MLX4_GET(size, outbox, QUERY_DEV_CAP_QP_RATE_LIMIT_MIN_OFFSET); + dev_cap->rl_caps.min_val = size & 0xfff; + dev_cap->rl_caps.min_unit = size >> 14; + } MLX4_GET(field32, outbox, QUERY_DEV_CAP_EXT_2_FLAGS_OFFSET); if (field32 & (1 << 16)) dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_UPDATE_QP; + if (field32 & (1 << 18)) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_UPDATE_QP_SRC_CHECK_LB; if (field32 & (1 << 19)) dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_LB_SRC_CHK; - if (field32 & (1 << 20)) - dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_FSM; if (field32 & (1 << 26)) dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_VLAN_CONTROL; + if (field32 & (1 << 20)) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_FSM; + if (field32 & (1 << 21)) + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_80_VFS; + + for (i = 1; i <= dev_cap->num_ports; i++) { + err = mlx4_QUERY_PORT(dev, i, dev_cap->port_cap + i); + if (err) + goto out; + } + + /* + * Each UAR has 4 EQ doorbells; so if a UAR is reserved, then + * we can't use any EQs whose doorbell falls on that page, + * even if the EQ itself isn't reserved. + */ + if (dev_cap->num_sys_eqs == 0) + dev_cap->reserved_eqs = max(dev_cap->reserved_uars * 4, + dev_cap->reserved_eqs); + else + dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_SYS_EQS; + +out: + mlx4_free_cmd_mailbox(dev, mailbox); + return err; +} + +void mlx4_dev_cap_dump(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) +{ + if (dev_cap->bf_reg_size > 0) + mlx4_dbg(dev, "BlueFlame available (reg size %d, regs/page %d)\n", + dev_cap->bf_reg_size, dev_cap->bf_regs_per_page); + else + mlx4_dbg(dev, "BlueFlame not available\n"); + + mlx4_dbg(dev, "Base MM extensions: flags %08x, rsvd L_Key %08x\n", + dev_cap->bmme_flags, dev_cap->reserved_lkey); + mlx4_dbg(dev, "Max ICM size %lld MB\n", + (unsigned long long) dev_cap->max_icm_sz >> 20); + mlx4_dbg(dev, "Max QPs: %d, reserved QPs: %d, entry size: %d\n", + dev_cap->max_qps, dev_cap->reserved_qps, dev_cap->qpc_entry_sz); + mlx4_dbg(dev, "Max SRQs: %d, reserved SRQs: %d, entry size: %d\n", + dev_cap->max_srqs, dev_cap->reserved_srqs, dev_cap->srq_entry_sz); + mlx4_dbg(dev, "Max CQs: %d, reserved CQs: %d, entry size: %d\n", + dev_cap->max_cqs, dev_cap->reserved_cqs, dev_cap->cqc_entry_sz); + mlx4_dbg(dev, "Num sys EQs: %d, max EQs: %d, reserved EQs: %d, entry size: %d\n", + dev_cap->num_sys_eqs, dev_cap->max_eqs, dev_cap->reserved_eqs, + dev_cap->eqc_entry_sz); + mlx4_dbg(dev, "reserved MPTs: %d, reserved MTTs: %d\n", + dev_cap->reserved_mrws, dev_cap->reserved_mtts); + mlx4_dbg(dev, "Max PDs: %d, reserved PDs: %d, reserved UARs: %d\n", + dev_cap->max_pds, dev_cap->reserved_pds, dev_cap->reserved_uars); + mlx4_dbg(dev, "Max QP/MCG: %d, reserved MGMs: %d\n", + dev_cap->max_pds, dev_cap->reserved_mgms); + mlx4_dbg(dev, "Max CQEs: %d, max WQEs: %d, max SRQ WQEs: %d\n", + dev_cap->max_cq_sz, dev_cap->max_qp_sz, dev_cap->max_srq_sz); + mlx4_dbg(dev, "Local CA ACK delay: %d, max MTU: %d, port width cap: %d\n", + dev_cap->local_ca_ack_delay, 128 << dev_cap->port_cap[1].ib_mtu, + dev_cap->port_cap[1].max_port_width); + mlx4_dbg(dev, "Max SQ desc size: %d, max SQ S/G: %d\n", + dev_cap->max_sq_desc_sz, dev_cap->max_sq_sg); + mlx4_dbg(dev, "Max RQ desc size: %d, max RQ S/G: %d\n", + dev_cap->max_rq_desc_sz, dev_cap->max_rq_sg); + mlx4_dbg(dev, "Max GSO size: %d\n", dev_cap->max_gso_sz); + mlx4_dbg(dev, "Max counters: %d\n", dev_cap->max_counters); + mlx4_dbg(dev, "Max RSS Table size: %d\n", dev_cap->max_rss_tbl_sz); + mlx4_dbg(dev, "DMFS high rate steer QPn base: %d\n", + dev_cap->dmfs_high_rate_qpn_base); + mlx4_dbg(dev, "DMFS high rate steer QPn range: %d\n", + dev_cap->dmfs_high_rate_qpn_range); + + if (dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_QP_RATE_LIMIT) { + struct mlx4_rate_limit_caps *rl_caps = &dev_cap->rl_caps; + + mlx4_dbg(dev, "QP Rate-Limit: #rates %d, unit/val max %d/%d, min %d/%d\n", + rl_caps->num_rates, rl_caps->max_unit, rl_caps->max_val, + rl_caps->min_unit, rl_caps->min_val); + } + + dump_dev_cap_flags(dev, dev_cap->flags); + dump_dev_cap_flags2(dev, dev_cap->flags2); +} + +int mlx4_QUERY_PORT(struct mlx4_dev *dev, int port, struct mlx4_port_cap *port_cap) +{ + struct mlx4_cmd_mailbox *mailbox; + u32 *outbox; + u8 field; + u32 field32; + int err; + + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) + return PTR_ERR(mailbox); + outbox = mailbox->buf; if (dev->flags & MLX4_FLAG_OLD_PORT_CMDS) { - for (i = 1; i <= dev_cap->num_ports; ++i) { - MLX4_GET(field, outbox, QUERY_DEV_CAP_VL_PORT_OFFSET); - dev_cap->max_vl[i] = field >> 4; - MLX4_GET(field, outbox, QUERY_DEV_CAP_MTU_WIDTH_OFFSET); - dev_cap->ib_mtu[i] = field >> 4; - dev_cap->max_port_width[i] = field & 0xf; - MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_GID_OFFSET); - dev_cap->max_gids[i] = 1 << (field & 0xf); - MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_PKEY_OFFSET); - dev_cap->max_pkeys[i] = 1 << (field & 0xf); - } + err = mlx4_cmd_box(dev, 0, mailbox->dma, 0, 0, MLX4_CMD_QUERY_DEV_CAP, + MLX4_CMD_TIME_CLASS_A, + MLX4_CMD_NATIVE); + + if (err) + goto out; + + MLX4_GET(field, outbox, QUERY_DEV_CAP_VL_PORT_OFFSET); + port_cap->max_vl = field >> 4; + MLX4_GET(field, outbox, QUERY_DEV_CAP_MTU_WIDTH_OFFSET); + port_cap->ib_mtu = field >> 4; + port_cap->max_port_width = field & 0xf; + MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_GID_OFFSET); + port_cap->max_gids = 1 << (field & 0xf); + MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_PKEY_OFFSET); + port_cap->max_pkeys = 1 << (field & 0xf); } else { #define QUERY_PORT_SUPPORTED_TYPE_OFFSET 0x00 #define QUERY_PORT_MTU_OFFSET 0x01 @@ -880,91 +1207,49 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) #define QUERY_PORT_WAVELENGTH_OFFSET 0x1c #define QUERY_PORT_TRANS_CODE_OFFSET 0x20 - for (i = 1; i <= dev_cap->num_ports; ++i) { - err = mlx4_cmd_box(dev, 0, mailbox->dma, i, 0, MLX4_CMD_QUERY_PORT, - MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); - if (err) - goto out; + err = mlx4_cmd_box(dev, 0, mailbox->dma, port, 0, MLX4_CMD_QUERY_PORT, + MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); + if (err) + goto out; - MLX4_GET(field, outbox, QUERY_PORT_SUPPORTED_TYPE_OFFSET); - dev_cap->supported_port_types[i] = field & 3; - dev_cap->suggested_type[i] = (field >> 3) & 1; - dev_cap->default_sense[i] = (field >> 4) & 1; - MLX4_GET(field, outbox, QUERY_PORT_MTU_OFFSET); - dev_cap->ib_mtu[i] = field & 0xf; - MLX4_GET(field, outbox, QUERY_PORT_WIDTH_OFFSET); - dev_cap->max_port_width[i] = field & 0xf; - MLX4_GET(field, outbox, QUERY_PORT_MAX_GID_PKEY_OFFSET); - dev_cap->max_gids[i] = 1 << (field >> 4); - dev_cap->max_pkeys[i] = 1 << (field & 0xf); - MLX4_GET(field, outbox, QUERY_PORT_MAX_VL_OFFSET); - dev_cap->max_vl[i] = field & 0xf; - MLX4_GET(field, outbox, QUERY_PORT_MAX_MACVLAN_OFFSET); - dev_cap->log_max_macs[i] = field & 0xf; - dev_cap->log_max_vlans[i] = field >> 4; - MLX4_GET(dev_cap->eth_mtu[i], outbox, QUERY_PORT_ETH_MTU_OFFSET); - MLX4_GET(dev_cap->def_mac[i], outbox, QUERY_PORT_MAC_OFFSET); - MLX4_GET(field32, outbox, QUERY_PORT_TRANS_VENDOR_OFFSET); - dev_cap->trans_type[i] = field32 >> 24; - dev_cap->vendor_oui[i] = field32 & 0xffffff; - MLX4_GET(dev_cap->wavelength[i], outbox, QUERY_PORT_WAVELENGTH_OFFSET); - MLX4_GET(dev_cap->trans_code[i], outbox, QUERY_PORT_TRANS_CODE_OFFSET); - } + MLX4_GET(field, outbox, QUERY_PORT_SUPPORTED_TYPE_OFFSET); + port_cap->link_state = (field & 0x80) >> 7; + port_cap->supported_port_types = field & 3; + port_cap->suggested_type = (field >> 3) & 1; + port_cap->default_sense = (field >> 4) & 1; + port_cap->dmfs_optimized_state = (field >> 5) & 1; + MLX4_GET(field, outbox, QUERY_PORT_MTU_OFFSET); + port_cap->ib_mtu = field & 0xf; + MLX4_GET(field, outbox, QUERY_PORT_WIDTH_OFFSET); + port_cap->max_port_width = field & 0xf; + MLX4_GET(field, outbox, QUERY_PORT_MAX_GID_PKEY_OFFSET); + port_cap->max_gids = 1 << (field >> 4); + port_cap->max_pkeys = 1 << (field & 0xf); + MLX4_GET(field, outbox, QUERY_PORT_MAX_VL_OFFSET); + port_cap->max_vl = field & 0xf; + port_cap->max_tc_eth = field >> 4; + MLX4_GET(field, outbox, QUERY_PORT_MAX_MACVLAN_OFFSET); + port_cap->log_max_macs = field & 0xf; + port_cap->log_max_vlans = field >> 4; + MLX4_GET(port_cap->eth_mtu, outbox, QUERY_PORT_ETH_MTU_OFFSET); + MLX4_GET(port_cap->def_mac, outbox, QUERY_PORT_MAC_OFFSET); + MLX4_GET(field32, outbox, QUERY_PORT_TRANS_VENDOR_OFFSET); + port_cap->trans_type = field32 >> 24; + port_cap->vendor_oui = field32 & 0xffffff; + MLX4_GET(port_cap->wavelength, outbox, QUERY_PORT_WAVELENGTH_OFFSET); + MLX4_GET(port_cap->trans_code, outbox, QUERY_PORT_TRANS_CODE_OFFSET); } - mlx4_dbg(dev, "Base MM extensions: flags %08x, rsvd L_Key %08x\n", - dev_cap->bmme_flags, dev_cap->reserved_lkey); - - /* - * Each UAR has 4 EQ doorbells; so if a UAR is reserved, then - * we can't use any EQs whose doorbell falls on that page, - * even if the EQ itself isn't reserved. - */ - if (dev_cap->num_sys_eqs == 0) - dev_cap->reserved_eqs = max(dev_cap->reserved_uars * 4, - dev_cap->reserved_eqs); - else - dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_SYS_EQS; - - mlx4_dbg(dev, "Max ICM size %lld MB\n", - (unsigned long long) dev_cap->max_icm_sz >> 20); - mlx4_dbg(dev, "Max QPs: %d, reserved QPs: %d, entry size: %d\n", - dev_cap->max_qps, dev_cap->reserved_qps, dev_cap->qpc_entry_sz); - mlx4_dbg(dev, "Max SRQs: %d, reserved SRQs: %d, entry size: %d\n", - dev_cap->max_srqs, dev_cap->reserved_srqs, dev_cap->srq_entry_sz); - mlx4_dbg(dev, "Max CQs: %d, reserved CQs: %d, entry size: %d\n", - dev_cap->max_cqs, dev_cap->reserved_cqs, dev_cap->cqc_entry_sz); - mlx4_dbg(dev, "Num sys EQs: %d, max EQs: %d, reserved EQs: %d, entry size: %d\n", - dev_cap->num_sys_eqs, dev_cap->max_eqs, dev_cap->reserved_eqs, - dev_cap->eqc_entry_sz); - mlx4_dbg(dev, "reserved MPTs: %d, reserved MTTs: %d\n", - dev_cap->reserved_mrws, dev_cap->reserved_mtts); - mlx4_dbg(dev, "Max PDs: %d, reserved PDs: %d, reserved UARs: %d\n", - dev_cap->max_pds, dev_cap->reserved_pds, dev_cap->reserved_uars); - mlx4_dbg(dev, "Max QP/MCG: %d, reserved MGMs: %d\n", - dev_cap->max_pds, dev_cap->reserved_mgms); - mlx4_dbg(dev, "Max CQEs: %d, max WQEs: %d, max SRQ WQEs: %d\n", - dev_cap->max_cq_sz, dev_cap->max_qp_sz, dev_cap->max_srq_sz); - mlx4_dbg(dev, "Local CA ACK delay: %d, max MTU: %d, port width cap: %d\n", - dev_cap->local_ca_ack_delay, 128 << dev_cap->ib_mtu[1], - dev_cap->max_port_width[1]); - mlx4_dbg(dev, "Max SQ desc size: %d, max SQ S/G: %d\n", - dev_cap->max_sq_desc_sz, dev_cap->max_sq_sg); - mlx4_dbg(dev, "Max RQ desc size: %d, max RQ S/G: %d\n", - dev_cap->max_rq_desc_sz, dev_cap->max_rq_sg); - mlx4_dbg(dev, "Max GSO size: %d\n", dev_cap->max_gso_sz); - mlx4_dbg(dev, "Max basic counters: %d\n", dev_cap->max_basic_counters); - mlx4_dbg(dev, "Max extended counters: %d\n", dev_cap->max_extended_counters); - mlx4_dbg(dev, "Max RSS Table size: %d\n", dev_cap->max_rss_tbl_sz); - - dump_dev_cap_flags(dev, dev_cap->flags); - dump_dev_cap_flags2(dev, dev_cap->flags2); - out: mlx4_free_cmd_mailbox(dev, mailbox); return err; } +#define DEV_CAP_EXT_2_FLAG_PFC_COUNTERS (1 << 28) +#define DEV_CAP_EXT_2_FLAG_VLAN_CONTROL (1 << 26) +#define DEV_CAP_EXT_2_FLAG_80_VFS (1 << 21) +#define DEV_CAP_EXT_2_FLAG_FSM (1 << 20) + int mlx4_QUERY_DEV_CAP_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_vhcr *vhcr, struct mlx4_cmd_mailbox *inbox, @@ -974,22 +1259,74 @@ int mlx4_QUERY_DEV_CAP_wrapper(struct mlx4_dev *dev, int slave, u64 flags; int err = 0; u8 field; + u16 field16; + u32 bmme_flags, field32; + int real_port; + int slave_port; + int first_port; + struct mlx4_active_ports actv_ports; err = mlx4_cmd_box(dev, 0, outbox->dma, 0, 0, MLX4_CMD_QUERY_DEV_CAP, MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); if (err) return err; - /* add port mng change event capability unconditionally to slaves */ + disable_unsupported_roce_caps(outbox->buf); + /* add port mng change event capability and disable mw type 1 + * unconditionally to slaves + */ MLX4_GET(flags, outbox->buf, QUERY_DEV_CAP_EXT_FLAGS_OFFSET); flags |= MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV; + flags &= ~MLX4_DEV_CAP_FLAG_MEM_WINDOW; + actv_ports = mlx4_get_active_ports(dev, slave); + first_port = find_first_bit(actv_ports.ports, dev->caps.num_ports); + for (slave_port = 0, real_port = first_port; + real_port < first_port + + bitmap_weight(actv_ports.ports, dev->caps.num_ports); + ++real_port, ++slave_port) { + if (flags & (MLX4_DEV_CAP_FLAG_WOL_PORT1 << real_port)) + flags |= MLX4_DEV_CAP_FLAG_WOL_PORT1 << slave_port; + else + flags &= ~(MLX4_DEV_CAP_FLAG_WOL_PORT1 << slave_port); + } + for (; slave_port < dev->caps.num_ports; ++slave_port) + flags &= ~(MLX4_DEV_CAP_FLAG_WOL_PORT1 << slave_port); + + /* Not exposing RSS IP fragments to guests */ + flags &= ~MLX4_DEV_CAP_FLAG_RSS_IP_FRAG; MLX4_PUT(outbox->buf, flags, QUERY_DEV_CAP_EXT_FLAGS_OFFSET); + MLX4_GET(field, outbox->buf, QUERY_DEV_CAP_VL_PORT_OFFSET); + field &= ~0x0F; + field |= bitmap_weight(actv_ports.ports, dev->caps.num_ports) & 0x0F; + MLX4_PUT(outbox->buf, field, QUERY_DEV_CAP_VL_PORT_OFFSET); + + /* For guests, disable timestamp */ + MLX4_GET(field, outbox->buf, QUERY_DEV_CAP_CQ_TS_SUPPORT_OFFSET); + field &= 0x7f; + MLX4_PUT(outbox->buf, field, QUERY_DEV_CAP_CQ_TS_SUPPORT_OFFSET); + + /* For guests, disable vxlan tunneling and QoS support */ + MLX4_GET(field, outbox->buf, QUERY_DEV_CAP_VXLAN); + field &= 0xd7; + MLX4_PUT(outbox->buf, field, QUERY_DEV_CAP_VXLAN); + + /* For guests, disable port BEACON */ + MLX4_GET(field, outbox->buf, QUERY_DEV_CAP_PORT_BEACON_OFFSET); + field &= 0x7f; + MLX4_PUT(outbox->buf, field, QUERY_DEV_CAP_PORT_BEACON_OFFSET); + /* For guests, report Blueflame disabled */ MLX4_GET(field, outbox->buf, QUERY_DEV_CAP_BF_OFFSET); field &= 0x7f; MLX4_PUT(outbox->buf, field, QUERY_DEV_CAP_BF_OFFSET); + /* For guests, disable mw type 2 and port remap*/ + MLX4_GET(bmme_flags, outbox->buf, QUERY_DEV_CAP_BMME_FLAGS_OFFSET); + bmme_flags &= ~MLX4_BMME_FLAG_TYPE_2_WIN; + bmme_flags &= ~MLX4_FLAG_PORT_REMAP; + MLX4_PUT(outbox->buf, bmme_flags, QUERY_DEV_CAP_BMME_FLAGS_OFFSET); + /* turn off device-managed steering capability if not enabled */ if (dev->caps.steering_mode != MLX4_STEERING_MODE_DEVICE_MANAGED) { MLX4_GET(field, outbox->buf, @@ -998,9 +1335,55 @@ int mlx4_QUERY_DEV_CAP_wrapper(struct mlx4_dev *dev, int slave, MLX4_PUT(outbox->buf, field, QUERY_DEV_CAP_FLOW_STEERING_RANGE_EN_OFFSET); } + + /* turn off ipoib managed steering for guests */ + MLX4_GET(field, outbox->buf, QUERY_DEV_CAP_FLOW_STEERING_IPOIB_OFFSET); + field &= ~0x80; + MLX4_PUT(outbox->buf, field, QUERY_DEV_CAP_FLOW_STEERING_IPOIB_OFFSET); + + /* turn off host side virt features (VST, FSM, etc) for guests */ + MLX4_GET(field32, outbox->buf, QUERY_DEV_CAP_EXT_2_FLAGS_OFFSET); + field32 &= ~(DEV_CAP_EXT_2_FLAG_VLAN_CONTROL | DEV_CAP_EXT_2_FLAG_80_VFS | + DEV_CAP_EXT_2_FLAG_FSM | DEV_CAP_EXT_2_FLAG_PFC_COUNTERS); + MLX4_PUT(outbox->buf, field32, QUERY_DEV_CAP_EXT_2_FLAGS_OFFSET); + + /* turn off QCN for guests */ + MLX4_GET(field, outbox->buf, QUERY_DEV_CAP_ECN_QCN_VER_OFFSET); + field &= 0xfe; + MLX4_PUT(outbox->buf, field, QUERY_DEV_CAP_ECN_QCN_VER_OFFSET); + + /* turn off QP max-rate limiting for guests */ + field16 = 0; + MLX4_PUT(outbox->buf, field16, QUERY_DEV_CAP_QP_RATE_LIMIT_NUM_OFFSET); + + /* turn off QoS per VF support for guests */ + MLX4_GET(field, outbox->buf, QUERY_DEV_CAP_CQ_EQ_CACHE_LINE_STRIDE); + field &= 0xef; + MLX4_PUT(outbox->buf, field, QUERY_DEV_CAP_CQ_EQ_CACHE_LINE_STRIDE); + + /* turn off ignore FCS feature for guests */ + MLX4_GET(field, outbox->buf, QUERY_DEV_CAP_CONFIG_DEV_OFFSET); + field &= 0xfb; + MLX4_PUT(outbox->buf, field, QUERY_DEV_CAP_CONFIG_DEV_OFFSET); + return 0; } +static void disable_unsupported_roce_caps(void *buf) +{ + u32 flags; + + MLX4_GET(flags, buf, QUERY_DEV_CAP_EXT_FLAGS_OFFSET); + flags &= ~(1UL << 31); + MLX4_PUT(buf, flags, QUERY_DEV_CAP_EXT_FLAGS_OFFSET); + MLX4_GET(flags, buf, QUERY_DEV_CAP_EXT_2_FLAGS_OFFSET); + flags &= ~(1UL << 24); + MLX4_PUT(buf, flags, QUERY_DEV_CAP_EXT_2_FLAGS_OFFSET); + MLX4_GET(flags, buf, QUERY_DEV_CAP_BMME_FLAGS_OFFSET); + flags &= ~(MLX4_FLAG_ROCE_V1_V2); + MLX4_PUT(buf, flags, QUERY_DEV_CAP_BMME_FLAGS_OFFSET); +} + int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_vhcr *vhcr, struct mlx4_cmd_mailbox *inbox, @@ -1012,19 +1395,30 @@ int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave, u8 port_type; u16 short_field; int err; - int admin_link_state; + int port = mlx4_slave_convert_port(dev, slave, + vhcr->in_modifier & 0xFF); #define MLX4_VF_PORT_NO_LINK_SENSE_MASK 0xE0 #define MLX4_PORT_LINK_UP_MASK 0x80 #define QUERY_PORT_CUR_MAX_PKEY_OFFSET 0x0c #define QUERY_PORT_CUR_MAX_GID_OFFSET 0x0e + if (port < 0) + return -EINVAL; + + /* Protect against untrusted guests: enforce that this is the + * QUERY_PORT general query. + */ + if (vhcr->op_modifier || vhcr->in_modifier & ~0xFF) + return -EINVAL; + + vhcr->in_modifier = port; + err = mlx4_cmd_box(dev, 0, outbox->dma, vhcr->in_modifier, 0, MLX4_CMD_QUERY_PORT, MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); if (!err && dev->caps.function != slave) { - /* set slave default_mac address to be zero MAC */ def_mac = priv->mfunc.master.vf_oper[slave].vport[vhcr->in_modifier].state.mac; MLX4_PUT(outbox->buf, def_mac, QUERY_PORT_MAC_OFFSET); @@ -1037,17 +1431,25 @@ int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave, /* set port type to currently operating port type */ port_type |= (dev->caps.port_type[vhcr->in_modifier] & 0x3); - admin_link_state = priv->mfunc.master.vf_oper[slave].vport[vhcr->in_modifier].state.link_state; - if (IFLA_VF_LINK_STATE_ENABLE == admin_link_state) + if (0 /* IFLA_VF_LINK_STATE_ENABLE == admin_link_state */) port_type |= MLX4_PORT_LINK_UP_MASK; - else if (IFLA_VF_LINK_STATE_DISABLE == admin_link_state) + else if (1 /* IFLA_VF_LINK_STATE_DISABLE == admin_link_state */) port_type &= ~MLX4_PORT_LINK_UP_MASK; + else if (0 /* IFLA_VF_LINK_STATE_AUTO == admin_link_state && mlx4_is_bonded(dev) */) { + int other_port = (port == 1) ? 2 : 1; + struct mlx4_port_cap port_cap; + + err = mlx4_QUERY_PORT(dev, other_port, &port_cap); + if (err) + goto out; + port_type |= (port_cap.link_state << 7); + } MLX4_PUT(outbox->buf, port_type, QUERY_PORT_SUPPORTED_TYPE_OFFSET); if (dev->caps.port_type[vhcr->in_modifier] == MLX4_PORT_TYPE_ETH) - short_field = mlx4_get_slave_num_gids(dev, slave); + short_field = mlx4_get_slave_num_gids(dev, slave, port); else short_field = 1; /* slave max gids */ MLX4_PUT(outbox->buf, short_field, @@ -1057,7 +1459,7 @@ int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave, MLX4_PUT(outbox->buf, short_field, QUERY_PORT_CUR_MAX_PKEY_OFFSET); } - +out: return err; } @@ -1107,7 +1509,6 @@ int mlx4_map_cmd(struct mlx4_dev *dev, u16 op, struct mlx4_icm *icm, u64 virt) mailbox = mlx4_alloc_cmd_mailbox(dev); if (IS_ERR(mailbox)) return PTR_ERR(mailbox); - memset(mailbox->buf, 0, MLX4_MAILBOX_SIZE); pages = mailbox->buf; for (mlx4_icm_first(icm, &iter); @@ -1120,10 +1521,10 @@ int mlx4_map_cmd(struct mlx4_dev *dev, u16 op, struct mlx4_icm *icm, u64 virt) */ lg = ffs(mlx4_icm_addr(&iter) | mlx4_icm_size(&iter)) - 1; if (lg < MLX4_ICM_PAGE_SHIFT) { - mlx4_warn(dev, "Got FW area not aligned to %d (%llx/%lx).\n", - MLX4_ICM_PAGE_SIZE, - (unsigned long long) mlx4_icm_addr(&iter), - mlx4_icm_size(&iter)); + mlx4_warn(dev, "Got FW area not aligned to %d (%llx/%lx)\n", + MLX4_ICM_PAGE_SIZE, + (unsigned long long) mlx4_icm_addr(&iter), + mlx4_icm_size(&iter)); err = -EINVAL; goto out; } @@ -1159,14 +1560,14 @@ int mlx4_map_cmd(struct mlx4_dev *dev, u16 op, struct mlx4_icm *icm, u64 virt) switch (op) { case MLX4_CMD_MAP_FA: - mlx4_dbg(dev, "Mapped %d chunks/%d KB for FW.\n", tc, ts); + mlx4_dbg(dev, "Mapped %d chunks/%d KB for FW\n", tc, ts); break; case MLX4_CMD_MAP_ICM_AUX: - mlx4_dbg(dev, "Mapped %d chunks/%d KB for ICM aux.\n", tc, ts); + mlx4_dbg(dev, "Mapped %d chunks/%d KB for ICM aux\n", tc, ts); break; case MLX4_CMD_MAP_ICM: - mlx4_dbg(dev, "Mapped %d chunks/%d KB at %llx for ICM.\n", - tc, ts, (unsigned long long) virt - (ts << 10)); + mlx4_dbg(dev, "Mapped %d chunks/%d KB at %llx for ICM\n", + tc, ts, (unsigned long long) virt - (ts << 10)); break; } @@ -1252,14 +1653,13 @@ int mlx4_QUERY_FW(struct mlx4_dev *dev) MLX4_GET(cmd_if_rev, outbox, QUERY_FW_CMD_IF_REV_OFFSET); if (cmd_if_rev < MLX4_COMMAND_INTERFACE_MIN_REV || cmd_if_rev > MLX4_COMMAND_INTERFACE_MAX_REV) { - mlx4_err(dev, "Installed FW has unsupported " - "command interface revision %d.\n", + mlx4_err(dev, "Installed FW has unsupported command interface revision %d\n", cmd_if_rev); mlx4_err(dev, "(Installed FW version is %d.%d.%03d)\n", (int) (dev->caps.fw_ver >> 32), (int) (dev->caps.fw_ver >> 16) & 0xffff, (int) dev->caps.fw_ver & 0xffff); - mlx4_err(dev, "This driver version supports only revisions %d to %d.\n", + mlx4_err(dev, "This driver version supports only revisions %d to %d\n", MLX4_COMMAND_INTERFACE_MIN_REV, MLX4_COMMAND_INTERFACE_MAX_REV); err = -ENODEV; goto out; @@ -1301,7 +1701,7 @@ int mlx4_QUERY_FW(struct mlx4_dev *dev) MLX4_GET(fw->clock_bar, outbox, QUERY_FW_CLOCK_BAR); fw->clock_bar = (fw->clock_bar >> 6) * 2; mlx4_dbg(dev, "Internal clock bar:%d offset:0x%llx\n", - fw->comm_bar, (unsigned long long)fw->comm_base); + fw->clock_bar, (unsigned long long)fw->clock_offset); /* * Round up number of system pages needed in case @@ -1343,7 +1743,7 @@ int mlx4_QUERY_FW_wrapper(struct mlx4_dev *dev, int slave, return 0; } -static void get_board_id(void *vsd, char *board_id, char *vsdstr) +static void get_board_id(void *vsd, char *board_id) { int i; @@ -1351,16 +1751,9 @@ static void get_board_id(void *vsd, char *board_id, char *vsdstr) #define VSD_OFFSET_SIG2 0xde #define VSD_OFFSET_MLX_BOARD_ID 0xd0 #define VSD_OFFSET_TS_BOARD_ID 0x20 -#define VSD_LEN 0xd0 #define VSD_SIGNATURE_TOPSPIN 0x5ad - memset(vsdstr, 0, MLX4_VSD_LEN); - - for (i = 0; i < VSD_LEN / 4; i++) - ((u32 *)vsdstr)[i] = - swab32(*(u32 *)(vsd + i * 4)); - memset(board_id, 0, MLX4_BOARD_ID_LEN); if (be16_to_cpup(vsd + VSD_OFFSET_SIG1) == VSD_SIGNATURE_TOPSPIN && @@ -1372,9 +1765,19 @@ static void get_board_id(void *vsd, char *board_id, char *vsdstr) * swaps each 4-byte word before passing it back to * us. Therefore we need to swab it before printing. */ - for (i = 0; i < 4; ++i) - ((u32 *) board_id)[i] = - swab32(*(u32 *) (vsd + VSD_OFFSET_MLX_BOARD_ID + i * 4)); + u32 *bid_u32 = (u32 *)board_id; + + for (i = 0; i < 4; ++i) { + typedef struct { u32 value; } __packed u64_p_t; + + u32 *addr; + u32 val; + + addr = (u32 *) (vsd + VSD_OFFSET_MLX_BOARD_ID + i * 4); + val = ((u64_p_t *)addr)->value; + val = swab32(val); + ((u64_p_t *)&bid_u32[i])->value = val; + } } } @@ -1387,7 +1790,6 @@ int mlx4_QUERY_ADAPTER(struct mlx4_dev *dev, struct mlx4_adapter *adapter) #define QUERY_ADAPTER_OUT_SIZE 0x100 #define QUERY_ADAPTER_INTA_PIN_OFFSET 0x10 #define QUERY_ADAPTER_VSD_OFFSET 0x20 -#define QUERY_ADAPTER_VSD_VENDOR_ID_OFFSET 0x1e mailbox = mlx4_alloc_cmd_mailbox(dev); if (IS_ERR(mailbox)) @@ -1401,11 +1803,8 @@ int mlx4_QUERY_ADAPTER(struct mlx4_dev *dev, struct mlx4_adapter *adapter) MLX4_GET(adapter->inta_pin, outbox, QUERY_ADAPTER_INTA_PIN_OFFSET); - adapter->vsd_vendor_id = be16_to_cpup((u16 *)outbox + - QUERY_ADAPTER_VSD_VENDOR_ID_OFFSET / 2); - get_board_id(outbox + QUERY_ADAPTER_VSD_OFFSET / 4, - adapter->board_id, adapter->vsd); + adapter->board_id); out: mlx4_free_cmd_mailbox(dev, mailbox); @@ -1416,13 +1815,18 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param) { struct mlx4_cmd_mailbox *mailbox; __be32 *inbox; - u32 mw_enable; int err; + static const u8 a0_dmfs_hw_steering[] = { + [MLX4_STEERING_DMFS_A0_DEFAULT] = 0, + [MLX4_STEERING_DMFS_A0_DYNAMIC] = 1, + [MLX4_STEERING_DMFS_A0_STATIC] = 2, + [MLX4_STEERING_DMFS_A0_DISABLE] = 3 + }; #define INIT_HCA_IN_SIZE 0x200 -#define INIT_HCA_DRV_NAME_FOR_FW_MAX_SIZE 64 #define INIT_HCA_VERSION_OFFSET 0x000 #define INIT_HCA_VERSION 2 +#define INIT_HCA_VXLAN_OFFSET 0x0c #define INIT_HCA_CACHELINE_SZ_OFFSET 0x0e #define INIT_HCA_FLAGS_OFFSET 0x014 #define INIT_HCA_RECOVERABLE_ERROR_EVENT_OFFSET 0x018 @@ -1434,6 +1838,7 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param) #define INIT_HCA_CQC_BASE_OFFSET (INIT_HCA_QPC_OFFSET + 0x30) #define INIT_HCA_LOG_CQ_OFFSET (INIT_HCA_QPC_OFFSET + 0x37) #define INIT_HCA_EQE_CQE_OFFSETS (INIT_HCA_QPC_OFFSET + 0x38) +#define INIT_HCA_EQE_CQE_STRIDE_OFFSET (INIT_HCA_QPC_OFFSET + 0x3b) #define INIT_HCA_ALTC_BASE_OFFSET (INIT_HCA_QPC_OFFSET + 0x40) #define INIT_HCA_AUXC_BASE_OFFSET (INIT_HCA_QPC_OFFSET + 0x50) #define INIT_HCA_EQC_BASE_OFFSET (INIT_HCA_QPC_OFFSET + 0x60) @@ -1448,10 +1853,10 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param) #define INIT_HCA_UC_STEERING_OFFSET (INIT_HCA_MCAST_OFFSET + 0x18) #define INIT_HCA_LOG_MC_TABLE_SZ_OFFSET (INIT_HCA_MCAST_OFFSET + 0x1b) #define INIT_HCA_DEVICE_MANAGED_FLOW_STEERING_EN 0x6 -#define INIT_HCA_DRIVER_VERSION_OFFSET 0x140 #define INIT_HCA_FS_PARAM_OFFSET 0x1d0 #define INIT_HCA_FS_BASE_OFFSET (INIT_HCA_FS_PARAM_OFFSET + 0x00) #define INIT_HCA_FS_LOG_ENTRY_SZ_OFFSET (INIT_HCA_FS_PARAM_OFFSET + 0x12) +#define INIT_HCA_FS_A0_OFFSET (INIT_HCA_FS_PARAM_OFFSET + 0x18) #define INIT_HCA_FS_LOG_TABLE_SZ_OFFSET (INIT_HCA_FS_PARAM_OFFSET + 0x1b) #define INIT_HCA_FS_ETH_BITS_OFFSET (INIT_HCA_FS_PARAM_OFFSET + 0x21) #define INIT_HCA_FS_ETH_NUM_ADDRS_OFFSET (INIT_HCA_FS_PARAM_OFFSET + 0x22) @@ -1460,7 +1865,6 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param) #define INIT_HCA_TPT_OFFSET 0x0f0 #define INIT_HCA_DMPT_BASE_OFFSET (INIT_HCA_TPT_OFFSET + 0x00) #define INIT_HCA_TPT_MW_OFFSET (INIT_HCA_TPT_OFFSET + 0x08) -#define INIT_HCA_TPT_MW_ENABLE (1 << 31) #define INIT_HCA_LOG_MPT_SZ_OFFSET (INIT_HCA_TPT_OFFSET + 0x0b) #define INIT_HCA_MTT_BASE_OFFSET (INIT_HCA_TPT_OFFSET + 0x10) #define INIT_HCA_CMPT_BASE_OFFSET (INIT_HCA_TPT_OFFSET + 0x18) @@ -1473,12 +1877,10 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param) return PTR_ERR(mailbox); inbox = mailbox->buf; - memset(inbox, 0, INIT_HCA_IN_SIZE); - *((u8 *) mailbox->buf + INIT_HCA_VERSION_OFFSET) = INIT_HCA_VERSION; *((u8 *) mailbox->buf + INIT_HCA_CACHELINE_SZ_OFFSET) = - ((ilog2(cache_line_size()) - 4) << 5) | (1 << 4); + (ilog2(cache_line_size()) - 4) << 5; #if defined(__LITTLE_ENDIAN) *(inbox + INIT_HCA_FLAGS_OFFSET / 4) &= ~cpu_to_be32(1 << 1); @@ -1495,18 +1897,18 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param) *(inbox + INIT_HCA_FLAGS_OFFSET / 4) |= cpu_to_be32(1 << 3); /* Enable QoS support if module parameter set */ - if (enable_qos) + if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ETS_CFG && enable_qos) *(inbox + INIT_HCA_FLAGS_OFFSET / 4) |= cpu_to_be32(1 << 2); - /* Enable fast drop performance optimization */ - if (dev->caps.fast_drop) - *(inbox + INIT_HCA_FLAGS_OFFSET / 4) |= cpu_to_be32(1 << 7); - /* enable counters */ if (dev->caps.flags & MLX4_DEV_CAP_FLAG_COUNTERS) *(inbox + INIT_HCA_FLAGS_OFFSET / 4) |= cpu_to_be32(1 << 4); - /* CX3 is capable of extending CQEs\EQEs from 32 to 64 bytes */ + /* Enable RSS spread to fragmented IP packets when supported */ + if (dev->caps.flags & MLX4_DEV_CAP_FLAG_RSS_IP_FRAG) + *(inbox + INIT_HCA_FLAGS_OFFSET / 4) |= cpu_to_be32(1 << 13); + + /* CX3 is capable of extending CQEs/EQEs from 32 to 64 bytes */ if (dev->caps.flags & MLX4_DEV_CAP_FLAG_64B_EQE) { *(inbox + INIT_HCA_EQE_CQE_OFFSETS / 4) |= cpu_to_be32(1 << 29); dev->caps.eqe_size = 64; @@ -1519,22 +1921,31 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param) if (dev->caps.flags & MLX4_DEV_CAP_FLAG_64B_CQE) { *(inbox + INIT_HCA_EQE_CQE_OFFSETS / 4) |= cpu_to_be32(1 << 30); dev->caps.cqe_size = 64; - dev->caps.userspace_caps |= MLX4_USER_DEV_CAP_64B_CQE; + dev->caps.userspace_caps |= MLX4_USER_DEV_CAP_LARGE_CQE; } else { dev->caps.cqe_size = 32; } +#if 0 + /* XXX not currently supported by the FreeBSD's mlxen */ + /* CX3 is capable of extending CQEs\EQEs to strides larger than 64B */ + if ((dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_EQE_STRIDE) && + (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_CQE_STRIDE)) { + dev->caps.eqe_size = cache_line_size(); + dev->caps.cqe_size = cache_line_size(); + dev->caps.eqe_factor = 0; + MLX4_PUT(inbox, (u8)((ilog2(dev->caps.eqe_size) - 5) << 4 | + (ilog2(dev->caps.eqe_size) - 5)), + INIT_HCA_EQE_CQE_STRIDE_OFFSET); + + /* User still need to know to support CQE > 32B */ + dev->caps.userspace_caps |= MLX4_USER_DEV_CAP_LARGE_CQE; + } +#endif + if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_RECOVERABLE_ERROR_EVENT) *(inbox + INIT_HCA_RECOVERABLE_ERROR_EVENT_OFFSET / 4) |= cpu_to_be32(1 << 31); - if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_DRIVER_VERSION_TO_FW) { - strncpy((u8 *)mailbox->buf + INIT_HCA_DRIVER_VERSION_OFFSET, - DRV_NAME_FOR_FW, - INIT_HCA_DRV_NAME_FOR_FW_MAX_SIZE - 1); - mlx4_dbg(dev, "Reporting Driver Version to FW: %s\n", - (u8 *)mailbox->buf + INIT_HCA_DRIVER_VERSION_OFFSET); - } - /* QPC/EEC/CQC/EQC/RDMARC attributes */ MLX4_PUT(inbox, param->qpc_base, INIT_HCA_QPC_BASE_OFFSET); @@ -1566,8 +1977,11 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param) /* Enable Ethernet flow steering * with udp unicast and tcp unicast */ - MLX4_PUT(inbox, (u8) (MLX4_FS_UDP_UC_EN | MLX4_FS_TCP_UC_EN), - INIT_HCA_FS_ETH_BITS_OFFSET); + if (dev->caps.dmfs_high_steer_mode != + MLX4_STEERING_DMFS_A0_STATIC) + MLX4_PUT(inbox, + (u8)(MLX4_FS_UDP_UC_EN | MLX4_FS_TCP_UC_EN), + INIT_HCA_FS_ETH_BITS_OFFSET); MLX4_PUT(inbox, (u16) MLX4_FS_NUM_OF_L2_ADDR, INIT_HCA_FS_ETH_NUM_ADDRS_OFFSET); /* Enable IPoIB flow steering @@ -1577,6 +1991,13 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param) INIT_HCA_FS_IB_BITS_OFFSET); MLX4_PUT(inbox, (u16) MLX4_FS_NUM_OF_L2_ADDR, INIT_HCA_FS_IB_NUM_ADDRS_OFFSET); + + if (dev->caps.dmfs_high_steer_mode != + MLX4_STEERING_DMFS_A0_NOT_SUPPORTED) + MLX4_PUT(inbox, + ((u8)(a0_dmfs_hw_steering[dev->caps.dmfs_high_steer_mode] + << 6)), + INIT_HCA_FS_A0_OFFSET); } else { MLX4_PUT(inbox, param->mc_base, INIT_HCA_MC_BASE_OFFSET); MLX4_PUT(inbox, param->log_mc_entry_sz, @@ -1593,8 +2014,7 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param) /* TPT attributes */ MLX4_PUT(inbox, param->dmpt_base, INIT_HCA_DMPT_BASE_OFFSET); - mw_enable = param->mw_enable ? INIT_HCA_TPT_MW_ENABLE : 0; - MLX4_PUT(inbox, mw_enable, INIT_HCA_TPT_MW_OFFSET); + MLX4_PUT(inbox, param->mw_enabled, INIT_HCA_TPT_MW_OFFSET); MLX4_PUT(inbox, param->log_mpt_sz, INIT_HCA_LOG_MPT_SZ_OFFSET); MLX4_PUT(inbox, param->mtt_base, INIT_HCA_MTT_BASE_OFFSET); MLX4_PUT(inbox, param->cmpt_base, INIT_HCA_CMPT_BASE_OFFSET); @@ -1604,8 +2024,14 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param) MLX4_PUT(inbox, param->uar_page_sz, INIT_HCA_UAR_PAGE_SZ_OFFSET); MLX4_PUT(inbox, param->log_uar_sz, INIT_HCA_LOG_UAR_SZ_OFFSET); - err = mlx4_cmd(dev, mailbox->dma, 0, 0, MLX4_CMD_INIT_HCA, 10000, - MLX4_CMD_NATIVE); + /* set parser VXLAN attributes */ + if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS) { + u8 parser_params = 0; + MLX4_PUT(inbox, parser_params, INIT_HCA_VXLAN_OFFSET); + } + + err = mlx4_cmd(dev, mailbox->dma, 0, 0, MLX4_CMD_INIT_HCA, + MLX4_CMD_TIME_CLASS_C, MLX4_CMD_NATIVE); if (err) mlx4_err(dev, "INIT_HCA returns %d\n", err); @@ -1620,9 +2046,14 @@ int mlx4_QUERY_HCA(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox; __be32 *outbox; u32 dword_field; - u32 mw_enable; int err; u8 byte_field; + static const u8 a0_dmfs_query_hw_steering[] = { + [0] = MLX4_STEERING_DMFS_A0_DEFAULT, + [1] = MLX4_STEERING_DMFS_A0_DYNAMIC, + [2] = MLX4_STEERING_DMFS_A0_STATIC, + [3] = MLX4_STEERING_DMFS_A0_DISABLE + }; #define QUERY_HCA_GLOBAL_CAPS_OFFSET 0x04 #define QUERY_HCA_CORE_CLOCK_OFFSET 0x0c @@ -1668,6 +2099,10 @@ int mlx4_QUERY_HCA(struct mlx4_dev *dev, else param->steering_mode = MLX4_STEERING_MODE_A0; } + + if (dword_field & (1 << 13)) + param->rss_ip_frags = 1; + /* steering attributes */ if (param->steering_mode == MLX4_STEERING_MODE_DEVICE_MANAGED) { MLX4_GET(param->mc_base, outbox, INIT_HCA_FS_BASE_OFFSET); @@ -1675,6 +2110,10 @@ int mlx4_QUERY_HCA(struct mlx4_dev *dev, INIT_HCA_FS_LOG_ENTRY_SZ_OFFSET); MLX4_GET(param->log_mc_table_sz, outbox, INIT_HCA_FS_LOG_TABLE_SZ_OFFSET); + MLX4_GET(byte_field, outbox, + INIT_HCA_FS_A0_OFFSET); + param->dmfs_high_steer_mode = + a0_dmfs_query_hw_steering[(byte_field >> 6) & 3]; } else { MLX4_GET(param->mc_base, outbox, INIT_HCA_MC_BASE_OFFSET); MLX4_GET(param->log_mc_entry_sz, outbox, @@ -1685,19 +2124,28 @@ int mlx4_QUERY_HCA(struct mlx4_dev *dev, INIT_HCA_LOG_MC_TABLE_SZ_OFFSET); } - /* CX3 is capable of extending CQEs\EQEs from 32 to 64 bytes */ + /* CX3 is capable of extending CQEs/EQEs from 32 to 64 bytes */ MLX4_GET(byte_field, outbox, INIT_HCA_EQE_CQE_OFFSETS); if (byte_field & 0x20) /* 64-bytes eqe enabled */ param->dev_cap_enabled |= MLX4_DEV_CAP_64B_EQE_ENABLED; if (byte_field & 0x40) /* 64-bytes cqe enabled */ param->dev_cap_enabled |= MLX4_DEV_CAP_64B_CQE_ENABLED; + /* CX3 is capable of extending CQEs\EQEs to strides larger than 64B */ + MLX4_GET(byte_field, outbox, INIT_HCA_EQE_CQE_STRIDE_OFFSET); + if (byte_field) { + param->dev_cap_enabled |= MLX4_DEV_CAP_EQE_STRIDE_ENABLED; + param->dev_cap_enabled |= MLX4_DEV_CAP_CQE_STRIDE_ENABLED; + param->cqe_size = 1 << ((byte_field & + MLX4_CQE_SIZE_MASK_STRIDE) + 5); + param->eqe_size = 1 << (((byte_field & + MLX4_EQE_SIZE_MASK_STRIDE) >> 4) + 5); + } + /* TPT attributes */ MLX4_GET(param->dmpt_base, outbox, INIT_HCA_DMPT_BASE_OFFSET); - MLX4_GET(mw_enable, outbox, INIT_HCA_TPT_MW_OFFSET); - param->mw_enable = (mw_enable & INIT_HCA_TPT_MW_ENABLE) == - INIT_HCA_TPT_MW_ENABLE; + MLX4_GET(param->mw_enabled, outbox, INIT_HCA_TPT_MW_OFFSET); MLX4_GET(param->log_mpt_sz, outbox, INIT_HCA_LOG_MPT_SZ_OFFSET); MLX4_GET(param->mtt_base, outbox, INIT_HCA_MTT_BASE_OFFSET); MLX4_GET(param->cmpt_base, outbox, INIT_HCA_CMPT_BASE_OFFSET); @@ -1707,6 +2155,40 @@ int mlx4_QUERY_HCA(struct mlx4_dev *dev, MLX4_GET(param->uar_page_sz, outbox, INIT_HCA_UAR_PAGE_SZ_OFFSET); MLX4_GET(param->log_uar_sz, outbox, INIT_HCA_LOG_UAR_SZ_OFFSET); + /* phv_check enable */ + MLX4_GET(byte_field, outbox, INIT_HCA_CACHELINE_SZ_OFFSET); + if (byte_field & 0x2) + param->phv_check_en = 1; +out: + mlx4_free_cmd_mailbox(dev, mailbox); + + return err; +} + +static int mlx4_hca_core_clock_update(struct mlx4_dev *dev) +{ + struct mlx4_cmd_mailbox *mailbox; + __be32 *outbox; + int err; + + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) { + mlx4_warn(dev, "hca_core_clock mailbox allocation failed\n"); + return PTR_ERR(mailbox); + } + outbox = mailbox->buf; + + err = mlx4_cmd_box(dev, 0, mailbox->dma, 0, 0, + MLX4_CMD_QUERY_HCA, + MLX4_CMD_TIME_CLASS_B, + !mlx4_is_slave(dev)); + if (err) { + mlx4_warn(dev, "hca_core_clock update failed\n"); + goto out; + } + + MLX4_GET(dev->caps.hca_core_clock, outbox, QUERY_HCA_CORE_CLOCK_OFFSET); + out: mlx4_free_cmd_mailbox(dev, mailbox); @@ -1733,9 +2215,12 @@ int mlx4_INIT_PORT_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_cmd_info *cmd) { struct mlx4_priv *priv = mlx4_priv(dev); - int port = vhcr->in_modifier; + int port = mlx4_slave_convert_port(dev, slave, vhcr->in_modifier); int err; + if (port < 0) + return -EINVAL; + if (priv->mfunc.master.slave_state[slave].init_port_mask & (1 << port)) return 0; @@ -1794,8 +2279,6 @@ int mlx4_INIT_PORT(struct mlx4_dev *dev, int port) return PTR_ERR(mailbox); inbox = mailbox->buf; - memset(inbox, 0, INIT_PORT_IN_SIZE); - flags = 0; flags |= (dev->caps.vl_cap[port] & 0xf) << INIT_PORT_VL_SHIFT; flags |= (dev->caps.port_width_cap[port] & 0xf) << INIT_PORT_PORT_WIDTH_SHIFT; @@ -1816,6 +2299,9 @@ int mlx4_INIT_PORT(struct mlx4_dev *dev, int port) err = mlx4_cmd(dev, 0, port, 0, MLX4_CMD_INIT_PORT, MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED); + if (!err) + mlx4_hca_core_clock_update(dev); + return err; } EXPORT_SYMBOL_GPL(mlx4_INIT_PORT); @@ -1827,9 +2313,12 @@ int mlx4_CLOSE_PORT_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_cmd_info *cmd) { struct mlx4_priv *priv = mlx4_priv(dev); - int port = vhcr->in_modifier; + int port = mlx4_slave_convert_port(dev, slave, vhcr->in_modifier); int err; + if (port < 0) + return -EINVAL; + if (!(priv->mfunc.master.slave_state[slave].init_port_mask & (1 << port))) return 0; @@ -1837,7 +2326,7 @@ int mlx4_CLOSE_PORT_wrapper(struct mlx4_dev *dev, int slave, if (dev->caps.port_mask[port] != MLX4_PORT_TYPE_IB) { if (priv->mfunc.master.init_port_ref[port] == 1) { err = mlx4_cmd(dev, 0, port, 0, MLX4_CMD_CLOSE_PORT, - 1000, MLX4_CMD_NATIVE); + MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); if (err) return err; } @@ -1848,7 +2337,7 @@ int mlx4_CLOSE_PORT_wrapper(struct mlx4_dev *dev, int slave, if (!priv->mfunc.master.qp0_state[port].qp0_active && priv->mfunc.master.qp0_state[port].port_active) { err = mlx4_cmd(dev, 0, port, 0, MLX4_CMD_CLOSE_PORT, - 1000, MLX4_CMD_NATIVE); + MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); if (err) return err; priv->mfunc.master.slave_state[slave].init_port_mask &= ~(1 << port); @@ -1863,17 +2352,188 @@ int mlx4_CLOSE_PORT_wrapper(struct mlx4_dev *dev, int slave, int mlx4_CLOSE_PORT(struct mlx4_dev *dev, int port) { - return mlx4_cmd(dev, 0, port, 0, MLX4_CMD_CLOSE_PORT, 1000, - MLX4_CMD_WRAPPED); + return mlx4_cmd(dev, 0, port, 0, MLX4_CMD_CLOSE_PORT, + MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED); } EXPORT_SYMBOL_GPL(mlx4_CLOSE_PORT); int mlx4_CLOSE_HCA(struct mlx4_dev *dev, int panic) { - return mlx4_cmd(dev, 0, 0, panic, MLX4_CMD_CLOSE_HCA, 1000, - MLX4_CMD_NATIVE); + return mlx4_cmd(dev, 0, 0, panic, MLX4_CMD_CLOSE_HCA, + MLX4_CMD_TIME_CLASS_C, MLX4_CMD_NATIVE); } +struct mlx4_config_dev { + __be32 update_flags; + __be32 rsvd1[3]; + __be16 vxlan_udp_dport; + __be16 rsvd2; + __be16 roce_v2_entropy; + __be16 roce_v2_udp_dport; + __be32 roce_flags; + __be32 rsvd4[25]; + __be16 rsvd5; + u8 rsvd6; + u8 rx_checksum_val; +}; + +#define MLX4_VXLAN_UDP_DPORT (1 << 0) +#define MLX4_ROCE_V2_UDP_DPORT BIT(3) +#define MLX4_DISABLE_RX_PORT BIT(18) + +static int mlx4_CONFIG_DEV_set(struct mlx4_dev *dev, struct mlx4_config_dev *config_dev) +{ + int err; + struct mlx4_cmd_mailbox *mailbox; + + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) + return PTR_ERR(mailbox); + + memcpy(mailbox->buf, config_dev, sizeof(*config_dev)); + + err = mlx4_cmd(dev, mailbox->dma, 0, 0, MLX4_CMD_CONFIG_DEV, + MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); + + mlx4_free_cmd_mailbox(dev, mailbox); + return err; +} + +static int mlx4_CONFIG_DEV_get(struct mlx4_dev *dev, struct mlx4_config_dev *config_dev) +{ + int err; + struct mlx4_cmd_mailbox *mailbox; + + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) + return PTR_ERR(mailbox); + + err = mlx4_cmd_box(dev, 0, mailbox->dma, 0, 1, MLX4_CMD_CONFIG_DEV, + MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); + + if (!err) + memcpy(config_dev, mailbox->buf, sizeof(*config_dev)); + + mlx4_free_cmd_mailbox(dev, mailbox); + return err; +} + +/* Conversion between the HW values and the actual functionality. + * The value represented by the array index, + * and the functionality determined by the flags. + */ +static const u8 config_dev_csum_flags[] = { + [0] = 0, + [1] = MLX4_RX_CSUM_MODE_VAL_NON_TCP_UDP, + [2] = MLX4_RX_CSUM_MODE_VAL_NON_TCP_UDP | + MLX4_RX_CSUM_MODE_L4, + [3] = MLX4_RX_CSUM_MODE_L4 | + MLX4_RX_CSUM_MODE_IP_OK_IP_NON_TCP_UDP | + MLX4_RX_CSUM_MODE_MULTI_VLAN +}; + +int mlx4_config_dev_retrieval(struct mlx4_dev *dev, + struct mlx4_config_dev_params *params) +{ + struct mlx4_config_dev config_dev = {0}; + int err; + u8 csum_mask; + +#define CONFIG_DEV_RX_CSUM_MODE_MASK 0x7 +#define CONFIG_DEV_RX_CSUM_MODE_PORT1_BIT_OFFSET 0 +#define CONFIG_DEV_RX_CSUM_MODE_PORT2_BIT_OFFSET 4 + + if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_CONFIG_DEV)) + return -ENOTSUPP; + + err = mlx4_CONFIG_DEV_get(dev, &config_dev); + if (err) + return err; + + csum_mask = (config_dev.rx_checksum_val >> CONFIG_DEV_RX_CSUM_MODE_PORT1_BIT_OFFSET) & + CONFIG_DEV_RX_CSUM_MODE_MASK; + + if (csum_mask >= sizeof(config_dev_csum_flags)/sizeof(config_dev_csum_flags[0])) + return -EINVAL; + params->rx_csum_flags_port_1 = config_dev_csum_flags[csum_mask]; + + csum_mask = (config_dev.rx_checksum_val >> CONFIG_DEV_RX_CSUM_MODE_PORT2_BIT_OFFSET) & + CONFIG_DEV_RX_CSUM_MODE_MASK; + + if (csum_mask >= sizeof(config_dev_csum_flags)/sizeof(config_dev_csum_flags[0])) + return -EINVAL; + params->rx_csum_flags_port_2 = config_dev_csum_flags[csum_mask]; + + params->vxlan_udp_dport = be16_to_cpu(config_dev.vxlan_udp_dport); + + return 0; +} +EXPORT_SYMBOL_GPL(mlx4_config_dev_retrieval); + +int mlx4_config_vxlan_port(struct mlx4_dev *dev, __be16 udp_port) +{ + struct mlx4_config_dev config_dev; + + memset(&config_dev, 0, sizeof(config_dev)); + config_dev.update_flags = cpu_to_be32(MLX4_VXLAN_UDP_DPORT); + config_dev.vxlan_udp_dport = udp_port; + + return mlx4_CONFIG_DEV_set(dev, &config_dev); +} +EXPORT_SYMBOL_GPL(mlx4_config_vxlan_port); + +#define CONFIG_DISABLE_RX_PORT BIT(15) +int mlx4_disable_rx_port_check(struct mlx4_dev *dev, bool dis) +{ + struct mlx4_config_dev config_dev; + + memset(&config_dev, 0, sizeof(config_dev)); + config_dev.update_flags = cpu_to_be32(MLX4_DISABLE_RX_PORT); + if (dis) + config_dev.roce_flags = + cpu_to_be32(CONFIG_DISABLE_RX_PORT); + + return mlx4_CONFIG_DEV_set(dev, &config_dev); +} + +int mlx4_config_roce_v2_port(struct mlx4_dev *dev, u16 udp_port) +{ + struct mlx4_config_dev config_dev; + + memset(&config_dev, 0, sizeof(config_dev)); + config_dev.update_flags = cpu_to_be32(MLX4_ROCE_V2_UDP_DPORT); + config_dev.roce_v2_udp_dport = cpu_to_be16(udp_port); + + return mlx4_CONFIG_DEV_set(dev, &config_dev); +} +EXPORT_SYMBOL_GPL(mlx4_config_roce_v2_port); + +int mlx4_virt2phy_port_map(struct mlx4_dev *dev, u32 port1, u32 port2) +{ + struct mlx4_cmd_mailbox *mailbox; + struct { + __be32 v_port1; + __be32 v_port2; + } *v2p; + int err; + + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) + return -ENOMEM; + + v2p = mailbox->buf; + v2p->v_port1 = cpu_to_be32(port1); + v2p->v_port2 = cpu_to_be32(port2); + + err = mlx4_cmd(dev, mailbox->dma, 0, + MLX4_SET_PORT_VIRT2PHY, MLX4_CMD_VIRT_PORT_MAP, + MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); + + mlx4_free_cmd_mailbox(dev, mailbox); + return err; +} + + int mlx4_SET_ICM_SIZE(struct mlx4_dev *dev, u64 icm_size, u64 *aux_pages) { int ret = mlx4_cmd_imm(dev, icm_size, aux_pages, 0, 0, @@ -1895,51 +2555,81 @@ int mlx4_SET_ICM_SIZE(struct mlx4_dev *dev, u64 icm_size, u64 *aux_pages) int mlx4_NOP(struct mlx4_dev *dev) { /* Input modifier of 0x1f means "finish as soon as possible." */ - return mlx4_cmd(dev, 0, 0x1f, 0, MLX4_CMD_NOP, MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); + return mlx4_cmd(dev, 0, 0x1f, 0, MLX4_CMD_NOP, MLX4_CMD_TIME_CLASS_A, + MLX4_CMD_NATIVE); } -int mlx4_query_diag_counters(struct mlx4_dev *dev, int array_length, - u8 op_modifier, u32 in_offset[], - u32 counter_out[]) +int mlx4_query_diag_counters(struct mlx4_dev *dev, u8 op_modifier, + const u32 offset[], + u32 value[], size_t array_len, u8 port) { struct mlx4_cmd_mailbox *mailbox; u32 *outbox; + size_t i; int ret; - int i; mailbox = mlx4_alloc_cmd_mailbox(dev); if (IS_ERR(mailbox)) return PTR_ERR(mailbox); + outbox = mailbox->buf; - ret = mlx4_cmd_box(dev, 0, mailbox->dma, 0, op_modifier, + ret = mlx4_cmd_box(dev, 0, mailbox->dma, port, op_modifier, MLX4_CMD_DIAG_RPRT, MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); if (ret) goto out; - for (i = 0; i < array_length; i++) { - if (in_offset[i] > MLX4_MAILBOX_SIZE) { + for (i = 0; i < array_len; i++) { + if (offset[i] > MLX4_MAILBOX_SIZE) { ret = -EINVAL; goto out; } - MLX4_GET(counter_out[i], outbox, in_offset[i]); + MLX4_GET(value[i], outbox, offset[i]); } out: mlx4_free_cmd_mailbox(dev, mailbox); return ret; } -EXPORT_SYMBOL_GPL(mlx4_query_diag_counters); +EXPORT_SYMBOL(mlx4_query_diag_counters); -int mlx4_MOD_STAT_CFG_wrapper(struct mlx4_dev *dev, int slave, - struct mlx4_vhcr *vhcr, - struct mlx4_cmd_mailbox *inbox, - struct mlx4_cmd_mailbox *outbox, - struct mlx4_cmd_info *cmd) +int mlx4_get_phys_port_id(struct mlx4_dev *dev) { - return -EPERM; + u8 port; + u32 *outbox; + struct mlx4_cmd_mailbox *mailbox; + u32 in_mod; + u32 guid_hi, guid_lo; + int err, ret = 0; +#define MOD_STAT_CFG_PORT_OFFSET 8 +#define MOD_STAT_CFG_GUID_H 0X14 +#define MOD_STAT_CFG_GUID_L 0X1c + + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) + return PTR_ERR(mailbox); + outbox = mailbox->buf; + + for (port = 1; port <= dev->caps.num_ports; port++) { + in_mod = port << MOD_STAT_CFG_PORT_OFFSET; + err = mlx4_cmd_box(dev, 0, mailbox->dma, in_mod, 0x2, + MLX4_CMD_MOD_STAT_CFG, MLX4_CMD_TIME_CLASS_A, + MLX4_CMD_NATIVE); + if (err) { + mlx4_err(dev, "Fail to get port %d uplink guid\n", + port); + ret = err; + } else { + MLX4_GET(guid_hi, outbox, MOD_STAT_CFG_GUID_H); + MLX4_GET(guid_lo, outbox, MOD_STAT_CFG_GUID_L); + dev->caps.phys_port_id[port] = (u64)guid_lo | + (u64)guid_hi << 32; + } + } + mlx4_free_cmd_mailbox(dev, mailbox); + return ret; } #define MLX4_WOL_SETUP_MODE (5 << 28) @@ -1969,7 +2659,8 @@ enum { void mlx4_opreq_action(struct work_struct *work) { - struct mlx4_priv *priv = container_of(work, struct mlx4_priv, opreq_task); + struct mlx4_priv *priv = container_of(work, struct mlx4_priv, + opreq_task); struct mlx4_dev *dev = &priv->dev; int num_tasks = atomic_read(&priv->opreq_count); struct mlx4_cmd_mailbox *mailbox; @@ -1977,7 +2668,6 @@ void mlx4_opreq_action(struct work_struct *work) u32 *outbox; u32 modifier; u16 token; - u16 type_m; u16 type; int err; u32 num_qps; @@ -2003,34 +2693,42 @@ void mlx4_opreq_action(struct work_struct *work) MLX4_CMD_GET_OP_REQ, MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); if (err) { - mlx4_err(dev, "Failed to retrieve required operation: %d\n", err); + mlx4_err(dev, "Failed to retrieve required operation: %d\n", + err); return; } MLX4_GET(modifier, outbox, GET_OP_REQ_MODIFIER_OFFSET); MLX4_GET(token, outbox, GET_OP_REQ_TOKEN_OFFSET); MLX4_GET(type, outbox, GET_OP_REQ_TYPE_OFFSET); - type_m = type >> 12; type &= 0xfff; switch (type) { case ADD_TO_MCG: - if (dev->caps.steering_mode == MLX4_STEERING_MODE_DEVICE_MANAGED) { - mlx4_warn(dev, "ADD MCG operation is not supported in " - "DEVICE_MANAGED steerign mode\n"); + if (dev->caps.steering_mode == + MLX4_STEERING_MODE_DEVICE_MANAGED) { + mlx4_warn(dev, "ADD MCG operation is not supported in DEVICE_MANAGED steering mode\n"); err = EPERM; break; } - mgm = (struct mlx4_mgm *) ((u8 *) (outbox) + GET_OP_REQ_DATA_OFFSET); - num_qps = be32_to_cpu(mgm->members_count) & MGM_QPN_MASK; - rem_mcg = ((u8 *) (&mgm->members_count))[0] & 1; - prot = ((u8 *) (&mgm->members_count))[0] >> 6; + mgm = (struct mlx4_mgm *)((u8 *)(outbox) + + GET_OP_REQ_DATA_OFFSET); + num_qps = be32_to_cpu(mgm->members_count) & + MGM_QPN_MASK; + rem_mcg = ((u8 *)(&mgm->members_count))[0] & 1; + prot = ((u8 *)(&mgm->members_count))[0] >> 6; for (i = 0; i < num_qps; i++) { qp.qpn = be32_to_cpu(mgm->qp[i]); if (rem_mcg) - err = mlx4_multicast_detach(dev, &qp, mgm->gid, prot, 0); + err = mlx4_multicast_detach(dev, &qp, + mgm->gid, + prot, 0); else - err = mlx4_multicast_attach(dev, &qp, mgm->gid, mgm->gid[5] ,0, prot, NULL); + err = mlx4_multicast_attach(dev, &qp, + mgm->gid, + mgm->gid[5] + , 0, prot, + NULL); if (err) break; } @@ -2040,11 +2738,13 @@ void mlx4_opreq_action(struct work_struct *work) err = EINVAL; break; } - err = mlx4_cmd(dev, 0, ((u32) err | cpu_to_be32(token) << 16), 1, - MLX4_CMD_GET_OP_REQ, MLX4_CMD_TIME_CLASS_A, + err = mlx4_cmd(dev, 0, ((u32) err | + (__force u32)cpu_to_be32(token) << 16), + 1, MLX4_CMD_GET_OP_REQ, MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); if (err) { - mlx4_err(dev, "Failed to acknowledge required request: %d\n", err); + mlx4_err(dev, "Failed to acknowledge required request: %d\n", + err); goto out; } memset(outbox, 0, 0xffc); @@ -2054,3 +2754,300 @@ void mlx4_opreq_action(struct work_struct *work) out: mlx4_free_cmd_mailbox(dev, mailbox); } + +static int mlx4_check_smp_firewall_active(struct mlx4_dev *dev, + struct mlx4_cmd_mailbox *mailbox) +{ +#define MLX4_CMD_MAD_DEMUX_SET_ATTR_OFFSET 0x10 +#define MLX4_CMD_MAD_DEMUX_GETRESP_ATTR_OFFSET 0x20 +#define MLX4_CMD_MAD_DEMUX_TRAP_ATTR_OFFSET 0x40 +#define MLX4_CMD_MAD_DEMUX_TRAP_REPRESS_ATTR_OFFSET 0x70 + + u32 set_attr_mask, getresp_attr_mask; + u32 trap_attr_mask, traprepress_attr_mask; + + MLX4_GET(set_attr_mask, mailbox->buf, + MLX4_CMD_MAD_DEMUX_SET_ATTR_OFFSET); + mlx4_dbg(dev, "SMP firewall set_attribute_mask = 0x%x\n", + set_attr_mask); + + MLX4_GET(getresp_attr_mask, mailbox->buf, + MLX4_CMD_MAD_DEMUX_GETRESP_ATTR_OFFSET); + mlx4_dbg(dev, "SMP firewall getresp_attribute_mask = 0x%x\n", + getresp_attr_mask); + + MLX4_GET(trap_attr_mask, mailbox->buf, + MLX4_CMD_MAD_DEMUX_TRAP_ATTR_OFFSET); + mlx4_dbg(dev, "SMP firewall trap_attribute_mask = 0x%x\n", + trap_attr_mask); + + MLX4_GET(traprepress_attr_mask, mailbox->buf, + MLX4_CMD_MAD_DEMUX_TRAP_REPRESS_ATTR_OFFSET); + mlx4_dbg(dev, "SMP firewall traprepress_attribute_mask = 0x%x\n", + traprepress_attr_mask); + + if (set_attr_mask && getresp_attr_mask && trap_attr_mask && + traprepress_attr_mask) + return 1; + + return 0; +} + +int mlx4_config_mad_demux(struct mlx4_dev *dev) +{ + struct mlx4_cmd_mailbox *mailbox; + int err; + + /* Check if mad_demux is supported */ + if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_MAD_DEMUX)) + return 0; + + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) { + mlx4_warn(dev, "Failed to allocate mailbox for cmd MAD_DEMUX"); + return -ENOMEM; + } + + /* Query mad_demux to find out which MADs are handled by internal sma */ + err = mlx4_cmd_box(dev, 0, mailbox->dma, 0x01 /* subn mgmt class */, + MLX4_CMD_MAD_DEMUX_QUERY_RESTR, MLX4_CMD_MAD_DEMUX, + MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); + if (err) { + mlx4_warn(dev, "MLX4_CMD_MAD_DEMUX: query restrictions failed (%d)\n", + err); + goto out; + } + + if (mlx4_check_smp_firewall_active(dev, mailbox)) + dev->flags |= MLX4_FLAG_SECURE_HOST; + + /* Config mad_demux to handle all MADs returned by the query above */ + err = mlx4_cmd(dev, mailbox->dma, 0x01 /* subn mgmt class */, + MLX4_CMD_MAD_DEMUX_CONFIG, MLX4_CMD_MAD_DEMUX, + MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); + if (err) { + mlx4_warn(dev, "MLX4_CMD_MAD_DEMUX: configure failed (%d)\n", err); + goto out; + } + + if (dev->flags & MLX4_FLAG_SECURE_HOST) + mlx4_warn(dev, "HCA operating in secure-host mode. SMP firewall activated.\n"); +out: + mlx4_free_cmd_mailbox(dev, mailbox); + return err; +} + +/* Access Reg commands */ +enum mlx4_access_reg_masks { + MLX4_ACCESS_REG_STATUS_MASK = 0x7f, + MLX4_ACCESS_REG_METHOD_MASK = 0x7f, + MLX4_ACCESS_REG_LEN_MASK = 0x7ff +}; + +struct mlx4_access_reg { + __be16 constant1; + u8 status; + u8 resrvd1; + __be16 reg_id; + u8 method; + u8 constant2; + __be32 resrvd2[2]; + __be16 len_const; + __be16 resrvd3; +#define MLX4_ACCESS_REG_HEADER_SIZE (20) + u8 reg_data[MLX4_MAILBOX_SIZE-MLX4_ACCESS_REG_HEADER_SIZE]; +} __attribute__((__packed__)); + +/** + * mlx4_ACCESS_REG - Generic access reg command. + * @dev: mlx4_dev. + * @reg_id: register ID to access. + * @method: Access method Read/Write. + * @reg_len: register length to Read/Write in bytes. + * @reg_data: reg_data pointer to Read/Write From/To. + * + * Access ConnectX registers FW command. + * Returns 0 on success and copies outbox mlx4_access_reg data + * field into reg_data or a negative error code. + */ +static int mlx4_ACCESS_REG(struct mlx4_dev *dev, u16 reg_id, + enum mlx4_access_reg_method method, + u16 reg_len, void *reg_data) +{ + struct mlx4_cmd_mailbox *inbox, *outbox; + struct mlx4_access_reg *inbuf, *outbuf; + int err; + + inbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(inbox)) + return PTR_ERR(inbox); + + outbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(outbox)) { + mlx4_free_cmd_mailbox(dev, inbox); + return PTR_ERR(outbox); + } + + inbuf = inbox->buf; + outbuf = outbox->buf; + + inbuf->constant1 = cpu_to_be16(0x1<<11 | 0x4); + inbuf->constant2 = 0x1; + inbuf->reg_id = cpu_to_be16(reg_id); + inbuf->method = method & MLX4_ACCESS_REG_METHOD_MASK; + + reg_len = min(reg_len, (u16)(sizeof(inbuf->reg_data))); + inbuf->len_const = + cpu_to_be16(((reg_len/4 + 1) & MLX4_ACCESS_REG_LEN_MASK) | + ((0x3) << 12)); + + memcpy(inbuf->reg_data, reg_data, reg_len); + err = mlx4_cmd_box(dev, inbox->dma, outbox->dma, 0, 0, + MLX4_CMD_ACCESS_REG, MLX4_CMD_TIME_CLASS_C, + MLX4_CMD_WRAPPED); + if (err) + goto out; + + if (outbuf->status & MLX4_ACCESS_REG_STATUS_MASK) { + err = outbuf->status & MLX4_ACCESS_REG_STATUS_MASK; + mlx4_err(dev, + "MLX4_CMD_ACCESS_REG(%x) returned REG status (%x)\n", + reg_id, err); + goto out; + } + + memcpy(reg_data, outbuf->reg_data, reg_len); +out: + mlx4_free_cmd_mailbox(dev, inbox); + mlx4_free_cmd_mailbox(dev, outbox); + return err; +} + +/* ConnectX registers IDs */ +enum mlx4_reg_id { + MLX4_REG_ID_PTYS = 0x5004, +}; + +/** + * mlx4_ACCESS_PTYS_REG - Access PTYs (Port Type and Speed) + * register + * @dev: mlx4_dev. + * @method: Access method Read/Write. + * @ptys_reg: PTYS register data pointer. + * + * Access ConnectX PTYS register, to Read/Write Port Type/Speed + * configuration + * Returns 0 on success or a negative error code. + */ +int mlx4_ACCESS_PTYS_REG(struct mlx4_dev *dev, + enum mlx4_access_reg_method method, + struct mlx4_ptys_reg *ptys_reg) +{ + return mlx4_ACCESS_REG(dev, MLX4_REG_ID_PTYS, + method, sizeof(*ptys_reg), ptys_reg); +} +EXPORT_SYMBOL_GPL(mlx4_ACCESS_PTYS_REG); + +int mlx4_ACCESS_REG_wrapper(struct mlx4_dev *dev, int slave, + struct mlx4_vhcr *vhcr, + struct mlx4_cmd_mailbox *inbox, + struct mlx4_cmd_mailbox *outbox, + struct mlx4_cmd_info *cmd) +{ + struct mlx4_access_reg *inbuf = inbox->buf; + u8 method = inbuf->method & MLX4_ACCESS_REG_METHOD_MASK; + u16 reg_id = be16_to_cpu(inbuf->reg_id); + + if (slave != mlx4_master_func_num(dev) && + method == MLX4_ACCESS_REG_WRITE) + return -EPERM; + + if (reg_id == MLX4_REG_ID_PTYS) { + struct mlx4_ptys_reg *ptys_reg = + (struct mlx4_ptys_reg *)inbuf->reg_data; + + ptys_reg->local_port = + mlx4_slave_convert_port(dev, slave, + ptys_reg->local_port); + } + + return mlx4_cmd_box(dev, inbox->dma, outbox->dma, vhcr->in_modifier, + 0, MLX4_CMD_ACCESS_REG, MLX4_CMD_TIME_CLASS_C, + MLX4_CMD_NATIVE); +} + +static int mlx4_SET_PORT_phv_bit(struct mlx4_dev *dev, u8 port, u8 phv_bit) +{ +#define SET_PORT_GEN_PHV_VALID 0x10 +#define SET_PORT_GEN_PHV_EN 0x80 + + struct mlx4_cmd_mailbox *mailbox; + struct mlx4_set_port_general_context *context; + u32 in_mod; + int err; + + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) + return PTR_ERR(mailbox); + context = mailbox->buf; + + context->v_ignore_fcs |= SET_PORT_GEN_PHV_VALID; + if (phv_bit) + context->phv_en |= SET_PORT_GEN_PHV_EN; + + in_mod = MLX4_SET_PORT_GENERAL << 8 | port; + err = mlx4_cmd(dev, mailbox->dma, in_mod, MLX4_SET_PORT_ETH_OPCODE, + MLX4_CMD_SET_PORT, MLX4_CMD_TIME_CLASS_B, + MLX4_CMD_NATIVE); + + mlx4_free_cmd_mailbox(dev, mailbox); + return err; +} + +int get_phv_bit(struct mlx4_dev *dev, u8 port, int *phv) +{ + int err; + struct mlx4_func_cap func_cap; + + memset(&func_cap, 0, sizeof(func_cap)); + err = mlx4_QUERY_FUNC_CAP(dev, port, &func_cap); + if (!err) + *phv = func_cap.flags0 & QUERY_FUNC_CAP_PHV_BIT; + return err; +} +EXPORT_SYMBOL(get_phv_bit); + +int set_phv_bit(struct mlx4_dev *dev, u8 port, int new_val) +{ + int ret; + + if (mlx4_is_slave(dev)) + return -EPERM; + + if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_PHV_EN && + !(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_SKIP_OUTER_VLAN)) { + ret = mlx4_SET_PORT_phv_bit(dev, port, new_val); + if (!ret) + dev->caps.phv_bit[port] = new_val; + return ret; + } + + return -EOPNOTSUPP; +} +EXPORT_SYMBOL(set_phv_bit); + +void mlx4_replace_zero_macs(struct mlx4_dev *dev) +{ + int i; + u8 mac_addr[ETH_ALEN]; + + dev->port_random_macs = 0; + for (i = 1; i <= dev->caps.num_ports; ++i) + if (!dev->caps.def_mac[i] && + dev->caps.port_type[i] == MLX4_PORT_TYPE_ETH) { + random_ether_addr(mac_addr); + dev->port_random_macs |= 1 << i; + dev->caps.def_mac[i] = mlx4_mac_to_u64(mac_addr); + } +} +EXPORT_SYMBOL_GPL(mlx4_replace_zero_macs); diff --git a/sys/dev/mlx4/mlx4_core/mlx4_fw_qos.c b/sys/dev/mlx4/mlx4_core/mlx4_fw_qos.c new file mode 100644 index 000000000000..63bdbfb69b90 --- /dev/null +++ b/sys/dev/mlx4/mlx4_core/mlx4_fw_qos.c @@ -0,0 +1,289 @@ +/* + * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. + * Copyright (c) 2005, 2006, 2007, 2008 Mellanox Technologies. + * All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include "fw_qos.h" +#include "fw.h" + +enum { + /* allocate vpp opcode modifiers */ + MLX4_ALLOCATE_VPP_ALLOCATE = 0x0, + MLX4_ALLOCATE_VPP_QUERY = 0x1 +}; + +enum { + /* set vport qos opcode modifiers */ + MLX4_SET_VPORT_QOS_SET = 0x0, + MLX4_SET_VPORT_QOS_QUERY = 0x1 +}; + +struct mlx4_set_port_prio2tc_context { + u8 prio2tc[4]; +}; + +struct mlx4_port_scheduler_tc_cfg_be { + __be16 pg; + __be16 bw_precentage; + __be16 max_bw_units; /* 3-100Mbps, 4-1Gbps, other values - reserved */ + __be16 max_bw_value; +}; + +struct mlx4_set_port_scheduler_context { + struct mlx4_port_scheduler_tc_cfg_be tc[MLX4_NUM_TC]; +}; + +/* Granular Qos (per VF) section */ +struct mlx4_alloc_vpp_param { + __be32 availible_vpp; + __be32 vpp_p_up[MLX4_NUM_UP]; +}; + +struct mlx4_prio_qos_param { + __be32 bw_share; + __be32 max_avg_bw; + __be32 reserved; + __be32 enable; + __be32 reserved1[4]; +}; + +struct mlx4_set_vport_context { + __be32 reserved[8]; + struct mlx4_prio_qos_param qos_p_up[MLX4_NUM_UP]; +}; + +int mlx4_SET_PORT_PRIO2TC(struct mlx4_dev *dev, u8 port, u8 *prio2tc) +{ + struct mlx4_cmd_mailbox *mailbox; + struct mlx4_set_port_prio2tc_context *context; + int err; + u32 in_mod; + int i; + + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) + return PTR_ERR(mailbox); + + context = mailbox->buf; + + for (i = 0; i < MLX4_NUM_UP; i += 2) + context->prio2tc[i >> 1] = prio2tc[i] << 4 | prio2tc[i + 1]; + + in_mod = MLX4_SET_PORT_PRIO2TC << 8 | port; + err = mlx4_cmd(dev, mailbox->dma, in_mod, 1, MLX4_CMD_SET_PORT, + MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); + + mlx4_free_cmd_mailbox(dev, mailbox); + return err; +} +EXPORT_SYMBOL(mlx4_SET_PORT_PRIO2TC); + +int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw, + u8 *pg, u16 *ratelimit) +{ + struct mlx4_cmd_mailbox *mailbox; + struct mlx4_set_port_scheduler_context *context; + int err; + u32 in_mod; + int i; + + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) + return PTR_ERR(mailbox); + + context = mailbox->buf; + + for (i = 0; i < MLX4_NUM_TC; i++) { + struct mlx4_port_scheduler_tc_cfg_be *tc = &context->tc[i]; + u16 r; + + if (ratelimit && ratelimit[i]) { + if (ratelimit[i] <= MLX4_MAX_100M_UNITS_VAL) { + r = ratelimit[i]; + tc->max_bw_units = + htons(MLX4_RATELIMIT_100M_UNITS); + } else { + r = ratelimit[i] / 10; + tc->max_bw_units = + htons(MLX4_RATELIMIT_1G_UNITS); + } + tc->max_bw_value = htons(r); + } else { + tc->max_bw_value = htons(MLX4_RATELIMIT_DEFAULT); + tc->max_bw_units = htons(MLX4_RATELIMIT_1G_UNITS); + } + + tc->pg = htons(pg[i]); + tc->bw_precentage = htons(tc_tx_bw[i]); + } + + in_mod = MLX4_SET_PORT_SCHEDULER << 8 | port; + err = mlx4_cmd(dev, mailbox->dma, in_mod, 1, MLX4_CMD_SET_PORT, + MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); + + mlx4_free_cmd_mailbox(dev, mailbox); + return err; +} +EXPORT_SYMBOL(mlx4_SET_PORT_SCHEDULER); + +int mlx4_ALLOCATE_VPP_get(struct mlx4_dev *dev, u8 port, + u16 *availible_vpp, u8 *vpp_p_up) +{ + int i; + int err; + struct mlx4_cmd_mailbox *mailbox; + struct mlx4_alloc_vpp_param *out_param; + + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) + return PTR_ERR(mailbox); + + out_param = mailbox->buf; + + err = mlx4_cmd_box(dev, 0, mailbox->dma, port, + MLX4_ALLOCATE_VPP_QUERY, + MLX4_CMD_ALLOCATE_VPP, + MLX4_CMD_TIME_CLASS_A, + MLX4_CMD_NATIVE); + if (err) + goto out; + + /* Total number of supported VPPs */ + *availible_vpp = (u16)be32_to_cpu(out_param->availible_vpp); + + for (i = 0; i < MLX4_NUM_UP; i++) + vpp_p_up[i] = (u8)be32_to_cpu(out_param->vpp_p_up[i]); + +out: + mlx4_free_cmd_mailbox(dev, mailbox); + + return err; +} +EXPORT_SYMBOL(mlx4_ALLOCATE_VPP_get); + +int mlx4_ALLOCATE_VPP_set(struct mlx4_dev *dev, u8 port, u8 *vpp_p_up) +{ + int i; + int err; + struct mlx4_cmd_mailbox *mailbox; + struct mlx4_alloc_vpp_param *in_param; + + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) + return PTR_ERR(mailbox); + + in_param = mailbox->buf; + + for (i = 0; i < MLX4_NUM_UP; i++) + in_param->vpp_p_up[i] = cpu_to_be32(vpp_p_up[i]); + + err = mlx4_cmd(dev, mailbox->dma, port, + MLX4_ALLOCATE_VPP_ALLOCATE, + MLX4_CMD_ALLOCATE_VPP, + MLX4_CMD_TIME_CLASS_A, + MLX4_CMD_NATIVE); + + mlx4_free_cmd_mailbox(dev, mailbox); + return err; +} +EXPORT_SYMBOL(mlx4_ALLOCATE_VPP_set); + +int mlx4_SET_VPORT_QOS_get(struct mlx4_dev *dev, u8 port, u8 vport, + struct mlx4_vport_qos_param *out_param) +{ + int i; + int err; + struct mlx4_cmd_mailbox *mailbox; + struct mlx4_set_vport_context *ctx; + + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) + return PTR_ERR(mailbox); + + ctx = mailbox->buf; + + err = mlx4_cmd_box(dev, 0, mailbox->dma, (vport << 8) | port, + MLX4_SET_VPORT_QOS_QUERY, + MLX4_CMD_SET_VPORT_QOS, + MLX4_CMD_TIME_CLASS_A, + MLX4_CMD_NATIVE); + if (err) + goto out; + + for (i = 0; i < MLX4_NUM_UP; i++) { + out_param[i].bw_share = be32_to_cpu(ctx->qos_p_up[i].bw_share); + out_param[i].max_avg_bw = + be32_to_cpu(ctx->qos_p_up[i].max_avg_bw); + out_param[i].enable = + !!(be32_to_cpu(ctx->qos_p_up[i].enable) & 31); + } + +out: + mlx4_free_cmd_mailbox(dev, mailbox); + + return err; +} +EXPORT_SYMBOL(mlx4_SET_VPORT_QOS_get); + +int mlx4_SET_VPORT_QOS_set(struct mlx4_dev *dev, u8 port, u8 vport, + struct mlx4_vport_qos_param *in_param) +{ + int i; + int err; + struct mlx4_cmd_mailbox *mailbox; + struct mlx4_set_vport_context *ctx; + + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) + return PTR_ERR(mailbox); + + ctx = mailbox->buf; + + for (i = 0; i < MLX4_NUM_UP; i++) { + ctx->qos_p_up[i].bw_share = cpu_to_be32(in_param[i].bw_share); + ctx->qos_p_up[i].max_avg_bw = + cpu_to_be32(in_param[i].max_avg_bw); + ctx->qos_p_up[i].enable = + cpu_to_be32(in_param[i].enable << 31); + } + + err = mlx4_cmd(dev, mailbox->dma, (vport << 8) | port, + MLX4_SET_VPORT_QOS_SET, + MLX4_CMD_SET_VPORT_QOS, + MLX4_CMD_TIME_CLASS_A, + MLX4_CMD_NATIVE); + + mlx4_free_cmd_mailbox(dev, mailbox); + return err; +} +EXPORT_SYMBOL(mlx4_SET_VPORT_QOS_set); diff --git a/sys/dev/mlx4/mlx4_core/mlx4_icm.c b/sys/dev/mlx4/mlx4_core/mlx4_icm.c index 02af1589ec00..3e3b25a0f6b6 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_icm.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_icm.c @@ -57,7 +57,7 @@ static void mlx4_free_icm_pages(struct mlx4_dev *dev, struct mlx4_icm_chunk *chu int i; if (chunk->nsg > 0) - pci_unmap_sg(dev->pdev, chunk->mem, chunk->npages, + pci_unmap_sg(dev->persist->pdev, chunk->mem, chunk->npages, PCI_DMA_BIDIRECTIONAL); for (i = 0; i < chunk->npages; ++i) @@ -70,7 +70,8 @@ static void mlx4_free_icm_coherent(struct mlx4_dev *dev, struct mlx4_icm_chunk * int i; for (i = 0; i < chunk->npages; ++i) - dma_free_coherent(&dev->pdev->dev, chunk->mem[i].length, + dma_free_coherent(&dev->persist->pdev->dev, + chunk->mem[i].length, lowmem_page_address(sg_page(&chunk->mem[i])), sg_dma_address(&chunk->mem[i])); } @@ -135,10 +136,12 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages, /* We use sg_set_buf for coherent allocs, which assumes low memory */ BUG_ON(coherent && (gfp_mask & __GFP_HIGHMEM)); - icm = kmalloc_node(sizeof *icm, gfp_mask & ~(__GFP_HIGHMEM | __GFP_NOWARN), + icm = kmalloc_node(sizeof(*icm), + gfp_mask & ~(__GFP_HIGHMEM | __GFP_NOWARN), dev->numa_node); if (!icm) { - icm = kmalloc(sizeof *icm, gfp_mask & ~(__GFP_HIGHMEM | __GFP_NOWARN)); + icm = kmalloc(sizeof(*icm), + gfp_mask & ~(__GFP_HIGHMEM | __GFP_NOWARN)); if (!icm) return NULL; } @@ -150,12 +153,14 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages, while (npages > 0) { if (!chunk) { - chunk = kmalloc_node(sizeof *chunk, - gfp_mask & ~(__GFP_HIGHMEM | __GFP_NOWARN), + chunk = kmalloc_node(sizeof(*chunk), + gfp_mask & ~(__GFP_HIGHMEM | + __GFP_NOWARN), dev->numa_node); if (!chunk) { - chunk = kmalloc(sizeof *chunk, - gfp_mask & ~(__GFP_HIGHMEM | __GFP_NOWARN)); + chunk = kmalloc(sizeof(*chunk), + gfp_mask & ~(__GFP_HIGHMEM | + __GFP_NOWARN)); if (!chunk) goto fail; } @@ -170,7 +175,7 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages, --cur_order; if (coherent) - ret = mlx4_alloc_icm_coherent(&dev->pdev->dev, + ret = mlx4_alloc_icm_coherent(&dev->persist->pdev->dev, &chunk->mem[chunk->npages], cur_order, gfp_mask); else @@ -190,7 +195,7 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages, if (coherent) ++chunk->nsg; else if (chunk->npages == MLX4_ICM_CHUNK_LEN) { - chunk->nsg = pci_map_sg(dev->pdev, chunk->mem, + chunk->nsg = pci_map_sg(dev->persist->pdev, chunk->mem, chunk->npages, PCI_DMA_BIDIRECTIONAL); @@ -205,7 +210,7 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages, } if (!coherent && chunk) { - chunk->nsg = pci_map_sg(dev->pdev, chunk->mem, + chunk->nsg = pci_map_sg(dev->persist->pdev, chunk->mem, chunk->npages, PCI_DMA_BIDIRECTIONAL); @@ -242,7 +247,8 @@ int mlx4_UNMAP_ICM_AUX(struct mlx4_dev *dev) MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); } -int mlx4_table_get(struct mlx4_dev *dev, struct mlx4_icm_table *table, u32 obj) +int mlx4_table_get(struct mlx4_dev *dev, struct mlx4_icm_table *table, u32 obj, + gfp_t gfp) { u32 i = (obj & (table->num_obj - 1)) / (MLX4_TABLE_CHUNK_SIZE / table->obj_size); @@ -256,7 +262,7 @@ int mlx4_table_get(struct mlx4_dev *dev, struct mlx4_icm_table *table, u32 obj) } table->icm[i] = mlx4_alloc_icm(dev, MLX4_TABLE_CHUNK_SIZE >> PAGE_SHIFT, - (table->lowmem ? GFP_KERNEL : GFP_HIGHUSER) | + (table->lowmem ? gfp : GFP_HIGHUSER) | __GFP_NOWARN, table->coherent); if (!table->icm[i]) { ret = -ENOMEM; @@ -289,14 +295,10 @@ void mlx4_table_put(struct mlx4_dev *dev, struct mlx4_icm_table *table, u32 obj) if (--table->icm[i]->refcount == 0) { offset = (u64) i * MLX4_TABLE_CHUNK_SIZE; - - if (!mlx4_UNMAP_ICM(dev, table->virt + offset, - MLX4_TABLE_CHUNK_SIZE / MLX4_ICM_PAGE_SIZE)) { - mlx4_free_icm(dev, table->icm[i], table->coherent); - table->icm[i] = NULL; - } else { - pr_warn("mlx4_core: mlx4_UNMAP_ICM failed.\n"); - } + mlx4_UNMAP_ICM(dev, table->virt + offset, + MLX4_TABLE_CHUNK_SIZE / MLX4_ICM_PAGE_SIZE); + mlx4_free_icm(dev, table->icm[i], table->coherent); + table->icm[i] = NULL; } mutex_unlock(&table->mutex); @@ -357,7 +359,7 @@ int mlx4_table_get_range(struct mlx4_dev *dev, struct mlx4_icm_table *table, u32 i; for (i = start; i <= end; i += inc) { - err = mlx4_table_get(dev, table, i); + err = mlx4_table_get(dev, table, i, GFP_KERNEL); if (err) goto fail; } @@ -383,7 +385,7 @@ void mlx4_table_put_range(struct mlx4_dev *dev, struct mlx4_icm_table *table, } int mlx4_init_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table, - u64 virt, int obj_size, u64 nobj, int reserved, + u64 virt, int obj_size, u32 nobj, int reserved, int use_lowmem, int use_coherent) { int obj_per_chunk; @@ -393,7 +395,7 @@ int mlx4_init_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table, u64 size; obj_per_chunk = MLX4_TABLE_CHUNK_SIZE / obj_size; - num_icm = div_u64((nobj + obj_per_chunk - 1), obj_per_chunk); + num_icm = (nobj + obj_per_chunk - 1) / obj_per_chunk; table->icm = kcalloc(num_icm, sizeof *table->icm, GFP_KERNEL); if (!table->icm) @@ -436,15 +438,11 @@ int mlx4_init_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table, err: for (i = 0; i < num_icm; ++i) if (table->icm[i]) { - if (!mlx4_UNMAP_ICM(dev, - virt + i * MLX4_TABLE_CHUNK_SIZE, - MLX4_TABLE_CHUNK_SIZE / MLX4_ICM_PAGE_SIZE)) { - mlx4_free_icm(dev, table->icm[i], use_coherent); - } else { - pr_warn("mlx4_core: mlx4_UNMAP_ICM failed.\n"); - return -ENOMEM; - } + mlx4_UNMAP_ICM(dev, virt + i * MLX4_TABLE_CHUNK_SIZE, + MLX4_TABLE_CHUNK_SIZE / MLX4_ICM_PAGE_SIZE); + mlx4_free_icm(dev, table->icm[i], use_coherent); } + kfree(table->icm); return -ENOMEM; @@ -452,22 +450,14 @@ int mlx4_init_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table, void mlx4_cleanup_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table) { - int i, err = 0; + int i; for (i = 0; i < table->num_icm; ++i) if (table->icm[i]) { - err = mlx4_UNMAP_ICM(dev, - table->virt + i * MLX4_TABLE_CHUNK_SIZE, - MLX4_TABLE_CHUNK_SIZE / MLX4_ICM_PAGE_SIZE); - if (!err) { - mlx4_free_icm(dev, table->icm[i], - table->coherent); - } else { - pr_warn("mlx4_core: mlx4_UNMAP_ICM failed.\n"); - break; - } + mlx4_UNMAP_ICM(dev, table->virt + i * MLX4_TABLE_CHUNK_SIZE, + MLX4_TABLE_CHUNK_SIZE / MLX4_ICM_PAGE_SIZE); + mlx4_free_icm(dev, table->icm[i], table->coherent); } - if (!err) - kfree(table->icm); + kfree(table->icm); } diff --git a/sys/dev/mlx4/mlx4_core/mlx4_intf.c b/sys/dev/mlx4/mlx4_core/mlx4_intf.c index 141629801d2f..2791cb1ce717 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_intf.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_intf.c @@ -38,6 +38,7 @@ struct mlx4_device_context { struct list_head list; + struct list_head bond_list; struct mlx4_interface *intf; void *context; }; @@ -61,6 +62,8 @@ static void mlx4_add_device(struct mlx4_interface *intf, struct mlx4_priv *priv) spin_lock_irq(&priv->ctx_lock); list_add_tail(&dev_ctx->list, &priv->ctx_list); spin_unlock_irq(&priv->ctx_lock); + if (intf->activate) + intf->activate(&priv->dev, dev_ctx->context); } else kfree(dev_ctx); } @@ -91,8 +94,14 @@ int mlx4_register_interface(struct mlx4_interface *intf) mutex_lock(&intf_mutex); list_add_tail(&intf->list, &intf_list); - list_for_each_entry(priv, &dev_list, dev_list) + list_for_each_entry(priv, &dev_list, dev_list) { + if (mlx4_is_mfunc(&priv->dev) && (intf->flags & MLX4_INTFF_BONDING)) { + mlx4_dbg(&priv->dev, + "SRIOV, disabling HA mode for intf proto %d\n", intf->protocol); + intf->flags &= ~MLX4_INTFF_BONDING; + } mlx4_add_device(intf, priv); + } mutex_unlock(&intf_mutex); @@ -115,6 +124,58 @@ void mlx4_unregister_interface(struct mlx4_interface *intf) } EXPORT_SYMBOL_GPL(mlx4_unregister_interface); +int mlx4_do_bond(struct mlx4_dev *dev, bool enable) +{ + struct mlx4_priv *priv = mlx4_priv(dev); + struct mlx4_device_context *dev_ctx = NULL, *temp_dev_ctx; + unsigned long flags; + int ret; + LIST_HEAD(bond_list); + + if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_PORT_REMAP)) + return -ENOTSUPP; + + ret = mlx4_disable_rx_port_check(dev, enable); + if (ret) { + mlx4_err(dev, "Fail to %s rx port check\n", + enable ? "enable" : "disable"); + return ret; + } + if (enable) { + dev->flags |= MLX4_FLAG_BONDED; + } else { + ret = mlx4_virt2phy_port_map(dev, 1, 2); + if (ret) { + mlx4_err(dev, "Fail to reset port map\n"); + return ret; + } + dev->flags &= ~MLX4_FLAG_BONDED; + } + + spin_lock_irqsave(&priv->ctx_lock, flags); + list_for_each_entry_safe(dev_ctx, temp_dev_ctx, &priv->ctx_list, list) { + if (dev_ctx->intf->flags & MLX4_INTFF_BONDING) { + list_add_tail(&dev_ctx->bond_list, &bond_list); + list_del(&dev_ctx->list); + } + } + spin_unlock_irqrestore(&priv->ctx_lock, flags); + + list_for_each_entry(dev_ctx, &bond_list, bond_list) { + dev_ctx->intf->remove(dev, dev_ctx->context); + dev_ctx->context = dev_ctx->intf->add(dev); + + spin_lock_irqsave(&priv->ctx_lock, flags); + list_add_tail(&dev_ctx->list, &priv->ctx_list); + spin_unlock_irqrestore(&priv->ctx_lock, flags); + + mlx4_dbg(dev, "Inrerface for protocol %d restarted with when bonded mode is %s\n", + dev_ctx->intf->protocol, enable ? + "enabled" : "disabled"); + } + return 0; +} + void mlx4_dispatch_event(struct mlx4_dev *dev, enum mlx4_dev_event type, unsigned long param) { @@ -138,13 +199,13 @@ int mlx4_register_device(struct mlx4_dev *dev) mutex_lock(&intf_mutex); + dev->persist->interface_state |= MLX4_INTERFACE_STATE_UP; list_add_tail(&priv->dev_list, &dev_list); list_for_each_entry(intf, &intf_list, list) mlx4_add_device(intf, priv); mutex_unlock(&intf_mutex); - if (!mlx4_is_slave(dev)) - mlx4_start_catas_poll(dev); + mlx4_start_catas_poll(dev); return 0; } @@ -154,14 +215,17 @@ void mlx4_unregister_device(struct mlx4_dev *dev) struct mlx4_priv *priv = mlx4_priv(dev); struct mlx4_interface *intf; - if (!mlx4_is_slave(dev)) - mlx4_stop_catas_poll(dev); + if (!(dev->persist->interface_state & MLX4_INTERFACE_STATE_UP)) + return; + + mlx4_stop_catas_poll(dev); mutex_lock(&intf_mutex); list_for_each_entry(intf, &intf_list, list) mlx4_remove_device(intf, priv); - list_del_init(&priv->dev_list); + list_del(&priv->dev_list); + dev->persist->interface_state &= ~MLX4_INTERFACE_STATE_UP; mutex_unlock(&intf_mutex); } @@ -186,3 +250,4 @@ void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int return result; } EXPORT_SYMBOL_GPL(mlx4_get_protocol_dev); + diff --git a/sys/dev/mlx4/mlx4_core/mlx4_main.c b/sys/dev/mlx4/mlx4_core/mlx4_main.c index bd2e19680059..dd650033d135 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_main.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_main.c @@ -46,6 +46,8 @@ #include #include #include +#include +#include #include #include @@ -55,7 +57,9 @@ #include "icm.h" #include -/* Mellanox ConnectX HCA low-level driver */ +MODULE_AUTHOR("Roland Dreier"); +MODULE_DESCRIPTION("Mellanox ConnectX HCA low-level driver"); +MODULE_LICENSE("Dual BSD/GPL"); struct workqueue_struct *mlx4_wq; @@ -71,7 +75,7 @@ MODULE_PARM_DESC(debug_level, "Enable debug tracing if > 0"); static int msi_x = 1; module_param(msi_x, int, 0444); -MODULE_PARM_DESC(msi_x, "0 - don't use MSI-X, 1 - use MSI-X, >1 - limit number of MSI-X irqs to msi_x (non-SRIOV only)"); +MODULE_PARM_DESC(msi_x, "attempt to use MSI-X if nonzero"); #else /* CONFIG_PCI_MSI */ @@ -79,71 +83,19 @@ MODULE_PARM_DESC(msi_x, "0 - don't use MSI-X, 1 - use MSI-X, >1 - limit number o #endif /* CONFIG_PCI_MSI */ -static int enable_sys_tune = 0; -module_param(enable_sys_tune, int, 0444); -MODULE_PARM_DESC(enable_sys_tune, "Tune the cpu's for better performance (default 0)"); +static uint8_t num_vfs[3] = {0, 0, 0}; +static int num_vfs_argc; +module_param_array(num_vfs, byte , &num_vfs_argc, 0444); +MODULE_PARM_DESC(num_vfs, "enable #num_vfs functions if num_vfs > 0\n" + "num_vfs=port1,port2,port1+2"); -int mlx4_blck_lb = 1; -module_param_named(block_loopback, mlx4_blck_lb, int, 0644); -MODULE_PARM_DESC(block_loopback, "Block multicast loopback packets if > 0 " - "(default: 1)"); -enum { - DEFAULT_DOMAIN = 0, - BDF_STR_SIZE = 8, /* bb:dd.f- */ - DBDF_STR_SIZE = 13 /* mmmm:bb:dd.f- */ -}; - -enum { - NUM_VFS, - PROBE_VF, - PORT_TYPE_ARRAY -}; - -enum { - VALID_DATA, - INVALID_DATA, - INVALID_STR -}; - -struct param_data { - int id; - struct mlx4_dbdf2val_lst dbdf2val; -}; - -static struct param_data num_vfs = { - .id = NUM_VFS, - .dbdf2val = { - .name = "num_vfs param", - .num_vals = 1, - .def_val = {0}, - .range = {0, MLX4_MAX_NUM_VF} - } -}; -module_param_string(num_vfs, num_vfs.dbdf2val.str, - sizeof(num_vfs.dbdf2val.str), 0444); -MODULE_PARM_DESC(num_vfs, - "Either single value (e.g. '5') to define uniform num_vfs value for all devices functions\n" - "\t\tor a string to map device function numbers to their num_vfs values (e.g. '0000:04:00.0-5,002b:1c:0b.a-15').\n" - "\t\tHexadecimal digits for the device function (e.g. 002b:1c:0b.a) and decimal for num_vfs value (e.g. 15)."); - -static struct param_data probe_vf = { - .id = PROBE_VF, - .dbdf2val = { - .name = "probe_vf param", - .num_vals = 1, - .def_val = {0}, - .range = {0, MLX4_MAX_NUM_VF} - } -}; -module_param_string(probe_vf, probe_vf.dbdf2val.str, - sizeof(probe_vf.dbdf2val.str), 0444); -MODULE_PARM_DESC(probe_vf, - "Either single value (e.g. '3') to define uniform number of VFs to probe by the pf driver for all devices functions\n" - "\t\tor a string to map device function numbers to their probe_vf values (e.g. '0000:04:00.0-3,002b:1c:0b.a-13').\n" - "\t\tHexadecimal digits for the device function (e.g. 002b:1c:0b.a) and decimal for probe_vf value (e.g. 13)."); +static uint8_t probe_vf[3] = {0, 0, 0}; +static int probe_vfs_argc; +module_param_array(probe_vf, byte, &probe_vfs_argc, 0444); +MODULE_PARM_DESC(probe_vf, "number of vfs to probe by pf driver (num_vfs > 0)\n" + "probe_vf=port1,port2,port1+2"); int mlx4_log_num_mgm_entry_size = MLX4_DEFAULT_MGM_LOG_ENTRY_SIZE; - module_param_named(log_num_mgm_entry_size, mlx4_log_num_mgm_entry_size, int, 0444); MODULE_PARM_DESC(log_num_mgm_entry_size, "log mgm size, that defines the num" @@ -153,28 +105,45 @@ MODULE_PARM_DESC(log_num_mgm_entry_size, "log mgm size, that defines the num" " To activate device managed" " flow steering when available, set to -1"); -static int high_rate_steer; -module_param(high_rate_steer, int, 0444); -MODULE_PARM_DESC(high_rate_steer, "Enable steering mode for higher packet rate" - " (default off)"); - -static int fast_drop; -module_param_named(fast_drop, fast_drop, int, 0444); -MODULE_PARM_DESC(fast_drop, - "Enable fast packet drop when no receive WQEs are posted"); - -int mlx4_enable_64b_cqe_eqe = 1; -module_param_named(enable_64b_cqe_eqe, mlx4_enable_64b_cqe_eqe, int, 0644); +static bool enable_64b_cqe_eqe = true; +module_param(enable_64b_cqe_eqe, bool, 0444); MODULE_PARM_DESC(enable_64b_cqe_eqe, - "Enable 64 byte CQEs/EQEs when the FW supports this if non-zero (default: 1)"); + "Enable 64 byte CQEs/EQEs when the FW supports this (default: True)"); -#define HCA_GLOBAL_CAP_MASK 0 +static bool enable_4k_uar; +module_param(enable_4k_uar, bool, 0444); +MODULE_PARM_DESC(enable_4k_uar, + "Enable using 4K UAR. Should not be enabled if have VFs which do not support 4K UARs (default: false)"); -#define PF_CONTEXT_BEHAVIOUR_MASK MLX4_FUNC_CAP_64B_EQE_CQE +#define PF_CONTEXT_BEHAVIOUR_MASK (MLX4_FUNC_CAP_64B_EQE_CQE | \ + MLX4_FUNC_CAP_EQE_CQE_STRIDE | \ + MLX4_FUNC_CAP_DMFS_A0_STATIC) -static char mlx4_version[] __devinitdata = - DRV_NAME ": Mellanox ConnectX VPI driver v" - DRV_VERSION "\n"; +#define RESET_PERSIST_MASK_FLAGS (MLX4_FLAG_SRIOV) + +static char mlx4_version[] = + DRV_NAME ": Mellanox ConnectX core driver v" + DRV_VERSION " (" DRV_RELDATE ")\n"; + +static struct mlx4_profile default_profile = { + .num_qp = 1 << 18, + .num_srq = 1 << 16, + .rdmarc_per_qp = 1 << 4, + .num_cq = 1 << 16, + .num_mcg = 1 << 13, + .num_mpt = 1 << 19, + .num_mtt = 1 << 20, /* It is really num mtt segements */ +}; + +static struct mlx4_profile low_mem_profile = { + .num_qp = 1 << 17, + .num_srq = 1 << 6, + .rdmarc_per_qp = 1 << 4, + .num_cq = 1 << 8, + .num_mcg = 1 << 8, + .num_mpt = 1 << 9, + .num_mtt = 1 << 7, +}; static int log_num_mac = 7; module_param_named(log_num_mac, log_num_mac, int, 0444); @@ -182,33 +151,21 @@ MODULE_PARM_DESC(log_num_mac, "Log2 max number of MACs per ETH port (1-7)"); static int log_num_vlan; module_param_named(log_num_vlan, log_num_vlan, int, 0444); -MODULE_PARM_DESC(log_num_vlan, - "(Obsolete) Log2 max number of VLANs per ETH port (0-7)"); +MODULE_PARM_DESC(log_num_vlan, "Log2 max number of VLANs per ETH port (0-7)"); /* Log2 max number of VLANs per ETH port (0-7) */ #define MLX4_LOG_NUM_VLANS 7 +#define MLX4_MIN_LOG_NUM_VLANS 0 +#define MLX4_MIN_LOG_NUM_MAC 1 -int log_mtts_per_seg = ilog2(1); +static bool use_prio; +module_param_named(use_prio, use_prio, bool, 0444); +MODULE_PARM_DESC(use_prio, "Enable steering by VLAN priority on ETH ports (deprecated)"); + +int log_mtts_per_seg = ilog2(MLX4_MTT_ENTRY_PER_SEG); module_param_named(log_mtts_per_seg, log_mtts_per_seg, int, 0444); -MODULE_PARM_DESC(log_mtts_per_seg, "Log2 number of MTT entries per segment " - "(0-7) (default: 0)"); - -static struct param_data port_type_array = { - .id = PORT_TYPE_ARRAY, - .dbdf2val = { - .name = "port_type_array param", - .num_vals = 2, - .def_val = {MLX4_PORT_TYPE_ETH, MLX4_PORT_TYPE_ETH}, - .range = {MLX4_PORT_TYPE_IB, MLX4_PORT_TYPE_NA} - } -}; -module_param_string(port_type_array, port_type_array.dbdf2val.str, - sizeof(port_type_array.dbdf2val.str), 0444); -MODULE_PARM_DESC(port_type_array, - "Either pair of values (e.g. '1,2') to define uniform port1/port2 types configuration for all devices functions\n" - "\t\tor a string to map device function numbers to their pair of port types values (e.g. '0000:04:00.0-1;2,002b:1c:0b.a-1;1').\n" - "\t\tValid port types: 1-ib, 2-eth, 3-auto, 4-N/A\n" - "\t\tIn case that only one port is available use the N/A port type for port2 (e.g '1,4')."); +MODULE_PARM_DESC(log_mtts_per_seg, "Log2 number of MTT entries per segment (1-7)"); +static int port_type_array[2] = {MLX4_PORT_TYPE_NONE, MLX4_PORT_TYPE_NONE}; struct mlx4_port_config { struct list_head list; @@ -216,345 +173,20 @@ struct mlx4_port_config { struct pci_dev *pdev; }; -#define MLX4_LOG_NUM_MTT 20 -/* We limit to 30 as of a bit map issue which uses int and not uint. - see mlx4_buddy_init -> bitmap_zero which gets int. -*/ -#define MLX4_MAX_LOG_NUM_MTT 30 -static struct mlx4_profile mod_param_profile = { - .num_qp = 19, - .num_srq = 16, - .rdmarc_per_qp = 4, - .num_cq = 16, - .num_mcg = 13, - .num_mpt = 19, - .num_mtt_segs = 0, /* max(20, 2*MTTs for host memory)) */ -}; +static atomic_t pf_loading = ATOMIC_INIT(0); -module_param_named(log_num_qp, mod_param_profile.num_qp, int, 0444); -MODULE_PARM_DESC(log_num_qp, "log maximum number of QPs per HCA (default: 19)"); - -module_param_named(log_num_srq, mod_param_profile.num_srq, int, 0444); -MODULE_PARM_DESC(log_num_srq, "log maximum number of SRQs per HCA " - "(default: 16)"); - -module_param_named(log_rdmarc_per_qp, mod_param_profile.rdmarc_per_qp, int, - 0444); -MODULE_PARM_DESC(log_rdmarc_per_qp, "log number of RDMARC buffers per QP " - "(default: 4)"); - -module_param_named(log_num_cq, mod_param_profile.num_cq, int, 0444); -MODULE_PARM_DESC(log_num_cq, "log maximum number of CQs per HCA (default: 16)"); - -module_param_named(log_num_mcg, mod_param_profile.num_mcg, int, 0444); -MODULE_PARM_DESC(log_num_mcg, "log maximum number of multicast groups per HCA " - "(default: 13)"); - -module_param_named(log_num_mpt, mod_param_profile.num_mpt, int, 0444); -MODULE_PARM_DESC(log_num_mpt, - "log maximum number of memory protection table entries per " - "HCA (default: 19)"); - -module_param_named(log_num_mtt, mod_param_profile.num_mtt_segs, int, 0444); -MODULE_PARM_DESC(log_num_mtt, - "log maximum number of memory translation table segments per " - "HCA (default: max(20, 2*MTTs for register all of the host memory limited to 30))"); - -enum { - MLX4_IF_STATE_BASIC, - MLX4_IF_STATE_EXTENDED -}; - -static inline u64 dbdf_to_u64(int domain, int bus, int dev, int fn) +static inline void mlx4_set_num_reserved_uars(struct mlx4_dev *dev, + struct mlx4_dev_cap *dev_cap) { - return (domain << 20) | (bus << 12) | (dev << 4) | fn; -} - -static inline void pr_bdf_err(const char *dbdf, const char *pname) -{ - pr_warn("mlx4_core: '%s' is not valid bdf in '%s'\n", dbdf, pname); -} - -static inline void pr_val_err(const char *dbdf, const char *pname, - const char *val) -{ - pr_warn("mlx4_core: value '%s' of bdf '%s' in '%s' is not valid\n" - , val, dbdf, pname); -} - -static inline void pr_out_of_range_bdf(const char *dbdf, int val, - struct mlx4_dbdf2val_lst *dbdf2val) -{ - pr_warn("mlx4_core: value %d in bdf '%s' of '%s' is out of its valid range (%d,%d)\n" - , val, dbdf, dbdf2val->name , dbdf2val->range.min, - dbdf2val->range.max); -} - -static inline void pr_out_of_range(struct mlx4_dbdf2val_lst *dbdf2val) -{ - pr_warn("mlx4_core: value of '%s' is out of its valid range (%d,%d)\n" - , dbdf2val->name , dbdf2val->range.min, dbdf2val->range.max); -} - -static inline int is_in_range(int val, struct mlx4_range *r) -{ - return (val >= r->min && val <= r->max); -} - -static int update_defaults(struct param_data *pdata) -{ - long int val[MLX4_MAX_BDF_VALS]; - int ret; - char *t, *p = pdata->dbdf2val.str; - char sval[32]; - int val_len; - - if (!strlen(p) || strchr(p, ':') || strchr(p, '.') || strchr(p, ';')) - return INVALID_STR; - - switch (pdata->id) { - case PORT_TYPE_ARRAY: - t = strchr(p, ','); - if (!t || t == p || (t - p) > sizeof(sval)) - return INVALID_STR; - - val_len = t - p; - strncpy(sval, p, val_len); - sval[val_len] = 0; - - ret = kstrtol(sval, 0, &val[0]); - if (ret == -EINVAL) - return INVALID_STR; - if (ret || !is_in_range(val[0], &pdata->dbdf2val.range)) { - pr_out_of_range(&pdata->dbdf2val); - return INVALID_DATA; - } - - ret = kstrtol(t + 1, 0, &val[1]); - if (ret == -EINVAL) - return INVALID_STR; - if (ret || !is_in_range(val[1], &pdata->dbdf2val.range)) { - pr_out_of_range(&pdata->dbdf2val); - return INVALID_DATA; - } - - pdata->dbdf2val.tbl[0].val[0] = val[0]; - pdata->dbdf2val.tbl[0].val[1] = val[1]; - break; - - case NUM_VFS: - case PROBE_VF: - ret = kstrtol(p, 0, &val[0]); - if (ret == -EINVAL) - return INVALID_STR; - if (ret || !is_in_range(val[0], &pdata->dbdf2val.range)) { - pr_out_of_range(&pdata->dbdf2val); - return INVALID_DATA; - } - pdata->dbdf2val.tbl[0].val[0] = val[0]; - break; - } - pdata->dbdf2val.tbl[1].dbdf = MLX4_ENDOF_TBL; - - return VALID_DATA; -} - -int mlx4_fill_dbdf2val_tbl(struct mlx4_dbdf2val_lst *dbdf2val_lst) -{ - int domain, bus, dev, fn; - u64 dbdf; - char *p, *t, *v; - char tmp[32]; - char sbdf[32]; - char sep = ','; - int j, k, str_size, i = 1; - int prfx_size; - - p = dbdf2val_lst->str; - - for (j = 0; j < dbdf2val_lst->num_vals; j++) - dbdf2val_lst->tbl[0].val[j] = dbdf2val_lst->def_val[j]; - dbdf2val_lst->tbl[1].dbdf = MLX4_ENDOF_TBL; - - str_size = strlen(dbdf2val_lst->str); - - if (str_size == 0) - return 0; - - while (strlen(p)) { - prfx_size = BDF_STR_SIZE; - sbdf[prfx_size] = 0; - strncpy(sbdf, p, prfx_size); - domain = DEFAULT_DOMAIN; - if (sscanf(sbdf, "%02x:%02x.%x-", &bus, &dev, &fn) != 3) { - prfx_size = DBDF_STR_SIZE; - sbdf[prfx_size] = 0; - strncpy(sbdf, p, prfx_size); - if (sscanf(sbdf, "%04x:%02x:%02x.%x-", &domain, &bus, - &dev, &fn) != 4) { - pr_bdf_err(sbdf, dbdf2val_lst->name); - goto err; - } - sprintf(tmp, "%04x:%02x:%02x.%x-", domain, bus, dev, - fn); - } else { - sprintf(tmp, "%02x:%02x.%x-", bus, dev, fn); - } - - if (strnicmp(sbdf, tmp, sizeof(tmp))) { - pr_bdf_err(sbdf, dbdf2val_lst->name); - goto err; - } - - dbdf = dbdf_to_u64(domain, bus, dev, fn); - - for (j = 1; j < i; j++) - if (dbdf2val_lst->tbl[j].dbdf == dbdf) { - pr_warn("mlx4_core: in '%s', %s appears multiple times\n" - , dbdf2val_lst->name, sbdf); - goto err; - } - - if (i >= MLX4_DEVS_TBL_SIZE) { - pr_warn("mlx4_core: Too many devices in '%s'\n" - , dbdf2val_lst->name); - goto err; - } - - p += prfx_size; - t = strchr(p, sep); - t = t ? t : p + strlen(p); - if (p >= t) { - pr_val_err(sbdf, dbdf2val_lst->name, ""); - goto err; - } - - for (k = 0; k < dbdf2val_lst->num_vals; k++) { - char sval[32]; - long int val; - int ret, val_len; - char vsep = ';'; - - v = (k == dbdf2val_lst->num_vals - 1) ? t : strchr(p, vsep); - if (!v || v > t || v == p || (v - p) > sizeof(sval)) { - pr_val_err(sbdf, dbdf2val_lst->name, p); - goto err; - } - val_len = v - p; - strncpy(sval, p, val_len); - sval[val_len] = 0; - - ret = kstrtol(sval, 0, &val); - if (ret) { - if (strchr(p, vsep)) - pr_warn("mlx4_core: too many vals in bdf '%s' of '%s'\n" - , sbdf, dbdf2val_lst->name); - else - pr_val_err(sbdf, dbdf2val_lst->name, - sval); - goto err; - } - if (!is_in_range(val, &dbdf2val_lst->range)) { - pr_out_of_range_bdf(sbdf, val, dbdf2val_lst); - goto err; - } - - dbdf2val_lst->tbl[i].val[k] = val; - p = v; - if (p[0] == vsep) - p++; - } - - dbdf2val_lst->tbl[i].dbdf = dbdf; - if (strlen(p)) { - if (p[0] != sep) { - pr_warn("mlx4_core: expect separator '%c' before '%s' in '%s'\n" - , sep, p, dbdf2val_lst->name); - goto err; - } - p++; - } - i++; - if (i < MLX4_DEVS_TBL_SIZE) - dbdf2val_lst->tbl[i].dbdf = MLX4_ENDOF_TBL; - } - - return 0; - -err: - dbdf2val_lst->tbl[1].dbdf = MLX4_ENDOF_TBL; - pr_warn("mlx4_core: The value of '%s' is incorrect. The value is discarded!\n" - , dbdf2val_lst->name); - - return -EINVAL; -} -EXPORT_SYMBOL(mlx4_fill_dbdf2val_tbl); - -int mlx4_get_val(struct mlx4_dbdf2val *tbl, struct pci_dev *pdev, int idx, - int *val) -{ - u64 dbdf; - int i = 1; - - *val = tbl[0].val[idx]; - if (!pdev) - return -EINVAL; - - dbdf = dbdf_to_u64(pci_get_domain(pdev->dev.bsddev), pci_get_bus(pdev->dev.bsddev), - PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn)); - - while ((i < MLX4_DEVS_TBL_SIZE) && (tbl[i].dbdf != MLX4_ENDOF_TBL)) { - if (tbl[i].dbdf == dbdf) { - *val = tbl[i].val[idx]; - return 0; - } - i++; - } - - return 0; -} -EXPORT_SYMBOL(mlx4_get_val); - -static void process_mod_param_profile(struct mlx4_profile *profile) -{ - vm_size_t hwphyssz; - hwphyssz = 0; - TUNABLE_ULONG_FETCH("hw.realmem", (u_long *) &hwphyssz); - - profile->num_qp = 1 << mod_param_profile.num_qp; - profile->num_srq = 1 << mod_param_profile.num_srq; - profile->rdmarc_per_qp = 1 << mod_param_profile.rdmarc_per_qp; - profile->num_cq = 1 << mod_param_profile.num_cq; - profile->num_mcg = 1 << mod_param_profile.num_mcg; - profile->num_mpt = 1 << mod_param_profile.num_mpt; - /* - * We want to scale the number of MTTs with the size of the - * system memory, since it makes sense to register a lot of - * memory on a system with a lot of memory. As a heuristic, - * make sure we have enough MTTs to register twice the system - * memory (with PAGE_SIZE entries). - * - * This number has to be a power of two and fit into 32 bits - * due to device limitations. We cap this at 2^30 as of bit map - * limitation to work with int instead of uint (mlx4_buddy_init -> bitmap_zero) - * That limits us to 4TB of memory registration per HCA with - * 4KB pages, which is probably OK for the next few months. + /* The reserved_uars is calculated by system page size unit. + * Therefore, adjustment is added when the uar page size is less + * than the system page size */ - if (mod_param_profile.num_mtt_segs) - profile->num_mtt_segs = 1 << mod_param_profile.num_mtt_segs; - else { - profile->num_mtt_segs = - roundup_pow_of_two(max_t(unsigned, - 1 << (MLX4_LOG_NUM_MTT - log_mtts_per_seg), - min(1UL << - (MLX4_MAX_LOG_NUM_MTT - - log_mtts_per_seg), - (hwphyssz << 1) - >> log_mtts_per_seg))); - /* set the actual value, so it will be reflected to the user - using the sysfs */ - mod_param_profile.num_mtt_segs = ilog2(profile->num_mtt_segs); - } + dev->caps.reserved_uars = + max_t(int, + mlx4_get_num_reserved_uar(dev), + dev_cap->reserved_uars / + (1 << (PAGE_SHIFT - dev->uar_page_shift))); } int mlx4_check_port_params(struct mlx4_dev *dev, @@ -562,11 +194,10 @@ int mlx4_check_port_params(struct mlx4_dev *dev, { int i; - for (i = 0; i < dev->caps.num_ports - 1; i++) { - if (port_type[i] != port_type[i + 1]) { - if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_DPDP)) { - mlx4_err(dev, "Only same port types supported " - "on this HCA, aborting.\n"); + if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_DPDP)) { + for (i = 0; i < dev->caps.num_ports - 1; i++) { + if (port_type[i] != port_type[i + 1]) { + mlx4_err(dev, "Only same port types supported on this HCA, aborting\n"); return -EINVAL; } } @@ -574,8 +205,8 @@ int mlx4_check_port_params(struct mlx4_dev *dev, for (i = 0; i < dev->caps.num_ports; i++) { if (!(port_type[i] & dev->caps.supported_type[i+1])) { - mlx4_err(dev, "Requested port type for port %d is not " - "supported on this HCA\n", i + 1); + mlx4_err(dev, "Requested port type for port %d is not supported on this HCA\n", + i + 1); return -EINVAL; } } @@ -613,6 +244,101 @@ static int mlx4_query_func(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) return err; } +static void mlx4_enable_cqe_eqe_stride(struct mlx4_dev *dev) +{ + struct mlx4_caps *dev_cap = &dev->caps; + + /* FW not supporting or cancelled by user */ + if (!(dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_EQE_STRIDE) || + !(dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_CQE_STRIDE)) + return; + + /* Must have 64B CQE_EQE enabled by FW to use bigger stride + * When FW has NCSI it may decide not to report 64B CQE/EQEs + */ + if (!(dev_cap->flags & MLX4_DEV_CAP_FLAG_64B_EQE) || + !(dev_cap->flags & MLX4_DEV_CAP_FLAG_64B_CQE)) { + dev_cap->flags2 &= ~MLX4_DEV_CAP_FLAG2_CQE_STRIDE; + dev_cap->flags2 &= ~MLX4_DEV_CAP_FLAG2_EQE_STRIDE; + return; + } + + if (cache_line_size() == 128 || cache_line_size() == 256) { + mlx4_dbg(dev, "Enabling CQE stride cacheLine supported\n"); + /* Changing the real data inside CQE size to 32B */ + dev_cap->flags &= ~MLX4_DEV_CAP_FLAG_64B_CQE; + dev_cap->flags &= ~MLX4_DEV_CAP_FLAG_64B_EQE; + + if (mlx4_is_master(dev)) + dev_cap->function_caps |= MLX4_FUNC_CAP_EQE_CQE_STRIDE; + } else { + if (cache_line_size() != 32 && cache_line_size() != 64) + mlx4_dbg(dev, "Disabling CQE stride, cacheLine size unsupported\n"); + dev_cap->flags2 &= ~MLX4_DEV_CAP_FLAG2_CQE_STRIDE; + dev_cap->flags2 &= ~MLX4_DEV_CAP_FLAG2_EQE_STRIDE; + } +} + +static int _mlx4_dev_port(struct mlx4_dev *dev, int port, + struct mlx4_port_cap *port_cap) +{ + dev->caps.vl_cap[port] = port_cap->max_vl; + dev->caps.ib_mtu_cap[port] = port_cap->ib_mtu; + dev->phys_caps.gid_phys_table_len[port] = port_cap->max_gids; + dev->phys_caps.pkey_phys_table_len[port] = port_cap->max_pkeys; + /* set gid and pkey table operating lengths by default + * to non-sriov values + */ + dev->caps.gid_table_len[port] = port_cap->max_gids; + dev->caps.pkey_table_len[port] = port_cap->max_pkeys; + dev->caps.port_width_cap[port] = port_cap->max_port_width; + dev->caps.eth_mtu_cap[port] = port_cap->eth_mtu; + dev->caps.max_tc_eth = port_cap->max_tc_eth; + dev->caps.def_mac[port] = port_cap->def_mac; + dev->caps.supported_type[port] = port_cap->supported_port_types; + dev->caps.suggested_type[port] = port_cap->suggested_type; + dev->caps.default_sense[port] = port_cap->default_sense; + dev->caps.trans_type[port] = port_cap->trans_type; + dev->caps.vendor_oui[port] = port_cap->vendor_oui; + dev->caps.wavelength[port] = port_cap->wavelength; + dev->caps.trans_code[port] = port_cap->trans_code; + + return 0; +} + +static int mlx4_dev_port(struct mlx4_dev *dev, int port, + struct mlx4_port_cap *port_cap) +{ + int err = 0; + + err = mlx4_QUERY_PORT(dev, port, port_cap); + + if (err) + mlx4_err(dev, "QUERY_PORT command failed.\n"); + + return err; +} + +static inline void mlx4_enable_ignore_fcs(struct mlx4_dev *dev) +{ + if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_IGNORE_FCS)) + return; + + if (mlx4_is_mfunc(dev)) { + mlx4_dbg(dev, "SRIOV mode - Disabling Ignore FCS"); + dev->caps.flags2 &= ~MLX4_DEV_CAP_FLAG2_IGNORE_FCS; + return; + } + + if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_FCS_KEEP)) { + mlx4_dbg(dev, + "Keep FCS is not supported - Disabling Ignore FCS"); + dev->caps.flags2 &= ~MLX4_DEV_CAP_FLAG2_IGNORE_FCS; + return; + } +} + +#define MLX4_A0_STEERING_TABLE_SIZE 256 static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) { int err; @@ -620,55 +346,41 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) err = mlx4_QUERY_DEV_CAP(dev, dev_cap); if (err) { - mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting.\n"); + mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting\n"); return err; } + mlx4_dev_cap_dump(dev, dev_cap); if (dev_cap->min_page_sz > PAGE_SIZE) { - mlx4_err(dev, "HCA minimum page size of %d bigger than " - "kernel PAGE_SIZE of %d, aborting.\n", - dev_cap->min_page_sz, (int)PAGE_SIZE); + mlx4_err(dev, "HCA minimum page size of %d bigger than kernel PAGE_SIZE of %ld, aborting\n", + dev_cap->min_page_sz, (long)PAGE_SIZE); return -ENODEV; } if (dev_cap->num_ports > MLX4_MAX_PORTS) { - mlx4_err(dev, "HCA has %d ports, but we only support %d, " - "aborting.\n", + mlx4_err(dev, "HCA has %d ports, but we only support %d, aborting\n", dev_cap->num_ports, MLX4_MAX_PORTS); return -ENODEV; } - if (dev_cap->uar_size > pci_resource_len(dev->pdev, 2)) { - mlx4_err(dev, "HCA reported UAR size of 0x%x bigger than " - "PCI resource 2 size of 0x%llx, aborting.\n", + if (dev_cap->uar_size > pci_resource_len(dev->persist->pdev, 2)) { + mlx4_err(dev, "HCA reported UAR size of 0x%x bigger than PCI resource 2 size of 0x%llx, aborting\n", dev_cap->uar_size, - (unsigned long long) pci_resource_len(dev->pdev, 2)); + (unsigned long long) + pci_resource_len(dev->persist->pdev, 2)); return -ENODEV; } dev->caps.num_ports = dev_cap->num_ports; - dev->caps.num_sys_eqs = dev_cap->num_sys_eqs; - dev->phys_caps.num_phys_eqs = dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_SYS_EQS ? - dev->caps.num_sys_eqs : - MLX4_MAX_EQ_NUM; + dev->caps.num_sys_eqs = dev_cap->num_sys_eqs; + dev->phys_caps.num_phys_eqs = dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_SYS_EQS ? + dev->caps.num_sys_eqs : + MLX4_MAX_EQ_NUM; for (i = 1; i <= dev->caps.num_ports; ++i) { - dev->caps.vl_cap[i] = dev_cap->max_vl[i]; - dev->caps.ib_mtu_cap[i] = dev_cap->ib_mtu[i]; - dev->phys_caps.gid_phys_table_len[i] = dev_cap->max_gids[i]; - dev->phys_caps.pkey_phys_table_len[i] = dev_cap->max_pkeys[i]; - /* set gid and pkey table operating lengths by default - * to non-sriov values */ - dev->caps.gid_table_len[i] = dev_cap->max_gids[i]; - dev->caps.pkey_table_len[i] = dev_cap->max_pkeys[i]; - dev->caps.port_width_cap[i] = dev_cap->max_port_width[i]; - dev->caps.eth_mtu_cap[i] = dev_cap->eth_mtu[i]; - dev->caps.def_mac[i] = dev_cap->def_mac[i]; - dev->caps.supported_type[i] = dev_cap->supported_port_types[i]; - dev->caps.suggested_type[i] = dev_cap->suggested_type[i]; - dev->caps.default_sense[i] = dev_cap->default_sense[i]; - dev->caps.trans_type[i] = dev_cap->trans_type[i]; - dev->caps.vendor_oui[i] = dev_cap->vendor_oui[i]; - dev->caps.wavelength[i] = dev_cap->wavelength[i]; - dev->caps.trans_code[i] = dev_cap->trans_code[i]; + err = _mlx4_dev_port(dev, i, dev_cap->port_cap + i); + if (err) { + mlx4_err(dev, "QUERY_PORT command failed, aborting\n"); + return err; + } } dev->caps.uar_page_size = PAGE_SIZE; @@ -687,7 +399,8 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) dev->caps.max_rq_desc_sz = dev_cap->max_rq_desc_sz; /* * Subtract 1 from the limit because we need to allocate a - * spare CQE to enable resizing the CQ + * spare CQE so the HCA HW can tell the difference between an + * empty CQ and a full CQ. */ dev->caps.max_cqes = dev_cap->max_cq_sz - 1; dev->caps.reserved_cqs = dev_cap->reserved_cqs; @@ -695,8 +408,6 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) dev->caps.reserved_mtts = dev_cap->reserved_mtts; dev->caps.reserved_mrws = dev_cap->reserved_mrws; - /* The first 128 UARs are used for EQ doorbells */ - dev->caps.reserved_uars = max_t(int, 128, dev_cap->reserved_uars); dev->caps.reserved_pds = dev_cap->reserved_pds; dev->caps.reserved_xrcds = (dev->caps.flags & MLX4_DEV_CAP_FLAG_XRC) ? dev_cap->reserved_xrcds : 0; @@ -711,10 +422,37 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) dev->caps.bmme_flags = dev_cap->bmme_flags; dev->caps.reserved_lkey = dev_cap->reserved_lkey; dev->caps.stat_rate_support = dev_cap->stat_rate_support; - dev->caps.cq_timestamp = dev_cap->timestamp_support; dev->caps.max_gso_sz = dev_cap->max_gso_sz; dev->caps.max_rss_tbl_sz = dev_cap->max_rss_tbl_sz; + /* Save uar page shift */ + if (!mlx4_is_slave(dev)) { + /* Virtual PCI function needs to determine UAR page size from + * firmware. Only master PCI function can set the uar page size + */ + if (enable_4k_uar) + dev->uar_page_shift = DEFAULT_UAR_PAGE_SHIFT; + else + dev->uar_page_shift = PAGE_SHIFT; + + mlx4_set_num_reserved_uars(dev, dev_cap); + } + + if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_PHV_EN) { + struct mlx4_init_hca_param hca_param; + + memset(&hca_param, 0, sizeof(hca_param)); + err = mlx4_QUERY_HCA(dev, &hca_param); + /* Turn off PHV_EN flag in case phv_check_en is set. + * phv_check_en is a HW check that parse the packet and verify + * phv bit was reported correctly in the wqe. To allow QinQ + * PHV_EN flag should be set and phv_check_en must be cleared + * otherwise QinQ packets will be drop by the HW. + */ + if (err || hca_param.phv_check_en) + dev->caps.flags2 &= ~MLX4_DEV_CAP_FLAG2_PHV_EN; + } + /* Sense port always allowed on supported devices for ConnectX-1 and -2 */ if (mlx4_priv(dev)->pci_dev_data & MLX4_PCI_DEV_FORCE_SENSE_PORT) dev->caps.flags |= MLX4_DEV_CAP_FLAG_SENSE_SUPPORT; @@ -722,12 +460,13 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) if (mlx4_is_mfunc(dev)) dev->caps.flags &= ~MLX4_DEV_CAP_FLAG_SENSE_SUPPORT; - dev->caps.log_num_macs = log_num_mac; - dev->caps.log_num_vlans = MLX4_LOG_NUM_VLANS; - - dev->caps.fast_drop = fast_drop ? - !!(dev->caps.flags & MLX4_DEV_CAP_FLAG_FAST_DROP) : - 0; + if (mlx4_low_memory_profile()) { + dev->caps.log_num_macs = MLX4_MIN_LOG_NUM_MAC; + dev->caps.log_num_vlans = MLX4_MIN_LOG_NUM_VLANS; + } else { + dev->caps.log_num_macs = log_num_mac; + dev->caps.log_num_vlans = MLX4_LOG_NUM_VLANS; + } for (i = 1; i <= dev->caps.num_ports; ++i) { dev->caps.port_type[i] = MLX4_PORT_TYPE_NONE; @@ -740,26 +479,14 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) MLX4_PORT_TYPE_IB) dev->caps.port_type[i] = MLX4_PORT_TYPE_IB; else { - /* - * if IB and ETH are supported, we set the port + /* if IB and ETH are supported, we set the port * type according to user selection of port type; - * if there is no user selection, take the FW hint - */ - int pta; - mlx4_get_val(port_type_array.dbdf2val.tbl, - pci_physfn(dev->pdev), i - 1, - &pta); - if (pta == MLX4_PORT_TYPE_NONE) { + * if user selected none, take the FW hint */ + if (port_type_array[i - 1] == MLX4_PORT_TYPE_NONE) dev->caps.port_type[i] = dev->caps.suggested_type[i] ? MLX4_PORT_TYPE_ETH : MLX4_PORT_TYPE_IB; - } else if (pta == MLX4_PORT_TYPE_NA) { - mlx4_err(dev, "Port %d is valid port. " - "It is not allowed to configure its type to N/A(%d)\n", - i, MLX4_PORT_TYPE_NA); - return -EINVAL; - } else { - dev->caps.port_type[i] = pta; - } + else + dev->caps.port_type[i] = port_type_array[i - 1]; } } /* @@ -773,9 +500,6 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) (dev->caps.flags & MLX4_DEV_CAP_FLAG_DPDP) && (dev->caps.flags & MLX4_DEV_CAP_FLAG_SENSE_SUPPORT)); - /* Disablling auto sense for default Eth ports support */ - mlx4_priv(dev)->sense.sense_allowed[i] = 0; - /* * If "default_sense" bit is set, we move the port to "AUTO" mode * and perform sense_port FW command to try and set the correct @@ -791,27 +515,27 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) dev->caps.possible_type[i] = dev->caps.port_type[i]; } - if (dev->caps.log_num_macs > dev_cap->log_max_macs[i]) { - dev->caps.log_num_macs = dev_cap->log_max_macs[i]; - mlx4_warn(dev, "Requested number of MACs is too much " - "for port %d, reducing to %d.\n", + if (dev->caps.log_num_macs > dev_cap->port_cap[i].log_max_macs) { + dev->caps.log_num_macs = dev_cap->port_cap[i].log_max_macs; + mlx4_warn(dev, "Requested number of MACs is too much for port %d, reducing to %d\n", i, 1 << dev->caps.log_num_macs); } - if (dev->caps.log_num_vlans > dev_cap->log_max_vlans[i]) { - dev->caps.log_num_vlans = dev_cap->log_max_vlans[i]; - mlx4_warn(dev, "Requested number of VLANs is too much " - "for port %d, reducing to %d.\n", + if (dev->caps.log_num_vlans > dev_cap->port_cap[i].log_max_vlans) { + dev->caps.log_num_vlans = dev_cap->port_cap[i].log_max_vlans; + mlx4_warn(dev, "Requested number of VLANs is too much for port %d, reducing to %d\n", i, 1 << dev->caps.log_num_vlans); } } - dev->caps.max_basic_counters = dev_cap->max_basic_counters; - dev->caps.max_extended_counters = dev_cap->max_extended_counters; - /* support extended counters if available */ - if (dev->caps.flags & MLX4_DEV_CAP_FLAG_COUNTERS_EXT) - dev->caps.max_counters = dev->caps.max_extended_counters; - else - dev->caps.max_counters = dev->caps.max_basic_counters; + if (mlx4_is_master(dev) && (dev->caps.num_ports == 2) && + (port_type_array[0] == MLX4_PORT_TYPE_IB) && + (port_type_array[1] == MLX4_PORT_TYPE_ETH)) { + mlx4_warn(dev, + "Granular QoS per VF not supported with IB/Eth configuration\n"); + dev->caps.flags2 &= ~MLX4_DEV_CAP_FLAG2_QOS_VPP; + } + + dev->caps.max_counters = dev_cap->max_counters; dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW] = dev_cap->reserved_qps; dev->caps.reserved_qps_cnt[MLX4_QP_REGION_ETH_ADDR] = @@ -821,24 +545,52 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) dev->caps.num_ports; dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FC_EXCH] = MLX4_NUM_FEXCH; + if (dev_cap->dmfs_high_rate_qpn_base > 0 && + dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_FS_EN) + dev->caps.dmfs_high_rate_qpn_base = dev_cap->dmfs_high_rate_qpn_base; + else + dev->caps.dmfs_high_rate_qpn_base = + dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW]; + + if (dev_cap->dmfs_high_rate_qpn_range > 0 && + dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_FS_EN) { + dev->caps.dmfs_high_rate_qpn_range = dev_cap->dmfs_high_rate_qpn_range; + dev->caps.dmfs_high_steer_mode = MLX4_STEERING_DMFS_A0_DEFAULT; + dev->caps.flags2 |= MLX4_DEV_CAP_FLAG2_FS_A0; + } else { + dev->caps.dmfs_high_steer_mode = MLX4_STEERING_DMFS_A0_NOT_SUPPORTED; + dev->caps.dmfs_high_rate_qpn_base = + dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW]; + dev->caps.dmfs_high_rate_qpn_range = MLX4_A0_STEERING_TABLE_SIZE; + } + + dev->caps.rl_caps = dev_cap->rl_caps; + + dev->caps.reserved_qps_cnt[MLX4_QP_REGION_RSS_RAW_ETH] = + dev->caps.dmfs_high_rate_qpn_range; + dev->caps.reserved_qps = dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW] + dev->caps.reserved_qps_cnt[MLX4_QP_REGION_ETH_ADDR] + dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FC_ADDR] + dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FC_EXCH]; - dev->caps.sync_qp = dev_cap->sync_qp; - if (dev->pdev->device == 0x1003) - dev->caps.cq_flags |= MLX4_DEV_CAP_CQ_FLAG_IO; - dev->caps.sqp_demux = (mlx4_is_master(dev)) ? MLX4_MAX_NUM_SLAVES : 0; - if (!mlx4_enable_64b_cqe_eqe && !mlx4_is_slave(dev)) { + if (!enable_64b_cqe_eqe && !mlx4_is_slave(dev)) { if (dev_cap->flags & (MLX4_DEV_CAP_FLAG_64B_CQE | MLX4_DEV_CAP_FLAG_64B_EQE)) { mlx4_warn(dev, "64B EQEs/CQEs supported by the device but not enabled\n"); dev->caps.flags &= ~MLX4_DEV_CAP_FLAG_64B_CQE; dev->caps.flags &= ~MLX4_DEV_CAP_FLAG_64B_EQE; } + + if (dev_cap->flags2 & + (MLX4_DEV_CAP_FLAG2_CQE_STRIDE | + MLX4_DEV_CAP_FLAG2_EQE_STRIDE)) { + mlx4_warn(dev, "Disabling EQE/CQE stride per user request\n"); + dev_cap->flags2 &= ~MLX4_DEV_CAP_FLAG2_CQE_STRIDE; + dev_cap->flags2 &= ~MLX4_DEV_CAP_FLAG2_EQE_STRIDE; + } } if ((dev->caps.flags & @@ -847,17 +599,106 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) dev->caps.function_caps |= MLX4_FUNC_CAP_64B_EQE_CQE; if (!mlx4_is_slave(dev)) { - for (i = 0; i < dev->caps.num_ports; ++i) - dev->caps.def_counter_index[i] = i << 1; - + mlx4_enable_cqe_eqe_stride(dev); dev->caps.alloc_res_qp_mask = - (dev->caps.bf_reg_size ? MLX4_RESERVE_ETH_BF_QP : 0); + (dev->caps.bf_reg_size ? MLX4_RESERVE_ETH_BF_QP : 0) | + MLX4_RESERVE_A0_QP; + + if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ETS_CFG) && + dev->caps.flags & MLX4_DEV_CAP_FLAG_SET_ETH_SCHED) { + mlx4_warn(dev, "Old device ETS support detected\n"); + mlx4_warn(dev, "Consider upgrading device FW.\n"); + dev->caps.flags2 |= MLX4_DEV_CAP_FLAG2_ETS_CFG; + } + } else { dev->caps.alloc_res_qp_mask = 0; } + mlx4_enable_ignore_fcs(dev); + return 0; } + +static int mlx4_get_pcie_dev_link_caps(struct mlx4_dev *dev, + enum pci_bus_speed *speed, + enum pcie_link_width *width) +{ + u32 lnkcap1, lnkcap2; + int err1, err2; + +#define PCIE_MLW_CAP_SHIFT 4 /* start of MLW mask in link capabilities */ + + *speed = PCI_SPEED_UNKNOWN; + *width = PCIE_LNK_WIDTH_UNKNOWN; + + err1 = pcie_capability_read_dword(dev->persist->pdev, PCI_EXP_LNKCAP, + &lnkcap1); + err2 = pcie_capability_read_dword(dev->persist->pdev, PCI_EXP_LNKCAP2, + &lnkcap2); + if (!err2 && lnkcap2) { /* PCIe r3.0-compliant */ + if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_8_0GB) + *speed = PCIE_SPEED_8_0GT; + else if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_5_0GB) + *speed = PCIE_SPEED_5_0GT; + else if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_2_5GB) + *speed = PCIE_SPEED_2_5GT; + } + if (!err1) { + *width = (lnkcap1 & PCI_EXP_LNKCAP_MLW) >> PCIE_MLW_CAP_SHIFT; + if (!lnkcap2) { /* pre-r3.0 */ + if (lnkcap1 & PCI_EXP_LNKCAP_SLS_5_0GB) + *speed = PCIE_SPEED_5_0GT; + else if (lnkcap1 & PCI_EXP_LNKCAP_SLS_2_5GB) + *speed = PCIE_SPEED_2_5GT; + } + } + + if (*speed == PCI_SPEED_UNKNOWN || *width == PCIE_LNK_WIDTH_UNKNOWN) { + return err1 ? err1 : + err2 ? err2 : -EINVAL; + } + return 0; +} + +static void mlx4_check_pcie_caps(struct mlx4_dev *dev) +{ + enum pcie_link_width width, width_cap; + enum pci_bus_speed speed, speed_cap; + int err; + +#define PCIE_SPEED_STR(speed) \ + (speed == PCIE_SPEED_8_0GT ? "8.0GT/s" : \ + speed == PCIE_SPEED_5_0GT ? "5.0GT/s" : \ + speed == PCIE_SPEED_2_5GT ? "2.5GT/s" : \ + "Unknown") + + err = mlx4_get_pcie_dev_link_caps(dev, &speed_cap, &width_cap); + if (err) { + mlx4_warn(dev, + "Unable to determine PCIe device BW capabilities\n"); + return; + } + + err = pcie_get_minimum_link(dev->persist->pdev, &speed, &width); + if (err || speed == PCI_SPEED_UNKNOWN || + width == PCIE_LNK_WIDTH_UNKNOWN) { + mlx4_warn(dev, + "Unable to determine PCI device chain minimum BW\n"); + return; + } + + if (width != width_cap || speed != speed_cap) + mlx4_warn(dev, + "PCIe BW is different than device's capability\n"); + + mlx4_info(dev, "PCIe link speed is %s, device supports %s\n", + PCIE_SPEED_STR(speed), PCIE_SPEED_STR(speed_cap)); + mlx4_info(dev, "PCIe link width is x%d, device supports x%d\n", + width, width_cap); + return; +} + /*The function checks if there are live vf, return the num of them*/ static int mlx4_how_many_lives_vf(struct mlx4_dev *dev) { @@ -947,9 +788,11 @@ static void slave_adjust_steering_mode(struct mlx4_dev *dev, struct mlx4_init_hca_param *hca_param) { dev->caps.steering_mode = hca_param->steering_mode; - if (dev->caps.steering_mode == MLX4_STEERING_MODE_DEVICE_MANAGED) + if (dev->caps.steering_mode == MLX4_STEERING_MODE_DEVICE_MANAGED) { dev->caps.num_qp_per_mgm = dev_cap->fs_max_num_qp_per_entry; - else + dev->caps.fs_log_max_ucast_qp_range_size = + dev_cap->fs_log_max_ucast_qp_range_size; + } else dev->caps.num_qp_per_mgm = 4 * ((1 << hca_param->log_mc_entry_sz)/16 - 2); @@ -964,18 +807,19 @@ static int mlx4_slave_cap(struct mlx4_dev *dev) struct mlx4_dev_cap dev_cap; struct mlx4_func_cap func_cap; struct mlx4_init_hca_param hca_param; - int i; + u8 i; memset(&hca_param, 0, sizeof(hca_param)); err = mlx4_QUERY_HCA(dev, &hca_param); if (err) { - mlx4_err(dev, "QUERY_HCA command failed, aborting.\n"); + mlx4_err(dev, "QUERY_HCA command failed, aborting\n"); return err; } - /*fail if the hca has an unknown capability */ - if ((hca_param.global_caps | HCA_GLOBAL_CAP_MASK) != - HCA_GLOBAL_CAP_MASK) { + /* fail if the hca has an unknown global capability + * at this time global_caps should be always zeroed + */ + if (hca_param.global_caps) { mlx4_err(dev, "Unknown hca global capabilities\n"); return -ENOSYS; } @@ -988,49 +832,53 @@ static int mlx4_slave_cap(struct mlx4_dev *dev) dev->caps.max_qp_dest_rdma = 1 << hca_param.log_rd_per_qp; err = mlx4_dev_cap(dev, &dev_cap); if (err) { - mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting.\n"); + mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting\n"); return err; } err = mlx4_QUERY_FW(dev); if (err) - mlx4_err(dev, "QUERY_FW command failed: could not get FW version.\n"); - - if (!hca_param.mw_enable) { - dev->caps.flags &= ~MLX4_DEV_CAP_FLAG_MEM_WINDOW; - dev->caps.bmme_flags &= ~MLX4_BMME_FLAG_TYPE_2_WIN; - } + mlx4_err(dev, "QUERY_FW command failed: could not get FW version\n"); page_size = ~dev->caps.page_size_cap + 1; mlx4_warn(dev, "HCA minimum page size:%d\n", page_size); if (page_size > PAGE_SIZE) { - mlx4_err(dev, "HCA minimum page size of %d bigger than " - "kernel PAGE_SIZE of %d, aborting.\n", - page_size, (int)PAGE_SIZE); + mlx4_err(dev, "HCA minimum page size of %d bigger than kernel PAGE_SIZE of %ld, aborting\n", + page_size, (long)PAGE_SIZE); return -ENODEV; } - /* slave gets uar page size from QUERY_HCA fw command */ - dev->caps.uar_page_size = 1 << (hca_param.uar_page_sz + 12); + /* Set uar_page_shift for VF */ + dev->uar_page_shift = hca_param.uar_page_sz + 12; - /* TODO: relax this assumption */ - if (dev->caps.uar_page_size != PAGE_SIZE) { - mlx4_err(dev, "UAR size:%d != kernel PAGE_SIZE of %d\n", - dev->caps.uar_page_size, (int)PAGE_SIZE); - return -ENODEV; + /* Make sure the master uar page size is valid */ + if (dev->uar_page_shift > PAGE_SHIFT) { + mlx4_err(dev, + "Invalid configuration: uar page size is larger than system page size\n"); + return -ENODEV; } + /* Set reserved_uars based on the uar_page_shift */ + mlx4_set_num_reserved_uars(dev, &dev_cap); + + /* Although uar page size in FW differs from system page size, + * upper software layers (mlx4_ib, mlx4_en and part of mlx4_core) + * still works with assumption that uar page size == system page size + */ + dev->caps.uar_page_size = PAGE_SIZE; + memset(&func_cap, 0, sizeof(func_cap)); err = mlx4_QUERY_FUNC_CAP(dev, 0, &func_cap); if (err) { - mlx4_err(dev, "QUERY_FUNC_CAP general command failed, aborting (%d).\n", - err); + mlx4_err(dev, "QUERY_FUNC_CAP general command failed, aborting (%d)\n", + err); return err; } if ((func_cap.pf_context_behaviour | PF_CONTEXT_BEHAVIOUR_MASK) != PF_CONTEXT_BEHAVIOUR_MASK) { - mlx4_err(dev, "Unknown pf context behaviour\n"); + mlx4_err(dev, "Unknown pf context behaviour %x known flags %x\n", + func_cap.pf_context_behaviour, PF_CONTEXT_BEHAVIOUR_MASK); return -ENOSYS; } @@ -1046,41 +894,46 @@ static int mlx4_slave_cap(struct mlx4_dev *dev) dev->caps.num_mpts = 1 << hca_param.log_mpt_sz; dev->caps.num_eqs = func_cap.max_eq; dev->caps.reserved_eqs = func_cap.reserved_eq; + dev->caps.reserved_lkey = func_cap.reserved_lkey; dev->caps.num_pds = MLX4_NUM_PDS; dev->caps.num_mgms = 0; dev->caps.num_amgms = 0; if (dev->caps.num_ports > MLX4_MAX_PORTS) { - mlx4_err(dev, "HCA has %d ports, but we only support %d, " - "aborting.\n", dev->caps.num_ports, MLX4_MAX_PORTS); + mlx4_err(dev, "HCA has %d ports, but we only support %d, aborting\n", + dev->caps.num_ports, MLX4_MAX_PORTS); return -ENODEV; } + mlx4_replace_zero_macs(dev); + + dev->caps.qp0_qkey = kcalloc(dev->caps.num_ports, sizeof(u32), GFP_KERNEL); dev->caps.qp0_tunnel = kcalloc(dev->caps.num_ports, sizeof (u32), GFP_KERNEL); dev->caps.qp0_proxy = kcalloc(dev->caps.num_ports, sizeof (u32), GFP_KERNEL); dev->caps.qp1_tunnel = kcalloc(dev->caps.num_ports, sizeof (u32), GFP_KERNEL); dev->caps.qp1_proxy = kcalloc(dev->caps.num_ports, sizeof (u32), GFP_KERNEL); if (!dev->caps.qp0_tunnel || !dev->caps.qp0_proxy || - !dev->caps.qp1_tunnel || !dev->caps.qp1_proxy) { + !dev->caps.qp1_tunnel || !dev->caps.qp1_proxy || + !dev->caps.qp0_qkey) { err = -ENOMEM; goto err_mem; } for (i = 1; i <= dev->caps.num_ports; ++i) { - err = mlx4_QUERY_FUNC_CAP(dev, (u32) i, &func_cap); + err = mlx4_QUERY_FUNC_CAP(dev, i, &func_cap); if (err) { - mlx4_err(dev, "QUERY_FUNC_CAP port command failed for" - " port %d, aborting (%d).\n", i, err); + mlx4_err(dev, "QUERY_FUNC_CAP port command failed for port %d, aborting (%d)\n", + i, err); goto err_mem; } + dev->caps.qp0_qkey[i - 1] = func_cap.qp0_qkey; dev->caps.qp0_tunnel[i - 1] = func_cap.qp0_tunnel_qpn; dev->caps.qp0_proxy[i - 1] = func_cap.qp0_proxy_qpn; dev->caps.qp1_tunnel[i - 1] = func_cap.qp1_tunnel_qpn; dev->caps.qp1_proxy[i - 1] = func_cap.qp1_proxy_qpn; - dev->caps.def_counter_index[i - 1] = func_cap.def_counter_index; - dev->caps.port_mask[i] = dev->caps.port_type[i]; + dev->caps.phys_port_id[i] = func_cap.phys_port_id; err = mlx4_get_slave_pkey_gid_tbl_len(dev, i, &dev->caps.gid_table_len[i], &dev->caps.pkey_table_len[i]); @@ -1090,11 +943,12 @@ static int mlx4_slave_cap(struct mlx4_dev *dev) if (dev->caps.uar_page_size * (dev->caps.num_uars - dev->caps.reserved_uars) > - pci_resource_len(dev->pdev, 2)) { - mlx4_err(dev, "HCA reported UAR region size of 0x%x bigger than " - "PCI resource 2 size of 0x%llx, aborting.\n", + pci_resource_len(dev->persist->pdev, + 2)) { + mlx4_err(dev, "HCA reported UAR region size of 0x%x bigger than PCI resource 2 size of 0x%llx, aborting\n", dev->caps.uar_page_size * dev->caps.num_uars, - (unsigned long long) pci_resource_len(dev->pdev, 2)); + (unsigned long long) + pci_resource_len(dev->persist->pdev, 2)); err = -ENOMEM; goto err_mem; } @@ -1109,29 +963,49 @@ static int mlx4_slave_cap(struct mlx4_dev *dev) if (hca_param.dev_cap_enabled & MLX4_DEV_CAP_64B_CQE_ENABLED) { dev->caps.cqe_size = 64; - dev->caps.userspace_caps |= MLX4_USER_DEV_CAP_64B_CQE; + dev->caps.userspace_caps |= MLX4_USER_DEV_CAP_LARGE_CQE; } else { dev->caps.cqe_size = 32; } + if (hca_param.dev_cap_enabled & MLX4_DEV_CAP_EQE_STRIDE_ENABLED) { + dev->caps.eqe_size = hca_param.eqe_size; + dev->caps.eqe_factor = 0; + } + + if (hca_param.dev_cap_enabled & MLX4_DEV_CAP_CQE_STRIDE_ENABLED) { + dev->caps.cqe_size = hca_param.cqe_size; + /* User still need to know when CQE > 32B */ + dev->caps.userspace_caps |= MLX4_USER_DEV_CAP_LARGE_CQE; + } + dev->caps.flags2 &= ~MLX4_DEV_CAP_FLAG2_TS; - mlx4_warn(dev, "Timestamping is not supported in slave mode.\n"); + mlx4_warn(dev, "Timestamping is not supported in slave mode\n"); slave_adjust_steering_mode(dev, &dev_cap, &hca_param); + mlx4_dbg(dev, "RSS support for IP fragments is %s\n", + hca_param.rss_ip_frags ? "on" : "off"); if (func_cap.extra_flags & MLX4_QUERY_FUNC_FLAGS_BF_RES_QP && dev->caps.bf_reg_size) dev->caps.alloc_res_qp_mask |= MLX4_RESERVE_ETH_BF_QP; + if (func_cap.extra_flags & MLX4_QUERY_FUNC_FLAGS_A0_RES_QP) + dev->caps.alloc_res_qp_mask |= MLX4_RESERVE_A0_QP; + return 0; err_mem: + kfree(dev->caps.qp0_qkey); kfree(dev->caps.qp0_tunnel); kfree(dev->caps.qp0_proxy); kfree(dev->caps.qp1_tunnel); kfree(dev->caps.qp1_proxy); - dev->caps.qp0_tunnel = dev->caps.qp0_proxy = - dev->caps.qp1_tunnel = dev->caps.qp1_proxy = NULL; + dev->caps.qp0_qkey = NULL; + dev->caps.qp0_tunnel = NULL; + dev->caps.qp0_proxy = NULL; + dev->caps.qp1_tunnel = NULL; + dev->caps.qp1_proxy = NULL; return err; } @@ -1151,10 +1025,10 @@ static void mlx4_request_modules(struct mlx4_dev *dev) has_eth_port = true; } - if (has_ib_port) - request_module_nowait(IB_DRV_NAME); if (has_eth_port) request_module_nowait(EN_DRV_NAME); + if (has_ib_port || (dev->caps.flags & MLX4_DEV_CAP_FLAG_IBOE)) + request_module_nowait(IB_DRV_NAME); } /* @@ -1181,8 +1055,8 @@ int mlx4_change_port_types(struct mlx4_dev *dev, dev->caps.port_type[port] = port_types[port - 1]; err = mlx4_SET_PORT(dev, port, -1); if (err) { - mlx4_err(dev, "Failed to set port %d, " - "aborting\n", port); + mlx4_err(dev, "Failed to set port %d, aborting\n", + port); goto out; } } @@ -1219,12 +1093,9 @@ static ssize_t show_port_type(struct device *dev, return strlen(buf); } -static ssize_t set_port_type(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) +static int __set_port_type(struct mlx4_port_info *info, + enum mlx4_port_type port_type) { - struct mlx4_port_info *info = container_of(attr, struct mlx4_port_info, - port_attr); struct mlx4_dev *mdev = info->dev; struct mlx4_priv *priv = mlx4_priv(mdev); enum mlx4_port_type types[MLX4_MAX_PORTS]; @@ -1232,26 +1103,18 @@ static ssize_t set_port_type(struct device *dev, int i; int err = 0; - if (!strcmp(buf, "ib\n")) - info->tmp_type = MLX4_PORT_TYPE_IB; - else if (!strcmp(buf, "eth\n")) - info->tmp_type = MLX4_PORT_TYPE_ETH; - else if (!strcmp(buf, "auto\n")) - info->tmp_type = MLX4_PORT_TYPE_AUTO; - else { - mlx4_err(mdev, "%s is not supported port type\n", buf); - return -EINVAL; - } - - if ((info->tmp_type & mdev->caps.supported_type[info->port]) != - info->tmp_type) { - mlx4_err(mdev, "Requested port type for port %d is not supported on this HCA\n", + if ((port_type & mdev->caps.supported_type[info->port]) != port_type) { + mlx4_err(mdev, + "Requested port type for port %d is not supported on this HCA\n", info->port); - return -EINVAL; + err = -EINVAL; + goto err_sup; } mlx4_stop_sense(mdev); mutex_lock(&priv->port_mutex); + info->tmp_type = port_type; + /* Possible type is always the one that was delivered */ mdev->caps.possible_type[info->port] = info->tmp_type; @@ -1272,9 +1135,7 @@ static ssize_t set_port_type(struct device *dev, } } if (err) { - mlx4_err(mdev, "Auto sensing is not supported on this HCA. " - "Set only 'eth' or 'ib' for both ports " - "(should be the same)\n"); + mlx4_err(mdev, "Auto sensing is not supported on this HCA. Set only 'eth' or 'ib' for both ports (should be the same)\n"); goto out; } @@ -1293,8 +1154,42 @@ static ssize_t set_port_type(struct device *dev, err = mlx4_change_port_types(mdev, new_types); out: - mlx4_start_sense(mdev); mutex_unlock(&priv->port_mutex); + mlx4_start_sense(mdev); +err_sup: + return err; +} + +static ssize_t set_port_type(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + struct mlx4_port_info *info = container_of(attr, struct mlx4_port_info, + port_attr); + struct mlx4_dev *mdev = info->dev; + enum mlx4_port_type port_type; + static DEFINE_MUTEX(set_port_type_mutex); + int err; + + mutex_lock(&set_port_type_mutex); + + if (!strcmp(buf, "ib\n")) { + port_type = MLX4_PORT_TYPE_IB; + } else if (!strcmp(buf, "eth\n")) { + port_type = MLX4_PORT_TYPE_ETH; + } else if (!strcmp(buf, "auto\n")) { + port_type = MLX4_PORT_TYPE_AUTO; + } else { + mlx4_err(mdev, "%s is not supported port type\n", buf); + err = -EINVAL; + goto err_out; + } + + err = __set_port_type(info, port_type); + +err_out: + mutex_unlock(&set_port_type_mutex); + return err ? err : count; } @@ -1330,43 +1225,6 @@ static inline int ibta_mtu_to_int(enum ibta_mtu mtu) } } -static ssize_t -show_board(struct device *device, struct device_attribute *attr, - char *buf) -{ - struct mlx4_hca_info *info = container_of(attr, struct mlx4_hca_info, - board_attr); - struct mlx4_dev *mdev = info->dev; - - return sprintf(buf, "%.*s\n", MLX4_BOARD_ID_LEN, - mdev->board_id); -} - -static ssize_t -show_hca(struct device *device, struct device_attribute *attr, - char *buf) -{ - struct mlx4_hca_info *info = container_of(attr, struct mlx4_hca_info, - hca_attr); - struct mlx4_dev *mdev = info->dev; - - return sprintf(buf, "MT%d\n", mdev->pdev->device); -} - -static ssize_t -show_firmware_version(struct device *dev, - struct device_attribute *attr, - char *buf) -{ - struct mlx4_hca_info *info = container_of(attr, struct mlx4_hca_info, - firmware_attr); - struct mlx4_dev *mdev = info->dev; - - return sprintf(buf, "%d.%d.%d\n", (int)(mdev->caps.fw_ver >> 32), - (int)(mdev->caps.fw_ver >> 16) & 0xffff, - (int)mdev->caps.fw_ver & 0xffff); -} - static ssize_t show_port_ib_mtu(struct device *dev, struct device_attribute *attr, char *buf) @@ -1375,9 +1233,8 @@ static ssize_t show_port_ib_mtu(struct device *dev, port_mtu_attr); struct mlx4_dev *mdev = info->dev; - /* When port type is eth, port mtu value isn't used. */ if (mdev->caps.port_type[info->port] == MLX4_PORT_TYPE_ETH) - return -EINVAL; + mlx4_warn(mdev, "port level mtu is only used for IB ports\n"); sprintf(buf, "%d\n", ibta_mtu_to_int(mdev->caps.port_ib_mtu[info->port])); @@ -1399,10 +1256,11 @@ static ssize_t set_port_ib_mtu(struct device *dev, return -EINVAL; } - mtu = (int) simple_strtol(buf, NULL, 0); - ibta_mtu = int_to_ibta_mtu(mtu); + err = kstrtoint(buf, 0, &mtu); + if (!err) + ibta_mtu = int_to_ibta_mtu(mtu); - if (ibta_mtu < 0) { + if (err || ibta_mtu < 0) { mlx4_err(mdev, "%s is invalid IBTA mtu\n", buf); return -EINVAL; } @@ -1416,8 +1274,8 @@ static ssize_t set_port_ib_mtu(struct device *dev, mlx4_CLOSE_PORT(mdev, port); err = mlx4_SET_PORT(mdev, port, -1); if (err) { - mlx4_err(mdev, "Failed to set port %d, " - "aborting\n", port); + mlx4_err(mdev, "Failed to set port %d, aborting\n", + port); goto err_set_port; } } @@ -1428,40 +1286,217 @@ static ssize_t set_port_ib_mtu(struct device *dev, return err ? err : count; } +/* bond for multi-function device */ +#define MAX_MF_BOND_ALLOWED_SLAVES 63 +static int mlx4_mf_bond(struct mlx4_dev *dev) +{ + int err = 0; + int nvfs; + struct mlx4_slaves_pport slaves_port1; + struct mlx4_slaves_pport slaves_port2; + DECLARE_BITMAP(slaves_port_1_2, MLX4_MFUNC_MAX); + + slaves_port1 = mlx4_phys_to_slaves_pport(dev, 1); + slaves_port2 = mlx4_phys_to_slaves_pport(dev, 2); + bitmap_and(slaves_port_1_2, + slaves_port1.slaves, slaves_port2.slaves, + dev->persist->num_vfs + 1); + + /* only single port vfs are allowed */ + if (bitmap_weight(slaves_port_1_2, dev->persist->num_vfs + 1) > 1) { + mlx4_warn(dev, "HA mode unsupported for dual ported VFs\n"); + return -EINVAL; + } + + /* number of virtual functions is number of total functions minus one + * physical function for each port. + */ + nvfs = bitmap_weight(slaves_port1.slaves, dev->persist->num_vfs + 1) + + bitmap_weight(slaves_port2.slaves, dev->persist->num_vfs + 1) - 2; + + /* limit on maximum allowed VFs */ + if (nvfs > MAX_MF_BOND_ALLOWED_SLAVES) { + mlx4_warn(dev, "HA mode is not supported for %d VFs (max %d are allowed)\n", + nvfs, MAX_MF_BOND_ALLOWED_SLAVES); + return -EINVAL; + } + + if (dev->caps.steering_mode != MLX4_STEERING_MODE_DEVICE_MANAGED) { + mlx4_warn(dev, "HA mode unsupported for NON DMFS steering\n"); + return -EINVAL; + } + + err = mlx4_bond_mac_table(dev); + if (err) + return err; + err = mlx4_bond_vlan_table(dev); + if (err) + goto err1; + err = mlx4_bond_fs_rules(dev); + if (err) + goto err2; + + return 0; +err2: + (void)mlx4_unbond_vlan_table(dev); +err1: + (void)mlx4_unbond_mac_table(dev); + return err; +} + +static int mlx4_mf_unbond(struct mlx4_dev *dev) +{ + int ret, ret1; + + ret = mlx4_unbond_fs_rules(dev); + if (ret) + mlx4_warn(dev, "multifunction unbond for flow rules failedi (%d)\n", ret); + ret1 = mlx4_unbond_mac_table(dev); + if (ret1) { + mlx4_warn(dev, "multifunction unbond for MAC table failed (%d)\n", ret1); + ret = ret1; + } + ret1 = mlx4_unbond_vlan_table(dev); + if (ret1) { + mlx4_warn(dev, "multifunction unbond for VLAN table failed (%d)\n", ret1); + ret = ret1; + } + return ret; +} + +int mlx4_bond(struct mlx4_dev *dev) +{ + int ret = 0; + struct mlx4_priv *priv = mlx4_priv(dev); + + mutex_lock(&priv->bond_mutex); + + if (!mlx4_is_bonded(dev)) { + ret = mlx4_do_bond(dev, true); + if (ret) + mlx4_err(dev, "Failed to bond device: %d\n", ret); + if (!ret && mlx4_is_master(dev)) { + ret = mlx4_mf_bond(dev); + if (ret) { + mlx4_err(dev, "bond for multifunction failed\n"); + mlx4_do_bond(dev, false); + } + } + } + + mutex_unlock(&priv->bond_mutex); + if (!ret) + mlx4_dbg(dev, "Device is bonded\n"); + + return ret; +} +EXPORT_SYMBOL_GPL(mlx4_bond); + +int mlx4_unbond(struct mlx4_dev *dev) +{ + int ret = 0; + struct mlx4_priv *priv = mlx4_priv(dev); + + mutex_lock(&priv->bond_mutex); + + if (mlx4_is_bonded(dev)) { + int ret2 = 0; + + ret = mlx4_do_bond(dev, false); + if (ret) + mlx4_err(dev, "Failed to unbond device: %d\n", ret); + if (mlx4_is_master(dev)) + ret2 = mlx4_mf_unbond(dev); + if (ret2) { + mlx4_warn(dev, "Failed to unbond device for multifunction (%d)\n", ret2); + ret = ret2; + } + } + + mutex_unlock(&priv->bond_mutex); + if (!ret) + mlx4_dbg(dev, "Device is unbonded\n"); + + return ret; +} +EXPORT_SYMBOL_GPL(mlx4_unbond); + + +int mlx4_port_map_set(struct mlx4_dev *dev, struct mlx4_port_map *v2p) +{ + u8 port1 = v2p->port1; + u8 port2 = v2p->port2; + struct mlx4_priv *priv = mlx4_priv(dev); + int err; + + if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_PORT_REMAP)) + return -ENOTSUPP; + + mutex_lock(&priv->bond_mutex); + + /* zero means keep current mapping for this port */ + if (port1 == 0) + port1 = priv->v2p.port1; + if (port2 == 0) + port2 = priv->v2p.port2; + + if ((port1 < 1) || (port1 > MLX4_MAX_PORTS) || + (port2 < 1) || (port2 > MLX4_MAX_PORTS) || + (port1 == 2 && port2 == 1)) { + /* besides boundary checks cross mapping makes + * no sense and therefore not allowed */ + err = -EINVAL; + } else if ((port1 == priv->v2p.port1) && + (port2 == priv->v2p.port2)) { + err = 0; + } else { + err = mlx4_virt2phy_port_map(dev, port1, port2); + if (!err) { + mlx4_dbg(dev, "port map changed: [%d][%d]\n", + port1, port2); + priv->v2p.port1 = port1; + priv->v2p.port2 = port2; + } else { + mlx4_err(dev, "Failed to change port mape: %d\n", err); + } + } + + mutex_unlock(&priv->bond_mutex); + return err; +} +EXPORT_SYMBOL_GPL(mlx4_port_map_set); + static int mlx4_load_fw(struct mlx4_dev *dev) { struct mlx4_priv *priv = mlx4_priv(dev); - int err, unmap_flag = 0; + int err; priv->fw.fw_icm = mlx4_alloc_icm(dev, priv->fw.fw_pages, GFP_HIGHUSER | __GFP_NOWARN, 0); if (!priv->fw.fw_icm) { - mlx4_err(dev, "Couldn't allocate FW area, aborting.\n"); + mlx4_err(dev, "Couldn't allocate FW area, aborting\n"); return -ENOMEM; } err = mlx4_MAP_FA(dev, priv->fw.fw_icm); if (err) { - mlx4_err(dev, "MAP_FA command failed, aborting.\n"); + mlx4_err(dev, "MAP_FA command failed, aborting\n"); goto err_free; } err = mlx4_RUN_FW(dev); if (err) { - mlx4_err(dev, "RUN_FW command failed, aborting.\n"); + mlx4_err(dev, "RUN_FW command failed, aborting\n"); goto err_unmap_fa; } return 0; err_unmap_fa: - unmap_flag = mlx4_UNMAP_FA(dev); - if (unmap_flag) - pr_warn("mlx4_core: mlx4_UNMAP_FA failed.\n"); + mlx4_UNMAP_FA(dev); err_free: - if (!unmap_flag) - mlx4_free_icm(dev, priv->fw.fw_icm, 0); + mlx4_free_icm(dev, priv->fw.fw_icm, 0); return err; } @@ -1530,34 +1565,34 @@ static int mlx4_init_icm(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap, struct mlx4_priv *priv = mlx4_priv(dev); u64 aux_pages; int num_eqs; - int err, unmap_flag = 0; + int err; err = mlx4_SET_ICM_SIZE(dev, icm_size, &aux_pages); if (err) { - mlx4_err(dev, "SET_ICM_SIZE command failed, aborting.\n"); + mlx4_err(dev, "SET_ICM_SIZE command failed, aborting\n"); return err; } - mlx4_dbg(dev, "%lld KB of HCA context requires %lld KB aux memory.\n", + mlx4_dbg(dev, "%lld KB of HCA context requires %lld KB aux memory\n", (unsigned long long) icm_size >> 10, (unsigned long long) aux_pages << 2); priv->fw.aux_icm = mlx4_alloc_icm(dev, aux_pages, GFP_HIGHUSER | __GFP_NOWARN, 0); if (!priv->fw.aux_icm) { - mlx4_err(dev, "Couldn't allocate aux memory, aborting.\n"); + mlx4_err(dev, "Couldn't allocate aux memory, aborting\n"); return -ENOMEM; } err = mlx4_MAP_ICM_AUX(dev, priv->fw.aux_icm); if (err) { - mlx4_err(dev, "MAP_ICM_AUX command failed, aborting.\n"); + mlx4_err(dev, "MAP_ICM_AUX command failed, aborting\n"); goto err_free_aux; } err = mlx4_init_cmpt_table(dev, init_hca->cmpt_base, dev_cap->cmpt_entry_sz); if (err) { - mlx4_err(dev, "Failed to map cMPT context memory, aborting.\n"); + mlx4_err(dev, "Failed to map cMPT context memory, aborting\n"); goto err_unmap_aux; } @@ -1567,7 +1602,7 @@ static int mlx4_init_icm(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap, init_hca->eqc_base, dev_cap->eqc_entry_sz, num_eqs, num_eqs, 0, 0); if (err) { - mlx4_err(dev, "Failed to map EQ context memory, aborting.\n"); + mlx4_err(dev, "Failed to map EQ context memory, aborting\n"); goto err_unmap_cmpt; } @@ -1588,7 +1623,7 @@ static int mlx4_init_icm(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap, dev->caps.num_mtts, dev->caps.reserved_mtts, 1, 0); if (err) { - mlx4_err(dev, "Failed to map MTT context memory, aborting.\n"); + mlx4_err(dev, "Failed to map MTT context memory, aborting\n"); goto err_unmap_eq; } @@ -1598,7 +1633,7 @@ static int mlx4_init_icm(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap, dev->caps.num_mpts, dev->caps.reserved_mrws, 1, 1); if (err) { - mlx4_err(dev, "Failed to map dMPT context memory, aborting.\n"); + mlx4_err(dev, "Failed to map dMPT context memory, aborting\n"); goto err_unmap_mtt; } @@ -1609,7 +1644,7 @@ static int mlx4_init_icm(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap, dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW], 0, 0); if (err) { - mlx4_err(dev, "Failed to map QP context memory, aborting.\n"); + mlx4_err(dev, "Failed to map QP context memory, aborting\n"); goto err_unmap_dmpt; } @@ -1620,7 +1655,7 @@ static int mlx4_init_icm(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap, dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW], 0, 0); if (err) { - mlx4_err(dev, "Failed to map AUXC context memory, aborting.\n"); + mlx4_err(dev, "Failed to map AUXC context memory, aborting\n"); goto err_unmap_qp; } @@ -1631,7 +1666,7 @@ static int mlx4_init_icm(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap, dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW], 0, 0); if (err) { - mlx4_err(dev, "Failed to map ALTC context memory, aborting.\n"); + mlx4_err(dev, "Failed to map ALTC context memory, aborting\n"); goto err_unmap_auxc; } @@ -1652,7 +1687,7 @@ static int mlx4_init_icm(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap, dev->caps.num_cqs, dev->caps.reserved_cqs, 0, 0); if (err) { - mlx4_err(dev, "Failed to map CQ context memory, aborting.\n"); + mlx4_err(dev, "Failed to map CQ context memory, aborting\n"); goto err_unmap_rdmarc; } @@ -1662,7 +1697,7 @@ static int mlx4_init_icm(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap, dev->caps.num_srqs, dev->caps.reserved_srqs, 0, 0); if (err) { - mlx4_err(dev, "Failed to map SRQ context memory, aborting.\n"); + mlx4_err(dev, "Failed to map SRQ context memory, aborting\n"); goto err_unmap_cq; } @@ -1680,7 +1715,7 @@ static int mlx4_init_icm(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap, dev->caps.num_mgms + dev->caps.num_amgms, 0, 0); if (err) { - mlx4_err(dev, "Failed to map MCG context memory, aborting.\n"); + mlx4_err(dev, "Failed to map MCG context memory, aborting\n"); goto err_unmap_srq; } @@ -1720,13 +1755,10 @@ static int mlx4_init_icm(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap, mlx4_cleanup_icm_table(dev, &priv->qp_table.cmpt_table); err_unmap_aux: - unmap_flag = mlx4_UNMAP_ICM_AUX(dev); - if (unmap_flag) - pr_warn("mlx4_core: mlx4_UNMAP_ICM_AUX failed.\n"); + mlx4_UNMAP_ICM_AUX(dev); err_free_aux: - if (!unmap_flag) - mlx4_free_icm(dev, priv->fw.aux_icm, 0); + mlx4_free_icm(dev, priv->fw.aux_icm, 0); return err; } @@ -1750,10 +1782,8 @@ static void mlx4_free_icms(struct mlx4_dev *dev) mlx4_cleanup_icm_table(dev, &priv->srq_table.cmpt_table); mlx4_cleanup_icm_table(dev, &priv->qp_table.cmpt_table); - if (!mlx4_UNMAP_ICM_AUX(dev)) - mlx4_free_icm(dev, priv->fw.aux_icm, 0); - else - pr_warn("mlx4_core: mlx4_UNMAP_ICM_AUX failed.\n"); + mlx4_UNMAP_ICM_AUX(dev); + mlx4_free_icm(dev, priv->fw.aux_icm, 0); } static void mlx4_slave_exit(struct mlx4_dev *dev) @@ -1761,8 +1791,9 @@ static void mlx4_slave_exit(struct mlx4_dev *dev) struct mlx4_priv *priv = mlx4_priv(dev); mutex_lock(&priv->cmd.slave_cmd_mutex); - if (mlx4_comm_cmd(dev, MLX4_COMM_CMD_RESET, 0, MLX4_COMM_TIME)) - mlx4_warn(dev, "Failed to close slave function.\n"); + if (mlx4_comm_cmd(dev, MLX4_COMM_CMD_RESET, 0, MLX4_COMM_CMD_NA_OP, + MLX4_COMM_TIME)) + mlx4_warn(dev, "Failed to close slave function\n"); mutex_unlock(&priv->cmd.slave_cmd_mutex); } @@ -1776,9 +1807,9 @@ static int map_bf_area(struct mlx4_dev *dev) if (!dev->caps.bf_reg_size) return -ENXIO; - bf_start = pci_resource_start(dev->pdev, 2) + + bf_start = pci_resource_start(dev->persist->pdev, 2) + (dev->caps.num_uars << PAGE_SHIFT); - bf_len = pci_resource_len(dev->pdev, 2) - + bf_len = pci_resource_len(dev->persist->pdev, 2) - (dev->caps.num_uars << PAGE_SHIFT); priv->bf_mapping = io_mapping_create_wc(bf_start, bf_len); if (!priv->bf_mapping) @@ -1822,9 +1853,10 @@ static int map_internal_clock(struct mlx4_dev *dev) { struct mlx4_priv *priv = mlx4_priv(dev); - priv->clock_mapping = ioremap(pci_resource_start(dev->pdev, - priv->fw.clock_bar) + - priv->fw.clock_offset, MLX4_CLOCK_SIZE); + priv->clock_mapping = + ioremap(pci_resource_start(dev->persist->pdev, + priv->fw.clock_bar) + + priv->fw.clock_offset, MLX4_CLOCK_SIZE); if (!priv->clock_mapping) return -ENOMEM; @@ -1832,7 +1864,6 @@ static int map_internal_clock(struct mlx4_dev *dev) return 0; } - int mlx4_get_internal_clock_params(struct mlx4_dev *dev, struct mlx4_clock_params *params) { @@ -1840,6 +1871,7 @@ int mlx4_get_internal_clock_params(struct mlx4_dev *dev, if (mlx4_is_slave(dev)) return -ENOTSUPP; + if (!params) return -EINVAL; @@ -1863,49 +1895,97 @@ static void mlx4_close_hca(struct mlx4_dev *dev) { unmap_internal_clock(dev); unmap_bf_area(dev); - if (mlx4_is_slave(dev)) { + if (mlx4_is_slave(dev)) mlx4_slave_exit(dev); - } else { + else { mlx4_CLOSE_HCA(dev, 0); mlx4_free_icms(dev); - - if (!mlx4_UNMAP_FA(dev)) - mlx4_free_icm(dev, mlx4_priv(dev)->fw.fw_icm, 0); - else - pr_warn("mlx4_core: mlx4_UNMAP_FA failed.\n"); } } +static void mlx4_close_fw(struct mlx4_dev *dev) +{ + if (!mlx4_is_slave(dev)) { + mlx4_UNMAP_FA(dev); + mlx4_free_icm(dev, mlx4_priv(dev)->fw.fw_icm, 0); + } +} + +static int mlx4_comm_check_offline(struct mlx4_dev *dev) +{ +#define COMM_CHAN_OFFLINE_OFFSET 0x09 + + u32 comm_flags; + u32 offline_bit; + unsigned long end; + struct mlx4_priv *priv = mlx4_priv(dev); + + end = msecs_to_jiffies(MLX4_COMM_OFFLINE_TIME_OUT) + jiffies; + while (time_before(jiffies, end)) { + comm_flags = swab32(readl((__iomem char *)priv->mfunc.comm + + MLX4_COMM_CHAN_FLAGS)); + offline_bit = (comm_flags & + (u32)(1 << COMM_CHAN_OFFLINE_OFFSET)); + if (!offline_bit) + return 0; + /* There are cases as part of AER/Reset flow that PF needs + * around 100 msec to load. We therefore sleep for 100 msec + * to allow other tasks to make use of that CPU during this + * time interval. + */ + msleep(100); + } + mlx4_err(dev, "Communication channel is offline.\n"); + return -EIO; +} + +static void mlx4_reset_vf_support(struct mlx4_dev *dev) +{ +#define COMM_CHAN_RST_OFFSET 0x1e + + struct mlx4_priv *priv = mlx4_priv(dev); + u32 comm_rst; + u32 comm_caps; + + comm_caps = swab32(readl((__iomem char *)priv->mfunc.comm + + MLX4_COMM_CHAN_CAPS)); + comm_rst = (comm_caps & (u32)(1 << COMM_CHAN_RST_OFFSET)); + + if (comm_rst) + dev->caps.vf_caps |= MLX4_VF_CAP_FLAG_RESET; +} + static int mlx4_init_slave(struct mlx4_dev *dev) { struct mlx4_priv *priv = mlx4_priv(dev); u64 dma = (u64) priv->mfunc.vhcr_dma; - int num_of_reset_retries = NUM_OF_RESET_RETRIES; int ret_from_reset = 0; u32 slave_read; u32 cmd_channel_ver; + if (atomic_read(&pf_loading)) { + mlx4_warn(dev, "PF is not ready - Deferring probe\n"); + return -EAGAIN; + } + mutex_lock(&priv->cmd.slave_cmd_mutex); priv->cmd.max_cmds = 1; + if (mlx4_comm_check_offline(dev)) { + mlx4_err(dev, "PF is not responsive, skipping initialization\n"); + goto err_offline; + } + + mlx4_reset_vf_support(dev); mlx4_warn(dev, "Sending reset\n"); ret_from_reset = mlx4_comm_cmd(dev, MLX4_COMM_CMD_RESET, 0, - MLX4_COMM_TIME); + MLX4_COMM_CMD_NA_OP, MLX4_COMM_TIME); /* if we are in the middle of flr the slave will try * NUM_OF_RESET_RETRIES times before leaving.*/ if (ret_from_reset) { if (MLX4_DELAY_RESET_SLAVE == ret_from_reset) { - msleep(SLEEP_TIME_IN_RESET); - while (ret_from_reset && num_of_reset_retries) { - mlx4_warn(dev, "slave is currently in the" - "middle of FLR. retrying..." - "(try num:%d)\n", - (NUM_OF_RESET_RETRIES - - num_of_reset_retries + 1)); - ret_from_reset = - mlx4_comm_cmd(dev, MLX4_COMM_CMD_RESET, - 0, MLX4_COMM_TIME); - num_of_reset_retries = num_of_reset_retries - 1; - } + mlx4_warn(dev, "slave is currently in the middle of FLR - Deferring probe\n"); + mutex_unlock(&priv->cmd.slave_cmd_mutex); + return -EAGAIN; } else goto err; } @@ -1917,29 +1997,30 @@ static int mlx4_init_slave(struct mlx4_dev *dev) if (MLX4_COMM_GET_IF_REV(cmd_channel_ver) != MLX4_COMM_GET_IF_REV(slave_read)) { - mlx4_err(dev, "slave driver version is not supported" - " by the master\n"); + mlx4_err(dev, "slave driver version is not supported by the master\n"); goto err; } mlx4_warn(dev, "Sending vhcr0\n"); if (mlx4_comm_cmd(dev, MLX4_COMM_CMD_VHCR0, dma >> 48, - MLX4_COMM_TIME)) + MLX4_COMM_CMD_NA_OP, MLX4_COMM_TIME)) goto err; if (mlx4_comm_cmd(dev, MLX4_COMM_CMD_VHCR1, dma >> 32, - MLX4_COMM_TIME)) + MLX4_COMM_CMD_NA_OP, MLX4_COMM_TIME)) goto err; if (mlx4_comm_cmd(dev, MLX4_COMM_CMD_VHCR2, dma >> 16, - MLX4_COMM_TIME)) + MLX4_COMM_CMD_NA_OP, MLX4_COMM_TIME)) goto err; - if (mlx4_comm_cmd(dev, MLX4_COMM_CMD_VHCR_EN, dma, MLX4_COMM_TIME)) + if (mlx4_comm_cmd(dev, MLX4_COMM_CMD_VHCR_EN, dma, + MLX4_COMM_CMD_NA_OP, MLX4_COMM_TIME)) goto err; mutex_unlock(&priv->cmd.slave_cmd_mutex); return 0; err: - mlx4_comm_cmd(dev, MLX4_COMM_CMD_RESET, 0, 0); + mlx4_comm_cmd(dev, MLX4_COMM_CMD_RESET, 0, MLX4_COMM_CMD_NA_OP, 0); +err_offline: mutex_unlock(&priv->cmd.slave_cmd_mutex); return -EIO; } @@ -1951,7 +2032,7 @@ static void mlx4_parav_master_pf_caps(struct mlx4_dev *dev) for (i = 1; i <= dev->caps.num_ports; i++) { if (dev->caps.port_type[i] == MLX4_PORT_TYPE_ETH) dev->caps.gid_table_len[i] = - mlx4_get_slave_num_gids(dev, 0); + mlx4_get_slave_num_gids(dev, 0, i); else dev->caps.gid_table_len[i] = 1; dev->caps.pkey_table_len[i] = @@ -1972,29 +2053,62 @@ static int choose_log_fs_mgm_entry_size(int qp_per_entry) return (i <= MLX4_MAX_MGM_LOG_ENTRY_SIZE) ? i : -1; } +static const char *dmfs_high_rate_steering_mode_str(int dmfs_high_steer_mode) +{ + switch (dmfs_high_steer_mode) { + case MLX4_STEERING_DMFS_A0_DEFAULT: + return "default performance"; + + case MLX4_STEERING_DMFS_A0_DYNAMIC: + return "dynamic hybrid mode"; + + case MLX4_STEERING_DMFS_A0_STATIC: + return "performance optimized for limited rule configuration (static)"; + + case MLX4_STEERING_DMFS_A0_DISABLE: + return "disabled performance optimized steering"; + + case MLX4_STEERING_DMFS_A0_NOT_SUPPORTED: + return "performance optimized steering not supported"; + + default: + return "Unrecognized mode"; + } +} + +#define MLX4_DMFS_A0_STEERING (1UL << 2) + static void choose_steering_mode(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) { - int nvfs; - - mlx4_get_val(num_vfs.dbdf2val.tbl, pci_physfn(dev->pdev), 0, &nvfs); - if (high_rate_steer && !mlx4_is_mfunc(dev)) { - dev->caps.flags &= ~(MLX4_DEV_CAP_FLAG_VEP_MC_STEER | - MLX4_DEV_CAP_FLAG_VEP_UC_STEER); - dev_cap->flags2 &= ~MLX4_DEV_CAP_FLAG2_FS_EN; + if (mlx4_log_num_mgm_entry_size <= 0) { + if ((-mlx4_log_num_mgm_entry_size) & MLX4_DMFS_A0_STEERING) { + if (dev->caps.dmfs_high_steer_mode == + MLX4_STEERING_DMFS_A0_NOT_SUPPORTED) + mlx4_err(dev, "DMFS high rate mode not supported\n"); + else + dev->caps.dmfs_high_steer_mode = + MLX4_STEERING_DMFS_A0_STATIC; + } } - if (mlx4_log_num_mgm_entry_size == -1 && + if (mlx4_log_num_mgm_entry_size <= 0 && dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_FS_EN && (!mlx4_is_mfunc(dev) || - (dev_cap->fs_max_num_qp_per_entry >= (nvfs + 1))) && + (dev_cap->fs_max_num_qp_per_entry >= + (dev->persist->num_vfs + 1))) && choose_log_fs_mgm_entry_size(dev_cap->fs_max_num_qp_per_entry) >= MLX4_MIN_MGM_LOG_ENTRY_SIZE) { dev->oper_log_mgm_entry_size = choose_log_fs_mgm_entry_size(dev_cap->fs_max_num_qp_per_entry); dev->caps.steering_mode = MLX4_STEERING_MODE_DEVICE_MANAGED; dev->caps.num_qp_per_mgm = dev_cap->fs_max_num_qp_per_entry; + dev->caps.fs_log_max_ucast_qp_range_size = + dev_cap->fs_log_max_ucast_qp_range_size; } else { + if (dev->caps.dmfs_high_steer_mode != + MLX4_STEERING_DMFS_A0_NOT_SUPPORTED) + dev->caps.dmfs_high_steer_mode = MLX4_STEERING_DMFS_A0_DISABLE; if (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER && dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER) dev->caps.steering_mode = MLX4_STEERING_MODE_B0; @@ -2003,8 +2117,7 @@ static void choose_steering_mode(struct mlx4_dev *dev, if (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER || dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER) - mlx4_warn(dev, "Must have both UC_STEER and MC_STEER flags " - "set to use B0 steering. Falling back to A0 steering mode.\n"); + mlx4_warn(dev, "Must have both UC_STEER and MC_STEER flags set to use B0 steering - falling back to A0 steering mode\n"); } dev->oper_log_mgm_entry_size = mlx4_log_num_mgm_entry_size > 0 ? @@ -2012,36 +2125,72 @@ static void choose_steering_mode(struct mlx4_dev *dev, MLX4_DEFAULT_MGM_LOG_ENTRY_SIZE; dev->caps.num_qp_per_mgm = mlx4_get_qp_per_mgm(dev); } - mlx4_dbg(dev, "Steering mode is: %s, oper_log_mgm_entry_size = %d, " - "log_num_mgm_entry_size = %d\n", + mlx4_dbg(dev, "Steering mode is: %s, oper_log_mgm_entry_size = %d, modparam log_num_mgm_entry_size = %d\n", mlx4_steering_mode_str(dev->caps.steering_mode), - dev->oper_log_mgm_entry_size, mlx4_log_num_mgm_entry_size); + dev->oper_log_mgm_entry_size, + mlx4_log_num_mgm_entry_size); } -static int mlx4_init_hca(struct mlx4_dev *dev) +static void choose_tunnel_offload_mode(struct mlx4_dev *dev, + struct mlx4_dev_cap *dev_cap) +{ + if (dev->caps.steering_mode == MLX4_STEERING_MODE_DEVICE_MANAGED && + dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS) + dev->caps.tunnel_offload_mode = MLX4_TUNNEL_OFFLOAD_MODE_VXLAN; + else + dev->caps.tunnel_offload_mode = MLX4_TUNNEL_OFFLOAD_MODE_NONE; + + mlx4_dbg(dev, "Tunneling offload mode is: %s\n", (dev->caps.tunnel_offload_mode + == MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) ? "vxlan" : "none"); +} + +static int mlx4_validate_optimized_steering(struct mlx4_dev *dev) +{ + int i; + struct mlx4_port_cap port_cap; + + if (dev->caps.dmfs_high_steer_mode == MLX4_STEERING_DMFS_A0_NOT_SUPPORTED) + return -EINVAL; + + for (i = 1; i <= dev->caps.num_ports; i++) { + if (mlx4_dev_port(dev, i, &port_cap)) { + mlx4_err(dev, + "QUERY_DEV_CAP command failed, can't veify DMFS high rate steering.\n"); + } else if ((dev->caps.dmfs_high_steer_mode != + MLX4_STEERING_DMFS_A0_DEFAULT) && + (port_cap.dmfs_optimized_state == + !!(dev->caps.dmfs_high_steer_mode == + MLX4_STEERING_DMFS_A0_DISABLE))) { + mlx4_err(dev, + "DMFS high rate steer mode differ, driver requested %s but %s in FW.\n", + dmfs_high_rate_steering_mode_str( + dev->caps.dmfs_high_steer_mode), + (port_cap.dmfs_optimized_state ? + "enabled" : "disabled")); + } + } + + return 0; +} + +static int mlx4_init_fw(struct mlx4_dev *dev) { - struct mlx4_priv *priv = mlx4_priv(dev); - struct mlx4_dev_cap *dev_cap = NULL; - struct mlx4_adapter adapter; struct mlx4_mod_stat_cfg mlx4_cfg; - struct mlx4_profile profile; - struct mlx4_init_hca_param init_hca; - u64 icm_size; - int err; + int err = 0; if (!mlx4_is_slave(dev)) { err = mlx4_QUERY_FW(dev); if (err) { if (err == -EACCES) - mlx4_info(dev, "non-primary physical function, skipping.\n"); + mlx4_info(dev, "non-primary physical function, skipping\n"); else - mlx4_err(dev, "QUERY_FW command failed, aborting.\n"); + mlx4_err(dev, "QUERY_FW command failed, aborting\n"); return err; } err = mlx4_load_fw(dev); if (err) { - mlx4_err(dev, "Failed to start FW, aborting.\n"); + mlx4_err(dev, "Failed to start FW, aborting\n"); return err; } @@ -2050,74 +2199,107 @@ static int mlx4_init_hca(struct mlx4_dev *dev) err = mlx4_MOD_STAT_CFG(dev, &mlx4_cfg); if (err) mlx4_warn(dev, "Failed to override log_pg_sz parameter\n"); + } - dev_cap = kzalloc(sizeof *dev_cap, GFP_KERNEL); - if (!dev_cap) { - mlx4_err(dev, "Failed to allocate memory for dev_cap\n"); - err = -ENOMEM; - goto err_stop_fw; - } + return err; +} - err = mlx4_dev_cap(dev, dev_cap); +static int mlx4_init_hca(struct mlx4_dev *dev) +{ + struct mlx4_priv *priv = mlx4_priv(dev); + struct mlx4_adapter adapter; + struct mlx4_dev_cap dev_cap; + struct mlx4_profile profile; + struct mlx4_init_hca_param init_hca; + u64 icm_size; + struct mlx4_config_dev_params params; + int err; + + if (!mlx4_is_slave(dev)) { + err = mlx4_dev_cap(dev, &dev_cap); if (err) { - mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting.\n"); - goto err_stop_fw; + mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting\n"); + return err; } - choose_steering_mode(dev, dev_cap); + choose_steering_mode(dev, &dev_cap); + choose_tunnel_offload_mode(dev, &dev_cap); + + if (dev->caps.dmfs_high_steer_mode == MLX4_STEERING_DMFS_A0_STATIC && + mlx4_is_master(dev)) + dev->caps.function_caps |= MLX4_FUNC_CAP_DMFS_A0_STATIC; + + err = mlx4_get_phys_port_id(dev); + if (err) + mlx4_err(dev, "Fail to get physical port id\n"); if (mlx4_is_master(dev)) mlx4_parav_master_pf_caps(dev); - process_mod_param_profile(&profile); + if (mlx4_low_memory_profile()) { + mlx4_info(dev, "Running from within kdump kernel. Using low memory profile\n"); + profile = low_mem_profile; + } else { + profile = default_profile; + } if (dev->caps.steering_mode == MLX4_STEERING_MODE_DEVICE_MANAGED) profile.num_mcg = MLX4_FS_NUM_MCG; - icm_size = mlx4_make_profile(dev, &profile, dev_cap, + icm_size = mlx4_make_profile(dev, &profile, &dev_cap, &init_hca); if ((long long) icm_size < 0) { err = icm_size; - goto err_stop_fw; + return err; } dev->caps.max_fmr_maps = (1 << (32 - ilog2(dev->caps.num_mpts))) - 1; - init_hca.log_uar_sz = ilog2(dev->caps.num_uars); - init_hca.uar_page_sz = PAGE_SHIFT - 12; + if (enable_4k_uar) { + init_hca.log_uar_sz = ilog2(dev->caps.num_uars) + + PAGE_SHIFT - DEFAULT_UAR_PAGE_SHIFT; + init_hca.uar_page_sz = DEFAULT_UAR_PAGE_SHIFT - 12; + } else { + init_hca.log_uar_sz = ilog2(dev->caps.num_uars); + init_hca.uar_page_sz = PAGE_SHIFT - 12; + } - err = mlx4_init_icm(dev, dev_cap, &init_hca, icm_size); + init_hca.mw_enabled = 0; + if (dev->caps.flags & MLX4_DEV_CAP_FLAG_MEM_WINDOW || + dev->caps.bmme_flags & MLX4_BMME_FLAG_TYPE_2_WIN) + init_hca.mw_enabled = INIT_HCA_TPT_MW_ENABLE; + + err = mlx4_init_icm(dev, &dev_cap, &init_hca, icm_size); if (err) - goto err_stop_fw; - - init_hca.mw_enable = 1; + return err; err = mlx4_INIT_HCA(dev, &init_hca); if (err) { - mlx4_err(dev, "INIT_HCA command failed, aborting.\n"); + mlx4_err(dev, "INIT_HCA command failed, aborting\n"); goto err_free_icm; } - if (dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_SYS_EQS) { - err = mlx4_query_func(dev, dev_cap); + if (dev_cap.flags2 & MLX4_DEV_CAP_FLAG2_SYS_EQS) { + err = mlx4_query_func(dev, &dev_cap); if (err < 0) { mlx4_err(dev, "QUERY_FUNC command failed, aborting.\n"); - goto err_stop_fw; + goto err_close; } else if (err & MLX4_QUERY_FUNC_NUM_SYS_EQS) { - dev->caps.num_eqs = dev_cap->max_eqs; - dev->caps.reserved_eqs = dev_cap->reserved_eqs; - dev->caps.reserved_uars = dev_cap->reserved_uars; + dev->caps.num_eqs = dev_cap.max_eqs; + dev->caps.reserved_eqs = dev_cap.reserved_eqs; + dev->caps.reserved_uars = dev_cap.reserved_uars; } } /* - * Read HCA frequency by QUERY_HCA command + * If TS is supported by FW + * read HCA frequency by QUERY_HCA command */ if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS) { memset(&init_hca, 0, sizeof(init_hca)); err = mlx4_QUERY_HCA(dev, &init_hca); if (err) { - mlx4_err(dev, "QUERY_HCA command failed, disable timestamp.\n"); + mlx4_err(dev, "QUERY_HCA command failed, disable timestamp\n"); dev->caps.flags2 &= ~MLX4_DEV_CAP_FLAG2_TS; } else { dev->caps.hca_core_clock = @@ -2129,19 +2311,40 @@ static int mlx4_init_hca(struct mlx4_dev *dev) */ if (!dev->caps.hca_core_clock) { dev->caps.flags2 &= ~MLX4_DEV_CAP_FLAG2_TS; - mlx4_err(dev, "HCA frequency is 0. Timestamping is not supported."); + mlx4_err(dev, + "HCA frequency is 0 - timestamping is not supported\n"); } else if (map_internal_clock(dev)) { - /* Map internal clock, + /* + * Map internal clock, * in case of failure disable timestamping */ dev->caps.flags2 &= ~MLX4_DEV_CAP_FLAG2_TS; - mlx4_err(dev, "Failed to map internal clock. Timestamping is not supported.\n"); + mlx4_err(dev, "Failed to map internal clock. Timestamping is not supported\n"); } } + + if (dev->caps.dmfs_high_steer_mode != + MLX4_STEERING_DMFS_A0_NOT_SUPPORTED) { + if (mlx4_validate_optimized_steering(dev)) + mlx4_warn(dev, "Optimized steering validation failed\n"); + + if (dev->caps.dmfs_high_steer_mode == + MLX4_STEERING_DMFS_A0_DISABLE) { + dev->caps.dmfs_high_rate_qpn_base = + dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW]; + dev->caps.dmfs_high_rate_qpn_range = + MLX4_A0_STEERING_TABLE_SIZE; + } + + mlx4_dbg(dev, "DMFS high rate steer mode is: %s\n", + dmfs_high_rate_steering_mode_str( + dev->caps.dmfs_high_steer_mode)); + } } else { err = mlx4_init_slave(dev); if (err) { - mlx4_err(dev, "Failed to initialize slave\n"); + if (err != -EAGAIN) + mlx4_err(dev, "Failed to initialize slave\n"); return err; } @@ -2155,32 +2358,35 @@ static int mlx4_init_hca(struct mlx4_dev *dev) if (map_bf_area(dev)) mlx4_dbg(dev, "Failed to map blue flame area\n"); - /* Only the master set the ports, all the rest got it from it.*/ + /*Only the master set the ports, all the rest got it from it.*/ if (!mlx4_is_slave(dev)) mlx4_set_port_mask(dev); err = mlx4_QUERY_ADAPTER(dev, &adapter); if (err) { - mlx4_err(dev, "QUERY_ADAPTER command failed, aborting.\n"); + mlx4_err(dev, "QUERY_ADAPTER command failed, aborting\n"); goto unmap_bf; } + /* Query CONFIG_DEV parameters */ + err = mlx4_config_dev_retrieval(dev, ¶ms); + if (err && err != -ENOTSUPP) { + mlx4_err(dev, "Failed to query CONFIG_DEV parameters\n"); + } else if (!err) { + dev->caps.rx_checksum_flags_port[1] = params.rx_csum_flags_port_1; + dev->caps.rx_checksum_flags_port[2] = params.rx_csum_flags_port_2; + } priv->eq_table.inta_pin = adapter.inta_pin; memcpy(dev->board_id, adapter.board_id, sizeof dev->board_id); - memcpy(dev->vsd, adapter.vsd, sizeof(dev->vsd)); - dev->vsd_vendor_id = adapter.vsd_vendor_id; - - if (!mlx4_is_slave(dev)) - kfree(dev_cap); return 0; unmap_bf: - if (!mlx4_is_slave(dev)) - unmap_internal_clock(dev); + unmap_internal_clock(dev); unmap_bf_area(dev); if (mlx4_is_slave(dev)) { + kfree(dev->caps.qp0_qkey); kfree(dev->caps.qp0_tunnel); kfree(dev->caps.qp0_proxy); kfree(dev->caps.qp1_tunnel); @@ -2197,447 +2403,128 @@ static int mlx4_init_hca(struct mlx4_dev *dev) if (!mlx4_is_slave(dev)) mlx4_free_icms(dev); -err_stop_fw: - if (!mlx4_is_slave(dev)) { - if (!mlx4_UNMAP_FA(dev)) - mlx4_free_icm(dev, priv->fw.fw_icm, 0); - else - pr_warn("mlx4_core: mlx4_UNMAP_FA failed.\n"); - kfree(dev_cap); - } return err; } static int mlx4_init_counters_table(struct mlx4_dev *dev) { struct mlx4_priv *priv = mlx4_priv(dev); - int nent_pow2, port_indx, vf_index, num_counters; - int res, index = 0; - struct counter_index *new_counter_index; - + int nent_pow2; if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_COUNTERS)) return -ENOENT; - if (!mlx4_is_slave(dev) && - dev->caps.max_counters == dev->caps.max_extended_counters) { - res = mlx4_cmd(dev, MLX4_IF_STATE_EXTENDED, 0, 0, - MLX4_CMD_SET_IF_STAT, - MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); - if (res) { - mlx4_err(dev, "Failed to set extended counters (err=%d)\n", res); - return res; - } - } - - mutex_init(&priv->counters_table.mutex); - - if (mlx4_is_slave(dev)) { - for (port_indx = 0; port_indx < dev->caps.num_ports; port_indx++) { - INIT_LIST_HEAD(&priv->counters_table.global_port_list[port_indx]); - if (dev->caps.def_counter_index[port_indx] != 0xFF) { - new_counter_index = kmalloc(sizeof(struct counter_index), GFP_KERNEL); - if (!new_counter_index) - return -ENOMEM; - new_counter_index->index = dev->caps.def_counter_index[port_indx]; - list_add_tail(&new_counter_index->list, &priv->counters_table.global_port_list[port_indx]); - } - } - mlx4_dbg(dev, "%s: slave allocated %d counters for %d ports\n", - __func__, dev->caps.num_ports, dev->caps.num_ports); - return 0; - } + if (!dev->caps.max_counters) + return -ENOSPC; nent_pow2 = roundup_pow_of_two(dev->caps.max_counters); - - for (port_indx = 0; port_indx < dev->caps.num_ports; port_indx++) { - INIT_LIST_HEAD(&priv->counters_table.global_port_list[port_indx]); - /* allocating 2 counters per port for PFs */ - /* For the PF, the ETH default counters are 0,2; */ - /* and the RoCE default counters are 1,3 */ - for (num_counters = 0; num_counters < 2; num_counters++, index++) { - new_counter_index = kmalloc(sizeof(struct counter_index), GFP_KERNEL); - if (!new_counter_index) - return -ENOMEM; - new_counter_index->index = index; - list_add_tail(&new_counter_index->list, - &priv->counters_table.global_port_list[port_indx]); - } - } - - if (mlx4_is_master(dev)) { - for (vf_index = 0; vf_index < dev->num_vfs; vf_index++) { - for (port_indx = 0; port_indx < dev->caps.num_ports; port_indx++) { - INIT_LIST_HEAD(&priv->counters_table.vf_list[vf_index][port_indx]); - new_counter_index = kmalloc(sizeof(struct counter_index), GFP_KERNEL); - if (!new_counter_index) - return -ENOMEM; - if (index < nent_pow2 - 2) { - new_counter_index->index = index; - index++; - } else { - new_counter_index->index = MLX4_SINK_COUNTER_INDEX; - } - - list_add_tail(&new_counter_index->list, - &priv->counters_table.vf_list[vf_index][port_indx]); - } - } - - res = mlx4_bitmap_init(&priv->counters_table.bitmap, - nent_pow2, nent_pow2 - 1, - index, 1); - mlx4_dbg(dev, "%s: master allocated %d counters for %d VFs\n", - __func__, index, dev->num_vfs); - } else { - res = mlx4_bitmap_init(&priv->counters_table.bitmap, - nent_pow2, nent_pow2 - 1, - index, 1); - mlx4_dbg(dev, "%s: native allocated %d counters for %d ports\n", - __func__, index, dev->caps.num_ports); - } - - return 0; - + /* reserve last counter index for sink counter */ + return mlx4_bitmap_init(&priv->counters_bitmap, nent_pow2, + nent_pow2 - 1, 0, + nent_pow2 - dev->caps.max_counters + 1); } static void mlx4_cleanup_counters_table(struct mlx4_dev *dev) { - struct mlx4_priv *priv = mlx4_priv(dev); - int i, j; - struct counter_index *port, *tmp_port; - struct counter_index *vf, *tmp_vf; + if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_COUNTERS)) + return; - mutex_lock(&priv->counters_table.mutex); + if (!dev->caps.max_counters) + return; - if (dev->caps.flags & MLX4_DEV_CAP_FLAG_COUNTERS) { - for (i = 0; i < dev->caps.num_ports; i++) { - list_for_each_entry_safe(port, tmp_port, - &priv->counters_table.global_port_list[i], - list) { - list_del(&port->list); - kfree(port); - } - } - if (!mlx4_is_slave(dev)) { - for (i = 0; i < dev->num_vfs; i++) { - for (j = 0; j < dev->caps.num_ports; j++) { - list_for_each_entry_safe(vf, tmp_vf, - &priv->counters_table.vf_list[i][j], - list) { - /* clear the counter statistic */ - if (__mlx4_clear_if_stat(dev, vf->index)) - mlx4_dbg(dev, "%s: reset counter %d failed\n", - __func__, vf->index); - list_del(&vf->list); - kfree(vf); - } - } - } - mlx4_bitmap_cleanup(&priv->counters_table.bitmap); - } - } - mutex_unlock(&priv->counters_table.mutex); + mlx4_bitmap_cleanup(&mlx4_priv(dev)->counters_bitmap); } -int __mlx4_slave_counters_free(struct mlx4_dev *dev, int slave) +static void mlx4_cleanup_default_counters(struct mlx4_dev *dev) { struct mlx4_priv *priv = mlx4_priv(dev); - int i, first; - struct counter_index *vf, *tmp_vf; + int port; - /* clean VF's counters for the next useg */ - if (slave > 0 && slave <= dev->num_vfs) { - mlx4_dbg(dev, "%s: free counters of slave(%d)\n" - , __func__, slave); - - mutex_lock(&priv->counters_table.mutex); - for (i = 0; i < dev->caps.num_ports; i++) { - first = 0; - list_for_each_entry_safe(vf, tmp_vf, - &priv->counters_table.vf_list[slave - 1][i], - list) { - /* clear the counter statistic */ - if (__mlx4_clear_if_stat(dev, vf->index)) - mlx4_dbg(dev, "%s: reset counter %d failed\n", - __func__, vf->index); - if (first++ && vf->index != MLX4_SINK_COUNTER_INDEX) { - mlx4_dbg(dev, "%s: delete counter index %d for slave %d and port %d\n" - , __func__, vf->index, slave, i + 1); - mlx4_bitmap_free(&priv->counters_table.bitmap, vf->index, MLX4_USE_RR); - list_del(&vf->list); - kfree(vf); - } else { - mlx4_dbg(dev, "%s: can't delete default counter index %d for slave %d and port %d\n" - , __func__, vf->index, slave, i + 1); - } - } - } - mutex_unlock(&priv->counters_table.mutex); - } - - return 0; + for (port = 0; port < dev->caps.num_ports; port++) + if (priv->def_counter[port] != -1) + mlx4_counter_free(dev, priv->def_counter[port]); } -int __mlx4_counter_alloc(struct mlx4_dev *dev, int slave, int port, u32 *idx) +static int mlx4_allocate_default_counters(struct mlx4_dev *dev) +{ + struct mlx4_priv *priv = mlx4_priv(dev); + int port, err = 0; + u32 idx; + + for (port = 0; port < dev->caps.num_ports; port++) + priv->def_counter[port] = -1; + + for (port = 0; port < dev->caps.num_ports; port++) { + err = mlx4_counter_alloc(dev, &idx); + + if (!err || err == -ENOSPC) { + priv->def_counter[port] = idx; + } else if (err == -ENOENT) { + err = 0; + continue; + } else if (mlx4_is_slave(dev) && err == -EINVAL) { + priv->def_counter[port] = MLX4_SINK_COUNTER_INDEX(dev); + mlx4_warn(dev, "can't allocate counter from old PF driver, using index %d\n", + MLX4_SINK_COUNTER_INDEX(dev)); + err = 0; + } else { + mlx4_err(dev, "%s: failed to allocate default counter port %d err %d\n", + __func__, port + 1, err); + mlx4_cleanup_default_counters(dev); + return err; + } + + mlx4_dbg(dev, "%s: default counter index %d for port %d\n", + __func__, priv->def_counter[port], port + 1); + } + + return err; +} + +int __mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx) { struct mlx4_priv *priv = mlx4_priv(dev); - struct counter_index *new_counter_index; if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_COUNTERS)) return -ENOENT; - if ((slave > MLX4_MAX_NUM_VF) || (slave < 0) || - (port < 0) || (port > MLX4_MAX_PORTS)) { - mlx4_dbg(dev, "%s: invalid slave(%d) or port(%d) index\n", - __func__, slave, port); - return -EINVAL; - } - - /* handle old guest request does not support request by port index */ - if (port == 0) { - *idx = MLX4_SINK_COUNTER_INDEX; - mlx4_dbg(dev, "%s: allocated default counter index %d for slave %d port %d\n" - , __func__, *idx, slave, port); - return 0; - } - - mutex_lock(&priv->counters_table.mutex); - - *idx = mlx4_bitmap_alloc(&priv->counters_table.bitmap); - /* if no resources return the default counter of the slave and port */ + *idx = mlx4_bitmap_alloc(&priv->counters_bitmap); if (*idx == -1) { - if (slave == 0) { /* its the ethernet counter ?????? */ - new_counter_index = list_entry(priv->counters_table.global_port_list[port - 1].next, - struct counter_index, - list); - } else { - new_counter_index = list_entry(priv->counters_table.vf_list[slave - 1][port - 1].next, - struct counter_index, - list); - } - - *idx = new_counter_index->index; - mlx4_dbg(dev, "%s: allocated defualt counter index %d for slave %d port %d\n" - , __func__, *idx, slave, port); - goto out; + *idx = MLX4_SINK_COUNTER_INDEX(dev); + return -ENOSPC; } - if (slave == 0) { /* native or master */ - new_counter_index = kmalloc(sizeof(struct counter_index), GFP_KERNEL); - if (!new_counter_index) - goto no_mem; - new_counter_index->index = *idx; - list_add_tail(&new_counter_index->list, &priv->counters_table.global_port_list[port - 1]); - } else { - new_counter_index = kmalloc(sizeof(struct counter_index), GFP_KERNEL); - if (!new_counter_index) - goto no_mem; - new_counter_index->index = *idx; - list_add_tail(&new_counter_index->list, &priv->counters_table.vf_list[slave - 1][port - 1]); - } - - mlx4_dbg(dev, "%s: allocated counter index %d for slave %d port %d\n" - , __func__, *idx, slave, port); -out: - mutex_unlock(&priv->counters_table.mutex); return 0; - -no_mem: - mlx4_bitmap_free(&priv->counters_table.bitmap, *idx, MLX4_USE_RR); - mutex_unlock(&priv->counters_table.mutex); - *idx = MLX4_SINK_COUNTER_INDEX; - mlx4_dbg(dev, "%s: failed err (%d)\n" - , __func__, -ENOMEM); - return -ENOMEM; } -int mlx4_counter_alloc(struct mlx4_dev *dev, u8 port, u32 *idx) +int mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx) { u64 out_param; int err; - struct mlx4_priv *priv = mlx4_priv(dev); - struct counter_index *new_counter_index, *c_index; if (mlx4_is_mfunc(dev)) { - err = mlx4_cmd_imm(dev, 0, &out_param, - ((u32) port) << 8 | (u32) RES_COUNTER, + err = mlx4_cmd_imm(dev, 0, &out_param, RES_COUNTER, RES_OP_RESERVE, MLX4_CMD_ALLOC_RES, MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED); - if (!err) { + if (!err) *idx = get_param_l(&out_param); - if (*idx == MLX4_SINK_COUNTER_INDEX) - return -ENOSPC; - mutex_lock(&priv->counters_table.mutex); - c_index = list_entry(priv->counters_table.global_port_list[port - 1].next, - struct counter_index, - list); - mutex_unlock(&priv->counters_table.mutex); - if (c_index->index == *idx) - return -EEXIST; - - if (mlx4_is_slave(dev)) { - new_counter_index = kmalloc(sizeof(struct counter_index), GFP_KERNEL); - if (!new_counter_index) { - mlx4_counter_free(dev, port, *idx); - return -ENOMEM; - } - new_counter_index->index = *idx; - mutex_lock(&priv->counters_table.mutex); - list_add_tail(&new_counter_index->list, &priv->counters_table.global_port_list[port - 1]); - mutex_unlock(&priv->counters_table.mutex); - mlx4_dbg(dev, "%s: allocated counter index %d for port %d\n" - , __func__, *idx, port); - } - } return err; } - return __mlx4_counter_alloc(dev, 0, port, idx); + return __mlx4_counter_alloc(dev, idx); } EXPORT_SYMBOL_GPL(mlx4_counter_alloc); -void __mlx4_counter_free(struct mlx4_dev *dev, int slave, int port, u32 idx) +static int __mlx4_clear_if_stat(struct mlx4_dev *dev, + u8 counter_index) { - /* check if native or slave and deletes accordingly */ - struct mlx4_priv *priv = mlx4_priv(dev); - struct counter_index *pf, *tmp_pf; - struct counter_index *vf, *tmp_vf; - int first; - - - if (idx == MLX4_SINK_COUNTER_INDEX) { - mlx4_dbg(dev, "%s: try to delete default counter index %d for port %d\n" - , __func__, idx, port); - return; - } - - if ((slave > MLX4_MAX_NUM_VF) || (slave < 0) || - (port < 0) || (port > MLX4_MAX_PORTS)) { - mlx4_warn(dev, "%s: deletion failed due to invalid slave(%d) or port(%d) index\n" - , __func__, slave, idx); - return; - } - - mutex_lock(&priv->counters_table.mutex); - if (slave == 0) { - first = 0; - list_for_each_entry_safe(pf, tmp_pf, - &priv->counters_table.global_port_list[port - 1], - list) { - /* the first 2 counters are reserved */ - if (pf->index == idx) { - /* clear the counter statistic */ - if (__mlx4_clear_if_stat(dev, pf->index)) - mlx4_dbg(dev, "%s: reset counter %d failed\n", - __func__, pf->index); - if (1 < first && idx != MLX4_SINK_COUNTER_INDEX) { - list_del(&pf->list); - kfree(pf); - mlx4_dbg(dev, "%s: delete counter index %d for native device (%d) port %d\n" - , __func__, idx, slave, port); - mlx4_bitmap_free(&priv->counters_table.bitmap, idx, MLX4_USE_RR); - goto out; - } else { - mlx4_dbg(dev, "%s: can't delete default counter index %d for native device (%d) port %d\n" - , __func__, idx, slave, port); - goto out; - } - } - first++; - } - mlx4_dbg(dev, "%s: can't delete counter index %d for native device (%d) port %d\n" - , __func__, idx, slave, port); - } else { - first = 0; - list_for_each_entry_safe(vf, tmp_vf, - &priv->counters_table.vf_list[slave - 1][port - 1], - list) { - /* the first element is reserved */ - if (vf->index == idx) { - /* clear the counter statistic */ - if (__mlx4_clear_if_stat(dev, vf->index)) - mlx4_dbg(dev, "%s: reset counter %d failed\n", - __func__, vf->index); - if (first) { - list_del(&vf->list); - kfree(vf); - mlx4_dbg(dev, "%s: delete counter index %d for slave %d port %d\n", - __func__, idx, slave, port); - mlx4_bitmap_free(&priv->counters_table.bitmap, idx, MLX4_USE_RR); - goto out; - } else { - mlx4_dbg(dev, "%s: can't delete default slave (%d) counter index %d for port %d\n" - , __func__, slave, idx, port); - goto out; - } - } - first++; - } - mlx4_dbg(dev, "%s: can't delete slave (%d) counter index %d for port %d\n" - , __func__, slave, idx, port); - } - -out: - mutex_unlock(&priv->counters_table.mutex); -} - -void mlx4_counter_free(struct mlx4_dev *dev, u8 port, u32 idx) -{ - u64 in_param = 0; - struct mlx4_priv *priv = mlx4_priv(dev); - struct counter_index *counter, *tmp_counter; - int first = 0; - - if (mlx4_is_mfunc(dev)) { - set_param_l(&in_param, idx); - mlx4_cmd(dev, in_param, - ((u32) port) << 8 | (u32) RES_COUNTER, - RES_OP_RESERVE, - MLX4_CMD_FREE_RES, MLX4_CMD_TIME_CLASS_A, - MLX4_CMD_WRAPPED); - - if (mlx4_is_slave(dev) && idx != MLX4_SINK_COUNTER_INDEX) { - mutex_lock(&priv->counters_table.mutex); - list_for_each_entry_safe(counter, tmp_counter, - &priv->counters_table.global_port_list[port - 1], - list) { - if (counter->index == idx && first++) { - list_del(&counter->list); - kfree(counter); - mlx4_dbg(dev, "%s: delete counter index %d for port %d\n" - , __func__, idx, port); - mutex_unlock(&priv->counters_table.mutex); - return; - } - } - mutex_unlock(&priv->counters_table.mutex); - } - - return; - } - __mlx4_counter_free(dev, 0, port, idx); -} -EXPORT_SYMBOL_GPL(mlx4_counter_free); - -int __mlx4_clear_if_stat(struct mlx4_dev *dev, - u8 counter_index) -{ - struct mlx4_cmd_mailbox *if_stat_mailbox = NULL; - int err = 0; - u32 if_stat_in_mod = (counter_index & 0xff) | (1 << 31); - - if (counter_index == MLX4_SINK_COUNTER_INDEX) - return -EINVAL; - - if (mlx4_is_slave(dev)) - return 0; + struct mlx4_cmd_mailbox *if_stat_mailbox; + int err; + u32 if_stat_in_mod = (counter_index & 0xff) | MLX4_QUERY_IF_STAT_RESET; if_stat_mailbox = mlx4_alloc_cmd_mailbox(dev); - if (IS_ERR(if_stat_mailbox)) { - err = PTR_ERR(if_stat_mailbox); - return err; - } + if (IS_ERR(if_stat_mailbox)) + return PTR_ERR(if_stat_mailbox); err = mlx4_cmd_box(dev, 0, if_stat_mailbox->dma, if_stat_in_mod, 0, MLX4_CMD_QUERY_IF_STAT, MLX4_CMD_TIME_CLASS_C, @@ -2647,102 +2534,73 @@ int __mlx4_clear_if_stat(struct mlx4_dev *dev, return err; } -u8 mlx4_get_default_counter_index(struct mlx4_dev *dev, int slave, int port) +void __mlx4_counter_free(struct mlx4_dev *dev, u32 idx) { - struct mlx4_priv *priv = mlx4_priv(dev); - struct counter_index *new_counter_index; + if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_COUNTERS)) + return; - if (dev->caps.port_type[port] == MLX4_PORT_TYPE_IB) { - mlx4_dbg(dev, "%s: return counter index %d for slave %d port (MLX4_PORT_TYPE_IB) %d\n", - __func__, MLX4_SINK_COUNTER_INDEX, slave, port); - return (u8)MLX4_SINK_COUNTER_INDEX; - } + if (idx == MLX4_SINK_COUNTER_INDEX(dev)) + return; - mutex_lock(&priv->counters_table.mutex); - if (slave == 0) { - new_counter_index = list_entry(priv->counters_table.global_port_list[port - 1].next, - struct counter_index, - list); - } else { - new_counter_index = list_entry(priv->counters_table.vf_list[slave - 1][port - 1].next, - struct counter_index, - list); - } - mutex_unlock(&priv->counters_table.mutex); + __mlx4_clear_if_stat(dev, idx); - mlx4_dbg(dev, "%s: return counter index %d for slave %d port %d\n", - __func__, new_counter_index->index, slave, port); - - - return (u8)new_counter_index->index; + mlx4_bitmap_free(&mlx4_priv(dev)->counters_bitmap, idx, MLX4_USE_RR); + return; } -int mlx4_get_vport_ethtool_stats(struct mlx4_dev *dev, int port, - struct mlx4_en_vport_stats *vport_stats, - int reset) +void mlx4_counter_free(struct mlx4_dev *dev, u32 idx) +{ + u64 in_param = 0; + + if (mlx4_is_mfunc(dev)) { + set_param_l(&in_param, idx); + mlx4_cmd(dev, in_param, RES_COUNTER, RES_OP_RESERVE, + MLX4_CMD_FREE_RES, MLX4_CMD_TIME_CLASS_A, + MLX4_CMD_WRAPPED); + return; + } + __mlx4_counter_free(dev, idx); +} +EXPORT_SYMBOL_GPL(mlx4_counter_free); + +int mlx4_get_default_counter_index(struct mlx4_dev *dev, int port) { struct mlx4_priv *priv = mlx4_priv(dev); - struct mlx4_cmd_mailbox *if_stat_mailbox = NULL; - union mlx4_counter *counter; - int err = 0; - u32 if_stat_in_mod; - struct counter_index *vport, *tmp_vport; - if (!vport_stats) - return -EINVAL; - - if_stat_mailbox = mlx4_alloc_cmd_mailbox(dev); - if (IS_ERR(if_stat_mailbox)) { - err = PTR_ERR(if_stat_mailbox); - return err; - } - - mutex_lock(&priv->counters_table.mutex); - list_for_each_entry_safe(vport, tmp_vport, - &priv->counters_table.global_port_list[port - 1], - list) { - if (vport->index == MLX4_SINK_COUNTER_INDEX) - continue; - - memset(if_stat_mailbox->buf, 0, sizeof(union mlx4_counter)); - if_stat_in_mod = (vport->index & 0xff) | ((reset & 1) << 31); - err = mlx4_cmd_box(dev, 0, if_stat_mailbox->dma, - if_stat_in_mod, 0, - MLX4_CMD_QUERY_IF_STAT, - MLX4_CMD_TIME_CLASS_C, - MLX4_CMD_NATIVE); - if (err) { - mlx4_dbg(dev, "%s: failed to read statistics for counter index %d\n", - __func__, vport->index); - goto if_stat_out; - } - counter = (union mlx4_counter *)if_stat_mailbox->buf; - if ((counter->control.cnt_mode & 0xf) == 1) { - vport_stats->rx_broadcast_packets += be64_to_cpu(counter->ext.counters[0].IfRxBroadcastFrames); - vport_stats->rx_unicast_packets += be64_to_cpu(counter->ext.counters[0].IfRxUnicastFrames); - vport_stats->rx_multicast_packets += be64_to_cpu(counter->ext.counters[0].IfRxMulticastFrames); - vport_stats->tx_broadcast_packets += be64_to_cpu(counter->ext.counters[0].IfTxBroadcastFrames); - vport_stats->tx_unicast_packets += be64_to_cpu(counter->ext.counters[0].IfTxUnicastFrames); - vport_stats->tx_multicast_packets += be64_to_cpu(counter->ext.counters[0].IfTxMulticastFrames); - vport_stats->rx_broadcast_bytes += be64_to_cpu(counter->ext.counters[0].IfRxBroadcastOctets); - vport_stats->rx_unicast_bytes += be64_to_cpu(counter->ext.counters[0].IfRxUnicastOctets); - vport_stats->rx_multicast_bytes += be64_to_cpu(counter->ext.counters[0].IfRxMulticastOctets); - vport_stats->tx_broadcast_bytes += be64_to_cpu(counter->ext.counters[0].IfTxBroadcastOctets); - vport_stats->tx_unicast_bytes += be64_to_cpu(counter->ext.counters[0].IfTxUnicastOctets); - vport_stats->tx_multicast_bytes += be64_to_cpu(counter->ext.counters[0].IfTxMulticastOctets); - vport_stats->rx_errors += be64_to_cpu(counter->ext.counters[0].IfRxErrorFrames); - vport_stats->rx_dropped += be64_to_cpu(counter->ext.counters[0].IfRxNoBufferFrames); - vport_stats->tx_errors += be64_to_cpu(counter->ext.counters[0].IfTxDroppedFrames); - } - } - -if_stat_out: - mutex_unlock(&priv->counters_table.mutex); - mlx4_free_cmd_mailbox(dev, if_stat_mailbox); - - return err; + return priv->def_counter[port - 1]; +} +EXPORT_SYMBOL_GPL(mlx4_get_default_counter_index); + +void mlx4_set_admin_guid(struct mlx4_dev *dev, __be64 guid, int entry, int port) +{ + struct mlx4_priv *priv = mlx4_priv(dev); + + priv->mfunc.master.vf_admin[entry].vport[port].guid = guid; +} +EXPORT_SYMBOL_GPL(mlx4_set_admin_guid); + +__be64 mlx4_get_admin_guid(struct mlx4_dev *dev, int entry, int port) +{ + struct mlx4_priv *priv = mlx4_priv(dev); + + return priv->mfunc.master.vf_admin[entry].vport[port].guid; +} +EXPORT_SYMBOL_GPL(mlx4_get_admin_guid); + +void mlx4_set_random_admin_guid(struct mlx4_dev *dev, int entry, int port) +{ + struct mlx4_priv *priv = mlx4_priv(dev); + __be64 guid; + + /* hw GUID */ + if (entry == 0) + return; + + get_random_bytes((char *)&guid, sizeof(guid)); + guid &= ~(cpu_to_be64(1ULL << 56)); + guid |= cpu_to_be64(1ULL << 57); + priv->mfunc.master.vf_admin[entry].vport[port].guid = guid; } -EXPORT_SYMBOL_GPL(mlx4_get_vport_ethtool_stats); static int mlx4_setup_hca(struct mlx4_dev *dev) { @@ -2753,84 +2611,75 @@ static int mlx4_setup_hca(struct mlx4_dev *dev) err = mlx4_init_uar_table(dev); if (err) { - mlx4_err(dev, "Failed to initialize " - "user access region table (err=%d), aborting.\n", - err); + mlx4_err(dev, "Failed to initialize user access region table, aborting\n"); return err; } err = mlx4_uar_alloc(dev, &priv->driver_uar); if (err) { - mlx4_err(dev, "Failed to allocate driver access region " - "(err=%d), aborting.\n", err); + mlx4_err(dev, "Failed to allocate driver access region, aborting\n"); goto err_uar_table_free; } priv->kar = ioremap((phys_addr_t) priv->driver_uar.pfn << PAGE_SHIFT, PAGE_SIZE); if (!priv->kar) { - mlx4_err(dev, "Couldn't map kernel access region, " - "aborting.\n"); + mlx4_err(dev, "Couldn't map kernel access region, aborting\n"); err = -ENOMEM; goto err_uar_free; } err = mlx4_init_pd_table(dev); if (err) { - mlx4_err(dev, "Failed to initialize " - "protection domain table (err=%d), aborting.\n", err); + mlx4_err(dev, "Failed to initialize protection domain table, aborting\n"); goto err_kar_unmap; } err = mlx4_init_xrcd_table(dev); if (err) { - mlx4_err(dev, "Failed to initialize " - "reliable connection domain table (err=%d), " - "aborting.\n", err); + mlx4_err(dev, "Failed to initialize reliable connection domain table, aborting\n"); goto err_pd_table_free; } err = mlx4_init_mr_table(dev); if (err) { - mlx4_err(dev, "Failed to initialize " - "memory region table (err=%d), aborting.\n", err); + mlx4_err(dev, "Failed to initialize memory region table, aborting\n"); goto err_xrcd_table_free; } if (!mlx4_is_slave(dev)) { err = mlx4_init_mcg_table(dev); if (err) { - mlx4_err(dev, "Failed to initialize " - "multicast group table (err=%d), aborting.\n", - err); + mlx4_err(dev, "Failed to initialize multicast group table, aborting\n"); goto err_mr_table_free; } + err = mlx4_config_mad_demux(dev); + if (err) { + mlx4_err(dev, "Failed in config_mad_demux, aborting\n"); + goto err_mcg_table_free; + } } err = mlx4_init_eq_table(dev); if (err) { - mlx4_err(dev, "Failed to initialize " - "event queue table (err=%d), aborting.\n", err); + mlx4_err(dev, "Failed to initialize event queue table, aborting\n"); goto err_mcg_table_free; } err = mlx4_cmd_use_events(dev); if (err) { - mlx4_err(dev, "Failed to switch to event-driven " - "firmware commands (err=%d), aborting.\n", err); + mlx4_err(dev, "Failed to switch to event-driven firmware commands, aborting\n"); goto err_eq_table_free; } err = mlx4_NOP(dev); if (err) { if (dev->flags & MLX4_FLAG_MSI_X) { - mlx4_warn(dev, "NOP command failed to generate MSI-X " - "interrupt IRQ %d).\n", - priv->eq_table.eq[dev->caps.num_comp_vectors].irq); - mlx4_warn(dev, "Trying again without MSI-X.\n"); + mlx4_warn(dev, "NOP command failed to generate MSI-X interrupt IRQ %d)\n", + priv->eq_table.eq[MLX4_EQ_ASYNC].irq); + mlx4_warn(dev, "Trying again without MSI-X\n"); } else { - mlx4_err(dev, "NOP command failed to generate interrupt " - "(IRQ %d), aborting.\n", - priv->eq_table.eq[dev->caps.num_comp_vectors].irq); + mlx4_err(dev, "NOP command failed to generate interrupt (IRQ %d), aborting\n", + priv->eq_table.eq[MLX4_EQ_ASYNC].irq); mlx4_err(dev, "BIOS or ACPI interrupt routing problem?\n"); } @@ -2841,31 +2690,34 @@ static int mlx4_setup_hca(struct mlx4_dev *dev) err = mlx4_init_cq_table(dev); if (err) { - mlx4_err(dev, "Failed to initialize " - "completion queue table (err=%d), aborting.\n", err); + mlx4_err(dev, "Failed to initialize completion queue table, aborting\n"); goto err_cmd_poll; } err = mlx4_init_srq_table(dev); if (err) { - mlx4_err(dev, "Failed to initialize " - "shared receive queue table (err=%d), aborting.\n", - err); + mlx4_err(dev, "Failed to initialize shared receive queue table, aborting\n"); goto err_cq_table_free; } err = mlx4_init_qp_table(dev); if (err) { - mlx4_err(dev, "Failed to initialize " - "queue pair table (err=%d), aborting.\n", err); + mlx4_err(dev, "Failed to initialize queue pair table, aborting\n"); goto err_srq_table_free; } - err = mlx4_init_counters_table(dev); - if (err && err != -ENOENT) { - mlx4_err(dev, "Failed to initialize counters table (err=%d), " - "aborting.\n", err); - goto err_qp_table_free; + if (!mlx4_is_slave(dev)) { + err = mlx4_init_counters_table(dev); + if (err && err != -ENOENT) { + mlx4_err(dev, "Failed to initialize counters table, aborting\n"); + goto err_qp_table_free; + } + } + + err = mlx4_allocate_default_counters(dev); + if (err) { + mlx4_err(dev, "Failed to allocate default counters, aborting\n"); + goto err_counters_table_free; } if (!mlx4_is_slave(dev)) { @@ -2874,9 +2726,8 @@ static int mlx4_setup_hca(struct mlx4_dev *dev) err = mlx4_get_port_ib_caps(dev, port, &ib_port_default_caps); if (err) - mlx4_warn(dev, "failed to get port %d default " - "ib capabilities (%d). Continuing " - "with caps = 0\n", port, err); + mlx4_warn(dev, "failed to get port %d default ib capabilities (%d). Continuing with caps = 0\n", + port, err); dev->caps.ib_port_def_cap[port] = ib_port_default_caps; /* initialize per-slave default ib port capabilities */ @@ -2886,26 +2737,33 @@ static int mlx4_setup_hca(struct mlx4_dev *dev) if (i == mlx4_master_func_num(dev)) continue; priv->mfunc.master.slave_state[i].ib_cap_mask[port] = - ib_port_default_caps; + ib_port_default_caps; } } - dev->caps.port_ib_mtu[port] = IB_MTU_4096; + if (mlx4_is_mfunc(dev)) + dev->caps.port_ib_mtu[port] = IB_MTU_2048; + else + dev->caps.port_ib_mtu[port] = IB_MTU_4096; err = mlx4_SET_PORT(dev, port, mlx4_is_master(dev) ? dev->caps.pkey_table_len[port] : -1); if (err) { - mlx4_err(dev, "Failed to set port %d (err=%d), " - "aborting\n", port, err); - goto err_counters_table_free; + mlx4_err(dev, "Failed to set port %d, aborting\n", + port); + goto err_default_countes_free; } } } return 0; +err_default_countes_free: + mlx4_cleanup_default_counters(dev); + err_counters_table_free: - mlx4_cleanup_counters_table(dev); + if (!mlx4_is_slave(dev)) + mlx4_cleanup_counters_table(dev); err_qp_table_free: mlx4_cleanup_qp_table(dev); @@ -2946,21 +2804,47 @@ static int mlx4_setup_hca(struct mlx4_dev *dev) return err; } +static int mlx4_init_affinity_hint(struct mlx4_dev *dev, int port, int eqn) +{ + int requested_cpu = 0; + struct mlx4_priv *priv = mlx4_priv(dev); + struct mlx4_eq *eq; + int off = 0; + int i; + + if (eqn > dev->caps.num_comp_vectors) + return -EINVAL; + + for (i = 1; i < port; i++) + off += mlx4_get_eqs_per_port(dev, i); + + requested_cpu = eqn - off - !!(eqn > MLX4_EQ_ASYNC); + + /* Meaning EQs are shared, and this call comes from the second port */ + if (requested_cpu < 0) + return 0; + + eq = &priv->eq_table.eq[eqn]; + + eq->affinity_cpu_id = requested_cpu % num_online_cpus(); + + return 0; +} + static void mlx4_enable_msi_x(struct mlx4_dev *dev) { struct mlx4_priv *priv = mlx4_priv(dev); struct msix_entry *entries; - int err; int i; + int port = 0; if (msi_x) { - int nreq = dev->caps.num_ports * num_online_cpus() + MSIX_LEGACY_SZ; + int nreq = dev->caps.num_ports * num_online_cpus() + 1; nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs, nreq); - - if (msi_x > 1 && !mlx4_is_mfunc(dev)) - nreq = min_t(int, nreq, msi_x); + if (nreq > MAX_MSIX) + nreq = MAX_MSIX; entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL); if (!entries) @@ -2969,38 +2853,58 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev) for (i = 0; i < nreq; ++i) entries[i].entry = i; - retry: - err = pci_enable_msix(dev->pdev, entries, nreq); - if (err) { - /* Try again if at least 2 vectors are available */ - if (err > 1) { - mlx4_info(dev, "Requested %d vectors, " - "but only %d MSI-X vectors available, " - "trying again\n", nreq, err); - nreq = err; - goto retry; - } + nreq = pci_enable_msix_range(dev->persist->pdev, entries, 2, + nreq); + + if (nreq < 0 || nreq < MLX4_EQ_ASYNC) { kfree(entries); - /* if error, or can't alloc even 1 IRQ */ - if (err < 0) { - mlx4_err(dev, "No IRQs left, device can't " - "be started.\n"); - goto no_irq; - } goto no_msi; } + /* 1 is reserved for events (asyncrounous EQ) */ + dev->caps.num_comp_vectors = nreq - 1; - if (nreq < - MSIX_LEGACY_SZ + dev->caps.num_ports * MIN_MSIX_P_PORT) { - /*Working in legacy mode , all EQ's shared*/ - dev->caps.comp_pool = 0; - dev->caps.num_comp_vectors = nreq - 1; - } else { - dev->caps.comp_pool = nreq - MSIX_LEGACY_SZ; - dev->caps.num_comp_vectors = MSIX_LEGACY_SZ - 1; + priv->eq_table.eq[MLX4_EQ_ASYNC].irq = entries[0].vector; + bitmap_zero(priv->eq_table.eq[MLX4_EQ_ASYNC].actv_ports.ports, + dev->caps.num_ports); + + for (i = 0; i < dev->caps.num_comp_vectors + 1; i++) { + if (i == MLX4_EQ_ASYNC) + continue; + + priv->eq_table.eq[i].irq = + entries[i + 1 - !!(i > MLX4_EQ_ASYNC)].vector; + + if (MLX4_IS_LEGACY_EQ_MODE(dev->caps)) { + bitmap_fill(priv->eq_table.eq[i].actv_ports.ports, + dev->caps.num_ports); + /* We don't set affinity hint when there + * aren't enough EQs + */ + } else { + set_bit(port, + priv->eq_table.eq[i].actv_ports.ports); + if (mlx4_init_affinity_hint(dev, port + 1, i)) + mlx4_warn(dev, "Couldn't init hint cpumask for EQ %d\n", + i); + } + /* We divide the Eqs evenly between the two ports. + * (dev->caps.num_comp_vectors / dev->caps.num_ports) + * refers to the number of Eqs per port + * (i.e eqs_per_port). Theoretically, we would like to + * write something like (i + 1) % eqs_per_port == 0. + * However, since there's an asynchronous Eq, we have + * to skip over it by comparing this condition to + * !!((i + 1) > MLX4_EQ_ASYNC). + */ + if ((dev->caps.num_comp_vectors > dev->caps.num_ports) && + ((i + 1) % + (dev->caps.num_comp_vectors / dev->caps.num_ports)) == + !!((i + 1) > MLX4_EQ_ASYNC)) + /* If dev->caps.num_comp_vectors < dev->caps.num_ports, + * everything is shared anyway. + */ + port++; } - for (i = 0; i < nreq; ++i) - priv->eq_table.eq[i].irq = entries[i].vector; dev->flags |= MLX4_FLAG_MSI_X; @@ -3010,38 +2914,15 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev) no_msi: dev->caps.num_comp_vectors = 1; - dev->caps.comp_pool = 0; - for (i = 0; i < 2; ++i) - priv->eq_table.eq[i].irq = dev->pdev->irq; - return; -no_irq: - dev->caps.num_comp_vectors = 0; - dev->caps.comp_pool = 0; - return; -} - -static void -mlx4_init_hca_info(struct mlx4_dev *dev) -{ - struct mlx4_hca_info *info = &mlx4_priv(dev)->hca_info; - - info->dev = dev; - - info->firmware_attr = (struct device_attribute)__ATTR(fw_ver, S_IRUGO, - show_firmware_version, NULL); - if (device_create_file(&dev->pdev->dev, &info->firmware_attr)) - mlx4_err(dev, "Failed to add file firmware version"); - - info->hca_attr = (struct device_attribute)__ATTR(hca, S_IRUGO, show_hca, - NULL); - if (device_create_file(&dev->pdev->dev, &info->hca_attr)) - mlx4_err(dev, "Failed to add file hca type"); - - info->board_attr = (struct device_attribute)__ATTR(board_id, S_IRUGO, - show_board, NULL); - if (device_create_file(&dev->pdev->dev, &info->board_attr)) - mlx4_err(dev, "Failed to add file board id type"); + BUG_ON(MLX4_EQ_ASYNC >= 2); + for (i = 0; i < 2; ++i) { + priv->eq_table.eq[i].irq = dev->persist->pdev->irq; + if (i != MLX4_EQ_ASYNC) { + bitmap_fill(priv->eq_table.eq[i].actv_ports.ports, + dev->caps.num_ports); + } + } } static int mlx4_init_port_info(struct mlx4_dev *dev, int port) @@ -3054,6 +2935,7 @@ static int mlx4_init_port_info(struct mlx4_dev *dev, int port) if (!mlx4_is_slave(dev)) { mlx4_init_mac_table(dev, &info->mac_table); mlx4_init_vlan_table(dev, &info->vlan_table); + mlx4_init_roce_gid_table(dev, &info->gid_table); info->base_qpn = mlx4_get_base_qpn(dev, port); } @@ -3068,7 +2950,7 @@ static int mlx4_init_port_info(struct mlx4_dev *dev, int port) info->port_attr.show = show_port_type; sysfs_attr_init(&info->port_attr.attr); - err = device_create_file(&dev->pdev->dev, &info->port_attr); + err = device_create_file(&dev->persist->pdev->dev, &info->port_attr); if (err) { mlx4_err(dev, "Failed to create file for port %d\n", port); info->port = -1; @@ -3085,31 +2967,30 @@ static int mlx4_init_port_info(struct mlx4_dev *dev, int port) info->port_mtu_attr.show = show_port_ib_mtu; sysfs_attr_init(&info->port_mtu_attr.attr); - err = device_create_file(&dev->pdev->dev, &info->port_mtu_attr); + err = device_create_file(&dev->persist->pdev->dev, + &info->port_mtu_attr); if (err) { mlx4_err(dev, "Failed to create mtu file for port %d\n", port); - device_remove_file(&info->dev->pdev->dev, &info->port_attr); + device_remove_file(&info->dev->persist->pdev->dev, + &info->port_attr); info->port = -1; } return err; } -static void -mlx4_cleanup_hca_info(struct mlx4_hca_info *info) -{ - device_remove_file(&info->dev->pdev->dev, &info->firmware_attr); - device_remove_file(&info->dev->pdev->dev, &info->board_attr); - device_remove_file(&info->dev->pdev->dev, &info->hca_attr); -} - static void mlx4_cleanup_port_info(struct mlx4_port_info *info) { if (info->port < 0) return; - device_remove_file(&info->dev->pdev->dev, &info->port_attr); - device_remove_file(&info->dev->pdev->dev, &info->port_mtu_attr); + device_remove_file(&info->dev->persist->pdev->dev, &info->port_attr); + device_remove_file(&info->dev->persist->pdev->dev, + &info->port_mtu_attr); +#ifdef CONFIG_RFS_ACCEL + free_irq_cpu_rmap(info->rmap); + info->rmap = NULL; +#endif } static int mlx4_init_steering(struct mlx4_dev *dev) @@ -3176,10 +3057,11 @@ static int mlx4_get_ownership(struct mlx4_dev *dev) void __iomem *owner; u32 ret; - if (pci_channel_offline(dev->pdev)) + if (pci_channel_offline(dev->persist->pdev)) return -EIO; - owner = ioremap(pci_resource_start(dev->pdev, 0) + MLX4_OWNER_BASE, + owner = ioremap(pci_resource_start(dev->persist->pdev, 0) + + MLX4_OWNER_BASE, MLX4_OWNER_SIZE); if (!owner) { mlx4_err(dev, "Failed to obtain ownership bit\n"); @@ -3195,10 +3077,11 @@ static void mlx4_free_ownership(struct mlx4_dev *dev) { void __iomem *owner; - if (pci_channel_offline(dev->pdev)) + if (pci_channel_offline(dev->persist->pdev)) return; - owner = ioremap(pci_resource_start(dev->pdev, 0) + MLX4_OWNER_BASE, + owner = ioremap(pci_resource_start(dev->persist->pdev, 0) + + MLX4_OWNER_BASE, MLX4_OWNER_SIZE); if (!owner) { mlx4_err(dev, "Failed to obtain ownership bit\n"); @@ -3209,118 +3092,142 @@ static void mlx4_free_ownership(struct mlx4_dev *dev) iounmap(owner); } -static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data) +#define SRIOV_VALID_STATE(flags) (!!((flags) & MLX4_FLAG_SRIOV) ==\ + !!((flags) & MLX4_FLAG_MASTER)) + +static u64 mlx4_enable_sriov(struct mlx4_dev *dev, struct pci_dev *pdev, + u8 total_vfs, int existing_vfs, int reset_flow) +{ + u64 dev_flags = dev->flags; + int err = 0; + + if (reset_flow) { + dev->dev_vfs = kcalloc(total_vfs, sizeof(*dev->dev_vfs), + GFP_KERNEL); + if (!dev->dev_vfs) + goto free_mem; + return dev_flags; + } + + atomic_inc(&pf_loading); + if (dev->flags & MLX4_FLAG_SRIOV) { + if (existing_vfs != total_vfs) { + mlx4_err(dev, "SR-IOV was already enabled, but with num_vfs (%d) different than requested (%d)\n", + existing_vfs, total_vfs); + total_vfs = existing_vfs; + } + } + + dev->dev_vfs = kzalloc(total_vfs * sizeof(*dev->dev_vfs), GFP_KERNEL); + if (NULL == dev->dev_vfs) { + mlx4_err(dev, "Failed to allocate memory for VFs\n"); + goto disable_sriov; + } + + if (!(dev->flags & MLX4_FLAG_SRIOV)) { + mlx4_warn(dev, "Enabling SR-IOV with %d VFs\n", total_vfs); + err = pci_enable_sriov(pdev, total_vfs); + } + if (err) { + mlx4_err(dev, "Failed to enable SR-IOV, continuing without SR-IOV (err = %d)\n", + err); + goto disable_sriov; + } else { + mlx4_warn(dev, "Running in master mode\n"); + dev_flags |= MLX4_FLAG_SRIOV | + MLX4_FLAG_MASTER; + dev_flags &= ~MLX4_FLAG_SLAVE; + dev->persist->num_vfs = total_vfs; + } + return dev_flags; + +disable_sriov: + atomic_dec(&pf_loading); +free_mem: + dev->persist->num_vfs = 0; + kfree(dev->dev_vfs); + dev->dev_vfs = NULL; + return dev_flags & ~MLX4_FLAG_MASTER; +} + +enum { + MLX4_DEV_CAP_CHECK_NUM_VFS_ABOVE_64 = -1, +}; + +static int mlx4_check_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap, + int *nvfs) +{ + int requested_vfs = nvfs[0] + nvfs[1] + nvfs[2]; + /* Checking for 64 VFs as a limitation of CX2 */ + if (!(dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_80_VFS) && + requested_vfs >= 64) { + mlx4_err(dev, "Requested %d VFs, but FW does not support more than 64\n", + requested_vfs); + return MLX4_DEV_CAP_CHECK_NUM_VFS_ABOVE_64; + } + return 0; +} + +static int mlx4_pci_enable_device(struct mlx4_dev *dev) +{ + struct pci_dev *pdev = dev->persist->pdev; + int err = 0; + + mutex_lock(&dev->persist->pci_status_mutex); + if (dev->persist->pci_status == MLX4_PCI_STATUS_DISABLED) { + err = pci_enable_device(pdev); + if (!err) + dev->persist->pci_status = MLX4_PCI_STATUS_ENABLED; + } + mutex_unlock(&dev->persist->pci_status_mutex); + + return err; +} + +static void mlx4_pci_disable_device(struct mlx4_dev *dev) +{ + struct pci_dev *pdev = dev->persist->pdev; + + mutex_lock(&dev->persist->pci_status_mutex); + if (dev->persist->pci_status == MLX4_PCI_STATUS_ENABLED) { + pci_disable_device(pdev); + dev->persist->pci_status = MLX4_PCI_STATUS_DISABLED; + } + mutex_unlock(&dev->persist->pci_status_mutex); +} + +static int mlx4_load_one(struct pci_dev *pdev, int pci_dev_data, + int total_vfs, int *nvfs, struct mlx4_priv *priv, + int reset_flow) { - struct mlx4_priv *priv; struct mlx4_dev *dev; + unsigned sum = 0; int err; int port; - int nvfs, prb_vf; + int i; + struct mlx4_dev_cap *dev_cap = NULL; + int existing_vfs = 0; - pr_info(DRV_NAME ": Initializing %s\n", pci_name(pdev)); + dev = &priv->dev; - err = pci_enable_device(pdev); - if (err) { - dev_err(&pdev->dev, "Cannot enable PCI device, " - "aborting.\n"); - return err; - } - - mlx4_get_val(num_vfs.dbdf2val.tbl, pci_physfn(pdev), 0, &nvfs); - mlx4_get_val(probe_vf.dbdf2val.tbl, pci_physfn(pdev), 0, &prb_vf); - if (nvfs > MLX4_MAX_NUM_VF) { - dev_err(&pdev->dev, "There are more VF's (%d) than allowed(%d)\n", - nvfs, MLX4_MAX_NUM_VF); - return -EINVAL; - } - - if (nvfs < 0) { - dev_err(&pdev->dev, "num_vfs module parameter cannot be negative\n"); - return -EINVAL; - } - /* - * Check for BARs. - */ - if (!(pci_dev_data & MLX4_PCI_DEV_IS_VF) && - !(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { - dev_err(&pdev->dev, "Missing DCS, aborting." - "(driver_data: 0x%x, pci_resource_flags(pdev, 0):0x%x)\n", - pci_dev_data, pci_resource_flags(pdev, 0)); - err = -ENODEV; - goto err_disable_pdev; - } - if (!(pci_resource_flags(pdev, 2) & IORESOURCE_MEM)) { - dev_err(&pdev->dev, "Missing UAR, aborting.\n"); - err = -ENODEV; - goto err_disable_pdev; - } - - err = pci_request_regions(pdev, DRV_NAME); - if (err) { - dev_err(&pdev->dev, "Couldn't get PCI resources, aborting\n"); - goto err_disable_pdev; - } - - pci_set_master(pdev); - - err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64)); - if (err) { - dev_warn(&pdev->dev, "Warning: couldn't set 64-bit PCI DMA mask.\n"); - err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); - if (err) { - dev_err(&pdev->dev, "Can't set PCI DMA mask, aborting.\n"); - goto err_release_regions; - } - } - err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); - if (err) { - dev_warn(&pdev->dev, "Warning: couldn't set 64-bit " - "consistent PCI DMA mask.\n"); - err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); - if (err) { - dev_err(&pdev->dev, "Can't set consistent PCI DMA mask, " - "aborting.\n"); - goto err_release_regions; - } - } - - /* Allow large DMA segments, up to the firmware limit of 1 GB */ - dma_set_max_seg_size(&pdev->dev, 1024 * 1024 * 1024); - - priv = kzalloc(sizeof *priv, GFP_KERNEL); - if (!priv) { - dev_err(&pdev->dev, "Device struct alloc failed, " - "aborting.\n"); - err = -ENOMEM; - goto err_release_regions; - } - - dev = &priv->dev; - dev->pdev = pdev; - INIT_LIST_HEAD(&priv->dev_list); INIT_LIST_HEAD(&priv->ctx_list); spin_lock_init(&priv->ctx_lock); mutex_init(&priv->port_mutex); + mutex_init(&priv->bond_mutex); INIT_LIST_HEAD(&priv->pgdir_list); mutex_init(&priv->pgdir_mutex); + spin_lock_init(&priv->cmd.context_lock); INIT_LIST_HEAD(&priv->bf_list); mutex_init(&priv->bf_mutex); dev->rev_id = pdev->revision; dev->numa_node = dev_to_node(&pdev->dev); + /* Detect if this device is a virtual function */ if (pci_dev_data & MLX4_PCI_DEV_IS_VF) { - /* When acting as pf, we normally skip vfs unless explicitly - * requested to probe them. */ - if (nvfs && extended_func_num(pdev) > prb_vf) { - mlx4_warn(dev, "Skipping virtual function:%d\n", - extended_func_num(pdev)); - err = -ENODEV; - goto err_free_dev; - } mlx4_warn(dev, "Detected virtual function - running in slave mode\n"); dev->flags |= MLX4_FLAG_SLAVE; } else { @@ -3330,27 +3237,10 @@ static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data) err = mlx4_get_ownership(dev); if (err) { if (err < 0) - goto err_free_dev; + return err; else { - mlx4_warn(dev, "Multiple PFs not yet supported." - " Skipping PF.\n"); - err = -EINVAL; - goto err_free_dev; - } - } - - if (nvfs) { - mlx4_warn(dev, "Enabling SR-IOV with %d VFs\n", nvfs); - err = pci_enable_sriov(pdev, nvfs); - if (err) { - mlx4_err(dev, "Failed to enable SR-IOV, continuing without SR-IOV (err = %d).\n", - err); - err = 0; - } else { - mlx4_warn(dev, "Running in master mode\n"); - dev->flags |= MLX4_FLAG_SRIOV | - MLX4_FLAG_MASTER; - dev->num_vfs = nvfs; + mlx4_warn(dev, "Multiple PFs not yet supported - Skipping PF\n"); + return -EINVAL; } } @@ -3364,15 +3254,28 @@ static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data) */ err = mlx4_reset(dev); if (err) { - mlx4_err(dev, "Failed to reset HCA, aborting.\n"); + mlx4_err(dev, "Failed to reset HCA, aborting\n"); goto err_sriov; } + + if (total_vfs) { + dev->flags = MLX4_FLAG_MASTER; + existing_vfs = pci_num_vf(pdev); + if (existing_vfs) + dev->flags |= MLX4_FLAG_SRIOV; + dev->persist->num_vfs = total_vfs; + } } + /* on load remove any previous indication of internal error, + * device is up. + */ + dev->persist->state = MLX4_DEVICE_STATE_UP; + slave_start: err = mlx4_cmd_init(dev); if (err) { - mlx4_err(dev, "Failed to init command interface, aborting.\n"); + mlx4_err(dev, "Failed to init command interface, aborting\n"); goto err_sriov; } @@ -3380,39 +3283,166 @@ static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data) * before posting commands. Also, init num_slaves before calling * mlx4_init_hca */ if (mlx4_is_mfunc(dev)) { - if (mlx4_is_master(dev)) + if (mlx4_is_master(dev)) { dev->num_slaves = MLX4_MAX_NUM_SLAVES; - else { + + } else { dev->num_slaves = 0; err = mlx4_multi_func_init(dev); if (err) { - mlx4_err(dev, "Failed to init slave mfunc" - " interface, aborting.\n"); + mlx4_err(dev, "Failed to init slave mfunc interface, aborting\n"); goto err_cmd; } } } + err = mlx4_init_fw(dev); + if (err) { + mlx4_err(dev, "Failed to init fw, aborting.\n"); + goto err_mfunc; + } + + if (mlx4_is_master(dev)) { + /* when we hit the goto slave_start below, dev_cap already initialized */ + if (!dev_cap) { + dev_cap = kzalloc(sizeof(*dev_cap), GFP_KERNEL); + + if (!dev_cap) { + err = -ENOMEM; + goto err_fw; + } + + err = mlx4_QUERY_DEV_CAP(dev, dev_cap); + if (err) { + mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting.\n"); + goto err_fw; + } + + if (mlx4_check_dev_cap(dev, dev_cap, nvfs)) + goto err_fw; + + if (!(dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_SYS_EQS)) { + u64 dev_flags = mlx4_enable_sriov(dev, pdev, + total_vfs, + existing_vfs, + reset_flow); + + mlx4_cmd_cleanup(dev, MLX4_CMD_CLEANUP_ALL); + dev->flags = dev_flags; + if (!SRIOV_VALID_STATE(dev->flags)) { + mlx4_err(dev, "Invalid SRIOV state\n"); + goto err_sriov; + } + err = mlx4_reset(dev); + if (err) { + mlx4_err(dev, "Failed to reset HCA, aborting.\n"); + goto err_sriov; + } + goto slave_start; + } + } else { + /* Legacy mode FW requires SRIOV to be enabled before + * doing QUERY_DEV_CAP, since max_eq's value is different if + * SRIOV is enabled. + */ + memset(dev_cap, 0, sizeof(*dev_cap)); + err = mlx4_QUERY_DEV_CAP(dev, dev_cap); + if (err) { + mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting.\n"); + goto err_fw; + } + + if (mlx4_check_dev_cap(dev, dev_cap, nvfs)) + goto err_fw; + } + } + err = mlx4_init_hca(dev); if (err) { if (err == -EACCES) { /* Not primary Physical function * Running in slave mode */ - mlx4_cmd_cleanup(dev); + mlx4_cmd_cleanup(dev, MLX4_CMD_CLEANUP_ALL); + /* We're not a PF */ + if (dev->flags & MLX4_FLAG_SRIOV) { + if (!existing_vfs) + pci_disable_sriov(pdev); + if (mlx4_is_master(dev) && !reset_flow) + atomic_dec(&pf_loading); + dev->flags &= ~MLX4_FLAG_SRIOV; + } + if (!mlx4_is_slave(dev)) + mlx4_free_ownership(dev); dev->flags |= MLX4_FLAG_SLAVE; dev->flags &= ~MLX4_FLAG_MASTER; goto slave_start; } else - goto err_mfunc; + goto err_fw; } + if (mlx4_is_master(dev) && (dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_SYS_EQS)) { + u64 dev_flags = mlx4_enable_sriov(dev, pdev, total_vfs, + existing_vfs, reset_flow); + + if ((dev->flags ^ dev_flags) & (MLX4_FLAG_MASTER | MLX4_FLAG_SLAVE)) { + mlx4_cmd_cleanup(dev, MLX4_CMD_CLEANUP_VHCR); + dev->flags = dev_flags; + err = mlx4_cmd_init(dev); + if (err) { + /* Only VHCR is cleaned up, so could still + * send FW commands + */ + mlx4_err(dev, "Failed to init VHCR command interface, aborting\n"); + goto err_close; + } + } else { + dev->flags = dev_flags; + } + + if (!SRIOV_VALID_STATE(dev->flags)) { + mlx4_err(dev, "Invalid SRIOV state\n"); + goto err_close; + } + } + + /* check if the device is functioning at its maximum possible speed. + * No return code for this call, just warn the user in case of PCI + * express device capabilities are under-satisfied by the bus. + */ + if (!mlx4_is_slave(dev)) + mlx4_check_pcie_caps(dev); + /* In master functions, the communication channel must be initialized * after obtaining its address from fw */ if (mlx4_is_master(dev)) { + if (dev->caps.num_ports < 2 && + num_vfs_argc > 1) { + err = -EINVAL; + mlx4_err(dev, + "Error: Trying to configure VFs on port 2, but HCA has only %d physical ports\n", + dev->caps.num_ports); + goto err_close; + } + memcpy(dev->persist->nvfs, nvfs, sizeof(dev->persist->nvfs)); + + for (i = 0; + i < sizeof(dev->persist->nvfs)/ + sizeof(dev->persist->nvfs[0]); i++) { + unsigned j; + + for (j = 0; j < dev->persist->nvfs[i]; ++sum, ++j) { + dev->dev_vfs[sum].min_port = i < 2 ? i + 1 : 1; + dev->dev_vfs[sum].n_ports = i < 2 ? 1 : + dev->caps.num_ports; + } + } + + /* In master functions, the communication channel + * must be initialized after obtaining its address from fw + */ err = mlx4_multi_func_init(dev); if (err) { - mlx4_err(dev, "Failed to init master mfunc" - "interface, aborting.\n"); + mlx4_err(dev, "Failed to init master mfunc interface, aborting.\n"); goto err_close; } } @@ -3421,29 +3451,21 @@ static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data) if (err) goto err_master_mfunc; - priv->msix_ctl.pool_bm = 0; + bitmap_zero(priv->msix_ctl.pool_bm, MAX_MSIX); mutex_init(&priv->msix_ctl.pool_lock); mlx4_enable_msi_x(dev); - - /* no MSIX and no shared IRQ */ - if (!dev->caps.num_comp_vectors && !dev->caps.comp_pool) { - err = -ENOSPC; - goto err_free_eq; - } - if ((mlx4_is_mfunc(dev)) && !(dev->flags & MLX4_FLAG_MSI_X)) { err = -ENOSYS; - mlx4_err(dev, "INTx is not supported in multi-function mode." - " aborting.\n"); + mlx4_err(dev, "INTx is not supported in multi-function mode, aborting\n"); goto err_free_eq; } if (!mlx4_is_slave(dev)) { err = mlx4_init_steering(dev); if (err) - goto err_free_eq; + goto err_disable_msix; } mlx4_init_quotas(dev); @@ -3453,7 +3475,6 @@ static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data) !mlx4_is_mfunc(dev)) { dev->flags &= ~MLX4_FLAG_MSI_X; dev->caps.num_comp_vectors = 1; - dev->caps.comp_pool = 0; pci_disable_msix(pdev); err = mlx4_setup_hca(dev); } @@ -3461,7 +3482,17 @@ static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data) if (err) goto err_steer; - mlx4_init_hca_info(dev); + /* When PF resources are ready arm its comm channel to enable + * getting commands + */ + if (mlx4_is_master(dev)) { + err = mlx4_ARM_COMM_CHANNEL(dev); + if (err) { + mlx4_err(dev, " Failed to arm comm channel eq: %x\n", + err); + goto err_steer; + } + } for (port = 1; port <= dev->caps.num_ports; port++) { err = mlx4_init_port_info(dev, port); @@ -3469,6 +3500,9 @@ static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data) goto err_port; } + priv->v2p.port1 = 1; + priv->v2p.port2 = 2; + err = mlx4_register_device(dev); if (err) goto err_port; @@ -3478,9 +3512,12 @@ static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data) mlx4_sense_init(dev); mlx4_start_sense(dev); - priv->pci_dev_data = pci_dev_data; - pci_set_drvdata(pdev, dev); + priv->removed = 0; + if (mlx4_is_master(dev) && dev->persist->num_vfs && !reset_flow) + atomic_dec(&pf_loading); + + kfree(dev_cap); return 0; err_port: @@ -3503,6 +3540,10 @@ static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data) if (!mlx4_is_slave(dev)) mlx4_clear_steering(dev); +err_disable_msix: + if (dev->flags & MLX4_FLAG_MSI_X) + pci_disable_msix(pdev); + err_free_eq: mlx4_free_eq_table(dev); @@ -3513,6 +3554,7 @@ static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data) } if (mlx4_is_slave(dev)) { + kfree(dev->caps.qp0_qkey); kfree(dev->caps.qp0_tunnel); kfree(dev->caps.qp0_proxy); kfree(dev->caps.qp1_tunnel); @@ -3520,118 +3562,354 @@ static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data) } err_close: - if (dev->flags & MLX4_FLAG_MSI_X) - pci_disable_msix(pdev); - mlx4_close_hca(dev); +err_fw: + mlx4_close_fw(dev); + err_mfunc: if (mlx4_is_slave(dev)) mlx4_multi_func_cleanup(dev); err_cmd: - mlx4_cmd_cleanup(dev); + mlx4_cmd_cleanup(dev, MLX4_CMD_CLEANUP_ALL); err_sriov: - if (dev->flags & MLX4_FLAG_SRIOV) + if (dev->flags & MLX4_FLAG_SRIOV && !existing_vfs) { pci_disable_sriov(pdev); + dev->flags &= ~MLX4_FLAG_SRIOV; + } + + if (mlx4_is_master(dev) && dev->persist->num_vfs && !reset_flow) + atomic_dec(&pf_loading); + + kfree(priv->dev.dev_vfs); if (!mlx4_is_slave(dev)) mlx4_free_ownership(dev); -err_free_dev: - kfree(priv); + kfree(dev_cap); + return err; +} + +static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data, + struct mlx4_priv *priv) +{ + int err; + int nvfs[MLX4_MAX_PORTS + 1] = {0, 0, 0}; + int prb_vf[MLX4_MAX_PORTS + 1] = {0, 0, 0}; + const int param_map[MLX4_MAX_PORTS + 1][MLX4_MAX_PORTS + 1] = { + {2, 0, 0}, {0, 1, 2}, {0, 1, 2} }; + unsigned total_vfs = 0; + unsigned int i; + + pr_info(DRV_NAME ": Initializing %s\n", pci_name(pdev)); + + err = mlx4_pci_enable_device(&priv->dev); + if (err) { + dev_err(&pdev->dev, "Cannot enable PCI device, aborting\n"); + return err; + } + + /* Due to requirement that all VFs and the PF are *guaranteed* 2 MACS + * per port, we must limit the number of VFs to 63 (since their are + * 128 MACs) + */ + for (i = 0; i < sizeof(nvfs)/sizeof(nvfs[0]) && i < num_vfs_argc; + total_vfs += nvfs[param_map[num_vfs_argc - 1][i]], i++) { + nvfs[param_map[num_vfs_argc - 1][i]] = num_vfs[i]; + if (nvfs[i] < 0) { + dev_err(&pdev->dev, "num_vfs module parameter cannot be negative\n"); + err = -EINVAL; + goto err_disable_pdev; + } + } + for (i = 0; i < sizeof(prb_vf)/sizeof(prb_vf[0]) && i < probe_vfs_argc; + i++) { + prb_vf[param_map[probe_vfs_argc - 1][i]] = probe_vf[i]; + if (prb_vf[i] < 0 || prb_vf[i] > nvfs[i]) { + dev_err(&pdev->dev, "probe_vf module parameter cannot be negative or greater than num_vfs\n"); + err = -EINVAL; + goto err_disable_pdev; + } + } + if (total_vfs > MLX4_MAX_NUM_VF) { + dev_err(&pdev->dev, + "Requested more VF's (%d) than allowed by hw (%d)\n", + total_vfs, MLX4_MAX_NUM_VF); + err = -EINVAL; + goto err_disable_pdev; + } + + for (i = 0; i < MLX4_MAX_PORTS; i++) { + if (nvfs[i] + nvfs[2] > MLX4_MAX_NUM_VF_P_PORT) { + dev_err(&pdev->dev, + "Requested more VF's (%d) for port (%d) than allowed by driver (%d)\n", + nvfs[i] + nvfs[2], i + 1, + MLX4_MAX_NUM_VF_P_PORT); + err = -EINVAL; + goto err_disable_pdev; + } + } + + /* Check for BARs. */ + if (!(pci_dev_data & MLX4_PCI_DEV_IS_VF) && + !(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { + dev_err(&pdev->dev, "Missing DCS, aborting (driver_data: 0x%x, pci_resource_flags(pdev, 0):0x%lx)\n", + pci_dev_data, (long)pci_resource_flags(pdev, 0)); + err = -ENODEV; + goto err_disable_pdev; + } + if (!(pci_resource_flags(pdev, 2) & IORESOURCE_MEM)) { + dev_err(&pdev->dev, "Missing UAR, aborting\n"); + err = -ENODEV; + goto err_disable_pdev; + } + + err = pci_request_regions(pdev, DRV_NAME); + if (err) { + dev_err(&pdev->dev, "Couldn't get PCI resources, aborting\n"); + goto err_disable_pdev; + } + + pci_set_master(pdev); + + err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64)); + if (err) { + dev_warn(&pdev->dev, "Warning: couldn't set 64-bit PCI DMA mask\n"); + err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); + if (err) { + dev_err(&pdev->dev, "Can't set PCI DMA mask, aborting\n"); + goto err_release_regions; + } + } + err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); + if (err) { + dev_warn(&pdev->dev, "Warning: couldn't set 64-bit consistent PCI DMA mask\n"); + err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); + if (err) { + dev_err(&pdev->dev, "Can't set consistent PCI DMA mask, aborting\n"); + goto err_release_regions; + } + } + + /* Allow large DMA segments, up to the firmware limit of 1 GB */ + dma_set_max_seg_size(&pdev->dev, 1024 * 1024 * 1024); + /* Detect if this device is a virtual function */ + if (pci_dev_data & MLX4_PCI_DEV_IS_VF) { + /* When acting as pf, we normally skip vfs unless explicitly + * requested to probe them. + */ + if (total_vfs) { + unsigned vfs_offset = 0; + + for (i = 0; i < sizeof(nvfs)/sizeof(nvfs[0]) && + vfs_offset + nvfs[i] < extended_func_num(pdev); + vfs_offset += nvfs[i], i++) + ; + if (i == sizeof(nvfs)/sizeof(nvfs[0])) { + err = -ENODEV; + goto err_release_regions; + } + if ((extended_func_num(pdev) - vfs_offset) + > prb_vf[i]) { + dev_warn(&pdev->dev, "Skipping virtual function:%d\n", + extended_func_num(pdev)); + err = -ENODEV; + goto err_release_regions; + } + } + } + + err = mlx4_catas_init(&priv->dev); + if (err) + goto err_release_regions; + + err = mlx4_load_one(pdev, pci_dev_data, total_vfs, nvfs, priv, 0); + if (err) + goto err_catas; + + return 0; + +err_catas: + mlx4_catas_end(&priv->dev); err_release_regions: pci_release_regions(pdev); err_disable_pdev: - pci_disable_device(pdev); + mlx4_pci_disable_device(&priv->dev); pci_set_drvdata(pdev, NULL); return err; } -static int __devinit mlx4_init_one(struct pci_dev *pdev, - const struct pci_device_id *id) +static int mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id) { - device_set_desc(pdev->dev.bsddev, mlx4_version); - return __mlx4_init_one(pdev, id->driver_data); + struct mlx4_priv *priv; + struct mlx4_dev *dev; + int ret; + + printk_once(KERN_INFO "%s", mlx4_version); + + priv = kzalloc(sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + dev = &priv->dev; + dev->persist = kzalloc(sizeof(*dev->persist), GFP_KERNEL); + if (!dev->persist) { + kfree(priv); + return -ENOMEM; + } + dev->persist->pdev = pdev; + dev->persist->dev = dev; + pci_set_drvdata(pdev, dev->persist); + priv->pci_dev_data = id->driver_data; + mutex_init(&dev->persist->device_state_mutex); + mutex_init(&dev->persist->interface_state_mutex); + mutex_init(&dev->persist->pci_status_mutex); + + ret = __mlx4_init_one(pdev, id->driver_data, priv); + if (ret) { + kfree(dev->persist); + kfree(priv); + } else { + pci_save_state(pdev->dev.bsddev); + } + + return ret; +} + +static void mlx4_clean_dev(struct mlx4_dev *dev) +{ + struct mlx4_dev_persistent *persist = dev->persist; + struct mlx4_priv *priv = mlx4_priv(dev); + unsigned long flags = (dev->flags & RESET_PERSIST_MASK_FLAGS); + + memset(priv, 0, sizeof(*priv)); + priv->dev.persist = persist; + priv->dev.flags = flags; +} + +static void mlx4_unload_one(struct pci_dev *pdev) +{ + struct mlx4_dev_persistent *persist = pci_get_drvdata(pdev); + struct mlx4_dev *dev = persist->dev; + struct mlx4_priv *priv = mlx4_priv(dev); + int pci_dev_data; + int p, i; + + if (priv->removed) + return; + + /* saving current ports type for further use */ + for (i = 0; i < dev->caps.num_ports; i++) { + dev->persist->curr_port_type[i] = dev->caps.port_type[i + 1]; + dev->persist->curr_port_poss_type[i] = dev->caps. + possible_type[i + 1]; + } + + pci_dev_data = priv->pci_dev_data; + + mlx4_stop_sense(dev); + mlx4_unregister_device(dev); + + for (p = 1; p <= dev->caps.num_ports; p++) { + mlx4_cleanup_port_info(&priv->port[p]); + mlx4_CLOSE_PORT(dev, p); + } + + if (mlx4_is_master(dev)) + mlx4_free_resource_tracker(dev, + RES_TR_FREE_SLAVES_ONLY); + + mlx4_cleanup_default_counters(dev); + if (!mlx4_is_slave(dev)) + mlx4_cleanup_counters_table(dev); + mlx4_cleanup_qp_table(dev); + mlx4_cleanup_srq_table(dev); + mlx4_cleanup_cq_table(dev); + mlx4_cmd_use_polling(dev); + mlx4_cleanup_eq_table(dev); + mlx4_cleanup_mcg_table(dev); + mlx4_cleanup_mr_table(dev); + mlx4_cleanup_xrcd_table(dev); + mlx4_cleanup_pd_table(dev); + + if (mlx4_is_master(dev)) + mlx4_free_resource_tracker(dev, + RES_TR_FREE_STRUCTS_ONLY); + + iounmap(priv->kar); + mlx4_uar_free(dev, &priv->driver_uar); + mlx4_cleanup_uar_table(dev); + if (!mlx4_is_slave(dev)) + mlx4_clear_steering(dev); + mlx4_free_eq_table(dev); + if (mlx4_is_master(dev)) + mlx4_multi_func_cleanup(dev); + mlx4_close_hca(dev); + mlx4_close_fw(dev); + if (mlx4_is_slave(dev)) + mlx4_multi_func_cleanup(dev); + mlx4_cmd_cleanup(dev, MLX4_CMD_CLEANUP_ALL); + + if (dev->flags & MLX4_FLAG_MSI_X) + pci_disable_msix(pdev); + + if (!mlx4_is_slave(dev)) + mlx4_free_ownership(dev); + + kfree(dev->caps.qp0_qkey); + kfree(dev->caps.qp0_tunnel); + kfree(dev->caps.qp0_proxy); + kfree(dev->caps.qp1_tunnel); + kfree(dev->caps.qp1_proxy); + kfree(dev->dev_vfs); + + mlx4_clean_dev(dev); + priv->pci_dev_data = pci_dev_data; + priv->removed = 1; } static void mlx4_remove_one(struct pci_dev *pdev) { - struct mlx4_dev *dev = pci_get_drvdata(pdev); + struct mlx4_dev_persistent *persist = pci_get_drvdata(pdev); + struct mlx4_dev *dev = persist->dev; struct mlx4_priv *priv = mlx4_priv(dev); - int p; + int active_vfs = 0; - if (dev) { - /* in SRIOV it is not allowed to unload the pf's - * driver while there are alive vf's */ - if (mlx4_is_master(dev)) { - if (mlx4_how_many_lives_vf(dev)) - mlx4_err(dev, "Removing PF when there are assigned VF's !!!\n"); + mutex_lock(&persist->interface_state_mutex); + persist->interface_state |= MLX4_INTERFACE_STATE_DELETION; + mutex_unlock(&persist->interface_state_mutex); + + /* Disabling SR-IOV is not allowed while there are active vf's */ + if (mlx4_is_master(dev) && dev->flags & MLX4_FLAG_SRIOV) { + active_vfs = mlx4_how_many_lives_vf(dev); + if (active_vfs) { + pr_warn("Removing PF when there are active VF's !!\n"); + pr_warn("Will not disable SR-IOV.\n"); } - mlx4_stop_sense(dev); - mlx4_unregister_device(dev); - - mlx4_cleanup_hca_info(&priv->hca_info); - for (p = 1; p <= dev->caps.num_ports; p++) { - mlx4_cleanup_port_info(&priv->port[p]); - mlx4_CLOSE_PORT(dev, p); - } - - if (mlx4_is_master(dev)) - mlx4_free_resource_tracker(dev, - RES_TR_FREE_SLAVES_ONLY); - - mlx4_cleanup_counters_table(dev); - mlx4_cleanup_qp_table(dev); - mlx4_cleanup_srq_table(dev); - mlx4_cleanup_cq_table(dev); - mlx4_cmd_use_polling(dev); - mlx4_cleanup_eq_table(dev); - mlx4_cleanup_mcg_table(dev); - mlx4_cleanup_mr_table(dev); - mlx4_cleanup_xrcd_table(dev); - mlx4_cleanup_pd_table(dev); - - if (mlx4_is_master(dev)) - mlx4_free_resource_tracker(dev, - RES_TR_FREE_STRUCTS_ONLY); - - iounmap(priv->kar); - mlx4_uar_free(dev, &priv->driver_uar); - mlx4_cleanup_uar_table(dev); - if (!mlx4_is_slave(dev)) - mlx4_clear_steering(dev); - mlx4_free_eq_table(dev); - if (mlx4_is_master(dev)) - mlx4_multi_func_cleanup(dev); - mlx4_close_hca(dev); - if (mlx4_is_slave(dev)) - mlx4_multi_func_cleanup(dev); - mlx4_cmd_cleanup(dev); - - if (dev->flags & MLX4_FLAG_MSI_X) - pci_disable_msix(pdev); - if (dev->flags & MLX4_FLAG_SRIOV) { - mlx4_warn(dev, "Disabling SR-IOV\n"); - pci_disable_sriov(pdev); - } - - if (!mlx4_is_slave(dev)) - mlx4_free_ownership(dev); - - kfree(dev->caps.qp0_tunnel); - kfree(dev->caps.qp0_proxy); - kfree(dev->caps.qp1_tunnel); - kfree(dev->caps.qp1_proxy); - - kfree(priv); - pci_release_regions(pdev); - pci_disable_device(pdev); - pci_set_drvdata(pdev, NULL); } + + /* device marked to be under deletion running now without the lock + * letting other tasks to be terminated + */ + if (persist->interface_state & MLX4_INTERFACE_STATE_UP) + mlx4_unload_one(pdev); + else + mlx4_info(dev, "%s: interface is down\n", __func__); + mlx4_catas_end(dev); + if (dev->flags & MLX4_FLAG_SRIOV && !active_vfs) { + mlx4_warn(dev, "Disabling SR-IOV\n"); + pci_disable_sriov(pdev); + } + + pci_release_regions(pdev); + pci_disable_device(pdev); + kfree(dev->persist); + kfree(priv); + pci_set_drvdata(pdev, NULL); } static int restore_current_port_types(struct mlx4_dev *dev, @@ -3642,40 +3920,45 @@ static int restore_current_port_types(struct mlx4_dev *dev, int err, i; mlx4_stop_sense(dev); + mutex_lock(&priv->port_mutex); for (i = 0; i < dev->caps.num_ports; i++) dev->caps.possible_type[i + 1] = poss_types[i]; err = mlx4_change_port_types(dev, types); - mlx4_start_sense(dev); mutex_unlock(&priv->port_mutex); + + mlx4_start_sense(dev); + return err; } int mlx4_restart_one(struct pci_dev *pdev) { - struct mlx4_dev *dev = pci_get_drvdata(pdev); + struct mlx4_dev_persistent *persist = pci_get_drvdata(pdev); + struct mlx4_dev *dev = persist->dev; struct mlx4_priv *priv = mlx4_priv(dev); - enum mlx4_port_type curr_type[MLX4_MAX_PORTS]; - enum mlx4_port_type poss_type[MLX4_MAX_PORTS]; - int pci_dev_data, err, i; + int nvfs[MLX4_MAX_PORTS + 1] = {0, 0, 0}; + int pci_dev_data, err, total_vfs; pci_dev_data = priv->pci_dev_data; - for (i = 0; i < dev->caps.num_ports; i++) { - curr_type[i] = dev->caps.port_type[i + 1]; - poss_type[i] = dev->caps.possible_type[i + 1]; + total_vfs = dev->persist->num_vfs; + memcpy(nvfs, dev->persist->nvfs, sizeof(dev->persist->nvfs)); + + mlx4_unload_one(pdev); + err = mlx4_load_one(pdev, pci_dev_data, total_vfs, nvfs, priv, 1); + if (err) { + mlx4_err(dev, "%s: ERROR: mlx4_load_one failed, pci_name=%s, err=%d\n", + __func__, pci_name(pdev), err); + return err; } - mlx4_remove_one(pdev); - err = __mlx4_init_one(pdev, pci_dev_data); + err = restore_current_port_types(dev, dev->persist->curr_port_type, + dev->persist->curr_port_poss_type); if (err) - return err; - - dev = pci_get_drvdata(pdev); - err = restore_current_port_types(dev, curr_type, poss_type); - if (err) - mlx4_err(dev, "mlx4_restart_one: could not restore original port types (%d)\n", + mlx4_err(dev, "could not restore original port types (%d)\n", err); - return 0; + + return err; } static DEFINE_PCI_DEVICE_TABLE(mlx4_pci_table) = { @@ -3743,143 +4026,137 @@ MODULE_DEVICE_TABLE(pci, mlx4_pci_table); static pci_ers_result_t mlx4_pci_err_detected(struct pci_dev *pdev, pci_channel_state_t state) { - mlx4_remove_one(pdev); + struct mlx4_dev_persistent *persist = pci_get_drvdata(pdev); - return state == pci_channel_io_perm_failure ? - PCI_ERS_RESULT_DISCONNECT : PCI_ERS_RESULT_NEED_RESET; + mlx4_err(persist->dev, "mlx4_pci_err_detected was called\n"); + mlx4_enter_error_state(persist); + + mutex_lock(&persist->interface_state_mutex); + if (persist->interface_state & MLX4_INTERFACE_STATE_UP) + mlx4_unload_one(pdev); + + mutex_unlock(&persist->interface_state_mutex); + if (state == pci_channel_io_perm_failure) + return PCI_ERS_RESULT_DISCONNECT; + + mlx4_pci_disable_device(persist->dev); + return PCI_ERS_RESULT_NEED_RESET; } static pci_ers_result_t mlx4_pci_slot_reset(struct pci_dev *pdev) { - int ret = __mlx4_init_one(pdev, 0); + struct mlx4_dev_persistent *persist = pci_get_drvdata(pdev); + struct mlx4_dev *dev = persist->dev; + int err; - return ret ? PCI_ERS_RESULT_DISCONNECT : PCI_ERS_RESULT_RECOVERED; + mlx4_err(dev, "mlx4_pci_slot_reset was called\n"); + err = mlx4_pci_enable_device(dev); + if (err) { + mlx4_err(dev, "Can not re-enable device, err=%d\n", err); + return PCI_ERS_RESULT_DISCONNECT; + } + + pci_set_master(pdev); + return PCI_ERS_RESULT_RECOVERED; +} + +static void mlx4_pci_resume(struct pci_dev *pdev) +{ + struct mlx4_dev_persistent *persist = pci_get_drvdata(pdev); + struct mlx4_dev *dev = persist->dev; + struct mlx4_priv *priv = mlx4_priv(dev); + int nvfs[MLX4_MAX_PORTS + 1] = {0, 0, 0}; + int total_vfs; + int err; + + mlx4_err(dev, "%s was called\n", __func__); + total_vfs = dev->persist->num_vfs; + memcpy(nvfs, dev->persist->nvfs, sizeof(dev->persist->nvfs)); + + mutex_lock(&persist->interface_state_mutex); + if (!(persist->interface_state & MLX4_INTERFACE_STATE_UP)) { + err = mlx4_load_one(pdev, priv->pci_dev_data, total_vfs, nvfs, + priv, 1); + if (err) { + mlx4_err(dev, "%s: mlx4_load_one failed, err=%d\n", + __func__, err); + goto end; + } + + err = restore_current_port_types(dev, dev->persist-> + curr_port_type, dev->persist-> + curr_port_poss_type); + if (err) + mlx4_err(dev, "could not restore original port types (%d)\n", err); + } +end: + mutex_unlock(&persist->interface_state_mutex); + +} + +static void mlx4_shutdown(struct pci_dev *pdev) +{ + struct mlx4_dev_persistent *persist = pci_get_drvdata(pdev); + + mlx4_info(persist->dev, "mlx4_shutdown was called\n"); + mutex_lock(&persist->interface_state_mutex); + if (persist->interface_state & MLX4_INTERFACE_STATE_UP) + mlx4_unload_one(pdev); + mutex_unlock(&persist->interface_state_mutex); } static const struct pci_error_handlers mlx4_err_handler = { .error_detected = mlx4_pci_err_detected, .slot_reset = mlx4_pci_slot_reset, + .resume = mlx4_pci_resume, }; -static int suspend(struct pci_dev *pdev, pm_message_t state) -{ - mlx4_remove_one(pdev); - - return 0; -} - -static int resume(struct pci_dev *pdev) -{ - return __mlx4_init_one(pdev, 0); -} - static struct pci_driver mlx4_driver = { .name = DRV_NAME, .id_table = mlx4_pci_table, .probe = mlx4_init_one, - .remove = __devexit_p(mlx4_remove_one), - .suspend = suspend, - .resume = resume, + .shutdown = mlx4_shutdown, + .remove = mlx4_remove_one, .err_handler = &mlx4_err_handler, }; static int __init mlx4_verify_params(void) { - int status; - - status = update_defaults(&port_type_array); - if (status == INVALID_STR) { - if (mlx4_fill_dbdf2val_tbl(&port_type_array.dbdf2val)) - return -1; - } else if (status == INVALID_DATA) { - return -1; - } - - status = update_defaults(&num_vfs); - if (status == INVALID_STR) { - if (mlx4_fill_dbdf2val_tbl(&num_vfs.dbdf2val)) - return -1; - } else if (status == INVALID_DATA) { - return -1; - } - - status = update_defaults(&probe_vf); - if (status == INVALID_STR) { - if (mlx4_fill_dbdf2val_tbl(&probe_vf.dbdf2val)) - return -1; - } else if (status == INVALID_DATA) { - return -1; - } - - if (msi_x < 0) { - pr_warn("mlx4_core: bad msi_x: %d\n", msi_x); - return -1; - } - if ((log_num_mac < 0) || (log_num_mac > 7)) { - pr_warning("mlx4_core: bad num_mac: %d\n", log_num_mac); + pr_warn("mlx4_core: bad num_mac: %d\n", log_num_mac); return -1; } if (log_num_vlan != 0) - pr_warning("mlx4_core: log_num_vlan - obsolete module param, using %d\n", - MLX4_LOG_NUM_VLANS); + pr_warn("mlx4_core: log_num_vlan - obsolete module param, using %d\n", + MLX4_LOG_NUM_VLANS); - if (mlx4_set_4k_mtu != -1) - pr_warning("mlx4_core: set_4k_mtu - obsolete module param\n"); + if (use_prio != 0) + pr_warn("mlx4_core: use_prio - obsolete module param, ignored\n"); - if ((log_mtts_per_seg < 0) || (log_mtts_per_seg > 7)) { - pr_warning("mlx4_core: bad log_mtts_per_seg: %d\n", log_mtts_per_seg); + if ((log_mtts_per_seg < 1) || (log_mtts_per_seg > 7)) { + pr_warn("mlx4_core: bad log_mtts_per_seg: %d\n", + log_mtts_per_seg); return -1; } - if (mlx4_log_num_mgm_entry_size != -1 && - (mlx4_log_num_mgm_entry_size < MLX4_MIN_MGM_LOG_ENTRY_SIZE || - mlx4_log_num_mgm_entry_size > MLX4_MAX_MGM_LOG_ENTRY_SIZE)) { - pr_warning("mlx4_core: mlx4_log_num_mgm_entry_size (%d) not " - "in legal range (-1 or %d..%d)\n", - mlx4_log_num_mgm_entry_size, - MLX4_MIN_MGM_LOG_ENTRY_SIZE, - MLX4_MAX_MGM_LOG_ENTRY_SIZE); + /* Check if module param for ports type has legal combination */ + if (port_type_array[0] == false && port_type_array[1] == true) { + pr_warn("Module parameter configuration ETH/IB is not supported. Switching to default configuration IB/IB\n"); + port_type_array[0] = true; + } + + if (mlx4_log_num_mgm_entry_size < -7 || + (mlx4_log_num_mgm_entry_size > 0 && + (mlx4_log_num_mgm_entry_size < MLX4_MIN_MGM_LOG_ENTRY_SIZE || + mlx4_log_num_mgm_entry_size > MLX4_MAX_MGM_LOG_ENTRY_SIZE))) { + pr_warn("mlx4_core: mlx4_log_num_mgm_entry_size (%d) not in legal range (-7..0 or %d..%d)\n", + mlx4_log_num_mgm_entry_size, + MLX4_MIN_MGM_LOG_ENTRY_SIZE, + MLX4_MAX_MGM_LOG_ENTRY_SIZE); return -1; } - if (mod_param_profile.num_qp < 18 || mod_param_profile.num_qp > 23) { - pr_warning("mlx4_core: bad log_num_qp: %d\n", - mod_param_profile.num_qp); - return -1; - } - - if (mod_param_profile.num_srq < 10) { - pr_warning("mlx4_core: too low log_num_srq: %d\n", - mod_param_profile.num_srq); - return -1; - } - - if (mod_param_profile.num_cq < 10) { - pr_warning("mlx4_core: too low log_num_cq: %d\n", - mod_param_profile.num_cq); - return -1; - } - - if (mod_param_profile.num_mpt < 10) { - pr_warning("mlx4_core: too low log_num_mpt: %d\n", - mod_param_profile.num_mpt); - return -1; - } - - if (mod_param_profile.num_mtt_segs && - mod_param_profile.num_mtt_segs < 15) { - pr_warning("mlx4_core: too low log_num_mtt: %d\n", - mod_param_profile.num_mtt_segs); - return -1; - } - - if (mod_param_profile.num_mtt_segs > MLX4_MAX_LOG_NUM_MTT) { - pr_warning("mlx4_core: too high log_num_mtt: %d\n", - mod_param_profile.num_mtt_segs); - return -1; - } return 0; } @@ -3890,40 +4167,24 @@ static int __init mlx4_init(void) if (mlx4_verify_params()) return -EINVAL; - mlx4_catas_init(); mlx4_wq = create_singlethread_workqueue("mlx4"); if (!mlx4_wq) return -ENOMEM; - if (enable_sys_tune) - sys_tune_init(); - ret = pci_register_driver(&mlx4_driver); if (ret < 0) - goto err; - - return 0; - -err: - if (enable_sys_tune) - sys_tune_fini(); - - destroy_workqueue(mlx4_wq); - - return ret; + destroy_workqueue(mlx4_wq); + return ret < 0 ? ret : 0; } static void __exit mlx4_cleanup(void) { - if (enable_sys_tune) - sys_tune_fini(); - pci_unregister_driver(&mlx4_driver); destroy_workqueue(mlx4_wq); } -module_init_order(mlx4_init, SI_ORDER_MIDDLE); +module_init(mlx4_init); module_exit(mlx4_cleanup); static int diff --git a/sys/dev/mlx4/mlx4_core/mlx4_mcg.c b/sys/dev/mlx4/mlx4_core/mlx4_mcg.c index 846daa99c634..d202b77f69c3 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_mcg.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_mcg.c @@ -323,15 +323,14 @@ static bool check_duplicate_entry(struct mlx4_dev *dev, u8 port, return true; } -/* - * returns true if all the QPs != tqpn contained in this entry - * are Promisc QPs. return false otherwise. +/* Returns true if all the QPs != tqpn contained in this entry + * are Promisc QPs. Returns false otherwise. */ static bool promisc_steering_entry(struct mlx4_dev *dev, u8 port, - enum mlx4_steer_type steer, - unsigned int index, u32 tqpn, u32 *members_count) + enum mlx4_steer_type steer, + unsigned int index, u32 tqpn, + u32 *members_count) { - struct mlx4_steer *s_steer; struct mlx4_cmd_mailbox *mailbox; struct mlx4_mgm *mgm; u32 m_count; @@ -341,8 +340,6 @@ static bool promisc_steering_entry(struct mlx4_dev *dev, u8 port, if (port < 1 || port > dev->caps.num_ports) return false; - s_steer = &mlx4_priv(dev)->steer[port - 1]; - mailbox = mlx4_alloc_cmd_mailbox(dev); if (IS_ERR(mailbox)) return false; @@ -382,7 +379,8 @@ static bool can_remove_steering_entry(struct mlx4_dev *dev, u8 port, s_steer = &mlx4_priv(dev)->steer[port - 1]; - if (!promisc_steering_entry(dev, port, steer, index, tqpn, &members_count)) + if (!promisc_steering_entry(dev, port, steer, index, + tqpn, &members_count)) goto out; /* All the qps currently registered for this entry are promiscuous, @@ -390,10 +388,10 @@ static bool can_remove_steering_entry(struct mlx4_dev *dev, u8 port, ret = true; list_for_each_entry_safe(entry, tmp_entry, &s_steer->steer_entries[steer], list) { if (entry->index == index) { - if (list_empty(&entry->duplicates) || members_count == 1) { + if (list_empty(&entry->duplicates) || + members_count == 1) { struct mlx4_promisc_qp *pqp, *tmp_pqp; - /* - * If there is only 1 entry in duplicates than + /* If there is only 1 entry in duplicates then * this is the QP we want to delete, going over * the list and deleting the entry. */ @@ -460,40 +458,53 @@ static int add_promisc_qp(struct mlx4_dev *dev, u8 port, mgm = mailbox->buf; if (!(mlx4_is_mfunc(dev) && steer == MLX4_UC_STEER)) { - /* the promisc qp needs to be added for each one of the steering - * entries, if it already exists, needs to be added as a duplicate - * for this entry */ - list_for_each_entry(entry, &s_steer->steer_entries[steer], list) { + /* The promisc QP needs to be added for each one of the steering + * entries. If it already exists, needs to be added as + * a duplicate for this entry. + */ + list_for_each_entry(entry, + &s_steer->steer_entries[steer], + list) { err = mlx4_READ_ENTRY(dev, entry->index, mailbox); if (err) goto out_mailbox; - members_count = be32_to_cpu(mgm->members_count) & 0xffffff; + members_count = be32_to_cpu(mgm->members_count) & + 0xffffff; prot = be32_to_cpu(mgm->members_count) >> 30; found = false; for (i = 0; i < members_count; i++) { - if ((be32_to_cpu(mgm->qp[i]) & MGM_QPN_MASK) == qpn) { - /* Entry already exists, add to duplicates */ - dqp = kmalloc(sizeof *dqp, GFP_KERNEL); + if ((be32_to_cpu(mgm->qp[i]) & + MGM_QPN_MASK) == qpn) { + /* Entry already exists. + * Add to duplicates. + */ + dqp = kmalloc(sizeof(*dqp), GFP_KERNEL); if (!dqp) { err = -ENOMEM; goto out_mailbox; } dqp->qpn = qpn; - list_add_tail(&dqp->list, &entry->duplicates); + list_add_tail(&dqp->list, + &entry->duplicates); found = true; } } if (!found) { /* Need to add the qpn to mgm */ - if (members_count == dev->caps.num_qp_per_mgm) { + if (members_count == + dev->caps.num_qp_per_mgm) { /* entry is full */ err = -ENOMEM; goto out_mailbox; } - mgm->qp[members_count++] = cpu_to_be32(qpn & MGM_QPN_MASK); - mgm->members_count = cpu_to_be32(members_count | (prot << 30)); - err = mlx4_WRITE_ENTRY(dev, entry->index, mailbox); + mgm->qp[members_count++] = + cpu_to_be32(qpn & MGM_QPN_MASK); + mgm->members_count = + cpu_to_be32(members_count | + (prot << 30)); + err = mlx4_WRITE_ENTRY(dev, entry->index, + mailbox); if (err) goto out_mailbox; } @@ -547,7 +558,7 @@ static int remove_promisc_qp(struct mlx4_dev *dev, u8 port, u32 members_count; bool found; bool back_to_list = false; - int i, loc = -1; + int i; int err; if (port < 1 || port > dev->caps.num_ports) @@ -575,7 +586,6 @@ static int remove_promisc_qp(struct mlx4_dev *dev, u8 port, goto out_list; } mgm = mailbox->buf; - memset(mgm, 0, sizeof *mgm); members_count = 0; list_for_each_entry(dqp, &s_steer->promisc_qps[steer], list) mgm->qp[members_count++] = cpu_to_be32(dqp->qpn & MGM_QPN_MASK); @@ -586,8 +596,10 @@ static int remove_promisc_qp(struct mlx4_dev *dev, u8 port, goto out_mailbox; if (!(mlx4_is_mfunc(dev) && steer == MLX4_UC_STEER)) { - /* remove the qp from all the steering entries*/ - list_for_each_entry_safe(entry, tmp_entry, &s_steer->steer_entries[steer], list) { + /* Remove the QP from all the steering entries */ + list_for_each_entry_safe(entry, tmp_entry, + &s_steer->steer_entries[steer], + list) { found = false; list_for_each_entry(dqp, &entry->duplicates, list) { if (dqp->qpn == qpn) { @@ -596,25 +608,33 @@ static int remove_promisc_qp(struct mlx4_dev *dev, u8 port, } } if (found) { - /* a duplicate, no need to change the mgm, - * only update the duplicates list */ + /* A duplicate, no need to change the MGM, + * only update the duplicates list + */ list_del(&dqp->list); kfree(dqp); } else { - err = mlx4_READ_ENTRY(dev, entry->index, mailbox); - if (err) - goto out_mailbox; - members_count = be32_to_cpu(mgm->members_count) & 0xffffff; + int loc = -1; + + err = mlx4_READ_ENTRY(dev, + entry->index, + mailbox); + if (err) + goto out_mailbox; + members_count = + be32_to_cpu(mgm->members_count) & + 0xffffff; if (!members_count) { - mlx4_warn(dev, "QP %06x wasn't found in entry %x mcount=0." - " deleting entry...\n", qpn, entry->index); + mlx4_warn(dev, "QP %06x wasn't found in entry %x mcount=0. deleting entry...\n", + qpn, entry->index); list_del(&entry->list); kfree(entry); continue; } for (i = 0; i < members_count; ++i) - if ((be32_to_cpu(mgm->qp[i]) & MGM_QPN_MASK) == qpn) { + if ((be32_to_cpu(mgm->qp[i]) & + MGM_QPN_MASK) == qpn) { loc = i; break; } @@ -626,15 +646,20 @@ static int remove_promisc_qp(struct mlx4_dev *dev, u8 port, goto out_mailbox; } - /* copy the last QP in this MGM over removed QP */ + /* Copy the last QP in this MGM + * over removed QP + */ mgm->qp[loc] = mgm->qp[members_count - 1]; mgm->qp[members_count - 1] = 0; - mgm->members_count = cpu_to_be32(--members_count | - (MLX4_PROT_ETH << 30)); + mgm->members_count = + cpu_to_be32(--members_count | + (MLX4_PROT_ETH << 30)); - err = mlx4_WRITE_ENTRY(dev, entry->index, mailbox); - if (err) - goto out_mailbox; + err = mlx4_WRITE_ENTRY(dev, + entry->index, + mailbox); + if (err) + goto out_mailbox; } } } @@ -706,7 +731,7 @@ static int find_entry(struct mlx4_dev *dev, u8 port, if (!(be32_to_cpu(mgm->members_count) & 0xffffff)) { if (*index != hash) { - mlx4_err(dev, "Found zero MGID in AMGM.\n"); + mlx4_err(dev, "Found zero MGID in AMGM\n"); err = -EINVAL; } return err; @@ -728,20 +753,22 @@ static const u8 __promisc_mode[] = { [MLX4_FS_REGULAR] = 0x0, [MLX4_FS_ALL_DEFAULT] = 0x1, [MLX4_FS_MC_DEFAULT] = 0x3, - [MLX4_FS_UC_SNIFFER] = 0x4, - [MLX4_FS_MC_SNIFFER] = 0x5, + [MLX4_FS_MIRROR_RX_PORT] = 0x4, + [MLX4_FS_MIRROR_SX_PORT] = 0x5, + [MLX4_FS_UC_SNIFFER] = 0x6, + [MLX4_FS_MC_SNIFFER] = 0x7, }; -int map_sw_to_hw_steering_mode(struct mlx4_dev *dev, - enum mlx4_net_trans_promisc_mode flow_type) +int mlx4_map_sw_to_hw_steering_mode(struct mlx4_dev *dev, + enum mlx4_net_trans_promisc_mode flow_type) { - if (flow_type >= MLX4_FS_MODE_NUM || flow_type < 0) { + if (flow_type >= MLX4_FS_MODE_NUM) { mlx4_err(dev, "Invalid flow type. type = %d\n", flow_type); return -EINVAL; } return __promisc_mode[flow_type]; } -EXPORT_SYMBOL_GPL(map_sw_to_hw_steering_mode); +EXPORT_SYMBOL_GPL(mlx4_map_sw_to_hw_steering_mode); static void trans_rule_ctrl_to_hw(struct mlx4_net_trans_rule *ctrl, struct mlx4_net_trans_rule_hw_ctrl *hw) @@ -765,19 +792,20 @@ const u16 __sw_id_hw[] = { [MLX4_NET_TRANS_RULE_ID_IPV6] = 0xE003, [MLX4_NET_TRANS_RULE_ID_IPV4] = 0xE002, [MLX4_NET_TRANS_RULE_ID_TCP] = 0xE004, - [MLX4_NET_TRANS_RULE_ID_UDP] = 0xE006 + [MLX4_NET_TRANS_RULE_ID_UDP] = 0xE006, + [MLX4_NET_TRANS_RULE_ID_VXLAN] = 0xE008 }; -int map_sw_to_hw_steering_id(struct mlx4_dev *dev, - enum mlx4_net_trans_rule_id id) +int mlx4_map_sw_to_hw_steering_id(struct mlx4_dev *dev, + enum mlx4_net_trans_rule_id id) { - if (id >= MLX4_NET_TRANS_RULE_NUM || id < 0) { + if (id >= MLX4_NET_TRANS_RULE_NUM) { mlx4_err(dev, "Invalid network rule id. id = %d\n", id); return -EINVAL; } return __sw_id_hw[id]; } -EXPORT_SYMBOL_GPL(map_sw_to_hw_steering_id); +EXPORT_SYMBOL_GPL(mlx4_map_sw_to_hw_steering_id); static const int __rule_hw_sz[] = { [MLX4_NET_TRANS_RULE_ID_ETH] = @@ -790,29 +818,31 @@ static const int __rule_hw_sz[] = { [MLX4_NET_TRANS_RULE_ID_TCP] = sizeof(struct mlx4_net_trans_rule_hw_tcp_udp), [MLX4_NET_TRANS_RULE_ID_UDP] = - sizeof(struct mlx4_net_trans_rule_hw_tcp_udp) + sizeof(struct mlx4_net_trans_rule_hw_tcp_udp), + [MLX4_NET_TRANS_RULE_ID_VXLAN] = + sizeof(struct mlx4_net_trans_rule_hw_vxlan) }; -int hw_rule_sz(struct mlx4_dev *dev, +int mlx4_hw_rule_sz(struct mlx4_dev *dev, enum mlx4_net_trans_rule_id id) { - if (id >= MLX4_NET_TRANS_RULE_NUM || id < 0) { + if (id >= MLX4_NET_TRANS_RULE_NUM) { mlx4_err(dev, "Invalid network rule id. id = %d\n", id); return -EINVAL; } return __rule_hw_sz[id]; } -EXPORT_SYMBOL_GPL(hw_rule_sz); +EXPORT_SYMBOL_GPL(mlx4_hw_rule_sz); static int parse_trans_rule(struct mlx4_dev *dev, struct mlx4_spec_list *spec, struct _rule_hw *rule_hw) { - if (hw_rule_sz(dev, spec->id) < 0) + if (mlx4_hw_rule_sz(dev, spec->id) < 0) return -EINVAL; - memset(rule_hw, 0, hw_rule_sz(dev, spec->id)); + memset(rule_hw, 0, mlx4_hw_rule_sz(dev, spec->id)); rule_hw->id = cpu_to_be16(__sw_id_hw[spec->id]); - rule_hw->size = hw_rule_sz(dev, spec->id) >> 2; + rule_hw->size = mlx4_hw_rule_sz(dev, spec->id) >> 2; switch (spec->id) { case MLX4_NET_TRANS_RULE_ID_ETH: @@ -855,6 +885,13 @@ static int parse_trans_rule(struct mlx4_dev *dev, struct mlx4_spec_list *spec, rule_hw->tcp_udp.src_port_msk = spec->tcp_udp.src_port_msk; break; + case MLX4_NET_TRANS_RULE_ID_VXLAN: + rule_hw->vxlan.vni = + cpu_to_be32(be32_to_cpu(spec->vxlan.vni) << 8); + rule_hw->vxlan.vni_mask = + cpu_to_be32(be32_to_cpu(spec->vxlan.vni_mask) << 8); + break; + default: return -EINVAL; } @@ -879,7 +916,10 @@ static void mlx4_err_rule(struct mlx4_dev *dev, char *str, switch (cur->id) { case MLX4_NET_TRANS_RULE_ID_ETH: len += snprintf(buf + len, BUF_SIZE - len, - "dmac = %pM ", &cur->eth.dst_mac); + "dmac = 0x%02x%02x%02x%02x%02x%02x ", + cur->eth.dst_mac[0], cur->eth.dst_mac[1], + cur->eth.dst_mac[2], cur->eth.dst_mac[3], + cur->eth.dst_mac[4], cur->eth.dst_mac[5]); if (cur->eth.ether_type) len += snprintf(buf + len, BUF_SIZE - len, "ethertype = 0x%x ", @@ -922,6 +962,10 @@ static void mlx4_err_rule(struct mlx4_dev *dev, char *str, GID_PRINT_ARGS(cur->ib.dst_gid_msk)); break; + case MLX4_NET_TRANS_RULE_ID_VXLAN: + len += snprintf(buf + len, BUF_SIZE - len, + "VNID = %d ", be32_to_cpu(cur->vxlan.vni)); + break; case MLX4_NET_TRANS_RULE_ID_IPV6: break; @@ -933,7 +977,7 @@ static void mlx4_err_rule(struct mlx4_dev *dev, char *str, mlx4_err(dev, "%s", buf); if (len >= BUF_SIZE) - mlx4_err(dev, "Network rule error message was truncated, print buffer is too small.\n"); + mlx4_err(dev, "Network rule error message was truncated, print buffer is too small\n"); } int mlx4_flow_attach(struct mlx4_dev *dev, @@ -948,7 +992,6 @@ int mlx4_flow_attach(struct mlx4_dev *dev, if (IS_ERR(mailbox)) return PTR_ERR(mailbox); - memset(mailbox->buf, 0, sizeof(struct mlx4_net_trans_rule_hw_ctrl)); trans_rule_ctrl_to_hw(rule, mailbox->buf); size += sizeof(struct mlx4_net_trans_rule_hw_ctrl); @@ -957,18 +1000,33 @@ int mlx4_flow_attach(struct mlx4_dev *dev, ret = parse_trans_rule(dev, cur, mailbox->buf + size); if (ret < 0) { mlx4_free_cmd_mailbox(dev, mailbox); - return -EINVAL; + return ret; } size += ret; } ret = mlx4_QP_FLOW_STEERING_ATTACH(dev, mailbox, size >> 2, reg_id); - if (ret == -ENOMEM) + if (ret == -ENOMEM) { mlx4_err_rule(dev, - "mcg table is full. Fail to register network rule.\n", + "mcg table is full. Fail to register network rule\n", rule); - else if (ret) - mlx4_err_rule(dev, "Fail to register network rule.\n", rule); + } else if (ret) { + if (ret == -ENXIO) { + if (dev->caps.steering_mode != MLX4_STEERING_MODE_DEVICE_MANAGED) + mlx4_err_rule(dev, + "DMFS is not enabled, " + "failed to register network rule.\n", + rule); + else + mlx4_err_rule(dev, + "Rule exceeds the dmfs_high_rate_mode limitations, " + "failed to register network rule.\n", + rule); + + } else { + mlx4_err_rule(dev, "Fail to register network rule.\n", rule); + } + } mlx4_free_cmd_mailbox(dev, mailbox); @@ -988,7 +1046,46 @@ int mlx4_flow_detach(struct mlx4_dev *dev, u64 reg_id) } EXPORT_SYMBOL_GPL(mlx4_flow_detach); -int mlx4_FLOW_STEERING_IB_UC_QP_RANGE(struct mlx4_dev *dev, u32 min_range_qpn, u32 max_range_qpn) +int mlx4_tunnel_steer_add(struct mlx4_dev *dev, unsigned char *addr, + int port, int qpn, u16 prio, u64 *reg_id) +{ + int err; + struct mlx4_spec_list spec_eth_outer = { {NULL} }; + struct mlx4_spec_list spec_vxlan = { {NULL} }; + struct mlx4_spec_list spec_eth_inner = { {NULL} }; + + struct mlx4_net_trans_rule rule = { + .queue_mode = MLX4_NET_TRANS_Q_FIFO, + .exclusive = 0, + .allow_loopback = 1, + .promisc_mode = MLX4_FS_REGULAR, + }; + + __be64 mac_mask = cpu_to_be64(MLX4_MAC_MASK << 16); + + rule.port = port; + rule.qpn = qpn; + rule.priority = prio; + INIT_LIST_HEAD(&rule.list); + + spec_eth_outer.id = MLX4_NET_TRANS_RULE_ID_ETH; + memcpy(spec_eth_outer.eth.dst_mac, addr, ETH_ALEN); + memcpy(spec_eth_outer.eth.dst_mac_msk, &mac_mask, ETH_ALEN); + + spec_vxlan.id = MLX4_NET_TRANS_RULE_ID_VXLAN; /* any vxlan header */ + spec_eth_inner.id = MLX4_NET_TRANS_RULE_ID_ETH; /* any inner eth header */ + + list_add_tail(&spec_eth_outer.list, &rule.list); + list_add_tail(&spec_vxlan.list, &rule.list); + list_add_tail(&spec_eth_inner.list, &rule.list); + + err = mlx4_flow_attach(dev, &rule, reg_id); + return err; +} +EXPORT_SYMBOL(mlx4_tunnel_steer_add); + +int mlx4_FLOW_STEERING_IB_UC_QP_RANGE(struct mlx4_dev *dev, u32 min_range_qpn, + u32 max_range_qpn) { int err; u64 in_param; @@ -1012,7 +1109,7 @@ int mlx4_qp_attach_common(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], struct mlx4_cmd_mailbox *mailbox; struct mlx4_mgm *mgm; u32 members_count; - int index, prev; + int index = -1, prev; int link = 0; int i; int err; @@ -1053,7 +1150,7 @@ int mlx4_qp_attach_common(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], members_count = be32_to_cpu(mgm->members_count) & 0xffffff; if (members_count == dev->caps.num_qp_per_mgm) { - mlx4_err(dev, "MGM at index %x is full.\n", index); + mlx4_err(dev, "MGM at index %x is full\n", index); err = -ENOMEM; goto out; } @@ -1065,8 +1162,11 @@ int mlx4_qp_attach_common(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], goto out; } - mgm->qp[members_count++] = cpu_to_be32((qp->qpn & MGM_QPN_MASK) | - (!!mlx4_blck_lb << MGM_BLCK_LB_BIT)); + if (block_mcast_loopback) + mgm->qp[members_count++] = cpu_to_be32((qp->qpn & MGM_QPN_MASK) | + (1U << MGM_BLCK_LB_BIT)); + else + mgm->qp[members_count++] = cpu_to_be32(qp->qpn & MGM_QPN_MASK); mgm->members_count = cpu_to_be32(members_count | (u32) prot << 30); @@ -1074,9 +1174,8 @@ int mlx4_qp_attach_common(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], if (err) goto out; - /* if !link, still add the new entry. */ if (!link) - goto skip_link; + goto out; err = mlx4_READ_ENTRY(dev, prev, mailbox); if (err) @@ -1088,20 +1187,19 @@ int mlx4_qp_attach_common(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], if (err) goto out; -skip_link: - if (prot == MLX4_PROT_ETH) { +out: + if (prot == MLX4_PROT_ETH && index != -1) { /* manage the steering entry for promisc mode */ if (new_entry) - new_steering_entry(dev, port, steer, index, qp->qpn); + err = new_steering_entry(dev, port, steer, + index, qp->qpn); else - existing_steering_entry(dev, port, steer, - index, qp->qpn); + err = existing_steering_entry(dev, port, steer, + index, qp->qpn); } - -out: if (err && link && index != -1) { if (index < dev->caps.num_mgms) - mlx4_warn(dev, "Got AMGM index %d < %d", + mlx4_warn(dev, "Got AMGM index %d < %d\n", index, dev->caps.num_mgms); else mlx4_bitmap_free(&priv->mcg_table.bitmap, @@ -1145,10 +1243,9 @@ int mlx4_qp_detach_common(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], goto out; } - /* - if this QP is also a promisc QP, it shouldn't be removed only if - at least one none promisc QP is also attached to this MCG - */ + /* If this QP is also a promisc QP, it shouldn't be removed only if + * at least one none promisc QP is also attached to this MCG + */ if (prot == MLX4_PROT_ETH && check_duplicate_entry(dev, port, steer, index, qp->qpn) && !promisc_steering_entry(dev, port, steer, index, qp->qpn, NULL)) @@ -1199,7 +1296,7 @@ int mlx4_qp_detach_common(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], if (amgm_index) { if (amgm_index < dev->caps.num_mgms) - mlx4_warn(dev, "MGM entry %d had AMGM index %d < %d", + mlx4_warn(dev, "MGM entry %d had AMGM index %d < %d\n", index, amgm_index, dev->caps.num_mgms); else mlx4_bitmap_free(&priv->mcg_table.bitmap, @@ -1219,7 +1316,7 @@ int mlx4_qp_detach_common(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], goto out; if (index < dev->caps.num_mgms) - mlx4_warn(dev, "entry %d had next AMGM index %d < %d", + mlx4_warn(dev, "entry %d had next AMGM index %d < %d\n", prev, index, dev->caps.num_mgms); else mlx4_bitmap_free(&priv->mcg_table.bitmap, @@ -1230,6 +1327,9 @@ int mlx4_qp_detach_common(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], mutex_unlock(&priv->mcg_table.mutex); mlx4_free_cmd_mailbox(dev, mailbox); + if (err && dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR) + /* In case device is under an error, return success as a closing command */ + err = 0; return err; } @@ -1259,6 +1359,9 @@ static int mlx4_QP_ATTACH(struct mlx4_dev *dev, struct mlx4_qp *qp, MLX4_CMD_WRAPPED); mlx4_free_cmd_mailbox(dev, mailbox); + if (err && !attach && + dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR) + err = 0; return err; } @@ -1306,9 +1409,6 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], u8 port, int block_mcast_loopback, enum mlx4_protocol prot, u64 *reg_id) { - enum mlx4_steer_type steer; - steer = (is_valid_ether_addr(&gid[10])) ? MLX4_UC_STEER : MLX4_MC_STEER; - switch (dev->caps.steering_mode) { case MLX4_STEERING_MODE_A0: if (prot == MLX4_PROT_ETH) @@ -1316,7 +1416,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], case MLX4_STEERING_MODE_B0: if (prot == MLX4_PROT_ETH) - gid[7] |= (steer << 1); + gid[7] |= (MLX4_MC_STEER << 1); if (mlx4_is_mfunc(dev)) return mlx4_QP_ATTACH(dev, qp, gid, 1, @@ -1338,9 +1438,6 @@ EXPORT_SYMBOL_GPL(mlx4_multicast_attach); int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], enum mlx4_protocol prot, u64 reg_id) { - enum mlx4_steer_type steer; - steer = (is_valid_ether_addr(&gid[10])) ? MLX4_UC_STEER : MLX4_MC_STEER; - switch (dev->caps.steering_mode) { case MLX4_STEERING_MODE_A0: if (prot == MLX4_PROT_ETH) @@ -1348,7 +1445,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], case MLX4_STEERING_MODE_B0: if (prot == MLX4_PROT_ETH) - gid[7] |= (steer << 1); + gid[7] |= (MLX4_MC_STEER << 1); if (mlx4_is_mfunc(dev)) return mlx4_QP_ATTACH(dev, qp, gid, 0, 0, prot); @@ -1368,7 +1465,12 @@ EXPORT_SYMBOL_GPL(mlx4_multicast_detach); int mlx4_flow_steer_promisc_add(struct mlx4_dev *dev, u8 port, u32 qpn, enum mlx4_net_trans_promisc_mode mode) { - struct mlx4_net_trans_rule rule; + struct mlx4_net_trans_rule rule = { + .queue_mode = MLX4_NET_TRANS_Q_FIFO, + .exclusive = 0, + .allow_loopback = 1, + }; + u64 *regid_p; switch (mode) { @@ -1459,11 +1561,14 @@ int mlx4_PROMISC_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_cmd_info *cmd) { u32 qpn = (u32) vhcr->in_param & 0xffffffff; - u8 port = vhcr->in_param >> 62; + int port = mlx4_slave_convert_port(dev, slave, vhcr->in_param >> 62); enum mlx4_steer_type steer = vhcr->in_modifier; - /* Promiscuous unicast is not allowed in mfunc for VFs */ - if ((slave != dev->caps.function) && (steer == MLX4_UC_STEER)) + if (port < 0) + return -EINVAL; + + /* Promiscuous unicast is not allowed in mfunc */ + if (mlx4_is_mfunc(dev) && steer == MLX4_UC_STEER) return 0; if (vhcr->op_modifier) diff --git a/sys/dev/mlx4/mlx4_core/mlx4_mr.c b/sys/dev/mlx4/mlx4_core/mlx4_mr.c index c194105249d8..e58b5cfbb8d3 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_mr.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_mr.c @@ -119,8 +119,11 @@ static int mlx4_buddy_init(struct mlx4_buddy *buddy, int max_order) for (i = 0; i <= buddy->max_order; ++i) { s = BITS_TO_LONGS(1 << (buddy->max_order - i)); buddy->bits[i] = kcalloc(s, sizeof (long), GFP_KERNEL | __GFP_NOWARN); - if (!buddy->bits[i]) - goto err_out_free; + if (!buddy->bits[i]) { + buddy->bits[i] = vzalloc(s * sizeof(long)); + if (!buddy->bits[i]) + goto err_out_free; + } } set_bit(0, buddy->bits[buddy->max_order]); @@ -130,7 +133,7 @@ static int mlx4_buddy_init(struct mlx4_buddy *buddy, int max_order) err_out_free: for (i = 0; i <= buddy->max_order; ++i) - kfree(buddy->bits[i]); + kvfree(buddy->bits[i]); err_out: kfree(buddy->bits); @@ -144,7 +147,7 @@ static void mlx4_buddy_cleanup(struct mlx4_buddy *buddy) int i; for (i = 0; i <= buddy->max_order; ++i) - kfree(buddy->bits[i]); + kvfree(buddy->bits[i]); kfree(buddy->bits); kfree(buddy->num_free); @@ -210,11 +213,8 @@ int mlx4_mtt_init(struct mlx4_dev *dev, int npages, int page_shift, ++mtt->order; mtt->offset = mlx4_alloc_mtt_range(dev, mtt->order); - if (mtt->offset == -1) { - mlx4_err(dev, "Failed to allocate mtts for %d pages(order %d)\n", - npages, mtt->order); + if (mtt->offset == -1) return -ENOMEM; - } return 0; } @@ -247,11 +247,11 @@ static void mlx4_free_mtt_range(struct mlx4_dev *dev, u32 offset, int order) MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED); if (err) - mlx4_warn(dev, "Failed to free mtt range at:" - "%d order:%d\n", offset, order); + mlx4_warn(dev, "Failed to free mtt range at:%d order:%d\n", + offset, order); return; } - __mlx4_free_mtt_range(dev, offset, order); + __mlx4_free_mtt_range(dev, offset, order); } void mlx4_mtt_cleanup(struct mlx4_dev *dev, struct mlx4_mtt *mtt) @@ -295,6 +295,130 @@ static int mlx4_HW2SW_MPT(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED); } +/* Must protect against concurrent access */ +int mlx4_mr_hw_get_mpt(struct mlx4_dev *dev, struct mlx4_mr *mmr, + struct mlx4_mpt_entry ***mpt_entry) +{ + int err; + int key = key_to_hw_index(mmr->key) & (dev->caps.num_mpts - 1); + struct mlx4_cmd_mailbox *mailbox = NULL; + + if (mmr->enabled != MLX4_MPT_EN_HW) + return -EINVAL; + + err = mlx4_HW2SW_MPT(dev, NULL, key); + if (err) { + mlx4_warn(dev, "HW2SW_MPT failed (%d).", err); + mlx4_warn(dev, "Most likely the MR has MWs bound to it.\n"); + return err; + } + + mmr->enabled = MLX4_MPT_EN_SW; + + if (!mlx4_is_mfunc(dev)) { + **mpt_entry = mlx4_table_find( + &mlx4_priv(dev)->mr_table.dmpt_table, + key, NULL); + } else { + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) + return PTR_ERR(mailbox); + + err = mlx4_cmd_box(dev, 0, mailbox->dma, key, + 0, MLX4_CMD_QUERY_MPT, + MLX4_CMD_TIME_CLASS_B, + MLX4_CMD_WRAPPED); + if (err) + goto free_mailbox; + + *mpt_entry = (struct mlx4_mpt_entry **)&mailbox->buf; + } + + if (!(*mpt_entry) || !(**mpt_entry)) { + err = -ENOMEM; + goto free_mailbox; + } + + return 0; + +free_mailbox: + mlx4_free_cmd_mailbox(dev, mailbox); + return err; +} +EXPORT_SYMBOL_GPL(mlx4_mr_hw_get_mpt); + +int mlx4_mr_hw_write_mpt(struct mlx4_dev *dev, struct mlx4_mr *mmr, + struct mlx4_mpt_entry **mpt_entry) +{ + int err; + + if (!mlx4_is_mfunc(dev)) { + /* Make sure any changes to this entry are flushed */ + wmb(); + + *(u8 *)(*mpt_entry) = MLX4_MPT_STATUS_HW; + + /* Make sure the new status is written */ + wmb(); + + err = mlx4_SYNC_TPT(dev); + } else { + int key = key_to_hw_index(mmr->key) & (dev->caps.num_mpts - 1); + + struct mlx4_cmd_mailbox *mailbox = + container_of((void *)mpt_entry, struct mlx4_cmd_mailbox, + buf); + + err = mlx4_SW2HW_MPT(dev, mailbox, key); + } + + if (!err) { + mmr->pd = be32_to_cpu((*mpt_entry)->pd_flags) & MLX4_MPT_PD_MASK; + mmr->enabled = MLX4_MPT_EN_HW; + } + return err; +} +EXPORT_SYMBOL_GPL(mlx4_mr_hw_write_mpt); + +void mlx4_mr_hw_put_mpt(struct mlx4_dev *dev, + struct mlx4_mpt_entry **mpt_entry) +{ + if (mlx4_is_mfunc(dev)) { + struct mlx4_cmd_mailbox *mailbox = + container_of((void *)mpt_entry, struct mlx4_cmd_mailbox, + buf); + mlx4_free_cmd_mailbox(dev, mailbox); + } +} +EXPORT_SYMBOL_GPL(mlx4_mr_hw_put_mpt); + +int mlx4_mr_hw_change_pd(struct mlx4_dev *dev, struct mlx4_mpt_entry *mpt_entry, + u32 pdn) +{ + u32 pd_flags = be32_to_cpu(mpt_entry->pd_flags) & ~MLX4_MPT_PD_MASK; + /* The wrapper function will put the slave's id here */ + if (mlx4_is_mfunc(dev)) + pd_flags &= ~MLX4_MPT_PD_VF_MASK; + + mpt_entry->pd_flags = cpu_to_be32(pd_flags | + (pdn & MLX4_MPT_PD_MASK) + | MLX4_MPT_PD_FLAG_EN_INV); + return 0; +} +EXPORT_SYMBOL_GPL(mlx4_mr_hw_change_pd); + +int mlx4_mr_hw_change_access(struct mlx4_dev *dev, + struct mlx4_mpt_entry *mpt_entry, + u32 access) +{ + u32 flags = (be32_to_cpu(mpt_entry->flags) & ~MLX4_PERM_MASK) | + (access & MLX4_PERM_MASK); + + mpt_entry->flags = cpu_to_be32(flags); + return 0; +} +EXPORT_SYMBOL_GPL(mlx4_mr_hw_change_access); + static int mlx4_mr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, u32 pd, u64 iova, u64 size, u32 access, int npages, int page_shift, struct mlx4_mr *mr) @@ -361,14 +485,14 @@ static void mlx4_mpt_release(struct mlx4_dev *dev, u32 index) __mlx4_mpt_release(dev, index); } -int __mlx4_mpt_alloc_icm(struct mlx4_dev *dev, u32 index) +int __mlx4_mpt_alloc_icm(struct mlx4_dev *dev, u32 index, gfp_t gfp) { struct mlx4_mr_table *mr_table = &mlx4_priv(dev)->mr_table; - return mlx4_table_get(dev, &mr_table->dmpt_table, index); + return mlx4_table_get(dev, &mr_table->dmpt_table, index, gfp); } -static int mlx4_mpt_alloc_icm(struct mlx4_dev *dev, u32 index) +static int mlx4_mpt_alloc_icm(struct mlx4_dev *dev, u32 index, gfp_t gfp) { u64 param = 0; @@ -379,7 +503,7 @@ static int mlx4_mpt_alloc_icm(struct mlx4_dev *dev, u32 index) MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED); } - return __mlx4_mpt_alloc_icm(dev, index); + return __mlx4_mpt_alloc_icm(dev, index, gfp); } void __mlx4_mpt_free_icm(struct mlx4_dev *dev, u32 index) @@ -433,8 +557,8 @@ static int mlx4_mr_free_reserved(struct mlx4_dev *dev, struct mlx4_mr *mr) key_to_hw_index(mr->key) & (dev->caps.num_mpts - 1)); if (err) { - mlx4_warn(dev, "HW2SW_MPT failed (%d).", err); - mlx4_warn(dev, "Most likely the MR has MWs bound to it.\n"); + mlx4_warn(dev, "HW2SW_MPT failed (%d), MR has MWs bound to it\n", + err); return err; } @@ -460,13 +584,58 @@ int mlx4_mr_free(struct mlx4_dev *dev, struct mlx4_mr *mr) } EXPORT_SYMBOL_GPL(mlx4_mr_free); +void mlx4_mr_rereg_mem_cleanup(struct mlx4_dev *dev, struct mlx4_mr *mr) +{ + mlx4_mtt_cleanup(dev, &mr->mtt); + mr->mtt.order = -1; +} +EXPORT_SYMBOL_GPL(mlx4_mr_rereg_mem_cleanup); + +int mlx4_mr_rereg_mem_write(struct mlx4_dev *dev, struct mlx4_mr *mr, + u64 iova, u64 size, int npages, + int page_shift, struct mlx4_mpt_entry *mpt_entry) +{ + int err; + + err = mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); + if (err) + return err; + + mpt_entry->start = cpu_to_be64(iova); + mpt_entry->length = cpu_to_be64(size); + mpt_entry->entity_size = cpu_to_be32(page_shift); + mpt_entry->flags &= ~(cpu_to_be32(MLX4_MPT_FLAG_FREE | + MLX4_MPT_FLAG_SW_OWNS)); + if (mr->mtt.order < 0) { + mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_PHYSICAL); + mpt_entry->mtt_addr = 0; + } else { + mpt_entry->mtt_addr = cpu_to_be64(mlx4_mtt_addr(dev, + &mr->mtt)); + if (mr->mtt.page_shift == 0) + mpt_entry->mtt_sz = cpu_to_be32(1 << mr->mtt.order); + } + if (mr->mtt.order >= 0 && mr->mtt.page_shift == 0) { + /* fast register MR in free state */ + mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_FREE); + mpt_entry->pd_flags |= cpu_to_be32(MLX4_MPT_PD_FLAG_FAST_REG | + MLX4_MPT_PD_FLAG_RAE); + } else { + mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_SW_OWNS); + } + mr->enabled = MLX4_MPT_EN_SW; + + return 0; +} +EXPORT_SYMBOL_GPL(mlx4_mr_rereg_mem_write); + int mlx4_mr_enable(struct mlx4_dev *dev, struct mlx4_mr *mr) { struct mlx4_cmd_mailbox *mailbox; struct mlx4_mpt_entry *mpt_entry; int err; - err = mlx4_mpt_alloc_icm(dev, key_to_hw_index(mr->key)); + err = mlx4_mpt_alloc_icm(dev, key_to_hw_index(mr->key), GFP_KERNEL); if (err) return err; @@ -476,9 +645,6 @@ int mlx4_mr_enable(struct mlx4_dev *dev, struct mlx4_mr *mr) goto err_table; } mpt_entry = mailbox->buf; - - memset(mpt_entry, 0, sizeof *mpt_entry); - mpt_entry->flags = cpu_to_be32(MLX4_MPT_FLAG_MIO | MLX4_MPT_FLAG_REGION | mr->access); @@ -542,13 +708,13 @@ static int mlx4_write_mtt_chunk(struct mlx4_dev *dev, struct mlx4_mtt *mtt, if (!mtts) return -ENOMEM; - dma_sync_single_for_cpu(&dev->pdev->dev, dma_handle, + dma_sync_single_for_cpu(&dev->persist->pdev->dev, dma_handle, npages * sizeof (u64), DMA_TO_DEVICE); for (i = 0; i < npages; ++i) mtts[i] = cpu_to_be64(page_list[i] | MLX4_MTT_FLAG_PRESENT); - dma_sync_single_for_device(&dev->pdev->dev, dma_handle, + dma_sync_single_for_device(&dev->persist->pdev->dev, dma_handle, npages * sizeof (u64), DMA_TO_DEVICE); return 0; @@ -627,13 +793,14 @@ int mlx4_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, EXPORT_SYMBOL_GPL(mlx4_write_mtt); int mlx4_buf_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, - struct mlx4_buf *buf) + struct mlx4_buf *buf, gfp_t gfp) { u64 *page_list; int err; int i; - page_list = kmalloc(buf->npages * sizeof *page_list, GFP_KERNEL); + page_list = kmalloc(buf->npages * sizeof *page_list, + gfp); if (!page_list) return -ENOMEM; @@ -655,6 +822,12 @@ int mlx4_mw_alloc(struct mlx4_dev *dev, u32 pd, enum mlx4_mw_type type, { u32 index; + if ((type == MLX4_MW_TYPE_1 && + !(dev->caps.flags & MLX4_DEV_CAP_FLAG_MEM_WINDOW)) || + (type == MLX4_MW_TYPE_2 && + !(dev->caps.bmme_flags & MLX4_BMME_FLAG_TYPE_2_WIN))) + return -ENOTSUPP; + index = mlx4_mpt_reserve(dev); if (index == -1) return -ENOMEM; @@ -674,7 +847,7 @@ int mlx4_mw_enable(struct mlx4_dev *dev, struct mlx4_mw *mw) struct mlx4_mpt_entry *mpt_entry; int err; - err = mlx4_mpt_alloc_icm(dev, key_to_hw_index(mw->key)); + err = mlx4_mpt_alloc_icm(dev, key_to_hw_index(mw->key), GFP_KERNEL); if (err) return err; @@ -685,11 +858,9 @@ int mlx4_mw_enable(struct mlx4_dev *dev, struct mlx4_mw *mw) } mpt_entry = mailbox->buf; - memset(mpt_entry, 0, sizeof(*mpt_entry)); - /* Note that the MLX4_MPT_FLAG_REGION bit in mpt_entry->flags is turned - * off, thus creating a memory window and not a memory region. - */ + * off, thus creating a memory window and not a memory region. + */ mpt_entry->key = cpu_to_be32(key_to_hw_index(mw->key)); mpt_entry->pd_flags = cpu_to_be32(mw->pd); if (mw->type == MLX4_MW_TYPE_2) { @@ -759,8 +930,8 @@ int mlx4_init_mr_table(struct mlx4_dev *dev) return err; err = mlx4_buddy_init(&mr_table->mtt_buddy, - ilog2(div_u64(dev->caps.num_mtts, - (1 << log_mtts_per_seg)))); + ilog2((u32)dev->caps.num_mtts / + (1 << log_mtts_per_seg))); if (err) goto err_buddy; @@ -769,7 +940,7 @@ int mlx4_init_mr_table(struct mlx4_dev *dev) mlx4_alloc_mtt_range(dev, fls(dev->caps.reserved_mtts - 1)); if (priv->reserved_mtts < 0) { - mlx4_warn(dev, "MTT table of order %u is too small.\n", + mlx4_warn(dev, "MTT table of order %u is too small\n", mr_table->mtt_buddy.max_order); err = -ENOMEM; goto err_reserve_mtts; @@ -849,13 +1020,13 @@ int mlx4_map_phys_fmr(struct mlx4_dev *dev, struct mlx4_fmr *fmr, u64 *page_list /* Make sure MPT status is visible before writing MTT entries */ wmb(); - dma_sync_single_for_cpu(&dev->pdev->dev, fmr->dma_handle, + dma_sync_single_for_cpu(&dev->persist->pdev->dev, fmr->dma_handle, npages * sizeof(u64), DMA_TO_DEVICE); for (i = 0; i < npages; ++i) fmr->mtts[i] = cpu_to_be64(page_list[i] | MLX4_MTT_FLAG_PRESENT); - dma_sync_single_for_device(&dev->pdev->dev, fmr->dma_handle, + dma_sync_single_for_device(&dev->persist->pdev->dev, fmr->dma_handle, npages * sizeof(u64), DMA_TO_DEVICE); fmr->mpt->key = cpu_to_be32(key); @@ -879,7 +1050,7 @@ int mlx4_fmr_alloc(struct mlx4_dev *dev, u32 pd, u32 access, int max_pages, int max_maps, u8 page_shift, struct mlx4_fmr *fmr) { struct mlx4_priv *priv = mlx4_priv(dev); - int err = -ENOMEM, ret; + int err = -ENOMEM; if (max_maps > dev->caps.max_fmr_maps) return -EINVAL; @@ -913,9 +1084,7 @@ int mlx4_fmr_alloc(struct mlx4_dev *dev, u32 pd, u32 access, int max_pages, return 0; err_free: - ret = mlx4_mr_free(dev, &fmr->mr); - if (ret) - mlx4_err(dev, "Error deregistering MR. The system may have become unstable."); + (void) mlx4_mr_free(dev, &fmr->mr); return err; } EXPORT_SYMBOL_GPL(mlx4_fmr_alloc); @@ -941,34 +1110,30 @@ EXPORT_SYMBOL_GPL(mlx4_fmr_enable); void mlx4_fmr_unmap(struct mlx4_dev *dev, struct mlx4_fmr *fmr, u32 *lkey, u32 *rkey) { - u32 key; + struct mlx4_cmd_mailbox *mailbox; + int err; if (!fmr->maps) return; - key = key_to_hw_index(fmr->mr.key) & (dev->caps.num_mpts - 1); - - *(u8 *)fmr->mpt = MLX4_MPT_STATUS_SW; - - /* Make sure MPT status is visible before changing MPT fields */ - wmb(); - - fmr->mr.key = hw_index_to_key(key); - - fmr->mpt->key = cpu_to_be32(key); - fmr->mpt->lkey = cpu_to_be32(key); - fmr->mpt->length = 0; - fmr->mpt->start = 0; - - /* Make sure MPT data is visible before changing MPT status */ - wmb(); - - *(u8 *)fmr->mpt = MLX4_MPT_STATUS_HW; - - /* Make sure MPT satus is visible */ - wmb(); - fmr->maps = 0; + + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) { + err = PTR_ERR(mailbox); + pr_warn("mlx4_ib: mlx4_alloc_cmd_mailbox failed (%d)\n", err); + return; + } + + err = mlx4_HW2SW_MPT(dev, NULL, + key_to_hw_index(fmr->mr.key) & + (dev->caps.num_mpts - 1)); + mlx4_free_cmd_mailbox(dev, mailbox); + if (err) { + pr_warn("mlx4_ib: mlx4_HW2SW_MPT failed (%d)\n", err); + return; + } + fmr->mr.enabled = MLX4_MPT_EN_SW; } EXPORT_SYMBOL_GPL(mlx4_fmr_unmap); @@ -990,7 +1155,7 @@ EXPORT_SYMBOL_GPL(mlx4_fmr_free); int mlx4_SYNC_TPT(struct mlx4_dev *dev) { - return mlx4_cmd(dev, 0, 0, 0, MLX4_CMD_SYNC_TPT, 1000, - MLX4_CMD_NATIVE); + return mlx4_cmd(dev, 0, 0, 0, MLX4_CMD_SYNC_TPT, + MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); } EXPORT_SYMBOL_GPL(mlx4_SYNC_TPT); diff --git a/sys/dev/mlx4/mlx4_core/mlx4_pd.c b/sys/dev/mlx4/mlx4_core/mlx4_pd.c index ecbe3eae7f4d..25fb9e754535 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_pd.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_pd.c @@ -151,11 +151,13 @@ int mlx4_uar_alloc(struct mlx4_dev *dev, struct mlx4_uar *uar) return -ENOMEM; if (mlx4_is_slave(dev)) - offset = uar->index % ((int) pci_resource_len(dev->pdev, 2) / + offset = uar->index % ((int)pci_resource_len(dev->persist->pdev, + 2) / dev->caps.uar_page_size); else offset = uar->index; - uar->pfn = (pci_resource_start(dev->pdev, 2) >> PAGE_SHIFT) + offset; + uar->pfn = (pci_resource_start(dev->persist->pdev, 2) >> PAGE_SHIFT) + + offset; uar->map = NULL; return 0; } @@ -167,7 +169,6 @@ void mlx4_uar_free(struct mlx4_dev *dev, struct mlx4_uar *uar) } EXPORT_SYMBOL_GPL(mlx4_uar_free); -#ifndef CONFIG_PPC int mlx4_bf_alloc(struct mlx4_dev *dev, struct mlx4_bf *bf, int node) { struct mlx4_priv *priv = mlx4_priv(dev); @@ -186,9 +187,9 @@ int mlx4_bf_alloc(struct mlx4_dev *dev, struct mlx4_bf *bf, int node) err = -ENOMEM; goto out; } - uar = kmalloc_node(sizeof *uar, GFP_KERNEL, node); + uar = kmalloc_node(sizeof(*uar), GFP_KERNEL, node); if (!uar) { - uar = kmalloc(sizeof *uar, GFP_KERNEL); + uar = kmalloc(sizeof(*uar), GFP_KERNEL); if (!uar) { err = -ENOMEM; goto out; @@ -204,7 +205,9 @@ int mlx4_bf_alloc(struct mlx4_dev *dev, struct mlx4_bf *bf, int node) goto free_uar; } - uar->bf_map = io_mapping_map_wc(priv->bf_mapping, uar->index << PAGE_SHIFT, PAGE_SIZE); + uar->bf_map = io_mapping_map_wc(priv->bf_mapping, + uar->index << PAGE_SHIFT, + PAGE_SIZE); if (!uar->bf_map) { err = -ENOMEM; goto unamp_uar; @@ -213,7 +216,6 @@ int mlx4_bf_alloc(struct mlx4_dev *dev, struct mlx4_bf *bf, int node) list_add(&uar->bf_list, &priv->bf_list); } - bf->uar = uar; idx = ffz(uar->free_bf_bmap); uar->free_bf_bmap |= 1 << idx; bf->uar = uar; @@ -267,26 +269,16 @@ void mlx4_bf_free(struct mlx4_dev *dev, struct mlx4_bf *bf) } EXPORT_SYMBOL_GPL(mlx4_bf_free); -#else -int mlx4_bf_alloc(struct mlx4_dev *dev, struct mlx4_bf *bf, int node) -{ - memset(bf, 0, sizeof *bf); - return -ENOSYS; -} -EXPORT_SYMBOL_GPL(mlx4_bf_alloc); - -void mlx4_bf_free(struct mlx4_dev *dev, struct mlx4_bf *bf) -{ - return; -} -EXPORT_SYMBOL_GPL(mlx4_bf_free); -#endif - int mlx4_init_uar_table(struct mlx4_dev *dev) { - if (dev->caps.num_uars <= 128) { - mlx4_err(dev, "Only %d UAR pages (need more than 128)\n", - dev->caps.num_uars); + int num_reserved_uar = mlx4_get_num_reserved_uar(dev); + + mlx4_dbg(dev, "uar_page_shift = %d", dev->uar_page_shift); + mlx4_dbg(dev, "Effective reserved_uars=%d", dev->caps.reserved_uars); + + if (dev->caps.num_uars <= num_reserved_uar) { + mlx4_err(dev, "Only %d UAR pages (need more than %d)\n", + dev->caps.num_uars, num_reserved_uar); mlx4_err(dev, "Increase firmware log2_uar_bar_megabytes?\n"); return -ENODEV; } diff --git a/sys/dev/mlx4/mlx4_core/mlx4_port.c b/sys/dev/mlx4/mlx4_core/mlx4_port.c index 00c88de91ee0..fbe215932306 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_port.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_port.c @@ -39,21 +39,26 @@ #include #include + +#include + #include "mlx4.h" #include - -int mlx4_set_4k_mtu = -1; -module_param_named(set_4k_mtu, mlx4_set_4k_mtu, int, 0444); -MODULE_PARM_DESC(set_4k_mtu, - "(Obsolete) attempt to set 4K MTU to all ConnectX ports"); - - #define MLX4_MAC_VALID (1ull << 63) #define MLX4_VLAN_VALID (1u << 31) #define MLX4_VLAN_MASK 0xfff +#define MLX4_STATS_TRAFFIC_COUNTERS_MASK 0xfULL +#define MLX4_STATS_TRAFFIC_DROPS_MASK 0xc0ULL +#define MLX4_STATS_ERROR_COUNTERS_MASK 0x1ffc30ULL +#define MLX4_STATS_PORT_COUNTERS_MASK 0x1fe00000ULL + +#define MLX4_FLAG_V_IGNORE_FCS_MASK 0x2 +#define MLX4_IGNORE_FCS_MASK 0x1 +#define MLX4_TC_MAX_NUMBER 8 + void mlx4_init_mac_table(struct mlx4_dev *dev, struct mlx4_mac_table *table) { int i; @@ -62,6 +67,7 @@ void mlx4_init_mac_table(struct mlx4_dev *dev, struct mlx4_mac_table *table) for (i = 0; i < MLX4_MAX_MAC_NUM; i++) { table->entries[i] = 0; table->refs[i] = 0; + table->is_dup[i] = false; } table->max = 1 << dev->caps.log_num_macs; table->total = 0; @@ -75,17 +81,28 @@ void mlx4_init_vlan_table(struct mlx4_dev *dev, struct mlx4_vlan_table *table) for (i = 0; i < MLX4_MAX_VLAN_NUM; i++) { table->entries[i] = 0; table->refs[i] = 0; + table->is_dup[i] = false; } table->max = (1 << dev->caps.log_num_vlans) - MLX4_VLAN_REGULAR; table->total = 0; } +void mlx4_init_roce_gid_table(struct mlx4_dev *dev, + struct mlx4_roce_gid_table *table) +{ + int i; + + mutex_init(&table->mutex); + for (i = 0; i < MLX4_ROCE_MAX_GIDS; i++) + memset(table->roce_gids[i].raw, 0, MLX4_ROCE_GID_ENTRY_SIZE); +} + static int validate_index(struct mlx4_dev *dev, struct mlx4_mac_table *table, int index) { int err = 0; - if (index < 0 || index >= table->max || !table->refs[index]) { + if (index < 0 || index >= table->max || !table->entries[index]) { mlx4_warn(dev, "No valid Mac entry for the given index\n"); err = -EINVAL; } @@ -98,7 +115,8 @@ static int find_index(struct mlx4_dev *dev, int i; for (i = 0; i < MLX4_MAX_MAC_NUM; i++) { - if ((mac & MLX4_MAC_MASK) == + if (table->refs[i] && + (MLX4_MAC_MASK & mac) == (MLX4_MAC_MASK & be64_to_cpu(table->entries[i]))) return i; } @@ -121,39 +139,154 @@ static int mlx4_set_port_mac_table(struct mlx4_dev *dev, u8 port, in_mod = MLX4_SET_PORT_MAC_TABLE << 8 | port; - err = mlx4_cmd(dev, mailbox->dma, in_mod, 1, MLX4_CMD_SET_PORT, - MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); + err = mlx4_cmd(dev, mailbox->dma, in_mod, MLX4_SET_PORT_ETH_OPCODE, + MLX4_CMD_SET_PORT, MLX4_CMD_TIME_CLASS_B, + MLX4_CMD_NATIVE); mlx4_free_cmd_mailbox(dev, mailbox); return err; } +int mlx4_find_cached_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *idx) +{ + struct mlx4_port_info *info = &mlx4_priv(dev)->port[port]; + struct mlx4_mac_table *table = &info->mac_table; + int i; + + for (i = 0; i < MLX4_MAX_MAC_NUM; i++) { + if (!table->refs[i]) + continue; + + if (mac == (MLX4_MAC_MASK & be64_to_cpu(table->entries[i]))) { + *idx = i; + return 0; + } + } + + return -ENOENT; +} +EXPORT_SYMBOL_GPL(mlx4_find_cached_mac); + +static bool mlx4_need_mf_bond(struct mlx4_dev *dev) +{ + int i, num_eth_ports = 0; + + if (!mlx4_is_mfunc(dev)) + return false; + mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH) + ++num_eth_ports; + + return (num_eth_ports == 2) ? true : false; +} + int __mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac) { struct mlx4_port_info *info = &mlx4_priv(dev)->port[port]; struct mlx4_mac_table *table = &info->mac_table; int i, err = 0; int free = -1; + int free_for_dup = -1; + bool dup = mlx4_is_mf_bonded(dev); + u8 dup_port = (port == 1) ? 2 : 1; + struct mlx4_mac_table *dup_table = &mlx4_priv(dev)->port[dup_port].mac_table; + bool need_mf_bond = mlx4_need_mf_bond(dev); + bool can_mf_bond = true; - mlx4_dbg(dev, "Registering MAC: 0x%llx for port %d\n", - (unsigned long long) mac, port); + mlx4_dbg(dev, "Registering MAC: 0x%llx for port %d %s duplicate\n", + (unsigned long long)mac, port, + dup ? "with" : "without"); + + if (need_mf_bond) { + if (port == 1) { + mutex_lock(&table->mutex); + mutex_lock_nested(&dup_table->mutex, SINGLE_DEPTH_NESTING); + } else { + mutex_lock(&dup_table->mutex); + mutex_lock_nested(&table->mutex, SINGLE_DEPTH_NESTING); + } + } else { + mutex_lock(&table->mutex); + } + + if (need_mf_bond) { + int index_at_port = -1; + int index_at_dup_port = -1; + + for (i = 0; i < MLX4_MAX_MAC_NUM; i++) { + if (((MLX4_MAC_MASK & mac) == (MLX4_MAC_MASK & be64_to_cpu(table->entries[i])))) + index_at_port = i; + if (((MLX4_MAC_MASK & mac) == (MLX4_MAC_MASK & be64_to_cpu(dup_table->entries[i])))) + index_at_dup_port = i; + } + + /* check that same mac is not in the tables at different indices */ + if ((index_at_port != index_at_dup_port) && + (index_at_port >= 0) && + (index_at_dup_port >= 0)) + can_mf_bond = false; + + /* If the mac is already in the primary table, the slot must be + * available in the duplicate table as well. + */ + if (index_at_port >= 0 && index_at_dup_port < 0 && + dup_table->refs[index_at_port]) { + can_mf_bond = false; + } + /* If the mac is already in the duplicate table, check that the + * corresponding index is not occupied in the primary table, or + * the primary table already contains the mac at the same index. + * Otherwise, you cannot bond (primary contains a different mac + * at that index). + */ + if (index_at_dup_port >= 0) { + if (!table->refs[index_at_dup_port] || + ((MLX4_MAC_MASK & mac) == (MLX4_MAC_MASK & be64_to_cpu(table->entries[index_at_dup_port])))) + free_for_dup = index_at_dup_port; + else + can_mf_bond = false; + } + } - mutex_lock(&table->mutex); for (i = 0; i < MLX4_MAX_MAC_NUM; i++) { - if (free < 0 && !table->refs[i]) { - free = i; + if (!table->refs[i]) { + if (free < 0) + free = i; + if (free_for_dup < 0 && need_mf_bond && can_mf_bond) { + if (!dup_table->refs[i]) + free_for_dup = i; + } continue; } - if ((mac == (MLX4_MAC_MASK & be64_to_cpu(table->entries[i]))) && - table->refs[i]) { - /* MAC already registered, Must not have duplicates */ + if ((MLX4_MAC_MASK & mac) == + (MLX4_MAC_MASK & be64_to_cpu(table->entries[i]))) { + /* MAC already registered, increment ref count */ err = i; ++table->refs[i]; + if (dup) { + u64 dup_mac = MLX4_MAC_MASK & be64_to_cpu(dup_table->entries[i]); + + if (dup_mac != mac || !dup_table->is_dup[i]) { + mlx4_warn(dev, "register mac: expect duplicate mac 0x%llx on port %d index %d\n", + (long long)mac, dup_port, i); + } + } goto out; } } + if (need_mf_bond && (free_for_dup < 0)) { + if (dup) { + mlx4_warn(dev, "Fail to allocate duplicate MAC table entry\n"); + mlx4_warn(dev, "High Availability for virtual functions may not work as expected\n"); + dup = false; + } + can_mf_bond = false; + } + + if (need_mf_bond && can_mf_bond) + free = free_for_dup; + mlx4_dbg(dev, "Free MAC index is %d\n", free); if (table->total == table->max) { @@ -173,11 +306,35 @@ int __mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac) goto out; } table->refs[free] = 1; - - err = free; + table->is_dup[free] = false; ++table->total; + if (dup) { + dup_table->refs[free] = 0; + dup_table->is_dup[free] = true; + dup_table->entries[free] = cpu_to_be64(mac | MLX4_MAC_VALID); + + err = mlx4_set_port_mac_table(dev, dup_port, dup_table->entries); + if (unlikely(err)) { + mlx4_warn(dev, "Failed adding duplicate mac: 0x%llx\n", (long long)mac); + dup_table->is_dup[free] = false; + dup_table->entries[free] = 0; + goto out; + } + ++dup_table->total; + } + err = free; out: - mutex_unlock(&table->mutex); + if (need_mf_bond) { + if (port == 2) { + mutex_unlock(&table->mutex); + mutex_unlock(&dup_table->mutex); + } else { + mutex_unlock(&dup_table->mutex); + mutex_unlock(&table->mutex); + } + } else { + mutex_unlock(&table->mutex); + } return err; } EXPORT_SYMBOL_GPL(__mlx4_register_mac); @@ -224,6 +381,9 @@ void __mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac) struct mlx4_port_info *info; struct mlx4_mac_table *table; int index; + bool dup = mlx4_is_mf_bonded(dev); + u8 dup_port = (port == 1) ? 2 : 1; + struct mlx4_mac_table *dup_table = &mlx4_priv(dev)->port[dup_port].mac_table; if (port < 1 || port > dev->caps.num_ports) { mlx4_warn(dev, "invalid port number (%d), aborting...\n", port); @@ -231,24 +391,59 @@ void __mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac) } info = &mlx4_priv(dev)->port[port]; table = &info->mac_table; - mutex_lock(&table->mutex); + + if (dup) { + if (port == 1) { + mutex_lock(&table->mutex); + mutex_lock_nested(&dup_table->mutex, SINGLE_DEPTH_NESTING); + } else { + mutex_lock(&dup_table->mutex); + mutex_lock_nested(&table->mutex, SINGLE_DEPTH_NESTING); + } + } else { + mutex_lock(&table->mutex); + } index = find_index(dev, table, mac); if (validate_index(dev, table, index)) goto out; - if (--table->refs[index]) { - mlx4_dbg(dev, "Have more references for index %d," - "no need to modify mac table\n", index); + if (--table->refs[index] || table->is_dup[index]) { + mlx4_dbg(dev, "Have more references for index %d, no need to modify mac table\n", + index); + if (!table->refs[index]) + dup_table->is_dup[index] = false; goto out; } table->entries[index] = 0; - mlx4_set_port_mac_table(dev, port, table->entries); + if (mlx4_set_port_mac_table(dev, port, table->entries)) + mlx4_warn(dev, "Fail to set mac in port %d during unregister\n", port); --table->total; + + if (dup) { + dup_table->is_dup[index] = false; + if (dup_table->refs[index]) + goto out; + dup_table->entries[index] = 0; + if (mlx4_set_port_mac_table(dev, dup_port, dup_table->entries)) + mlx4_warn(dev, "Fail to set mac in duplicate port %d during unregister\n", dup_port); + + --table->total; + } out: - mutex_unlock(&table->mutex); + if (dup) { + if (port == 2) { + mutex_unlock(&table->mutex); + mutex_unlock(&dup_table->mutex); + } else { + mutex_unlock(&dup_table->mutex); + mutex_unlock(&table->mutex); + } + } else { + mutex_unlock(&table->mutex); + } } EXPORT_SYMBOL_GPL(__mlx4_unregister_mac); @@ -282,9 +477,22 @@ int __mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac) struct mlx4_mac_table *table = &info->mac_table; int index = qpn - info->base_qpn; int err = 0; + bool dup = mlx4_is_mf_bonded(dev); + u8 dup_port = (port == 1) ? 2 : 1; + struct mlx4_mac_table *dup_table = &mlx4_priv(dev)->port[dup_port].mac_table; /* CX1 doesn't support multi-functions */ - mutex_lock(&table->mutex); + if (dup) { + if (port == 1) { + mutex_lock(&table->mutex); + mutex_lock_nested(&dup_table->mutex, SINGLE_DEPTH_NESTING); + } else { + mutex_lock(&dup_table->mutex); + mutex_lock_nested(&table->mutex, SINGLE_DEPTH_NESTING); + } + } else { + mutex_lock(&table->mutex); + } err = validate_index(dev, table, index); if (err) @@ -297,9 +505,30 @@ int __mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac) mlx4_err(dev, "Failed adding MAC: 0x%llx\n", (unsigned long long) new_mac); table->entries[index] = 0; + } else { + if (dup) { + dup_table->entries[index] = cpu_to_be64(new_mac | MLX4_MAC_VALID); + + err = mlx4_set_port_mac_table(dev, dup_port, dup_table->entries); + if (unlikely(err)) { + mlx4_err(dev, "Failed adding duplicate MAC: 0x%llx\n", + (unsigned long long)new_mac); + dup_table->entries[index] = 0; + } + } } out: - mutex_unlock(&table->mutex); + if (dup) { + if (port == 2) { + mutex_unlock(&table->mutex); + mutex_unlock(&dup_table->mutex); + } else { + mutex_unlock(&dup_table->mutex); + mutex_unlock(&table->mutex); + } + } else { + mutex_unlock(&table->mutex); + } return err; } EXPORT_SYMBOL_GPL(__mlx4_replace_mac); @@ -317,8 +546,9 @@ static int mlx4_set_port_vlan_table(struct mlx4_dev *dev, u8 port, memcpy(mailbox->buf, entries, MLX4_VLAN_TABLE_SIZE); in_mod = MLX4_SET_PORT_VLAN_TABLE << 8 | port; - err = mlx4_cmd(dev, mailbox->dma, in_mod, 1, MLX4_CMD_SET_PORT, - MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); + err = mlx4_cmd(dev, mailbox->dma, in_mod, MLX4_SET_PORT_ETH_OPCODE, + MLX4_CMD_SET_PORT, MLX4_CMD_TIME_CLASS_B, + MLX4_CMD_NATIVE); mlx4_free_cmd_mailbox(dev, mailbox); @@ -350,8 +580,28 @@ int __mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, struct mlx4_vlan_table *table = &mlx4_priv(dev)->port[port].vlan_table; int i, err = 0; int free = -1; + int free_for_dup = -1; + bool dup = mlx4_is_mf_bonded(dev); + u8 dup_port = (port == 1) ? 2 : 1; + struct mlx4_vlan_table *dup_table = &mlx4_priv(dev)->port[dup_port].vlan_table; + bool need_mf_bond = mlx4_need_mf_bond(dev); + bool can_mf_bond = true; - mutex_lock(&table->mutex); + mlx4_dbg(dev, "Registering VLAN: %d for port %d %s duplicate\n", + vlan, port, + dup ? "with" : "without"); + + if (need_mf_bond) { + if (port == 1) { + mutex_lock(&table->mutex); + mutex_lock_nested(&dup_table->mutex, SINGLE_DEPTH_NESTING); + } else { + mutex_lock(&dup_table->mutex); + mutex_lock_nested(&table->mutex, SINGLE_DEPTH_NESTING); + } + } else { + mutex_lock(&table->mutex); + } if (table->total == table->max) { /* No free vlan entries */ @@ -359,22 +609,85 @@ int __mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, goto out; } + if (need_mf_bond) { + int index_at_port = -1; + int index_at_dup_port = -1; + + for (i = MLX4_VLAN_REGULAR; i < MLX4_MAX_VLAN_NUM; i++) { + if (vlan == (MLX4_VLAN_MASK & be32_to_cpu(table->entries[i]))) + index_at_port = i; + if (vlan == (MLX4_VLAN_MASK & be32_to_cpu(dup_table->entries[i]))) + index_at_dup_port = i; + } + /* check that same vlan is not in the tables at different indices */ + if ((index_at_port != index_at_dup_port) && + (index_at_port >= 0) && + (index_at_dup_port >= 0)) + can_mf_bond = false; + + /* If the vlan is already in the primary table, the slot must be + * available in the duplicate table as well. + */ + if (index_at_port >= 0 && index_at_dup_port < 0 && + dup_table->refs[index_at_port]) { + can_mf_bond = false; + } + /* If the vlan is already in the duplicate table, check that the + * corresponding index is not occupied in the primary table, or + * the primary table already contains the vlan at the same index. + * Otherwise, you cannot bond (primary contains a different vlan + * at that index). + */ + if (index_at_dup_port >= 0) { + if (!table->refs[index_at_dup_port] || + (vlan == (MLX4_VLAN_MASK & be32_to_cpu(dup_table->entries[index_at_dup_port])))) + free_for_dup = index_at_dup_port; + else + can_mf_bond = false; + } + } + for (i = MLX4_VLAN_REGULAR; i < MLX4_MAX_VLAN_NUM; i++) { - if (free < 0 && (table->refs[i] == 0)) { - free = i; - continue; + if (!table->refs[i]) { + if (free < 0) + free = i; + if (free_for_dup < 0 && need_mf_bond && can_mf_bond) { + if (!dup_table->refs[i]) + free_for_dup = i; + } } - if (table->refs[i] && + if ((table->refs[i] || table->is_dup[i]) && (vlan == (MLX4_VLAN_MASK & be32_to_cpu(table->entries[i])))) { /* Vlan already registered, increase references count */ + mlx4_dbg(dev, "vlan %u is already registered.\n", vlan); *index = i; ++table->refs[i]; + if (dup) { + u16 dup_vlan = MLX4_VLAN_MASK & be32_to_cpu(dup_table->entries[i]); + + if (dup_vlan != vlan || !dup_table->is_dup[i]) { + mlx4_warn(dev, "register vlan: expected duplicate vlan %u on port %d index %d\n", + vlan, dup_port, i); + } + } goto out; } } + if (need_mf_bond && (free_for_dup < 0)) { + if (dup) { + mlx4_warn(dev, "Fail to allocate duplicate VLAN table entry\n"); + mlx4_warn(dev, "High Availability for virtual functions may not work as expected\n"); + dup = false; + } + can_mf_bond = false; + } + + if (need_mf_bond && can_mf_bond) + free = free_for_dup; + if (free < 0) { err = -ENOMEM; goto out; @@ -382,6 +695,7 @@ int __mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, /* Register new VLAN */ table->refs[free] = 1; + table->is_dup[free] = false; table->entries[free] = cpu_to_be32(vlan | MLX4_VLAN_VALID); err = mlx4_set_port_vlan_table(dev, port, table->entries); @@ -391,11 +705,35 @@ int __mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, table->entries[free] = 0; goto out; } + ++table->total; + if (dup) { + dup_table->refs[free] = 0; + dup_table->is_dup[free] = true; + dup_table->entries[free] = cpu_to_be32(vlan | MLX4_VLAN_VALID); + + err = mlx4_set_port_vlan_table(dev, dup_port, dup_table->entries); + if (unlikely(err)) { + mlx4_warn(dev, "Failed adding duplicate vlan: %u\n", vlan); + dup_table->is_dup[free] = false; + dup_table->entries[free] = 0; + goto out; + } + ++dup_table->total; + } *index = free; - ++table->total; out: - mutex_unlock(&table->mutex); + if (need_mf_bond) { + if (port == 2) { + mutex_unlock(&table->mutex); + mutex_unlock(&dup_table->mutex); + } else { + mutex_unlock(&dup_table->mutex); + mutex_unlock(&table->mutex); + } + } else { + mutex_unlock(&table->mutex); + } return err; } @@ -425,8 +763,22 @@ void __mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, u16 vlan) { struct mlx4_vlan_table *table = &mlx4_priv(dev)->port[port].vlan_table; int index; + bool dup = mlx4_is_mf_bonded(dev); + u8 dup_port = (port == 1) ? 2 : 1; + struct mlx4_vlan_table *dup_table = &mlx4_priv(dev)->port[dup_port].vlan_table; + + if (dup) { + if (port == 1) { + mutex_lock(&table->mutex); + mutex_lock_nested(&dup_table->mutex, SINGLE_DEPTH_NESTING); + } else { + mutex_lock(&dup_table->mutex); + mutex_lock_nested(&table->mutex, SINGLE_DEPTH_NESTING); + } + } else { + mutex_lock(&table->mutex); + } - mutex_lock(&table->mutex); if (mlx4_find_cached_vlan(dev, port, vlan, &index)) { mlx4_warn(dev, "vlan 0x%x is not in the vlan table\n", vlan); goto out; @@ -437,17 +789,38 @@ void __mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, u16 vlan) goto out; } - if (--table->refs[index]) { - mlx4_dbg(dev, "Have %d more references for index %d, " - "no need to modify vlan table\n", table->refs[index], - index); + if (--table->refs[index] || table->is_dup[index]) { + mlx4_dbg(dev, "Have %d more references for index %d, no need to modify vlan table\n", + table->refs[index], index); + if (!table->refs[index]) + dup_table->is_dup[index] = false; goto out; } table->entries[index] = 0; - mlx4_set_port_vlan_table(dev, port, table->entries); + if (mlx4_set_port_vlan_table(dev, port, table->entries)) + mlx4_warn(dev, "Fail to set vlan in port %d during unregister\n", port); --table->total; + if (dup) { + dup_table->is_dup[index] = false; + if (dup_table->refs[index]) + goto out; + dup_table->entries[index] = 0; + if (mlx4_set_port_vlan_table(dev, dup_port, dup_table->entries)) + mlx4_warn(dev, "Fail to set vlan in duplicate port %d during unregister\n", dup_port); + --dup_table->total; + } out: - mutex_unlock(&table->mutex); + if (dup) { + if (port == 2) { + mutex_unlock(&table->mutex); + mutex_unlock(&dup_table->mutex); + } else { + mutex_unlock(&dup_table->mutex); + mutex_unlock(&table->mutex); + } + } else { + mutex_unlock(&table->mutex); + } } void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, u16 vlan) @@ -466,6 +839,220 @@ void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, u16 vlan) } EXPORT_SYMBOL_GPL(mlx4_unregister_vlan); +int mlx4_bond_mac_table(struct mlx4_dev *dev) +{ + struct mlx4_mac_table *t1 = &mlx4_priv(dev)->port[1].mac_table; + struct mlx4_mac_table *t2 = &mlx4_priv(dev)->port[2].mac_table; + int ret = 0; + int i; + bool update1 = false; + bool update2 = false; + + mutex_lock(&t1->mutex); + mutex_lock(&t2->mutex); + for (i = 0; i < MLX4_MAX_MAC_NUM; i++) { + if ((t1->entries[i] != t2->entries[i]) && + t1->entries[i] && t2->entries[i]) { + mlx4_warn(dev, "can't duplicate entry %d in mac table\n", i); + ret = -EINVAL; + goto unlock; + } + } + + for (i = 0; i < MLX4_MAX_MAC_NUM; i++) { + if (t1->entries[i] && !t2->entries[i]) { + t2->entries[i] = t1->entries[i]; + t2->is_dup[i] = true; + update2 = true; + } else if (!t1->entries[i] && t2->entries[i]) { + t1->entries[i] = t2->entries[i]; + t1->is_dup[i] = true; + update1 = true; + } else if (t1->entries[i] && t2->entries[i]) { + t1->is_dup[i] = true; + t2->is_dup[i] = true; + } + } + + if (update1) { + ret = mlx4_set_port_mac_table(dev, 1, t1->entries); + if (ret) + mlx4_warn(dev, "failed to set MAC table for port 1 (%d)\n", ret); + } + if (!ret && update2) { + ret = mlx4_set_port_mac_table(dev, 2, t2->entries); + if (ret) + mlx4_warn(dev, "failed to set MAC table for port 2 (%d)\n", ret); + } + + if (ret) + mlx4_warn(dev, "failed to create mirror MAC tables\n"); +unlock: + mutex_unlock(&t2->mutex); + mutex_unlock(&t1->mutex); + return ret; +} + +int mlx4_unbond_mac_table(struct mlx4_dev *dev) +{ + struct mlx4_mac_table *t1 = &mlx4_priv(dev)->port[1].mac_table; + struct mlx4_mac_table *t2 = &mlx4_priv(dev)->port[2].mac_table; + int ret = 0; + int ret1; + int i; + bool update1 = false; + bool update2 = false; + + mutex_lock(&t1->mutex); + mutex_lock(&t2->mutex); + for (i = 0; i < MLX4_MAX_MAC_NUM; i++) { + if (t1->entries[i] != t2->entries[i]) { + mlx4_warn(dev, "mac table is in an unexpected state when trying to unbond\n"); + ret = -EINVAL; + goto unlock; + } + } + + for (i = 0; i < MLX4_MAX_MAC_NUM; i++) { + if (!t1->entries[i]) + continue; + t1->is_dup[i] = false; + if (!t1->refs[i]) { + t1->entries[i] = 0; + update1 = true; + } + t2->is_dup[i] = false; + if (!t2->refs[i]) { + t2->entries[i] = 0; + update2 = true; + } + } + + if (update1) { + ret = mlx4_set_port_mac_table(dev, 1, t1->entries); + if (ret) + mlx4_warn(dev, "failed to unmirror MAC tables for port 1(%d)\n", ret); + } + if (update2) { + ret1 = mlx4_set_port_mac_table(dev, 2, t2->entries); + if (ret1) { + mlx4_warn(dev, "failed to unmirror MAC tables for port 2(%d)\n", ret1); + ret = ret1; + } + } +unlock: + mutex_unlock(&t2->mutex); + mutex_unlock(&t1->mutex); + return ret; +} + +int mlx4_bond_vlan_table(struct mlx4_dev *dev) +{ + struct mlx4_vlan_table *t1 = &mlx4_priv(dev)->port[1].vlan_table; + struct mlx4_vlan_table *t2 = &mlx4_priv(dev)->port[2].vlan_table; + int ret = 0; + int i; + bool update1 = false; + bool update2 = false; + + mutex_lock(&t1->mutex); + mutex_lock(&t2->mutex); + for (i = 0; i < MLX4_MAX_VLAN_NUM; i++) { + if ((t1->entries[i] != t2->entries[i]) && + t1->entries[i] && t2->entries[i]) { + mlx4_warn(dev, "can't duplicate entry %d in vlan table\n", i); + ret = -EINVAL; + goto unlock; + } + } + + for (i = 0; i < MLX4_MAX_VLAN_NUM; i++) { + if (t1->entries[i] && !t2->entries[i]) { + t2->entries[i] = t1->entries[i]; + t2->is_dup[i] = true; + update2 = true; + } else if (!t1->entries[i] && t2->entries[i]) { + t1->entries[i] = t2->entries[i]; + t1->is_dup[i] = true; + update1 = true; + } else if (t1->entries[i] && t2->entries[i]) { + t1->is_dup[i] = true; + t2->is_dup[i] = true; + } + } + + if (update1) { + ret = mlx4_set_port_vlan_table(dev, 1, t1->entries); + if (ret) + mlx4_warn(dev, "failed to set VLAN table for port 1 (%d)\n", ret); + } + if (!ret && update2) { + ret = mlx4_set_port_vlan_table(dev, 2, t2->entries); + if (ret) + mlx4_warn(dev, "failed to set VLAN table for port 2 (%d)\n", ret); + } + + if (ret) + mlx4_warn(dev, "failed to create mirror VLAN tables\n"); +unlock: + mutex_unlock(&t2->mutex); + mutex_unlock(&t1->mutex); + return ret; +} + +int mlx4_unbond_vlan_table(struct mlx4_dev *dev) +{ + struct mlx4_vlan_table *t1 = &mlx4_priv(dev)->port[1].vlan_table; + struct mlx4_vlan_table *t2 = &mlx4_priv(dev)->port[2].vlan_table; + int ret = 0; + int ret1; + int i; + bool update1 = false; + bool update2 = false; + + mutex_lock(&t1->mutex); + mutex_lock(&t2->mutex); + for (i = 0; i < MLX4_MAX_VLAN_NUM; i++) { + if (t1->entries[i] != t2->entries[i]) { + mlx4_warn(dev, "vlan table is in an unexpected state when trying to unbond\n"); + ret = -EINVAL; + goto unlock; + } + } + + for (i = 0; i < MLX4_MAX_VLAN_NUM; i++) { + if (!t1->entries[i]) + continue; + t1->is_dup[i] = false; + if (!t1->refs[i]) { + t1->entries[i] = 0; + update1 = true; + } + t2->is_dup[i] = false; + if (!t2->refs[i]) { + t2->entries[i] = 0; + update2 = true; + } + } + + if (update1) { + ret = mlx4_set_port_vlan_table(dev, 1, t1->entries); + if (ret) + mlx4_warn(dev, "failed to unmirror VLAN tables for port 1(%d)\n", ret); + } + if (update2) { + ret1 = mlx4_set_port_vlan_table(dev, 2, t2->entries); + if (ret1) { + mlx4_warn(dev, "failed to unmirror VLAN tables for port 2(%d)\n", ret1); + ret = ret1; + } + } +unlock: + mutex_unlock(&t2->mutex); + mutex_unlock(&t1->mutex); + return ret; +} + int mlx4_get_port_ib_caps(struct mlx4_dev *dev, u8 port, __be32 *caps) { struct mlx4_cmd_mailbox *inmailbox, *outmailbox; @@ -484,8 +1071,6 @@ int mlx4_get_port_ib_caps(struct mlx4_dev *dev, u8 port, __be32 *caps) inbuf = inmailbox->buf; outbuf = outmailbox->buf; - memset(inbuf, 0, 256); - memset(outbuf, 0, 256); inbuf[0] = 1; inbuf[1] = 1; inbuf[2] = 1; @@ -504,29 +1089,159 @@ int mlx4_get_port_ib_caps(struct mlx4_dev *dev, u8 port, __be32 *caps) } static struct mlx4_roce_gid_entry zgid_entry; -int mlx4_get_slave_num_gids(struct mlx4_dev *dev, int slave) +int mlx4_get_slave_num_gids(struct mlx4_dev *dev, int slave, int port) { + int vfs; + int slave_gid = slave; + unsigned i; + struct mlx4_slaves_pport slaves_pport; + struct mlx4_active_ports actv_ports; + unsigned max_port_p_one; + if (slave == 0) return MLX4_ROCE_PF_GIDS; - if (slave <= ((MLX4_ROCE_MAX_GIDS - MLX4_ROCE_PF_GIDS) % dev->num_vfs)) - return ((MLX4_ROCE_MAX_GIDS - MLX4_ROCE_PF_GIDS) / dev->num_vfs) + 1; - return (MLX4_ROCE_MAX_GIDS - MLX4_ROCE_PF_GIDS) / dev->num_vfs; + + /* Slave is a VF */ + slaves_pport = mlx4_phys_to_slaves_pport(dev, port); + actv_ports = mlx4_get_active_ports(dev, slave); + max_port_p_one = find_first_bit(actv_ports.ports, dev->caps.num_ports) + + bitmap_weight(actv_ports.ports, dev->caps.num_ports) + 1; + + for (i = 1; i < max_port_p_one; i++) { + struct mlx4_active_ports exclusive_ports; + struct mlx4_slaves_pport slaves_pport_actv; + bitmap_zero(exclusive_ports.ports, dev->caps.num_ports); + set_bit(i - 1, exclusive_ports.ports); + if (i == port) + continue; + slaves_pport_actv = mlx4_phys_to_slaves_pport_actv( + dev, &exclusive_ports); + slave_gid -= bitmap_weight(slaves_pport_actv.slaves, + dev->persist->num_vfs + 1); + } + vfs = bitmap_weight(slaves_pport.slaves, dev->persist->num_vfs + 1) - 1; + if (slave_gid <= ((MLX4_ROCE_MAX_GIDS - MLX4_ROCE_PF_GIDS) % vfs)) + return ((MLX4_ROCE_MAX_GIDS - MLX4_ROCE_PF_GIDS) / vfs) + 1; + return (MLX4_ROCE_MAX_GIDS - MLX4_ROCE_PF_GIDS) / vfs; } -int mlx4_get_base_gid_ix(struct mlx4_dev *dev, int slave) +int mlx4_get_base_gid_ix(struct mlx4_dev *dev, int slave, int port) { int gids; + unsigned i; + int slave_gid = slave; int vfs; - gids = MLX4_ROCE_MAX_GIDS - MLX4_ROCE_PF_GIDS; - vfs = dev->num_vfs; + struct mlx4_slaves_pport slaves_pport; + struct mlx4_active_ports actv_ports; + unsigned max_port_p_one; if (slave == 0) return 0; - if (slave <= gids % vfs) - return MLX4_ROCE_PF_GIDS + ((gids / vfs) + 1) * (slave - 1); - return MLX4_ROCE_PF_GIDS + (gids % vfs) + ((gids / vfs) * (slave - 1)); + slaves_pport = mlx4_phys_to_slaves_pport(dev, port); + actv_ports = mlx4_get_active_ports(dev, slave); + max_port_p_one = find_first_bit(actv_ports.ports, dev->caps.num_ports) + + bitmap_weight(actv_ports.ports, dev->caps.num_ports) + 1; + + for (i = 1; i < max_port_p_one; i++) { + struct mlx4_active_ports exclusive_ports; + struct mlx4_slaves_pport slaves_pport_actv; + bitmap_zero(exclusive_ports.ports, dev->caps.num_ports); + set_bit(i - 1, exclusive_ports.ports); + if (i == port) + continue; + slaves_pport_actv = mlx4_phys_to_slaves_pport_actv( + dev, &exclusive_ports); + slave_gid -= bitmap_weight(slaves_pport_actv.slaves, + dev->persist->num_vfs + 1); + } + gids = MLX4_ROCE_MAX_GIDS - MLX4_ROCE_PF_GIDS; + vfs = bitmap_weight(slaves_pport.slaves, dev->persist->num_vfs + 1) - 1; + if (slave_gid <= gids % vfs) + return MLX4_ROCE_PF_GIDS + ((gids / vfs) + 1) * (slave_gid - 1); + + return MLX4_ROCE_PF_GIDS + (gids % vfs) + + ((gids / vfs) * (slave_gid - 1)); +} +EXPORT_SYMBOL_GPL(mlx4_get_base_gid_ix); + +static int mlx4_reset_roce_port_gids(struct mlx4_dev *dev, int slave, + int port, struct mlx4_cmd_mailbox *mailbox) +{ + struct mlx4_roce_gid_entry *gid_entry_mbox; + struct mlx4_priv *priv = mlx4_priv(dev); + int num_gids, base, offset; + int i, err; + + num_gids = mlx4_get_slave_num_gids(dev, slave, port); + base = mlx4_get_base_gid_ix(dev, slave, port); + + memset(mailbox->buf, 0, MLX4_MAILBOX_SIZE); + + mutex_lock(&(priv->port[port].gid_table.mutex)); + /* Zero-out gids belonging to that slave in the port GID table */ + for (i = 0, offset = base; i < num_gids; offset++, i++) + memcpy(priv->port[port].gid_table.roce_gids[offset].raw, + zgid_entry.raw, MLX4_ROCE_GID_ENTRY_SIZE); + + /* Now, copy roce port gids table to mailbox for passing to FW */ + gid_entry_mbox = (struct mlx4_roce_gid_entry *)mailbox->buf; + for (i = 0; i < MLX4_ROCE_MAX_GIDS; gid_entry_mbox++, i++) + memcpy(gid_entry_mbox->raw, + priv->port[port].gid_table.roce_gids[i].raw, + MLX4_ROCE_GID_ENTRY_SIZE); + + err = mlx4_cmd(dev, mailbox->dma, + ((u32)port) | (MLX4_SET_PORT_GID_TABLE << 8), + MLX4_SET_PORT_ETH_OPCODE, MLX4_CMD_SET_PORT, + MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); + mutex_unlock(&(priv->port[port].gid_table.mutex)); + return err; +} + + +void mlx4_reset_roce_gids(struct mlx4_dev *dev, int slave) +{ + struct mlx4_active_ports actv_ports; + struct mlx4_cmd_mailbox *mailbox; + int num_eth_ports, err; + int i; + + if (slave < 0 || slave > dev->persist->num_vfs) + return; + + actv_ports = mlx4_get_active_ports(dev, slave); + + for (i = 0, num_eth_ports = 0; i < dev->caps.num_ports; i++) { + if (test_bit(i, actv_ports.ports)) { + if (dev->caps.port_type[i + 1] != MLX4_PORT_TYPE_ETH) + continue; + num_eth_ports++; + } + } + + if (!num_eth_ports) + return; + + /* have ETH ports. Alloc mailbox for SET_PORT command */ + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) + return; + + for (i = 0; i < dev->caps.num_ports; i++) { + if (test_bit(i, actv_ports.ports)) { + if (dev->caps.port_type[i + 1] != MLX4_PORT_TYPE_ETH) + continue; + err = mlx4_reset_roce_port_gids(dev, slave, i + 1, mailbox); + if (err) + mlx4_warn(dev, "Could not reset ETH port GID table for slave %d, port %d (%d)\n", + slave, i + 1, err); + } + } + + mlx4_free_cmd_mailbox(dev, mailbox); + return; } static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod, @@ -555,21 +1270,17 @@ static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod, __be32 new_cap_mask; port = in_mod & 0xff; - in_modifier = (in_mod >> 8) & 0xff; + in_modifier = in_mod >> 8; is_eth = op_mod; port_info = &priv->port[port]; - if (op_mod > 1) - return -EINVAL; - /* Slaves cannot perform SET_PORT operations except changing MTU */ if (is_eth) { if (slave != dev->caps.function && in_modifier != MLX4_SET_PORT_GENERAL && in_modifier != MLX4_SET_PORT_GID_TABLE) { - mlx4_warn(dev, "denying SET_PORT for slave:%d," - "port %d, config_select 0x%x\n", - slave, port, in_modifier); + mlx4_warn(dev, "denying SET_PORT for slave:%d\n", + slave); return -EINVAL; } switch (in_modifier) { @@ -612,15 +1323,28 @@ static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod, } gen_context->mtu = cpu_to_be16(master->max_mtu[port]); + /* Slave cannot change Global Pause configuration */ + if (slave != mlx4_master_func_num(dev) && + ((gen_context->pptx != master->pptx) || + (gen_context->pprx != master->pprx))) { + gen_context->pptx = master->pptx; + gen_context->pprx = master->pprx; + mlx4_warn(dev, + "denying Global Pause change for slave:%d\n", + slave); + } else { + master->pptx = gen_context->pptx; + master->pprx = gen_context->pprx; + } break; case MLX4_SET_PORT_GID_TABLE: /* change to MULTIPLE entries: number of guest's gids * need a FOR-loop here over number of gids the guest has. * 1. Check no duplicates in gids passed by slave */ - num_gids = mlx4_get_slave_num_gids(dev, slave); - base = mlx4_get_base_gid_ix(dev, slave); - gid_entry_mbox = (struct mlx4_roce_gid_entry *) (inbox->buf); + num_gids = mlx4_get_slave_num_gids(dev, slave, port); + base = mlx4_get_base_gid_ix(dev, slave, port); + gid_entry_mbox = (struct mlx4_roce_gid_entry *)(inbox->buf); for (i = 0; i < num_gids; gid_entry_mbox++, i++) { if (!memcmp(gid_entry_mbox->raw, zgid_entry.raw, sizeof(zgid_entry))) @@ -641,13 +1365,15 @@ static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod, /* 2. Check that do not have duplicates in OTHER * entries in the port GID table */ + + mutex_lock(&(priv->port[port].gid_table.mutex)); for (i = 0; i < MLX4_ROCE_MAX_GIDS; i++) { if (i >= base && i < base + num_gids) continue; /* don't compare to slave's current gids */ - gid_entry_tbl = &priv->roce_gids[port - 1][i]; + gid_entry_tbl = &priv->port[port].gid_table.roce_gids[i]; if (!memcmp(gid_entry_tbl->raw, zgid_entry.raw, sizeof(zgid_entry))) continue; - gid_entry_mbox = (struct mlx4_roce_gid_entry *) (inbox->buf); + gid_entry_mbox = (struct mlx4_roce_gid_entry *)(inbox->buf); for (j = 0; j < num_gids; gid_entry_mbox++, j++) { if (!memcmp(gid_entry_mbox->raw, zgid_entry.raw, sizeof(zgid_entry))) @@ -655,31 +1381,45 @@ static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod, if (!memcmp(gid_entry_mbox->raw, gid_entry_tbl->raw, sizeof(gid_entry_tbl->raw))) { /* found duplicate */ - mlx4_warn(dev, "requested gid entry for slave:%d " - "is a duplicate of gid at index %d\n", + mlx4_warn(dev, "requested gid entry for slave:%d is a duplicate of gid at index %d\n", slave, i); + mutex_unlock(&(priv->port[port].gid_table.mutex)); return -EINVAL; } } } /* insert slave GIDs with memcpy, starting at slave's base index */ - gid_entry_mbox = (struct mlx4_roce_gid_entry *) (inbox->buf); + gid_entry_mbox = (struct mlx4_roce_gid_entry *)(inbox->buf); for (i = 0, offset = base; i < num_gids; gid_entry_mbox++, offset++, i++) - memcpy(priv->roce_gids[port - 1][offset].raw, gid_entry_mbox->raw, 16); + memcpy(priv->port[port].gid_table.roce_gids[offset].raw, + gid_entry_mbox->raw, MLX4_ROCE_GID_ENTRY_SIZE); /* Now, copy roce port gids table to current mailbox for passing to FW */ - gid_entry_mbox = (struct mlx4_roce_gid_entry *) (inbox->buf); + gid_entry_mbox = (struct mlx4_roce_gid_entry *)(inbox->buf); for (i = 0; i < MLX4_ROCE_MAX_GIDS; gid_entry_mbox++, i++) - memcpy(gid_entry_mbox->raw, priv->roce_gids[port - 1][i].raw, 16); + memcpy(gid_entry_mbox->raw, + priv->port[port].gid_table.roce_gids[i].raw, + MLX4_ROCE_GID_ENTRY_SIZE); - break; + err = mlx4_cmd(dev, inbox->dma, in_mod & 0xffff, op_mod, + MLX4_CMD_SET_PORT, MLX4_CMD_TIME_CLASS_B, + MLX4_CMD_NATIVE); + mutex_unlock(&(priv->port[port].gid_table.mutex)); + return err; } + return mlx4_cmd(dev, inbox->dma, in_mod & 0xffff, op_mod, MLX4_CMD_SET_PORT, MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); } + /* Slaves are not allowed to SET_PORT beacon (LED) blink */ + if (op_mod == MLX4_SET_PORT_BEACON_OPCODE) { + mlx4_warn(dev, "denying SET_PORT Beacon slave:%d\n", slave); + return -EPERM; + } + /* For IB, we only consider: * - The capability mask, which is set to the aggregate of all * slave function capabilities @@ -739,6 +1479,15 @@ int mlx4_SET_PORT_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_cmd_mailbox *outbox, struct mlx4_cmd_info *cmd) { + int port = mlx4_slave_convert_port( + dev, slave, vhcr->in_modifier & 0xFF); + + if (port < 0) + return -EINVAL; + + vhcr->in_modifier = (vhcr->in_modifier & ~0xFF) | + (port & 0xFF); + return mlx4_common_set_port(dev, slave, vhcr->in_modifier, vhcr->op_modifier, inbox); } @@ -755,51 +1504,43 @@ enum { int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port, int pkey_tbl_sz) { struct mlx4_cmd_mailbox *mailbox; - int err = -EINVAL, vl_cap, pkey_tbl_flag = 0; - u32 in_mod; + int err, vl_cap, pkey_tbl_flag = 0; - if (dev->caps.port_type[port] == MLX4_PORT_TYPE_NONE) + if (dev->caps.port_type[port] == MLX4_PORT_TYPE_ETH) return 0; mailbox = mlx4_alloc_cmd_mailbox(dev); if (IS_ERR(mailbox)) return PTR_ERR(mailbox); - memset(mailbox->buf, 0, 256); + ((__be32 *) mailbox->buf)[1] = dev->caps.ib_port_def_cap[port]; - if (dev->caps.port_type[port] == MLX4_PORT_TYPE_ETH) { - in_mod = MLX4_SET_PORT_GENERAL << 8 | port; - err = mlx4_cmd(dev, mailbox->dma, in_mod, 1, - MLX4_CMD_SET_PORT, MLX4_CMD_TIME_CLASS_B, - MLX4_CMD_WRAPPED); - } else { - ((__be32 *) mailbox->buf)[1] = dev->caps.ib_port_def_cap[port]; + if (pkey_tbl_sz >= 0 && mlx4_is_master(dev)) { + pkey_tbl_flag = 1; + ((__be16 *) mailbox->buf)[20] = cpu_to_be16(pkey_tbl_sz); + } - if (pkey_tbl_sz >= 0 && mlx4_is_master(dev)) { - pkey_tbl_flag = 1; - ((__be16 *) mailbox->buf)[20] = cpu_to_be16(pkey_tbl_sz); - } - - /* IB VL CAP enum isn't used by the firmware, just numerical values */ - for (vl_cap = dev->caps.vl_cap[port]; - vl_cap >= 1; vl_cap >>= 1) { - ((__be32 *) mailbox->buf)[0] = cpu_to_be32( - (1 << MLX4_CHANGE_PORT_MTU_CAP) | - (1 << MLX4_CHANGE_PORT_VL_CAP) | - (pkey_tbl_flag << MLX4_CHANGE_PORT_PKEY_TBL_SZ) | - (dev->caps.port_ib_mtu[port] << MLX4_SET_PORT_MTU_CAP) | - (vl_cap << MLX4_SET_PORT_VL_CAP)); - err = mlx4_cmd(dev, mailbox->dma, port, 0, MLX4_CMD_SET_PORT, - MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED); - if (err != -ENOMEM) - break; - } + /* IB VL CAP enum isn't used by the firmware, just numerical values */ + for (vl_cap = 8; vl_cap >= 1; vl_cap >>= 1) { + ((__be32 *) mailbox->buf)[0] = cpu_to_be32( + (1 << MLX4_CHANGE_PORT_MTU_CAP) | + (1 << MLX4_CHANGE_PORT_VL_CAP) | + (pkey_tbl_flag << MLX4_CHANGE_PORT_PKEY_TBL_SZ) | + (dev->caps.port_ib_mtu[port] << MLX4_SET_PORT_MTU_CAP) | + (vl_cap << MLX4_SET_PORT_VL_CAP)); + err = mlx4_cmd(dev, mailbox->dma, port, + MLX4_SET_PORT_IB_OPCODE, MLX4_CMD_SET_PORT, + MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED); + if (err != -ENOMEM) + break; } mlx4_free_cmd_mailbox(dev, mailbox); return err; } +#define SET_PORT_ROCE_2_FLAGS 0x10 +#define MLX4_SET_PORT_ROCE_V1_V2 0x2 int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu, u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx) { @@ -812,8 +1553,6 @@ int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu, if (IS_ERR(mailbox)) return PTR_ERR(mailbox); context = mailbox->buf; - memset(context, 0, sizeof *context); - context->flags = SET_PORT_GEN_ALL_VALID; context->mtu = cpu_to_be16(mtu); context->pptx = (pptx * (!pfctx)) << 7; @@ -821,9 +1560,15 @@ int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu, context->pprx = (pprx * (!pfcrx)) << 7; context->pfcrx = pfcrx; + if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ROCE_V1_V2) { + context->flags |= SET_PORT_ROCE_2_FLAGS; + context->roce_mode |= + MLX4_SET_PORT_ROCE_V1_V2 << 4; + } in_mod = MLX4_SET_PORT_GENERAL << 8 | port; - err = mlx4_cmd(dev, mailbox->dma, in_mod, 1, MLX4_CMD_SET_PORT, - MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED); + err = mlx4_cmd(dev, mailbox->dma, in_mod, MLX4_SET_PORT_ETH_OPCODE, + MLX4_CMD_SET_PORT, MLX4_CMD_TIME_CLASS_B, + MLX4_CMD_WRAPPED); mlx4_free_cmd_mailbox(dev, mailbox); return err; @@ -847,8 +1592,6 @@ int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn, if (IS_ERR(mailbox)) return PTR_ERR(mailbox); context = mailbox->buf; - memset(context, 0, sizeof *context); - context->base_qpn = cpu_to_be32(base_qpn); context->n_mac = dev->caps.log_num_macs; context->promisc = cpu_to_be32(promisc << SET_PORT_PROMISC_SHIFT | @@ -861,86 +1604,103 @@ int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn, context->vlan_miss = MLX4_VLAN_MISS_IDX; in_mod = MLX4_SET_PORT_RQP_CALC << 8 | port; - err = mlx4_cmd(dev, mailbox->dma, in_mod, 1, MLX4_CMD_SET_PORT, - MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED); + err = mlx4_cmd(dev, mailbox->dma, in_mod, MLX4_SET_PORT_ETH_OPCODE, + MLX4_CMD_SET_PORT, MLX4_CMD_TIME_CLASS_B, + MLX4_CMD_WRAPPED); mlx4_free_cmd_mailbox(dev, mailbox); return err; } EXPORT_SYMBOL(mlx4_SET_PORT_qpn_calc); -int mlx4_SET_PORT_PRIO2TC(struct mlx4_dev *dev, u8 port, u8 *prio2tc) +int mlx4_SET_PORT_fcs_check(struct mlx4_dev *dev, u8 port, u8 ignore_fcs_value) { struct mlx4_cmd_mailbox *mailbox; - struct mlx4_set_port_prio2tc_context *context; - int err; + struct mlx4_set_port_general_context *context; u32 in_mod; - int i; + int err; mailbox = mlx4_alloc_cmd_mailbox(dev); if (IS_ERR(mailbox)) return PTR_ERR(mailbox); context = mailbox->buf; - memset(context, 0, sizeof *context); + context->v_ignore_fcs |= MLX4_FLAG_V_IGNORE_FCS_MASK; + if (ignore_fcs_value) + context->ignore_fcs |= MLX4_IGNORE_FCS_MASK; + else + context->ignore_fcs &= ~MLX4_IGNORE_FCS_MASK; - for (i = 0; i < MLX4_NUM_UP; i += 2) - context->prio2tc[i >> 1] = prio2tc[i] << 4 | prio2tc[i + 1]; - - in_mod = MLX4_SET_PORT_PRIO2TC << 8 | port; + in_mod = MLX4_SET_PORT_GENERAL << 8 | port; err = mlx4_cmd(dev, mailbox->dma, in_mod, 1, MLX4_CMD_SET_PORT, MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); mlx4_free_cmd_mailbox(dev, mailbox); return err; } -EXPORT_SYMBOL(mlx4_SET_PORT_PRIO2TC); +EXPORT_SYMBOL(mlx4_SET_PORT_fcs_check); -int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw, - u8 *pg, u16 *ratelimit) +enum { + VXLAN_ENABLE_MODIFY = 1 << 7, + VXLAN_STEERING_MODIFY = 1 << 6, + + VXLAN_ENABLE = 1 << 7, +}; + +struct mlx4_set_port_vxlan_context { + u32 reserved1; + u8 modify_flags; + u8 reserved2; + u8 enable_flags; + u8 steering; +}; + +int mlx4_SET_PORT_VXLAN(struct mlx4_dev *dev, u8 port, u8 steering, int enable) { - struct mlx4_cmd_mailbox *mailbox; - struct mlx4_set_port_scheduler_context *context; int err; u32 in_mod; - int i; + struct mlx4_cmd_mailbox *mailbox; + struct mlx4_set_port_vxlan_context *context; mailbox = mlx4_alloc_cmd_mailbox(dev); if (IS_ERR(mailbox)) return PTR_ERR(mailbox); context = mailbox->buf; - memset(context, 0, sizeof *context); + memset(context, 0, sizeof(*context)); - for (i = 0; i < MLX4_NUM_TC; i++) { - struct mlx4_port_scheduler_tc_cfg_be *tc = &context->tc[i]; - u16 r; - if (ratelimit && ratelimit[i]) { - if (ratelimit[i] <= MLX4_MAX_100M_UNITS_VAL) { - r = ratelimit[i]; - tc->max_bw_units = - htons(MLX4_RATELIMIT_100M_UNITS); - } else { - r = ratelimit[i]/10; - tc->max_bw_units = - htons(MLX4_RATELIMIT_1G_UNITS); - } - tc->max_bw_value = htons(r); - } else { - tc->max_bw_value = htons(MLX4_RATELIMIT_DEFAULT); - tc->max_bw_units = htons(MLX4_RATELIMIT_1G_UNITS); - } + context->modify_flags = VXLAN_ENABLE_MODIFY | VXLAN_STEERING_MODIFY; + if (enable) + context->enable_flags = VXLAN_ENABLE; + context->steering = steering; - tc->pg = htons(pg[i]); - tc->bw_precentage = htons(tc_tx_bw[i]); - } - - in_mod = MLX4_SET_PORT_SCHEDULER << 8 | port; - err = mlx4_cmd(dev, mailbox->dma, in_mod, 1, MLX4_CMD_SET_PORT, - MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); + in_mod = MLX4_SET_PORT_VXLAN << 8 | port; + err = mlx4_cmd(dev, mailbox->dma, in_mod, MLX4_SET_PORT_ETH_OPCODE, + MLX4_CMD_SET_PORT, MLX4_CMD_TIME_CLASS_B, + MLX4_CMD_NATIVE); mlx4_free_cmd_mailbox(dev, mailbox); return err; } -EXPORT_SYMBOL(mlx4_SET_PORT_SCHEDULER); +EXPORT_SYMBOL(mlx4_SET_PORT_VXLAN); + +int mlx4_SET_PORT_BEACON(struct mlx4_dev *dev, u8 port, u16 time) +{ + int err; + struct mlx4_cmd_mailbox *mailbox; + + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) + return PTR_ERR(mailbox); + + *((__be32 *)mailbox->buf) = cpu_to_be32(time); + + err = mlx4_cmd(dev, mailbox->dma, port, MLX4_SET_PORT_BEACON_OPCODE, + MLX4_CMD_SET_PORT, MLX4_CMD_TIME_CLASS_B, + MLX4_CMD_NATIVE); + + mlx4_free_cmd_mailbox(dev, mailbox); + return err; +} +EXPORT_SYMBOL(mlx4_SET_PORT_BEACON); int mlx4_SET_MCAST_FLTR_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_vhcr *vhcr, @@ -982,48 +1742,115 @@ int mlx4_DUMP_ETH_STATS_wrapper(struct mlx4_dev *dev, int slave, return 0; } -int mlx4_get_slave_from_roce_gid(struct mlx4_dev *dev, int port, u8 *gid, int *slave_id) +int mlx4_get_slave_from_roce_gid(struct mlx4_dev *dev, int port, u8 *gid, + int *slave_id) { struct mlx4_priv *priv = mlx4_priv(dev); int i, found_ix = -1; int vf_gids = MLX4_ROCE_MAX_GIDS - MLX4_ROCE_PF_GIDS; + struct mlx4_slaves_pport slaves_pport; + unsigned num_vfs; + int slave_gid; if (!mlx4_is_mfunc(dev)) return -EINVAL; + slaves_pport = mlx4_phys_to_slaves_pport(dev, port); + num_vfs = bitmap_weight(slaves_pport.slaves, + dev->persist->num_vfs + 1) - 1; + for (i = 0; i < MLX4_ROCE_MAX_GIDS; i++) { - if (!memcmp(priv->roce_gids[port - 1][i].raw, gid, 16)) { + if (!memcmp(priv->port[port].gid_table.roce_gids[i].raw, gid, + MLX4_ROCE_GID_ENTRY_SIZE)) { found_ix = i; break; } } if (found_ix >= 0) { + /* Calculate a slave_gid which is the slave number in the gid + * table and not a globally unique slave number. + */ if (found_ix < MLX4_ROCE_PF_GIDS) - *slave_id = 0; - else if (found_ix < MLX4_ROCE_PF_GIDS + (vf_gids % dev->num_vfs) * - (vf_gids / dev->num_vfs + 1)) - *slave_id = ((found_ix - MLX4_ROCE_PF_GIDS) / - (vf_gids / dev->num_vfs + 1)) + 1; + slave_gid = 0; + else if (found_ix < MLX4_ROCE_PF_GIDS + (vf_gids % num_vfs) * + (vf_gids / num_vfs + 1)) + slave_gid = ((found_ix - MLX4_ROCE_PF_GIDS) / + (vf_gids / num_vfs + 1)) + 1; else - *slave_id = + slave_gid = ((found_ix - MLX4_ROCE_PF_GIDS - - ((vf_gids % dev->num_vfs) * ((vf_gids / dev->num_vfs + 1)))) / - (vf_gids / dev->num_vfs)) + vf_gids % dev->num_vfs + 1; + ((vf_gids % num_vfs) * ((vf_gids / num_vfs + 1)))) / + (vf_gids / num_vfs)) + vf_gids % num_vfs + 1; + + /* Calculate the globally unique slave id */ + if (slave_gid) { + struct mlx4_active_ports exclusive_ports; + struct mlx4_active_ports actv_ports; + struct mlx4_slaves_pport slaves_pport_actv; + unsigned max_port_p_one; + int num_vfs_before = 0; + int candidate_slave_gid; + + /* Calculate how many VFs are on the previous port, if exists */ + for (i = 1; i < port; i++) { + bitmap_zero(exclusive_ports.ports, dev->caps.num_ports); + set_bit(i - 1, exclusive_ports.ports); + slaves_pport_actv = + mlx4_phys_to_slaves_pport_actv( + dev, &exclusive_ports); + num_vfs_before += bitmap_weight( + slaves_pport_actv.slaves, + dev->persist->num_vfs + 1); + } + + /* candidate_slave_gid isn't necessarily the correct slave, but + * it has the same number of ports and is assigned to the same + * ports as the real slave we're looking for. On dual port VF, + * slave_gid = [single port VFs on port ] + + * [offset of the current slave from the first dual port VF] + + * 1 (for the PF). + */ + candidate_slave_gid = slave_gid + num_vfs_before; + + actv_ports = mlx4_get_active_ports(dev, candidate_slave_gid); + max_port_p_one = find_first_bit( + actv_ports.ports, dev->caps.num_ports) + + bitmap_weight(actv_ports.ports, + dev->caps.num_ports) + 1; + + /* Calculate the real slave number */ + for (i = 1; i < max_port_p_one; i++) { + if (i == port) + continue; + bitmap_zero(exclusive_ports.ports, + dev->caps.num_ports); + set_bit(i - 1, exclusive_ports.ports); + slaves_pport_actv = + mlx4_phys_to_slaves_pport_actv( + dev, &exclusive_ports); + slave_gid += bitmap_weight( + slaves_pport_actv.slaves, + dev->persist->num_vfs + 1); + } + } + *slave_id = slave_gid; } return (found_ix >= 0) ? 0 : -EINVAL; } EXPORT_SYMBOL(mlx4_get_slave_from_roce_gid); -int mlx4_get_roce_gid_from_slave(struct mlx4_dev *dev, int port, int slave_id, u8 *gid) +int mlx4_get_roce_gid_from_slave(struct mlx4_dev *dev, int port, int slave_id, + u8 *gid) { struct mlx4_priv *priv = mlx4_priv(dev); if (!mlx4_is_master(dev)) return -EINVAL; - memcpy(gid, priv->roce_gids[port - 1][slave_id].raw, 16); + memcpy(gid, priv->port[port].gid_table.roce_gids[slave_id].raw, + MLX4_ROCE_GID_ENTRY_SIZE); return 0; } EXPORT_SYMBOL(mlx4_get_roce_gid_from_slave); @@ -1047,15 +1874,15 @@ struct mlx4_cable_info { }; enum cable_info_err { - CABLE_INF_INV_PORT = 0x1, - CABLE_INF_OP_NOSUP = 0x2, - CABLE_INF_NOT_CONN = 0x3, - CABLE_INF_NO_EEPRM = 0x4, - CABLE_INF_PAGE_ERR = 0x5, - CABLE_INF_INV_ADDR = 0x6, - CABLE_INF_I2C_ADDR = 0x7, - CABLE_INF_QSFP_VIO = 0x8, - CABLE_INF_I2C_BUSY = 0x9, + CABLE_INF_INV_PORT = 0x1, + CABLE_INF_OP_NOSUP = 0x2, + CABLE_INF_NOT_CONN = 0x3, + CABLE_INF_NO_EEPRM = 0x4, + CABLE_INF_PAGE_ERR = 0x5, + CABLE_INF_INV_ADDR = 0x6, + CABLE_INF_I2C_ADDR = 0x7, + CABLE_INF_QSFP_VIO = 0x8, + CABLE_INF_I2C_BUSY = 0x9, }; #define MAD_STATUS_2_CABLE_ERR(mad_status) ((mad_status >> 8) & 0xFF) @@ -1102,8 +1929,8 @@ static inline const char *cable_info_mad_err_str(u16 mad_status) * Returns num of read bytes on success or a negative error * code. */ -int mlx4_get_module_info(struct mlx4_dev *dev, u8 port, u16 offset, - u16 size, u8 *data) +int mlx4_get_module_info(struct mlx4_dev *dev, u8 port, + u16 offset, u16 size, u8 *data) { struct mlx4_cmd_mailbox *inbox, *outbox; struct mlx4_mad_ifc *inmad, *outmad; @@ -1115,17 +1942,12 @@ int mlx4_get_module_info(struct mlx4_dev *dev, u8 port, u16 offset, size = MODULE_INFO_MAX_READ; inbox = mlx4_alloc_cmd_mailbox(dev); - if (IS_ERR(inbox)) { - mlx4_err(dev, - "mlx4_alloc_cmd_mailbox returned with error(%lx)", PTR_ERR(inbox)); + if (IS_ERR(inbox)) return PTR_ERR(inbox); - } outbox = mlx4_alloc_cmd_mailbox(dev); if (IS_ERR(outbox)) { mlx4_free_cmd_mailbox(dev, inbox); - mlx4_err(dev, - "mlx4_alloc_cmd_mailbox returned with error(%lx)", PTR_ERR(outbox)); return PTR_ERR(outbox); } @@ -1158,7 +1980,8 @@ int mlx4_get_module_info(struct mlx4_dev *dev, u8 port, u16 offset, cable_info->size = cpu_to_be16(size); ret = mlx4_cmd_box(dev, inbox->dma, outbox->dma, port, 3, - MLX4_CMD_MAD_IFC, MLX4_CMD_TIME_CLASS_C, MLX4_CMD_NATIVE); + MLX4_CMD_MAD_IFC, MLX4_CMD_TIME_CLASS_C, + MLX4_CMD_NATIVE); if (ret) goto out; @@ -1166,10 +1989,10 @@ int mlx4_get_module_info(struct mlx4_dev *dev, u8 port, u16 offset, /* Mad returned with bad status */ ret = be16_to_cpu(outmad->status); #ifdef DEBUG - mlx4_warn(dev, "MLX4_CMD_MAD_IFC Get Module info attr(%x) " - "port(%d) i2c_addr(%x) offset(%d) size(%d): Response " - "Mad Status(%x) - %s\n", 0xFF60, port, i2c_addr, offset, - size, ret, cable_info_mad_err_str(ret)); + mlx4_warn(dev, + "MLX4_CMD_MAD_IFC Get Module info attr(%x) port(%d) i2c_addr(%x) offset(%d) size(%d): Response Mad Status(%x) - %s\n", + 0xFF60, port, i2c_addr, offset, size, + ret, cable_info_mad_err_str(ret)); #endif if (i2c_addr == I2C_ADDR_HIGH && MAD_STATUS_2_CABLE_ERR(ret) == CABLE_INF_I2C_ADDR) diff --git a/sys/dev/mlx4/mlx4_core/mlx4_profile.c b/sys/dev/mlx4/mlx4_core/mlx4_profile.c index 46239313d4b0..aff76dd9bdb0 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_profile.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_profile.c @@ -76,13 +76,12 @@ u64 mlx4_make_profile(struct mlx4_dev *dev, u64 size; u64 start; int type; - u64 num; + u32 num; int log_num; }; u64 total_size = 0; struct mlx4_resource *profile; - struct mlx4_resource tmp; int i, j; profile = kcalloc(MLX4_RES_NUM, sizeof(*profile), GFP_KERNEL); @@ -107,13 +106,11 @@ u64 mlx4_make_profile(struct mlx4_dev *dev, profile[MLX4_RES_AUXC].num = request->num_qp; profile[MLX4_RES_SRQ].num = request->num_srq; profile[MLX4_RES_CQ].num = request->num_cq; - profile[MLX4_RES_EQ].num = mlx4_is_mfunc(dev) ? - dev->phys_caps.num_phys_eqs : + profile[MLX4_RES_EQ].num = mlx4_is_mfunc(dev) ? dev->phys_caps.num_phys_eqs : min_t(unsigned, dev_cap->max_eqs, MAX_MSIX); profile[MLX4_RES_DMPT].num = request->num_mpt; profile[MLX4_RES_CMPT].num = MLX4_NUM_CMPTS; - profile[MLX4_RES_MTT].num = ((u64)request->num_mtt_segs) * - (1 << log_mtts_per_seg); + profile[MLX4_RES_MTT].num = request->num_mtt * (1 << log_mtts_per_seg); profile[MLX4_RES_MCG].num = request->num_mcg; for (i = 0; i < MLX4_RES_NUM; ++i) { @@ -132,11 +129,8 @@ u64 mlx4_make_profile(struct mlx4_dev *dev, */ for (i = MLX4_RES_NUM; i > 0; --i) for (j = 1; j < i; ++j) { - if (profile[j].size > profile[j - 1].size) { - tmp = profile[j]; - profile[j] = profile[j - 1]; - profile[j - 1] = tmp; - } + if (profile[j].size > profile[j - 1].size) + swap(profile[j], profile[j - 1]); } for (i = 0; i < MLX4_RES_NUM; ++i) { @@ -146,18 +140,17 @@ u64 mlx4_make_profile(struct mlx4_dev *dev, } if (total_size > dev_cap->max_icm_sz) { - mlx4_err(dev, "Profile requires 0x%llx bytes; " - "won't fit in 0x%llx bytes of context memory.\n", - (unsigned long long) total_size, - (unsigned long long) dev_cap->max_icm_sz); + mlx4_err(dev, "Profile requires 0x%llx bytes; won't fit in 0x%llx bytes of context memory\n", + (unsigned long long) total_size, + (unsigned long long) dev_cap->max_icm_sz); kfree(profile); return -ENOMEM; } if (profile[i].size) - mlx4_dbg(dev, " profile[%2d] (%6s): 2^%02d entries @ 0x%10llx, " - "size 0x%10llx\n", - i, res_name[profile[i].type], profile[i].log_num, + mlx4_dbg(dev, " profile[%2d] (%6s): 2^%02d entries @ 0x%10llx, size 0x%10llx\n", + i, res_name[profile[i].type], + profile[i].log_num, (unsigned long long) profile[i].start, (unsigned long long) profile[i].size); } @@ -200,15 +193,16 @@ u64 mlx4_make_profile(struct mlx4_dev *dev, break; case MLX4_RES_EQ: if (dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_SYS_EQS) { - init_hca->log_num_eqs = 0x1f; - init_hca->eqc_base = profile[i].start; - init_hca->num_sys_eqs = dev_cap->num_sys_eqs; + init_hca->log_num_eqs = 0x1f; + init_hca->eqc_base = profile[i].start; + init_hca->num_sys_eqs = dev_cap->num_sys_eqs; } else { - dev->caps.num_eqs = roundup_pow_of_two( - min_t(unsigned, - dev_cap->max_eqs, MAX_MSIX)); - init_hca->eqc_base = profile[i].start; - init_hca->log_num_eqs = ilog2(dev->caps.num_eqs); + dev->caps.num_eqs = roundup_pow_of_two( + min_t(unsigned, + dev_cap->max_eqs, + MAX_MSIX)); + init_hca->eqc_base = profile[i].start; + init_hca->log_num_eqs = ilog2(dev->caps.num_eqs); } break; case MLX4_RES_DMPT: diff --git a/sys/dev/mlx4/mlx4_core/mlx4_qp.c b/sys/dev/mlx4/mlx4_core/mlx4_qp.c index 3b40b4563d16..be435776591a 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_qp.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_qp.c @@ -43,9 +43,7 @@ #include "mlx4.h" #include "icm.h" -/* - * QP to support BF should have bits 6,7 cleared - */ +/* QP to support BF should have bits 6,7 cleared */ #define MLX4_BF_QP_SKIP_MASK 0xc0 #define MLX4_MAX_BF_QP_RANGE 0x40 @@ -170,6 +168,12 @@ static int __mlx4_qp_modify(struct mlx4_dev *dev, struct mlx4_mtt *mtt, context->log_page_size = mtt->page_shift - MLX4_ICM_PAGE_SHIFT; } + if ((cur_state == MLX4_QP_STATE_RTR) && + (new_state == MLX4_QP_STATE_RTS) && + dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ROCE_V1_V2) + context->roce_entropy = + cpu_to_be16(mlx4_qp_roce_entropy(dev, qp->qpn)); + *(__be32 *) mailbox->buf = cpu_to_be32(optpar); memcpy(mailbox->buf + 8, context, sizeof *context); @@ -216,19 +220,25 @@ EXPORT_SYMBOL_GPL(mlx4_qp_modify); int __mlx4_qp_reserve_range(struct mlx4_dev *dev, int cnt, int align, int *base, u8 flags) { - int bf_qp = !!(flags & (u8) MLX4_RESERVE_BF_QP); + u32 uid; + int bf_qp = !!(flags & (u8)MLX4_RESERVE_ETH_BF_QP); struct mlx4_priv *priv = mlx4_priv(dev); struct mlx4_qp_table *qp_table = &priv->qp_table; - /* Only IPoIB uses a large cnt. In this case, just allocate - * as usual, ignoring bf skipping, since IPoIB does not run over RoCE - */ if (cnt > MLX4_MAX_BF_QP_RANGE && bf_qp) - bf_qp = 0; + return -ENOMEM; - *base = mlx4_bitmap_alloc_range(&qp_table->bitmap, cnt, align, - bf_qp ? MLX4_BF_QP_SKIP_MASK : 0); + uid = MLX4_QP_TABLE_ZONE_GENERAL; + if (flags & (u8)MLX4_RESERVE_A0_QP) { + if (bf_qp) + uid = MLX4_QP_TABLE_ZONE_RAW_ETH; + else + uid = MLX4_QP_TABLE_ZONE_RSS; + } + + *base = mlx4_zone_alloc_entries(qp_table->zones, uid, cnt, align, + bf_qp ? MLX4_BF_QP_SKIP_MASK : 0, NULL); if (*base == -1) return -ENOMEM; @@ -246,7 +256,7 @@ int mlx4_qp_reserve_range(struct mlx4_dev *dev, int cnt, int align, flags &= dev->caps.alloc_res_qp_mask; if (mlx4_is_mfunc(dev)) { - set_param_l(&in_param, (((u32) flags) << 24) | (u32) cnt); + set_param_l(&in_param, (((u32)flags) << 24) | (u32)cnt); set_param_h(&in_param, align); err = mlx4_cmd_imm(dev, in_param, &out_param, RES_QP, RES_OP_RESERVE, @@ -269,7 +279,7 @@ void __mlx4_qp_release_range(struct mlx4_dev *dev, int base_qpn, int cnt) if (mlx4_is_qp_reserved(dev, (u32) base_qpn)) return; - mlx4_bitmap_free_range(&qp_table->bitmap, base_qpn, cnt, MLX4_USE_RR); + mlx4_zone_free_entries_unique(qp_table->zones, base_qpn, cnt); } void mlx4_qp_release_range(struct mlx4_dev *dev, int base_qpn, int cnt) @@ -284,37 +294,37 @@ void mlx4_qp_release_range(struct mlx4_dev *dev, int base_qpn, int cnt) MLX4_CMD_FREE_RES, MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED); if (err) { - mlx4_warn(dev, "Failed to release qp range" - " base:%d cnt:%d\n", base_qpn, cnt); + mlx4_warn(dev, "Failed to release qp range base:%d cnt:%d\n", + base_qpn, cnt); } } else __mlx4_qp_release_range(dev, base_qpn, cnt); } EXPORT_SYMBOL_GPL(mlx4_qp_release_range); -int __mlx4_qp_alloc_icm(struct mlx4_dev *dev, int qpn) +int __mlx4_qp_alloc_icm(struct mlx4_dev *dev, int qpn, gfp_t gfp) { struct mlx4_priv *priv = mlx4_priv(dev); struct mlx4_qp_table *qp_table = &priv->qp_table; int err; - err = mlx4_table_get(dev, &qp_table->qp_table, qpn); + err = mlx4_table_get(dev, &qp_table->qp_table, qpn, gfp); if (err) goto err_out; - err = mlx4_table_get(dev, &qp_table->auxc_table, qpn); + err = mlx4_table_get(dev, &qp_table->auxc_table, qpn, gfp); if (err) goto err_put_qp; - err = mlx4_table_get(dev, &qp_table->altc_table, qpn); + err = mlx4_table_get(dev, &qp_table->altc_table, qpn, gfp); if (err) goto err_put_auxc; - err = mlx4_table_get(dev, &qp_table->rdmarc_table, qpn); + err = mlx4_table_get(dev, &qp_table->rdmarc_table, qpn, gfp); if (err) goto err_put_altc; - err = mlx4_table_get(dev, &qp_table->cmpt_table, qpn); + err = mlx4_table_get(dev, &qp_table->cmpt_table, qpn, gfp); if (err) goto err_put_rdmarc; @@ -336,7 +346,7 @@ int __mlx4_qp_alloc_icm(struct mlx4_dev *dev, int qpn) return err; } -static int mlx4_qp_alloc_icm(struct mlx4_dev *dev, int qpn) +static int mlx4_qp_alloc_icm(struct mlx4_dev *dev, int qpn, gfp_t gfp) { u64 param = 0; @@ -346,7 +356,7 @@ static int mlx4_qp_alloc_icm(struct mlx4_dev *dev, int qpn) MLX4_CMD_ALLOC_RES, MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED); } - return __mlx4_qp_alloc_icm(dev, qpn); + return __mlx4_qp_alloc_icm(dev, qpn, gfp); } void __mlx4_qp_free_icm(struct mlx4_dev *dev, int qpn) @@ -375,7 +385,7 @@ static void mlx4_qp_free_icm(struct mlx4_dev *dev, int qpn) __mlx4_qp_free_icm(dev, qpn); } -int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp) +int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp, gfp_t gfp) { struct mlx4_priv *priv = mlx4_priv(dev); struct mlx4_qp_table *qp_table = &priv->qp_table; @@ -386,7 +396,7 @@ int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp) qp->qpn = qpn; - err = mlx4_qp_alloc_icm(dev, qpn); + err = mlx4_qp_alloc_icm(dev, qpn, gfp); if (err) return err; @@ -409,6 +419,75 @@ int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp) EXPORT_SYMBOL_GPL(mlx4_qp_alloc); +int mlx4_update_qp(struct mlx4_dev *dev, u32 qpn, + enum mlx4_update_qp_attr attr, + struct mlx4_update_qp_params *params) +{ + struct mlx4_cmd_mailbox *mailbox; + struct mlx4_update_qp_context *cmd; + u64 pri_addr_path_mask = 0; + u64 qp_mask = 0; + int err = 0; + + if (!attr || (attr & ~MLX4_UPDATE_QP_SUPPORTED_ATTRS)) + return -EINVAL; + + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) + return PTR_ERR(mailbox); + + cmd = (struct mlx4_update_qp_context *)mailbox->buf; + + if (attr & MLX4_UPDATE_QP_SMAC) { + pri_addr_path_mask |= 1ULL << MLX4_UPD_QP_PATH_MASK_MAC_INDEX; + cmd->qp_context.pri_path.grh_mylmc = params->smac_index; + } + + if (attr & MLX4_UPDATE_QP_ETH_SRC_CHECK_MC_LB) { + if (!(dev->caps.flags2 + & MLX4_DEV_CAP_FLAG2_UPDATE_QP_SRC_CHECK_LB)) { + mlx4_warn(dev, + "Trying to set src check LB, but it isn't supported\n"); + err = -ENOTSUPP; + goto out; + } + pri_addr_path_mask |= + 1ULL << MLX4_UPD_QP_PATH_MASK_ETH_SRC_CHECK_MC_LB; + if (params->flags & + MLX4_UPDATE_QP_PARAMS_FLAGS_ETH_CHECK_MC_LB) { + cmd->qp_context.pri_path.fl |= + MLX4_FL_ETH_SRC_CHECK_MC_LB; + } + } + + if (attr & MLX4_UPDATE_QP_VSD) { + qp_mask |= 1ULL << MLX4_UPD_QP_MASK_VSD; + if (params->flags & MLX4_UPDATE_QP_PARAMS_FLAGS_VSD_ENABLE) + cmd->qp_context.param3 |= cpu_to_be32(MLX4_STRIP_VLAN); + } + + if (attr & MLX4_UPDATE_QP_RATE_LIMIT) { + qp_mask |= 1ULL << MLX4_UPD_QP_MASK_RATE_LIMIT; + cmd->qp_context.rate_limit_params = cpu_to_be16((params->rate_unit << 14) | params->rate_val); + } + + if (attr & MLX4_UPDATE_QP_QOS_VPORT) { + qp_mask |= 1ULL << MLX4_UPD_QP_MASK_QOS_VPP; + cmd->qp_context.qos_vport = params->qos_vport; + } + + cmd->primary_addr_path_mask = cpu_to_be64(pri_addr_path_mask); + cmd->qp_mask = cpu_to_be64(qp_mask); + + err = mlx4_cmd(dev, mailbox->dma, qpn & 0xffffff, 0, + MLX4_CMD_UPDATE_QP, MLX4_CMD_TIME_CLASS_A, + MLX4_CMD_NATIVE); +out: + mlx4_free_cmd_mailbox(dev, mailbox); + return err; +} +EXPORT_SYMBOL_GPL(mlx4_update_qp); + void mlx4_qp_remove(struct mlx4_dev *dev, struct mlx4_qp *qp) { struct mlx4_qp_table *qp_table = &mlx4_priv(dev)->qp_table; @@ -436,6 +515,227 @@ static int mlx4_CONF_SPECIAL_QP(struct mlx4_dev *dev, u32 base_qpn) MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); } +#define MLX4_QP_TABLE_RSS_ETH_PRIORITY 2 +#define MLX4_QP_TABLE_RAW_ETH_PRIORITY 1 +#define MLX4_QP_TABLE_RAW_ETH_SIZE 256 + +static int mlx4_create_zones(struct mlx4_dev *dev, + u32 reserved_bottom_general, + u32 reserved_top_general, + u32 reserved_bottom_rss, + u32 start_offset_rss, + u32 max_table_offset) +{ + struct mlx4_qp_table *qp_table = &mlx4_priv(dev)->qp_table; + struct mlx4_bitmap (*bitmap)[MLX4_QP_TABLE_ZONE_NUM] = NULL; + int bitmap_initialized = 0; + u32 last_offset; + int k; + int err; + + qp_table->zones = mlx4_zone_allocator_create(MLX4_ZONE_ALLOC_FLAGS_NO_OVERLAP); + + if (NULL == qp_table->zones) + return -ENOMEM; + + bitmap = kmalloc(sizeof(*bitmap), GFP_KERNEL); + + if (NULL == bitmap) { + err = -ENOMEM; + goto free_zone; + } + + err = mlx4_bitmap_init(*bitmap + MLX4_QP_TABLE_ZONE_GENERAL, dev->caps.num_qps, + (1 << 23) - 1, reserved_bottom_general, + reserved_top_general); + + if (err) + goto free_bitmap; + + ++bitmap_initialized; + + err = mlx4_zone_add_one(qp_table->zones, *bitmap + MLX4_QP_TABLE_ZONE_GENERAL, + MLX4_ZONE_FALLBACK_TO_HIGHER_PRIO | + MLX4_ZONE_USE_RR, 0, + 0, qp_table->zones_uids + MLX4_QP_TABLE_ZONE_GENERAL); + + if (err) + goto free_bitmap; + + err = mlx4_bitmap_init(*bitmap + MLX4_QP_TABLE_ZONE_RSS, + reserved_bottom_rss, + reserved_bottom_rss - 1, + dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW], + reserved_bottom_rss - start_offset_rss); + + if (err) + goto free_bitmap; + + ++bitmap_initialized; + + err = mlx4_zone_add_one(qp_table->zones, *bitmap + MLX4_QP_TABLE_ZONE_RSS, + MLX4_ZONE_ALLOW_ALLOC_FROM_LOWER_PRIO | + MLX4_ZONE_ALLOW_ALLOC_FROM_EQ_PRIO | + MLX4_ZONE_USE_RR, MLX4_QP_TABLE_RSS_ETH_PRIORITY, + 0, qp_table->zones_uids + MLX4_QP_TABLE_ZONE_RSS); + + if (err) + goto free_bitmap; + + last_offset = dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW]; + /* We have a single zone for the A0 steering QPs area of the FW. This area + * needs to be split into subareas. One set of subareas is for RSS QPs + * (in which qp number bits 6 and/or 7 are set); the other set of subareas + * is for RAW_ETH QPs, which require that both bits 6 and 7 are zero. + * Currently, the values returned by the FW (A0 steering area starting qp number + * and A0 steering area size) are such that there are only two subareas -- one + * for RSS and one for RAW_ETH. + */ + for (k = MLX4_QP_TABLE_ZONE_RSS + 1; k < sizeof(*bitmap)/sizeof((*bitmap)[0]); + k++) { + int size; + u32 offset = start_offset_rss; + u32 bf_mask; + u32 requested_size; + + /* Assuming MLX4_BF_QP_SKIP_MASK is consecutive ones, this calculates + * a mask of all LSB bits set until (and not including) the first + * set bit of MLX4_BF_QP_SKIP_MASK. For example, if MLX4_BF_QP_SKIP_MASK + * is 0xc0, bf_mask will be 0x3f. + */ + bf_mask = (MLX4_BF_QP_SKIP_MASK & ~(MLX4_BF_QP_SKIP_MASK - 1)) - 1; + requested_size = min((u32)MLX4_QP_TABLE_RAW_ETH_SIZE, bf_mask + 1); + + if (((last_offset & MLX4_BF_QP_SKIP_MASK) && + ((int)(max_table_offset - last_offset)) >= + roundup_pow_of_two(MLX4_BF_QP_SKIP_MASK)) || + (!(last_offset & MLX4_BF_QP_SKIP_MASK) && + !((last_offset + requested_size - 1) & + MLX4_BF_QP_SKIP_MASK))) + size = requested_size; + else { + u32 candidate_offset = + (last_offset | MLX4_BF_QP_SKIP_MASK | bf_mask) + 1; + + if (last_offset & MLX4_BF_QP_SKIP_MASK) + last_offset = candidate_offset; + + /* From this point, the BF bits are 0 */ + + if (last_offset > max_table_offset) { + /* need to skip */ + size = -1; + } else { + size = min3(max_table_offset - last_offset, + bf_mask - (last_offset & bf_mask), + requested_size); + if (size < requested_size) { + int candidate_size; + + candidate_size = min3( + max_table_offset - candidate_offset, + bf_mask - (last_offset & bf_mask), + requested_size); + + /* We will not take this path if last_offset was + * already set above to candidate_offset + */ + if (candidate_size > size) { + last_offset = candidate_offset; + size = candidate_size; + } + } + } + } + + if (size > 0) { + /* mlx4_bitmap_alloc_range will find a contiguous range of "size" + * QPs in which both bits 6 and 7 are zero, because we pass it the + * MLX4_BF_SKIP_MASK). + */ + offset = mlx4_bitmap_alloc_range( + *bitmap + MLX4_QP_TABLE_ZONE_RSS, + size, 1, + MLX4_BF_QP_SKIP_MASK); + + if (offset == (u32)-1) { + err = -ENOMEM; + break; + } + + last_offset = offset + size; + + err = mlx4_bitmap_init(*bitmap + k, roundup_pow_of_two(size), + roundup_pow_of_two(size) - 1, 0, + roundup_pow_of_two(size) - size); + } else { + /* Add an empty bitmap, we'll allocate from different zones (since + * at least one is reserved) + */ + err = mlx4_bitmap_init(*bitmap + k, 1, + MLX4_QP_TABLE_RAW_ETH_SIZE - 1, 0, + 0); + mlx4_bitmap_alloc_range(*bitmap + k, 1, 1, 0); + } + + if (err) + break; + + ++bitmap_initialized; + + err = mlx4_zone_add_one(qp_table->zones, *bitmap + k, + MLX4_ZONE_ALLOW_ALLOC_FROM_LOWER_PRIO | + MLX4_ZONE_ALLOW_ALLOC_FROM_EQ_PRIO | + MLX4_ZONE_USE_RR, MLX4_QP_TABLE_RAW_ETH_PRIORITY, + offset, qp_table->zones_uids + k); + + if (err) + break; + } + + if (err) + goto free_bitmap; + + qp_table->bitmap_gen = *bitmap; + + return err; + +free_bitmap: + for (k = 0; k < bitmap_initialized; k++) + mlx4_bitmap_cleanup(*bitmap + k); + kfree(bitmap); +free_zone: + mlx4_zone_allocator_destroy(qp_table->zones); + return err; +} + +static void mlx4_cleanup_qp_zones(struct mlx4_dev *dev) +{ + struct mlx4_qp_table *qp_table = &mlx4_priv(dev)->qp_table; + + if (qp_table->zones) { + int i; + + for (i = 0; + i < sizeof(qp_table->zones_uids)/sizeof(qp_table->zones_uids[0]); + i++) { + struct mlx4_bitmap *bitmap = + mlx4_zone_get_bitmap(qp_table->zones, + qp_table->zones_uids[i]); + + mlx4_zone_remove_one(qp_table->zones, qp_table->zones_uids[i]); + if (NULL == bitmap) + continue; + + mlx4_bitmap_cleanup(bitmap); + } + mlx4_zone_allocator_destroy(qp_table->zones); + kfree(qp_table->bitmap_gen); + qp_table->bitmap_gen = NULL; + qp_table->zones = NULL; + } +} + int mlx4_init_qp_table(struct mlx4_dev *dev) { struct mlx4_qp_table *qp_table = &mlx4_priv(dev)->qp_table; @@ -443,49 +743,56 @@ int mlx4_init_qp_table(struct mlx4_dev *dev) int reserved_from_top = 0; int reserved_from_bot; int k; + int fixed_reserved_from_bot_rv = 0; + int bottom_reserved_for_rss_bitmap; + u32 max_table_offset = dev->caps.dmfs_high_rate_qpn_base + + dev->caps.dmfs_high_rate_qpn_range; spin_lock_init(&qp_table->lock); INIT_RADIX_TREE(&dev->qp_table_tree, GFP_ATOMIC); if (mlx4_is_slave(dev)) return 0; - /* - * We reserve 2 extra QPs per port for the special QPs. The + /* We reserve 2 extra QPs per port for the special QPs. The * block of special QPs must be aligned to a multiple of 8, so * round up. * * We also reserve the MSB of the 24-bit QP number to indicate * that a QP is an XRC QP. */ - dev->phys_caps.base_sqpn = - ALIGN(dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW], 8); + for (k = 0; k <= MLX4_QP_REGION_BOTTOM; k++) + fixed_reserved_from_bot_rv += dev->caps.reserved_qps_cnt[k]; + + if (fixed_reserved_from_bot_rv < max_table_offset) + fixed_reserved_from_bot_rv = max_table_offset; + + /* We reserve at least 1 extra for bitmaps that we don't have enough space for*/ + bottom_reserved_for_rss_bitmap = + roundup_pow_of_two(fixed_reserved_from_bot_rv + 1); + dev->phys_caps.base_sqpn = ALIGN(bottom_reserved_for_rss_bitmap, 8); { int sort[MLX4_NUM_QP_REGION]; - int i, j, tmp; + int i, j; int last_base = dev->caps.num_qps; for (i = 1; i < MLX4_NUM_QP_REGION; ++i) sort[i] = i; - for (i = MLX4_NUM_QP_REGION; i > 0; --i) { - for (j = 2; j < i; ++j) { + for (i = MLX4_NUM_QP_REGION; i > MLX4_QP_REGION_BOTTOM; --i) { + for (j = MLX4_QP_REGION_BOTTOM + 2; j < i; ++j) { if (dev->caps.reserved_qps_cnt[sort[j]] > - dev->caps.reserved_qps_cnt[sort[j - 1]]) { - tmp = sort[j]; - sort[j] = sort[j - 1]; - sort[j - 1] = tmp; - } + dev->caps.reserved_qps_cnt[sort[j - 1]]) + swap(sort[j], sort[j - 1]); } } - for (i = 1; i < MLX4_NUM_QP_REGION; ++i) { + for (i = MLX4_QP_REGION_BOTTOM + 1; i < MLX4_NUM_QP_REGION; ++i) { last_base -= dev->caps.reserved_qps_cnt[sort[i]]; dev->caps.reserved_qps_base[sort[i]] = last_base; reserved_from_top += dev->caps.reserved_qps_cnt[sort[i]]; } - } /* Reserve 8 real SQPs in both native and SRIOV modes. @@ -500,14 +807,15 @@ int mlx4_init_qp_table(struct mlx4_dev *dev) */ reserved_from_bot = mlx4_num_reserved_sqps(dev); if (reserved_from_bot + reserved_from_top > dev->caps.num_qps) { - mlx4_err(dev, "Number of reserved QPs is higher than number " - "of QPs, increase the value of log_num_qp\n"); + mlx4_err(dev, "Number of reserved QPs is higher than number of QPs\n"); return -EINVAL; } - err = mlx4_bitmap_init(&qp_table->bitmap, dev->caps.num_qps, - (1 << 23) - 1, reserved_from_bot, - reserved_from_top); + err = mlx4_create_zones(dev, reserved_from_bot, reserved_from_bot, + bottom_reserved_for_rss_bitmap, + fixed_reserved_from_bot_rv, + max_table_offset); + if (err) return err; @@ -543,7 +851,8 @@ int mlx4_init_qp_table(struct mlx4_dev *dev) err = mlx4_CONF_SPECIAL_QP(dev, dev->phys_caps.base_sqpn); if (err) goto err_mem; - return 0; + + return err; err_mem: kfree(dev->caps.qp0_tunnel); @@ -552,6 +861,7 @@ int mlx4_init_qp_table(struct mlx4_dev *dev) kfree(dev->caps.qp1_proxy); dev->caps.qp0_tunnel = dev->caps.qp0_proxy = dev->caps.qp1_tunnel = dev->caps.qp1_proxy = NULL; + mlx4_cleanup_qp_zones(dev); return err; } @@ -561,7 +871,8 @@ void mlx4_cleanup_qp_table(struct mlx4_dev *dev) return; mlx4_CONF_SPECIAL_QP(dev, 0); - mlx4_bitmap_cleanup(&mlx4_priv(dev)->qp_table.bitmap); + + mlx4_cleanup_qp_zones(dev); } int mlx4_qp_query(struct mlx4_dev *dev, struct mlx4_qp *qp, @@ -601,11 +912,12 @@ int mlx4_qp_to_ready(struct mlx4_dev *dev, struct mlx4_mtt *mtt, for (i = 0; i < ARRAY_SIZE(states) - 1; i++) { context->flags &= cpu_to_be32(~(0xf << 28)); context->flags |= cpu_to_be32(states[i + 1] << 28); + if (states[i + 1] != MLX4_QP_STATE_RTR) + context->params2 &= ~MLX4_QP_BIT_FPP; err = mlx4_qp_modify(dev, mtt, states[i], states[i + 1], context, 0, 0, qp); if (err) { - mlx4_err(dev, "Failed to bring QP to state: " - "%d with error: %d\n", + mlx4_err(dev, "Failed to bring QP to state: %d with error: %d\n", states[i + 1], err); return err; } @@ -616,3 +928,23 @@ int mlx4_qp_to_ready(struct mlx4_dev *dev, struct mlx4_mtt *mtt, return 0; } EXPORT_SYMBOL_GPL(mlx4_qp_to_ready); + +u16 mlx4_qp_roce_entropy(struct mlx4_dev *dev, u32 qpn) +{ + struct mlx4_qp_context context; + struct mlx4_qp qp; + int err; + + qp.qpn = qpn; + err = mlx4_qp_query(dev, &qp, &context); + if (!err) { + u32 dest_qpn = be32_to_cpu(context.remote_qpn) & 0xffffff; + u16 folded_dst = folded_qp(dest_qpn); + u16 folded_src = folded_qp(qpn); + + return (dest_qpn != qpn) ? + ((folded_dst ^ folded_src) | 0xC000) : + folded_src | 0xC000; + } + return 0xdead; +} diff --git a/sys/dev/mlx4/mlx4_core/mlx4_reset.c b/sys/dev/mlx4/mlx4_core/mlx4_reset.c index 44ec1e12b898..dd2a9acfd74f 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_reset.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_reset.c @@ -72,29 +72,29 @@ int mlx4_reset(struct mlx4_dev *dev) hca_header = kmalloc(256, GFP_KERNEL); if (!hca_header) { err = -ENOMEM; - mlx4_err(dev, "Couldn't allocate memory to save HCA " - "PCI header, aborting.\n"); + mlx4_err(dev, "Couldn't allocate memory to save HCA PCI header, aborting\n"); goto out; } - pcie_cap = pci_pcie_cap(dev->pdev); + pcie_cap = pci_pcie_cap(dev->persist->pdev); for (i = 0; i < 64; ++i) { if (i == 22 || i == 23) continue; - if (pci_read_config_dword(dev->pdev, i * 4, hca_header + i)) { + if (pci_read_config_dword(dev->persist->pdev, i * 4, + hca_header + i)) { err = -ENODEV; - mlx4_err(dev, "Couldn't save HCA " - "PCI header, aborting.\n"); + mlx4_err(dev, "Couldn't save HCA PCI header, aborting\n"); goto out; } } - reset = ioremap(pci_resource_start(dev->pdev, 0) + MLX4_RESET_BASE, + reset = ioremap(pci_resource_start(dev->persist->pdev, 0) + + MLX4_RESET_BASE, MLX4_RESET_SIZE); if (!reset) { err = -ENOMEM; - mlx4_err(dev, "Couldn't map HCA reset register, aborting.\n"); + mlx4_err(dev, "Couldn't map HCA reset register, aborting\n"); goto out; } @@ -119,13 +119,13 @@ int mlx4_reset(struct mlx4_dev *dev) writel(MLX4_RESET_VALUE, reset + MLX4_RESET_OFFSET); iounmap(reset); - /* wait half a second before accessing device */ - msleep(500); + /* Docs say to wait one second before accessing device */ + msleep(1000); end = jiffies + MLX4_RESET_TIMEOUT_JIFFIES; do { - if (!pci_read_config_word(dev->pdev, PCI_VENDOR_ID, &vendor) && - vendor != 0xffff) + if (!pci_read_config_word(dev->persist->pdev, PCI_VENDOR_ID, + &vendor) && vendor != 0xffff) break; msleep(1); @@ -133,27 +133,26 @@ int mlx4_reset(struct mlx4_dev *dev) if (vendor == 0xffff) { err = -ENODEV; - mlx4_err(dev, "PCI device did not come back after reset, " - "aborting.\n"); + mlx4_err(dev, "PCI device did not come back after reset, aborting\n"); goto out; } /* Now restore the PCI headers */ if (pcie_cap) { devctl = hca_header[(pcie_cap + PCI_EXP_DEVCTL) / 4]; - if (pcie_capability_write_word(dev->pdev, PCI_EXP_DEVCTL, + if (pcie_capability_write_word(dev->persist->pdev, + PCI_EXP_DEVCTL, devctl)) { err = -ENODEV; - mlx4_err(dev, "Couldn't restore HCA PCI Express " - "Device Control register, aborting.\n"); + mlx4_err(dev, "Couldn't restore HCA PCI Express Device Control register, aborting\n"); goto out; } linkctl = hca_header[(pcie_cap + PCI_EXP_LNKCTL) / 4]; - if (pcie_capability_write_word(dev->pdev, PCI_EXP_LNKCTL, + if (pcie_capability_write_word(dev->persist->pdev, + PCI_EXP_LNKCTL, linkctl)) { err = -ENODEV; - mlx4_err(dev, "Couldn't restore HCA PCI Express " - "Link control register, aborting.\n"); + mlx4_err(dev, "Couldn't restore HCA PCI Express Link control register, aborting\n"); goto out; } } @@ -162,19 +161,19 @@ int mlx4_reset(struct mlx4_dev *dev) if (i * 4 == PCI_COMMAND) continue; - if (pci_write_config_dword(dev->pdev, i * 4, hca_header[i])) { + if (pci_write_config_dword(dev->persist->pdev, i * 4, + hca_header[i])) { err = -ENODEV; - mlx4_err(dev, "Couldn't restore HCA reg %x, " - "aborting.\n", i); + mlx4_err(dev, "Couldn't restore HCA reg %x, aborting\n", + i); goto out; } } - if (pci_write_config_dword(dev->pdev, PCI_COMMAND, + if (pci_write_config_dword(dev->persist->pdev, PCI_COMMAND, hca_header[PCI_COMMAND / 4])) { err = -ENODEV; - mlx4_err(dev, "Couldn't restore HCA COMMAND, " - "aborting.\n"); + mlx4_err(dev, "Couldn't restore HCA COMMAND, aborting\n"); goto out; } diff --git a/sys/dev/mlx4/mlx4_core/mlx4_resource_tracker.c b/sys/dev/mlx4/mlx4_core/mlx4_resource_tracker.c index 43edcac1bfc9..4e4b04758e11 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_resource_tracker.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_resource_tracker.c @@ -48,6 +48,8 @@ #include "fw.h" #define MLX4_MAC_VALID (1ull << 63) +#define MLX4_PF_COUNTERS_PER_PORT 2 +#define MLX4_VF_COUNTERS_PER_PORT 1 struct mac_res { struct list_head list; @@ -219,13 +221,15 @@ enum res_fs_rule_states { struct res_fs_rule { struct res_common com; int qpn; + /* VF DMFS mbox with port flipped */ + void *mirr_mbox; + /* > 0 --> apply mirror when getting into HA mode */ + /* = 0 --> un-apply mirror when getting out of HA mode */ + u32 mirr_mbox_size; + struct list_head mirr_list; + u64 mirr_rule_id; }; -static int mlx4_is_eth(struct mlx4_dev *dev, int port) -{ - return dev->caps.port_mask[port] == MLX4_PORT_TYPE_IB ? 0 : 1; -} - static void *res_tracker_lookup(struct rb_root *root, u64 res_id) { struct rb_node *node = root->rb_node; @@ -279,7 +283,7 @@ enum qp_transition { }; /* For Debug uses */ -static const char *ResourceType(enum mlx4_resource rt) +static const char *resource_str(enum mlx4_resource rt) { switch (rt) { case RES_QP: return "RES_QP"; @@ -307,10 +311,15 @@ static inline int mlx4_grant_resource(struct mlx4_dev *dev, int slave, &priv->mfunc.master.res_tracker.res_alloc[res_type]; int err = -EINVAL; int allocated, free, reserved, guaranteed, from_free; + int from_rsvd; + + if (slave > dev->persist->num_vfs) + return -EINVAL; spin_lock(&res_alloc->alloc_lock); allocated = (port > 0) ? - res_alloc->allocated[(port - 1) * (dev->num_vfs + 1) + slave] : + res_alloc->allocated[(port - 1) * + (dev->persist->num_vfs + 1) + slave] : res_alloc->allocated[slave]; free = (port > 0) ? res_alloc->res_port_free[port - 1] : res_alloc->res_free; @@ -318,11 +327,16 @@ static inline int mlx4_grant_resource(struct mlx4_dev *dev, int slave, res_alloc->res_reserved; guaranteed = res_alloc->guaranteed[slave]; - if (allocated + count > res_alloc->quota[slave]) + if (allocated + count > res_alloc->quota[slave]) { + mlx4_warn(dev, "VF %d port %d res %s: quota exceeded, count %d alloc %d quota %d\n", + slave, port, resource_str(res_type), count, + allocated, res_alloc->quota[slave]); goto out; + } if (allocated + count <= guaranteed) { err = 0; + from_rsvd = count; } else { /* portion may need to be obtained from free area */ if (guaranteed - allocated > 0) @@ -330,25 +344,33 @@ static inline int mlx4_grant_resource(struct mlx4_dev *dev, int slave, else from_free = count; - if (free - from_free > reserved) + from_rsvd = count - from_free; + + if (free - from_free >= reserved) err = 0; + else + mlx4_warn(dev, "VF %d port %d res %s: free pool empty, free %d from_free %d rsvd %d\n", + slave, port, resource_str(res_type), free, + from_free, reserved); } if (!err) { /* grant the request */ if (port > 0) { - res_alloc->allocated[(port - 1) * (dev->num_vfs + 1) + slave] += count; + res_alloc->allocated[(port - 1) * + (dev->persist->num_vfs + 1) + slave] += count; res_alloc->res_port_free[port - 1] -= count; + res_alloc->res_port_rsvd[port - 1] -= from_rsvd; } else { res_alloc->allocated[slave] += count; res_alloc->res_free -= count; + res_alloc->res_reserved -= from_rsvd; } } out: spin_unlock(&res_alloc->alloc_lock); return err; - } static inline void mlx4_release_resource(struct mlx4_dev *dev, int slave, @@ -358,14 +380,38 @@ static inline void mlx4_release_resource(struct mlx4_dev *dev, int slave, struct mlx4_priv *priv = mlx4_priv(dev); struct resource_allocator *res_alloc = &priv->mfunc.master.res_tracker.res_alloc[res_type]; + int allocated, guaranteed, from_rsvd; + + if (slave > dev->persist->num_vfs) + return; spin_lock(&res_alloc->alloc_lock); + + allocated = (port > 0) ? + res_alloc->allocated[(port - 1) * + (dev->persist->num_vfs + 1) + slave] : + res_alloc->allocated[slave]; + guaranteed = res_alloc->guaranteed[slave]; + + if (allocated - count >= guaranteed) { + from_rsvd = 0; + } else { + /* portion may need to be returned to reserved area */ + if (allocated - guaranteed > 0) + from_rsvd = count - (allocated - guaranteed); + else + from_rsvd = count; + } + if (port > 0) { - res_alloc->allocated[(port - 1) * (dev->num_vfs + 1) + slave] -= count; + res_alloc->allocated[(port - 1) * + (dev->persist->num_vfs + 1) + slave] -= count; res_alloc->res_port_free[port - 1] += count; + res_alloc->res_port_rsvd[port - 1] += from_rsvd; } else { res_alloc->allocated[slave] -= count; res_alloc->res_free += count; + res_alloc->res_reserved += from_rsvd; } spin_unlock(&res_alloc->alloc_lock); @@ -377,7 +423,8 @@ static inline void initialize_res_quotas(struct mlx4_dev *dev, enum mlx4_resource res_type, int vf, int num_instances) { - res_alloc->guaranteed[vf] = num_instances / (2 * (dev->num_vfs + 1)); + res_alloc->guaranteed[vf] = num_instances / + (2 * (dev->persist->num_vfs + 1)); res_alloc->quota[vf] = (num_instances / 2) + res_alloc->guaranteed[vf]; if (vf == mlx4_master_func_num(dev)) { res_alloc->res_free = num_instances; @@ -421,11 +468,21 @@ void mlx4_init_quotas(struct mlx4_dev *dev) dev->quotas.mpt = priv->mfunc.master.res_tracker.res_alloc[RES_MPT].quota[pf]; } + +static int get_max_gauranteed_vfs_counter(struct mlx4_dev *dev) +{ + /* reduce the sink counter */ + return (dev->caps.max_counters - 1 - + (MLX4_PF_COUNTERS_PER_PORT * MLX4_MAX_PORTS)) + / MLX4_MAX_PORTS; +} + int mlx4_init_resource_tracker(struct mlx4_dev *dev) { struct mlx4_priv *priv = mlx4_priv(dev); int i, j; int t; + int max_vfs_guarantee_counter = get_max_gauranteed_vfs_counter(dev); priv->mfunc.master.res_tracker.slave_list = kzalloc(dev->num_slaves * sizeof(struct slave_list), @@ -448,21 +505,31 @@ int mlx4_init_resource_tracker(struct mlx4_dev *dev) for (i = 0; i < MLX4_NUM_OF_RESOURCE_TYPE; i++) { struct resource_allocator *res_alloc = &priv->mfunc.master.res_tracker.res_alloc[i]; - res_alloc->quota = kmalloc((dev->num_vfs + 1) * sizeof(int), GFP_KERNEL); - res_alloc->guaranteed = kmalloc((dev->num_vfs + 1) * sizeof(int), GFP_KERNEL); + res_alloc->quota = kmalloc((dev->persist->num_vfs + 1) * + sizeof(int), GFP_KERNEL); + res_alloc->guaranteed = kmalloc((dev->persist->num_vfs + 1) * + sizeof(int), GFP_KERNEL); if (i == RES_MAC || i == RES_VLAN) res_alloc->allocated = kzalloc(MLX4_MAX_PORTS * - (dev->num_vfs + 1) * sizeof(int), - GFP_KERNEL); + (dev->persist->num_vfs + + 1) * + sizeof(int), GFP_KERNEL); else - res_alloc->allocated = kzalloc((dev->num_vfs + 1) * sizeof(int), GFP_KERNEL); + res_alloc->allocated = kzalloc((dev->persist-> + num_vfs + 1) * + sizeof(int), GFP_KERNEL); + /* Reduce the sink counter */ + if (i == RES_COUNTER) + res_alloc->res_free = dev->caps.max_counters - 1; if (!res_alloc->quota || !res_alloc->guaranteed || !res_alloc->allocated) goto no_mem_err; spin_lock_init(&res_alloc->alloc_lock); - for (t = 0; t < dev->num_vfs + 1; t++) { + for (t = 0; t < dev->persist->num_vfs + 1; t++) { + struct mlx4_active_ports actv_ports = + mlx4_get_active_ports(dev, t); switch (i) { case RES_QP: initialize_res_quotas(dev, res_alloc, RES_QP, @@ -492,13 +559,29 @@ int mlx4_init_resource_tracker(struct mlx4_dev *dev) break; case RES_MAC: if (t == mlx4_master_func_num(dev)) { + int max_vfs_pport = 0; + /* Calculate the max vfs per port for */ + /* both ports. */ + for (j = 0; j < dev->caps.num_ports; + j++) { + struct mlx4_slaves_pport slaves_pport = + mlx4_phys_to_slaves_pport(dev, j + 1); + unsigned current_slaves = + bitmap_weight(slaves_pport.slaves, + dev->caps.num_ports) - 1; + if (max_vfs_pport < current_slaves) + max_vfs_pport = + current_slaves; + } res_alloc->quota[t] = - MLX4_MAX_MAC_NUM - 2 * dev->num_vfs; - res_alloc->guaranteed[t] = res_alloc->quota[t]; + MLX4_MAX_MAC_NUM - + 2 * max_vfs_pport; + res_alloc->guaranteed[t] = 2; for (j = 0; j < MLX4_MAX_PORTS; j++) - res_alloc->res_port_free[j] = MLX4_MAX_MAC_NUM; + res_alloc->res_port_free[j] = + MLX4_MAX_MAC_NUM; } else { - res_alloc->quota[t] = 2; + res_alloc->quota[t] = MLX4_MAX_MAC_NUM; res_alloc->guaranteed[t] = 2; } break; @@ -516,17 +599,26 @@ int mlx4_init_resource_tracker(struct mlx4_dev *dev) break; case RES_COUNTER: res_alloc->quota[t] = dev->caps.max_counters; - res_alloc->guaranteed[t] = 0; if (t == mlx4_master_func_num(dev)) - res_alloc->res_free = res_alloc->quota[t]; + res_alloc->guaranteed[t] = + MLX4_PF_COUNTERS_PER_PORT * + MLX4_MAX_PORTS; + else if (t <= max_vfs_guarantee_counter) + res_alloc->guaranteed[t] = + MLX4_VF_COUNTERS_PER_PORT * + MLX4_MAX_PORTS; + else + res_alloc->guaranteed[t] = 0; + res_alloc->res_free -= res_alloc->guaranteed[t]; break; default: break; } if (i == RES_MAC || i == RES_VLAN) { - for (j = 0; j < MLX4_MAX_PORTS; j++) - res_alloc->res_port_rsvd[j] += - res_alloc->guaranteed[t]; + for (j = 0; j < dev->caps.num_ports; j++) + if (test_bit(j, actv_ports.ports)) + res_alloc->res_port_rsvd[j] += + res_alloc->guaranteed[t]; } else { res_alloc->res_reserved += res_alloc->guaranteed[t]; } @@ -562,6 +654,7 @@ void mlx4_free_resource_tracker(struct mlx4_dev *dev, } /* free master's vlans */ i = dev->caps.function; + mlx4_reset_roce_gids(dev, i); mutex_lock(&priv->mfunc.master.res_tracker.slave_list[i].mutex); rem_slave_vlans(dev, i); mutex_unlock(&priv->mfunc.master.res_tracker.slave_list[i].mutex); @@ -608,15 +701,17 @@ static void update_gid(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *inbox, if (MLX4_QP_ST_UD == ts) { port = (qp_ctx->pri_path.sched_queue >> 6 & 1) + 1; if (mlx4_is_eth(dev, port)) - qp_ctx->pri_path.mgid_index = mlx4_get_base_gid_ix(dev, slave) | 0x80; + qp_ctx->pri_path.mgid_index = + mlx4_get_base_gid_ix(dev, slave, port) | 0x80; else - qp_ctx->pri_path.mgid_index = 0x80 | slave; + qp_ctx->pri_path.mgid_index = slave | 0x80; - } else if (MLX4_QP_ST_RC == ts || MLX4_QP_ST_UC == ts) { + } else if (MLX4_QP_ST_RC == ts || MLX4_QP_ST_XRC == ts || MLX4_QP_ST_UC == ts) { if (optpar & MLX4_QP_OPTPAR_PRIMARY_ADDR_PATH) { port = (qp_ctx->pri_path.sched_queue >> 6 & 1) + 1; if (mlx4_is_eth(dev, port)) { - qp_ctx->pri_path.mgid_index += mlx4_get_base_gid_ix(dev, slave); + qp_ctx->pri_path.mgid_index += + mlx4_get_base_gid_ix(dev, slave, port); qp_ctx->pri_path.mgid_index &= 0x7f; } else { qp_ctx->pri_path.mgid_index = slave & 0x7F; @@ -625,7 +720,8 @@ static void update_gid(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *inbox, if (optpar & MLX4_QP_OPTPAR_ALT_ADDR_PATH) { port = (qp_ctx->alt_path.sched_queue >> 6 & 1) + 1; if (mlx4_is_eth(dev, port)) { - qp_ctx->alt_path.mgid_index += mlx4_get_base_gid_ix(dev, slave); + qp_ctx->alt_path.mgid_index += + mlx4_get_base_gid_ix(dev, slave, port); qp_ctx->alt_path.mgid_index &= 0x7f; } else { qp_ctx->alt_path.mgid_index = slave & 0x7F; @@ -634,29 +730,8 @@ static void update_gid(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *inbox, } } -static int check_counter_index_validity(struct mlx4_dev *dev, int slave, int port, int idx) -{ - struct mlx4_priv *priv = mlx4_priv(dev); - struct counter_index *counter, *tmp_counter; - - if (slave == 0) { - list_for_each_entry_safe(counter, tmp_counter, - &priv->counters_table.global_port_list[port - 1], - list) { - if (counter->index == idx) - return 0; - } - return -EINVAL; - } else { - list_for_each_entry_safe(counter, tmp_counter, - &priv->counters_table.vf_list[slave - 1][port - 1], - list) { - if (counter->index == idx) - return 0; - } - return -EINVAL; - } -} +static int handle_counter(struct mlx4_dev *dev, struct mlx4_qp_context *qpc, + u8 slave, int port); static int update_vport_qp_param(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *inbox, @@ -666,33 +741,16 @@ static int update_vport_qp_param(struct mlx4_dev *dev, struct mlx4_vport_oper_state *vp_oper; struct mlx4_priv *priv; u32 qp_type; - int port; + int port, err = 0; port = (qpc->pri_path.sched_queue & 0x40) ? 2 : 1; priv = mlx4_priv(dev); vp_oper = &priv->mfunc.master.vf_oper[slave].vport[port]; qp_type = (be32_to_cpu(qpc->flags) >> 16) & 0xff; - if (dev->caps.port_type[port] == MLX4_PORT_TYPE_ETH && - qpc->pri_path.counter_index != MLX4_SINK_COUNTER_INDEX) { - if (check_counter_index_validity(dev, slave, port, - qpc->pri_path.counter_index)) - return -EINVAL; - } - - mlx4_dbg(dev, "%s: QP counter_index %d for slave %d port %d\n", - __func__, qpc->pri_path.counter_index, slave, port); - - if ((dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_LB_SRC_CHK) && - dev->caps.port_type[port] == MLX4_PORT_TYPE_ETH && - !mlx4_is_qp_reserved(dev, qpn) && - qp_type == MLX4_QP_ST_MLX && - qpc->pri_path.counter_index != 0xFF) { - /* disable multicast loopback to qp with same counter */ - qpc->pri_path.fl |= MLX4_FL_ETH_SRC_CHECK_MC_LB; - qpc->pri_path.vlan_control |= - MLX4_VLAN_CTRL_ETH_SRC_CHECK_IF_COUNTER; - } + err = handle_counter(dev, qpc, slave, port); + if (err) + goto out; if (MLX4_VGT != vp_oper->state.default_vlan) { /* the reserved QPs (special, proxy, tunnel) @@ -701,35 +759,76 @@ static int update_vport_qp_param(struct mlx4_dev *dev, if (mlx4_is_qp_reserved(dev, qpn)) return 0; - /* force strip vlan by clear vsd */ - qpc->param3 &= ~cpu_to_be32(MLX4_STRIP_VLAN); + /* force strip vlan by clear vsd, MLX QP refers to Raw Ethernet */ + if (qp_type == MLX4_QP_ST_UD || + (qp_type == MLX4_QP_ST_MLX && mlx4_is_eth(dev, port))) { + if (dev->caps.bmme_flags & MLX4_BMME_FLAG_VSD_INIT2RTR) { + *(__be32 *)inbox->buf = + cpu_to_be32(be32_to_cpu(*(__be32 *)inbox->buf) | + MLX4_QP_OPTPAR_VLAN_STRIPPING); + qpc->param3 &= ~cpu_to_be32(MLX4_STRIP_VLAN); + } else { + struct mlx4_update_qp_params params = {.flags = 0}; + + err = mlx4_update_qp(dev, qpn, MLX4_UPDATE_QP_VSD, ¶ms); + if (err) + goto out; + } + } + /* preserve IF_COUNTER flag */ qpc->pri_path.vlan_control &= - MLX4_VLAN_CTRL_ETH_SRC_CHECK_IF_COUNTER; - if (MLX4_QP_ST_RC != qp_type) { - if (0 != vp_oper->state.default_vlan) { + MLX4_CTRL_ETH_SRC_CHECK_IF_COUNTER; + if (1 /*vp_oper->state.link_state == IFLA_VF_LINK_STATE_DISABLE*/ && + dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_UPDATE_QP) { + qpc->pri_path.vlan_control |= + MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED | + MLX4_VLAN_CTRL_ETH_TX_BLOCK_PRIO_TAGGED | + MLX4_VLAN_CTRL_ETH_TX_BLOCK_UNTAGGED | + MLX4_VLAN_CTRL_ETH_RX_BLOCK_PRIO_TAGGED | + MLX4_VLAN_CTRL_ETH_RX_BLOCK_UNTAGGED | + MLX4_VLAN_CTRL_ETH_RX_BLOCK_TAGGED; + } else if (0 != vp_oper->state.default_vlan) { + if (vp_oper->state.vlan_proto == htons(ETH_P_8021AD)) { + /* vst QinQ should block untagged on TX, + * but cvlan is in payload and phv is set so + * hw see it as untagged. Block tagged instead. + */ + qpc->pri_path.vlan_control |= + MLX4_VLAN_CTRL_ETH_TX_BLOCK_PRIO_TAGGED | + MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED | + MLX4_VLAN_CTRL_ETH_RX_BLOCK_PRIO_TAGGED | + MLX4_VLAN_CTRL_ETH_RX_BLOCK_UNTAGGED; + } else { /* vst 802.1Q */ qpc->pri_path.vlan_control |= MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED | MLX4_VLAN_CTRL_ETH_RX_BLOCK_PRIO_TAGGED | MLX4_VLAN_CTRL_ETH_RX_BLOCK_UNTAGGED; - } else { /* priority tagged */ - qpc->pri_path.vlan_control |= - MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED | - MLX4_VLAN_CTRL_ETH_RX_BLOCK_TAGGED; } + } else { /* priority tagged */ + qpc->pri_path.vlan_control |= + MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED | + MLX4_VLAN_CTRL_ETH_RX_BLOCK_TAGGED; } + qpc->pri_path.fvl_rx |= MLX4_FVL_RX_FORCE_ETH_VLAN; qpc->pri_path.vlan_index = vp_oper->vlan_idx; - qpc->pri_path.fl |= MLX4_FL_CV | MLX4_FL_ETH_HIDE_CQE_VLAN; + qpc->pri_path.fl |= MLX4_FL_ETH_HIDE_CQE_VLAN; + if (vp_oper->state.vlan_proto == htons(ETH_P_8021AD)) + qpc->pri_path.fl |= MLX4_FL_SV; + else + qpc->pri_path.fl |= MLX4_FL_CV; qpc->pri_path.feup |= MLX4_FEUP_FORCE_ETH_UP | MLX4_FVL_FORCE_ETH_VLAN; qpc->pri_path.sched_queue &= 0xC7; qpc->pri_path.sched_queue |= (vp_oper->state.default_qos) << 3; + qpc->qos_vport = vp_oper->state.qos_vport; } if (vp_oper->state.spoofchk) { qpc->pri_path.feup |= MLX4_FSM_FORCE_ETH_SRC_MAC; qpc->pri_path.grh_mylmc = (0x80 & qpc->pri_path.grh_mylmc) + vp_oper->mac_idx; } - return 0; +out: + return err; } static int mpt_mask(struct mlx4_dev *dev) @@ -816,6 +915,85 @@ static void put_res(struct mlx4_dev *dev, int slave, u64 res_id, spin_unlock_irq(mlx4_tlock(dev)); } +static int counter_alloc_res(struct mlx4_dev *dev, int slave, int op, int cmd, + u64 in_param, u64 *out_param, int port); + +static int handle_existing_counter(struct mlx4_dev *dev, u8 slave, int port, + int counter_index) +{ + struct res_common *r; + struct res_counter *counter; + int ret = 0; + + if (counter_index == MLX4_SINK_COUNTER_INDEX(dev)) + return ret; + + spin_lock_irq(mlx4_tlock(dev)); + r = find_res(dev, counter_index, RES_COUNTER); + if (!r || r->owner != slave) { + ret = -EINVAL; + } else { + counter = container_of(r, struct res_counter, com); + if (!counter->port) + counter->port = port; + } + + spin_unlock_irq(mlx4_tlock(dev)); + return ret; +} + +static int handle_unexisting_counter(struct mlx4_dev *dev, + struct mlx4_qp_context *qpc, u8 slave, + int port) +{ + struct mlx4_priv *priv = mlx4_priv(dev); + struct mlx4_resource_tracker *tracker = &priv->mfunc.master.res_tracker; + struct res_common *tmp; + struct res_counter *counter; + u64 counter_idx = MLX4_SINK_COUNTER_INDEX(dev); + int err = 0; + + spin_lock_irq(mlx4_tlock(dev)); + list_for_each_entry(tmp, + &tracker->slave_list[slave].res_list[RES_COUNTER], + list) { + counter = container_of(tmp, struct res_counter, com); + if (port == counter->port) { + qpc->pri_path.counter_index = counter->com.res_id; + spin_unlock_irq(mlx4_tlock(dev)); + return 0; + } + } + spin_unlock_irq(mlx4_tlock(dev)); + + /* No existing counter, need to allocate a new counter */ + err = counter_alloc_res(dev, slave, RES_OP_RESERVE, 0, 0, &counter_idx, + port); + if (err == -ENOENT) { + err = 0; + } else if (err && err != -ENOSPC) { + mlx4_err(dev, "%s: failed to create new counter for slave %d err %d\n", + __func__, slave, err); + } else { + qpc->pri_path.counter_index = counter_idx; + mlx4_dbg(dev, "%s: alloc new counter for slave %d index %d\n", + __func__, slave, qpc->pri_path.counter_index); + err = 0; + } + + return err; +} + +static int handle_counter(struct mlx4_dev *dev, struct mlx4_qp_context *qpc, + u8 slave, int port) +{ + if (qpc->pri_path.counter_index != MLX4_SINK_COUNTER_INDEX(dev)) + return handle_existing_counter(dev, slave, port, + qpc->pri_path.counter_index); + + return handle_unexisting_counter(dev, qpc, slave, port); +} + static struct res_common *alloc_qp_tr(int id) { struct res_qp *ret; @@ -909,7 +1087,7 @@ static struct res_common *alloc_srq_tr(int id) return &ret->com; } -static struct res_common *alloc_counter_tr(int id) +static struct res_common *alloc_counter_tr(int id, int port) { struct res_counter *ret; @@ -919,6 +1097,7 @@ static struct res_common *alloc_counter_tr(int id) ret->com.res_id = id; ret->com.state = RES_COUNTER_ALLOCATED; + ret->port = port; return &ret->com; } @@ -976,10 +1155,10 @@ static struct res_common *alloc_tr(u64 id, enum mlx4_resource type, int slave, ret = alloc_srq_tr(id); break; case RES_MAC: - printk(KERN_ERR "implementation missing\n"); + pr_err("implementation missing\n"); return NULL; case RES_COUNTER: - ret = alloc_counter_tr(id); + ret = alloc_counter_tr(id, extra); break; case RES_XRCD: ret = alloc_xrcdn_tr(id); @@ -996,6 +1175,53 @@ static struct res_common *alloc_tr(u64 id, enum mlx4_resource type, int slave, return ret; } +int mlx4_calc_vf_counters(struct mlx4_dev *dev, int slave, int port, + struct mlx4_counter *data) +{ + struct mlx4_priv *priv = mlx4_priv(dev); + struct mlx4_resource_tracker *tracker = &priv->mfunc.master.res_tracker; + struct res_common *tmp; + struct res_counter *counter; + int *counters_arr; + int i = 0, err = 0; + + memset(data, 0, sizeof(*data)); + + counters_arr = kmalloc_array(dev->caps.max_counters, + sizeof(*counters_arr), GFP_KERNEL); + if (!counters_arr) + return -ENOMEM; + + spin_lock_irq(mlx4_tlock(dev)); + list_for_each_entry(tmp, + &tracker->slave_list[slave].res_list[RES_COUNTER], + list) { + counter = container_of(tmp, struct res_counter, com); + if (counter->port == port) { + counters_arr[i] = (int)tmp->res_id; + i++; + } + } + spin_unlock_irq(mlx4_tlock(dev)); + counters_arr[i] = -1; + + i = 0; + + while (counters_arr[i] != -1) { + err = mlx4_get_counter_stats(dev, counters_arr[i], data, + 0); + if (err) { + memset(data, 0, sizeof(*data)); + goto table_changed; + } + i++; + } + +table_changed: + kfree(counters_arr); + return 0; +} + static int add_res_range(struct mlx4_dev *dev, int slave, u64 base, int count, enum mlx4_resource type, int extra) { @@ -1072,10 +1298,10 @@ static int remove_mtt_ok(struct res_mtt *res, int order) { if (res->com.state == RES_MTT_BUSY || atomic_read(&res->ref_count)) { - printk(KERN_DEBUG "%s-%d: state %s, ref_count %d\n", - __func__, __LINE__, - mtt_states_str(res->com.state), - atomic_read(&res->ref_count)); + pr_devel("%s-%d: state %s, ref_count %d\n", + __func__, __LINE__, + mtt_states_str(res->com.state), + atomic_read(&res->ref_count)); return -EBUSY; } else if (res->com.state != RES_MTT_ALLOCATED) return -EPERM; @@ -1378,13 +1604,14 @@ static int eq_res_start_move_to(struct mlx4_dev *dev, int slave, int index, r->com.from_state = r->com.state; r->com.to_state = state; r->com.state = RES_EQ_BUSY; - if (eq) - *eq = r; } } spin_unlock_irq(mlx4_tlock(dev)); + if (!err && eq) + *eq = r; + return err; } @@ -1398,43 +1625,29 @@ static int cq_res_start_move_to(struct mlx4_dev *dev, int slave, int cqn, spin_lock_irq(mlx4_tlock(dev)); r = res_tracker_lookup(&tracker->res_tree[RES_CQ], cqn); - if (!r) + if (!r) { err = -ENOENT; - else if (r->com.owner != slave) + } else if (r->com.owner != slave) { err = -EPERM; - else { - switch (state) { - case RES_CQ_BUSY: - err = -EBUSY; - break; - - case RES_CQ_ALLOCATED: - if (r->com.state != RES_CQ_HW) - err = -EINVAL; - else if (atomic_read(&r->ref_count)) - err = -EBUSY; - else - err = 0; - break; - - case RES_CQ_HW: - if (r->com.state != RES_CQ_ALLOCATED) - err = -EINVAL; - else - err = 0; - break; - - default: + } else if (state == RES_CQ_ALLOCATED) { + if (r->com.state != RES_CQ_HW) err = -EINVAL; - } + else if (atomic_read(&r->ref_count)) + err = -EBUSY; + else + err = 0; + } else if (state != RES_CQ_HW || r->com.state != RES_CQ_ALLOCATED) { + err = -EINVAL; + } else { + err = 0; + } - if (!err) { - r->com.from_state = r->com.state; - r->com.to_state = state; - r->com.state = RES_CQ_BUSY; - if (cq) - *cq = r; - } + if (!err) { + r->com.from_state = r->com.state; + r->com.to_state = state; + r->com.state = RES_CQ_BUSY; + if (cq) + *cq = r; } spin_unlock_irq(mlx4_tlock(dev)); @@ -1452,39 +1665,25 @@ static int srq_res_start_move_to(struct mlx4_dev *dev, int slave, int index, spin_lock_irq(mlx4_tlock(dev)); r = res_tracker_lookup(&tracker->res_tree[RES_SRQ], index); - if (!r) + if (!r) { err = -ENOENT; - else if (r->com.owner != slave) + } else if (r->com.owner != slave) { err = -EPERM; - else { - switch (state) { - case RES_SRQ_BUSY: + } else if (state == RES_SRQ_ALLOCATED) { + if (r->com.state != RES_SRQ_HW) err = -EINVAL; - break; + else if (atomic_read(&r->ref_count)) + err = -EBUSY; + } else if (state != RES_SRQ_HW || r->com.state != RES_SRQ_ALLOCATED) { + err = -EINVAL; + } - case RES_SRQ_ALLOCATED: - if (r->com.state != RES_SRQ_HW) - err = -EINVAL; - else if (atomic_read(&r->ref_count)) - err = -EBUSY; - break; - - case RES_SRQ_HW: - if (r->com.state != RES_SRQ_ALLOCATED) - err = -EINVAL; - break; - - default: - err = -EINVAL; - } - - if (!err) { - r->com.from_state = r->com.state; - r->com.to_state = state; - r->com.state = RES_SRQ_BUSY; - if (srq) - *srq = r; - } + if (!err) { + r->com.from_state = r->com.state; + r->com.to_state = state; + r->com.state = RES_SRQ_BUSY; + if (srq) + *srq = r; } spin_unlock_irq(mlx4_tlock(dev)); @@ -1581,7 +1780,7 @@ static int qp_alloc_res(struct mlx4_dev *dev, int slave, int op, int cmd, return err; if (!fw_reserved(dev, qpn)) { - err = __mlx4_qp_alloc_icm(dev, qpn); + err = __mlx4_qp_alloc_icm(dev, qpn, GFP_KERNEL); if (err) { res_abort_move(dev, slave, RES_QP, qpn); return err; @@ -1624,8 +1823,9 @@ static int mtt_alloc_res(struct mlx4_dev *dev, int slave, int op, int cmd, if (err) { mlx4_release_resource(dev, slave, RES_MTT, 1 << order, 0); __mlx4_free_mtt_range(dev, base, order); - } else + } else { set_param_l(out_param, base); + } return err; } @@ -1667,7 +1867,7 @@ static int mpt_alloc_res(struct mlx4_dev *dev, int slave, int op, int cmd, if (err) return err; - err = __mlx4_mpt_alloc_icm(dev, mpt->key); + err = __mlx4_mpt_alloc_icm(dev, mpt->key, GFP_KERNEL); if (err) { res_abort_move(dev, slave, RES_MPT, id); return err; @@ -1799,7 +1999,6 @@ static int mac_add_to_slave(struct mlx4_dev *dev, int slave, u64 mac, int port, return 0; } - static void mac_del_from_slave(struct mlx4_dev *dev, int slave, u64 mac, int port) { @@ -1852,6 +2051,11 @@ static int mac_alloc_res(struct mlx4_dev *dev, int slave, int op, int cmd, return err; port = !in_port ? get_param_l(out_param) : in_port; + port = mlx4_slave_convert_port( + dev, slave, port); + + if (port < 0) + return -EINVAL; mac = in_param; err = __mlx4_register_mac(dev, port, mac); @@ -1949,19 +2153,21 @@ static int vlan_alloc_res(struct mlx4_dev *dev, int slave, int op, int cmd, { struct mlx4_priv *priv = mlx4_priv(dev); struct mlx4_slave_state *slave_state = priv->mfunc.master.slave_state; - int err = -EINVAL; + int err; u16 vlan; int vlan_index; int port; port = !in_port ? get_param_l(out_param) : in_port; - if (!port) - return err; + if (!port || op != RES_OP_RESERVE_AND_MAP) + return -EINVAL; - if (op != RES_OP_RESERVE_AND_MAP) - return err; + port = mlx4_slave_convert_port( + dev, slave, port); + if (port < 0) + return -EINVAL; /* upstream kernels had NOP for reg/unreg vlan. Continue this. */ if (!in_port && port > 0 && port <= dev->caps.num_ports) { slave_state[slave].old_vlan_api = true; @@ -1989,9 +2195,23 @@ static int counter_alloc_res(struct mlx4_dev *dev, int slave, int op, int cmd, if (op != RES_OP_RESERVE) return -EINVAL; - err = __mlx4_counter_alloc(dev, slave, port, &index); - if (!err) + err = mlx4_grant_resource(dev, slave, RES_COUNTER, 1, 0); + if (err) + return err; + + err = __mlx4_counter_alloc(dev, &index); + if (err) { + mlx4_release_resource(dev, slave, RES_COUNTER, 1, 0); + return err; + } + + err = add_res_range(dev, slave, index, 1, RES_COUNTER, port); + if (err) { + __mlx4_counter_free(dev, index); + mlx4_release_resource(dev, slave, RES_COUNTER, 1, 0); + } else { set_param_l(out_param, index); + } return err; } @@ -2067,8 +2287,7 @@ int mlx4_ALLOC_RES_wrapper(struct mlx4_dev *dev, int slave, case RES_COUNTER: err = counter_alloc_res(dev, slave, vhcr->op_modifier, alop, - vhcr->in_param, &vhcr->out_param, - (vhcr->in_modifier >> 8) & 0xFF); + vhcr->in_param, &vhcr->out_param, 0); break; case RES_XRCD: @@ -2169,16 +2388,15 @@ static int mpt_free_res(struct mlx4_dev *dev, int slave, int op, int cmd, __mlx4_mpt_release(dev, index); break; case RES_OP_MAP_ICM: - index = get_param_l(&in_param); - id = index & mpt_mask(dev); - err = mr_res_start_move_to(dev, slave, id, - RES_MPT_RESERVED, &mpt); - if (err) - return err; - - __mlx4_mpt_free_icm(dev, mpt->key); - res_end_move(dev, slave, RES_MPT, id); + index = get_param_l(&in_param); + id = index & mpt_mask(dev); + err = mr_res_start_move_to(dev, slave, id, + RES_MPT_RESERVED, &mpt); + if (err) return err; + + __mlx4_mpt_free_icm(dev, mpt->key); + res_end_move(dev, slave, RES_MPT, id); break; default: err = -EINVAL; @@ -2246,6 +2464,11 @@ static int mac_free_res(struct mlx4_dev *dev, int slave, int op, int cmd, switch (op) { case RES_OP_RESERVE_AND_MAP: port = !in_port ? get_param_l(out_param) : in_port; + port = mlx4_slave_convert_port( + dev, slave, port); + + if (port < 0) + return -EINVAL; mac_del_from_slave(dev, slave, in_param, port); __mlx4_unregister_mac(dev, port, in_param); break; @@ -2265,9 +2488,14 @@ static int vlan_free_res(struct mlx4_dev *dev, int slave, int op, int cmd, struct mlx4_slave_state *slave_state = priv->mfunc.master.slave_state; int err = 0; + port = mlx4_slave_convert_port( + dev, slave, port); + + if (port < 0) + return -EINVAL; switch (op) { case RES_OP_RESERVE_AND_MAP: - if (slave_state[slave].old_vlan_api == true) + if (slave_state[slave].old_vlan_api) return 0; if (!port) return -EINVAL; @@ -2283,18 +2511,26 @@ static int vlan_free_res(struct mlx4_dev *dev, int slave, int op, int cmd, } static int counter_free_res(struct mlx4_dev *dev, int slave, int op, int cmd, - u64 in_param, u64 *out_param, int port) + u64 in_param, u64 *out_param) { int index; + int err; if (op != RES_OP_RESERVE) return -EINVAL; index = get_param_l(&in_param); + if (index == MLX4_SINK_COUNTER_INDEX(dev)) + return 0; - __mlx4_counter_free(dev, slave, port, index); + err = rem_res_range(dev, slave, index, 1, RES_COUNTER, 0); + if (err) + return err; - return 0; + __mlx4_counter_free(dev, index); + mlx4_release_resource(dev, slave, RES_COUNTER, 1, 0); + + return err; } static int xrcdn_free_res(struct mlx4_dev *dev, int slave, int op, int cmd, @@ -2365,8 +2601,7 @@ int mlx4_FREE_RES_wrapper(struct mlx4_dev *dev, int slave, case RES_COUNTER: err = counter_free_res(dev, slave, vhcr->op_modifier, alop, - vhcr->in_param, &vhcr->out_param, - (vhcr->in_modifier >> 8) & 0xFF); + vhcr->in_param, &vhcr->out_param); break; case RES_XRCD: @@ -2484,18 +2719,16 @@ int mlx4_SW2HW_MPT_wrapper(struct mlx4_dev *dev, int slave, if (err) return err; - /* Currently disable memory windows since this feature isn't tested yet - * under virtualization. - */ + /* Disable memory windows for VFs. */ if (!mr_is_region(inbox->buf)) { - err = -ENOSYS; + err = -EPERM; goto ex_abort; } /* Make sure that the PD bits related to the slave id are zeros. */ pd = mr_get_pd(inbox->buf); pd_slave = (pd >> 17) & 0x7f; - if (pd_slave != 0 && pd_slave != slave) { + if (pd_slave != 0 && --pd_slave != slave) { err = -EPERM; goto ex_abort; } @@ -2596,12 +2829,34 @@ int mlx4_QUERY_MPT_wrapper(struct mlx4_dev *dev, int slave, if (err) return err; - if (mpt->com.from_state != RES_MPT_HW) { + if (mpt->com.from_state == RES_MPT_MAPPED) { + /* In order to allow rereg in SRIOV, we need to alter the MPT entry. To do + * that, the VF must read the MPT. But since the MPT entry memory is not + * in the VF's virtual memory space, it must use QUERY_MPT to obtain the + * entry contents. To guarantee that the MPT cannot be changed, the driver + * must perform HW2SW_MPT before this query and return the MPT entry to HW + * ownership fofollowing the change. The change here allows the VF to + * perform QUERY_MPT also when the entry is in SW ownership. + */ + struct mlx4_mpt_entry *mpt_entry = mlx4_table_find( + &mlx4_priv(dev)->mr_table.dmpt_table, + mpt->key, NULL); + + if (NULL == mpt_entry || NULL == outbox->buf) { + err = -EINVAL; + goto out; + } + + memcpy(outbox->buf, mpt_entry, sizeof(*mpt_entry)); + + err = 0; + } else if (mpt->com.from_state == RES_MPT_HW) { + err = mlx4_DMA_wrapper(dev, slave, vhcr, inbox, outbox, cmd); + } else { err = -EBUSY; goto out; } - err = mlx4_DMA_wrapper(dev, slave, vhcr, inbox, outbox, cmd); out: put_res(dev, slave, id, RES_MPT); @@ -2636,6 +2891,10 @@ static void adjust_proxy_tun_qkey(struct mlx4_dev *dev, struct mlx4_vhcr *vhcr, context->qkey = cpu_to_be32(qkey); } +static int adjust_qp_sched_queue(struct mlx4_dev *dev, int slave, + struct mlx4_qp_context *qpc, + struct mlx4_cmd_mailbox *inbox); + int mlx4_RST2INIT_QP_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_vhcr *vhcr, struct mlx4_cmd_mailbox *inbox, @@ -2658,6 +2917,10 @@ int mlx4_RST2INIT_QP_wrapper(struct mlx4_dev *dev, int slave, struct res_srq *srq; int local_qpn = be32_to_cpu(qpc->local_qpn) & 0xffffff; + err = adjust_qp_sched_queue(dev, slave, qpc, inbox); + if (err) + return err; + err = qp_res_start_move_to(dev, slave, qpn, RES_QP_HW, &qp, 0); if (err) return err; @@ -2778,7 +3041,7 @@ int mlx4_SW2HW_EQ_wrapper(struct mlx4_dev *dev, int slave, { int err; int eqn = vhcr->in_modifier; - int res_id = (slave << 8) | eqn; + int res_id = (slave << 10) | eqn; struct mlx4_eq_context *eqc = inbox->buf; int mtt_base = eq_get_mtt_addr(eqc) / dev->caps.mtt_entry_sz; int mtt_size = eq_get_mtt_size(eqc); @@ -2819,6 +3082,23 @@ int mlx4_SW2HW_EQ_wrapper(struct mlx4_dev *dev, int slave, return err; } +int mlx4_CONFIG_DEV_wrapper(struct mlx4_dev *dev, int slave, + struct mlx4_vhcr *vhcr, + struct mlx4_cmd_mailbox *inbox, + struct mlx4_cmd_mailbox *outbox, + struct mlx4_cmd_info *cmd) +{ + int err; + u8 get = vhcr->op_modifier; + + if (get != 1) + return -EPERM; + + err = mlx4_DMA_wrapper(dev, slave, vhcr, inbox, outbox, cmd); + + return err; +} + static int get_containing_mtt(struct mlx4_dev *dev, int slave, int start, int len, struct res_mtt **res) { @@ -2844,10 +3124,12 @@ static int get_containing_mtt(struct mlx4_dev *dev, int slave, int start, } static int verify_qp_parameters(struct mlx4_dev *dev, + struct mlx4_vhcr *vhcr, struct mlx4_cmd_mailbox *inbox, enum qp_transition transition, u8 slave) { u32 qp_type; + u32 qpn; struct mlx4_qp_context *qp_ctx; enum mlx4_qp_optpar optpar; int port; @@ -2857,8 +3139,16 @@ static int verify_qp_parameters(struct mlx4_dev *dev, qp_type = (be32_to_cpu(qp_ctx->flags) >> 16) & 0xff; optpar = be32_to_cpu(*(__be32 *) inbox->buf); + if (slave != mlx4_master_func_num(dev)) { + qp_ctx->params2 &= ~MLX4_QP_BIT_FPP; + /* setting QP rate-limit is disallowed for VFs */ + if (qp_ctx->rate_limit_params) + return -EPERM; + } + switch (qp_type) { case MLX4_QP_ST_RC: + case MLX4_QP_ST_XRC: case MLX4_QP_ST_UC: switch (transition) { case QP_TRANS_INIT2RTR: @@ -2866,11 +3156,11 @@ static int verify_qp_parameters(struct mlx4_dev *dev, case QP_TRANS_RTS2RTS: case QP_TRANS_SQD2SQD: case QP_TRANS_SQD2RTS: - if (slave != mlx4_master_func_num(dev)) + if (slave != mlx4_master_func_num(dev)) { if (optpar & MLX4_QP_OPTPAR_PRIMARY_ADDR_PATH) { port = (qp_ctx->pri_path.sched_queue >> 6 & 1) + 1; if (dev->caps.port_mask[port] != MLX4_PORT_TYPE_IB) - num_gids = mlx4_get_slave_num_gids(dev, slave); + num_gids = mlx4_get_slave_num_gids(dev, slave, port); else num_gids = 1; if (qp_ctx->pri_path.mgid_index >= num_gids) @@ -2879,18 +3169,33 @@ static int verify_qp_parameters(struct mlx4_dev *dev, if (optpar & MLX4_QP_OPTPAR_ALT_ADDR_PATH) { port = (qp_ctx->alt_path.sched_queue >> 6 & 1) + 1; if (dev->caps.port_mask[port] != MLX4_PORT_TYPE_IB) - num_gids = mlx4_get_slave_num_gids(dev, slave); + num_gids = mlx4_get_slave_num_gids(dev, slave, port); else num_gids = 1; if (qp_ctx->alt_path.mgid_index >= num_gids) return -EINVAL; } + } break; default: break; } - break; + + case MLX4_QP_ST_MLX: + qpn = vhcr->in_modifier & 0x7fffff; + port = (qp_ctx->pri_path.sched_queue >> 6 & 1) + 1; + if (transition == QP_TRANS_INIT2RTR && + slave != mlx4_master_func_num(dev) && + mlx4_is_qp_reserved(dev, qpn) && + !mlx4_vf_smi_enabled(dev, slave, port)) { + /* only enabled VFs may create MLX proxy QPs */ + mlx4_err(dev, "%s: unprivileged slave %d attempting to create an MLX proxy special QP on port %d\n", + __func__, slave, port); + return -EPERM; + } + break; + default: break; } @@ -2943,7 +3248,7 @@ int mlx4_HW2SW_EQ_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_cmd_info *cmd) { int eqn = vhcr->in_modifier; - int res_id = eqn | (slave << 8); + int res_id = eqn | (slave << 10); struct res_eq *eq; int err; @@ -2988,7 +3293,7 @@ int mlx4_GEN_EQE(struct mlx4_dev *dev, int slave, struct mlx4_eqe *eqe) return -EINVAL; /* check for slave valid, slave not PF, and slave active */ - if (slave < 0 || slave >= dev->num_slaves || + if (slave < 0 || slave > dev->persist->num_vfs || slave == dev->caps.function || !priv->mfunc.master.slave_state[slave].active) return 0; @@ -3000,7 +3305,7 @@ int mlx4_GEN_EQE(struct mlx4_dev *dev, int slave, struct mlx4_eqe *eqe) return 0; mutex_lock(&priv->mfunc.master.gen_eqe_mutex[slave]); - res_id = (slave << 8) | event_eq->eqn; + res_id = (slave << 10) | event_eq->eqn; err = get_res(dev, slave, res_id, RES_EQ, &req); if (err) goto unlock; @@ -3023,7 +3328,7 @@ int mlx4_GEN_EQE(struct mlx4_dev *dev, int slave, struct mlx4_eqe *eqe) memcpy(mailbox->buf, (u8 *) eqe, 28); - in_modifier = (slave & 0xff) | ((event_eq->eqn & 0xff) << 16); + in_modifier = (slave & 0xff) | ((event_eq->eqn & 0x3ff) << 16); err = mlx4_cmd(dev, mailbox->dma, in_modifier, 0, MLX4_CMD_GEN_EQE, MLX4_CMD_TIME_CLASS_B, @@ -3049,7 +3354,7 @@ int mlx4_QUERY_EQ_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_cmd_info *cmd) { int eqn = vhcr->in_modifier; - int res_id = eqn | (slave << 8); + int res_id = eqn | (slave << 10); struct res_eq *eq; int err; @@ -3079,7 +3384,7 @@ int mlx4_SW2HW_CQ_wrapper(struct mlx4_dev *dev, int slave, int cqn = vhcr->in_modifier; struct mlx4_cq_context *cqc = inbox->buf; int mtt_base = cq_get_mtt_addr(cqc) / dev->caps.mtt_entry_sz; - struct res_cq *cq; + struct res_cq *cq = NULL; struct res_mtt *mtt; err = cq_res_start_move_to(dev, slave, cqn, RES_CQ_HW, &cq); @@ -3115,7 +3420,7 @@ int mlx4_HW2SW_CQ_wrapper(struct mlx4_dev *dev, int slave, { int err; int cqn = vhcr->in_modifier; - struct res_cq *cq; + struct res_cq *cq = NULL; err = cq_res_start_move_to(dev, slave, cqn, RES_CQ_ALLOCATED, &cq); if (err) @@ -3254,7 +3559,7 @@ int mlx4_SW2HW_SRQ_wrapper(struct mlx4_dev *dev, int slave, int err; int srqn = vhcr->in_modifier; struct res_mtt *mtt; - struct res_srq *srq; + struct res_srq *srq = NULL; struct mlx4_srq_context *srqc = inbox->buf; int mtt_base = srq_get_mtt_addr(srqc) / dev->caps.mtt_entry_sz; @@ -3298,7 +3603,7 @@ int mlx4_HW2SW_SRQ_wrapper(struct mlx4_dev *dev, int slave, { int err; int srqn = vhcr->in_modifier; - struct res_srq *srq; + struct res_srq *srq = NULL; err = srq_res_start_move_to(dev, slave, srqn, RES_SRQ_ALLOCATED, &srq); if (err) @@ -3403,6 +3708,39 @@ int mlx4_INIT2INIT_QP_wrapper(struct mlx4_dev *dev, int slave, return mlx4_GEN_QP_wrapper(dev, slave, vhcr, inbox, outbox, cmd); } +static int adjust_qp_sched_queue(struct mlx4_dev *dev, int slave, + struct mlx4_qp_context *qpc, + struct mlx4_cmd_mailbox *inbox) +{ + enum mlx4_qp_optpar optpar = be32_to_cpu(*(__be32 *)inbox->buf); + u8 pri_sched_queue; + int port = mlx4_slave_convert_port( + dev, slave, (qpc->pri_path.sched_queue >> 6 & 1) + 1) - 1; + + if (port < 0) + return -EINVAL; + + pri_sched_queue = (qpc->pri_path.sched_queue & ~(1 << 6)) | + ((port & 1) << 6); + + if (optpar & (MLX4_QP_OPTPAR_PRIMARY_ADDR_PATH | MLX4_QP_OPTPAR_SCHED_QUEUE) || + qpc->pri_path.sched_queue || mlx4_is_eth(dev, port + 1)) { + qpc->pri_path.sched_queue = pri_sched_queue; + } + + if (optpar & MLX4_QP_OPTPAR_ALT_ADDR_PATH) { + port = mlx4_slave_convert_port( + dev, slave, (qpc->alt_path.sched_queue >> 6 & 1) + + 1) - 1; + if (port < 0) + return -EINVAL; + qpc->alt_path.sched_queue = + (qpc->alt_path.sched_queue & ~(1 << 6)) | + (port & 1) << 6; + } + return 0; +} + static int roce_verify_mac(struct mlx4_dev *dev, int slave, struct mlx4_qp_context *qpc, struct mlx4_cmd_mailbox *inbox) @@ -3440,7 +3778,10 @@ int mlx4_INIT2RTR_QP_wrapper(struct mlx4_dev *dev, int slave, u8 orig_vlan_index = qpc->pri_path.vlan_index; u8 orig_feup = qpc->pri_path.feup; - err = verify_qp_parameters(dev, inbox, QP_TRANS_INIT2RTR, slave); + err = adjust_qp_sched_queue(dev, slave, qpc, inbox); + if (err) + return err; + err = verify_qp_parameters(dev, vhcr, inbox, QP_TRANS_INIT2RTR, slave); if (err) return err; @@ -3460,12 +3801,9 @@ int mlx4_INIT2RTR_QP_wrapper(struct mlx4_dev *dev, int slave, goto out; } - /* do not modify vport QP params for RSS QPs */ - if (!(qp->qpc_flags & (1 << MLX4_RSS_QPC_FLAG_OFFSET))) { - err = update_vport_qp_param(dev, inbox, slave, qpn); - if (err) - goto out; - } + err = update_vport_qp_param(dev, inbox, slave, qpn); + if (err) + goto out; err = mlx4_DMA_wrapper(dev, slave, vhcr, inbox, outbox, cmd); out: @@ -3495,7 +3833,10 @@ int mlx4_RTR2RTS_QP_wrapper(struct mlx4_dev *dev, int slave, int err; struct mlx4_qp_context *context = inbox->buf + 8; - err = verify_qp_parameters(dev, inbox, QP_TRANS_RTR2RTS, slave); + err = adjust_qp_sched_queue(dev, slave, context, inbox); + if (err) + return err; + err = verify_qp_parameters(dev, vhcr, inbox, QP_TRANS_RTR2RTS, slave); if (err) return err; @@ -3514,7 +3855,10 @@ int mlx4_RTS2RTS_QP_wrapper(struct mlx4_dev *dev, int slave, int err; struct mlx4_qp_context *context = inbox->buf + 8; - err = verify_qp_parameters(dev, inbox, QP_TRANS_RTS2RTS, slave); + err = adjust_qp_sched_queue(dev, slave, context, inbox); + if (err) + return err; + err = verify_qp_parameters(dev, vhcr, inbox, QP_TRANS_RTS2RTS, slave); if (err) return err; @@ -3532,6 +3876,9 @@ int mlx4_SQERR2RTS_QP_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_cmd_info *cmd) { struct mlx4_qp_context *context = inbox->buf + 8; + int err = adjust_qp_sched_queue(dev, slave, context, inbox); + if (err) + return err; adjust_proxy_tun_qkey(dev, vhcr, context); return mlx4_GEN_QP_wrapper(dev, slave, vhcr, inbox, outbox, cmd); } @@ -3545,7 +3892,10 @@ int mlx4_SQD2SQD_QP_wrapper(struct mlx4_dev *dev, int slave, int err; struct mlx4_qp_context *context = inbox->buf + 8; - err = verify_qp_parameters(dev, inbox, QP_TRANS_SQD2SQD, slave); + err = adjust_qp_sched_queue(dev, slave, context, inbox); + if (err) + return err; + err = verify_qp_parameters(dev, vhcr, inbox, QP_TRANS_SQD2SQD, slave); if (err) return err; @@ -3564,7 +3914,10 @@ int mlx4_SQD2RTS_QP_wrapper(struct mlx4_dev *dev, int slave, int err; struct mlx4_qp_context *context = inbox->buf + 8; - err = verify_qp_parameters(dev, inbox, QP_TRANS_SQD2RTS, slave); + err = adjust_qp_sched_queue(dev, slave, context, inbox); + if (err) + return err; + err = verify_qp_parameters(dev, vhcr, inbox, QP_TRANS_SQD2RTS, slave); if (err) return err; @@ -3667,16 +4020,26 @@ static int rem_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp, return err; } -static int qp_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], - int block_loopback, enum mlx4_protocol prot, +static int qp_attach(struct mlx4_dev *dev, int slave, struct mlx4_qp *qp, + u8 gid[16], int block_loopback, enum mlx4_protocol prot, enum mlx4_steer_type type, u64 *reg_id) { switch (dev->caps.steering_mode) { - case MLX4_STEERING_MODE_DEVICE_MANAGED: - return mlx4_trans_to_dmfs_attach(dev, qp, gid, gid[5], + case MLX4_STEERING_MODE_DEVICE_MANAGED: { + int port = mlx4_slave_convert_port(dev, slave, gid[5]); + if (port < 0) + return port; + return mlx4_trans_to_dmfs_attach(dev, qp, gid, port, block_loopback, prot, reg_id); + } case MLX4_STEERING_MODE_B0: + if (prot == MLX4_PROT_ETH) { + int port = mlx4_slave_convert_port(dev, slave, gid[5]); + if (port < 0) + return port; + gid[5] = port; + } return mlx4_qp_attach_common(dev, qp, gid, block_loopback, prot, type); default: @@ -3684,9 +4047,9 @@ static int qp_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], } } -static int qp_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], - enum mlx4_protocol prot, enum mlx4_steer_type type, - u64 reg_id) +static int qp_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, + u8 gid[16], enum mlx4_protocol prot, + enum mlx4_steer_type type, u64 reg_id) { switch (dev->caps.steering_mode) { case MLX4_STEERING_MODE_DEVICE_MANAGED: @@ -3698,6 +4061,25 @@ static int qp_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], } } +static int mlx4_adjust_port(struct mlx4_dev *dev, int slave, + u8 *gid, enum mlx4_protocol prot) +{ + int real_port; + + if (prot != MLX4_PROT_ETH) + return 0; + + if (dev->caps.steering_mode == MLX4_STEERING_MODE_B0 || + dev->caps.steering_mode == MLX4_STEERING_MODE_DEVICE_MANAGED) { + real_port = mlx4_slave_convert_port(dev, slave, gid[5]); + if (real_port < 0) + return -EINVAL; + gid[5] = real_port; + } + + return 0; +} + int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_vhcr *vhcr, struct mlx4_cmd_mailbox *inbox, @@ -3723,7 +4105,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, qp.qpn = qpn; if (attach) { - err = qp_attach(dev, &qp, gid, block_loopback, prot, + err = qp_attach(dev, slave, &qp, gid, block_loopback, prot, type, ®_id); if (err) { pr_err("Fail to attach rule to qp 0x%x\n", qpn); @@ -3733,6 +4115,10 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, if (err) goto ex_detach; } else { + err = mlx4_adjust_port(dev, slave, gid, prot); + if (err) + goto ex_put; + err = rem_mcg_res(dev, slave, rqp, gid, prot, type, ®_id); if (err) goto ex_put; @@ -3767,7 +4153,7 @@ static int validate_eth_header_mac(int slave, struct _rule_hw *eth_header, !is_broadcast_ether_addr(eth_header->eth.dst_mac)) { list_for_each_entry_safe(res, tmp, rlist, list) { be_mac = cpu_to_be64(res->mac << 16); - if (!memcmp(&be_mac, eth_header->eth.dst_mac, ETH_ALEN)) + if (ether_addr_equal((u8 *)&be_mac, eth_header->eth.dst_mac)) return 0; } pr_err("MAC %pM doesn't belong to VF %d, Steering rule rejected\n", @@ -3777,6 +4163,22 @@ static int validate_eth_header_mac(int slave, struct _rule_hw *eth_header, return 0; } +static void handle_eth_header_mcast_prio(struct mlx4_net_trans_rule_hw_ctrl *ctrl, + struct _rule_hw *eth_header) +{ + if (is_multicast_ether_addr(eth_header->eth.dst_mac) || + is_broadcast_ether_addr(eth_header->eth.dst_mac)) { + struct mlx4_net_trans_rule_hw_eth *eth = + (struct mlx4_net_trans_rule_hw_eth *)eth_header; + struct _rule_hw *next_rule = (struct _rule_hw *)(eth + 1); + bool last_rule = next_rule->size == 0 && next_rule->id == 0 && + next_rule->rsvd == 0; + + if (last_rule) + ctrl->prio = cpu_to_be16(MLX4_DOMAIN_NIC); + } +} + /* * In case of missing eth header, append eth header with a MAC address * assigned to the VF. @@ -3822,7 +4224,7 @@ static int add_eth_header(struct mlx4_dev *dev, int slave, } } if (!be_mac) { - pr_err("Failed adding eth header to FS rule, Can't find matching MAC for port %d .\n", + pr_err("Failed adding eth header to FS rule, Can't find matching MAC for port %d\n", port); return -EINVAL; } @@ -3834,9 +4236,93 @@ static int add_eth_header(struct mlx4_dev *dev, int slave, memcpy(eth_header->dst_mac_msk, &mac_msk, ETH_ALEN); return 0; - } +#define MLX4_UPD_QP_PATH_MASK_SUPPORTED ( \ + 1ULL << MLX4_UPD_QP_PATH_MASK_MAC_INDEX |\ + 1ULL << MLX4_UPD_QP_PATH_MASK_ETH_SRC_CHECK_MC_LB) +int mlx4_UPDATE_QP_wrapper(struct mlx4_dev *dev, int slave, + struct mlx4_vhcr *vhcr, + struct mlx4_cmd_mailbox *inbox, + struct mlx4_cmd_mailbox *outbox, + struct mlx4_cmd_info *cmd_info) +{ + int err; + u32 qpn = vhcr->in_modifier & 0xffffff; + struct res_qp *rqp; + u64 mac; + unsigned port; + u64 pri_addr_path_mask; + struct mlx4_update_qp_context *cmd; + int smac_index; + + cmd = (struct mlx4_update_qp_context *)inbox->buf; + + pri_addr_path_mask = be64_to_cpu(cmd->primary_addr_path_mask); + if (cmd->qp_mask || cmd->secondary_addr_path_mask || + (pri_addr_path_mask & ~MLX4_UPD_QP_PATH_MASK_SUPPORTED)) + return -EPERM; + + if ((pri_addr_path_mask & + (1ULL << MLX4_UPD_QP_PATH_MASK_ETH_SRC_CHECK_MC_LB)) && + !(dev->caps.flags2 & + MLX4_DEV_CAP_FLAG2_UPDATE_QP_SRC_CHECK_LB)) { + mlx4_warn(dev, "Src check LB for slave %d isn't supported\n", + slave); + return -ENOTSUPP; + } + + /* Just change the smac for the QP */ + err = get_res(dev, slave, qpn, RES_QP, &rqp); + if (err) { + mlx4_err(dev, "Updating qpn 0x%x for slave %d rejected\n", qpn, slave); + return err; + } + + port = (rqp->sched_queue >> 6 & 1) + 1; + + if (pri_addr_path_mask & (1ULL << MLX4_UPD_QP_PATH_MASK_MAC_INDEX)) { + smac_index = cmd->qp_context.pri_path.grh_mylmc; + err = mac_find_smac_ix_in_slave(dev, slave, port, + smac_index, &mac); + + if (err) { + mlx4_err(dev, "Failed to update qpn 0x%x, MAC is invalid. smac_ix: %d\n", + qpn, smac_index); + goto err_mac; + } + } + + err = mlx4_cmd(dev, inbox->dma, + vhcr->in_modifier, 0, + MLX4_CMD_UPDATE_QP, MLX4_CMD_TIME_CLASS_A, + MLX4_CMD_NATIVE); + if (err) { + mlx4_err(dev, "Failed to update qpn on qpn 0x%x, command failed\n", qpn); + goto err_mac; + } + +err_mac: + put_res(dev, slave, qpn, RES_QP); + return err; +} + +static u32 qp_attach_mbox_size(void *mbox) +{ + u32 size = sizeof(struct mlx4_net_trans_rule_hw_ctrl); + struct _rule_hw *rule_header; + + rule_header = (struct _rule_hw *)(mbox + size); + + while (rule_header->size) { + size += rule_header->size * sizeof(u32); + rule_header += 1; + } + return size; +} + +static int mlx4_do_mirror_rule(struct mlx4_dev *dev, struct res_fs_rule *fs_rule); + int mlx4_QP_FLOW_STEERING_ATTACH_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_vhcr *vhcr, struct mlx4_cmd_mailbox *inbox, @@ -3853,26 +4339,38 @@ int mlx4_QP_FLOW_STEERING_ATTACH_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_net_trans_rule_hw_ctrl *ctrl; struct _rule_hw *rule_header; int header_id; + struct res_fs_rule *rrule; + u32 mbox_size; if (dev->caps.steering_mode != MLX4_STEERING_MODE_DEVICE_MANAGED) return -EOPNOTSUPP; ctrl = (struct mlx4_net_trans_rule_hw_ctrl *)inbox->buf; + err = mlx4_slave_convert_port(dev, slave, ctrl->port); + if (err <= 0) + return -EINVAL; + ctrl->port = err; qpn = be32_to_cpu(ctrl->qpn) & 0xffffff; err = get_res(dev, slave, qpn, RES_QP, &rqp); if (err) { - pr_err("Steering rule with qpn 0x%x rejected.\n", qpn); + pr_err("Steering rule with qpn 0x%x rejected\n", qpn); return err; } rule_header = (struct _rule_hw *)(ctrl + 1); header_id = map_hw_to_sw_id(be16_to_cpu(rule_header->id)); + if (header_id == MLX4_NET_TRANS_RULE_ID_ETH) + handle_eth_header_mcast_prio(ctrl, rule_header); + + if (slave == dev->caps.function) + goto execute; + switch (header_id) { case MLX4_NET_TRANS_RULE_ID_ETH: if (validate_eth_header_mac(slave, rule_header, rlist)) { err = -EINVAL; - goto err_put; + goto err_put_qp; } break; case MLX4_NET_TRANS_RULE_ID_IB: @@ -3880,42 +4378,89 @@ int mlx4_QP_FLOW_STEERING_ATTACH_wrapper(struct mlx4_dev *dev, int slave, case MLX4_NET_TRANS_RULE_ID_IPV4: case MLX4_NET_TRANS_RULE_ID_TCP: case MLX4_NET_TRANS_RULE_ID_UDP: - pr_warn("Can't attach FS rule without L2 headers, adding L2 header.\n"); + pr_warn("Can't attach FS rule without L2 headers, adding L2 header\n"); if (add_eth_header(dev, slave, inbox, rlist, header_id)) { err = -EINVAL; - goto err_put; + goto err_put_qp; } vhcr->in_modifier += sizeof(struct mlx4_net_trans_rule_hw_eth) >> 2; break; default: - pr_err("Corrupted mailbox.\n"); + pr_err("Corrupted mailbox\n"); err = -EINVAL; - goto err_put; + goto err_put_qp; } +execute: err = mlx4_cmd_imm(dev, inbox->dma, &vhcr->out_param, vhcr->in_modifier, 0, MLX4_QP_FLOW_STEERING_ATTACH, MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); if (err) - goto err_put; + goto err_put_qp; + err = add_res_range(dev, slave, vhcr->out_param, 1, RES_FS_RULE, qpn); if (err) { - mlx4_err(dev, "Fail to add flow steering resources.\n "); - /* detach rule*/ + mlx4_err(dev, "Fail to add flow steering resources\n"); + goto err_detach; + } + + err = get_res(dev, slave, vhcr->out_param, RES_FS_RULE, &rrule); + if (err) + goto err_detach; + + mbox_size = qp_attach_mbox_size(inbox->buf); + rrule->mirr_mbox = kmalloc(mbox_size, GFP_KERNEL); + if (!rrule->mirr_mbox) { + err = -ENOMEM; + goto err_put_rule; + } + rrule->mirr_mbox_size = mbox_size; + rrule->mirr_rule_id = 0; + memcpy(rrule->mirr_mbox, inbox->buf, mbox_size); + + /* set different port */ + ctrl = (struct mlx4_net_trans_rule_hw_ctrl *)rrule->mirr_mbox; + if (ctrl->port == 1) + ctrl->port = 2; + else + ctrl->port = 1; + + if (mlx4_is_bonded(dev)) + mlx4_do_mirror_rule(dev, rrule); + + atomic_inc(&rqp->ref_count); + +err_put_rule: + put_res(dev, slave, vhcr->out_param, RES_FS_RULE); +err_detach: + /* detach rule on error */ + if (err) mlx4_cmd(dev, vhcr->out_param, 0, 0, MLX4_QP_FLOW_STEERING_DETACH, MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); - goto err_put; - } - atomic_inc(&rqp->ref_count); -err_put: +err_put_qp: put_res(dev, slave, qpn, RES_QP); return err; } +static int mlx4_undo_mirror_rule(struct mlx4_dev *dev, struct res_fs_rule *fs_rule) +{ + int err; + + err = rem_res_range(dev, fs_rule->com.owner, fs_rule->com.res_id, 1, RES_FS_RULE, 0); + if (err) { + mlx4_err(dev, "Fail to remove flow steering resources\n"); + return err; + } + + mlx4_cmd(dev, fs_rule->com.res_id, 0, 0, MLX4_QP_FLOW_STEERING_DETACH, + MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); + return 0; +} + int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_vhcr *vhcr, struct mlx4_cmd_mailbox *inbox, @@ -3925,6 +4470,7 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct mlx4_dev *dev, int slave, int err; struct res_qp *rqp; struct res_fs_rule *rrule; + u64 mirr_reg_id; if (dev->caps.steering_mode != MLX4_STEERING_MODE_DEVICE_MANAGED) @@ -3933,26 +4479,41 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct mlx4_dev *dev, int slave, err = get_res(dev, slave, vhcr->in_param, RES_FS_RULE, &rrule); if (err) return err; + + if (!rrule->mirr_mbox) { + mlx4_err(dev, "Mirror rules cannot be removed explicitly\n"); + put_res(dev, slave, vhcr->in_param, RES_FS_RULE); + return -EINVAL; + } + mirr_reg_id = rrule->mirr_rule_id; + kfree(rrule->mirr_mbox); + /* Release the rule form busy state before removal */ put_res(dev, slave, vhcr->in_param, RES_FS_RULE); err = get_res(dev, slave, rrule->qpn, RES_QP, &rqp); if (err) return err; + if (mirr_reg_id && mlx4_is_bonded(dev)) { + err = get_res(dev, slave, mirr_reg_id, RES_FS_RULE, &rrule); + if (err) { + mlx4_err(dev, "Fail to get resource of mirror rule\n"); + } else { + put_res(dev, slave, mirr_reg_id, RES_FS_RULE); + mlx4_undo_mirror_rule(dev, rrule); + } + } + err = rem_res_range(dev, slave, vhcr->in_param, 1, RES_FS_RULE, 0); + if (err) { + mlx4_err(dev, "Fail to remove flow steering resources\n"); + goto out; + } + err = mlx4_cmd(dev, vhcr->in_param, 0, 0, MLX4_QP_FLOW_STEERING_DETACH, MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); - if (!err) { - err = rem_res_range(dev, slave, vhcr->in_param, 1, RES_FS_RULE, - 0); + if (!err) atomic_dec(&rqp->ref_count); - - if (err) { - mlx4_err(dev, "Fail to remove flow steering resources.\n "); - goto out; - } - } - out: put_res(dev, slave, rrule->qpn, RES_QP); return err; @@ -3969,9 +4530,14 @@ int mlx4_QUERY_IF_STAT_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_cmd_info *cmd) { int err; + int index = vhcr->in_modifier & 0xffff; + + err = get_res(dev, slave, index, RES_COUNTER, NULL); + if (err) + return err; err = mlx4_DMA_wrapper(dev, slave, vhcr, inbox, outbox, cmd); - + put_res(dev, slave, index, RES_COUNTER); return err; } @@ -4017,8 +4583,8 @@ static int _move_all_busy(struct mlx4_dev *dev, int slave, if (print) mlx4_dbg(dev, "%s id 0x%llx is busy\n", - ResourceType(type), - (unsigned long long)r->res_id); + resource_str(type), + (long long)r->res_id); ++busy; } else { r->from_state = r->state; @@ -4068,8 +4634,8 @@ static void rem_slave_qps(struct mlx4_dev *dev, int slave) err = move_all_busy(dev, slave, RES_QP); if (err) - mlx4_warn(dev, "rem_slave_qps: Could not move all qps to busy" - "for slave %d\n", slave); + mlx4_warn(dev, "rem_slave_qps: Could not move all qps to busy for slave %d\n", + slave); spin_lock_irq(mlx4_tlock(dev)); list_for_each_entry_safe(qp, tmp, qp_list, com.list) { @@ -4107,10 +4673,8 @@ static void rem_slave_qps(struct mlx4_dev *dev, int slave) MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); if (err) - mlx4_dbg(dev, "rem_slave_qps: failed" - " to move slave %d qpn %d to" - " reset\n", slave, - qp->local_qpn); + mlx4_dbg(dev, "rem_slave_qps: failed to move slave %d qpn %d to reset\n", + slave, qp->local_qpn); atomic_dec(&qp->rcq->ref_count); atomic_dec(&qp->scq->ref_count); atomic_dec(&qp->mtt->ref_count); @@ -4144,8 +4708,8 @@ static void rem_slave_srqs(struct mlx4_dev *dev, int slave) err = move_all_busy(dev, slave, RES_SRQ); if (err) - mlx4_warn(dev, "rem_slave_srqs: Could not move all srqs to " - "busy for slave %d\n", slave); + mlx4_warn(dev, "rem_slave_srqs: Could not move all srqs - too busy for slave %d\n", + slave); spin_lock_irq(mlx4_tlock(dev)); list_for_each_entry_safe(srq, tmp, srq_list, com.list) { @@ -4175,9 +4739,7 @@ static void rem_slave_srqs(struct mlx4_dev *dev, int slave) MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); if (err) - mlx4_dbg(dev, "rem_slave_srqs: failed" - " to move slave %d srq %d to" - " SW ownership\n", + mlx4_dbg(dev, "rem_slave_srqs: failed to move slave %d srq %d to SW ownership\n", slave, srqn); atomic_dec(&srq->mtt->ref_count); @@ -4212,8 +4774,8 @@ static void rem_slave_cqs(struct mlx4_dev *dev, int slave) err = move_all_busy(dev, slave, RES_CQ); if (err) - mlx4_warn(dev, "rem_slave_cqs: Could not move all cqs to " - "busy for slave %d\n", slave); + mlx4_warn(dev, "rem_slave_cqs: Could not move all cqs - too busy for slave %d\n", + slave); spin_lock_irq(mlx4_tlock(dev)); list_for_each_entry_safe(cq, tmp, cq_list, com.list) { @@ -4243,9 +4805,7 @@ static void rem_slave_cqs(struct mlx4_dev *dev, int slave) MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); if (err) - mlx4_dbg(dev, "rem_slave_cqs: failed" - " to move slave %d cq %d to" - " SW ownership\n", + mlx4_dbg(dev, "rem_slave_cqs: failed to move slave %d cq %d to SW ownership\n", slave, cqn); atomic_dec(&cq->mtt->ref_count); state = RES_CQ_ALLOCATED; @@ -4277,8 +4837,8 @@ static void rem_slave_mrs(struct mlx4_dev *dev, int slave) err = move_all_busy(dev, slave, RES_MPT); if (err) - mlx4_warn(dev, "rem_slave_mrs: Could not move all mpts to " - "busy for slave %d\n", slave); + mlx4_warn(dev, "rem_slave_mrs: Could not move all mpts - too busy for slave %d\n", + slave); spin_lock_irq(mlx4_tlock(dev)); list_for_each_entry_safe(mpt, tmp, mpt_list, com.list) { @@ -4313,9 +4873,7 @@ static void rem_slave_mrs(struct mlx4_dev *dev, int slave) MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); if (err) - mlx4_dbg(dev, "rem_slave_mrs: failed" - " to move slave %d mpt %d to" - " SW ownership\n", + mlx4_dbg(dev, "rem_slave_mrs: failed to move slave %d mpt %d to SW ownership\n", slave, mptn); if (mpt->mtt) atomic_dec(&mpt->mtt->ref_count); @@ -4347,8 +4905,8 @@ static void rem_slave_mtts(struct mlx4_dev *dev, int slave) err = move_all_busy(dev, slave, RES_MTT); if (err) - mlx4_warn(dev, "rem_slave_mtts: Could not move all mtts to " - "busy for slave %d\n", slave); + mlx4_warn(dev, "rem_slave_mtts: Could not move all mtts - too busy for slave %d\n", + slave); spin_lock_irq(mlx4_tlock(dev)); list_for_each_entry_safe(mtt, tmp, mtt_list, com.list) { @@ -4382,6 +4940,91 @@ static void rem_slave_mtts(struct mlx4_dev *dev, int slave) spin_unlock_irq(mlx4_tlock(dev)); } +static int mlx4_do_mirror_rule(struct mlx4_dev *dev, struct res_fs_rule *fs_rule) +{ + struct mlx4_cmd_mailbox *mailbox; + int err; + struct res_fs_rule *mirr_rule; + u64 reg_id; + + mailbox = mlx4_alloc_cmd_mailbox(dev); + if (IS_ERR(mailbox)) + return PTR_ERR(mailbox); + + if (!fs_rule->mirr_mbox) { + mlx4_err(dev, "rule mirroring mailbox is null\n"); + return -EINVAL; + } + memcpy(mailbox->buf, fs_rule->mirr_mbox, fs_rule->mirr_mbox_size); + err = mlx4_cmd_imm(dev, mailbox->dma, ®_id, fs_rule->mirr_mbox_size >> 2, 0, + MLX4_QP_FLOW_STEERING_ATTACH, MLX4_CMD_TIME_CLASS_A, + MLX4_CMD_NATIVE); + mlx4_free_cmd_mailbox(dev, mailbox); + + if (err) + goto err; + + err = add_res_range(dev, fs_rule->com.owner, reg_id, 1, RES_FS_RULE, fs_rule->qpn); + if (err) + goto err_detach; + + err = get_res(dev, fs_rule->com.owner, reg_id, RES_FS_RULE, &mirr_rule); + if (err) + goto err_rem; + + fs_rule->mirr_rule_id = reg_id; + mirr_rule->mirr_rule_id = 0; + mirr_rule->mirr_mbox_size = 0; + mirr_rule->mirr_mbox = NULL; + put_res(dev, fs_rule->com.owner, reg_id, RES_FS_RULE); + + return 0; +err_rem: + rem_res_range(dev, fs_rule->com.owner, reg_id, 1, RES_FS_RULE, 0); +err_detach: + mlx4_cmd(dev, reg_id, 0, 0, MLX4_QP_FLOW_STEERING_DETACH, + MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); +err: + return err; +} + +static int mlx4_mirror_fs_rules(struct mlx4_dev *dev, bool bond) +{ + struct mlx4_priv *priv = mlx4_priv(dev); + struct mlx4_resource_tracker *tracker = + &priv->mfunc.master.res_tracker; + struct rb_root *root = &tracker->res_tree[RES_FS_RULE]; + struct rb_node *p; + struct res_fs_rule *fs_rule; + int err = 0; + LIST_HEAD(mirr_list); + + for (p = rb_first(root); p; p = rb_next(p)) { + fs_rule = rb_entry(p, struct res_fs_rule, com.node); + if ((bond && fs_rule->mirr_mbox_size) || + (!bond && !fs_rule->mirr_mbox_size)) + list_add_tail(&fs_rule->mirr_list, &mirr_list); + } + + list_for_each_entry(fs_rule, &mirr_list, mirr_list) { + if (bond) + err += mlx4_do_mirror_rule(dev, fs_rule); + else + err += mlx4_undo_mirror_rule(dev, fs_rule); + } + return err; +} + +int mlx4_bond_fs_rules(struct mlx4_dev *dev) +{ + return mlx4_mirror_fs_rules(dev, true); +} + +int mlx4_unbond_fs_rules(struct mlx4_dev *dev) +{ + return mlx4_mirror_fs_rules(dev, false); +} + static void rem_slave_fs_rule(struct mlx4_dev *dev, int slave) { struct mlx4_priv *priv = mlx4_priv(dev); @@ -4446,12 +5089,11 @@ static void rem_slave_eqs(struct mlx4_dev *dev, int slave) int state; LIST_HEAD(tlist); int eqn; - struct mlx4_cmd_mailbox *mailbox; err = move_all_busy(dev, slave, RES_EQ); if (err) - mlx4_warn(dev, "rem_slave_eqs: Could not move all eqs to " - "busy for slave %d\n", slave); + mlx4_warn(dev, "rem_slave_eqs: Could not move all eqs - too busy for slave %d\n", + slave); spin_lock_irq(mlx4_tlock(dev)); list_for_each_entry_safe(eq, tmp, eq_list, com.list) { @@ -4472,21 +5114,13 @@ static void rem_slave_eqs(struct mlx4_dev *dev, int slave) break; case RES_EQ_HW: - mailbox = mlx4_alloc_cmd_mailbox(dev); - if (IS_ERR(mailbox)) { - cond_resched(); - continue; - } - err = mlx4_cmd_box(dev, slave, 0, - eqn & 0xff, 0, - MLX4_CMD_HW2SW_EQ, - MLX4_CMD_TIME_CLASS_A, - MLX4_CMD_NATIVE); + err = mlx4_cmd(dev, slave, eqn & 0x3ff, + 1, MLX4_CMD_HW2SW_EQ, + MLX4_CMD_TIME_CLASS_A, + MLX4_CMD_NATIVE); if (err) - mlx4_dbg(dev, "rem_slave_eqs: failed" - " to move slave %d eqs %d to" - " SW ownership\n", slave, eqn); - mlx4_free_cmd_mailbox(dev, mailbox); + mlx4_dbg(dev, "rem_slave_eqs: failed to move slave %d eqs %d to SW ownership\n", + slave, eqn & 0x3ff); atomic_dec(&eq->mtt->ref_count); state = RES_EQ_RESERVED; break; @@ -4503,7 +5137,48 @@ static void rem_slave_eqs(struct mlx4_dev *dev, int slave) static void rem_slave_counters(struct mlx4_dev *dev, int slave) { - __mlx4_slave_counters_free(dev, slave); + struct mlx4_priv *priv = mlx4_priv(dev); + struct mlx4_resource_tracker *tracker = &priv->mfunc.master.res_tracker; + struct list_head *counter_list = + &tracker->slave_list[slave].res_list[RES_COUNTER]; + struct res_counter *counter; + struct res_counter *tmp; + int err; + int *counters_arr = NULL; + int i, j; + + err = move_all_busy(dev, slave, RES_COUNTER); + if (err) + mlx4_warn(dev, "rem_slave_counters: Could not move all counters - too busy for slave %d\n", + slave); + + counters_arr = kmalloc_array(dev->caps.max_counters, + sizeof(*counters_arr), GFP_KERNEL); + if (!counters_arr) + return; + + do { + i = 0; + j = 0; + spin_lock_irq(mlx4_tlock(dev)); + list_for_each_entry_safe(counter, tmp, counter_list, com.list) { + if (counter->com.owner == slave) { + counters_arr[i++] = counter->com.res_id; + rb_erase(&counter->com.node, + &tracker->res_tree[RES_COUNTER]); + list_del(&counter->com.list); + kfree(counter); + } + } + spin_unlock_irq(mlx4_tlock(dev)); + + while (j < i) { + __mlx4_counter_free(dev, counters_arr[j++]); + mlx4_release_resource(dev, slave, RES_COUNTER, 1, 0); + } + } while (i); + + kfree(counters_arr); } static void rem_slave_xrcdns(struct mlx4_dev *dev, int slave) @@ -4519,8 +5194,8 @@ static void rem_slave_xrcdns(struct mlx4_dev *dev, int slave) err = move_all_busy(dev, slave, RES_XRCD); if (err) - mlx4_warn(dev, "rem_slave_xrcdns: Could not move all xrcdns to " - "busy for slave %d\n", slave); + mlx4_warn(dev, "rem_slave_xrcdns: Could not move all xrcdns - too busy for slave %d\n", + slave); spin_lock_irq(mlx4_tlock(dev)); list_for_each_entry_safe(xrcd, tmp, xrcdn_list, com.list) { @@ -4538,10 +5213,10 @@ static void rem_slave_xrcdns(struct mlx4_dev *dev, int slave) void mlx4_delete_all_resources_for_slave(struct mlx4_dev *dev, int slave) { struct mlx4_priv *priv = mlx4_priv(dev); - + mlx4_reset_roce_gids(dev, slave); mutex_lock(&priv->mfunc.master.res_tracker.slave_list[slave].mutex); - rem_slave_macs(dev, slave); rem_slave_vlans(dev, slave); + rem_slave_macs(dev, slave); rem_slave_fs_rule(dev, slave); rem_slave_qps(dev, slave); rem_slave_srqs(dev, slave); @@ -4578,6 +5253,7 @@ void mlx4_vf_immed_vlan_work_handler(struct work_struct *_work) u64 qp_path_mask = ((1ULL << MLX4_UPD_QP_PATH_MASK_VLAN_INDEX) | (1ULL << MLX4_UPD_QP_PATH_MASK_FVL) | (1ULL << MLX4_UPD_QP_PATH_MASK_CV) | + (1ULL << MLX4_UPD_QP_PATH_MASK_SV) | (1ULL << MLX4_UPD_QP_PATH_MASK_ETH_HIDE_CQE_VLAN) | (1ULL << MLX4_UPD_QP_PATH_MASK_FEUP) | (1ULL << MLX4_UPD_QP_PATH_MASK_FVL_RX) | @@ -4596,17 +5272,28 @@ void mlx4_vf_immed_vlan_work_handler(struct work_struct *_work) mailbox = mlx4_alloc_cmd_mailbox(dev); if (IS_ERR(mailbox)) goto out; - - if (!work->vlan_id) + if (work->flags & MLX4_VF_IMMED_VLAN_FLAG_LINK_DISABLE) /* block all */ + vlan_control = MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED | + MLX4_VLAN_CTRL_ETH_TX_BLOCK_PRIO_TAGGED | + MLX4_VLAN_CTRL_ETH_TX_BLOCK_UNTAGGED | + MLX4_VLAN_CTRL_ETH_RX_BLOCK_PRIO_TAGGED | + MLX4_VLAN_CTRL_ETH_RX_BLOCK_UNTAGGED | + MLX4_VLAN_CTRL_ETH_RX_BLOCK_TAGGED; + else if (!work->vlan_id) vlan_control = MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED | MLX4_VLAN_CTRL_ETH_RX_BLOCK_TAGGED; - else + else if (work->vlan_proto == htons(ETH_P_8021AD)) + vlan_control = MLX4_VLAN_CTRL_ETH_TX_BLOCK_PRIO_TAGGED | + MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED | + MLX4_VLAN_CTRL_ETH_RX_BLOCK_PRIO_TAGGED | + MLX4_VLAN_CTRL_ETH_RX_BLOCK_UNTAGGED; + else /* vst 802.1Q */ vlan_control = MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED | MLX4_VLAN_CTRL_ETH_RX_BLOCK_PRIO_TAGGED | MLX4_VLAN_CTRL_ETH_RX_BLOCK_UNTAGGED; upd_context = mailbox->buf; - upd_context->qp_mask = cpu_to_be64(MLX4_UPD_QP_MASK_VSD); + upd_context->qp_mask = cpu_to_be64(1ULL << MLX4_UPD_QP_MASK_VSD); spin_lock_irq(mlx4_tlock(dev)); list_for_each_entry_safe(qp, tmp, qp_list, com.list) { @@ -4645,13 +5332,22 @@ void mlx4_vf_immed_vlan_work_handler(struct work_struct *_work) upd_context->qp_context.pri_path.fvl_rx = qp->fvl_rx | MLX4_FVL_RX_FORCE_ETH_VLAN; upd_context->qp_context.pri_path.fl = - qp->pri_path_fl | MLX4_FL_CV | MLX4_FL_ETH_HIDE_CQE_VLAN; + qp->pri_path_fl | MLX4_FL_ETH_HIDE_CQE_VLAN; + if (work->vlan_proto == htons(ETH_P_8021AD)) + upd_context->qp_context.pri_path.fl |= MLX4_FL_SV; + else + upd_context->qp_context.pri_path.fl |= MLX4_FL_CV; upd_context->qp_context.pri_path.feup = qp->feup | MLX4_FEUP_FORCE_ETH_UP | MLX4_FVL_FORCE_ETH_VLAN; upd_context->qp_context.pri_path.sched_queue = qp->sched_queue & 0xC7; upd_context->qp_context.pri_path.sched_queue |= ((work->qos & 0x7) << 3); + upd_context->qp_mask |= + cpu_to_be64(1ULL << + MLX4_UPD_QP_MASK_QOS_VPP); + upd_context->qp_context.qos_vport = + work->qos_vport; } err = mlx4_cmd(dev, mailbox->dma, @@ -4659,10 +5355,8 @@ void mlx4_vf_immed_vlan_work_handler(struct work_struct *_work) 0, MLX4_CMD_UPDATE_QP, MLX4_CMD_TIME_CLASS_C, MLX4_CMD_NATIVE); if (err) { - mlx4_info(dev, "UPDATE_QP failed for slave %d, " - "port %d, qpn %d (%d)\n", - work->slave, port, qp->local_qpn, - err); + mlx4_info(dev, "UPDATE_QP failed for slave %d, port %d, qpn %d (%d)\n", + work->slave, port, qp->local_qpn, err); errors++; } } diff --git a/sys/dev/mlx4/mlx4_core/mlx4_sense.c b/sys/dev/mlx4/mlx4_core/mlx4_sense.c index 5d2ee392d348..f11ea11f81da 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_sense.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_sense.c @@ -53,7 +53,7 @@ int mlx4_SENSE_PORT(struct mlx4_dev *dev, int port, } if (out_param > 2) { - mlx4_err(dev, "Sense returned illegal value: 0x%llx\n", (unsigned long long)out_param); + mlx4_err(dev, "Sense returned illegal value: 0x%llx\n", (long long)out_param); return -EINVAL; } @@ -98,6 +98,10 @@ static void mlx4_sense_port(struct work_struct *work) enum mlx4_port_type stype[MLX4_MAX_PORTS]; mutex_lock(&priv->port_mutex); + if (sense->gone != 0) { + mutex_unlock(&priv->port_mutex); + return; + } mlx4_do_sense_ports(dev, stype, &dev->caps.port_type[1]); if (mlx4_check_port_params(dev, stype)) @@ -107,9 +111,9 @@ static void mlx4_sense_port(struct work_struct *work) mlx4_err(dev, "Failed to change port_types\n"); sense_again: - mutex_unlock(&priv->port_mutex); queue_delayed_work(mlx4_wq , &sense->sense_poll, round_jiffies_relative(MLX4_SENSE_RANGE)); + mutex_unlock(&priv->port_mutex); } void mlx4_start_sense(struct mlx4_dev *dev) @@ -120,12 +124,22 @@ void mlx4_start_sense(struct mlx4_dev *dev) if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_DPDP)) return; + mutex_lock(&priv->port_mutex); + sense->gone = 0; queue_delayed_work(mlx4_wq , &sense->sense_poll, round_jiffies_relative(MLX4_SENSE_RANGE)); + mutex_unlock(&priv->port_mutex); } void mlx4_stop_sense(struct mlx4_dev *dev) { + struct mlx4_priv *priv = mlx4_priv(dev); + struct mlx4_sense *sense = &priv->sense; + + mutex_lock(&priv->port_mutex); + sense->gone = 1; + mutex_unlock(&priv->port_mutex); + cancel_delayed_work_sync(&mlx4_priv(dev)->sense.sense_poll); } diff --git a/sys/dev/mlx4/mlx4_core/mlx4_srq.c b/sys/dev/mlx4/mlx4_core/mlx4_srq.c index 877ee67918ee..1a3c66065204 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_srq.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_srq.c @@ -35,6 +35,7 @@ #include #include #include +#include #include "mlx4.h" #include "icm.h" @@ -44,15 +45,12 @@ void mlx4_srq_event(struct mlx4_dev *dev, u32 srqn, int event_type) struct mlx4_srq_table *srq_table = &mlx4_priv(dev)->srq_table; struct mlx4_srq *srq; - spin_lock(&srq_table->lock); - + rcu_read_lock(); srq = radix_tree_lookup(&srq_table->tree, srqn & (dev->caps.num_srqs - 1)); + rcu_read_unlock(); if (srq) atomic_inc(&srq->refcount); - - spin_unlock(&srq_table->lock); - - if (!srq) { + else { mlx4_warn(dev, "Async event for bogus SRQ %08x\n", srqn); return; } @@ -102,11 +100,11 @@ int __mlx4_srq_alloc_icm(struct mlx4_dev *dev, int *srqn) if (*srqn == -1) return -ENOMEM; - err = mlx4_table_get(dev, &srq_table->table, *srqn); + err = mlx4_table_get(dev, &srq_table->table, *srqn, GFP_KERNEL); if (err) goto err_out; - err = mlx4_table_get(dev, &srq_table->cmpt_table, *srqn); + err = mlx4_table_get(dev, &srq_table->cmpt_table, *srqn, GFP_KERNEL); if (err) goto err_put; return 0; @@ -187,8 +185,6 @@ int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, u32 cqn, u16 xrcd, } srq_context = mailbox->buf; - memset(srq_context, 0, sizeof *srq_context); - srq_context->state_logsize_srqn = cpu_to_be32((ilog2(srq->max) << 24) | srq->srqn); srq_context->logstride = srq->wqe_shift - 4; @@ -302,12 +298,11 @@ struct mlx4_srq *mlx4_srq_lookup(struct mlx4_dev *dev, u32 srqn) { struct mlx4_srq_table *srq_table = &mlx4_priv(dev)->srq_table; struct mlx4_srq *srq; - unsigned long flags; - spin_lock_irqsave(&srq_table->lock, flags); + rcu_read_lock(); srq = radix_tree_lookup(&srq_table->tree, srqn & (dev->caps.num_srqs - 1)); - spin_unlock_irqrestore(&srq_table->lock, flags); + rcu_read_unlock(); return srq; } diff --git a/sys/dev/mlx4/mlx4_core/mlx4_sys_tune.c b/sys/dev/mlx4/mlx4_core/mlx4_sys_tune.c deleted file mode 100644 index 87eb30e6ccfe..000000000000 --- a/sys/dev/mlx4/mlx4_core/mlx4_sys_tune.c +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Copyright (c) 2010, 2014 Mellanox Technologies. All rights reserved. - * - * This software is available to you under a choice of one of two - * licenses. You may choose to be licensed under the terms of the GNU - * General Public License (GPL) Version 2, available from the file - * COPYING in the main directory of this source tree, or the - * OpenIB.org BSD license below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ - -#include -#include -#include - -#include "mlx4.h" - -#if defined(CONFIG_X86) && defined(CONFIG_APM_MODULE) - -/* Each CPU is put into a group. In most cases, the group number is - * equal to the CPU number of one of the CPUs in the group. The - * exception is group NR_CPUS which is the default group. This is - * protected by sys_tune_startup_mutex. */ -DEFINE_PER_CPU(int, idle_cpu_group) = NR_CPUS; - -/* For each group, a count of the number of CPUs in the group which - * are known to be busy. A busy CPU might be running the busy loop - * below or general kernel code. The count is decremented on entry to - * the old pm_idle handler and incremented on exit. The aim is to - * avoid the count going to zero or negative. This situation can - * occur temporarily during module unload or CPU hot-plug but - * normality will be restored when the affected CPUs next exit the - * idle loop. */ -static atomic_t busy_cpu_count[NR_CPUS+1]; - -/* A workqueue item to be executed to cause the CPU to exit from the - * idle loop. */ -DEFINE_PER_CPU(struct work_struct, sys_tune_cpu_work); - -#define sys_tune_set_state(CPU,STATE) \ - do { } while(0) - - -/* A mutex to protect most of the module datastructures. */ -static DEFINE_MUTEX(sys_tune_startup_mutex); - -/* The old pm_idle handler. */ -static void (*old_pm_idle)(void) = NULL; - -static void sys_tune_pm_idle(void) -{ - atomic_t *busy_cpus_ptr; - int busy_cpus; - int cpu = smp_processor_id(); - - busy_cpus_ptr = &(busy_cpu_count[per_cpu(idle_cpu_group, cpu)]); - - sys_tune_set_state(cpu, 2); - - local_irq_enable(); - while (!need_resched()) { - busy_cpus = atomic_read(busy_cpus_ptr); - - /* If other CPUs in this group are busy then let this - * CPU go idle. We mustn't let the number of busy - * CPUs drop below 1. */ - if ( busy_cpus > 1 && - old_pm_idle != NULL && - ( atomic_cmpxchg(busy_cpus_ptr, busy_cpus, - busy_cpus-1) == busy_cpus ) ) { - local_irq_disable(); - sys_tune_set_state(cpu, 3); - /* This check might not be necessary, but it - * seems safest to include it because there - * might be a kernel version which requires - * it. */ - if (need_resched()) - local_irq_enable(); - else - old_pm_idle(); - /* This CPU is busy again. */ - sys_tune_set_state(cpu, 1); - atomic_add(1, busy_cpus_ptr); - return; - } - - cpu_relax(); - } - sys_tune_set_state(cpu, 0); -} - - -void sys_tune_work_func(struct work_struct *work) -{ - /* Do nothing. Since this function is running in process - * context, the idle thread isn't running on this CPU. */ -} - - -#ifdef CONFIG_SMP -static void sys_tune_smp_call(void *info) -{ - schedule_work(&get_cpu_var(sys_tune_cpu_work)); - put_cpu_var(sys_tune_cpu_work); -} -#endif - - -#ifdef CONFIG_SMP -static void sys_tune_refresh(void) -{ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26) - on_each_cpu(&sys_tune_smp_call, NULL, 0, 1); -#else - on_each_cpu(&sys_tune_smp_call, NULL, 1); -#endif -} -#else -static void sys_tune_refresh(void) -{ - /* The current thread is executing on the one and only CPU so - * the idle thread isn't running. */ -} -#endif - - - -static int sys_tune_cpu_group(int cpu) -{ -#ifdef CONFIG_SMP - const cpumask_t *mask; - int other_cpu; - int group; - -#if defined(topology_thread_cpumask) && defined(ST_HAVE_EXPORTED_CPU_SIBLING_MAP) - /* Keep one hyperthread busy per core. */ - mask = topology_thread_cpumask(cpu); -#else - return cpu; -#endif - for_each_cpu_mask(cpu, *(mask)) { - group = per_cpu(idle_cpu_group, other_cpu); - if (group != NR_CPUS) - return group; - } -#endif - - return cpu; -} - - -static void sys_tune_add_cpu(int cpu) -{ - int group; - - /* Do nothing if this CPU has already been added. */ - if (per_cpu(idle_cpu_group, cpu) != NR_CPUS) - return; - - group = sys_tune_cpu_group(cpu); - per_cpu(idle_cpu_group, cpu) = group; - atomic_inc(&(busy_cpu_count[group])); - -} - -static void sys_tune_del_cpu(int cpu) -{ - - int group; - - if (per_cpu(idle_cpu_group, cpu) == NR_CPUS) - return; - - group = per_cpu(idle_cpu_group, cpu); - /* If the CPU was busy, this can cause the count to drop to - * zero. To rectify this, we need to cause one of the other - * CPUs in the group to exit the idle loop. If the CPU was - * not busy then this causes the contribution for this CPU to - * go to -1 which can cause the overall count to drop to zero - * or go negative. To rectify this situation we need to cause - * this CPU to exit the idle loop. */ - atomic_dec(&(busy_cpu_count[group])); - per_cpu(idle_cpu_group, cpu) = NR_CPUS; - -} - - -static int sys_tune_cpu_notify(struct notifier_block *self, - unsigned long action, void *hcpu) -{ - int cpu = (long)hcpu; - - switch(action) { -#ifdef CPU_ONLINE_FROZEN - case CPU_ONLINE_FROZEN: -#endif - case CPU_ONLINE: - mutex_lock(&sys_tune_startup_mutex); - sys_tune_add_cpu(cpu); - mutex_unlock(&sys_tune_startup_mutex); - /* The CPU might have already entered the idle loop in - * the wrong group. Make sure it exits the idle loop - * so that it picks up the correct group. */ - sys_tune_refresh(); - break; - -#ifdef CPU_DEAD_FROZEN - case CPU_DEAD_FROZEN: -#endif - case CPU_DEAD: - mutex_lock(&sys_tune_startup_mutex); - sys_tune_del_cpu(cpu); - mutex_unlock(&sys_tune_startup_mutex); - /* The deleted CPU may have been the only busy CPU in - * the group. Make sure one of the other CPUs in the - * group exits the idle loop. */ - sys_tune_refresh(); - break; - } - return NOTIFY_OK; -} - - -static struct notifier_block sys_tune_cpu_nb = { - .notifier_call = sys_tune_cpu_notify, -}; - - -static void sys_tune_ensure_init(void) -{ - BUG_ON (old_pm_idle != NULL); - - /* Atomically update pm_idle to &sys_tune_pm_idle. The old value - * is stored in old_pm_idle before installing the new - * handler. */ - do { - old_pm_idle = pm_idle; - } while (cmpxchg(&pm_idle, old_pm_idle, &sys_tune_pm_idle) != - old_pm_idle); -} -#endif - -void sys_tune_fini(void) -{ -#if defined(CONFIG_X86) && defined(CONFIG_APM_MODULE) - void (*old)(void); - int cpu; - - unregister_cpu_notifier(&sys_tune_cpu_nb); - - mutex_lock(&sys_tune_startup_mutex); - - - old = cmpxchg(&pm_idle, &sys_tune_pm_idle, old_pm_idle); - - for_each_online_cpu(cpu) - sys_tune_del_cpu(cpu); - - mutex_unlock(&sys_tune_startup_mutex); - - /* Our handler may still be executing on other CPUs. - * Schedule this thread on all CPUs to make sure all - * idle threads get interrupted. */ - sys_tune_refresh(); - - /* Make sure the work item has finished executing on all CPUs. - * This in turn ensures that all idle threads have been - * interrupted. */ - flush_scheduled_work(); -#endif /* CONFIG_X86 */ -} - -void sys_tune_init(void) -{ -#if defined(CONFIG_X86) && defined(CONFIG_APM_MODULE) - int cpu; - - for_each_possible_cpu(cpu) { - INIT_WORK(&per_cpu(sys_tune_cpu_work, cpu), - sys_tune_work_func); - } - - /* Start by registering the handler to ensure we don't miss - * any updates. */ - register_cpu_notifier(&sys_tune_cpu_nb); - - mutex_lock(&sys_tune_startup_mutex); - - for_each_online_cpu(cpu) - sys_tune_add_cpu(cpu); - - sys_tune_ensure_init(); - - - mutex_unlock(&sys_tune_startup_mutex); - - /* Ensure our idle handler starts to run. */ - sys_tune_refresh(); -#endif -} - diff --git a/sys/dev/mlx4/mlx4_en/en.h b/sys/dev/mlx4/mlx4_en/en.h index 5e4b4fa60841..ae6e1821014a 100644 --- a/sys/dev/mlx4/mlx4_en/en.h +++ b/sys/dev/mlx4/mlx4_en/en.h @@ -75,6 +75,7 @@ #define MIN_RX_RINGS 4 #define TXBB_SIZE 64 #define HEADROOM (2048 / TXBB_SIZE + 1) +#define INIT_OWNER_BIT 0xffffffff #define STAMP_STRIDE 64 #define STAMP_DWORDS (STAMP_STRIDE / 4) #define STAMP_SHIFT 31 @@ -131,11 +132,13 @@ enum mlx4_en_alloc_type { #define MAX_TX_RINGS (MLX4_EN_MAX_TX_RING_P_UP * \ MLX4_EN_NUM_UP) +#define MLX4_EN_NO_VLAN 0xffff + #define MLX4_EN_DEF_TX_RING_SIZE 1024 #define MLX4_EN_DEF_RX_RING_SIZE 1024 /* Target number of bytes to coalesce with interrupt moderation */ -#define MLX4_EN_RX_COAL_TARGET 0x20000 +#define MLX4_EN_RX_COAL_TARGET 44 #define MLX4_EN_RX_COAL_TIME 0x10 #define MLX4_EN_TX_COAL_PKTS 64 @@ -192,6 +195,13 @@ enum mlx4_en_alloc_type { #define GET_AVG_PERF_COUNTER(cnt) (0) #endif /* MLX4_EN_PERF_STAT */ +/* Constants for TX flow */ +enum { + MAX_INLINE = 104, /* 128 - 16 - 4 - 4 */ + MAX_BF = 256, + MIN_PKT_LEN = 17, +}; + /* * Configurables */ @@ -264,7 +274,6 @@ struct mlx4_en_tx_ring { int blocked; struct mlx4_en_tx_info *tx_info; u8 queue_index; - cpuset_t affinity_mask; struct buf_ring *br; u32 last_nr_txbb; struct mlx4_qp qp; @@ -272,14 +281,14 @@ struct mlx4_en_tx_ring { int qpn; enum mlx4_qp_state qp_state; struct mlx4_srq dummy; - unsigned long bytes; - unsigned long packets; - unsigned long tx_csum; - unsigned long queue_stopped; - unsigned long oversized_packets; - unsigned long wake_queue; - unsigned long tso_packets; - unsigned long defrag_attempts; + u64 bytes; + u64 packets; + u64 tx_csum; + u64 queue_stopped; + u64 oversized_packets; + u64 wake_queue; + u64 tso_packets; + u64 defrag_attempts; struct mlx4_bf bf; bool bf_enabled; int hwtstamp_tx_type; @@ -322,16 +331,16 @@ struct mlx4_en_rx_ring { int qpn; u8 *buf; struct mlx4_en_rx_mbuf *mbuf; - unsigned long errors; - unsigned long bytes; - unsigned long packets; + u64 errors; + u64 bytes; + u64 packets; #ifdef LL_EXTENDED_STATS - unsigned long yields; - unsigned long misses; - unsigned long cleaned; + u64 yields; + u64 misses; + u64 cleaned; #endif - unsigned long csum_ok; - unsigned long csum_none; + u64 csum_ok; + u64 csum_none; int hwtstamp_rx_filter; int numa_node; struct lro_ctrl lro; @@ -385,14 +394,14 @@ struct mlx4_en_cq { #ifdef CONFIG_NET_RX_BUSY_POLL unsigned int state; -#define MLX4_EN_CQ_STATEIDLE 0 -#define MLX4_EN_CQ_STATENAPI 1 /* NAPI owns this CQ */ -#define MLX4_EN_CQ_STATEPOLL 2 /* poll owns this CQ */ -#define MLX4_CQ_LOCKED (MLX4_EN_CQ_STATENAPI | MLX4_EN_CQ_STATEPOLL) -#define MLX4_EN_CQ_STATENAPI_YIELD 4 /* NAPI yielded this CQ */ -#define MLX4_EN_CQ_STATEPOLL_YIELD 8 /* poll yielded this CQ */ -#define CQ_YIELD (MLX4_EN_CQ_STATENAPI_YIELD | MLX4_EN_CQ_STATEPOLL_YIELD) -#define CQ_USER_PEND (MLX4_EN_CQ_STATEPOLL | MLX4_EN_CQ_STATEPOLL_YIELD) +#define MLX4_EN_CQ_STATE_IDLE 0 +#define MLX4_EN_CQ_STATE_NAPI 1 /* NAPI owns this CQ */ +#define MLX4_EN_CQ_STATE_POLL 2 /* poll owns this CQ */ +#define MLX4_CQ_LOCKED (MLX4_EN_CQ_STATE_NAPI | MLX4_EN_CQ_STATE_POLL) +#define MLX4_EN_CQ_STATE_NAPI_YIELD 4 /* NAPI yielded this CQ */ +#define MLX4_EN_CQ_STATE_POLL_YIELD 8 /* poll yielded this CQ */ +#define CQ_YIELD (MLX4_EN_CQ_STATE_NAPI_YIELD | MLX4_EN_CQ_STATE_POLL_YIELD) +#define CQ_USER_PEND (MLX4_EN_CQ_STATE_POLL | MLX4_EN_CQ_STATE_POLL_YIELD) spinlock_t poll_lock; /* protects from LLS/napi conflicts */ #endif /* CONFIG_NET_RX_BUSY_POLL */ }; @@ -408,6 +417,7 @@ struct mlx4_en_port_profile { u8 tx_pause; u8 tx_ppp; int rss_rings; + int inline_thold; }; struct mlx4_en_profile { @@ -451,24 +461,30 @@ struct mlx4_en_rss_map { enum mlx4_qp_state indir_state; }; +enum mlx4_en_port_flag { + MLX4_EN_PORT_ANC = 1<<0, /* Auto-negotiation complete */ + MLX4_EN_PORT_ANE = 1<<1, /* Auto-negotiation enabled */ +}; + struct mlx4_en_port_state { int link_state; int link_speed; - int transciver; - int autoneg; + int transceiver; + u32 flags; }; -enum mlx4_en_mclist_act { - MCLIST_NONE, - MCLIST_REM, - MCLIST_ADD, +enum mlx4_en_addr_list_act { + MLX4_ADDR_LIST_NONE, + MLX4_ADDR_LIST_REM, + MLX4_ADDR_LIST_ADD, }; -struct mlx4_en_mc_list { +struct mlx4_en_addr_list { struct list_head list; - enum mlx4_en_mclist_act action; + enum mlx4_en_addr_list_act action; u8 addr[ETH_ALEN]; u64 reg_id; + u64 tunnel_reg_id; }; #ifdef CONFIG_MLX4_EN_DCB @@ -476,6 +492,7 @@ struct mlx4_en_mc_list { #define MLX4_EN_BW_MIN 1 #define MLX4_EN_BW_MAX 100 /* Utilize 100% of the line */ +#define MLX4_EN_TC_VENDOR 0 #define MLX4_EN_TC_ETS 7 #endif @@ -541,6 +558,7 @@ struct mlx4_en_priv { bool port_up; int port; int registered; + int gone; int allocated; int stride; unsigned char current_mac[ETH_ALEN + 2]; @@ -570,12 +588,17 @@ struct mlx4_en_priv { struct mlx4_en_perf_stats pstats; struct mlx4_en_pkt_stats pkstats; struct mlx4_en_pkt_stats pkstats_last; - struct mlx4_en_flow_stats flowstats[MLX4_NUM_PRIORITIES]; + struct mlx4_en_flow_stats_rx rx_priority_flowstats[MLX4_NUM_PRIORITIES]; + struct mlx4_en_flow_stats_tx tx_priority_flowstats[MLX4_NUM_PRIORITIES]; + struct mlx4_en_flow_stats_rx rx_flowstats; + struct mlx4_en_flow_stats_tx tx_flowstats; struct mlx4_en_port_stats port_stats; struct mlx4_en_vport_stats vport_stats; struct mlx4_en_vf_stats vf_stats; struct list_head mc_list; - struct list_head curr_list; + struct list_head uc_list; + struct list_head curr_mc_list; + struct list_head curr_uc_list; u64 broadcast_id; struct mlx4_en_stat_out_mbox hw_stats; int vids[128]; @@ -592,8 +615,6 @@ struct mlx4_en_priv { struct sysctl_oid *stat_sysctl; struct sysctl_ctx_list conf_ctx; struct sysctl_ctx_list stat_ctx; -#define MLX4_EN_MAC_HASH_IDX 5 - struct hlist_head mac_hash[MLX4_EN_MAC_HASH_SIZE]; #ifdef CONFIG_MLX4_EN_DCB struct ieee_ets ets; @@ -606,6 +627,7 @@ struct mlx4_en_priv { struct list_head filters; struct hlist_head filter_hash[1 << MLX4_EN_FILTER_HASH_SHIFT]; #endif + u64 tunnel_reg_id; struct en_port *vf_ports[MLX4_MAX_NUM_VF]; unsigned long last_ifq_jiffies; u64 if_counters_rx_errors; @@ -623,11 +645,16 @@ struct mlx4_mac_entry { u64 reg_id; }; +static inline struct mlx4_cqe *mlx4_en_get_cqe(u8 *buf, int idx, int cqe_sz) +{ + return (struct mlx4_cqe *)(buf + idx * cqe_sz); +} + #ifdef CONFIG_NET_RX_BUSY_POLL static inline void mlx4_en_cq_init_lock(struct mlx4_en_cq *cq) { spin_lock_init(&cq->poll_lock); - cq->state = MLX4_EN_CQ_STATEIDLE; + cq->state = MLX4_EN_CQ_STATE_IDLE; } /* called from the device poll rutine to get ownership of a cq */ @@ -636,12 +663,12 @@ static inline bool mlx4_en_cq_lock_napi(struct mlx4_en_cq *cq) int rc = true; spin_lock(&cq->poll_lock); if (cq->state & MLX4_CQ_LOCKED) { - WARN_ON(cq->state & MLX4_EN_CQ_STATENAPI); - cq->state |= MLX4_EN_CQ_STATENAPI_YIELD; + WARN_ON(cq->state & MLX4_EN_CQ_STATE_NAPI); + cq->state |= MLX4_EN_CQ_STATE_NAPI_YIELD; rc = false; } else /* we don't care if someone yielded */ - cq->state = MLX4_EN_CQ_STATENAPI; + cq->state = MLX4_EN_CQ_STATE_NAPI; spin_unlock(&cq->poll_lock); return rc; } @@ -651,12 +678,12 @@ static inline bool mlx4_en_cq_unlock_napi(struct mlx4_en_cq *cq) { int rc = false; spin_lock(&cq->poll_lock); - WARN_ON(cq->state & (MLX4_EN_CQ_STATEPOLL | - MLX4_EN_CQ_STATENAPI_YIELD)); + WARN_ON(cq->state & (MLX4_EN_CQ_STATE_POLL | + MLX4_EN_CQ_STATE_NAPI_YIELD)); - if (cq->state & MLX4_EN_CQ_STATEPOLL_YIELD) + if (cq->state & MLX4_EN_CQ_STATE_POLL_YIELD) rc = true; - cq->state = MLX4_EN_CQ_STATEIDLE; + cq->state = MLX4_EN_CQ_STATE_IDLE; spin_unlock(&cq->poll_lock); return rc; } @@ -671,14 +698,14 @@ static inline bool mlx4_en_cq_lock_poll(struct mlx4_en_cq *cq) struct mlx4_en_priv *priv = netdev_priv(dev); struct mlx4_en_rx_ring *rx_ring = priv->rx_ring[cq->ring]; - cq->state |= MLX4_EN_CQ_STATEPOLL_YIELD; + cq->state |= MLX4_EN_CQ_STATE_POLL_YIELD; rc = false; #ifdef LL_EXTENDED_STATS rx_ring->yields++; #endif } else /* preserve yield marks */ - cq->state |= MLX4_EN_CQ_STATEPOLL; + cq->state |= MLX4_EN_CQ_STATE_POLL; spin_unlock_bh(&cq->poll_lock); return rc; } @@ -688,17 +715,17 @@ static inline bool mlx4_en_cq_unlock_poll(struct mlx4_en_cq *cq) { int rc = false; spin_lock_bh(&cq->poll_lock); - WARN_ON(cq->state & (MLX4_EN_CQ_STATENAPI)); + WARN_ON(cq->state & (MLX4_EN_CQ_STATE_NAPI)); - if (cq->state & MLX4_EN_CQ_STATEPOLL_YIELD) + if (cq->state & MLX4_EN_CQ_STATE_POLL_YIELD) rc = true; - cq->state = MLX4_EN_CQ_STATEIDLE; + cq->state = MLX4_EN_CQ_STATE_IDLE; spin_unlock_bh(&cq->poll_lock); return rc; } /* true if a socket is polling, even if it did not get the lock */ -static inline bool mlx4_en_cq_ll_polling(struct mlx4_en_cq *cq) +static inline bool mlx4_en_cq_busy_polling(struct mlx4_en_cq *cq) { WARN_ON(!(cq->state & MLX4_CQ_LOCKED)); return cq->state & CQ_USER_PEND; @@ -728,7 +755,7 @@ static inline bool mlx4_en_cq_unlock_poll(struct mlx4_en_cq *cq) return false; } -static inline bool mlx4_en_cq_ll_polling(struct mlx4_en_cq *cq) +static inline bool mlx4_en_cq_busy_polling(struct mlx4_en_cq *cq) { return false; } @@ -770,6 +797,7 @@ int mlx4_en_activate_tx_ring(struct mlx4_en_priv *priv, int cq, int user_prio); void mlx4_en_deactivate_tx_ring(struct mlx4_en_priv *priv, struct mlx4_en_tx_ring *ring); +void mlx4_en_set_num_rx_rings(struct mlx4_en_dev *mdev); void mlx4_en_qflush(struct ifnet *dev); int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv, @@ -883,10 +911,10 @@ enum { { \ if ((priv)->registered) \ printk(level "%s: %s: " format, DRV_NAME, \ - (priv->dev)->if_xname, ## arg); \ + (priv)->dev->if_xname, ## arg); \ else \ printk(level "%s: %s: Port %d: " format, \ - DRV_NAME, dev_name(&priv->mdev->pdev->dev), \ + DRV_NAME, dev_name(&(priv)->mdev->pdev->dev), \ (priv)->port, ## arg); \ } @@ -905,12 +933,12 @@ do { \ #define mlx4_err(mdev, format, arg...) \ pr_err("%s %s: " format, DRV_NAME, \ - dev_name(&mdev->pdev->dev), ##arg) + dev_name(&(mdev)->pdev->dev), ##arg) #define mlx4_info(mdev, format, arg...) \ pr_info("%s %s: " format, DRV_NAME, \ - dev_name(&mdev->pdev->dev), ##arg) + dev_name(&(mdev)->pdev->dev), ##arg) #define mlx4_warn(mdev, format, arg...) \ pr_warning("%s %s: " format, DRV_NAME, \ - dev_name(&mdev->pdev->dev), ##arg) + dev_name(&(mdev)->pdev->dev), ##arg) #endif diff --git a/sys/dev/mlx4/mlx4_en/en_port.h b/sys/dev/mlx4/mlx4_en/en_port.h index 6301717e1814..59b9a2598f34 100644 --- a/sys/dev/mlx4/mlx4_en/en_port.h +++ b/sys/dev/mlx4/mlx4_en/en_port.h @@ -53,7 +53,30 @@ enum { MLX4_MCAST_ENABLE = 2, }; +enum mlx4_link_mode { + MLX4_1000BASE_CX_SGMII = 0, + MLX4_1000BASE_KX = 1, + MLX4_10GBASE_CX4 = 2, + MLX4_10GBASE_KX4 = 3, + MLX4_10GBASE_KR = 4, + MLX4_20GBASE_KR2 = 5, + MLX4_40GBASE_CR4 = 6, + MLX4_40GBASE_KR4 = 7, + MLX4_56GBASE_KR4 = 8, + MLX4_10GBASE_CR = 12, + MLX4_10GBASE_SR = 13, + MLX4_40GBASE_SR4 = 15, + MLX4_56GBASE_CR4 = 17, + MLX4_56GBASE_SR4 = 18, + MLX4_100BASE_TX = 24, + MLX4_1000BASE_T = 25, + MLX4_10GBASE_T = 26, +}; + +#define MLX4_PROT_MASK(link_mode) (1<<(link_mode)) + enum { + MLX4_EN_100M_SPEED = 0x04, MLX4_EN_10G_SPEED_XAUI = 0x00, MLX4_EN_10G_SPEED_XFI = 0x01, MLX4_EN_1G_SPEED = 0x02, @@ -66,12 +89,13 @@ enum { struct mlx4_en_query_port_context { u8 link_up; #define MLX4_EN_LINK_UP_MASK 0x80 +#define MLX4_EN_ANC_MASK 0x40 u8 autoneg; #define MLX4_EN_AUTONEG_MASK 0x80 __be16 mtu; u8 reserved2; u8 link_speed; -#define MLX4_EN_SPEED_MASK 0x6b +#define MLX4_EN_SPEED_MASK 0x6f u16 reserved3[5]; __be64 mac; u8 transceiver; @@ -559,5 +583,4 @@ struct mlx4_en_stat_out_mbox { __be32 TDROP; }; - #endif diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_cq.c b/sys/dev/mlx4/mlx4_en/mlx4_en_cq.c index febef4bebc0e..f19ce2f1e1ef 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_cq.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_cq.c @@ -31,13 +31,14 @@ * */ +#include + #include #include #include #include "en.h" - static void mlx4_en_cq_event(struct mlx4_cq *cq, enum mlx4_event event) { return; @@ -53,11 +54,11 @@ int mlx4_en_create_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq; int err; - cq = kzalloc_node(sizeof(struct mlx4_en_cq), GFP_KERNEL, node); + cq = kzalloc_node(sizeof(*cq), GFP_KERNEL, node); if (!cq) { - cq = kzalloc(sizeof(struct mlx4_en_cq), GFP_KERNEL); + cq = kzalloc(sizeof(*cq), GFP_KERNEL); if (!cq) { - en_err(priv, "Failed to allocate CW struture\n"); + en_err(priv, "Failed to allocate CQ structure\n"); return -ENOMEM; } } @@ -80,6 +81,7 @@ int mlx4_en_create_cq(struct mlx4_en_priv *priv, cq->ring = ring; cq->is_tx = mode; + cq->vector = mdev->dev->caps.num_comp_vectors; spin_lock_init(&cq->lock); err = mlx4_alloc_hwq_res(mdev->dev, &cq->wqres, @@ -91,7 +93,7 @@ int mlx4_en_create_cq(struct mlx4_en_priv *priv, if (err) goto err_res; - cq->buf = (struct mlx4_cqe *) cq->wqres.buf.direct.buf; + cq->buf = (struct mlx4_cqe *)cq->wqres.buf.direct.buf; *pcq = cq; return 0; @@ -100,17 +102,17 @@ int mlx4_en_create_cq(struct mlx4_en_priv *priv, mlx4_free_hwq_res(mdev->dev, &cq->wqres, cq->buf_size); err_cq: kfree(cq); + *pcq = NULL; return err; } - int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq, int cq_idx) { struct mlx4_en_dev *mdev = priv->mdev; int err = 0; - char name[25]; int timestamp_en = 0; + bool assigned_eq = false; cq->dev = mdev->pndev[priv->port]; cq->mcq.set_ci_db = cq->wqres.db.db; @@ -120,22 +122,19 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq, memset(cq->buf, 0, cq->buf_size); if (cq->is_tx == RX) { - if (mdev->dev->caps.comp_pool) { - if (!cq->vector) { - sprintf(name, "%s-%d", if_name(priv->dev), - cq->ring); - /* Set IRQ for specific name (per ring) */ - if (mlx4_assign_eq(mdev->dev, name, &cq->vector)) { - cq->vector = (cq->ring + 1 + priv->port) - % mdev->dev->caps.num_comp_vectors; - mlx4_warn(mdev, "Failed Assigning an EQ to " - "%s ,Falling back to legacy EQ's\n", - name); - } + if (!mlx4_is_eq_vector_valid(mdev->dev, priv->port, + cq->vector)) { + cq->vector = cq_idx % mdev->dev->caps.num_comp_vectors; + + err = mlx4_assign_eq(mdev->dev, priv->port, + &cq->vector); + if (err) { + mlx4_err(mdev, "Failed assigning an EQ to CQ vector %d\n", + cq->vector); + goto free_eq; } - } else { - cq->vector = (cq->ring + 1 + priv->port) % - mdev->dev->caps.num_comp_vectors; + + assigned_eq = true; } } else { struct mlx4_en_cq *rx_cq; @@ -150,11 +149,12 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq, if (!cq->is_tx) cq->size = priv->rx_ring[cq->ring]->actual_size; + err = mlx4_cq_alloc(mdev->dev, cq->size, &cq->wqres.mtt, &mdev->priv_uar, cq->wqres.db.dma, &cq->mcq, cq->vector, 0, timestamp_en); if (err) - return err; + goto free_eq; cq->mcq.comp = cq->is_tx ? mlx4_en_tx_irq : mlx4_en_rx_irq; cq->mcq.event = mlx4_en_cq_event; @@ -167,6 +167,12 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq, return 0; + +free_eq: + if (assigned_eq) + mlx4_release_eq(mdev->dev, cq->vector); + cq->vector = mdev->dev->caps.num_comp_vectors; + return err; } void mlx4_en_destroy_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq **pcq) @@ -178,24 +184,28 @@ void mlx4_en_destroy_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq **pcq) taskqueue_free(cq->tq); mlx4_en_unmap_buffer(&cq->wqres.buf); mlx4_free_hwq_res(mdev->dev, &cq->wqres, cq->buf_size); - if (priv->mdev->dev->caps.comp_pool && cq->vector) + if (mlx4_is_eq_vector_valid(mdev->dev, priv->port, cq->vector) && + cq->is_tx == RX) mlx4_release_eq(priv->mdev->dev, cq->vector); + cq->vector = 0; + cq->buf_size = 0; + cq->buf = NULL; kfree(cq); *pcq = NULL; } void mlx4_en_deactivate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq) { - struct mlx4_en_dev *mdev = priv->mdev; + taskqueue_drain(cq->tq, &cq->cq_task); + if (!cq->is_tx) { + synchronize_rcu(); + } else { + del_timer_sync(&cq->timer); + } - taskqueue_drain(cq->tq, &cq->cq_task); - if (cq->is_tx) - del_timer_sync(&cq->timer); - - mlx4_cq_free(mdev->dev, &cq->mcq); + mlx4_cq_free(priv->mdev->dev, &cq->mcq); } - /* Set rx cq moderation parameters */ int mlx4_en_set_cq_moder(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq) { diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_main.c b/sys/dev/mlx4/mlx4_en/mlx4_en_main.c index bacef4ada6bc..3f57a038ec53 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_main.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_main.c @@ -58,7 +58,7 @@ /* Enable RSS UDP traffic */ MLX4_EN_PARM_INT(udp_rss, 1, - "Enable RSS for incoming UDP traffic"); + "Enable RSS for incoming UDP traffic or disabled (0)"); /* Priority pausing */ MLX4_EN_PARM_INT(pfctx, 0, "Priority based Flow Control policy on TX[7:0]." @@ -66,9 +66,11 @@ MLX4_EN_PARM_INT(pfctx, 0, "Priority based Flow Control policy on TX[7:0]." MLX4_EN_PARM_INT(pfcrx, 0, "Priority based Flow Control policy on RX[7:0]." " Per priority bit mask"); -#define MAX_PFC_TX 0xff -#define MAX_PFC_RX 0xff +MLX4_EN_PARM_INT(inline_thold, MAX_INLINE, + "Threshold for using inline data (range: 17-104, default: 104)"); +#define MAX_PFC_TX 0xff +#define MAX_PFC_RX 0xff static int mlx4_en_get_profile(struct mlx4_en_dev *mdev) { @@ -93,6 +95,7 @@ static int mlx4_en_get_profile(struct mlx4_en_dev *mdev) params->prof[i].tx_ring_num = params->num_tx_rings_p_up * MLX4_EN_NUM_UP; params->prof[i].rss_rings = 0; + params->prof[i].inline_thold = inline_thold; } return 0; @@ -142,7 +145,7 @@ static void mlx4_en_event(struct mlx4_dev *dev, void *endev_ptr, static void mlx4_en_remove(struct mlx4_dev *dev, void *endev_ptr) { struct mlx4_en_dev *mdev = endev_ptr; - int i, ret; + int i; mutex_lock(&mdev->state_lock); mdev->device_up = false; @@ -154,28 +157,34 @@ static void mlx4_en_remove(struct mlx4_dev *dev, void *endev_ptr) flush_workqueue(mdev->workqueue); destroy_workqueue(mdev->workqueue); - ret = mlx4_mr_free(dev, &mdev->mr); - if (ret) - mlx4_err(mdev, "Error deregistering MR. The system may have become unstable."); + (void) mlx4_mr_free(dev, &mdev->mr); iounmap(mdev->uar_map); mlx4_uar_free(dev, &mdev->priv_uar); mlx4_pd_free(dev, mdev->priv_pdn); kfree(mdev); } +static void mlx4_en_activate(struct mlx4_dev *dev, void *ctx) +{ + int i; + struct mlx4_en_dev *mdev = ctx; + + /* Create a netdev for each port */ + mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH) { + mlx4_info(mdev, "Activating port:%d\n", i); + if (mlx4_en_init_netdev(mdev, i, &mdev->profile.prof[i])) + mdev->pndev[i] = NULL; + } +} + static void *mlx4_en_add(struct mlx4_dev *dev) { struct mlx4_en_dev *mdev; int i; - int err; - mdev = kzalloc(sizeof *mdev, GFP_KERNEL); - if (!mdev) { - dev_err(&dev->pdev->dev, "Device struct alloc failed, " - "aborting.\n"); - err = -ENOMEM; + mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); + if (!mdev) goto err_free_res; - } if (mlx4_pd_alloc(dev, &mdev->priv_pdn)) goto err_free_dev; @@ -190,8 +199,8 @@ static void *mlx4_en_add(struct mlx4_dev *dev) spin_lock_init(&mdev->uar_lock); mdev->dev = dev; - mdev->dma_device = &(dev->pdev->dev); - mdev->pdev = dev->pdev; + mdev->dma_device = &dev->persist->pdev->dev; + mdev->pdev = dev->persist->pdev; mdev->device_up = false; mdev->LSO_support = !!(dev->caps.flags & (1 << 15)); @@ -211,9 +220,8 @@ static void *mlx4_en_add(struct mlx4_dev *dev) } /* Build device profile according to supplied module parameters */ - err = mlx4_en_get_profile(mdev); - if (err) { - mlx4_err(mdev, "Bad module parameters, aborting.\n"); + if (mlx4_en_get_profile(mdev)) { + mlx4_err(mdev, "Bad module parameters, aborting\n"); goto err_mr; } @@ -222,50 +230,25 @@ static void *mlx4_en_add(struct mlx4_dev *dev) mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH) mdev->port_cnt++; - - mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH) { - if (!dev->caps.comp_pool) { - mdev->profile.prof[i].rx_ring_num = - rounddown_pow_of_two(max_t(int, MIN_RX_RINGS, - min_t(int, - dev->caps.num_comp_vectors, - DEF_RX_RINGS))); - } else { - mdev->profile.prof[i].rx_ring_num = rounddown_pow_of_two( - min_t(int, dev->caps.comp_pool / - dev->caps.num_ports, MAX_MSIX_P_PORT)); - } - } + /* Set default number of RX rings*/ + mlx4_en_set_num_rx_rings(mdev); /* Create our own workqueue for reset/multicast tasks * Note: we cannot use the shared workqueue because of deadlocks caused * by the rtnl lock */ mdev->workqueue = create_singlethread_workqueue("mlx4_en"); - if (!mdev->workqueue) { - err = -ENOMEM; + if (!mdev->workqueue) goto err_mr; - } /* At this stage all non-port specific tasks are complete: * mark the card state as up */ mutex_init(&mdev->state_lock); mdev->device_up = true; - /* Setup ports */ - - /* Create a netdev for each port */ - mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH) { - mlx4_info(mdev, "Activating port:%d\n", i); - if (mlx4_en_init_netdev(mdev, i, &mdev->profile.prof[i])) - mdev->pndev[i] = NULL; - } - return mdev; err_mr: - err = mlx4_mr_free(dev, &mdev->mr); - if (err) - mlx4_err(mdev, "Error deregistering MR. The system may have become unstable."); + (void) mlx4_mr_free(dev, &mdev->mr); err_map: if (mdev->uar_map) iounmap(mdev->uar_map); @@ -285,45 +268,40 @@ static struct mlx4_interface mlx4_en_interface = { .event = mlx4_en_event, .get_dev = mlx4_en_get_netdev, .protocol = MLX4_PROT_ETH, + .activate = mlx4_en_activate, }; static void mlx4_en_verify_params(void) { - if (pfctx > MAX_PFC_TX) { - pr_warn("mlx4_en: WARNING: illegal module parameter pfctx 0x%x - " - "should be in range 0-0x%x, will be changed to default (0)\n", - pfctx, MAX_PFC_TX); - pfctx = 0; - } + if (pfctx > MAX_PFC_TX) { + pr_warn("mlx4_en: WARNING: illegal module parameter pfctx 0x%x - should be in range 0-0x%x, will be changed to default (0)\n", + pfctx, MAX_PFC_TX); + pfctx = 0; + } - if (pfcrx > MAX_PFC_RX) { - pr_warn("mlx4_en: WARNING: illegal module parameter pfcrx 0x%x - " - "should be in range 0-0x%x, will be changed to default (0)\n", - pfcrx, MAX_PFC_RX); - pfcrx = 0; - } + if (pfcrx > MAX_PFC_RX) { + pr_warn("mlx4_en: WARNING: illegal module parameter pfcrx 0x%x - should be in range 0-0x%x, will be changed to default (0)\n", + pfcrx, MAX_PFC_RX); + pfcrx = 0; + } + + if (inline_thold < MIN_PKT_LEN || inline_thold > MAX_INLINE) { + pr_warn("mlx4_en: WARNING: illegal module parameter inline_thold %d - should be in range %d-%d, will be changed to default (%d)\n", + inline_thold, MIN_PKT_LEN, MAX_INLINE, MAX_INLINE); + inline_thold = MAX_INLINE; + } } - static int __init mlx4_en_init(void) { - mlx4_en_verify_params(); + mlx4_en_verify_params(); -#ifdef CONFIG_DEBUG_FS - int err = 0; - err = mlx4_en_register_debugfs(); - if (err) - pr_err(KERN_ERR "Failed to register debugfs\n"); -#endif return mlx4_register_interface(&mlx4_en_interface); } static void __exit mlx4_en_cleanup(void) { mlx4_unregister_interface(&mlx4_en_interface); -#ifdef CONFIG_DEBUG_FS - mlx4_en_unregister_debugfs(); -#endif } module_init(mlx4_en_init); diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c b/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c index c7f169aa549b..72fd57a7ba88 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c @@ -34,6 +34,7 @@ #include #include #include +#include #ifdef CONFIG_NET_RX_BUSY_POLL #include #endif @@ -73,7 +74,7 @@ static int mlx4_en_low_latency_recv(struct napi_struct *napi) done = mlx4_en_process_rx_cq(dev, cq, 4); #ifdef LL_EXTENDED_STATS - if (done) + if (likely(done)) rx_ring->cleaned += done; else rx_ring->misses++; @@ -118,7 +119,7 @@ static enum mlx4_net_trans_rule_id mlx4_ip_proto_to_trans_rule_id(u8 ip_proto) case IPPROTO_TCP: return MLX4_NET_TRANS_RULE_ID_TCP; default: - return -EPROTONOSUPPORT; + return MLX4_NET_TRANS_RULE_NUM; } }; @@ -165,7 +166,7 @@ static void mlx4_en_filter_work(struct work_struct *work) int rc; __be64 mac_mask = cpu_to_be64(MLX4_MAC_MASK << 16); - if (spec_tcp_udp.id < 0) { + if (spec_tcp_udp.id >= MLX4_NET_TRANS_RULE_NUM) { en_warn(priv, "RFS: ignoring unsupported ip protocol (%d)\n", filter->ip_proto); goto ignore; @@ -344,8 +345,7 @@ mlx4_en_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb, return ret; } -void mlx4_en_cleanup_filters(struct mlx4_en_priv *priv, - struct mlx4_en_rx_ring *rx_ring) +void mlx4_en_cleanup_filters(struct mlx4_en_priv *priv) { struct mlx4_en_filter *filter, *tmp; LIST_HEAD(del_list); @@ -450,6 +450,25 @@ static void mlx4_en_vlan_rx_kill_vid(void *arg, struct net_device *dev, u16 vid) } +static int mlx4_en_tunnel_steer_add(struct mlx4_en_priv *priv, unsigned char *addr, + int qpn, u64 *reg_id) +{ + int err; + + if (priv->mdev->dev->caps.tunnel_offload_mode != MLX4_TUNNEL_OFFLOAD_MODE_VXLAN || + priv->mdev->dev->caps.dmfs_high_steer_mode == MLX4_STEERING_DMFS_A0_STATIC) + return 0; /* do nothing */ + + err = mlx4_tunnel_steer_add(priv->mdev->dev, addr, priv->port, qpn, + MLX4_DOMAIN_NIC, reg_id); + if (err) { + en_err(priv, "failed to add vxlan steering rule, err %d\n", err); + return err; + } + en_dbg(DRV, priv, "added vxlan steering rule, mac %pM reg_id %llx\n", addr, (long long)*reg_id); + return 0; +} + static int mlx4_en_uc_steer_add(struct mlx4_en_priv *priv, unsigned char *mac, int *qpn, u64 *reg_id) { @@ -533,10 +552,8 @@ static int mlx4_en_get_qp(struct mlx4_en_priv *priv) { struct mlx4_en_dev *mdev = priv->mdev; struct mlx4_dev *dev = mdev->dev; - struct mlx4_mac_entry *entry; int index = 0; int err = 0; - u64 reg_id; int *qpn = &priv->base_qpn; u64 mac = mlx4_mac_to_u64(IF_LLADDR(priv->dev)); @@ -556,39 +573,15 @@ static int mlx4_en_get_qp(struct mlx4_en_priv *priv) return 0; } - err = mlx4_qp_reserve_range(dev, 1, 1, qpn, 0); + err = mlx4_qp_reserve_range(dev, 1, 1, qpn, MLX4_RESERVE_A0_QP); en_dbg(DRV, priv, "Reserved qp %d\n", *qpn); if (err) { en_err(priv, "Failed to reserve qp for mac registration\n"); - goto qp_err; + mlx4_unregister_mac(dev, priv->port, mac); + return err; } - err = mlx4_en_uc_steer_add(priv, IF_LLADDR(priv->dev), qpn, ®_id); - if (err) - goto steer_err; - - entry = kmalloc(sizeof(*entry), GFP_KERNEL); - if (!entry) { - err = -ENOMEM; - goto alloc_err; - } - memcpy(entry->mac, IF_LLADDR(priv->dev), sizeof(entry->mac)); - entry->reg_id = reg_id; - - hlist_add_head(&entry->hlist, - &priv->mac_hash[entry->mac[MLX4_EN_MAC_HASH_IDX]]); - return 0; - -alloc_err: - mlx4_en_uc_steer_release(priv, IF_LLADDR(priv->dev), *qpn, reg_id); - -steer_err: - mlx4_qp_release_range(dev, *qpn, 1); - -qp_err: - mlx4_unregister_mac(dev, priv->port, mac); - return err; } static void mlx4_en_put_qp(struct mlx4_en_priv *priv) @@ -596,34 +589,13 @@ static void mlx4_en_put_qp(struct mlx4_en_priv *priv) struct mlx4_en_dev *mdev = priv->mdev; struct mlx4_dev *dev = mdev->dev; int qpn = priv->base_qpn; - u64 mac; if (dev->caps.steering_mode == MLX4_STEERING_MODE_A0) { - mac = mlx4_mac_to_u64(IF_LLADDR(priv->dev)); + u64 mac = mlx4_mac_to_u64(IF_LLADDR(priv->dev)); en_dbg(DRV, priv, "Registering MAC: %pM for deleting\n", IF_LLADDR(priv->dev)); mlx4_unregister_mac(dev, priv->port, mac); } else { - struct mlx4_mac_entry *entry; - struct hlist_node *tmp; - struct hlist_head *bucket; - unsigned int i; - - for (i = 0; i < MLX4_EN_MAC_HASH_SIZE; ++i) { - bucket = &priv->mac_hash[i]; - hlist_for_each_entry_safe(entry, tmp, bucket, hlist) { - mac = mlx4_mac_to_u64(entry->mac); - en_dbg(DRV, priv, "Registering MAC: %pM for deleting\n", - entry->mac); - mlx4_en_uc_steer_release(priv, entry->mac, - qpn, entry->reg_id); - - mlx4_unregister_mac(dev, priv->port, mac); - hlist_del(&entry->hlist); - kfree(entry); - } - } - en_dbg(DRV, priv, "Releasing qp: port %d, qpn %d\n", priv->port, qpn); mlx4_qp_release_range(dev, qpn, 1); @@ -631,10 +603,48 @@ static void mlx4_en_put_qp(struct mlx4_en_priv *priv) } } -static void mlx4_en_clear_list(struct net_device *dev) +static void mlx4_en_clear_uclist(struct net_device *dev) { struct mlx4_en_priv *priv = netdev_priv(dev); - struct mlx4_en_mc_list *tmp, *mc_to_del; + struct mlx4_en_addr_list *tmp, *uc_to_del; + + list_for_each_entry_safe(uc_to_del, tmp, &priv->uc_list, list) { + list_del(&uc_to_del->list); + kfree(uc_to_del); + } +} + +static void mlx4_en_cache_uclist(struct net_device *dev) +{ + struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_addr_list *tmp; + struct ifaddr *ifa; + + mlx4_en_clear_uclist(dev); + + if_addr_rlock(dev); + TAILQ_FOREACH(ifa, &dev->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family != AF_LINK) + continue; + if (((struct sockaddr_dl *)ifa->ifa_addr)->sdl_alen != + ETHER_ADDR_LEN) + continue; + tmp = kzalloc(sizeof(struct mlx4_en_addr_list), GFP_ATOMIC); + if (tmp == NULL) { + en_err(priv, "Failed to allocate address list\n"); + break; + } + memcpy(tmp->addr, + LLADDR((struct sockaddr_dl *)ifa->ifa_addr), ETH_ALEN); + list_add_tail(&tmp->list, &priv->uc_list); + } + if_addr_runlock(dev); +} + +static void mlx4_en_clear_mclist(struct net_device *dev) +{ + struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_addr_list *tmp, *mc_to_del; list_for_each_entry_safe(mc_to_del, tmp, &priv->mc_list, list) { list_del(&mc_to_del->list); @@ -644,35 +654,36 @@ static void mlx4_en_clear_list(struct net_device *dev) static void mlx4_en_cache_mclist(struct net_device *dev) { - struct ifmultiaddr *ifma; - struct mlx4_en_mc_list *tmp; struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_addr_list *tmp; + struct ifmultiaddr *ifma; - if_maddr_rlock(dev); - TAILQ_FOREACH(ifma, &dev->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - if (((struct sockaddr_dl *)ifma->ifma_addr)->sdl_alen != - ETHER_ADDR_LEN) - continue; - /* Make sure the list didn't grow. */ - tmp = kzalloc(sizeof(struct mlx4_en_mc_list), GFP_ATOMIC); + mlx4_en_clear_mclist(dev); + + if_maddr_rlock(dev); + TAILQ_FOREACH(ifma, &dev->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + if (((struct sockaddr_dl *)ifma->ifma_addr)->sdl_alen != + ETHER_ADDR_LEN) + continue; + tmp = kzalloc(sizeof(struct mlx4_en_addr_list), GFP_ATOMIC); if (tmp == NULL) { - en_err(priv, "Failed to allocate multicast list\n"); + en_err(priv, "Failed to allocate address list\n"); break; } memcpy(tmp->addr, LLADDR((struct sockaddr_dl *)ifma->ifma_addr), ETH_ALEN); list_add_tail(&tmp->list, &priv->mc_list); - } - if_maddr_runlock(dev); + } + if_maddr_runlock(dev); } -static void update_mclist_flags(struct mlx4_en_priv *priv, +static void update_addr_list_flags(struct mlx4_en_priv *priv, struct list_head *dst, struct list_head *src) { - struct mlx4_en_mc_list *dst_tmp, *src_tmp, *new_mc; + struct mlx4_en_addr_list *dst_tmp, *src_tmp, *new_mc; bool found; /* Find all the entries that should be removed from dst, @@ -687,7 +698,7 @@ static void update_mclist_flags(struct mlx4_en_priv *priv, } } if (!found) - dst_tmp->action = MCLIST_REM; + dst_tmp->action = MLX4_ADDR_LIST_REM; } /* Add entries that exist in src but not in dst @@ -697,21 +708,21 @@ static void update_mclist_flags(struct mlx4_en_priv *priv, found = false; list_for_each_entry(dst_tmp, dst, list) { if (!memcmp(dst_tmp->addr, src_tmp->addr, ETH_ALEN)) { - dst_tmp->action = MCLIST_NONE; + dst_tmp->action = MLX4_ADDR_LIST_NONE; found = true; break; } } if (!found) { - new_mc = kmalloc(sizeof(struct mlx4_en_mc_list), + new_mc = kmalloc(sizeof(struct mlx4_en_addr_list), GFP_KERNEL); if (!new_mc) { en_err(priv, "Failed to allocate current multicast list\n"); return; } memcpy(new_mc, src_tmp, - sizeof(struct mlx4_en_mc_list)); - new_mc->action = MCLIST_ADD; + sizeof(struct mlx4_en_addr_list)); + new_mc->action = MLX4_ADDR_LIST_ADD; list_add_tail(&new_mc->list, dst); } } @@ -731,6 +742,7 @@ static void mlx4_en_set_promisc_mode(struct mlx4_en_priv *priv, struct mlx4_en_dev *mdev) { int err = 0; + if (!(priv->flags & MLX4_EN_FLAG_PROMISC)) { priv->flags |= MLX4_EN_FLAG_PROMISC; @@ -833,7 +845,7 @@ static void mlx4_en_do_multicast(struct mlx4_en_priv *priv, struct net_device *dev, struct mlx4_en_dev *mdev) { - struct mlx4_en_mc_list *mclist, *tmp; + struct mlx4_en_addr_list *addr_list, *tmp; u8 mc_list[16] = {0}; int err = 0; u64 mcast_addr = 0; @@ -893,6 +905,28 @@ static void mlx4_en_do_multicast(struct mlx4_en_priv *priv, priv->flags &= ~MLX4_EN_FLAG_MC_PROMISC; } + /* Update unicast list */ + mlx4_en_cache_uclist(dev); + + update_addr_list_flags(priv, &priv->curr_uc_list, &priv->uc_list); + + list_for_each_entry_safe(addr_list, tmp, &priv->curr_uc_list, list) { + if (addr_list->action == MLX4_ADDR_LIST_REM) { + mlx4_en_uc_steer_release(priv, addr_list->addr, + priv->rss_map.indir_qp.qpn, + addr_list->reg_id); + /* remove from list */ + list_del(&addr_list->list); + kfree(addr_list); + } else if (addr_list->action == MLX4_ADDR_LIST_ADD) { + err = mlx4_en_uc_steer_add(priv, addr_list->addr, + &priv->rss_map.indir_qp.qpn, + &addr_list->reg_id); + if (err) + en_err(priv, "Fail to add unicast address\n"); + } + } + err = mlx4_SET_MCAST_FLTR(mdev->dev, priv->port, 0, 0, MLX4_MCAST_DISABLE); if (err) @@ -905,8 +939,8 @@ static void mlx4_en_do_multicast(struct mlx4_en_priv *priv, /* Update multicast list - we cache all addresses so they won't * change while HW is updated holding the command semaphor */ mlx4_en_cache_mclist(dev); - list_for_each_entry(mclist, &priv->mc_list, list) { - mcast_addr = mlx4_mac_to_u64(mclist->addr); + list_for_each_entry(addr_list, &priv->mc_list, list) { + mcast_addr = mlx4_mac_to_u64(addr_list->addr); mlx4_SET_MCAST_FLTR(mdev->dev, priv->port, mcast_addr, 0, MLX4_MCAST_CONFIG); } @@ -915,26 +949,33 @@ static void mlx4_en_do_multicast(struct mlx4_en_priv *priv, if (err) en_err(priv, "Failed enabling multicast filter\n"); - update_mclist_flags(priv, &priv->curr_list, &priv->mc_list); - list_for_each_entry_safe(mclist, tmp, &priv->curr_list, list) { - if (mclist->action == MCLIST_REM) { + update_addr_list_flags(priv, &priv->curr_mc_list, &priv->mc_list); + + list_for_each_entry_safe(addr_list, tmp, &priv->curr_mc_list, list) { + if (addr_list->action == MLX4_ADDR_LIST_REM) { /* detach this address and delete from list */ - memcpy(&mc_list[10], mclist->addr, ETH_ALEN); + memcpy(&mc_list[10], addr_list->addr, ETH_ALEN); mc_list[5] = priv->port; err = mlx4_multicast_detach(mdev->dev, &priv->rss_map.indir_qp, mc_list, MLX4_PROT_ETH, - mclist->reg_id); + addr_list->reg_id); if (err) en_err(priv, "Fail to detach multicast address\n"); + if (addr_list->tunnel_reg_id) { + err = mlx4_flow_detach(priv->mdev->dev, addr_list->tunnel_reg_id); + if (err) + en_err(priv, "Failed to detach multicast address\n"); + } + /* remove from list */ - list_del(&mclist->list); - kfree(mclist); - } else if (mclist->action == MCLIST_ADD) { + list_del(&addr_list->list); + kfree(addr_list); + } else if (addr_list->action == MLX4_ADDR_LIST_ADD) { /* attach the address */ - memcpy(&mc_list[10], mclist->addr, ETH_ALEN); + memcpy(&mc_list[10], addr_list->addr, ETH_ALEN); /* needed for B0 steering support */ mc_list[5] = priv->port; err = mlx4_multicast_attach(mdev->dev, @@ -942,10 +983,14 @@ static void mlx4_en_do_multicast(struct mlx4_en_priv *priv, mc_list, priv->port, 0, MLX4_PROT_ETH, - &mclist->reg_id); + &addr_list->reg_id); if (err) en_err(priv, "Fail to attach multicast address\n"); + err = mlx4_en_tunnel_steer_add(priv, &mc_list[10], priv->base_qpn, + &addr_list->tunnel_reg_id); + if (err) + en_err(priv, "Failed to attach multicast address\n"); } } } @@ -958,7 +1003,6 @@ static void mlx4_en_do_set_rx_mode(struct work_struct *work) struct mlx4_en_dev *mdev = priv->mdev; struct net_device *dev = priv->dev; - mutex_lock(&mdev->state_lock); if (!mdev->device_up) { en_dbg(HW, priv, "Card is not up, ignoring rx mode change.\n"); @@ -998,24 +1042,6 @@ static void mlx4_en_do_set_rx_mode(struct work_struct *work) mutex_unlock(&mdev->state_lock); } -#ifdef CONFIG_NET_POLL_CONTROLLER -static void mlx4_en_netpoll(struct net_device *dev) -{ - struct mlx4_en_priv *priv = netdev_priv(dev); - struct mlx4_en_cq *cq; - unsigned long flags; - int i; - - for (i = 0; i < priv->rx_ring_num; i++) { - cq = priv->rx_cq[i]; - spin_lock_irqsave(&cq->lock, flags); - napi_synchronize(&cq->napi); - mlx4_en_process_rx_cq(dev, cq, 0); - spin_unlock_irqrestore(&cq->lock, flags); - } -} -#endif - static void mlx4_en_watchdog_timeout(void *arg) { struct mlx4_en_priv *priv = arg; @@ -1038,10 +1064,10 @@ static void mlx4_en_set_default_moderation(struct mlx4_en_priv *priv) /* If we haven't received a specific coalescing setting * (module param), we set the moderation parameters as follows: * - moder_cnt is set to the number of mtu sized packets to - * satisfy our coelsing target. + * satisfy our coalescing target. * - moder_time is set to a fixed value. */ - priv->rx_frames = MLX4_EN_RX_COAL_TARGET / priv->dev->if_mtu + 1; + priv->rx_frames = MLX4_EN_RX_COAL_TARGET; priv->rx_usecs = MLX4_EN_RX_COAL_TIME; priv->tx_frames = MLX4_EN_TX_COAL_PKTS; priv->tx_usecs = MLX4_EN_TX_COAL_TIME; @@ -1126,6 +1152,7 @@ static void mlx4_en_auto_moderation(struct mlx4_en_priv *priv) priv->last_moder_time[ring] = moder_time; cq = priv->rx_cq[ring]; cq->moder_time = moder_time; + cq->moder_cnt = priv->rx_frames; err = mlx4_en_set_cq_moder(priv, cq); if (err) en_err(priv, "Failed modifying moderation for cq:%d\n", @@ -1149,7 +1176,10 @@ static void mlx4_en_do_get_stats(struct work_struct *work) mutex_lock(&mdev->state_lock); if (mdev->device_up) { if (priv->port_up) { - err = mlx4_en_DUMP_ETH_STATS(mdev, priv->port, 0); + if (mlx4_is_slave(mdev->dev)) + err = mlx4_en_get_vport_stats(mdev, priv->port); + else + err = mlx4_en_DUMP_ETH_STATS(mdev, priv->port, 0); if (err) en_dbg(HW, priv, "Could not update stats\n"); @@ -1236,7 +1266,9 @@ int mlx4_en_start_port(struct net_device *dev) } INIT_LIST_HEAD(&priv->mc_list); - INIT_LIST_HEAD(&priv->curr_list); + INIT_LIST_HEAD(&priv->uc_list); + INIT_LIST_HEAD(&priv->curr_mc_list); + INIT_LIST_HEAD(&priv->curr_uc_list); INIT_LIST_HEAD(&priv->ethtool_list); /* Calculate Rx buf size */ @@ -1281,12 +1313,8 @@ int mlx4_en_start_port(struct net_device *dev) } mdev->mac_removed[priv->port] = 0; - /* gets default allocated counter index from func cap */ - /* or sink counter index if no resources */ - priv->counter_index = mdev->dev->caps.def_counter_index[priv->port - 1]; - - en_dbg(DRV, priv, "%s: default counter index %d for port %d\n", - __func__, priv->counter_index, priv->port); + priv->counter_index = + mlx4_get_default_counter_index(mdev->dev, priv->port); err = mlx4_en_config_rss_steer(priv); if (err) { @@ -1332,7 +1360,7 @@ int mlx4_en_start_port(struct net_device *dev) /* Set initial ownership of all Tx TXBBs to SW (1) */ for (j = 0; j < tx_ring->buf_size; j += STAMP_STRIDE) - *((u32 *) (tx_ring->buf + j)) = 0xffffffff; + *((u32 *) (tx_ring->buf + j)) = INIT_OWNER_BIT; ++tx_index; } @@ -1415,7 +1443,7 @@ void mlx4_en_stop_port(struct net_device *dev) { struct mlx4_en_priv *priv = netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; - struct mlx4_en_mc_list *mclist, *tmp; + struct mlx4_en_addr_list *addr_list, *tmp; int i; u8 mc_list[16] = {0}; @@ -1433,10 +1461,7 @@ void mlx4_en_stop_port(struct net_device *dev) /* Set port as not active */ priv->port_up = false; - if (priv->counter_index != 0xff) { - mlx4_counter_free(mdev->dev, priv->port, priv->counter_index); - priv->counter_index = 0xff; - } + priv->counter_index = MLX4_SINK_COUNTER_INDEX(mdev->dev); /* Promsicuous mode */ if (mdev->dev->caps.steering_mode == @@ -1464,21 +1489,33 @@ void mlx4_en_stop_port(struct net_device *dev) } } + /* Detach All unicasts */ + list_for_each_entry(addr_list, &priv->curr_uc_list, list) { + mlx4_en_uc_steer_release(priv, addr_list->addr, + priv->rss_map.indir_qp.qpn, + addr_list->reg_id); + } + mlx4_en_clear_uclist(dev); + list_for_each_entry_safe(addr_list, tmp, &priv->curr_uc_list, list) { + list_del(&addr_list->list); + kfree(addr_list); + } + /* Detach All multicasts */ memset(&mc_list[10], 0xff, ETH_ALEN); mc_list[5] = priv->port; /* needed for B0 steering support */ mlx4_multicast_detach(mdev->dev, &priv->rss_map.indir_qp, mc_list, MLX4_PROT_ETH, priv->broadcast_id); - list_for_each_entry(mclist, &priv->curr_list, list) { - memcpy(&mc_list[10], mclist->addr, ETH_ALEN); + list_for_each_entry(addr_list, &priv->curr_mc_list, list) { + memcpy(&mc_list[10], addr_list->addr, ETH_ALEN); mc_list[5] = priv->port; mlx4_multicast_detach(mdev->dev, &priv->rss_map.indir_qp, - mc_list, MLX4_PROT_ETH, mclist->reg_id); + mc_list, MLX4_PROT_ETH, addr_list->reg_id); } - mlx4_en_clear_list(dev); - list_for_each_entry_safe(mclist, tmp, &priv->curr_list, list) { - list_del(&mclist->list); - kfree(mclist); + mlx4_en_clear_mclist(dev); + list_for_each_entry_safe(addr_list, tmp, &priv->curr_mc_list, list) { + list_del(&addr_list->list); + kfree(addr_list); } /* Flush multicast filter */ @@ -1716,10 +1753,16 @@ void mlx4_en_destroy_netdev(struct net_device *dev) en_dbg(DRV, priv, "Destroying netdev on port:%d\n", priv->port); - if (priv->vlan_attach != NULL) - EVENTHANDLER_DEREGISTER(vlan_config, priv->vlan_attach); - if (priv->vlan_detach != NULL) - EVENTHANDLER_DEREGISTER(vlan_unconfig, priv->vlan_detach); + /* don't allow more IOCTLs */ + priv->gone = 1; + + /* XXX wait a bit to allow IOCTL handlers to complete */ + pause("W", hz); + + if (priv->vlan_attach != NULL) + EVENTHANDLER_DEREGISTER(vlan_config, priv->vlan_attach); + if (priv->vlan_detach != NULL) + EVENTHANDLER_DEREGISTER(vlan_unconfig, priv->vlan_detach); /* Unregister device - this will close the port if it was up */ if (priv->registered) { @@ -1805,9 +1848,12 @@ static int mlx4_en_calc_media(struct mlx4_en_priv *priv) if (priv->last_link_state == MLX4_DEV_EVENT_PORT_DOWN) return (active); active |= IFM_FDX; - trans_type = priv->port_state.transciver; + trans_type = priv->port_state.transceiver; /* XXX I don't know all of the transceiver values. */ switch (priv->port_state.link_speed) { + case 100: + active |= IFM_100_T; + break; case 1000: active |= IFM_1000_T; break; @@ -1904,10 +1950,15 @@ static int mlx4_en_ioctl(struct ifnet *dev, u_long command, caddr_t data) error = 0; mask = 0; priv = dev->if_softc; + + /* check if detaching */ + if (priv == NULL || priv->gone != 0) + return (ENXIO); + mdev = priv->mdev; ifr = (struct ifreq *) data; - switch (command) { + switch (command) { case SIOCSIFMTU: error = -mlx4_en_change_mtu(dev, ifr->ifr_mtu); break; @@ -2156,9 +2207,6 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, } #endif - for (i = 0; i < MLX4_EN_MAC_HASH_SIZE; ++i) - INIT_HLIST_HEAD(&priv->mac_hash[i]); - /* Query for default mac and max mtu */ priv->max_mtu = mdev->dev->caps.eth_mtu_cap[priv->port]; priv->mac = mdev->dev->caps.def_mac[priv->port]; @@ -2602,7 +2650,6 @@ static void mlx4_en_sysctl_conf(struct mlx4_en_priv *priv) struct sysctl_oid *coal; struct sysctl_oid_list *coal_list; const char *pnameunit; - dev = priv->dev; ctx = &priv->conf_ctx; pnameunit = device_get_nameunit(priv->mdev->pdev->dev.bsddev); @@ -2641,7 +2688,6 @@ static void mlx4_en_sysctl_conf(struct mlx4_en_priv *priv) SYSCTL_ADD_STRING(ctx, node_list, OID_AUTO, "device_name", CTLFLAG_RD, __DECONST(void *, pnameunit), 0, "PCI device name"); - /* Add coalescer configuration. */ coal = SYSCTL_ADD_NODE(ctx, node_list, OID_AUTO, "coalesce", CTLFLAG_RD, NULL, "Interrupt coalesce configuration"); @@ -2700,124 +2746,123 @@ static void mlx4_en_sysctl_stat(struct mlx4_en_priv *priv) &priv->pstats.rx_coal_avg, "RX average coalesced completions"); #endif - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tso_packets", CTLFLAG_RD, - &priv->port_stats.tso_packets, "TSO packets sent"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "queue_stopped", CTLFLAG_RD, - &priv->port_stats.queue_stopped, "Queue full"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "wake_queue", CTLFLAG_RD, - &priv->port_stats.wake_queue, "Queue resumed after full"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_timeout", CTLFLAG_RD, - &priv->port_stats.tx_timeout, "Transmit timeouts"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_oversized_packets", CTLFLAG_RD, - &priv->port_stats.oversized_packets, "TX oversized packets, m_defrag failed"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_alloc_failed", CTLFLAG_RD, - &priv->port_stats.rx_alloc_failed, "RX failed to allocate mbuf"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_chksum_good", CTLFLAG_RD, - &priv->port_stats.rx_chksum_good, "RX checksum offload success"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_chksum_none", CTLFLAG_RD, - &priv->port_stats.rx_chksum_none, "RX without checksum offload"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_chksum_offload", - CTLFLAG_RD, &priv->port_stats.tx_chksum_offload, + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "tso_packets", CTLFLAG_RD, + &priv->port_stats.tso_packets, 0, "TSO packets sent"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "queue_stopped", CTLFLAG_RD, + &priv->port_stats.queue_stopped, 0, "Queue full"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "wake_queue", CTLFLAG_RD, + &priv->port_stats.wake_queue, 0, "Queue resumed after full"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "tx_timeout", CTLFLAG_RD, + &priv->port_stats.tx_timeout, 0, "Transmit timeouts"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "tx_oversized_packets", CTLFLAG_RD, + &priv->port_stats.oversized_packets, 0, "TX oversized packets, m_defrag failed"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_alloc_failed", CTLFLAG_RD, + &priv->port_stats.rx_alloc_failed, 0, "RX failed to allocate mbuf"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_chksum_good", CTLFLAG_RD, + &priv->port_stats.rx_chksum_good, 0, "RX checksum offload success"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_chksum_none", CTLFLAG_RD, + &priv->port_stats.rx_chksum_none, 0, "RX without checksum offload"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "tx_chksum_offload", + CTLFLAG_RD, &priv->port_stats.tx_chksum_offload, 0, "TX checksum offloads"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "defrag_attempts", CTLFLAG_RD, - &priv->port_stats.defrag_attempts, "Oversized chains defragged"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "defrag_attempts", + CTLFLAG_RD, &priv->port_stats.defrag_attempts, 0, + "Oversized chains defragged"); /* Could strdup the names and add in a loop. This is simpler. */ - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_bytes", CTLFLAG_RD, - &priv->pkstats.rx_bytes, "RX Bytes"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_packets", CTLFLAG_RD, - &priv->pkstats.rx_packets, "RX packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_multicast_packets", CTLFLAG_RD, - &priv->pkstats.rx_multicast_packets, "RX Multicast Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_broadcast_packets", CTLFLAG_RD, - &priv->pkstats.rx_broadcast_packets, "RX Broadcast Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_errors", CTLFLAG_RD, - &priv->pkstats.rx_errors, "RX Errors"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_dropped", CTLFLAG_RD, - &priv->pkstats.rx_dropped, "RX Dropped"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_length_errors", CTLFLAG_RD, - &priv->pkstats.rx_length_errors, "RX Length Errors"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_over_errors", CTLFLAG_RD, - &priv->pkstats.rx_over_errors, "RX Over Errors"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_crc_errors", CTLFLAG_RD, - &priv->pkstats.rx_crc_errors, "RX CRC Errors"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_jabbers", CTLFLAG_RD, - &priv->pkstats.rx_jabbers, "RX Jabbers"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_bytes", CTLFLAG_RD, + &priv->pkstats.rx_bytes, 0, "RX Bytes"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_packets", CTLFLAG_RD, + &priv->pkstats.rx_packets, 0, "RX packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_multicast_packets", CTLFLAG_RD, + &priv->pkstats.rx_multicast_packets, 0, "RX Multicast Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_broadcast_packets", CTLFLAG_RD, + &priv->pkstats.rx_broadcast_packets, 0, "RX Broadcast Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_errors", CTLFLAG_RD, + &priv->pkstats.rx_errors, 0, "RX Errors"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_dropped", CTLFLAG_RD, + &priv->pkstats.rx_dropped, 0, "RX Dropped"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_length_errors", CTLFLAG_RD, + &priv->pkstats.rx_length_errors, 0, "RX Length Errors"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_over_errors", CTLFLAG_RD, + &priv->pkstats.rx_over_errors, 0, "RX Over Errors"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_crc_errors", CTLFLAG_RD, + &priv->pkstats.rx_crc_errors, 0, "RX CRC Errors"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_jabbers", CTLFLAG_RD, + &priv->pkstats.rx_jabbers, 0, "RX Jabbers"); - - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_in_range_length_error", CTLFLAG_RD, - &priv->pkstats.rx_in_range_length_error, "RX IN_Range Length Error"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_out_range_length_error", - CTLFLAG_RD, &priv->pkstats.rx_out_range_length_error, - "RX Out Range Length Error"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_lt_64_bytes_packets", CTLFLAG_RD, - &priv->pkstats.rx_lt_64_bytes_packets, "RX Lt 64 Bytes Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_127_bytes_packets", CTLFLAG_RD, - &priv->pkstats.rx_127_bytes_packets, "RX 127 bytes Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_255_bytes_packets", CTLFLAG_RD, - &priv->pkstats.rx_255_bytes_packets, "RX 255 bytes Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_511_bytes_packets", CTLFLAG_RD, - &priv->pkstats.rx_511_bytes_packets, "RX 511 bytes Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_1023_bytes_packets", CTLFLAG_RD, - &priv->pkstats.rx_1023_bytes_packets, "RX 1023 bytes Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_1518_bytes_packets", CTLFLAG_RD, - &priv->pkstats.rx_1518_bytes_packets, "RX 1518 bytes Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_1522_bytes_packets", CTLFLAG_RD, - &priv->pkstats.rx_1522_bytes_packets, "RX 1522 bytes Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_1548_bytes_packets", CTLFLAG_RD, - &priv->pkstats.rx_1548_bytes_packets, "RX 1548 bytes Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_gt_1548_bytes_packets", CTLFLAG_RD, - &priv->pkstats.rx_gt_1548_bytes_packets, + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_in_range_length_error", CTLFLAG_RD, + &priv->pkstats.rx_in_range_length_error, 0, "RX IN_Range Length Error"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_out_range_length_error", + CTLFLAG_RD, &priv->pkstats.rx_out_range_length_error, 0, + "RX Out Range Length Error"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_lt_64_bytes_packets", CTLFLAG_RD, + &priv->pkstats.rx_lt_64_bytes_packets, 0, "RX Lt 64 Bytes Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_127_bytes_packets", CTLFLAG_RD, + &priv->pkstats.rx_127_bytes_packets, 0, "RX 127 bytes Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_255_bytes_packets", CTLFLAG_RD, + &priv->pkstats.rx_255_bytes_packets, 0, "RX 255 bytes Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_511_bytes_packets", CTLFLAG_RD, + &priv->pkstats.rx_511_bytes_packets, 0, "RX 511 bytes Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_1023_bytes_packets", CTLFLAG_RD, + &priv->pkstats.rx_1023_bytes_packets, 0, "RX 1023 bytes Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_1518_bytes_packets", CTLFLAG_RD, + &priv->pkstats.rx_1518_bytes_packets, 0, "RX 1518 bytes Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_1522_bytes_packets", CTLFLAG_RD, + &priv->pkstats.rx_1522_bytes_packets, 0, "RX 1522 bytes Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_1548_bytes_packets", CTLFLAG_RD, + &priv->pkstats.rx_1548_bytes_packets, 0, "RX 1548 bytes Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "rx_gt_1548_bytes_packets", CTLFLAG_RD, + &priv->pkstats.rx_gt_1548_bytes_packets, 0, "RX Greater Then 1548 bytes Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_packets", CTLFLAG_RD, - &priv->pkstats.tx_packets, "TX packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_bytes", CTLFLAG_RD, - &priv->pkstats.tx_bytes, "TX Bytes"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_multicast_packets", CTLFLAG_RD, - &priv->pkstats.tx_multicast_packets, "TX Multicast Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_broadcast_packets", CTLFLAG_RD, - &priv->pkstats.tx_broadcast_packets, "TX Broadcast Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_errors", CTLFLAG_RD, - &priv->pkstats.tx_errors, "TX Errors"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_dropped", CTLFLAG_RD, - &priv->pkstats.tx_dropped, "TX Dropped"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_lt_64_bytes_packets", CTLFLAG_RD, - &priv->pkstats.tx_lt_64_bytes_packets, "TX Less Then 64 Bytes Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_127_bytes_packets", CTLFLAG_RD, - &priv->pkstats.tx_127_bytes_packets, "TX 127 Bytes Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_255_bytes_packets", CTLFLAG_RD, - &priv->pkstats.tx_255_bytes_packets, "TX 255 Bytes Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_511_bytes_packets", CTLFLAG_RD, - &priv->pkstats.tx_511_bytes_packets, "TX 511 Bytes Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_1023_bytes_packets", CTLFLAG_RD, - &priv->pkstats.tx_1023_bytes_packets, "TX 1023 Bytes Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_1518_bytes_packets", CTLFLAG_RD, - &priv->pkstats.tx_1518_bytes_packets, "TX 1518 Bytes Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_1522_bytes_packets", CTLFLAG_RD, - &priv->pkstats.tx_1522_bytes_packets, "TX 1522 Bytes Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_1548_bytes_packets", CTLFLAG_RD, - &priv->pkstats.tx_1548_bytes_packets, "TX 1548 Bytes Packets"); - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_gt_1548_bytes_packets", CTLFLAG_RD, - &priv->pkstats.tx_gt_1548_bytes_packets, + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "tx_packets", CTLFLAG_RD, + &priv->pkstats.tx_packets, 0, "TX packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "tx_bytes", CTLFLAG_RD, + &priv->pkstats.tx_bytes, 0, "TX Bytes"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "tx_multicast_packets", CTLFLAG_RD, + &priv->pkstats.tx_multicast_packets, 0, "TX Multicast Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "tx_broadcast_packets", CTLFLAG_RD, + &priv->pkstats.tx_broadcast_packets, 0, "TX Broadcast Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "tx_errors", CTLFLAG_RD, + &priv->pkstats.tx_errors, 0, "TX Errors"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "tx_dropped", CTLFLAG_RD, + &priv->pkstats.tx_dropped, 0, "TX Dropped"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "tx_lt_64_bytes_packets", CTLFLAG_RD, + &priv->pkstats.tx_lt_64_bytes_packets, 0, "TX Less Then 64 Bytes Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "tx_127_bytes_packets", CTLFLAG_RD, + &priv->pkstats.tx_127_bytes_packets, 0, "TX 127 Bytes Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "tx_255_bytes_packets", CTLFLAG_RD, + &priv->pkstats.tx_255_bytes_packets, 0, "TX 255 Bytes Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "tx_511_bytes_packets", CTLFLAG_RD, + &priv->pkstats.tx_511_bytes_packets, 0, "TX 511 Bytes Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "tx_1023_bytes_packets", CTLFLAG_RD, + &priv->pkstats.tx_1023_bytes_packets, 0, "TX 1023 Bytes Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "tx_1518_bytes_packets", CTLFLAG_RD, + &priv->pkstats.tx_1518_bytes_packets, 0, "TX 1518 Bytes Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "tx_1522_bytes_packets", CTLFLAG_RD, + &priv->pkstats.tx_1522_bytes_packets, 0, "TX 1522 Bytes Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "tx_1548_bytes_packets", CTLFLAG_RD, + &priv->pkstats.tx_1548_bytes_packets, 0, "TX 1548 Bytes Packets"); + SYSCTL_ADD_U64(ctx, node_list, OID_AUTO, "tx_gt_1548_bytes_packets", CTLFLAG_RD, + &priv->pkstats.tx_gt_1548_bytes_packets, 0, "TX Greater Then 1548 Bytes Packets"); - - for (i = 0; i < priv->tx_ring_num; i++) { tx_ring = priv->tx_ring[i]; snprintf(namebuf, sizeof(namebuf), "tx_ring%d", i); ring_node = SYSCTL_ADD_NODE(ctx, node_list, OID_AUTO, namebuf, CTLFLAG_RD, NULL, "TX Ring"); ring_list = SYSCTL_CHILDREN(ring_node); - SYSCTL_ADD_ULONG(ctx, ring_list, OID_AUTO, "packets", - CTLFLAG_RD, &tx_ring->packets, "TX packets"); - SYSCTL_ADD_ULONG(ctx, ring_list, OID_AUTO, "bytes", - CTLFLAG_RD, &tx_ring->bytes, "TX bytes"); - SYSCTL_ADD_ULONG(ctx, ring_list, OID_AUTO, "tso_packets", - CTLFLAG_RD, &tx_ring->tso_packets, "TSO packets"); - SYSCTL_ADD_ULONG(ctx, ring_list, OID_AUTO, "defrag_attempts", - CTLFLAG_RD, &tx_ring->defrag_attempts, "Oversized chains defragged"); + SYSCTL_ADD_U64(ctx, ring_list, OID_AUTO, "packets", + CTLFLAG_RD, &tx_ring->packets, 0, "TX packets"); + SYSCTL_ADD_U64(ctx, ring_list, OID_AUTO, "bytes", + CTLFLAG_RD, &tx_ring->bytes, 0, "TX bytes"); + SYSCTL_ADD_U64(ctx, ring_list, OID_AUTO, "tso_packets", + CTLFLAG_RD, &tx_ring->tso_packets, 0, "TSO packets"); + SYSCTL_ADD_U64(ctx, ring_list, OID_AUTO, "defrag_attempts", + CTLFLAG_RD, &tx_ring->defrag_attempts, 0, + "Oversized chains defragged"); } for (i = 0; i < priv->rx_ring_num; i++) { @@ -2826,11 +2871,11 @@ static void mlx4_en_sysctl_stat(struct mlx4_en_priv *priv) ring_node = SYSCTL_ADD_NODE(ctx, node_list, OID_AUTO, namebuf, CTLFLAG_RD, NULL, "RX Ring"); ring_list = SYSCTL_CHILDREN(ring_node); - SYSCTL_ADD_ULONG(ctx, ring_list, OID_AUTO, "packets", - CTLFLAG_RD, &rx_ring->packets, "RX packets"); - SYSCTL_ADD_ULONG(ctx, ring_list, OID_AUTO, "bytes", - CTLFLAG_RD, &rx_ring->bytes, "RX bytes"); - SYSCTL_ADD_ULONG(ctx, ring_list, OID_AUTO, "error", - CTLFLAG_RD, &rx_ring->errors, "RX soft errors"); + SYSCTL_ADD_U64(ctx, ring_list, OID_AUTO, "packets", + CTLFLAG_RD, &rx_ring->packets, 0, "RX packets"); + SYSCTL_ADD_U64(ctx, ring_list, OID_AUTO, "bytes", + CTLFLAG_RD, &rx_ring->bytes, 0, "RX bytes"); + SYSCTL_ADD_U64(ctx, ring_list, OID_AUTO, "error", + CTLFLAG_RD, &rx_ring->errors, 0, "RX soft errors"); } } diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_port.c b/sys/dev/mlx4/mlx4_en/mlx4_en_port.c index 07fcd6b0b4c3..4f3b29b5b296 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_port.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_port.c @@ -39,7 +39,6 @@ #include "en_port.h" #include "en.h" -#define EN_IFQ_MIN_INTERVAL 3000 int mlx4_SET_VLAN_FLTR(struct mlx4_dev *dev, struct mlx4_en_priv *priv) @@ -57,7 +56,6 @@ int mlx4_SET_VLAN_FLTR(struct mlx4_dev *dev, struct mlx4_en_priv *priv) return PTR_ERR(mailbox); filter = mailbox->buf; - memset(filter, 0, sizeof(*filter)); for (i = VLAN_FLTR_SIZE - 1; i >= 0; i--) { entry = 0; for (j = 0; j < 32; j++) { @@ -84,7 +82,6 @@ int mlx4_en_QUERY_PORT(struct mlx4_en_dev *mdev, u8 port) mailbox = mlx4_alloc_cmd_mailbox(mdev->dev); if (IS_ERR(mailbox)) return PTR_ERR(mailbox); - memset(mailbox->buf, 0, sizeof(*qport_context)); err = mlx4_cmd_box(mdev->dev, 0, mailbox->dma, port, 0, MLX4_CMD_QUERY_PORT, MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED); @@ -96,6 +93,9 @@ int mlx4_en_QUERY_PORT(struct mlx4_en_dev *mdev, u8 port) * already synchronized, no need in locking */ state->link_state = !!(qport_context->link_up & MLX4_EN_LINK_UP_MASK); switch (qport_context->link_speed & MLX4_EN_SPEED_MASK) { + case MLX4_EN_100M_SPEED: + state->link_speed = 100; + break; case MLX4_EN_1G_SPEED: state->link_speed = 1000; break; @@ -116,14 +116,39 @@ int mlx4_en_QUERY_PORT(struct mlx4_en_dev *mdev, u8 port) state->link_speed = -1; break; } - state->transciver = qport_context->transceiver; - state->autoneg = !!(qport_context->autoneg & MLX4_EN_AUTONEG_MASK); + + state->transceiver = qport_context->transceiver; + + state->flags = 0; /* Reset and recalculate the port flags */ + state->flags |= (qport_context->link_up & MLX4_EN_ANC_MASK) ? + MLX4_EN_PORT_ANC : 0; + state->flags |= (qport_context->autoneg & MLX4_EN_AUTONEG_MASK) ? + MLX4_EN_PORT_ANE : 0; out: mlx4_free_cmd_mailbox(mdev->dev, mailbox); return err; } +/* Each counter set is located in struct mlx4_en_stat_out_mbox + * with a const offset between its prio components. + * This function runs over a counter set and sum all of it's prio components. + */ +static u64 en_stats_adder(__be64 *start, __be64 *next, int num) +{ + __be64 *curr = start; + u64 ret = 0; + int i; + int offset = next - start; + + for (i = 0; i < num; i++) { + ret += be64_to_cpu(*curr); + curr += offset; + } + + return ret; +} + static void mlx4_en_fold_software_stats(struct net_device *dev) { struct mlx4_en_priv *priv = netdev_priv(dev); @@ -159,51 +184,20 @@ static void mlx4_en_fold_software_stats(struct net_device *dev) int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset) { + struct mlx4_counter tmp_vport_stats; struct mlx4_en_stat_out_mbox *mlx4_en_stats; struct mlx4_en_stat_out_flow_control_mbox *flowstats; struct net_device *dev = mdev->pndev[port]; struct mlx4_en_priv *priv = netdev_priv(dev); struct mlx4_en_vport_stats *vport_stats = &priv->vport_stats; - struct mlx4_cmd_mailbox *mailbox = NULL; - struct mlx4_cmd_mailbox *mailbox_flow = NULL; + struct mlx4_cmd_mailbox *mailbox; u64 in_mod = reset << 8 | port; int err; - int i; - int do_if_stat = 1; - unsigned long period = (unsigned long) (jiffies - priv->last_ifq_jiffies); - struct mlx4_en_vport_stats tmp_vport_stats; - - if (jiffies_to_msecs(period) < EN_IFQ_MIN_INTERVAL || - priv->counter_index == 0xff) - do_if_stat = 0; + int i, counter_index; mailbox = mlx4_alloc_cmd_mailbox(mdev->dev); - if (IS_ERR(mailbox)) { - err = PTR_ERR(mailbox); - goto mailbox_out; - } - - mailbox_flow = mlx4_alloc_cmd_mailbox(mdev->dev); - if (IS_ERR(mailbox_flow)) { - mlx4_free_cmd_mailbox(mdev->dev, mailbox); - err = PTR_ERR(mailbox_flow); - goto mailbox_out; - } - - /* 0xffs indicates invalid value */ - memset(mailbox_flow->buf, 0xff, sizeof(*flowstats) * - MLX4_NUM_PRIORITIES); - - if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN) { - memset(mailbox_flow->buf, 0, sizeof(*flowstats)); - err = mlx4_cmd_box(mdev->dev, 0, mailbox_flow->dma, - in_mod | 1<<12, 0, MLX4_CMD_DUMP_ETH_STATS, - MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); - - if (err) - goto out; - } - + if (IS_ERR(mailbox)) + return PTR_ERR(mailbox); err = mlx4_cmd_box(mdev->dev, 0, mailbox->dma, in_mod, 0, MLX4_CMD_DUMP_ETH_STATS, MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); @@ -220,292 +214,83 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset) priv->port_stats.rx_chksum_good += priv->rx_ring[i]->csum_ok; priv->port_stats.rx_chksum_none += priv->rx_ring[i]->csum_none; } - priv->port_stats.tx_chksum_offload = 0; priv->port_stats.queue_stopped = 0; priv->port_stats.wake_queue = 0; priv->port_stats.oversized_packets = 0; priv->port_stats.tso_packets = 0; priv->port_stats.defrag_attempts = 0; + for (i = 0; i < priv->tx_ring_num; i++) { - priv->port_stats.tx_chksum_offload += priv->tx_ring[i]->tx_csum; - priv->port_stats.queue_stopped += priv->tx_ring[i]->queue_stopped; - priv->port_stats.wake_queue += priv->tx_ring[i]->wake_queue; - priv->port_stats.oversized_packets += priv->tx_ring[i]->oversized_packets; - priv->port_stats.tso_packets += priv->tx_ring[i]->tso_packets; - priv->port_stats.defrag_attempts += priv->tx_ring[i]->defrag_attempts; + const struct mlx4_en_tx_ring *ring; + ring = priv->tx_ring[i]; + + priv->port_stats.tx_chksum_offload += ring->tx_csum; + priv->port_stats.queue_stopped += ring->queue_stopped; + priv->port_stats.wake_queue += ring->wake_queue; + priv->port_stats.oversized_packets += ring->oversized_packets; + priv->port_stats.tso_packets += ring->tso_packets; + priv->port_stats.defrag_attempts += ring->defrag_attempts; } - /* RX Statistics */ - priv->pkstats.rx_packets = be64_to_cpu(mlx4_en_stats->RTOT_prio_0) + - be64_to_cpu(mlx4_en_stats->RTOT_prio_1) + - be64_to_cpu(mlx4_en_stats->RTOT_prio_2) + - be64_to_cpu(mlx4_en_stats->RTOT_prio_3) + - be64_to_cpu(mlx4_en_stats->RTOT_prio_4) + - be64_to_cpu(mlx4_en_stats->RTOT_prio_5) + - be64_to_cpu(mlx4_en_stats->RTOT_prio_6) + - be64_to_cpu(mlx4_en_stats->RTOT_prio_7) + - be64_to_cpu(mlx4_en_stats->RTOT_novlan); - priv->pkstats.rx_bytes = be64_to_cpu(mlx4_en_stats->ROCT_prio_0) + - be64_to_cpu(mlx4_en_stats->ROCT_prio_1) + - be64_to_cpu(mlx4_en_stats->ROCT_prio_2) + - be64_to_cpu(mlx4_en_stats->ROCT_prio_3) + - be64_to_cpu(mlx4_en_stats->ROCT_prio_4) + - be64_to_cpu(mlx4_en_stats->ROCT_prio_5) + - be64_to_cpu(mlx4_en_stats->ROCT_prio_6) + - be64_to_cpu(mlx4_en_stats->ROCT_prio_7) + - be64_to_cpu(mlx4_en_stats->ROCT_novlan); - priv->pkstats.rx_multicast_packets = be64_to_cpu(mlx4_en_stats->MCAST_prio_0) + - be64_to_cpu(mlx4_en_stats->MCAST_prio_1) + - be64_to_cpu(mlx4_en_stats->MCAST_prio_2) + - be64_to_cpu(mlx4_en_stats->MCAST_prio_3) + - be64_to_cpu(mlx4_en_stats->MCAST_prio_4) + - be64_to_cpu(mlx4_en_stats->MCAST_prio_5) + - be64_to_cpu(mlx4_en_stats->MCAST_prio_6) + - be64_to_cpu(mlx4_en_stats->MCAST_prio_7) + - be64_to_cpu(mlx4_en_stats->MCAST_novlan); - priv->pkstats.rx_broadcast_packets = be64_to_cpu(mlx4_en_stats->RBCAST_prio_0) + - be64_to_cpu(mlx4_en_stats->RBCAST_prio_1) + - be64_to_cpu(mlx4_en_stats->RBCAST_prio_2) + - be64_to_cpu(mlx4_en_stats->RBCAST_prio_3) + - be64_to_cpu(mlx4_en_stats->RBCAST_prio_4) + - be64_to_cpu(mlx4_en_stats->RBCAST_prio_5) + - be64_to_cpu(mlx4_en_stats->RBCAST_prio_6) + - be64_to_cpu(mlx4_en_stats->RBCAST_prio_7) + - be64_to_cpu(mlx4_en_stats->RBCAST_novlan); - priv->pkstats.rx_errors = be64_to_cpu(mlx4_en_stats->PCS) + - be32_to_cpu(mlx4_en_stats->RJBBR) + - be32_to_cpu(mlx4_en_stats->RCRC) + - be32_to_cpu(mlx4_en_stats->RRUNT) + - be64_to_cpu(mlx4_en_stats->RInRangeLengthErr) + - be64_to_cpu(mlx4_en_stats->ROutRangeLengthErr) + - be32_to_cpu(mlx4_en_stats->RSHORT) + - be64_to_cpu(mlx4_en_stats->RGIANT_prio_0) + - be64_to_cpu(mlx4_en_stats->RGIANT_prio_1) + - be64_to_cpu(mlx4_en_stats->RGIANT_prio_2) + - be64_to_cpu(mlx4_en_stats->RGIANT_prio_3) + - be64_to_cpu(mlx4_en_stats->RGIANT_prio_4) + - be64_to_cpu(mlx4_en_stats->RGIANT_prio_5) + - be64_to_cpu(mlx4_en_stats->RGIANT_prio_6) + - be64_to_cpu(mlx4_en_stats->RGIANT_prio_7) + - be64_to_cpu(mlx4_en_stats->RGIANT_novlan); - priv->pkstats.rx_dropped = be32_to_cpu(mlx4_en_stats->RdropOvflw); + + priv->pkstats.rx_errors = + be64_to_cpu(mlx4_en_stats->PCS) + + be32_to_cpu(mlx4_en_stats->RJBBR) + + be32_to_cpu(mlx4_en_stats->RCRC) + + be32_to_cpu(mlx4_en_stats->RRUNT) + + be64_to_cpu(mlx4_en_stats->RInRangeLengthErr) + + be64_to_cpu(mlx4_en_stats->ROutRangeLengthErr) + + be32_to_cpu(mlx4_en_stats->RSHORT) + + en_stats_adder(&mlx4_en_stats->RGIANT_prio_0, + &mlx4_en_stats->RGIANT_prio_1, + NUM_PRIORITIES); + priv->pkstats.tx_errors = + en_stats_adder(&mlx4_en_stats->TGIANT_prio_0, + &mlx4_en_stats->TGIANT_prio_1, + NUM_PRIORITIES); + priv->pkstats.rx_multicast_packets = + en_stats_adder(&mlx4_en_stats->MCAST_prio_0, + &mlx4_en_stats->MCAST_prio_1, + NUM_PRIORITIES); + priv->pkstats.rx_dropped = be32_to_cpu(mlx4_en_stats->RDROP); priv->pkstats.rx_length_errors = be32_to_cpu(mlx4_en_stats->RdropLength); priv->pkstats.rx_over_errors = be32_to_cpu(mlx4_en_stats->RdropOvflw); priv->pkstats.rx_crc_errors = be32_to_cpu(mlx4_en_stats->RCRC); - priv->pkstats.rx_jabbers = be32_to_cpu(mlx4_en_stats->RJBBR); - priv->pkstats.rx_in_range_length_error = be64_to_cpu(mlx4_en_stats->RInRangeLengthErr); - priv->pkstats.rx_out_range_length_error = be64_to_cpu(mlx4_en_stats->ROutRangeLengthErr); - priv->pkstats.rx_lt_64_bytes_packets = be64_to_cpu(mlx4_en_stats->R64_prio_0) + - be64_to_cpu(mlx4_en_stats->R64_prio_1) + - be64_to_cpu(mlx4_en_stats->R64_prio_2) + - be64_to_cpu(mlx4_en_stats->R64_prio_3) + - be64_to_cpu(mlx4_en_stats->R64_prio_4) + - be64_to_cpu(mlx4_en_stats->R64_prio_5) + - be64_to_cpu(mlx4_en_stats->R64_prio_6) + - be64_to_cpu(mlx4_en_stats->R64_prio_7) + - be64_to_cpu(mlx4_en_stats->R64_novlan); - priv->pkstats.rx_127_bytes_packets = be64_to_cpu(mlx4_en_stats->R127_prio_0) + - be64_to_cpu(mlx4_en_stats->R127_prio_1) + - be64_to_cpu(mlx4_en_stats->R127_prio_2) + - be64_to_cpu(mlx4_en_stats->R127_prio_3) + - be64_to_cpu(mlx4_en_stats->R127_prio_4) + - be64_to_cpu(mlx4_en_stats->R127_prio_5) + - be64_to_cpu(mlx4_en_stats->R127_prio_6) + - be64_to_cpu(mlx4_en_stats->R127_prio_7) + - be64_to_cpu(mlx4_en_stats->R127_novlan); - priv->pkstats.rx_255_bytes_packets = be64_to_cpu(mlx4_en_stats->R255_prio_0) + - be64_to_cpu(mlx4_en_stats->R255_prio_1) + - be64_to_cpu(mlx4_en_stats->R255_prio_2) + - be64_to_cpu(mlx4_en_stats->R255_prio_3) + - be64_to_cpu(mlx4_en_stats->R255_prio_4) + - be64_to_cpu(mlx4_en_stats->R255_prio_5) + - be64_to_cpu(mlx4_en_stats->R255_prio_6) + - be64_to_cpu(mlx4_en_stats->R255_prio_7) + - be64_to_cpu(mlx4_en_stats->R255_novlan); - priv->pkstats.rx_511_bytes_packets = be64_to_cpu(mlx4_en_stats->R511_prio_0) + - be64_to_cpu(mlx4_en_stats->R511_prio_1) + - be64_to_cpu(mlx4_en_stats->R511_prio_2) + - be64_to_cpu(mlx4_en_stats->R511_prio_3) + - be64_to_cpu(mlx4_en_stats->R511_prio_4) + - be64_to_cpu(mlx4_en_stats->R511_prio_5) + - be64_to_cpu(mlx4_en_stats->R511_prio_6) + - be64_to_cpu(mlx4_en_stats->R511_prio_7) + - be64_to_cpu(mlx4_en_stats->R511_novlan); - priv->pkstats.rx_1023_bytes_packets = be64_to_cpu(mlx4_en_stats->R1023_prio_0) + - be64_to_cpu(mlx4_en_stats->R1023_prio_1) + - be64_to_cpu(mlx4_en_stats->R1023_prio_2) + - be64_to_cpu(mlx4_en_stats->R1023_prio_3) + - be64_to_cpu(mlx4_en_stats->R1023_prio_4) + - be64_to_cpu(mlx4_en_stats->R1023_prio_5) + - be64_to_cpu(mlx4_en_stats->R1023_prio_6) + - be64_to_cpu(mlx4_en_stats->R1023_prio_7) + - be64_to_cpu(mlx4_en_stats->R1023_novlan); - priv->pkstats.rx_1518_bytes_packets = be64_to_cpu(mlx4_en_stats->R1518_prio_0) + - be64_to_cpu(mlx4_en_stats->R1518_prio_1) + - be64_to_cpu(mlx4_en_stats->R1518_prio_2) + - be64_to_cpu(mlx4_en_stats->R1518_prio_3) + - be64_to_cpu(mlx4_en_stats->R1518_prio_4) + - be64_to_cpu(mlx4_en_stats->R1518_prio_5) + - be64_to_cpu(mlx4_en_stats->R1518_prio_6) + - be64_to_cpu(mlx4_en_stats->R1518_prio_7) + - be64_to_cpu(mlx4_en_stats->R1518_novlan); - priv->pkstats.rx_1522_bytes_packets = be64_to_cpu(mlx4_en_stats->R1522_prio_0) + - be64_to_cpu(mlx4_en_stats->R1522_prio_1) + - be64_to_cpu(mlx4_en_stats->R1522_prio_2) + - be64_to_cpu(mlx4_en_stats->R1522_prio_3) + - be64_to_cpu(mlx4_en_stats->R1522_prio_4) + - be64_to_cpu(mlx4_en_stats->R1522_prio_5) + - be64_to_cpu(mlx4_en_stats->R1522_prio_6) + - be64_to_cpu(mlx4_en_stats->R1522_prio_7) + - be64_to_cpu(mlx4_en_stats->R1522_novlan); - priv->pkstats.rx_1548_bytes_packets = be64_to_cpu(mlx4_en_stats->R1548_prio_0) + - be64_to_cpu(mlx4_en_stats->R1548_prio_1) + - be64_to_cpu(mlx4_en_stats->R1548_prio_2) + - be64_to_cpu(mlx4_en_stats->R1548_prio_3) + - be64_to_cpu(mlx4_en_stats->R1548_prio_4) + - be64_to_cpu(mlx4_en_stats->R1548_prio_5) + - be64_to_cpu(mlx4_en_stats->R1548_prio_6) + - be64_to_cpu(mlx4_en_stats->R1548_prio_7) + - be64_to_cpu(mlx4_en_stats->R1548_novlan); - priv->pkstats.rx_gt_1548_bytes_packets = be64_to_cpu(mlx4_en_stats->R2MTU_prio_0) + - be64_to_cpu(mlx4_en_stats->R2MTU_prio_1) + - be64_to_cpu(mlx4_en_stats->R2MTU_prio_2) + - be64_to_cpu(mlx4_en_stats->R2MTU_prio_3) + - be64_to_cpu(mlx4_en_stats->R2MTU_prio_4) + - be64_to_cpu(mlx4_en_stats->R2MTU_prio_5) + - be64_to_cpu(mlx4_en_stats->R2MTU_prio_6) + - be64_to_cpu(mlx4_en_stats->R2MTU_prio_7) + - be64_to_cpu(mlx4_en_stats->R2MTU_novlan); + priv->pkstats.rx_dropped = be32_to_cpu(mlx4_en_stats->RdropOvflw); + priv->pkstats.tx_dropped = be32_to_cpu(mlx4_en_stats->TDROP); - /* Tx Stats */ - priv->pkstats.tx_packets = be64_to_cpu(mlx4_en_stats->TTOT_prio_0) + - be64_to_cpu(mlx4_en_stats->TTOT_prio_1) + - be64_to_cpu(mlx4_en_stats->TTOT_prio_2) + - be64_to_cpu(mlx4_en_stats->TTOT_prio_3) + - be64_to_cpu(mlx4_en_stats->TTOT_prio_4) + - be64_to_cpu(mlx4_en_stats->TTOT_prio_5) + - be64_to_cpu(mlx4_en_stats->TTOT_prio_6) + - be64_to_cpu(mlx4_en_stats->TTOT_prio_7) + - be64_to_cpu(mlx4_en_stats->TTOT_novlan); - priv->pkstats.tx_bytes = be64_to_cpu(mlx4_en_stats->TOCT_prio_0) + - be64_to_cpu(mlx4_en_stats->TOCT_prio_1) + - be64_to_cpu(mlx4_en_stats->TOCT_prio_2) + - be64_to_cpu(mlx4_en_stats->TOCT_prio_3) + - be64_to_cpu(mlx4_en_stats->TOCT_prio_4) + - be64_to_cpu(mlx4_en_stats->TOCT_prio_5) + - be64_to_cpu(mlx4_en_stats->TOCT_prio_6) + - be64_to_cpu(mlx4_en_stats->TOCT_prio_7) + - be64_to_cpu(mlx4_en_stats->TOCT_novlan); - priv->pkstats.tx_multicast_packets = be64_to_cpu(mlx4_en_stats->TMCAST_prio_0) + - be64_to_cpu(mlx4_en_stats->TMCAST_prio_1) + - be64_to_cpu(mlx4_en_stats->TMCAST_prio_2) + - be64_to_cpu(mlx4_en_stats->TMCAST_prio_3) + - be64_to_cpu(mlx4_en_stats->TMCAST_prio_4) + - be64_to_cpu(mlx4_en_stats->TMCAST_prio_5) + - be64_to_cpu(mlx4_en_stats->TMCAST_prio_6) + - be64_to_cpu(mlx4_en_stats->TMCAST_prio_7) + - be64_to_cpu(mlx4_en_stats->TMCAST_novlan); - priv->pkstats.tx_broadcast_packets = be64_to_cpu(mlx4_en_stats->TBCAST_prio_0) + - be64_to_cpu(mlx4_en_stats->TBCAST_prio_1) + - be64_to_cpu(mlx4_en_stats->TBCAST_prio_2) + - be64_to_cpu(mlx4_en_stats->TBCAST_prio_3) + - be64_to_cpu(mlx4_en_stats->TBCAST_prio_4) + - be64_to_cpu(mlx4_en_stats->TBCAST_prio_5) + - be64_to_cpu(mlx4_en_stats->TBCAST_prio_6) + - be64_to_cpu(mlx4_en_stats->TBCAST_prio_7) + - be64_to_cpu(mlx4_en_stats->TBCAST_novlan); - priv->pkstats.tx_errors = be64_to_cpu(mlx4_en_stats->TGIANT_prio_0) + - be64_to_cpu(mlx4_en_stats->TGIANT_prio_1) + - be64_to_cpu(mlx4_en_stats->TGIANT_prio_2) + - be64_to_cpu(mlx4_en_stats->TGIANT_prio_3) + - be64_to_cpu(mlx4_en_stats->TGIANT_prio_4) + - be64_to_cpu(mlx4_en_stats->TGIANT_prio_5) + - be64_to_cpu(mlx4_en_stats->TGIANT_prio_6) + - be64_to_cpu(mlx4_en_stats->TGIANT_prio_7) + - be64_to_cpu(mlx4_en_stats->TGIANT_novlan); - priv->pkstats.tx_dropped = be32_to_cpu(mlx4_en_stats->TDROP) - - priv->pkstats.tx_errors; - priv->pkstats.tx_lt_64_bytes_packets = be64_to_cpu(mlx4_en_stats->T64_prio_0) + - be64_to_cpu(mlx4_en_stats->T64_prio_1) + - be64_to_cpu(mlx4_en_stats->T64_prio_2) + - be64_to_cpu(mlx4_en_stats->T64_prio_3) + - be64_to_cpu(mlx4_en_stats->T64_prio_4) + - be64_to_cpu(mlx4_en_stats->T64_prio_5) + - be64_to_cpu(mlx4_en_stats->T64_prio_6) + - be64_to_cpu(mlx4_en_stats->T64_prio_7) + - be64_to_cpu(mlx4_en_stats->T64_novlan); - priv->pkstats.tx_127_bytes_packets = be64_to_cpu(mlx4_en_stats->T127_prio_0) + - be64_to_cpu(mlx4_en_stats->T127_prio_1) + - be64_to_cpu(mlx4_en_stats->T127_prio_2) + - be64_to_cpu(mlx4_en_stats->T127_prio_3) + - be64_to_cpu(mlx4_en_stats->T127_prio_4) + - be64_to_cpu(mlx4_en_stats->T127_prio_5) + - be64_to_cpu(mlx4_en_stats->T127_prio_6) + - be64_to_cpu(mlx4_en_stats->T127_prio_7) + - be64_to_cpu(mlx4_en_stats->T127_novlan); - priv->pkstats.tx_255_bytes_packets = be64_to_cpu(mlx4_en_stats->T255_prio_0) + - be64_to_cpu(mlx4_en_stats->T255_prio_1) + - be64_to_cpu(mlx4_en_stats->T255_prio_2) + - be64_to_cpu(mlx4_en_stats->T255_prio_3) + - be64_to_cpu(mlx4_en_stats->T255_prio_4) + - be64_to_cpu(mlx4_en_stats->T255_prio_5) + - be64_to_cpu(mlx4_en_stats->T255_prio_6) + - be64_to_cpu(mlx4_en_stats->T255_prio_7) + - be64_to_cpu(mlx4_en_stats->T255_novlan); - priv->pkstats.tx_511_bytes_packets = be64_to_cpu(mlx4_en_stats->T511_prio_0) + - be64_to_cpu(mlx4_en_stats->T511_prio_1) + - be64_to_cpu(mlx4_en_stats->T511_prio_2) + - be64_to_cpu(mlx4_en_stats->T511_prio_3) + - be64_to_cpu(mlx4_en_stats->T511_prio_4) + - be64_to_cpu(mlx4_en_stats->T511_prio_5) + - be64_to_cpu(mlx4_en_stats->T511_prio_6) + - be64_to_cpu(mlx4_en_stats->T511_prio_7) + - be64_to_cpu(mlx4_en_stats->T511_novlan); - priv->pkstats.tx_1023_bytes_packets = be64_to_cpu(mlx4_en_stats->T1023_prio_0) + - be64_to_cpu(mlx4_en_stats->T1023_prio_1) + - be64_to_cpu(mlx4_en_stats->T1023_prio_2) + - be64_to_cpu(mlx4_en_stats->T1023_prio_3) + - be64_to_cpu(mlx4_en_stats->T1023_prio_4) + - be64_to_cpu(mlx4_en_stats->T1023_prio_5) + - be64_to_cpu(mlx4_en_stats->T1023_prio_6) + - be64_to_cpu(mlx4_en_stats->T1023_prio_7) + - be64_to_cpu(mlx4_en_stats->T1023_novlan); - priv->pkstats.tx_1518_bytes_packets = be64_to_cpu(mlx4_en_stats->T1518_prio_0) + - be64_to_cpu(mlx4_en_stats->T1518_prio_1) + - be64_to_cpu(mlx4_en_stats->T1518_prio_2) + - be64_to_cpu(mlx4_en_stats->T1518_prio_3) + - be64_to_cpu(mlx4_en_stats->T1518_prio_4) + - be64_to_cpu(mlx4_en_stats->T1518_prio_5) + - be64_to_cpu(mlx4_en_stats->T1518_prio_6) + - be64_to_cpu(mlx4_en_stats->T1518_prio_7) + - be64_to_cpu(mlx4_en_stats->T1518_novlan); - priv->pkstats.tx_1522_bytes_packets = be64_to_cpu(mlx4_en_stats->T1522_prio_0) + - be64_to_cpu(mlx4_en_stats->T1522_prio_1) + - be64_to_cpu(mlx4_en_stats->T1522_prio_2) + - be64_to_cpu(mlx4_en_stats->T1522_prio_3) + - be64_to_cpu(mlx4_en_stats->T1522_prio_4) + - be64_to_cpu(mlx4_en_stats->T1522_prio_5) + - be64_to_cpu(mlx4_en_stats->T1522_prio_6) + - be64_to_cpu(mlx4_en_stats->T1522_prio_7) + - be64_to_cpu(mlx4_en_stats->T1522_novlan); - priv->pkstats.tx_1548_bytes_packets = be64_to_cpu(mlx4_en_stats->T1548_prio_0) + - be64_to_cpu(mlx4_en_stats->T1548_prio_1) + - be64_to_cpu(mlx4_en_stats->T1548_prio_2) + - be64_to_cpu(mlx4_en_stats->T1548_prio_3) + - be64_to_cpu(mlx4_en_stats->T1548_prio_4) + - be64_to_cpu(mlx4_en_stats->T1548_prio_5) + - be64_to_cpu(mlx4_en_stats->T1548_prio_6) + - be64_to_cpu(mlx4_en_stats->T1548_prio_7) + - be64_to_cpu(mlx4_en_stats->T1548_novlan); - priv->pkstats.tx_gt_1548_bytes_packets = be64_to_cpu(mlx4_en_stats->T2MTU_prio_0) + - be64_to_cpu(mlx4_en_stats->T2MTU_prio_1) + - be64_to_cpu(mlx4_en_stats->T2MTU_prio_2) + - be64_to_cpu(mlx4_en_stats->T2MTU_prio_3) + - be64_to_cpu(mlx4_en_stats->T2MTU_prio_4) + - be64_to_cpu(mlx4_en_stats->T2MTU_prio_5) + - be64_to_cpu(mlx4_en_stats->T2MTU_prio_6) + - be64_to_cpu(mlx4_en_stats->T2MTU_prio_7) + - be64_to_cpu(mlx4_en_stats->T2MTU_novlan); + /* RX stats */ + priv->pkstats.rx_packets = en_stats_adder(&mlx4_en_stats->RTOT_prio_0, + &mlx4_en_stats->RTOT_prio_1, + NUM_PRIORITIES); + priv->pkstats.rx_bytes = en_stats_adder(&mlx4_en_stats->ROCT_prio_0, + &mlx4_en_stats->ROCT_prio_1, + NUM_PRIORITIES); + priv->pkstats.rx_broadcast_packets = + en_stats_adder(&mlx4_en_stats->RBCAST_prio_0, + &mlx4_en_stats->RBCAST_prio_1, + NUM_PRIORITIES); + priv->pkstats.rx_jabbers = be32_to_cpu(mlx4_en_stats->RJBBR); + priv->pkstats.rx_in_range_length_error = + be64_to_cpu(mlx4_en_stats->RInRangeLengthErr); + priv->pkstats.rx_out_range_length_error = + be64_to_cpu(mlx4_en_stats->ROutRangeLengthErr); + + /* Tx stats */ + priv->pkstats.tx_packets = en_stats_adder(&mlx4_en_stats->TTOT_prio_0, + &mlx4_en_stats->TTOT_prio_1, + NUM_PRIORITIES); + priv->pkstats.tx_bytes = en_stats_adder(&mlx4_en_stats->TOCT_prio_0, + &mlx4_en_stats->TOCT_prio_1, + NUM_PRIORITIES); + priv->pkstats.tx_multicast_packets = + en_stats_adder(&mlx4_en_stats->TMCAST_prio_0, + &mlx4_en_stats->TMCAST_prio_1, + NUM_PRIORITIES); + priv->pkstats.tx_broadcast_packets = + en_stats_adder(&mlx4_en_stats->TBCAST_prio_0, + &mlx4_en_stats->TBCAST_prio_1, + NUM_PRIORITIES); priv->pkstats.rx_prio[0][0] = be64_to_cpu(mlx4_en_stats->RTOT_prio_0); priv->pkstats.rx_prio[0][1] = be64_to_cpu(mlx4_en_stats->ROCT_prio_0); @@ -544,49 +329,22 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset) priv->pkstats.tx_prio[8][0] = be64_to_cpu(mlx4_en_stats->TTOT_novlan); priv->pkstats.tx_prio[8][1] = be64_to_cpu(mlx4_en_stats->TOCT_novlan); - flowstats = mailbox_flow->buf; - - for (i = 0; i < MLX4_NUM_PRIORITIES; i++) { - priv->flowstats[i].rx_pause = - be64_to_cpu(flowstats[i].rx_pause); - priv->flowstats[i].rx_pause_duration = - be64_to_cpu(flowstats[i].rx_pause_duration); - priv->flowstats[i].rx_pause_transition = - be64_to_cpu(flowstats[i].rx_pause_transition); - priv->flowstats[i].tx_pause = - be64_to_cpu(flowstats[i].tx_pause); - priv->flowstats[i].tx_pause_duration = - be64_to_cpu(flowstats[i].tx_pause_duration); - priv->flowstats[i].tx_pause_transition = - be64_to_cpu(flowstats[i].tx_pause_transition); - } - mlx4_en_fold_software_stats(dev); spin_unlock(&priv->stats_lock); memset(&tmp_vport_stats, 0, sizeof(tmp_vport_stats)); + counter_index = mlx4_get_default_counter_index(mdev->dev, port); + err = mlx4_get_counter_stats(mdev->dev, counter_index, + &tmp_vport_stats, reset); - err = mlx4_get_vport_ethtool_stats(mdev->dev, port, - &tmp_vport_stats, reset); spin_lock(&priv->stats_lock); if (!err) { /* ethtool stats format */ - vport_stats->rx_unicast_packets = tmp_vport_stats.rx_unicast_packets; - vport_stats->rx_unicast_bytes = tmp_vport_stats.rx_unicast_bytes; - vport_stats->rx_multicast_packets = tmp_vport_stats.rx_multicast_packets; - vport_stats->rx_multicast_bytes = tmp_vport_stats.rx_multicast_bytes; - vport_stats->rx_broadcast_packets = tmp_vport_stats.rx_broadcast_packets; - vport_stats->rx_broadcast_bytes = tmp_vport_stats.rx_broadcast_bytes; - vport_stats->rx_dropped = tmp_vport_stats.rx_dropped; - vport_stats->rx_errors = tmp_vport_stats.rx_errors; - vport_stats->tx_unicast_packets = tmp_vport_stats.tx_unicast_packets; - vport_stats->tx_unicast_bytes = tmp_vport_stats.tx_unicast_bytes; - vport_stats->tx_multicast_packets = tmp_vport_stats.tx_multicast_packets; - vport_stats->tx_multicast_bytes = tmp_vport_stats.tx_multicast_bytes; - vport_stats->tx_broadcast_packets = tmp_vport_stats.tx_broadcast_packets; - vport_stats->tx_broadcast_bytes = tmp_vport_stats.tx_broadcast_bytes; - vport_stats->tx_errors = tmp_vport_stats.tx_errors; + vport_stats->rx_bytes = be64_to_cpu(tmp_vport_stats.rx_bytes); + vport_stats->rx_frames = be64_to_cpu(tmp_vport_stats.rx_frames); + vport_stats->tx_bytes = be64_to_cpu(tmp_vport_stats.tx_bytes); + vport_stats->tx_frames = be64_to_cpu(tmp_vport_stats.tx_frames); } #if __FreeBSD_version >= 1100000 @@ -623,13 +381,128 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset) spin_unlock(&priv->stats_lock); -out: - mlx4_free_cmd_mailbox(mdev->dev, mailbox_flow); - mlx4_free_cmd_mailbox(mdev->dev, mailbox); + /* 0xffs indicates invalid value */ + memset(mailbox->buf, 0xff, sizeof(*flowstats) * MLX4_NUM_PRIORITIES); -mailbox_out: - if (do_if_stat) - priv->last_ifq_jiffies = jiffies; + if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN) { + memset(mailbox->buf, 0, + sizeof(*flowstats) * MLX4_NUM_PRIORITIES); + err = mlx4_cmd_box(mdev->dev, 0, mailbox->dma, + in_mod | MLX4_DUMP_ETH_STATS_FLOW_CONTROL, + 0, MLX4_CMD_DUMP_ETH_STATS, + MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); + if (err) + goto out; + } + + flowstats = mailbox->buf; + + spin_lock(&priv->stats_lock); + + for (i = 0; i < MLX4_NUM_PRIORITIES; i++) { + priv->rx_priority_flowstats[i].rx_pause = + be64_to_cpu(flowstats[i].rx_pause); + priv->rx_priority_flowstats[i].rx_pause_duration = + be64_to_cpu(flowstats[i].rx_pause_duration); + priv->rx_priority_flowstats[i].rx_pause_transition = + be64_to_cpu(flowstats[i].rx_pause_transition); + priv->tx_priority_flowstats[i].tx_pause = + be64_to_cpu(flowstats[i].tx_pause); + priv->tx_priority_flowstats[i].tx_pause_duration = + be64_to_cpu(flowstats[i].tx_pause_duration); + priv->tx_priority_flowstats[i].tx_pause_transition = + be64_to_cpu(flowstats[i].tx_pause_transition); + } + + /* if pfc is not in use, all priorities counters have the same value */ + priv->rx_flowstats.rx_pause = + be64_to_cpu(flowstats[0].rx_pause); + priv->rx_flowstats.rx_pause_duration = + be64_to_cpu(flowstats[0].rx_pause_duration); + priv->rx_flowstats.rx_pause_transition = + be64_to_cpu(flowstats[0].rx_pause_transition); + priv->tx_flowstats.tx_pause = + be64_to_cpu(flowstats[0].tx_pause); + priv->tx_flowstats.tx_pause_duration = + be64_to_cpu(flowstats[0].tx_pause_duration); + priv->tx_flowstats.tx_pause_transition = + be64_to_cpu(flowstats[0].tx_pause_transition); + + spin_unlock(&priv->stats_lock); + +out: + mlx4_free_cmd_mailbox(mdev->dev, mailbox); + return err; +} + +int mlx4_en_get_vport_stats(struct mlx4_en_dev *mdev, u8 port) +{ + struct mlx4_en_priv *priv = netdev_priv(mdev->pndev[port]); + struct mlx4_counter tmp_vport_stats; + struct mlx4_en_vf_stats *vf_stats = &priv->vf_stats; + int err, i, counter_index; + + spin_lock(&priv->stats_lock); + + priv->pkstats.rx_packets = 0; + priv->pkstats.rx_bytes = 0; + priv->port_stats.rx_chksum_good = 0; + priv->port_stats.rx_chksum_none = 0; + for (i = 0; i < priv->rx_ring_num; i++) { + priv->pkstats.rx_packets += priv->rx_ring[i]->packets; + priv->pkstats.rx_bytes += priv->rx_ring[i]->bytes; + priv->port_stats.rx_chksum_good += priv->rx_ring[i]->csum_ok; + priv->port_stats.rx_chksum_none += priv->rx_ring[i]->csum_none; + } + priv->pkstats.tx_packets = 0; + priv->pkstats.tx_bytes = 0; + priv->port_stats.tx_chksum_offload = 0; + priv->port_stats.queue_stopped = 0; + priv->port_stats.wake_queue = 0; + + for (i = 0; i < priv->tx_ring_num; i++) { + const struct mlx4_en_tx_ring *ring = priv->tx_ring[i]; + + priv->pkstats.tx_packets += ring->packets; + priv->pkstats.tx_bytes += ring->bytes; + priv->port_stats.tx_chksum_offload += ring->tx_csum; + priv->port_stats.queue_stopped += ring->queue_stopped; + priv->port_stats.wake_queue += ring->wake_queue; + priv->port_stats.oversized_packets += priv->tx_ring[i]->oversized_packets; + } + + spin_unlock(&priv->stats_lock); + + memset(&tmp_vport_stats, 0, sizeof(tmp_vport_stats)); + + counter_index = mlx4_get_default_counter_index(mdev->dev, port); + err = mlx4_get_counter_stats(mdev->dev, counter_index, + &tmp_vport_stats, 0); + + if (!err) { + spin_lock(&priv->stats_lock); + + vf_stats->rx_bytes = be64_to_cpu(tmp_vport_stats.rx_bytes); + vf_stats->rx_frames = be64_to_cpu(tmp_vport_stats.rx_frames); + vf_stats->tx_bytes = be64_to_cpu(tmp_vport_stats.tx_bytes); + vf_stats->tx_frames = be64_to_cpu(tmp_vport_stats.tx_frames); + + priv->pkstats.rx_packets = vf_stats->rx_frames; + priv->pkstats.rx_bytes = vf_stats->rx_bytes; + priv->pkstats.tx_packets = vf_stats->tx_frames; + priv->pkstats.tx_bytes = vf_stats->tx_bytes; + + /* PF&VFs are not expected to report errors in ifconfig. + * rx_errors will be reprted in PF's ethtool statistics, + * see: mlx4_en_DUMP_ETH_STATS + */ + priv->pkstats.rx_errors = 0; + priv->pkstats.rx_dropped = 0; + priv->pkstats.tx_dropped = 0; + priv->pkstats.rx_multicast_packets = 0; + + spin_unlock(&priv->stats_lock); + } return err; } diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_resources.c b/sys/dev/mlx4/mlx4_en/mlx4_en_resources.c index fd270ede1ff1..db8beb501594 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_resources.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_resources.c @@ -70,7 +70,7 @@ void mlx4_en_fill_qp_context(struct mlx4_en_priv *priv, int size, int stride, /* disable multicast loopback to qp with same counter */ context->pri_path.fl |= MLX4_FL_ETH_SRC_CHECK_MC_LB; context->pri_path.vlan_control |= - MLX4_VLAN_CTRL_ETH_SRC_CHECK_IF_COUNTER; + MLX4_CTRL_ETH_SRC_CHECK_IF_COUNTER; } context->cqn_send = cpu_to_be32(cqn); diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c b/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c index 300478205920..7266cfa83ad6 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c @@ -252,6 +252,26 @@ static void mlx4_en_free_rx_buf(struct mlx4_en_priv *priv, } } +void mlx4_en_set_num_rx_rings(struct mlx4_en_dev *mdev) +{ + int i; + int num_of_eqs; + int num_rx_rings; + struct mlx4_dev *dev = mdev->dev; + + mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH) { + num_of_eqs = max_t(int, MIN_RX_RINGS, + min_t(int, + mlx4_get_eqs_per_port(mdev->dev, i), + DEF_RX_RINGS)); + + num_rx_rings = mlx4_low_memory_profile() ? MIN_RX_RINGS : + num_of_eqs; + mdev->profile.prof[i].rx_ring_num = + rounddown_pow_of_two(num_rx_rings); + } +} + void mlx4_en_calc_rx_buf(struct net_device *dev) { struct mlx4_en_priv *priv = netdev_priv(dev); @@ -259,7 +279,7 @@ void mlx4_en_calc_rx_buf(struct net_device *dev) MLX4_NET_IP_ALIGN; if (eff_mtu > MJUM16BYTES) { - en_err(priv, "MTU(%d) is too big\n", dev->if_mtu); + en_err(priv, "MTU(%u) is too big\n", (unsigned)dev->if_mtu); eff_mtu = MJUM16BYTES; } else if (eff_mtu > MJUM9BYTES) { eff_mtu = MJUM16BYTES; @@ -399,7 +419,7 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv) __be32 *ptr = (__be32 *)ring->buf; __be32 stamp = cpu_to_be32(1 << STAMP_SHIFT); *ptr = stamp; - /* Move pointer to start of rx section */ + /* Move pointer to start of rx section */ ring->buf += TXBB_SIZE; } @@ -607,7 +627,7 @@ mlx4_en_rss_hash(__be16 status, int udp_rss) * was added in the beginning of each cqe (the real data is in the corresponding 32B). * The following calc ensures that when factor==1, it means we are aligned to 64B * and we get the real cqe data*/ -#define CQE_FACTOR_INDEX(index, factor) ((index << factor) + factor) +#define CQE_FACTOR_INDEX(index, factor) (((index) << (factor)) + (factor)) int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int budget) { struct mlx4_en_priv *priv = netdev_priv(dev); @@ -676,7 +696,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud M_HASHTYPE_SET(mb, mlx4_en_rss_hash(cqe->status, udp_rss)); mb->m_pkthdr.rcvif = dev; if (be32_to_cpu(cqe->vlan_my_qpn) & - MLX4_CQE_VLAN_PRESENT_MASK) { + MLX4_CQE_CVLAN_PRESENT_MASK) { mb->m_pkthdr.ether_vtag = be16_to_cpu(cqe->sl_vid); mb->m_flags |= M_VLANTAG; } @@ -802,7 +822,7 @@ static int mlx4_en_config_rss_qp(struct mlx4_en_priv *priv, int qpn, return -ENOMEM; } - err = mlx4_qp_alloc(mdev->dev, qpn, qp); + err = mlx4_qp_alloc(mdev->dev, qpn, qp, GFP_KERNEL); if (err) { en_err(priv, "Failed to allocate qp #%x\n", qpn); goto out; @@ -842,7 +862,7 @@ int mlx4_en_create_drop_qp(struct mlx4_en_priv *priv) en_err(priv, "Failed reserving drop qpn\n"); return err; } - err = mlx4_qp_alloc(priv->mdev->dev, qpn, &priv->drop_qp); + err = mlx4_qp_alloc(priv->mdev->dev, qpn, &priv->drop_qp, GFP_KERNEL); if (err) { en_err(priv, "Failed allocating drop qp\n"); mlx4_qp_release_range(priv->mdev->dev, qpn, 1); @@ -930,7 +950,7 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv) } /* Configure RSS indirection qp */ - err = mlx4_qp_alloc(mdev->dev, priv->base_qpn, &rss_map->indir_qp); + err = mlx4_qp_alloc(mdev->dev, priv->base_qpn, &rss_map->indir_qp, GFP_KERNEL); if (err) { en_err(priv, "Failed to allocate RSS indirection QP\n"); goto rss_err; diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c b/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c index ad0b3ccefdcf..f3d700502977 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c @@ -52,17 +52,6 @@ #include "en.h" -enum { - MAX_INLINE = 104, /* 128 - 16 - 4 - 4 */ - MAX_BF = 256, - MIN_PKT_LEN = 17, -}; - -static int inline_thold __read_mostly = MAX_INLINE; - -module_param_named(inline_thold, inline_thold, uint, 0444); -MODULE_PARM_DESC(inline_thold, "threshold for using inline data"); - int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv, struct mlx4_en_tx_ring **pring, u32 size, u16 stride, int node, int queue_idx) @@ -101,7 +90,7 @@ int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv, ring->size = size; ring->size_mask = size - 1; ring->stride = stride; - ring->inline_thold = MAX(MIN_PKT_LEN, MIN(inline_thold, MAX_INLINE)); + ring->inline_thold = MAX(MIN_PKT_LEN, MIN(priv->prof->inline_thold, MAX_INLINE)); mtx_init(&ring->tx_lock.m, "mlx4 tx", NULL, MTX_DEF); mtx_init(&ring->comp_lock.m, "mlx4 comp", NULL, MTX_DEF); @@ -163,13 +152,13 @@ int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv, ring->buf_size, (unsigned long long) ring->wqres.buf.direct.map); err = mlx4_qp_reserve_range(mdev->dev, 1, 1, &ring->qpn, - MLX4_RESERVE_BF_QP); + MLX4_RESERVE_ETH_BF_QP); if (err) { en_err(priv, "failed reserving qp for TX ring\n"); goto err_map; } - err = mlx4_qp_alloc(mdev->dev, ring->qpn, &ring->qp); + err = mlx4_qp_alloc(mdev->dev, ring->qpn, &ring->qp, GFP_KERNEL); if (err) { en_err(priv, "Failed allocating qp %d\n", ring->qpn); goto err_reserve; @@ -185,8 +174,6 @@ int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv, } else ring->bf_enabled = true; ring->queue_index = queue_idx; - if (queue_idx < priv->num_tx_rings_p_up ) - CPU_SET(queue_idx, &ring->affinity_mask); *pring = ring; return 0; @@ -447,8 +434,8 @@ static int mlx4_en_process_tx_cq(struct net_device *dev, ring->blocked = 0; if (atomic_fetchadd_int(&priv->blocked, -1) == 1) atomic_clear_int(&dev->if_drv_flags ,IFF_DRV_OACTIVE); - ring->wake_queue++; priv->port_stats.wake_queue++; + ring->wake_queue++; } return (0); } @@ -752,7 +739,7 @@ static int mlx4_en_xmit(struct mlx4_en_priv *priv, int tx_ind, struct mbuf **mbp /* check for VLAN tag */ if (mb->m_flags & M_VLANTAG) { tx_desc->ctrl.vlan_tag = cpu_to_be16(mb->m_pkthdr.ether_vtag); - tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_VLAN; + tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_CVLAN; } else { tx_desc->ctrl.vlan_tag = 0; tx_desc->ctrl.ins_vlan = 0; @@ -930,7 +917,7 @@ static int mlx4_en_xmit(struct mlx4_en_priv *priv, int tx_ind, struct mbuf **mbp ring->prod += tx_info->nr_txbb; if (ring->bf_enabled && bf_size <= MAX_BF && - (tx_desc->ctrl.ins_vlan != MLX4_WQE_CTRL_INS_VLAN)) { + (tx_desc->ctrl.ins_vlan != MLX4_WQE_CTRL_INS_CVLAN)) { /* store doorbell number */ *(volatile __be32 *) (&tx_desc->ctrl.vlan_tag) |= cpu_to_be32(ring->doorbell_qpn); diff --git a/sys/dev/mlx4/qp.h b/sys/dev/mlx4/qp.h index b2479ae87390..fff16de040da 100644 --- a/sys/dev/mlx4/qp.h +++ b/sys/dev/mlx4/qp.h @@ -38,22 +38,12 @@ #include #define MLX4_INVALID_LKEY 0x100 - #define DS_SIZE_ALIGNMENT 16 #define SET_BYTE_COUNT(byte_count) cpu_to_be32(byte_count) #define SET_LSO_MSS(mss_hdr_size) cpu_to_be32(mss_hdr_size) #define DS_BYTE_COUNT_MASK cpu_to_be32(0x7fffffff) -enum ib_m_qp_attr_mask { - IB_M_EXT_CLASS_1 = 1 << 28, - IB_M_EXT_CLASS_2 = 1 << 29, - IB_M_EXT_CLASS_3 = 1 << 30, - - IB_M_QP_MOD_VEND_MASK = (IB_M_EXT_CLASS_1 | IB_M_EXT_CLASS_2 | - IB_M_EXT_CLASS_3) -}; - enum mlx4_qp_optpar { MLX4_QP_OPTPAR_ALT_ADDR_PATH = 1 << 0, MLX4_QP_OPTPAR_RRE = 1 << 1, @@ -70,7 +60,8 @@ enum mlx4_qp_optpar { MLX4_QP_OPTPAR_RNR_RETRY = 1 << 13, MLX4_QP_OPTPAR_ACK_TIMEOUT = 1 << 14, MLX4_QP_OPTPAR_SCHED_QUEUE = 1 << 16, - MLX4_QP_OPTPAR_COUNTER_INDEX = 1 << 20 + MLX4_QP_OPTPAR_COUNTER_INDEX = 1 << 20, + MLX4_QP_OPTPAR_VLAN_STRIPPING = 1 << 21, }; enum mlx4_qp_state { @@ -109,10 +100,8 @@ enum { MLX4_QP_BIT_RRE = 1 << 15, MLX4_QP_BIT_RWE = 1 << 14, MLX4_QP_BIT_RAE = 1 << 13, + MLX4_QP_BIT_FPP = 1 << 3, MLX4_QP_BIT_RIC = 1 << 4, - MLX4_QP_BIT_COLL_SYNC_RQ = 1 << 2, - MLX4_QP_BIT_COLL_SYNC_SQ = 1 << 1, - MLX4_QP_BIT_COLL_MASTER = 1 << 0 }; enum { @@ -126,25 +115,34 @@ enum { MLX4_RSS_TCP_IPV4 = 1 << 4, MLX4_RSS_IPV4 = 1 << 5, + MLX4_RSS_BY_OUTER_HEADERS = 0 << 6, + MLX4_RSS_BY_INNER_HEADERS = 2 << 6, + MLX4_RSS_BY_INNER_HEADERS_IPONLY = 3 << 6, + /* offset of mlx4_rss_context within mlx4_qp_context.pri_path */ MLX4_RSS_OFFSET_IN_QPC_PRI_PATH = 0x24, /* offset of being RSS indirection QP within mlx4_qp_context.flags */ MLX4_RSS_QPC_FLAG_OFFSET = 13, }; +#define MLX4_EN_RSS_KEY_SIZE 40 + struct mlx4_rss_context { __be32 base_qpn; __be32 default_qpn; u16 reserved; u8 hash_fn; u8 flags; - __be32 rss_key[10]; + __be32 rss_key[MLX4_EN_RSS_KEY_SIZE / sizeof(__be32)]; __be32 base_qpn_udp; }; struct mlx4_qp_path { u8 fl; - u8 vlan_control; + union { + u8 vlan_control; + u8 control; + }; u8 disable_pkey_check; u8 pkey_index; u8 counter_index; @@ -161,31 +159,38 @@ struct mlx4_qp_path { u8 feup; u8 fvl_rx; u8 reserved4[2]; - u8 dmac[6]; + u8 dmac[ETH_ALEN]; }; enum { /* fl */ MLX4_FL_CV = 1 << 6, + MLX4_FL_SV = 1 << 5, MLX4_FL_ETH_HIDE_CQE_VLAN = 1 << 2, MLX4_FL_ETH_SRC_CHECK_MC_LB = 1 << 1, MLX4_FL_ETH_SRC_CHECK_UC_LB = 1 << 0, }; + +enum { /* control */ + MLX4_CTRL_ETH_SRC_CHECK_IF_COUNTER = 1 << 7, +}; + enum { /* vlan_control */ - MLX4_VLAN_CTRL_ETH_SRC_CHECK_IF_COUNTER = 1 << 7, MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED = 1 << 6, + MLX4_VLAN_CTRL_ETH_TX_BLOCK_PRIO_TAGGED = 1 << 5, /* 802.1p priority tag */ + MLX4_VLAN_CTRL_ETH_TX_BLOCK_UNTAGGED = 1 << 4, MLX4_VLAN_CTRL_ETH_RX_BLOCK_TAGGED = 1 << 2, - MLX4_VLAN_CTRL_ETH_RX_BLOCK_PRIO_TAGGED = 1 << 1,/* 802.1p priorty tag*/ + MLX4_VLAN_CTRL_ETH_RX_BLOCK_PRIO_TAGGED = 1 << 1, /* 802.1p priority tag */ MLX4_VLAN_CTRL_ETH_RX_BLOCK_UNTAGGED = 1 << 0 }; enum { /* feup */ - MLX4_FEUP_FORCE_ETH_UP = 1 << 6, /* force Eth UP */ - MLX4_FSM_FORCE_ETH_SRC_MAC = 1 << 5, /* force Source MAC */ - MLX4_FVL_FORCE_ETH_VLAN = 1 << 3 /* force Eth vlan */ + MLX4_FEUP_FORCE_ETH_UP = 1 << 6, /* force Eth UP */ + MLX4_FSM_FORCE_ETH_SRC_MAC = 1 << 5, /* force Source MAC */ + MLX4_FVL_FORCE_ETH_VLAN = 1 << 3 /* force Eth vlan */ }; enum { /* fvl_rx */ - MLX4_FVL_RX_FORCE_ETH_VLAN = 1 << 0 /* enforce Eth rx vlan */ + MLX4_FVL_RX_FORCE_ETH_VLAN = 1 << 0 /* enforce Eth rx vlan */ }; struct mlx4_qp_context { @@ -194,7 +199,7 @@ struct mlx4_qp_context { u8 mtu_msgmax; u8 rq_size_stride; u8 sq_size_stride; - u8 rlkey; + u8 rlkey_roce_mode; __be32 usr_page; __be32 local_qpn; __be32 remote_qpn; @@ -204,7 +209,8 @@ struct mlx4_qp_context { u32 reserved1; __be32 next_send_psn; __be32 cqn_send; - u32 reserved2[2]; + __be16 roce_entropy; + __be16 reserved2[3]; __be32 last_acked_psn; __be32 ssn; __be32 params2; @@ -217,14 +223,17 @@ struct mlx4_qp_context { __be32 msn; __be16 rq_wqe_counter; __be16 sq_wqe_counter; - u32 reserved3[2]; + u32 reserved3; + __be16 rate_limit_params; + u8 reserved4; + u8 qos_vport; __be32 param3; __be32 nummmcpeers_basemkey; u8 log_page_size; - u8 reserved4[2]; + u8 reserved5[2]; u8 mtt_base_addr_h; __be32 mtt_base_addr_l; - u32 reserved5[10]; + u32 reserved6[10]; }; struct mlx4_update_qp_context { @@ -239,6 +248,8 @@ struct mlx4_update_qp_context { enum { MLX4_UPD_QP_MASK_PM_STATE = 32, MLX4_UPD_QP_MASK_VSD = 33, + MLX4_UPD_QP_MASK_QOS_VPP = 34, + MLX4_UPD_QP_MASK_RATE_LIMIT = 35, }; enum { @@ -261,13 +272,13 @@ enum { MLX4_UPD_QP_PATH_MASK_FVL_RX = 16 + 32, MLX4_UPD_QP_PATH_MASK_ETH_SRC_CHECK_UC_LB = 18 + 32, MLX4_UPD_QP_PATH_MASK_ETH_SRC_CHECK_MC_LB = 19 + 32, + MLX4_UPD_QP_PATH_MASK_SV = 22 + 32, }; enum { /* param3 */ - MLX4_STRIP_VLAN = 1 << 30 + MLX4_STRIP_VLAN = 1 << 30 }; - /* Which firmware version adds support for NEC (NoErrorCompletion) bit */ #define MLX4_FW_VER_WQE_CTRL_NEC mlx4_fw_ver(2, 2, 232) @@ -275,21 +286,29 @@ enum { MLX4_WQE_CTRL_OWN = 1 << 31, MLX4_WQE_CTRL_NEC = 1 << 29, MLX4_WQE_CTRL_RR = 1 << 6, + MLX4_WQE_CTRL_IIP = 1 << 28, + MLX4_WQE_CTRL_ILP = 1 << 27, MLX4_WQE_CTRL_FENCE = 1 << 6, MLX4_WQE_CTRL_CQ_UPDATE = 3 << 2, MLX4_WQE_CTRL_SOLICITED = 1 << 1, MLX4_WQE_CTRL_IP_CSUM = 1 << 4, MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5, - MLX4_WQE_CTRL_INS_VLAN = 1 << 6, + MLX4_WQE_CTRL_INS_CVLAN = 1 << 6, + MLX4_WQE_CTRL_INS_SVLAN = 1 << 7, MLX4_WQE_CTRL_STRONG_ORDER = 1 << 7, MLX4_WQE_CTRL_FORCE_LOOPBACK = 1 << 0, }; struct mlx4_wqe_ctrl_seg { __be32 owner_opcode; - __be16 vlan_tag; - u8 ins_vlan; - u8 fence_size; + union { + struct { + __be16 vlan_tag; + u8 ins_vlan; + u8 fence_size; + }; + __be32 bf_qpn; + }; /* * High 24 bits are SRC remote buffer; low 8 bits are flags: * [7] SO (strong ordering) @@ -342,7 +361,7 @@ struct mlx4_wqe_datagram_seg { __be32 dqpn; __be32 qkey; __be16 vlan; - u8 mac[6]; + u8 mac[ETH_ALEN]; }; struct mlx4_wqe_lso_seg { @@ -351,8 +370,8 @@ struct mlx4_wqe_lso_seg { }; enum mlx4_wqe_bind_seg_flags2 { - MLX4_WQE_BIND_TYPE_2 = (1<<31), - MLX4_WQE_BIND_ZERO_BASED = (1<<30), + MLX4_WQE_BIND_ZERO_BASED = (1 << 30), + MLX4_WQE_BIND_TYPE_2 = (1 << 31), }; struct mlx4_wqe_bind_seg { @@ -433,6 +452,31 @@ struct mlx4_wqe_inline_seg { __be32 byte_count; }; +enum mlx4_update_qp_attr { + MLX4_UPDATE_QP_SMAC = 1 << 0, + MLX4_UPDATE_QP_VSD = 1 << 1, + MLX4_UPDATE_QP_RATE_LIMIT = 1 << 2, + MLX4_UPDATE_QP_QOS_VPORT = 1 << 3, + MLX4_UPDATE_QP_ETH_SRC_CHECK_MC_LB = 1 << 4, + MLX4_UPDATE_QP_SUPPORTED_ATTRS = (1 << 5) - 1 +}; + +enum mlx4_update_qp_params_flags { + MLX4_UPDATE_QP_PARAMS_FLAGS_ETH_CHECK_MC_LB = 1 << 0, + MLX4_UPDATE_QP_PARAMS_FLAGS_VSD_ENABLE = 1 << 1, +}; + +struct mlx4_update_qp_params { + u8 smac_index; + u8 qos_vport; + u32 flags; + u16 rate_unit; + u16 rate_val; +}; + +int mlx4_update_qp(struct mlx4_dev *dev, u32 qpn, + enum mlx4_update_qp_attr attr, + struct mlx4_update_qp_params *params); int mlx4_qp_modify(struct mlx4_dev *dev, struct mlx4_mtt *mtt, enum mlx4_qp_state cur_state, enum mlx4_qp_state new_state, struct mlx4_qp_context *context, enum mlx4_qp_optpar optpar, @@ -452,4 +496,14 @@ static inline struct mlx4_qp *__mlx4_qp_lookup(struct mlx4_dev *dev, u32 qpn) void mlx4_qp_remove(struct mlx4_dev *dev, struct mlx4_qp *qp); +static inline u16 folded_qp(u32 q) +{ + u16 res; + + res = ((q & 0xff) ^ ((q & 0xff0000) >> 16)) | (q & 0xff00); + return res; +} + +u16 mlx4_qp_roce_entropy(struct mlx4_dev *dev, u32 qpn); + #endif /* MLX4_QP_H */ diff --git a/sys/dev/mlx4/stats.h b/sys/dev/mlx4/stats.h index 3b86ea18cbd0..fd03c39c11f3 100644 --- a/sys/dev/mlx4/stats.h +++ b/sys/dev/mlx4/stats.h @@ -33,100 +33,75 @@ #ifndef _MLX4_STATS_ #define _MLX4_STATS_ - -#ifdef MLX4_EN_PERF_STAT -#define NUM_PERF_STATS NUM_PERF_COUNTERS -#else -#define NUM_PERF_STATS 0 -#endif - #define NUM_PRIORITIES 9 #define NUM_PRIORITY_STATS 2 struct mlx4_en_pkt_stats { - unsigned long rx_packets; - unsigned long rx_bytes; - unsigned long rx_multicast_packets; - unsigned long rx_broadcast_packets; - unsigned long rx_errors; - unsigned long rx_dropped; - unsigned long rx_length_errors; - unsigned long rx_over_errors; - unsigned long rx_crc_errors; - unsigned long rx_jabbers; - unsigned long rx_in_range_length_error; - unsigned long rx_out_range_length_error; - unsigned long rx_lt_64_bytes_packets; - unsigned long rx_127_bytes_packets; - unsigned long rx_255_bytes_packets; - unsigned long rx_511_bytes_packets; - unsigned long rx_1023_bytes_packets; - unsigned long rx_1518_bytes_packets; - unsigned long rx_1522_bytes_packets; - unsigned long rx_1548_bytes_packets; - unsigned long rx_gt_1548_bytes_packets; - unsigned long tx_packets; - unsigned long tx_bytes; - unsigned long tx_multicast_packets; - unsigned long tx_broadcast_packets; - unsigned long tx_errors; - unsigned long tx_dropped; - unsigned long tx_lt_64_bytes_packets; - unsigned long tx_127_bytes_packets; - unsigned long tx_255_bytes_packets; - unsigned long tx_511_bytes_packets; - unsigned long tx_1023_bytes_packets; - unsigned long tx_1518_bytes_packets; - unsigned long tx_1522_bytes_packets; - unsigned long tx_1548_bytes_packets; - unsigned long tx_gt_1548_bytes_packets; - unsigned long rx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; - unsigned long tx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; + u64 rx_packets; + u64 rx_bytes; + u64 rx_multicast_packets; + u64 rx_broadcast_packets; + u64 rx_errors; + u64 rx_dropped; + u64 rx_length_errors; + u64 rx_over_errors; + u64 rx_crc_errors; + u64 rx_jabbers; + u64 rx_in_range_length_error; + u64 rx_out_range_length_error; + u64 rx_lt_64_bytes_packets; + u64 rx_127_bytes_packets; + u64 rx_255_bytes_packets; + u64 rx_511_bytes_packets; + u64 rx_1023_bytes_packets; + u64 rx_1518_bytes_packets; + u64 rx_1522_bytes_packets; + u64 rx_1548_bytes_packets; + u64 rx_gt_1548_bytes_packets; + u64 tx_packets; + u64 tx_bytes; + u64 tx_multicast_packets; + u64 tx_broadcast_packets; + u64 tx_errors; + u64 tx_dropped; + u64 tx_lt_64_bytes_packets; + u64 tx_127_bytes_packets; + u64 tx_255_bytes_packets; + u64 tx_511_bytes_packets; + u64 tx_1023_bytes_packets; + u64 tx_1518_bytes_packets; + u64 tx_1522_bytes_packets; + u64 tx_1548_bytes_packets; + u64 tx_gt_1548_bytes_packets; + u64 rx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; + u64 tx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; }; struct mlx4_en_vf_stats { - unsigned long rx_packets; - unsigned long rx_bytes; - unsigned long rx_multicast_packets; - unsigned long rx_broadcast_packets; - unsigned long rx_errors; - unsigned long rx_dropped; - unsigned long tx_packets; - unsigned long tx_bytes; - unsigned long tx_multicast_packets; - unsigned long tx_broadcast_packets; - unsigned long tx_errors; + u64 rx_frames; + u64 rx_bytes; + u64 tx_frames; + u64 tx_bytes; }; struct mlx4_en_vport_stats { - unsigned long rx_unicast_packets; - unsigned long rx_unicast_bytes; - unsigned long rx_multicast_packets; - unsigned long rx_multicast_bytes; - unsigned long rx_broadcast_packets; - unsigned long rx_broadcast_bytes; - unsigned long rx_dropped; - unsigned long rx_errors; - unsigned long tx_unicast_packets; - unsigned long tx_unicast_bytes; - unsigned long tx_multicast_packets; - unsigned long tx_multicast_bytes; - unsigned long tx_broadcast_packets; - unsigned long tx_broadcast_bytes; - unsigned long tx_errors; + u64 rx_frames; + u64 rx_bytes; + u64 tx_frames; + u64 tx_bytes; }; struct mlx4_en_port_stats { - unsigned long tso_packets; - unsigned long queue_stopped; - unsigned long wake_queue; - unsigned long tx_timeout; - unsigned long oversized_packets; - unsigned long rx_alloc_failed; - unsigned long rx_chksum_good; - unsigned long rx_chksum_none; - unsigned long tx_chksum_offload; - unsigned long defrag_attempts; + u64 tso_packets; + u64 queue_stopped; + u64 wake_queue; + u64 tx_timeout; + u64 oversized_packets; + u64 rx_alloc_failed; + u64 rx_chksum_good; + u64 rx_chksum_none; + u64 tx_chksum_offload; + u64 defrag_attempts; }; struct mlx4_en_perf_stats { @@ -138,16 +113,19 @@ struct mlx4_en_perf_stats { u32 napi_quota; }; -struct mlx4_en_flow_stats { +#define MLX4_NUM_PRIORITIES 8 + +struct mlx4_en_flow_stats_rx { u64 rx_pause; u64 rx_pause_duration; u64 rx_pause_transition; +}; + +struct mlx4_en_flow_stats_tx { u64 tx_pause; u64 tx_pause_duration; u64 tx_pause_transition; }; -#define MLX4_NUM_PRIORITIES 8 - struct mlx4_en_stat_out_flow_control_mbox { /* Total number of PAUSE frames received from the far-end port */ @@ -170,8 +148,12 @@ struct mlx4_en_stat_out_flow_control_mbox { __be64 reserved[2]; }; +enum { + MLX4_DUMP_ETH_STATS_FLOW_CONTROL = 1 << 12 +}; + int mlx4_get_vport_ethtool_stats(struct mlx4_dev *dev, int port, - struct mlx4_en_vport_stats *vport_stats, - int reset); + struct mlx4_en_vport_stats *vport_stats, + int reset, int *read_counters); #endif diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c index a651a0856827..53b4e58d978c 100644 --- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c +++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c @@ -3820,7 +3820,7 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, } for (nreq = 0; wr; nreq++, wr = wr->next) { - if (unlikely(wr->opcode >= ARRAY_SIZE(mlx5_ib_opcode))) { + if (unlikely(wr->opcode < 0 || wr->opcode >= ARRAY_SIZE(mlx5_ib_opcode))) { mlx5_ib_warn(dev, "\n"); err = -EINVAL; *bad_wr = wr; diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c index 1a75707cbe33..6aff753edc7b 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -677,7 +677,11 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t attaching) return (error); } - if ((error = mpr_pci_setup_interrupts(sc)) != 0) { + /* + * XXX If the number of MSI-X vectors changes during re-init, this + * won't see it and adjust. + */ + if (attaching && (error = mpr_pci_setup_interrupts(sc)) != 0) { mpr_dprint(sc, MPR_INIT|MPR_ERROR, "Failed to setup interrupts\n"); mpr_free(sc); diff --git a/sys/dev/mps/mps.c b/sys/dev/mps/mps.c index 8bc461db3ab4..c5fb0ee614ce 100644 --- a/sys/dev/mps/mps.c +++ b/sys/dev/mps/mps.c @@ -665,7 +665,11 @@ mps_iocfacts_allocate(struct mps_softc *sc, uint8_t attaching) return (error); } - if ((error = mps_pci_setup_interrupts(sc)) != 0) { + /* + * XXX If the number of MSI-X vectors changes during re-init, this + * won't see it and adjust. + */ + if (attaching && (error = mps_pci_setup_interrupts(sc)) != 0) { mps_dprint(sc, MPS_INIT|MPS_FAULT, "Failed to setup " "interrupts\n"); mps_free(sc); diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index aff4fbc66a61..b5960eb9b115 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -41,6 +41,13 @@ #define NVME_IO_TEST _IOWR('n', 100, struct nvme_io_test) #define NVME_BIO_TEST _IOWR('n', 101, struct nvme_io_test) +/* + * Macros to deal with NVME revisions, as defined VS register + */ +#define NVME_REV(x, y) (((x) << 16) | ((y) << 8)) +#define NVME_MAJOR(r) (((r) >> 16) & 0xffff) +#define NVME_MINOR(r) (((r) >> 8) & 0xff) + /* * Use to mark a command to apply to all namespaces, or to retrieve global * log pages. diff --git a/sys/dev/nvme/nvme_sim.c b/sys/dev/nvme/nvme_sim.c index 94169055919c..775a48278217 100644 --- a/sys/dev/nvme/nvme_sim.c +++ b/sys/dev/nvme/nvme_sim.c @@ -44,6 +44,9 @@ __FBSDID("$FreeBSD$"); #include // Yes, this is wrong. #include +#include +#include + #include "nvme_private.h" #define ccb_accb_ptr spriv_ptr0 @@ -122,6 +125,24 @@ nvme_sim_nvmeio(struct cam_sim *sim, union ccb *ccb) ccb->ccb_h.status |= CAM_SIM_QUEUED; } +static uint32_t +nvme_link_kBps(struct nvme_controller *ctrlr) +{ + uint32_t speed, lanes, link[] = { 1, 250000, 500000, 985000, 1970000 }; + uint32_t status; + + status = pcie_read_config(ctrlr->dev, PCIER_LINK_STA, 2); + speed = status & PCIEM_LINK_STA_SPEED; + lanes = (status & PCIEM_LINK_STA_WIDTH) >> 4; + /* + * Failsafe on link speed indicator. If it is insane report the number of + * lanes as the speed. Not 100% accurate, but may be diagnostic. + */ + if (speed >= nitems(link)) + speed = 0; + return link[speed] * lanes; +} + static void nvme_sim_action(struct cam_sim *sim, union ccb *ccb) { @@ -179,15 +200,15 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) cpi->maxio = nvme_ns_get_max_io_xfer_size(ns); cpi->initiator_id = 0; cpi->bus_id = cam_sim_bus(sim); - cpi->base_transfer_speed = 4000000; /* 4 GB/s 4 lanes pcie 3 */ + cpi->base_transfer_speed = nvme_link_kBps(ctrlr); strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strlcpy(cpi->hba_vid, "NVMe", HBA_IDLEN); strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); cpi->unit_number = cam_sim_unit(sim); cpi->transport = XPORT_NVME; /* XXX XPORT_PCIE ? */ - cpi->transport_version = 1; /* XXX Get PCIe spec ? */ + cpi->transport_version = nvme_mmio_read_4(ctrlr, vs); cpi->protocol = PROTO_NVME; - cpi->protocol_version = NVME_REV_1; /* Groks all 1.x NVMe cards */ + cpi->protocol_version = nvme_mmio_read_4(ctrlr, vs); cpi->xport_specific.nvme.nsid = ns->id; cpi->ccb_h.status = CAM_REQ_CMP; break; @@ -197,20 +218,27 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) struct ccb_trans_settings *cts; struct ccb_trans_settings_nvme *nvmep; struct ccb_trans_settings_nvme *nvmex; + device_t dev; + uint32_t status, caps; + dev = ctrlr->dev; cts = &ccb->cts; nvmex = &cts->xport_specific.nvme; nvmep = &cts->proto_specific.nvme; - nvmex->valid = CTS_NVME_VALID_SPEC; - nvmex->spec_major = 1; /* XXX read from card */ - nvmex->spec_minor = 2; - nvmex->spec_tiny = 0; + status = pcie_read_config(dev, PCIER_LINK_STA, 2); + caps = pcie_read_config(dev, PCIER_LINK_CAP, 2); + nvmex->valid = CTS_NVME_VALID_SPEC | CTS_NVME_VALID_LINK; + nvmex->spec = nvme_mmio_read_4(ctrlr, vs); + nvmex->speed = status & PCIEM_LINK_STA_SPEED; + nvmex->lanes = (status & PCIEM_LINK_STA_WIDTH) >> 4; + nvmex->max_speed = caps & PCIEM_LINK_CAP_MAX_SPEED; + nvmex->max_lanes = (caps & PCIEM_LINK_CAP_MAX_WIDTH) >> 4; + + /* XXX these should be something else maybe ? */ + nvmep->valid = 1; + nvmep->spec = nvmex->spec; - nvmep->valid = CTS_NVME_VALID_SPEC; - nvmep->spec_major = 1; /* XXX read from card */ - nvmep->spec_minor = 2; - nvmep->spec_tiny = 0; cts->transport = XPORT_NVME; cts->protocol = PROTO_NVME; cts->ccb_h.status = CAM_REQ_CMP; diff --git a/sys/dev/usb/net/if_ure.c b/sys/dev/usb/net/if_ure.c index d58b1fc6837f..db9b0517f238 100644 --- a/sys/dev/usb/net/if_ure.c +++ b/sys/dev/usb/net/if_ure.c @@ -70,6 +70,7 @@ static const STRUCT_USB_HOST_ID ure_devs[] = { URE_DEV(LENOVO, RTL8153, 0), URE_DEV(REALTEK, RTL8152, URE_FLAG_8152), URE_DEV(REALTEK, RTL8153, 0), + URE_DEV(TPLINK, RTL8153, 0), #undef URE_DEV }; diff --git a/sys/dev/usb/quirk/usb_quirk.c b/sys/dev/usb/quirk/usb_quirk.c index 92fd9dee4f0b..3f18b61db87c 100644 --- a/sys/dev/usb/quirk/usb_quirk.c +++ b/sys/dev/usb/quirk/usb_quirk.c @@ -95,7 +95,6 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRKS_MAX] = { USB_QUIRK(SILICONPORTALS, YAPPHONE, 0x100, 0x100, UQ_AU_INP_ASYNC), USB_QUIRK(LOGITECH, UN53B, 0x0000, 0xffff, UQ_NO_STRINGS), USB_QUIRK(REALTEK, RTL8196EU, 0x0000, 0xffff, UQ_CFG_INDEX_1), - USB_QUIRK(TPLINK, RTL8153, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(ELSA, MODEM1, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(PLANEX2, MZKUE150N, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(CISCOLINKSYS, USB3GIGV1, 0x0000, 0xffff, UQ_CFG_INDEX_1), diff --git a/sys/dev/vnic/nicvf_main.c b/sys/dev/vnic/nicvf_main.c index adfa53e05840..5e6cf9e6884a 100644 --- a/sys/dev/vnic/nicvf_main.c +++ b/sys/dev/vnic/nicvf_main.c @@ -350,7 +350,7 @@ nicvf_setup_ifnet(struct nicvf *nic) if_setsoftc(ifp, nic); if_initname(ifp, device_get_name(nic->dev), device_get_unit(nic->dev)); - if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX); + if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); if_settransmitfn(ifp, nicvf_if_transmit); if_setqflushfn(ifp, nicvf_if_qflush); diff --git a/sys/dev/vnic/nicvf_queues.c b/sys/dev/vnic/nicvf_queues.c index bd65e40fe8ad..51d043a74145 100644 --- a/sys/dev/vnic/nicvf_queues.c +++ b/sys/dev/vnic/nicvf_queues.c @@ -78,6 +78,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include @@ -992,6 +994,9 @@ nicvf_xmit_locked(struct snd_queue *sq) err = 0; while ((next = drbr_peek(ifp, sq->br)) != NULL) { + /* Send a copy of the frame to the BPF listener */ + ETHER_BPF_MTAP(ifp, next); + err = nicvf_tx_mbuf_locked(sq, &next); if (err != 0) { if (next == NULL) @@ -1002,8 +1007,6 @@ nicvf_xmit_locked(struct snd_queue *sq) break; } drbr_advance(ifp, sq->br); - /* Send a copy of the frame to the BPF listener */ - ETHER_BPF_MTAP(ifp, next); } return (err); } @@ -1751,7 +1754,7 @@ nicvf_sq_add_hdr_subdesc(struct snd_queue *sq, int qentry, struct tcphdr *th; #endif uint16_t etype; - int ehdrlen, iphlen, poff; + int ehdrlen, iphlen, poff, proto; nic = sq->nic; @@ -1775,13 +1778,21 @@ nicvf_sq_add_hdr_subdesc(struct snd_queue *sq, int qentry, etype = ntohs(eh->evl_encap_proto); } + poff = proto = -1; switch (etype) { #ifdef INET6 case ETHERTYPE_IPV6: - /* ARM64TODO: Add support for IPv6 */ - hdr->csum_l3 = 0; - sq->snd_buff[qentry].mbuf = NULL; - return (ENXIO); + if (mbuf->m_len < ehdrlen + sizeof(struct ip6_hdr)) { + mbuf = m_pullup(mbuf, ehdrlen +sizeof(struct ip6_hdr)); + sq->snd_buff[qentry].mbuf = NULL; + if (mbuf == NULL) + return (ENOBUFS); + } + poff = ip6_lasthdr(mbuf, ehdrlen, IPPROTO_IPV6, &proto); + if (poff < 0) + return (ENOBUFS); + poff += ehdrlen; + break; #endif #ifdef INET case ETHERTYPE_IP: @@ -1795,72 +1806,71 @@ nicvf_sq_add_hdr_subdesc(struct snd_queue *sq, int qentry, ip = (struct ip *)(mbuf->m_data + ehdrlen); iphlen = ip->ip_hl << 2; poff = ehdrlen + iphlen; - - if (mbuf->m_pkthdr.csum_flags != 0) { - hdr->csum_l3 = 1; /* Enable IP csum calculation */ - switch (ip->ip_p) { - case IPPROTO_TCP: - if ((mbuf->m_pkthdr.csum_flags & CSUM_TCP) == 0) - break; - - if (mbuf->m_len < (poff + sizeof(struct tcphdr))) { - mbuf = m_pullup(mbuf, poff + sizeof(struct tcphdr)); - sq->snd_buff[qentry].mbuf = mbuf; - if (mbuf == NULL) - return (ENOBUFS); - } - hdr->csum_l4 = SEND_L4_CSUM_TCP; - break; - case IPPROTO_UDP: - if ((mbuf->m_pkthdr.csum_flags & CSUM_UDP) == 0) - break; - - if (mbuf->m_len < (poff + sizeof(struct udphdr))) { - mbuf = m_pullup(mbuf, poff + sizeof(struct udphdr)); - sq->snd_buff[qentry].mbuf = mbuf; - if (mbuf == NULL) - return (ENOBUFS); - } - hdr->csum_l4 = SEND_L4_CSUM_UDP; - break; - case IPPROTO_SCTP: - if ((mbuf->m_pkthdr.csum_flags & CSUM_SCTP) == 0) - break; - - if (mbuf->m_len < (poff + sizeof(struct sctphdr))) { - mbuf = m_pullup(mbuf, poff + sizeof(struct sctphdr)); - sq->snd_buff[qentry].mbuf = mbuf; - if (mbuf == NULL) - return (ENOBUFS); - } - hdr->csum_l4 = SEND_L4_CSUM_SCTP; - break; - default: - break; - } - hdr->l3_offset = ehdrlen; - hdr->l4_offset = ehdrlen + iphlen; - } - - if ((mbuf->m_pkthdr.tso_segsz != 0) && nic->hw_tso) { - /* - * Extract ip again as m_data could have been modified. - */ - ip = (struct ip *)(mbuf->m_data + ehdrlen); - th = (struct tcphdr *)((caddr_t)ip + iphlen); - - hdr->tso = 1; - hdr->tso_start = ehdrlen + iphlen + (th->th_off * 4); - hdr->tso_max_paysize = mbuf->m_pkthdr.tso_segsz; - hdr->inner_l3_offset = ehdrlen - 2; - nic->drv_stats.tx_tso++; - } + proto = ip->ip_p; break; #endif default: hdr->csum_l3 = 0; } +#if defined(INET6) || defined(INET) + if (poff > 0 && mbuf->m_pkthdr.csum_flags != 0) { + hdr->csum_l3 = 1; /* Enable IP csum calculation */ + switch (proto) { + case IPPROTO_TCP: + if ((mbuf->m_pkthdr.csum_flags & CSUM_TCP) == 0) + break; + + if (mbuf->m_len < (poff + sizeof(struct tcphdr))) { + mbuf = m_pullup(mbuf, poff + sizeof(struct tcphdr)); + sq->snd_buff[qentry].mbuf = mbuf; + if (mbuf == NULL) + return (ENOBUFS); + } + hdr->csum_l4 = SEND_L4_CSUM_TCP; + break; + case IPPROTO_UDP: + if ((mbuf->m_pkthdr.csum_flags & CSUM_UDP) == 0) + break; + + if (mbuf->m_len < (poff + sizeof(struct udphdr))) { + mbuf = m_pullup(mbuf, poff + sizeof(struct udphdr)); + sq->snd_buff[qentry].mbuf = mbuf; + if (mbuf == NULL) + return (ENOBUFS); + } + hdr->csum_l4 = SEND_L4_CSUM_UDP; + break; + case IPPROTO_SCTP: + if ((mbuf->m_pkthdr.csum_flags & CSUM_SCTP) == 0) + break; + + if (mbuf->m_len < (poff + sizeof(struct sctphdr))) { + mbuf = m_pullup(mbuf, poff + sizeof(struct sctphdr)); + sq->snd_buff[qentry].mbuf = mbuf; + if (mbuf == NULL) + return (ENOBUFS); + } + hdr->csum_l4 = SEND_L4_CSUM_SCTP; + break; + default: + break; + } + hdr->l3_offset = ehdrlen; + hdr->l4_offset = poff; + } + + if ((mbuf->m_pkthdr.tso_segsz != 0) && nic->hw_tso) { + th = (struct tcphdr *)((caddr_t)(mbuf->m_data + poff)); + + hdr->tso = 1; + hdr->tso_start = poff + (th->th_off * 4); + hdr->tso_max_paysize = mbuf->m_pkthdr.tso_segsz; + hdr->inner_l3_offset = ehdrlen - 2; + nic->drv_stats.tx_tso++; + } +#endif + return (0); } diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index 2743a3492270..5efc4eb24326 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -2161,6 +2161,10 @@ vtterm_ioctl(struct terminal *tm, u_long cmd, caddr_t data, return (error); } + case KDGETMODE: + *(int *)data = (vw->vw_flags & VWF_GRAPHICS) ? + KD_GRAPHICS : KD_TEXT; + return (0); case KDGKBMODE: { error = 0; diff --git a/sys/boot/fdt/dts/Makefile b/sys/dts/Makefile similarity index 100% rename from sys/boot/fdt/dts/Makefile rename to sys/dts/Makefile diff --git a/sys/boot/fdt/dts/Makefile.inc b/sys/dts/Makefile.inc similarity index 82% rename from sys/boot/fdt/dts/Makefile.inc rename to sys/dts/Makefile.inc index 4454755dc813..a62fd171edc6 100644 --- a/sys/boot/fdt/dts/Makefile.inc +++ b/sys/dts/Makefile.inc @@ -1,6 +1,6 @@ # $FreeBSD$ -SYSDIR?=${.CURDIR}/../../../.. +SYSDIR?=${SRCTOP}/sys test-dts: .for dts in ${DTS} diff --git a/sys/boot/fdt/dts/arm/Makefile b/sys/dts/arm/Makefile similarity index 100% rename from sys/boot/fdt/dts/arm/Makefile rename to sys/dts/arm/Makefile diff --git a/sys/boot/fdt/dts/arm/a83t.dtsi b/sys/dts/arm/a83t.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/a83t.dtsi rename to sys/dts/arm/a83t.dtsi diff --git a/sys/boot/fdt/dts/arm/annapurna-alpine.dts b/sys/dts/arm/annapurna-alpine.dts similarity index 100% rename from sys/boot/fdt/dts/arm/annapurna-alpine.dts rename to sys/dts/arm/annapurna-alpine.dts diff --git a/sys/boot/fdt/dts/arm/apalis-imx6.dts b/sys/dts/arm/apalis-imx6.dts similarity index 100% rename from sys/boot/fdt/dts/arm/apalis-imx6.dts rename to sys/dts/arm/apalis-imx6.dts diff --git a/sys/boot/fdt/dts/arm/armada-380.dtsi b/sys/dts/arm/armada-380.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/armada-380.dtsi rename to sys/dts/arm/armada-380.dtsi diff --git a/sys/boot/fdt/dts/arm/armada-385-db-ap.dts b/sys/dts/arm/armada-385-db-ap.dts similarity index 100% rename from sys/boot/fdt/dts/arm/armada-385-db-ap.dts rename to sys/dts/arm/armada-385-db-ap.dts diff --git a/sys/boot/fdt/dts/arm/armada-385.dtsi b/sys/dts/arm/armada-385.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/armada-385.dtsi rename to sys/dts/arm/armada-385.dtsi diff --git a/sys/boot/fdt/dts/arm/armada-388-clearfog.dts b/sys/dts/arm/armada-388-clearfog.dts similarity index 100% rename from sys/boot/fdt/dts/arm/armada-388-clearfog.dts rename to sys/dts/arm/armada-388-clearfog.dts diff --git a/sys/boot/fdt/dts/arm/armada-388-gp.dts b/sys/dts/arm/armada-388-gp.dts similarity index 100% rename from sys/boot/fdt/dts/arm/armada-388-gp.dts rename to sys/dts/arm/armada-388-gp.dts diff --git a/sys/boot/fdt/dts/arm/armada-388.dtsi b/sys/dts/arm/armada-388.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/armada-388.dtsi rename to sys/dts/arm/armada-388.dtsi diff --git a/sys/boot/fdt/dts/arm/armada-38x-solidrun-microsom.dtsi b/sys/dts/arm/armada-38x-solidrun-microsom.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/armada-38x-solidrun-microsom.dtsi rename to sys/dts/arm/armada-38x-solidrun-microsom.dtsi diff --git a/sys/boot/fdt/dts/arm/armada-38x.dtsi b/sys/dts/arm/armada-38x.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/armada-38x.dtsi rename to sys/dts/arm/armada-38x.dtsi diff --git a/sys/boot/fdt/dts/arm/bcm2835.dtsi b/sys/dts/arm/bcm2835.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/bcm2835.dtsi rename to sys/dts/arm/bcm2835.dtsi diff --git a/sys/boot/fdt/dts/arm/bcm2836.dtsi b/sys/dts/arm/bcm2836.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/bcm2836.dtsi rename to sys/dts/arm/bcm2836.dtsi diff --git a/sys/boot/fdt/dts/arm/db78100.dts b/sys/dts/arm/db78100.dts similarity index 100% rename from sys/boot/fdt/dts/arm/db78100.dts rename to sys/dts/arm/db78100.dts diff --git a/sys/boot/fdt/dts/arm/db78460.dts b/sys/dts/arm/db78460.dts similarity index 100% rename from sys/boot/fdt/dts/arm/db78460.dts rename to sys/dts/arm/db78460.dts diff --git a/sys/boot/fdt/dts/arm/db88f5182.dts b/sys/dts/arm/db88f5182.dts similarity index 100% rename from sys/boot/fdt/dts/arm/db88f5182.dts rename to sys/dts/arm/db88f5182.dts diff --git a/sys/boot/fdt/dts/arm/db88f5281.dts b/sys/dts/arm/db88f5281.dts similarity index 100% rename from sys/boot/fdt/dts/arm/db88f5281.dts rename to sys/dts/arm/db88f5281.dts diff --git a/sys/boot/fdt/dts/arm/db88f6281.dts b/sys/dts/arm/db88f6281.dts similarity index 100% rename from sys/boot/fdt/dts/arm/db88f6281.dts rename to sys/dts/arm/db88f6281.dts diff --git a/sys/boot/fdt/dts/arm/digi-ccwmx53.dts b/sys/dts/arm/digi-ccwmx53.dts similarity index 100% rename from sys/boot/fdt/dts/arm/digi-ccwmx53.dts rename to sys/dts/arm/digi-ccwmx53.dts diff --git a/sys/boot/fdt/dts/arm/dockstar.dts b/sys/dts/arm/dockstar.dts similarity index 100% rename from sys/boot/fdt/dts/arm/dockstar.dts rename to sys/dts/arm/dockstar.dts diff --git a/sys/boot/fdt/dts/arm/dreamplug-1001.dts b/sys/dts/arm/dreamplug-1001.dts similarity index 100% rename from sys/boot/fdt/dts/arm/dreamplug-1001.dts rename to sys/dts/arm/dreamplug-1001.dts diff --git a/sys/boot/fdt/dts/arm/dreamplug-1001N.dts b/sys/dts/arm/dreamplug-1001N.dts similarity index 100% rename from sys/boot/fdt/dts/arm/dreamplug-1001N.dts rename to sys/dts/arm/dreamplug-1001N.dts diff --git a/sys/boot/fdt/dts/arm/ea3250.dts b/sys/dts/arm/ea3250.dts similarity index 100% rename from sys/boot/fdt/dts/arm/ea3250.dts rename to sys/dts/arm/ea3250.dts diff --git a/sys/boot/fdt/dts/arm/efikamx.dts b/sys/dts/arm/efikamx.dts similarity index 100% rename from sys/boot/fdt/dts/arm/efikamx.dts rename to sys/dts/arm/efikamx.dts diff --git a/sys/boot/fdt/dts/arm/exynos5.dtsi b/sys/dts/arm/exynos5.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/exynos5.dtsi rename to sys/dts/arm/exynos5.dtsi diff --git a/sys/boot/fdt/dts/arm/exynos5250-arndale.dts b/sys/dts/arm/exynos5250-arndale.dts similarity index 100% rename from sys/boot/fdt/dts/arm/exynos5250-arndale.dts rename to sys/dts/arm/exynos5250-arndale.dts diff --git a/sys/boot/fdt/dts/arm/exynos5250-snow.dts b/sys/dts/arm/exynos5250-snow.dts similarity index 100% rename from sys/boot/fdt/dts/arm/exynos5250-snow.dts rename to sys/dts/arm/exynos5250-snow.dts diff --git a/sys/boot/fdt/dts/arm/exynos5250-spring.dts b/sys/dts/arm/exynos5250-spring.dts similarity index 100% rename from sys/boot/fdt/dts/arm/exynos5250-spring.dts rename to sys/dts/arm/exynos5250-spring.dts diff --git a/sys/boot/fdt/dts/arm/exynos5250.dtsi b/sys/dts/arm/exynos5250.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/exynos5250.dtsi rename to sys/dts/arm/exynos5250.dtsi diff --git a/sys/boot/fdt/dts/arm/exynos5420-arndale-octa.dts b/sys/dts/arm/exynos5420-arndale-octa.dts similarity index 100% rename from sys/boot/fdt/dts/arm/exynos5420-arndale-octa.dts rename to sys/dts/arm/exynos5420-arndale-octa.dts diff --git a/sys/boot/fdt/dts/arm/exynos5420-peach-pit.dts b/sys/dts/arm/exynos5420-peach-pit.dts similarity index 100% rename from sys/boot/fdt/dts/arm/exynos5420-peach-pit.dts rename to sys/dts/arm/exynos5420-peach-pit.dts diff --git a/sys/boot/fdt/dts/arm/exynos5420.dtsi b/sys/dts/arm/exynos5420.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/exynos5420.dtsi rename to sys/dts/arm/exynos5420.dtsi diff --git a/sys/boot/fdt/dts/arm/h3.dtsi b/sys/dts/arm/h3.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/h3.dtsi rename to sys/dts/arm/h3.dtsi diff --git a/sys/boot/fdt/dts/arm/hl201.dts b/sys/dts/arm/hl201.dts similarity index 100% rename from sys/boot/fdt/dts/arm/hl201.dts rename to sys/dts/arm/hl201.dts diff --git a/sys/boot/fdt/dts/arm/imx51x.dtsi b/sys/dts/arm/imx51x.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/imx51x.dtsi rename to sys/dts/arm/imx51x.dtsi diff --git a/sys/boot/fdt/dts/arm/imx53x.dtsi b/sys/dts/arm/imx53x.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/imx53x.dtsi rename to sys/dts/arm/imx53x.dtsi diff --git a/sys/boot/fdt/dts/arm/imx6.dtsi b/sys/dts/arm/imx6.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/imx6.dtsi rename to sys/dts/arm/imx6.dtsi diff --git a/sys/boot/fdt/dts/arm/meson3.dtsi b/sys/dts/arm/meson3.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/meson3.dtsi rename to sys/dts/arm/meson3.dtsi diff --git a/sys/boot/fdt/dts/arm/meson8b.dtsi b/sys/dts/arm/meson8b.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/meson8b.dtsi rename to sys/dts/arm/meson8b.dtsi diff --git a/sys/boot/fdt/dts/arm/nanopi-neo.dts b/sys/dts/arm/nanopi-neo.dts similarity index 100% rename from sys/boot/fdt/dts/arm/nanopi-neo.dts rename to sys/dts/arm/nanopi-neo.dts diff --git a/sys/boot/fdt/dts/arm/odroidc1.dts b/sys/dts/arm/odroidc1.dts similarity index 100% rename from sys/boot/fdt/dts/arm/odroidc1.dts rename to sys/dts/arm/odroidc1.dts diff --git a/sys/boot/fdt/dts/arm/orangepi-plus-2e.dts b/sys/dts/arm/orangepi-plus-2e.dts similarity index 100% rename from sys/boot/fdt/dts/arm/orangepi-plus-2e.dts rename to sys/dts/arm/orangepi-plus-2e.dts diff --git a/sys/boot/fdt/dts/arm/pandaboard-common.dtsi b/sys/dts/arm/pandaboard-common.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/pandaboard-common.dtsi rename to sys/dts/arm/pandaboard-common.dtsi diff --git a/sys/boot/fdt/dts/arm/pandaboard-es.dts b/sys/dts/arm/pandaboard-es.dts similarity index 100% rename from sys/boot/fdt/dts/arm/pandaboard-es.dts rename to sys/dts/arm/pandaboard-es.dts diff --git a/sys/boot/fdt/dts/arm/pandaboard.dts b/sys/dts/arm/pandaboard.dts similarity index 100% rename from sys/boot/fdt/dts/arm/pandaboard.dts rename to sys/dts/arm/pandaboard.dts diff --git a/sys/boot/fdt/dts/arm/rk3188-radxa-lite.dts b/sys/dts/arm/rk3188-radxa-lite.dts similarity index 100% rename from sys/boot/fdt/dts/arm/rk3188-radxa-lite.dts rename to sys/dts/arm/rk3188-radxa-lite.dts diff --git a/sys/boot/fdt/dts/arm/rk3188-radxa.dts b/sys/dts/arm/rk3188-radxa.dts similarity index 100% rename from sys/boot/fdt/dts/arm/rk3188-radxa.dts rename to sys/dts/arm/rk3188-radxa.dts diff --git a/sys/boot/fdt/dts/arm/rk3188.dtsi b/sys/dts/arm/rk3188.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/rk3188.dtsi rename to sys/dts/arm/rk3188.dtsi diff --git a/sys/boot/fdt/dts/arm/rpi.dts b/sys/dts/arm/rpi.dts similarity index 100% rename from sys/boot/fdt/dts/arm/rpi.dts rename to sys/dts/arm/rpi.dts diff --git a/sys/boot/fdt/dts/arm/rpi2.dts b/sys/dts/arm/rpi2.dts similarity index 100% rename from sys/boot/fdt/dts/arm/rpi2.dts rename to sys/dts/arm/rpi2.dts diff --git a/sys/boot/fdt/dts/arm/rt1310a.dtsi b/sys/dts/arm/rt1310a.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/rt1310a.dtsi rename to sys/dts/arm/rt1310a.dtsi diff --git a/sys/boot/fdt/dts/arm/sam9260ek.dts b/sys/dts/arm/sam9260ek.dts similarity index 100% rename from sys/boot/fdt/dts/arm/sam9260ek.dts rename to sys/dts/arm/sam9260ek.dts diff --git a/sys/boot/fdt/dts/arm/sheevaplug.dts b/sys/dts/arm/sheevaplug.dts similarity index 100% rename from sys/boot/fdt/dts/arm/sheevaplug.dts rename to sys/dts/arm/sheevaplug.dts diff --git a/sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts b/sys/dts/arm/sinovoip-bpi-m3.dts similarity index 100% rename from sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts rename to sys/dts/arm/sinovoip-bpi-m3.dts diff --git a/sys/boot/fdt/dts/arm/socfpga_arria10_socdk_sdmmc.dts b/sys/dts/arm/socfpga_arria10_socdk_sdmmc.dts similarity index 100% rename from sys/boot/fdt/dts/arm/socfpga_arria10_socdk_sdmmc.dts rename to sys/dts/arm/socfpga_arria10_socdk_sdmmc.dts diff --git a/sys/boot/fdt/dts/arm/socfpga_cyclone5_sockit_beri_sdmmc.dts b/sys/dts/arm/socfpga_cyclone5_sockit_beri_sdmmc.dts similarity index 100% rename from sys/boot/fdt/dts/arm/socfpga_cyclone5_sockit_beri_sdmmc.dts rename to sys/dts/arm/socfpga_cyclone5_sockit_beri_sdmmc.dts diff --git a/sys/boot/fdt/dts/arm/socfpga_cyclone5_sockit_sdmmc.dts b/sys/dts/arm/socfpga_cyclone5_sockit_sdmmc.dts similarity index 100% rename from sys/boot/fdt/dts/arm/socfpga_cyclone5_sockit_sdmmc.dts rename to sys/dts/arm/socfpga_cyclone5_sockit_sdmmc.dts diff --git a/sys/boot/fdt/dts/arm/sun7i-a20-hdmi.dtsi b/sys/dts/arm/sun7i-a20-hdmi.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/sun7i-a20-hdmi.dtsi rename to sys/dts/arm/sun7i-a20-hdmi.dtsi diff --git a/sys/boot/fdt/dts/arm/sun8i-a83t-sinovoip-bpi-m3.dts b/sys/dts/arm/sun8i-a83t-sinovoip-bpi-m3.dts similarity index 100% rename from sys/boot/fdt/dts/arm/sun8i-a83t-sinovoip-bpi-m3.dts rename to sys/dts/arm/sun8i-a83t-sinovoip-bpi-m3.dts diff --git a/sys/boot/fdt/dts/arm/sun8i-a83t.dtsi b/sys/dts/arm/sun8i-a83t.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/sun8i-a83t.dtsi rename to sys/dts/arm/sun8i-a83t.dtsi diff --git a/sys/boot/fdt/dts/arm/sun8i-h3-nanopi-neo.dts b/sys/dts/arm/sun8i-h3-nanopi-neo.dts similarity index 100% rename from sys/boot/fdt/dts/arm/sun8i-h3-nanopi-neo.dts rename to sys/dts/arm/sun8i-h3-nanopi-neo.dts diff --git a/sys/boot/fdt/dts/arm/tegra124-jetson-tk1-fbsd.dts b/sys/dts/arm/tegra124-jetson-tk1-fbsd.dts similarity index 100% rename from sys/boot/fdt/dts/arm/tegra124-jetson-tk1-fbsd.dts rename to sys/dts/arm/tegra124-jetson-tk1-fbsd.dts diff --git a/sys/boot/fdt/dts/arm/tegra20-paz00.dts b/sys/dts/arm/tegra20-paz00.dts similarity index 100% rename from sys/boot/fdt/dts/arm/tegra20-paz00.dts rename to sys/dts/arm/tegra20-paz00.dts diff --git a/sys/boot/fdt/dts/arm/tegra20.dtsi b/sys/dts/arm/tegra20.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/tegra20.dtsi rename to sys/dts/arm/tegra20.dtsi diff --git a/sys/boot/fdt/dts/arm/trimslice.dts b/sys/dts/arm/trimslice.dts similarity index 100% rename from sys/boot/fdt/dts/arm/trimslice.dts rename to sys/dts/arm/trimslice.dts diff --git a/sys/boot/fdt/dts/arm/ts7800.dts b/sys/dts/arm/ts7800.dts similarity index 100% rename from sys/boot/fdt/dts/arm/ts7800.dts rename to sys/dts/arm/ts7800.dts diff --git a/sys/boot/fdt/dts/arm/ufw.dts b/sys/dts/arm/ufw.dts similarity index 100% rename from sys/boot/fdt/dts/arm/ufw.dts rename to sys/dts/arm/ufw.dts diff --git a/sys/boot/fdt/dts/arm/versatilepb.dts b/sys/dts/arm/versatilepb.dts similarity index 100% rename from sys/boot/fdt/dts/arm/versatilepb.dts rename to sys/dts/arm/versatilepb.dts diff --git a/sys/boot/fdt/dts/arm/vsatv102-m6.dts b/sys/dts/arm/vsatv102-m6.dts similarity index 100% rename from sys/boot/fdt/dts/arm/vsatv102-m6.dts rename to sys/dts/arm/vsatv102-m6.dts diff --git a/sys/boot/fdt/dts/arm/vybrid-colibri-vf50.dts b/sys/dts/arm/vybrid-colibri-vf50.dts similarity index 100% rename from sys/boot/fdt/dts/arm/vybrid-colibri-vf50.dts rename to sys/dts/arm/vybrid-colibri-vf50.dts diff --git a/sys/boot/fdt/dts/arm/vybrid-cosmic.dts b/sys/dts/arm/vybrid-cosmic.dts similarity index 100% rename from sys/boot/fdt/dts/arm/vybrid-cosmic.dts rename to sys/dts/arm/vybrid-cosmic.dts diff --git a/sys/boot/fdt/dts/arm/vybrid-quartz.dts b/sys/dts/arm/vybrid-quartz.dts similarity index 100% rename from sys/boot/fdt/dts/arm/vybrid-quartz.dts rename to sys/dts/arm/vybrid-quartz.dts diff --git a/sys/boot/fdt/dts/arm/vybrid.dtsi b/sys/dts/arm/vybrid.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/vybrid.dtsi rename to sys/dts/arm/vybrid.dtsi diff --git a/sys/boot/fdt/dts/arm/wandboard-dual.dts b/sys/dts/arm/wandboard-dual.dts similarity index 100% rename from sys/boot/fdt/dts/arm/wandboard-dual.dts rename to sys/dts/arm/wandboard-dual.dts diff --git a/sys/boot/fdt/dts/arm/wandboard-quad.dts b/sys/dts/arm/wandboard-quad.dts similarity index 100% rename from sys/boot/fdt/dts/arm/wandboard-quad.dts rename to sys/dts/arm/wandboard-quad.dts diff --git a/sys/boot/fdt/dts/arm/wandboard-solo.dts b/sys/dts/arm/wandboard-solo.dts similarity index 100% rename from sys/boot/fdt/dts/arm/wandboard-solo.dts rename to sys/dts/arm/wandboard-solo.dts diff --git a/sys/boot/fdt/dts/arm/wzr2-g300n.dts b/sys/dts/arm/wzr2-g300n.dts similarity index 100% rename from sys/boot/fdt/dts/arm/wzr2-g300n.dts rename to sys/dts/arm/wzr2-g300n.dts diff --git a/sys/boot/fdt/dts/arm/xpowers-axp209.dtsi b/sys/dts/arm/xpowers-axp209.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/xpowers-axp209.dtsi rename to sys/dts/arm/xpowers-axp209.dtsi diff --git a/sys/boot/fdt/dts/arm/yyhd18-m3.dts b/sys/dts/arm/yyhd18-m3.dts similarity index 100% rename from sys/boot/fdt/dts/arm/yyhd18-m3.dts rename to sys/dts/arm/yyhd18-m3.dts diff --git a/sys/boot/fdt/dts/arm/zedboard.dts b/sys/dts/arm/zedboard.dts similarity index 100% rename from sys/boot/fdt/dts/arm/zedboard.dts rename to sys/dts/arm/zedboard.dts diff --git a/sys/boot/fdt/dts/arm/zybo.dts b/sys/dts/arm/zybo.dts similarity index 100% rename from sys/boot/fdt/dts/arm/zybo.dts rename to sys/dts/arm/zybo.dts diff --git a/sys/boot/fdt/dts/arm/zynq-7000.dtsi b/sys/dts/arm/zynq-7000.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm/zynq-7000.dtsi rename to sys/dts/arm/zynq-7000.dtsi diff --git a/sys/boot/fdt/dts/arm64/Makefile b/sys/dts/arm64/Makefile similarity index 100% rename from sys/boot/fdt/dts/arm64/Makefile rename to sys/dts/arm64/Makefile diff --git a/sys/boot/fdt/dts/arm64/a64.dtsi b/sys/dts/arm64/a64.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm64/a64.dtsi rename to sys/dts/arm64/a64.dtsi diff --git a/sys/boot/fdt/dts/arm64/pine64_plus.dts b/sys/dts/arm64/pine64_plus.dts similarity index 100% rename from sys/boot/fdt/dts/arm64/pine64_plus.dts rename to sys/dts/arm64/pine64_plus.dts diff --git a/sys/boot/fdt/dts/arm64/sun50i-a64-pine64-common.dtsi b/sys/dts/arm64/sun50i-a64-pine64-common.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm64/sun50i-a64-pine64-common.dtsi rename to sys/dts/arm64/sun50i-a64-pine64-common.dtsi diff --git a/sys/boot/fdt/dts/arm64/sun50i-a64-pine64-plus.dts b/sys/dts/arm64/sun50i-a64-pine64-plus.dts similarity index 100% rename from sys/boot/fdt/dts/arm64/sun50i-a64-pine64-plus.dts rename to sys/dts/arm64/sun50i-a64-pine64-plus.dts diff --git a/sys/boot/fdt/dts/arm64/sun50i-a64-pine64.dts b/sys/dts/arm64/sun50i-a64-pine64.dts similarity index 100% rename from sys/boot/fdt/dts/arm64/sun50i-a64-pine64.dts rename to sys/dts/arm64/sun50i-a64-pine64.dts diff --git a/sys/boot/fdt/dts/arm64/sun50i-a64.dtsi b/sys/dts/arm64/sun50i-a64.dtsi similarity index 100% rename from sys/boot/fdt/dts/arm64/sun50i-a64.dtsi rename to sys/dts/arm64/sun50i-a64.dtsi diff --git a/sys/boot/fdt/dts/bindings-gpio.txt b/sys/dts/bindings-gpio.txt similarity index 100% rename from sys/boot/fdt/dts/bindings-gpio.txt rename to sys/dts/bindings-gpio.txt diff --git a/sys/boot/fdt/dts/bindings-localbus.txt b/sys/dts/bindings-localbus.txt similarity index 100% rename from sys/boot/fdt/dts/bindings-localbus.txt rename to sys/dts/bindings-localbus.txt diff --git a/sys/boot/fdt/dts/bindings-mpp.txt b/sys/dts/bindings-mpp.txt similarity index 100% rename from sys/boot/fdt/dts/bindings-mpp.txt rename to sys/dts/bindings-mpp.txt diff --git a/sys/boot/fdt/dts/mips/Makefile b/sys/dts/mips/Makefile similarity index 100% rename from sys/boot/fdt/dts/mips/Makefile rename to sys/dts/mips/Makefile diff --git a/sys/boot/fdt/dts/mips/beri-netfpga.dts b/sys/dts/mips/beri-netfpga.dts similarity index 100% rename from sys/boot/fdt/dts/mips/beri-netfpga.dts rename to sys/dts/mips/beri-netfpga.dts diff --git a/sys/boot/fdt/dts/mips/beri-sim.dts b/sys/dts/mips/beri-sim.dts similarity index 100% rename from sys/boot/fdt/dts/mips/beri-sim.dts rename to sys/dts/mips/beri-sim.dts diff --git a/sys/boot/fdt/dts/mips/beripad-de4.dts b/sys/dts/mips/beripad-de4.dts similarity index 100% rename from sys/boot/fdt/dts/mips/beripad-de4.dts rename to sys/dts/mips/beripad-de4.dts diff --git a/sys/boot/fdt/dts/mips/beripad-sockit.dts b/sys/dts/mips/beripad-sockit.dts similarity index 100% rename from sys/boot/fdt/dts/mips/beripad-sockit.dts rename to sys/dts/mips/beripad-sockit.dts diff --git a/sys/boot/fdt/dts/mips/fbsd-mt7620a.dtsi b/sys/dts/mips/fbsd-mt7620a.dtsi similarity index 100% rename from sys/boot/fdt/dts/mips/fbsd-mt7620a.dtsi rename to sys/dts/mips/fbsd-mt7620a.dtsi diff --git a/sys/boot/fdt/dts/mips/fbsd-mt7621.dtsi b/sys/dts/mips/fbsd-mt7621.dtsi similarity index 100% rename from sys/boot/fdt/dts/mips/fbsd-mt7621.dtsi rename to sys/dts/mips/fbsd-mt7621.dtsi diff --git a/sys/boot/fdt/dts/mips/fbsd-mt7628an.dtsi b/sys/dts/mips/fbsd-mt7628an.dtsi similarity index 100% rename from sys/boot/fdt/dts/mips/fbsd-mt7628an.dtsi rename to sys/dts/mips/fbsd-mt7628an.dtsi diff --git a/sys/boot/fdt/dts/mips/fbsd-rt3883.dtsi b/sys/dts/mips/fbsd-rt3883.dtsi similarity index 100% rename from sys/boot/fdt/dts/mips/fbsd-rt3883.dtsi rename to sys/dts/mips/fbsd-rt3883.dtsi diff --git a/sys/boot/fdt/dts/mips/xlp-basic.dts b/sys/dts/mips/xlp-basic.dts similarity index 100% rename from sys/boot/fdt/dts/mips/xlp-basic.dts rename to sys/dts/mips/xlp-basic.dts diff --git a/sys/boot/fdt/dts/powerpc/Makefile b/sys/dts/powerpc/Makefile similarity index 100% rename from sys/boot/fdt/dts/powerpc/Makefile rename to sys/dts/powerpc/Makefile diff --git a/sys/boot/fdt/dts/powerpc/mpc8555cds.dts b/sys/dts/powerpc/mpc8555cds.dts similarity index 100% rename from sys/boot/fdt/dts/powerpc/mpc8555cds.dts rename to sys/dts/powerpc/mpc8555cds.dts diff --git a/sys/boot/fdt/dts/powerpc/mpc8572ds.dts b/sys/dts/powerpc/mpc8572ds.dts similarity index 100% rename from sys/boot/fdt/dts/powerpc/mpc8572ds.dts rename to sys/dts/powerpc/mpc8572ds.dts diff --git a/sys/boot/fdt/dts/powerpc/p1020rdb.dts b/sys/dts/powerpc/p1020rdb.dts similarity index 100% rename from sys/boot/fdt/dts/powerpc/p1020rdb.dts rename to sys/dts/powerpc/p1020rdb.dts diff --git a/sys/boot/fdt/dts/powerpc/p2020ds.dts b/sys/dts/powerpc/p2020ds.dts similarity index 100% rename from sys/boot/fdt/dts/powerpc/p2020ds.dts rename to sys/dts/powerpc/p2020ds.dts diff --git a/sys/boot/fdt/dts/powerpc/p2041rdb.dts b/sys/dts/powerpc/p2041rdb.dts similarity index 100% rename from sys/boot/fdt/dts/powerpc/p2041rdb.dts rename to sys/dts/powerpc/p2041rdb.dts diff --git a/sys/boot/fdt/dts/powerpc/p2041si.dtsi b/sys/dts/powerpc/p2041si.dtsi similarity index 100% rename from sys/boot/fdt/dts/powerpc/p2041si.dtsi rename to sys/dts/powerpc/p2041si.dtsi diff --git a/sys/boot/fdt/dts/powerpc/p3041ds.dts b/sys/dts/powerpc/p3041ds.dts similarity index 100% rename from sys/boot/fdt/dts/powerpc/p3041ds.dts rename to sys/dts/powerpc/p3041ds.dts diff --git a/sys/boot/fdt/dts/powerpc/p3041si.dtsi b/sys/dts/powerpc/p3041si.dtsi similarity index 100% rename from sys/boot/fdt/dts/powerpc/p3041si.dtsi rename to sys/dts/powerpc/p3041si.dtsi diff --git a/sys/boot/fdt/dts/powerpc/p5020ds.dts b/sys/dts/powerpc/p5020ds.dts similarity index 100% rename from sys/boot/fdt/dts/powerpc/p5020ds.dts rename to sys/dts/powerpc/p5020ds.dts diff --git a/sys/boot/fdt/dts/powerpc/p5020si.dtsi b/sys/dts/powerpc/p5020si.dtsi similarity index 100% rename from sys/boot/fdt/dts/powerpc/p5020si.dtsi rename to sys/dts/powerpc/p5020si.dtsi diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 7700e34f0372..69e501da278d 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -406,16 +406,15 @@ filt_procattach(struct knote *kn) bool exiting, immediate; exiting = immediate = false; - p = pfind(kn->kn_id); - if (p == NULL && (kn->kn_sfflags & NOTE_EXIT)) { - p = zpfind(kn->kn_id); - exiting = true; - } else if (p != NULL && (p->p_flag & P_WEXIT)) { - exiting = true; - } - + if (kn->kn_sfflags & NOTE_EXIT) + p = pfind_any(kn->kn_id); + else + p = pfind(kn->kn_id); if (p == NULL) return (ESRCH); + if (p->p_flag & P_WEXIT) + exiting = true; + if ((error = p_cansee(curthread, p))) { PROC_UNLOCK(p); return (error); diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 6eeb29556e71..6fdb6f6d6589 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -342,12 +342,34 @@ pfind(pid_t pid) { struct proc *p; + p = curproc; + if (p->p_pid == pid) { + PROC_LOCK(p); + return (p); + } sx_slock(&allproc_lock); p = pfind_locked(pid); sx_sunlock(&allproc_lock); return (p); } +/* + * Same as pfind but allow zombies. + */ +struct proc * +pfind_any(pid_t pid) +{ + struct proc *p; + + sx_slock(&allproc_lock); + p = pfind_locked(pid); + if (p == NULL) + p = zpfind_locked(pid); + sx_sunlock(&allproc_lock); + + return (p); +} + static struct proc * pfind_tid_locked(pid_t tid) { @@ -1369,16 +1391,12 @@ kern_proc_out(struct proc *p, struct sbuf *sb, int flags) } static int -sysctl_out_proc(struct proc *p, struct sysctl_req *req, int flags, - int doingzomb) +sysctl_out_proc(struct proc *p, struct sysctl_req *req, int flags) { struct sbuf sb; struct kinfo_proc ki; - struct proc *np; int error, error2; - pid_t pid; - pid = p->p_pid; sbuf_new_for_sysctl(&sb, (char *)&ki, sizeof(ki), req); sbuf_clear_flags(&sb, SBUF_INCLUDENUL); error = kern_proc_out(p, &sb, flags); @@ -1388,20 +1406,6 @@ sysctl_out_proc(struct proc *p, struct sysctl_req *req, int flags, return (error); else if (error2 != 0) return (error2); - if (doingzomb) - np = zpfind(pid); - else { - if (pid == 0) - return (0); - np = pfind(pid); - } - if (np == NULL) - return (ESRCH); - if (np != p) { - PROC_UNLOCK(np); - return (ESRCH); - } - PROC_UNLOCK(np); return (0); } @@ -1435,7 +1439,7 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) sx_slock(&proctree_lock); error = pget((pid_t)name[0], PGET_CANSEE, &p); if (error == 0) - error = sysctl_out_proc(p, req, flags, 0); + error = sysctl_out_proc(p, req, flags); sx_sunlock(&proctree_lock); return (error); } @@ -1566,7 +1570,7 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) } - error = sysctl_out_proc(p, req, flags, doingzomb); + error = sysctl_out_proc(p, req, flags); if (error) { sx_sunlock(&allproc_lock); sx_sunlock(&proctree_lock); @@ -1905,14 +1909,27 @@ sysctl_kern_proc_args(SYSCTL_HANDLER_ARGS) struct proc *p; struct sbuf sb; int flags, error = 0, error2; + pid_t pid; if (namelen != 1) return (EINVAL); + pid = (pid_t)name[0]; + /* + * If the query is for this process and it is single-threaded, there + * is nobody to modify pargs, thus we can just read. + */ + p = curproc; + if (pid == p->p_pid && p->p_numthreads == 1 && req->newptr == NULL) { + if ((pa = p->p_args) != NULL) + error = SYSCTL_OUT(req, pa->ar_args, pa->ar_length); + return (error); + } + flags = PGET_CANSEE; if (req->newptr != NULL) flags |= PGET_ISCURRENT; - error = pget((pid_t)name[0], flags, &p); + error = pget(pid, flags, &p); if (error) return (error); @@ -1939,7 +1956,7 @@ sysctl_kern_proc_args(SYSCTL_HANDLER_ARGS) if (error != 0 || req->newptr == NULL) return (error); - if (req->newlen + sizeof(struct pargs) > ps_arg_cache_limit) + if (req->newlen > ps_arg_cache_limit - sizeof(struct pargs)) return (ENOMEM); newpa = pargs_alloc(req->newlen); error = SYSCTL_IN(req, newpa->ar_args, req->newlen); diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c index 9f0b059280b9..ffe0e9ca8f39 100644 --- a/sys/kern/kern_rwlock.c +++ b/sys/kern/kern_rwlock.c @@ -929,9 +929,8 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, if ((v & RW_LOCK_READ) && RW_READERS(v) && spintries < rowner_retries) { if (!(v & RW_LOCK_WRITE_SPINNER)) { - if (!atomic_cmpset_ptr(&rw->rw_lock, v, + if (!atomic_fcmpset_ptr(&rw->rw_lock, &v, v | RW_LOCK_WRITE_SPINNER)) { - v = RW_READ_VALUE(rw); continue; } } diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 8f4a5c8b2200..a5def7f2f7e7 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -134,6 +134,14 @@ static int sync_on_panic = 0; SYSCTL_INT(_kern, OID_AUTO, sync_on_panic, CTLFLAG_RWTUN, &sync_on_panic, 0, "Do a sync before rebooting from a panic"); +static bool poweroff_on_panic = 0; +SYSCTL_BOOL(_kern, OID_AUTO, poweroff_on_panic, CTLFLAG_RWTUN, + &poweroff_on_panic, 0, "Do a power off instead of a reboot on a panic"); + +static bool powercycle_on_panic = 0; +SYSCTL_BOOL(_kern, OID_AUTO, powercycle_on_panic, CTLFLAG_RWTUN, + &powercycle_on_panic, 0, "Do a power cycle instead of a reboot on a panic"); + static SYSCTL_NODE(_kern, OID_AUTO, shutdown, CTLFLAG_RW, 0, "Shutdown environment"); @@ -797,6 +805,10 @@ vpanic(const char *fmt, va_list ap) /* thread_unlock(td); */ if (!sync_on_panic) bootopt |= RB_NOSYNC; + if (poweroff_on_panic) + bootopt |= RB_POWEROFF; + if (powercycle_on_panic) + bootopt |= RB_POWERCYCLE; kern_reboot(bootopt); } diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index ea3b68e370c6..ebbb404b8f82 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1765,10 +1765,8 @@ sys_kill(struct thread *td, struct kill_args *uap) if (uap->pid > 0) { /* kill single process */ - if ((p = pfind(uap->pid)) == NULL) { - if ((p = zpfind(uap->pid)) == NULL) - return (ESRCH); - } + if ((p = pfind_any(uap->pid)) == NULL) + return (ESRCH); AUDIT_ARG_PROCESS(p); error = p_cansignal(td, p, uap->signum); if (error == 0 && uap->signum) @@ -1872,10 +1870,8 @@ kern_sigqueue(struct thread *td, pid_t pid, int signum, union sigval *value) if (pid <= 0) return (EINVAL); - if ((p = pfind(pid)) == NULL) { - if ((p = zpfind(pid)) == NULL) - return (ESRCH); - } + if ((p = pfind_any(pid)) == NULL) + return (ESRCH); error = p_cansignal(td, p, signum); if (error == 0 && signum != 0) { ksiginfo_init(&ksi); diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 340549ff5749..ade226c5379e 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1209,17 +1209,21 @@ sysctl_sysctl_name2oid(SYSCTL_HANDLER_ARGS) int error, oid[CTL_MAXNAME], len = 0; struct sysctl_oid *op = NULL; struct rm_priotracker tracker; + char buf[32]; if (!req->newlen) return (ENOENT); if (req->newlen >= MAXPATHLEN) /* XXX arbitrary, undocumented */ return (ENAMETOOLONG); - p = malloc(req->newlen+1, M_SYSCTL, M_WAITOK); + p = buf; + if (req->newlen >= sizeof(buf)) + p = malloc(req->newlen+1, M_SYSCTL, M_WAITOK); error = SYSCTL_IN(req, p, req->newlen); if (error) { - free(p, M_SYSCTL); + if (p != buf) + free(p, M_SYSCTL); return (error); } @@ -1229,7 +1233,8 @@ sysctl_sysctl_name2oid(SYSCTL_HANDLER_ARGS) error = name2oid(p, oid, &len, &op); SYSCTL_RUNLOCK(&tracker); - free(p, M_SYSCTL); + if (p != buf) + free(p, M_SYSCTL); if (error) return (error); diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 92672438253a..1fe53e2819b2 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -408,7 +408,7 @@ kern_clock_settime(struct thread *td, clockid_t clock_id, struct timespec *ats) if (ats->tv_nsec < 0 || ats->tv_nsec >= 1000000000 || ats->tv_sec < 0) return (EINVAL); - if (!allow_insane_settime && ats->tv_sec > 9999ULL * 366 * 24 * 60 * 60) + if (!allow_insane_settime && ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60) return (EINVAL); /* XXX Don't convert nsec->usec and back */ TIMESPEC_TO_TIMEVAL(&atv, ats); diff --git a/sys/kern/p1003_1b.c b/sys/kern/p1003_1b.c index ac6cd60a5d6e..07049c7399a7 100644 --- a/sys/kern/p1003_1b.c +++ b/sys/kern/p1003_1b.c @@ -292,8 +292,8 @@ int sys_sched_yield(struct thread *td, struct sched_yield_args *uap) { - sched_relinquish(curthread); - return 0; + sched_relinquish(td); + return (0); } int diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 67aaff6389bc..9e6e1aa347b6 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -869,19 +869,13 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) } /* not currently stopped */ - if ((p->p_flag & (P_STOPPED_SIG | P_STOPPED_TRACE)) == 0 || + if ((p->p_flag & P_STOPPED_TRACE) == 0 || p->p_suspcount != p->p_numthreads || (p->p_flag & P_WAITED) == 0) { error = EBUSY; goto fail; } - if ((p->p_flag & P_STOPPED_TRACE) == 0) { - static int count = 0; - if (count++ == 0) - printf("P_STOPPED_TRACE not set.\n"); - } - /* OK */ break; } @@ -926,10 +920,27 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) if (p->p_pptr != td->td_proc) { proc_reparent(p, td->td_proc); } - data = SIGSTOP; CTR2(KTR_PTRACE, "PT_ATTACH: pid %d, oppid %d", p->p_pid, p->p_oppid); - goto sendsig; /* in PT_CONTINUE below */ + + sx_xunlock(&proctree_lock); + proctree_locked = 0; + MPASS(p->p_xthread == NULL); + MPASS((p->p_flag & P_STOPPED_TRACE) == 0); + + /* + * If already stopped due to a stop signal, clear the + * existing stop before triggering a traced SIGSTOP. + */ + if ((p->p_flag & P_STOPPED_SIG) != 0) { + PROC_SLOCK(p); + p->p_flag &= ~(P_STOPPED_SIG | P_WAITED); + thread_unsuspend(p); + PROC_SUNLOCK(p); + } + + kern_psignal(p, SIGSTOP); + break; case PT_CLEARSTEP: CTR2(KTR_PTRACE, "PT_CLEARSTEP: tid %d (pid %d)", td2->td_tid, @@ -1117,8 +1128,10 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) sigqueue_delete(&td3->td_sigqueue, SIGSTOP); } - td3->td_dbgflags &= ~(TDB_XSIG | TDB_FSTP); + td3->td_dbgflags &= ~(TDB_XSIG | TDB_FSTP | + TDB_SUSPEND); } + if ((p->p_flag2 & P2_PTRACE_FSTP) != 0) { sigqueue_delete(&p->p_sigqueue, SIGSTOP); p->p_flag2 &= ~P2_PTRACE_FSTP; @@ -1129,54 +1142,45 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) break; } + sx_xunlock(&proctree_lock); + proctree_locked = 0; + sendsig: - /* + MPASS(proctree_locked == 0); + + /* * Clear the pending event for the thread that just * reported its event (p_xthread). This may not be * the thread passed to PT_CONTINUE, PT_STEP, etc. if * the debugger is resuming a different thread. + * + * Deliver any pending signal via the reporting thread. */ - td2 = p->p_xthread; - if (proctree_locked) { - sx_xunlock(&proctree_lock); - proctree_locked = 0; - } - p->p_xsig = data; + MPASS(p->p_xthread != NULL); + p->p_xthread->td_dbgflags &= ~TDB_XSIG; + p->p_xthread->td_xsig = data; p->p_xthread = NULL; - if ((p->p_flag & (P_STOPPED_SIG | P_STOPPED_TRACE)) != 0) { - /* deliver or queue signal */ - td2->td_dbgflags &= ~TDB_XSIG; - td2->td_xsig = data; + p->p_xsig = data; - /* - * P_WKILLED is insurance that a PT_KILL/SIGKILL always - * works immediately, even if another thread is - * unsuspended first and attempts to handle a different - * signal or if the POSIX.1b style signal queue cannot - * accommodate any new signals. - */ - if (data == SIGKILL) - p->p_flag |= P_WKILLED; + /* + * P_WKILLED is insurance that a PT_KILL/SIGKILL + * always works immediately, even if another thread is + * unsuspended first and attempts to handle a + * different signal or if the POSIX.1b style signal + * queue cannot accommodate any new signals. + */ + if (data == SIGKILL) + p->p_flag |= P_WKILLED; - if (req == PT_DETACH) { - FOREACH_THREAD_IN_PROC(p, td3) - td3->td_dbgflags &= ~TDB_SUSPEND; - } - /* - * unsuspend all threads, to not let a thread run, - * you should use PT_SUSPEND to suspend it before - * continuing process. - */ - PROC_SLOCK(p); - p->p_flag &= ~(P_STOPPED_TRACE|P_STOPPED_SIG|P_WAITED); - thread_unsuspend(p); - PROC_SUNLOCK(p); - if (req == PT_ATTACH) - kern_psignal(p, data); - } else { - if (data) - kern_psignal(p, data); - } + /* + * Unsuspend all threads. To leave a thread + * suspended, use PT_SUSPEND to suspend it before + * continuing the process. + */ + PROC_SLOCK(p); + p->p_flag &= ~(P_STOPPED_TRACE | P_STOPPED_SIG | P_WAITED); + thread_unsuspend(p); + PROC_SUNLOCK(p); break; case PT_WRITE_I: diff --git a/sys/mips/beri/beri_machdep.c b/sys/mips/beri/beri_machdep.c index 2c153e47c798..3624b5843343 100644 --- a/sys/mips/beri/beri_machdep.c +++ b/sys/mips/beri/beri_machdep.c @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #ifdef FDT #include #include +#include #endif #include @@ -161,46 +162,6 @@ platform_reset(void) __asm__ __volatile("wait"); } -#ifdef FDT -/* Parse cmd line args as env - copied from xlp_machdep. */ -/* XXX-BZ this should really be centrally provided for all (boot) code. */ -static void -_parse_bootargs(char *cmdline) -{ - char *n, *v; - - while ((v = strsep(&cmdline, " \n")) != NULL) { - if (*v == '\0') - continue; - if (*v == '-') { - while (*v != '\0') { - v++; - switch (*v) { - case 'a': boothowto |= RB_ASKNAME; break; - /* Someone should simulate that ;-) */ - case 'C': boothowto |= RB_CDROM; break; - case 'd': boothowto |= RB_KDB; break; - case 'D': boothowto |= RB_MULTIPLE; break; - case 'm': boothowto |= RB_MUTE; break; - case 'g': boothowto |= RB_GDB; break; - case 'h': boothowto |= RB_SERIAL; break; - case 'p': boothowto |= RB_PAUSE; break; - case 'r': boothowto |= RB_DFLTROOT; break; - case 's': boothowto |= RB_SINGLE; break; - case 'v': boothowto |= RB_VERBOSE; break; - } - } - } else { - n = strsep(&v, "="); - if (v == NULL) - kern_setenv(n, "1"); - else - kern_setenv(n, v); - } - } -} -#endif - void platform_start(__register_t a0, __register_t a1, __register_t a2, __register_t a3) @@ -279,9 +240,7 @@ platform_start(__register_t a0, __register_t a1, __register_t a2, /* * Get bootargs from FDT if specified. */ - chosen = OF_finddevice("/chosen"); - if (OF_getprop(chosen, "bootargs", buf, sizeof(buf)) != -1) - _parse_bootargs(buf); + ofw_parse_bootargs(); #endif /* diff --git a/sys/modules/mlx4/Makefile b/sys/modules/mlx4/Makefile index 44ec725ee9ce..d71f79bde0e2 100644 --- a/sys/modules/mlx4/Makefile +++ b/sys/modules/mlx4/Makefile @@ -10,6 +10,7 @@ SRCS= device_if.h bus_if.h vnode_if.h pci_if.h \ mlx4_cq.c \ mlx4_eq.c \ mlx4_fw.c \ + mlx4_fw_qos.c \ mlx4_icm.c \ mlx4_intf.c \ mlx4_main.c \ @@ -22,8 +23,7 @@ SRCS= device_if.h bus_if.h vnode_if.h pci_if.h \ mlx4_reset.c \ mlx4_sense.c \ mlx4_srq.c \ - mlx4_resource_tracker.c \ - mlx4_sys_tune.c + mlx4_resource_tracker.c CFLAGS+= -I${SRCTOP}/sys/ofed/include CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/include @@ -31,5 +31,3 @@ CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/include .include CFLAGS+= -Wno-cast-qual -Wno-pointer-arith - -CWARNFLAGS.mlx4_mcg.c= -Wno-unused diff --git a/sys/modules/nvme/Makefile b/sys/modules/nvme/Makefile index b06d164de5c2..662fb4bd7010 100644 --- a/sys/modules/nvme/Makefile +++ b/sys/modules/nvme/Makefile @@ -18,6 +18,7 @@ SRCS = nvme.c \ bus_if.h \ device_if.h \ opt_cam.h \ + opt_nvme.h \ pci_if.h .include diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 17ae947f650f..c769ec621b81 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -633,6 +633,14 @@ sctp_handle_heartbeat_ack(struct sctp_heartbeat_chunk *cp, r_net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_4); sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, r_net); } + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { + sctp_misc_ints(SCTP_THRESHOLD_CLEAR, + stcb->asoc.overall_error_count, + 0, + SCTP_FROM_SCTP_INPUT, + __LINE__); + } + stcb->asoc.overall_error_count = 0; old_error_counter = r_net->error_count; r_net->error_count = 0; r_net->hb_responded = 1; @@ -2925,7 +2933,14 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *cp SCTP_UNUSED, return; } asoc = &stcb->asoc; - + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { + sctp_misc_ints(SCTP_THRESHOLD_CLEAR, + asoc->overall_error_count, + 0, + SCTP_FROM_SCTP_INPUT, + __LINE__); + } + asoc->overall_error_count = 0; sctp_stop_all_cookie_timers(stcb); /* process according to association state */ if (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED) { @@ -4509,7 +4524,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, char msg[SCTP_DIAG_INFO_LEN]; uint32_t vtag_in; int num_chunks = 0; /* number of control chunks processed */ - uint32_t chk_length; + uint32_t chk_length, contiguous; int ret; int abort_no_unlock = 0; int ecne_seen = 0; @@ -4718,14 +4733,6 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, (ch->chunk_type == SCTP_HEARTBEAT_REQUEST)) && (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { /* implied cookie-ack.. we must have lost the ack */ - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } - stcb->asoc.overall_error_count = 0; sctp_handle_cookie_ack((struct sctp_cookie_ack_chunk *)ch, stcb, *netp); } @@ -4743,58 +4750,30 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, } SCTP_STAT_INCR_COUNTER64(sctps_incontrolchunks); /* - * INIT-ACK only gets the init ack "header" portion only - * because we don't have to process the peer's COOKIE. All - * others get a complete chunk. + * INIT and INIT-ACK only gets the init ack "header" portion + * only because we don't have to process the peer's COOKIE. + * All others get a complete chunk. */ - if ((ch->chunk_type == SCTP_INITIATION_ACK) || - (ch->chunk_type == SCTP_INITIATION)) { - /* get an init-ack chunk */ - ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset, - sizeof(struct sctp_init_ack_chunk), chunk_buf); - if (ch == NULL) { - *offset = length; - if (stcb != NULL) { - SCTP_TCB_UNLOCK(stcb); - } - return (NULL); - } - } else { - /* For cookies and all other chunks. */ - if (chk_length > sizeof(chunk_buf)) { - /* - * use just the size of the chunk buffer so - * the front part of our chunks fit in - * contiguous space up to the chunk buffer - * size (508 bytes). For chunks that need to - * get more than that they must use the - * sctp_m_getptr() function or other means - * (e.g. know how to parse mbuf chains). - * Cookies do this already. - */ - ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset, - (sizeof(chunk_buf) - 4), - chunk_buf); - if (ch == NULL) { - *offset = length; - if (stcb != NULL) { - SCTP_TCB_UNLOCK(stcb); - } - return (NULL); - } - } else { - /* We can fit it all */ - ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset, - chk_length, chunk_buf); - if (ch == NULL) { - SCTP_PRINTF("sctp_process_control: Can't get the all data....\n"); - *offset = length; - if (stcb != NULL) { - SCTP_TCB_UNLOCK(stcb); - } - return (NULL); - } + switch (ch->chunk_type) { + case SCTP_INITIATION: + contiguous = sizeof(struct sctp_init_chunk); + break; + case SCTP_INITIATION_ACK: + contiguous = sizeof(struct sctp_init_ack_chunk); + break; + default: + contiguous = min(chk_length, sizeof(chunk_buf)); + break; + } + ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset, + contiguous, + chunk_buf); + if (ch == NULL) { + *offset = length; + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } + return (NULL); } num_chunks++; /* Save off the last place we got a control from */ @@ -4859,7 +4838,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, case SCTP_PAD_CHUNK: break; case SCTP_INITIATION_ACK: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_INIT-ACK\n"); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_INIT_ACK\n"); if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ if ((stcb != NULL) && (stcb->asoc.total_output_queue_size)) { @@ -4890,7 +4869,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, *offset = length; return (stcb); } - if ((netp) && (*netp)) { + if ((netp != NULL) && (*netp != NULL)) { ret = sctp_handle_init_ack(m, iphlen, *offset, src, dst, sh, (struct sctp_init_ack_chunk *)ch, @@ -4915,109 +4894,35 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, return (stcb); break; case SCTP_SELECTIVE_ACK: - { - struct sctp_sack_chunk *sack; - int abort_now = 0; - uint32_t a_rwnd, cum_ack; - uint16_t num_seg, num_dup; - uint8_t flags; - int offset_seg, offset_dup; - - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SACK\n"); - SCTP_STAT_INCR(sctps_recvsacks); - if (stcb == NULL) { - SCTPDBG(SCTP_DEBUG_INDATA1, "No stcb when processing SACK chunk\n"); - break; - } - if (chk_length < sizeof(struct sctp_sack_chunk)) { - SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size on SACK chunk, too small\n"); - break; - } - if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) { - /*- - * If we have sent a shutdown-ack, we will pay no - * attention to a sack sent in to us since - * we don't care anymore. - */ - break; - } - sack = (struct sctp_sack_chunk *)ch; - flags = ch->chunk_flags; - cum_ack = ntohl(sack->sack.cum_tsn_ack); - num_seg = ntohs(sack->sack.num_gap_ack_blks); - num_dup = ntohs(sack->sack.num_dup_tsns); - a_rwnd = (uint32_t)ntohl(sack->sack.a_rwnd); - if (sizeof(struct sctp_sack_chunk) + - num_seg * sizeof(struct sctp_gap_ack_block) + - num_dup * sizeof(uint32_t) != chk_length) { - SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size of SACK chunk\n"); - break; - } - offset_seg = *offset + sizeof(struct sctp_sack_chunk); - offset_dup = offset_seg + num_seg * sizeof(struct sctp_gap_ack_block); - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SACK process cum_ack:%x num_seg:%d a_rwnd:%d\n", - cum_ack, num_seg, a_rwnd); - stcb->asoc.seen_a_sack_this_pkt = 1; - if ((stcb->asoc.pr_sctp_cnt == 0) && - (num_seg == 0) && - SCTP_TSN_GE(cum_ack, stcb->asoc.last_acked_seq) && - (stcb->asoc.saw_sack_with_frags == 0) && - (stcb->asoc.saw_sack_with_nr_frags == 0) && - (!TAILQ_EMPTY(&stcb->asoc.sent_queue)) - ) { - /* - * We have a SIMPLE sack having no - * prior segments and data on sent - * queue to be acked.. Use the - * faster path sack processing. We - * also allow window update sacks - * with no missing segments to go - * this way too. - */ - sctp_express_handle_sack(stcb, cum_ack, a_rwnd, &abort_now, ecne_seen); - } else { - if (netp && *netp) - sctp_handle_sack(m, offset_seg, offset_dup, stcb, - num_seg, 0, num_dup, &abort_now, flags, - cum_ack, a_rwnd, ecne_seen); - } - if (abort_now) { - /* ABORT signal from sack processing */ - *offset = length; - return (NULL); - } - if (TAILQ_EMPTY(&stcb->asoc.send_queue) && - TAILQ_EMPTY(&stcb->asoc.sent_queue) && - (stcb->asoc.stream_queue_cnt == 0)) { - sctp_ulp_notify(SCTP_NOTIFY_SENDER_DRY, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); - } - } - break; - /* - * EY - nr_sack: If the received chunk is an - * nr_sack chunk - */ case SCTP_NR_SELECTIVE_ACK: { - struct sctp_nr_sack_chunk *nr_sack; int abort_now = 0; uint32_t a_rwnd, cum_ack; uint16_t num_seg, num_nr_seg, num_dup; uint8_t flags; int offset_seg, offset_dup; - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_NR_SACK\n"); + SCTPDBG(SCTP_DEBUG_INPUT3, "%s\n", + ch->chunk_type == SCTP_SELECTIVE_ACK ? "SCTP_SACK" : "SCTP_NR_SACK"); SCTP_STAT_INCR(sctps_recvsacks); if (stcb == NULL) { - SCTPDBG(SCTP_DEBUG_INDATA1, "No stcb when processing NR-SACK chunk\n"); + SCTPDBG(SCTP_DEBUG_INDATA1, "No stcb when processing %s chunk\n", + (ch->chunk_type == SCTP_SELECTIVE_ACK) ? "SCTP_SACK" : "SCTP_NR_SACK"); break; } - if (stcb->asoc.nrsack_supported == 0) { - goto unknown_chunk; - } - if (chk_length < sizeof(struct sctp_nr_sack_chunk)) { - SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size on NR-SACK chunk, too small\n"); - break; + if (ch->chunk_type == SCTP_SELECTIVE_ACK) { + if (chk_length < sizeof(struct sctp_sack_chunk)) { + SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size on SACK chunk, too small\n"); + break; + } + } else { + if (stcb->asoc.nrsack_supported == 0) { + goto unknown_chunk; + } + if (chk_length < sizeof(struct sctp_nr_sack_chunk)) { + SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size on NR_SACK chunk, too small\n"); + break; + } } if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) { /*- @@ -5027,22 +4932,44 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, */ break; } - nr_sack = (struct sctp_nr_sack_chunk *)ch; flags = ch->chunk_flags; - cum_ack = ntohl(nr_sack->nr_sack.cum_tsn_ack); - num_seg = ntohs(nr_sack->nr_sack.num_gap_ack_blks); - num_nr_seg = ntohs(nr_sack->nr_sack.num_nr_gap_ack_blks); - num_dup = ntohs(nr_sack->nr_sack.num_dup_tsns); - a_rwnd = (uint32_t)ntohl(nr_sack->nr_sack.a_rwnd); - if (sizeof(struct sctp_nr_sack_chunk) + - (num_seg + num_nr_seg) * sizeof(struct sctp_gap_ack_block) + - num_dup * sizeof(uint32_t) != chk_length) { - SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size of NR_SACK chunk\n"); - break; + if (ch->chunk_type == SCTP_SELECTIVE_ACK) { + struct sctp_sack_chunk *sack; + + sack = (struct sctp_sack_chunk *)ch; + cum_ack = ntohl(sack->sack.cum_tsn_ack); + num_seg = ntohs(sack->sack.num_gap_ack_blks); + num_nr_seg = 0; + num_dup = ntohs(sack->sack.num_dup_tsns); + a_rwnd = ntohl(sack->sack.a_rwnd); + if (sizeof(struct sctp_sack_chunk) + + num_seg * sizeof(struct sctp_gap_ack_block) + + num_dup * sizeof(uint32_t) != chk_length) { + SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size of SACK chunk\n"); + break; + } + offset_seg = *offset + sizeof(struct sctp_sack_chunk); + offset_dup = offset_seg + num_seg * sizeof(struct sctp_gap_ack_block); + } else { + struct sctp_nr_sack_chunk *nr_sack; + + nr_sack = (struct sctp_nr_sack_chunk *)ch; + cum_ack = ntohl(nr_sack->nr_sack.cum_tsn_ack); + num_seg = ntohs(nr_sack->nr_sack.num_gap_ack_blks); + num_nr_seg = ntohs(nr_sack->nr_sack.num_nr_gap_ack_blks); + num_dup = ntohs(nr_sack->nr_sack.num_dup_tsns); + a_rwnd = ntohl(nr_sack->nr_sack.a_rwnd); + if (sizeof(struct sctp_nr_sack_chunk) + + (num_seg + num_nr_seg) * sizeof(struct sctp_gap_ack_block) + + num_dup * sizeof(uint32_t) != chk_length) { + SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size of NR_SACK chunk\n"); + break; + } + offset_seg = *offset + sizeof(struct sctp_nr_sack_chunk); + offset_dup = offset_seg + (num_seg + num_nr_seg) * sizeof(struct sctp_gap_ack_block); } - offset_seg = *offset + sizeof(struct sctp_nr_sack_chunk); - offset_dup = offset_seg + num_seg * sizeof(struct sctp_gap_ack_block); - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_NR_SACK process cum_ack:%x num_seg:%d a_rwnd:%d\n", + SCTPDBG(SCTP_DEBUG_INPUT3, "%s process cum_ack:%x num_seg:%d a_rwnd:%d\n", + (ch->chunk_type == SCTP_SELECTIVE_ACK) ? "SCTP_SACK" : "SCTP_NR_SACK", cum_ack, num_seg, a_rwnd); stcb->asoc.seen_a_sack_this_pkt = 1; if ((stcb->asoc.pr_sctp_cnt == 0) && @@ -5063,10 +4990,11 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, sctp_express_handle_sack(stcb, cum_ack, a_rwnd, &abort_now, ecne_seen); } else { - if (netp && *netp) + if ((netp != NULL) && (*netp != NULL)) { sctp_handle_sack(m, offset_seg, offset_dup, stcb, num_seg, num_nr_seg, num_dup, &abort_now, flags, cum_ack, a_rwnd, ecne_seen); + } } if (abort_now) { /* ABORT signal from sack processing */ @@ -5078,47 +5006,28 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, (stcb->asoc.stream_queue_cnt == 0)) { sctp_ulp_notify(SCTP_NOTIFY_SENDER_DRY, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); } + break; } - break; - case SCTP_HEARTBEAT_REQUEST: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_HEARTBEAT\n"); - if ((stcb) && netp && *netp) { + if ((stcb != NULL) && (netp != NULL) && (*netp != NULL)) { SCTP_STAT_INCR(sctps_recvheartbeat); sctp_send_heartbeat_ack(stcb, m, *offset, chk_length, *netp); - - /* He's alive so give him credit */ - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } - stcb->asoc.overall_error_count = 0; } break; case SCTP_HEARTBEAT_ACK: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_HEARTBEAT-ACK\n"); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_HEARTBEAT_ACK\n"); if ((stcb == NULL) || (chk_length != sizeof(struct sctp_heartbeat_chunk))) { /* Its not ours */ *offset = length; return (stcb); } - /* He's alive so give him credit */ - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } - stcb->asoc.overall_error_count = 0; SCTP_STAT_INCR(sctps_recvheartbeatack); - if (netp && *netp) + if ((netp != NULL) && (*netp != NULL)) { sctp_handle_heartbeat_ack((struct sctp_heartbeat_chunk *)ch, stcb, *netp); + } break; case SCTP_ABORT_ASSOCIATION: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ABORT, stcb %p\n", @@ -5141,7 +5050,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, *offset = length; return (stcb); } - if (netp && *netp) { + if ((netp != NULL) && (*netp != NULL)) { int abort_flag = 0; sctp_handle_shutdown((struct sctp_shutdown_chunk *)ch, @@ -5153,24 +5062,25 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, } break; case SCTP_SHUTDOWN_ACK: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN-ACK, stcb %p\n", (void *)stcb); - if ((stcb) && (netp) && (*netp)) + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN_ACK, stcb %p\n", (void *)stcb); + if ((stcb != NULL) && (netp != NULL) && (*netp != NULL)) { sctp_handle_shutdown_ack((struct sctp_shutdown_ack_chunk *)ch, stcb, *netp); + } *offset = length; return (NULL); break; - case SCTP_OPERATION_ERROR: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_OP-ERR\n"); - if ((stcb) && netp && *netp && sctp_handle_error(ch, stcb, *netp) < 0) { + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_OP_ERR\n"); + if ((stcb != NULL) && (netp != NULL) && (*netp != NULL) && + sctp_handle_error(ch, stcb, *netp) < 0) { *offset = length; return (NULL); } break; case SCTP_COOKIE_ECHO: SCTPDBG(SCTP_DEBUG_INPUT3, - "SCTP_COOKIE-ECHO, stcb %p\n", (void *)stcb); - if ((stcb) && (stcb->asoc.total_output_queue_size)) { + "SCTP_COOKIE_ECHO, stcb %p\n", (void *)stcb); + if ((stcb != NULL) && (stcb->asoc.total_output_queue_size > 0)) { ; } else { if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { @@ -5224,7 +5134,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, linp = inp; } - if (linp) { + if (linp != NULL) { SCTP_ASOC_CREATE_LOCK(linp); if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE)) { @@ -5232,7 +5142,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, goto abend; } } - if (netp) { + if (netp != NULL) { struct sctp_tcb *locked_stcb; locked_stcb = stcb; @@ -5260,7 +5170,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, } else { ret_buf = NULL; } - if (linp) { + if (linp != NULL) { SCTP_ASOC_CREATE_UNLOCK(linp); } if (ret_buf == NULL) { @@ -5290,7 +5200,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, } break; case SCTP_COOKIE_ACK: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_COOKIE-ACK, stcb %p\n", (void *)stcb); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_COOKIE_ACK, stcb %p\n", (void *)stcb); if ((stcb == NULL) || chk_length != sizeof(struct sctp_cookie_ack_chunk)) { return (stcb); } @@ -5316,75 +5226,43 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, return (NULL); } } - /* He's alive so give him credit */ - if ((stcb) && netp && *netp) { - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } - stcb->asoc.overall_error_count = 0; + if ((netp != NULL) && (*netp != NULL)) { sctp_handle_cookie_ack((struct sctp_cookie_ack_chunk *)ch, stcb, *netp); } break; case SCTP_ECN_ECHO: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ECN-ECHO\n"); - /* He's alive so give him credit */ + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ECN_ECHO\n"); if ((stcb == NULL) || (chk_length != sizeof(struct sctp_ecne_chunk))) { /* Its not ours */ *offset = length; return (stcb); } - if (stcb) { - if (stcb->asoc.ecn_supported == 0) { - goto unknown_chunk; - } - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } - stcb->asoc.overall_error_count = 0; - sctp_handle_ecn_echo((struct sctp_ecne_chunk *)ch, - stcb); - ecne_seen = 1; + if (stcb->asoc.ecn_supported == 0) { + goto unknown_chunk; } + sctp_handle_ecn_echo((struct sctp_ecne_chunk *)ch, stcb); + ecne_seen = 1; break; case SCTP_ECN_CWR: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ECN-CWR\n"); - /* He's alive so give him credit */ + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ECN_CWR\n"); if ((stcb == NULL) || (chk_length != sizeof(struct sctp_cwr_chunk))) { *offset = length; return (stcb); } - if (stcb) { - if (stcb->asoc.ecn_supported == 0) { - goto unknown_chunk; - } - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } - stcb->asoc.overall_error_count = 0; - sctp_handle_ecn_cwr((struct sctp_cwr_chunk *)ch, stcb, *netp); + if (stcb->asoc.ecn_supported == 0) { + goto unknown_chunk; } + sctp_handle_ecn_cwr((struct sctp_cwr_chunk *)ch, stcb, *netp); break; case SCTP_SHUTDOWN_COMPLETE: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN-COMPLETE, stcb %p\n", (void *)stcb); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN_COMPLETE, stcb %p\n", (void *)stcb); /* must be first and only chunk */ if ((num_chunks > 1) || (length - *offset > (int)SCTP_SIZE32(chk_length))) { *offset = length; return (stcb); } - if ((stcb) && netp && *netp) { + if ((stcb != NULL) && (netp != NULL) && (*netp != NULL)) { sctp_handle_shutdown_complete((struct sctp_shutdown_complete_chunk *)ch, stcb, *netp); } @@ -5393,32 +5271,23 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, break; case SCTP_ASCONF: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ASCONF\n"); - /* He's alive so give him credit */ - if (stcb) { + if (stcb != NULL) { if (stcb->asoc.asconf_supported == 0) { goto unknown_chunk; } - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } - stcb->asoc.overall_error_count = 0; sctp_handle_asconf(m, *offset, src, (struct sctp_asconf_chunk *)ch, stcb, asconf_cnt == 0); asconf_cnt++; } break; case SCTP_ASCONF_ACK: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ASCONF-ACK\n"); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ASCONF_ACK\n"); if (chk_length < sizeof(struct sctp_asconf_ack_chunk)) { /* Its not ours */ *offset = length; return (stcb); } - if ((stcb) && netp && *netp) { + if ((stcb != NULL) && (netp != NULL) && (*netp != NULL)) { if (stcb->asoc.asconf_supported == 0) { goto unknown_chunk; } @@ -5439,27 +5308,18 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, break; case SCTP_FORWARD_CUM_TSN: case SCTP_IFORWARD_CUM_TSN: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_FWD-TSN\n"); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_FWD_TSN\n"); if (chk_length < sizeof(struct sctp_forward_tsn_chunk)) { /* Its not ours */ *offset = length; return (stcb); } - /* He's alive so give him credit */ - if (stcb) { + if (stcb != NULL) { int abort_flag = 0; if (stcb->asoc.prsctp_supported == 0) { goto unknown_chunk; } - stcb->asoc.overall_error_count = 0; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } *fwd_tsn_seen = 1; if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ @@ -5489,17 +5349,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, if (abort_flag) { *offset = length; return (NULL); - } else { - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } - stcb->asoc.overall_error_count = 0; } - } break; case SCTP_STREAM_RESET: @@ -5526,13 +5376,13 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, *offset = length; return (stcb); } - if (ch && (stcb) && netp && (*netp)) { + if ((ch != NULL) && (stcb != NULL) && (netp != NULL) && (*netp != NULL)) { if (stcb->asoc.pktdrop_supported == 0) { goto unknown_chunk; } sctp_handle_packet_dropped((struct sctp_pktdrop_chunk *)ch, stcb, *netp, - min(chk_length, (sizeof(chunk_buf) - 4))); + min(chk_length, contiguous)); } break; case SCTP_AUTHENTICATION: @@ -5625,7 +5475,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, } } /* while */ - if (asconf_cnt > 0 && stcb != NULL) { + if ((asconf_cnt > 0) && (stcb != NULL)) { sctp_send_asconf_ack(stcb); } return (stcb); @@ -5903,14 +5753,6 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int lengt * shows us the cookie-ack was lost. Imply it was * there. */ - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } - stcb->asoc.overall_error_count = 0; sctp_handle_cookie_ack((struct sctp_cookie_ack_chunk *)ch, stcb, net); break; case SCTP_STATE_COOKIE_WAIT: diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 2afd3e7e0940..26fea1f1bfbb 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -523,12 +523,12 @@ tcp_output(struct tcpcb *tp) * XXXGL: should there be used sbused() or sbavail()? */ if (V_tcp_do_autosndbuf && so->so_snd.sb_flags & SB_AUTOSIZE) { - int autosndbuf_mod = 0; - if (V_tcp_sendbuf_auto_lowat) - autosndbuf_mod = so->so_snd.sb_lowat; + int lowat; - if ((tp->snd_wnd / 4 * 5) >= so->so_snd.sb_hiwat - autosndbuf_mod && - sbused(&so->so_snd) >= (so->so_snd.sb_hiwat / 8 * 7) - autosndbuf_mod && + lowat = V_tcp_sendbuf_auto_lowat ? so->so_snd.sb_lowat : 0; + if ((tp->snd_wnd / 4 * 5) >= so->so_snd.sb_hiwat - lowat && + sbused(&so->so_snd) >= + (so->so_snd.sb_hiwat / 8 * 7) - lowat && sbused(&so->so_snd) < V_tcp_autosndbuf_max && sendwin >= (sbused(&so->so_snd) - (tp->snd_nxt - tp->snd_una))) { diff --git a/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c b/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c index 397d5e8e827d..f9df880766d0 100644 --- a/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c +++ b/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c @@ -50,12 +50,30 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include +#include + #include #include #include +#include + #include "pcib_if.h" +struct fsl_pcib_softc { + /* + * This is here so that we can use pci bridge methods, too - the + * generic routines only need the dev, secbus and subbus members + * filled. + */ + struct pcib_softc ops_pcib_sc; + phandle_t ops_node; + struct ofw_bus_iinfo ops_iinfo; +}; + static int fsl_pcib_rc_probe(device_t dev) { @@ -72,13 +90,89 @@ fsl_pcib_rc_probe(device_t dev) return (BUS_PROBE_DEFAULT); } +static int +fsl_pcib_rc_attach(device_t dev) +{ + struct fsl_pcib_softc *sc; + + sc = device_get_softc(dev); + sc->ops_pcib_sc.dev = dev; + sc->ops_node = ofw_bus_get_node(dev); + + ofw_bus_setup_iinfo(sc->ops_node, &sc->ops_iinfo, + sizeof(cell_t)); + + pcib_attach_common(dev); + return (pcib_attach_child(dev)); +} + +static phandle_t +fsl_pcib_rc_get_node(device_t bridge, device_t dev) +{ + /* We have only one child, the PCI bus, so pass it our node */ + + return (ofw_bus_get_node(bridge)); +} + +static int +fsl_pcib_rc_route_interrupt(device_t bridge, device_t dev, int intpin) +{ + struct fsl_pcib_softc *sc; + struct ofw_bus_iinfo *ii; + struct ofw_pci_register reg; + cell_t pintr, mintr[2]; + int intrcells; + phandle_t iparent; + + sc = device_get_softc(bridge); + ii = &sc->ops_iinfo; + if (ii->opi_imapsz > 0) { + pintr = intpin; + + /* Fabricate imap information if this isn't an OFW device */ + bzero(®, sizeof(reg)); + reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) | + (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | + (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); + + intrcells = ofw_bus_lookup_imap(ofw_bus_get_node(dev), ii, ®, + sizeof(reg), &pintr, sizeof(pintr), mintr, sizeof(mintr), + &iparent); + if (intrcells) { + /* + * If we've found a mapping, return it and don't map + * it again on higher levels - that causes problems + * in some cases, and never seems to be required. + */ + mintr[0] = ofw_bus_map_intr(dev, iparent, intrcells, + mintr); + return (mintr[0]); + } + } else if (intpin >= 1 && intpin <= 4) { + /* + * When an interrupt map is missing, we need to do the + * standard PCI swizzle and continue mapping at the parent. + */ + return (pcib_route_interrupt(bridge, dev, intpin)); + } + return (PCIB_ROUTE_INTERRUPT(device_get_parent(device_get_parent( + bridge)), bridge, intpin)); +} + static device_method_t fsl_pcib_rc_methods[] = { DEVMETHOD(device_probe, fsl_pcib_rc_probe), + DEVMETHOD(device_attach, fsl_pcib_rc_attach), + + /* pcib interface */ + DEVMETHOD(pcib_route_interrupt, fsl_pcib_rc_route_interrupt), + DEVMETHOD(pcib_request_feature, pcib_request_feature_allow), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, fsl_pcib_rc_get_node), DEVMETHOD_END }; static devclass_t fsl_pcib_rc_devclass; DEFINE_CLASS_1(pcib, fsl_pcib_rc_driver, fsl_pcib_rc_methods, - sizeof(struct pcib_softc), pcib_driver); + sizeof(struct fsl_pcib_softc), pcib_driver); DRIVER_MODULE(rcpcib, pci, fsl_pcib_rc_driver, fsl_pcib_rc_devclass, 0, 0); - diff --git a/sys/sys/aio.h b/sys/sys/aio.h index 16a7aecbc956..520254eaf0b0 100644 --- a/sys/sys/aio.h +++ b/sys/sys/aio.h @@ -252,7 +252,7 @@ int aio_suspend(const struct aiocb * const[], int, const struct timespec *); */ int aio_mlock(struct aiocb *); -#ifdef __BSD_VISIBLE +#if __BSD_VISIBLE ssize_t aio_waitcomplete(struct aiocb **, struct timespec *); #endif diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 2daf1a6aee7d..7f455577f090 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -954,6 +954,7 @@ extern struct proc *initproc, *pageproc; /* Process slots for init, pager. */ extern struct uma_zone *proc_zone; struct proc *pfind(pid_t); /* Find process by id. */ +struct proc *pfind_any(pid_t); /* Find (zombie) process by id. */ struct proc *pfind_locked(pid_t pid); struct pgrp *pgfind(pid_t); /* Find process group by id. */ struct proc *zpfind(pid_t); /* Find zombie process by id. */ diff --git a/sys/sys/shm.h b/sys/sys/shm.h index 218be51a397a..8a2490c69686 100644 --- a/sys/sys/shm.h +++ b/sys/sys/shm.h @@ -159,7 +159,7 @@ typedef __size_t size_t; #endif __BEGIN_DECLS -#ifdef __BSD_VISIBLE +#if __BSD_VISIBLE int shmsys(int, ...); #endif void *shmat(int, const void *, int); diff --git a/sys/sys/umtx.h b/sys/sys/umtx.h index d2ff5acd0b74..dfd6be54000c 100644 --- a/sys/sys/umtx.h +++ b/sys/sys/umtx.h @@ -122,8 +122,12 @@ struct umtx_robust_lists_params { #ifndef _KERNEL +__BEGIN_DECLS + int _umtx_op(void *obj, int op, u_long val, void *uaddr, void *uaddr2); +__END_DECLS + #else /* diff --git a/sys/tools/fdt/make_dtb.sh b/sys/tools/fdt/make_dtb.sh index f2becbe6218d..1efd4d1732a1 100755 --- a/sys/tools/fdt/make_dtb.sh +++ b/sys/tools/fdt/make_dtb.sh @@ -21,6 +21,6 @@ fi for d in ${dts}; do dtb=${dtb_path}/`basename $d .dts`.dtb echo "converting $d -> $dtb" - cpp -P -x assembler-with-cpp -I $S/gnu/dts/include -I $S/boot/fdt/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $d /dev/null | - ${DTC} -@ -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts/${MACHINE} -i $S/gnu/dts/${MACHINE} + cpp -P -x assembler-with-cpp -I $S/gnu/dts/include -I $S/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $d /dev/null | + ${DTC} -@ -O dtb -o $dtb -b 0 -p 1024 -i $S/dts/${MACHINE} -i $S/gnu/dts/${MACHINE} done diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h index d327d1112f66..39d511330669 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -546,6 +546,62 @@ #define MSR_IA32_XSS 0xda0 +/* + * Intel Processor Trace (PT) MSRs. + */ +#define MSR_IA32_RTIT_OUTPUT_BASE 0x560 /* Trace Output Base Register (R/W) */ +#define MSR_IA32_RTIT_OUTPUT_MASK_PTRS 0x561 /* Trace Output Mask Pointers Register (R/W) */ +#define MSR_IA32_RTIT_CTL 0x570 /* Trace Control Register (R/W) */ +#define RTIT_CTL_TRACEEN (1 << 0) +#define RTIT_CTL_CYCEN (1 << 1) +#define RTIT_CTL_OS (1 << 2) +#define RTIT_CTL_USER (1 << 3) +#define RTIT_CTL_PWREVTEN (1 << 4) +#define RTIT_CTL_FUPONPTW (1 << 5) +#define RTIT_CTL_FABRICEN (1 << 6) +#define RTIT_CTL_CR3FILTER (1 << 7) +#define RTIT_CTL_TOPA (1 << 8) +#define RTIT_CTL_MTCEN (1 << 9) +#define RTIT_CTL_TSCEN (1 << 10) +#define RTIT_CTL_DISRETC (1 << 11) +#define RTIT_CTL_PTWEN (1 << 12) +#define RTIT_CTL_BRANCHEN (1 << 13) +#define RTIT_CTL_MTC_FREQ_S 14 +#define RTIT_CTL_MTC_FREQ(n) ((n) << RTIT_CTL_MTC_FREQ_S) +#define RTIT_CTL_MTC_FREQ_M (0xf << RTIT_CTL_MTC_FREQ_S) +#define RTIT_CTL_CYC_THRESH_S 19 +#define RTIT_CTL_CYC_THRESH_M (0xf << RTIT_CTL_CYC_THRESH_S) +#define RTIT_CTL_PSB_FREQ_S 24 +#define RTIT_CTL_PSB_FREQ_M (0xf << RTIT_CTL_PSB_FREQ_S) +#define RTIT_CTL_ADDR_CFG_S(n) (32 + (n) * 4) +#define RTIT_CTL_ADDR0_CFG_S 32 +#define RTIT_CTL_ADDR0_CFG_M (0xfULL << RTIT_CTL_ADDR0_CFG_S) +#define RTIT_CTL_ADDR1_CFG_S 36 +#define RTIT_CTL_ADDR1_CFG_M (0xfULL << RTIT_CTL_ADDR1_CFG_S) +#define RTIT_CTL_ADDR2_CFG_S 40 +#define RTIT_CTL_ADDR2_CFG_M (0xfULL << RTIT_CTL_ADDR2_CFG_S) +#define RTIT_CTL_ADDR3_CFG_S 44 +#define RTIT_CTL_ADDR3_CFG_M (0xfULL << RTIT_CTL_ADDR3_CFG_S) +#define MSR_IA32_RTIT_STATUS 0x571 /* Tracing Status Register (R/W) */ +#define RTIT_STATUS_FILTEREN (1 << 0) +#define RTIT_STATUS_CONTEXTEN (1 << 1) +#define RTIT_STATUS_TRIGGEREN (1 << 2) +#define RTIT_STATUS_ERROR (1 << 4) +#define RTIT_STATUS_STOPPED (1 << 5) +#define RTIT_STATUS_PACKETBYTECNT_S 32 +#define RTIT_STATUS_PACKETBYTECNT_M (0x1ffffULL << RTIT_STATUS_PACKETBYTECNT_S) +#define MSR_IA32_RTIT_CR3_MATCH 0x572 /* Trace Filter CR3 Match Register (R/W) */ +#define MSR_IA32_RTIT_ADDR_A(n) (0x580 + (n) * 2) +#define MSR_IA32_RTIT_ADDR_B(n) (0x581 + (n) * 2) +#define MSR_IA32_RTIT_ADDR0_A 0x580 /* Region 0 Start Address (R/W) */ +#define MSR_IA32_RTIT_ADDR0_B 0x581 /* Region 0 End Address (R/W) */ +#define MSR_IA32_RTIT_ADDR1_A 0x582 /* Region 1 Start Address (R/W) */ +#define MSR_IA32_RTIT_ADDR1_B 0x583 /* Region 1 End Address (R/W) */ +#define MSR_IA32_RTIT_ADDR2_A 0x584 /* Region 2 Start Address (R/W) */ +#define MSR_IA32_RTIT_ADDR2_B 0x585 /* Region 2 End Address (R/W) */ +#define MSR_IA32_RTIT_ADDR3_A 0x586 /* Region 3 Start Address (R/W) */ +#define MSR_IA32_RTIT_ADDR3_B 0x587 /* Region 3 End Address (R/W) */ + /* * Constants related to MSR's. */ diff --git a/targets/pseudo/userland/Makefile.depend b/targets/pseudo/userland/Makefile.depend index 73d46e2759fb..2e33b1705198 100644 --- a/targets/pseudo/userland/Makefile.depend +++ b/targets/pseudo/userland/Makefile.depend @@ -48,7 +48,6 @@ DIRDEPS+= \ sbin/adjkerntz \ sbin/atacontrol \ sbin/atm/atmconfig \ - sbin/badsect \ sbin/camcontrol \ sbin/ccdconfig \ sbin/clri \ @@ -686,13 +685,6 @@ DIRDEPS+= \ usr.sbin/pciconf \ usr.sbin/periodic \ usr.sbin/pkg \ - usr.sbin/pkg_install/add \ - usr.sbin/pkg_install/create \ - usr.sbin/pkg_install/delete \ - usr.sbin/pkg_install/info \ - usr.sbin/pkg_install/lib \ - usr.sbin/pkg_install/updating \ - usr.sbin/pkg_install/version \ usr.sbin/pmcannotate \ usr.sbin/pmccontrol \ usr.sbin/pmcstat \ diff --git a/targets/pseudo/userland/lib/Makefile.depend b/targets/pseudo/userland/lib/Makefile.depend index 87d53d0ebc88..7911c85d2915 100644 --- a/targets/pseudo/userland/lib/Makefile.depend +++ b/targets/pseudo/userland/lib/Makefile.depend @@ -196,7 +196,7 @@ DIRDEPS+= \ .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ ${MACHINE_CPUARCH} == "powerpc" -DIRDEPS+= sys/boot/libsa32 +DIRDEPS+= stand/libsa32 .endif .if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mfilter} diff --git a/targets/pseudo/userland/misc/Makefile.depend b/targets/pseudo/userland/misc/Makefile.depend index 6d473ea1f88c..7b4700a5d201 100644 --- a/targets/pseudo/userland/misc/Makefile.depend +++ b/targets/pseudo/userland/misc/Makefile.depend @@ -6,12 +6,12 @@ .include .endif -_sys_boot_efi= sys/boot/efi/loader sys/boot/efi/boot1 +_sys_boot_efi= stand/efi/loader stand/efi/boot1 .if ${MK_FDT} != "no" -_sys_boot_fdt= sys/boot/fdt sys/boot/efi/fdt +_sys_boot_fdt= stand/fdt stand/efi/fdt .endif .if ${MK_ZFS} != "no" -_sys_boot_zfs= sys/boot/zfs +_sys_boot_zfs= stand/zfs .endif DIRDEPS = \ @@ -22,40 +22,40 @@ DIRDEPS = \ rescue/rescue \ .if ${MK_BOOT} != "no" -DIRDEPS+= sys/boot/common +DIRDEPS+= stand/common .if ${MK_FORTH} != "no" DIRDEPS+= \ - sys/boot/ficl \ - sys/boot/forth \ + stand/ficl \ + stand/forth \ .endif DIRDEPS.x86sys= \ - sys/boot/efi/libefi \ - sys/boot/geli \ - sys/boot/i386/boot0 \ - sys/boot/i386/boot0sio \ - sys/boot/i386/boot2 \ - sys/boot/i386/btx/btx \ - sys/boot/i386/btx/btxldr \ - sys/boot/i386/btx/lib \ - sys/boot/i386/cdboot \ - sys/boot/i386/gptboot \ - sys/boot/i386/libfirewire \ - sys/boot/i386/libi386 \ - sys/boot/i386/loader \ - sys/boot/i386/mbr \ - sys/boot/i386/pmbr \ - sys/boot/i386/pxeldr \ - sys/boot/libsa32 \ + stand/efi/libefi \ + stand/geli \ + stand/i386/boot0 \ + stand/i386/boot0sio \ + stand/i386/boot2 \ + stand/i386/btx/btx \ + stand/i386/btx/btxldr \ + stand/i386/btx/lib \ + stand/i386/cdboot \ + stand/i386/gptboot \ + stand/i386/libfirewire \ + stand/i386/libi386 \ + stand/i386/loader \ + stand/i386/mbr \ + stand/i386/pmbr \ + stand/i386/pxeldr \ + stand/libsa32 \ ${_sys_boot_zfs} \ .if ${MK_ZFS} != "no" DIRDEPS.x86sys+= \ - sys/boot/i386/gptzfsboot \ - sys/boot/i386/zfsboot \ - sys/boot/i386/zfsloader \ + stand/i386/gptzfsboot \ + stand/i386/zfsboot \ + stand/i386/zfsloader \ DIRDEPS+= \ sbin/zfsbootcfg \ @@ -65,13 +65,13 @@ DIRDEPS+= \ DIRDEPS.amd64= \ ${DIRDEPS.x86sys} \ ${_sys_boot_efi} \ - sys/boot/ficl32 \ - sys/boot/userboot/test \ - sys/boot/userboot/userboot \ + stand/ficl32 \ + stand/userboot/test \ + stand/userboot/userboot \ .if ${MK_ZFS} != "no" DIRDEPS.amd64+= \ - sys/boot/zfs32 \ + stand/zfs32 \ .endif @@ -83,9 +83,9 @@ DIRDEPS+= \ DIRDEPS.arm= ${_sys_boot_fdt} ${_sys_boot_efi} DIRDEPS.arm64= ${_sys_boot_fdt} ${_sys_boot_efi} -DIRDEPS.i386= ${DIRDEPS.x86sys} ${_sys_boot_efi} sys/boot/i386/kgzldr -DIRDEPS.powerpc= ${_sys_boot_fdt} sys/boot/libsa32 sys/boot/ofw sys/boot/uboot -DIRDEPS.sparc64= sys/boot/ofw ${_sys_boot_zfs} +DIRDEPS.i386= ${DIRDEPS.x86sys} ${_sys_boot_efi} stand/i386/kgzldr +DIRDEPS.powerpc= ${_sys_boot_fdt} stand/libsa32 stand/ofw stand/uboot +DIRDEPS.sparc64= stand/ofw ${_sys_boot_zfs} .endif DIRDEPS+= ${DIRDEPS.${MACHINE}:U} diff --git a/targets/pseudo/userland/share/Makefile.depend b/targets/pseudo/userland/share/Makefile.depend index 3bac4b78d4a8..9946a8370552 100644 --- a/targets/pseudo/userland/share/Makefile.depend +++ b/targets/pseudo/userland/share/Makefile.depend @@ -91,7 +91,7 @@ DIRDEPS = \ share/xml/atf \ share/xsl/atf \ share/zoneinfo \ - sys/boot/man \ + stand/man \ .include diff --git a/tests/sys/aio/aio_kqueue_test.c b/tests/sys/aio/aio_kqueue_test.c index 1e98d78e9125..95f49a479996 100644 --- a/tests/sys/aio/aio_kqueue_test.c +++ b/tests/sys/aio/aio_kqueue_test.c @@ -51,28 +51,37 @@ #define PATH_TEMPLATE "aio.XXXXXXXXXX" -#define MAX_IOCBS 128 #define MAX_RUNS 300 /* #define DEBUG */ int main (int argc, char *argv[]) { - struct aiocb *iocb[MAX_IOCBS], *kq_iocb; + struct aiocb **iocb, *kq_iocb; char *file, pathname[sizeof(PATH_TEMPLATE)+1]; struct kevent ke, kq_returned; struct timespec ts; char buffer[32768]; + int max_queue_per_proc; + size_t max_queue_per_proc_size; #ifdef DEBUG int cancel, error; #endif int failed = 0, fd, kq, pending, result, run; int tmp_file = 0; - unsigned i, j; + int i, j; PLAIN_REQUIRE_KERNEL_MODULE("aio", 0); PLAIN_REQUIRE_UNSAFE_AIO(0); + max_queue_per_proc_size = sizeof(max_queue_per_proc); + if (sysctlbyname("vfs.aio.max_aio_queue_per_proc", + &max_queue_per_proc, &max_queue_per_proc_size, NULL, 0) != 0) + err(1, "sysctlbyname"); + iocb = calloc(max_queue_per_proc, sizeof(struct aiocb*)); + if (iocb == NULL) + err(1, "calloc"); + kq = kqueue(); if (kq < 0) { perror("No kqeueue\n"); @@ -95,7 +104,7 @@ main (int argc, char *argv[]) #ifdef DEBUG printf("Run %d\n", run); #endif - for (i = 0; i < nitems(iocb); i++) { + for (i = 0; i < max_queue_per_proc; i++) { iocb[i] = (struct aiocb *)calloc(1, sizeof(struct aiocb)); if (iocb[i] == NULL) @@ -103,7 +112,7 @@ main (int argc, char *argv[]) } pending = 0; - for (i = 0; i < nitems(iocb); i++) { + for (i = 0; i < max_queue_per_proc; i++) { pending++; iocb[i]->aio_nbytes = sizeof(buffer); iocb[i]->aio_buf = buffer; @@ -139,7 +148,7 @@ main (int argc, char *argv[]) } } #ifdef DEBUG - cancel = nitems(iocb) - pending; + cancel = max_queue_per_proc - pending; #endif i = 0; @@ -173,11 +182,11 @@ main (int argc, char *argv[]) break; #ifdef DEBUG printf("Try again left %d out of %lu %d\n", - pending, nitems(iocb), cancel); + pending, max_queue_per_proc, cancel); #endif } - for (j = 0; j < nitems(iocb) && iocb[j] != kq_iocb; + for (j = 0; j < max_queue_per_proc && iocb[j] != kq_iocb; j++) ; #ifdef DEBUG printf("kq_iocb %p\n", kq_iocb); @@ -204,7 +213,7 @@ main (int argc, char *argv[]) i++; } - for (i = 0; i < nitems(iocb); i++) + for (i = 0; i < max_queue_per_proc; i++) free(iocb[i]); } diff --git a/tests/sys/aio/lio_kqueue_test.c b/tests/sys/aio/lio_kqueue_test.c index fdbe72a3377b..3226573721c6 100644 --- a/tests/sys/aio/lio_kqueue_test.c +++ b/tests/sys/aio/lio_kqueue_test.c @@ -27,14 +27,7 @@ /* * Note: it is a good idea to run this against a physical drive to - * exercise the physio fast path (ie. lio_kqueue /dev/) - * This will ensure op's counting is correct. It is currently broken. - * - * Also note that LIO & kqueue is not implemented in FreeBSD yet, LIO - * is also broken with respect to op's and some paths. - * - * A patch to make this work is at: - * http://www.ambrisko.com/doug/listio_kqueue/listio_kqueue.patch + * exercise the physio fast path (ie. lio_kqueue_test /dev/) */ #include @@ -55,8 +48,8 @@ #define PATH_TEMPLATE "aio.XXXXXXXXXX" #define LIO_MAX 5 -#define IOCBS_PER_LIO 16 -#define MAX_IOCBS (LIO_MAX * IOCBS_PER_LIO) +#define MAX_IOCBS_PER_LIO 64 +#define MAX_IOCBS (LIO_MAX * MAX_IOCBS_PER_LIO) #define MAX_RUNS 300 int @@ -65,7 +58,9 @@ main(int argc, char *argv[]) int fd; struct aiocb *iocb[MAX_IOCBS]; struct aiocb **lio[LIO_MAX], **kq_lio; - int i, result, run, error, j, k; + int i, result, run, error, j, k, max_queue_per_proc; + int max_iocbs, iocbs_per_lio; + size_t max_queue_per_proc_size; char buffer[32768]; int kq; struct kevent ke, kq_returned; @@ -78,6 +73,13 @@ main(int argc, char *argv[]) PLAIN_REQUIRE_KERNEL_MODULE("aio", 0); PLAIN_REQUIRE_UNSAFE_AIO(0); + max_queue_per_proc_size = sizeof(max_queue_per_proc); + if (sysctlbyname("vfs.aio.max_aio_queue_per_proc", + &max_queue_per_proc, &max_queue_per_proc_size, NULL, 0) != 0) + err(1, "sysctlbyname"); + iocbs_per_lio = max_queue_per_proc / LIO_MAX; + max_iocbs = LIO_MAX * iocbs_per_lio; + kq = kqueue(); if (kq < 0) err(1, "kqeueue(2) failed"); @@ -104,9 +106,9 @@ main(int argc, char *argv[]) #endif for (j = 0; j < LIO_MAX; j++) { lio[j] = - malloc(sizeof(struct aiocb *) * IOCBS_PER_LIO); - for (i = 0; i < IOCBS_PER_LIO; i++) { - k = (IOCBS_PER_LIO * j) + i; + malloc(sizeof(struct aiocb *) * iocbs_per_lio); + for (i = 0; i < iocbs_per_lio; i++) { + k = (iocbs_per_lio * j) + i; lio[j][i] = iocb[k] = calloc(1, sizeof(struct aiocb)); iocb[k]->aio_nbytes = sizeof(buffer); @@ -116,8 +118,8 @@ main(int argc, char *argv[]) = iocb[k]->aio_nbytes * k * (run + 1); #ifdef DEBUG - printf("hello iocb[k] %ld\n", - iocb[k]->aio_offset); + printf("hello iocb[k] %jd\n", + (intmax_t)iocb[k]->aio_offset); #endif iocb[k]->aio_lio_opcode = LIO_WRITE; } @@ -126,12 +128,13 @@ main(int argc, char *argv[]) sig.sigev_notify = SIGEV_KEVENT; time(&time1); result = lio_listio(LIO_NOWAIT, lio[j], - IOCBS_PER_LIO, &sig); + iocbs_per_lio, &sig); error = errno; time(&time2); #ifdef DEBUG - printf("Time %ld %ld %ld result -> %d\n", - time1, time2, time2-time1, result); + printf("Time %jd %jd %jd result -> %d\n", + (intmax_t)time1, (intmax_t)time2, + (intmax_t)time2-time1, result); #endif if (result != 0) { errno = error; @@ -202,10 +205,10 @@ main(int argc, char *argv[]) failed++; } else printf("PASS: run %d, operation %d result %d \n", run, LIO_MAX - i -1, result); - for (k = 0; k < MAX_IOCBS / LIO_MAX; k++) { + for (k = 0; k < max_iocbs / LIO_MAX; k++) { result = aio_return(kq_lio[k]); #ifdef DEBUG - printf("Return Resulto for %d %d is %d\n", j, k, result); + printf("Return Result for %d %d is %d\n", j, k, result); #endif if (result != sizeof(buffer)) { printf("FAIL: run %d, operation %d sub-opt %d result %d (errno=%d) should be %zu\n", @@ -219,7 +222,7 @@ main(int argc, char *argv[]) printf("\n"); #endif - for (k = 0; k < MAX_IOCBS / LIO_MAX; k++) + for (k = 0; k < max_iocbs / LIO_MAX; k++) free(lio[j][k]); free(lio[j]); lio[j] = NULL; diff --git a/tools/boot/universe.sh b/tools/boot/universe.sh index fa11ad2dde7e..495e84b1ebaa 100755 --- a/tools/boot/universe.sh +++ b/tools/boot/universe.sh @@ -11,17 +11,38 @@ # powerpc/powerpc powerpc/powerpc64 powerpc/powerpcspe \ # riscv/riscv64 riscv/riscv64sf # -# This script is expected to be run in sys/boot (though you could run it anywhere -# in the tree). It does a full clean build. For sys/boot you can do all the archs in +# This script is expected to be run in stand (though you could run it anywhere +# in the tree). It does a full clean build. For stand you can do all the archs in # about a minute or two on a fast machine. It's also possible that you need a full # make universe for this to work completely. # # Output is put into _.boot.$TARGET_ARCH.log in sys.boot. # -top=$(make -V SRCTOP) -cd $top/sys/boot +dobuild() +{ + local ta=$1 + local lf=$2 + local opt=$3 + echo -n "Building $ta ${opt} ... " + if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make clean cleandepend cleandir obj depend" \ + > $lf 2>&1; then + echo "Fail (cleanup)" + continue + fi + if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make ${opt} -j 20 all" \ + >> $lf 2>&1; then + echo "Fail (build)" + continue + fi + echo "Success" +} + +top=$(make -V SRCTOP) +cd $top/stand + +# Default build for a goodly selection of architectures for i in \ amd64/amd64 \ arm/arm arm/armeb arm/armv7 \ @@ -32,34 +53,33 @@ for i in \ sparc64/sparc64 \ ; do ta=${i##*/} - echo -n "Building $ta..." - if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make clean cleandepend cleandir obj depend" \ - > _.boot.${ta}.log 2>&1; then - echo "Fail (cleanup)" - continue - fi - if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make -j 20 all" \ - >> _.boot.${ta}.log 2>&1; then - echo "Fail (build)" - continue - fi - echo "Success" + dobuild $ta _.boot.${ta}.log "" done + +# Build w/o ZFS +for i in \ + amd64/amd64 \ + i386/i386 \ + sparc64/sparc64 \ + ; do + ta=${i##*/} + dobuild $ta _.boot.${ta}.no_zfs.log "MK_ZFS=no" +done + +# Build with firewire for i in \ amd64/amd64 \ i386/i386 \ ; do ta=${i##*/} - echo -n "Building $ta MK_ZFS=no..." - if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make clean cleandepend cleandir obj depend" \ - > _.boot.${ta}.noZFS.log 2>&1; then - echo "Fail (cleanup)" - continue - fi - if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make MK_ZFS=no -j 20 all" \ - >> _.boot.${ta}.noZFS.log 2>&1; then - echo "Fail (build)" - continue - fi - echo "Success" + dobuild $ta _.boot.${ta}.firewire.log "MK_LOADER_FIREWIRE=yes" +done + +# Build without GELI +for i in \ + amd64/amd64 \ + i386/i386 \ + ; do + ta=${i##*/} + dobuild $ta _.boot.${ta}.no_geli.log "MK_LOADER_GELI=no" done diff --git a/tools/build/options/WITHOUT_LOADER_GELI b/tools/build/options/WITHOUT_LOADER_GELI new file mode 100644 index 000000000000..114bea6bfe0d --- /dev/null +++ b/tools/build/options/WITHOUT_LOADER_GELI @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Disable inclusion of GELI crypto support in the boot chain binaries. diff --git a/tools/build/options/WITH_LOADER_FIREWIRE b/tools/build/options/WITH_LOADER_FIREWIRE new file mode 100644 index 000000000000..a8f8924934b3 --- /dev/null +++ b/tools/build/options/WITH_LOADER_FIREWIRE @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Enable firewire support in /boot/loader and /boot/zfsloader on x86. +This option is a nop on all other platforms. diff --git a/tools/tools/bootparttest/Makefile b/tools/tools/bootparttest/Makefile index 026f83ea647d..7d54dfca0427 100644 --- a/tools/tools/bootparttest/Makefile +++ b/tools/tools/bootparttest/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${SRCTOP}/sys/boot/common +.PATH: ${SRCTOP}/stand/common BINDIR?= /usr/bin @@ -9,7 +9,7 @@ MAN= SRCS= bootparttest.c crc32.c stub.c part.c disk.c -CFLAGS= -I${SRCTOP}/sys/boot/common \ +CFLAGS= -I${SRCTOP}/stand/common \ -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -DPART_DEBUG \ -DDISK_DEBUG diff --git a/tools/tools/sysdoc/tunables.mdoc b/tools/tools/sysdoc/tunables.mdoc index d293b756b446..7dc2f8fa4e96 100644 --- a/tools/tools/sysdoc/tunables.mdoc +++ b/tools/tools/sysdoc/tunables.mdoc @@ -1034,6 +1034,20 @@ that the system is attempting to comply with. This is a read-only variable. +--- +kern.powercycle_on_panic +bool + +In the event of a panic, this variable controls whether or not the +system should try to power cycle instead of rebooting. + +--- +kern.poweroff_on_panic +bool + +In the event of a panic, this variable controls whether or not the +system should try to power off instead of rebooting. + --- kern.proc.all diff --git a/tools/tools/zfsboottest/Makefile b/tools/tools/zfsboottest/Makefile index 1f6084effa0a..acb510de70a9 100644 --- a/tools/tools/zfsboottest/Makefile +++ b/tools/tools/zfsboottest/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${SRCTOP}/sys/boot/zfs ${SRCTOP}/sys/cddl/boot/zfs +.PATH: ${SRCTOP}/stand/zfs ${SRCTOP}/sys/cddl/boot/zfs BINDIR?= /usr/bin SCRIPTSDIR?= /usr/bin @@ -11,7 +11,7 @@ SCRIPTSNAME= zfsboottest.sh MAN= CFLAGS= -O1 \ - -I${SRCTOP}/sys/boot/zfs \ + -I${SRCTOP}/stand/zfs \ -I${SRCTOP}/sys/cddl/boot/zfs \ -I. \ -fdiagnostics-show-option \ diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index 53f40a3f71c6..733115b7c8d6 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -902,8 +902,13 @@ f_fstype(PLAN *plan, FTSENT *entry) } else p = NULL; - if (statfs(entry->fts_accpath, &sb)) - err(1, "%s", entry->fts_accpath); + if (statfs(entry->fts_accpath, &sb)) { + if (!ignore_readdir_race || errno != ENOENT) { + warn("statfs: %s", entry->fts_accpath); + exitstatus = 1; + } + return 0; + } if (p) { p[0] = save[0]; diff --git a/usr.bin/fortune/datfiles/Makefile b/usr.bin/fortune/datfiles/Makefile index 6f1fc9c26e19..80b8cd2ab641 100644 --- a/usr.bin/fortune/datfiles/Makefile +++ b/usr.bin/fortune/datfiles/Makefile @@ -1,11 +1,7 @@ # @(#)Makefile 8.2 (Berkeley) 4/19/94 # $FreeBSD$ -DB= fortunes freebsd-tips murphy startrek zippy - -# TO AVOID INSTALLING THE POTENTIALLY OFFENSIVE FORTUNES, COMMENT OUT THE -# NEXT LINE. -DB+= limerick murphy-o gerrold.limerick +DB= freebsd-tips BLDS= ${DB:S/$/.dat/} FILES= ${DB} ${BLDS} diff --git a/usr.bin/fortune/datfiles/fortunes b/usr.bin/fortune/datfiles/fortunes deleted file mode 100644 index 832c9d437337..000000000000 --- a/usr.bin/fortune/datfiles/fortunes +++ /dev/null @@ -1,59053 +0,0 @@ -This fortune brought to you by: -$FreeBSD$ -% -======================================================================= -|| || -|| The FORTUNE-COOKIE program is soon to be a Major Motion Picture! || -|| Watch for it at a theater near you next summer! || -|| || -======================================================================= - Francis Ford Coppola presents a George Lucas Production: - "Fortune Cookie" - Directed by Steven Spielberg. - Starring Harrison Ford Bette Midler Marlon Brando - Christopher Reeves Marilyn Chambers - and Bob Hope as "The Waiter". - Costumes Designed by Pierre Cardin. - Special Effects by Timothy Leary. - Read the Warner paperback! - Invoke the Unix program! - Soundtrack on XTC Records. - In 70mm and Dolby Stereo at selected theaters and terminal - centers. -% - FROM THE DESK OF - Dorothy Gale - - Auntie Em: - Hate you. - Hate Kansas. - Taking the dog. - Dorothy -% - FROM THE DESK OF - Rapunzel - -Dear Prince: - - Use ladder tonight -- - you're splitting my ends. -% - SEMINAR ANNOUNCEMENT - -Title: Are Frogs Turing Compatible? -Speaker: Don "The Lion" Knuth - - ABSTRACT - Several researchers at the University of Louisiana have been studying -the computing power of various amphibians, frogs in particular. The problem -of frog computability has become a critical issue that ranges across all areas -of computer science. It has been shown that anything computable by an amphi- -bian community in a fixed-size pond is computable by a frog in the same-size -pond -- that is to say, frogs are Pond-space complete. We will show that -there is a log-space, polywog-time reduction from any Turing machine program -to a frog. We will suggest these represent a proper subset of frog-computable -functions. - This is not just a let's-see-how-far-those-frogs-can-jump seminar. -This is only for hardcore amphibian-computation people and their colleagues. - Refreshments will be served. Music will be played. -% - UNIX Trix - -For those of you in the reseller business, here is a helpful tip that will -save your support staff a few hours of precious time. Before you send your -next machine out to an untrained client, change the permissions on /etc/passwd -to 666 and make sure there is a copy somewhere on the disk. Now when they -forget the root password, you can easily login as an ordinary user and correct -the damage. Having a bootable tape (for larger machines) is not a bad idea -either. If you need some help, give us a call. - - -- CommUNIXque 1:1, ASCAR Business Systems -% - 1/2 - 12 + 144 + 20 + 3*4 2 - ---------------------- + 5 * 11 = 9 + 0 - 7 - -A dozen, a gross and a score, -Plus three times the square root of four, - Divided by seven, - Plus five times eleven, -Equals nine squared plus zero, no more! -% - -- Gifts for Children -- - -This is easy. You never have to figure out what to get for children, -because they will tell you exactly what they want. They spend months -and months researching these kinds of things by watching Saturday- -morning cartoon-show advertisements. Make sure you get your children -exactly what they ask for, even if you disapprove of their choices. If -your child thinks he wants Murderous Bob, the Doll with the Face You -Can Rip Right Off, you'd better get it. You may be worried that it -might help to encourage your child's antisocial tendencies, but believe -me, you have not seen antisocial tendencies until you've seen a child -who is convinced that he or she did not get the right gift. - -- Dave Barry, "Christmas Shopping: A Survivor's Guide" -% - -- Gifts for Men -- - -Men are amused by almost any idiot thing -- that is why professional -ice hockey is so popular -- so buying gifts for them is easy. But you -should never buy them clothes. Men believe they already have all the -clothes they will ever need, and new ones make them nervous. For -example, your average man has 84 ties, but he wears, at most, only -three of them. He has learned, through humiliating trial and error, -that if he wears any of the other 81 ties, his wife will probably laugh -at him ("You're not going to wear THAT tie with that suit, are you?"). -So he has narrowed it down to three safe ties, and has gone several -years without being laughed at. If you give him a new tie, he will -pretend to like it, but deep inside he will hate you. - -If you want to give a man something practical, consider tires. More -than once, I would have gladly traded all the gifts I got for a new set -of tires. - -- Dave Barry, "Christmas Shopping: A Survivor's Guide" -% - Chapter 1 - -The story so far: - - In the beginning the Universe was created. This has made a lot -of people very angry and been widely regarded as a bad move. - -- Douglas Adams, "The Restaurant at the End of the Universe" -% - DELETE A FORTUNE! - -Don't some of these fortunes just drive you nuts?! Wouldn't you like -to see some of them deleted from the system? You can! Just mail to -"fortune" with the fortune you hate most, and we MIGHT make sure it -gets expunged. -% - Get GUMMed - --- ------ -The Gurus of Unix Meeting of Minds (GUMM) takes place Wednesday, April -1, 2076 (check THAT in your perpetual calendar program), 14 feet above -the ground directly in front of the Milpitas Gumps. Members will grep -each other by the hand (after intro), yacc a lot, smoke filtered -chroots in pipes, chown with forks, use the wc (unless uuclean), fseek -nice zombie processes, strip, and sleep, but not, we hope, od. Three -days will be devoted to discussion of the ramifications of whodo. Two -seconds have been allotted for a complete rundown of all the user- -friendly features of Unix. Seminars include "Everything You Know is -Wrong", led by Tom Kempson, "Batman or Cat:man?" led by Richie Dennis -"cc C? Si! Si!" led by Kerwin Bernighan, and "Document Unix, Are You -Kidding?" led by Jan Yeats. No Reader Service No. is necessary because -all GUGUs (Gurus of Unix Group of Users) already know everything we -could tell them. - -- Dr. Dobb's Journal, June '84 -% - Has your family tried 'em? - - POWDERMILK BISCUITS - - Heavens, they're tasty and expeditious! - - They're made from whole wheat, to give shy persons - the strength to get up and do what needs to be done. - - POWDERMILK BISCUITS - - Buy them ready-made in the big blue box with the picture of - the biscuit on the front, or in the brown bag with the dark - stains that indicate freshness. -% - It's grad exam time... -COMPUTER SCIENCE - Inside your desk you'll find a listing of the DEC/VMS operating -system in IBM 1710 machine code. Show what changes are necessary to convert -this code into a UNIX Berkeley 7 operating system. Prove that these fixes are -bug free and run correctly. You should gain at least 150% efficiency in the -new system. (You should take no more than 10 minutes on this question.) - -MATHEMATICS - If X equals PI times R^2, construct a formula showing how long -it would take a fire ant to drill a hole through a dill pickle, if the -length-girth ratio of the ant to the pickle were 98.17:1. - -GENERAL KNOWLEDGE -Describe the Universe. Give three examples. -% - It's grad exam time... -MEDICINE - You have been provided with a razor blade, a piece of gauze, and a -bottle of Scotch. Remove your appendix. Do not suture until your work has -been inspected. (You have 15 minutes.) - -HISTORY - Describe the history of the papacy from its origins to the present -day, concentrating especially, but not exclusively, on its social, political, -economic, religious and philosophical impact upon Europe, Asia, America, and -Africa. Be brief, concise, and specific. - -BIOLOGY - Create life. Estimate the differences in subsequent human culture -if this form of life had been created 500 million years ago or earlier, with -special attention to its probable effect on the English parliamentary system. -% - Pittsburgh driver's test -10: Potholes are - a) extremely dangerous. - b) patriotic. - c) the fault of the previous administration. - d) all going to be fixed next summer. -The correct answer is b. -Potholes destroy unpatriotic, unamerican, imported cars, since the holes -are larger than the cars. If you drive a big, patriotic, American car -you have nothing to worry about. -% - Pittsburgh driver's test -2: A traffic light at an intersection changes from yellow to red, you should - a) stop immediately. - b) proceed slowly through the intersection. - c) blow the horn. - d) floor it. -The correct answer is d. -If you said c, you were almost right, so give yourself a half point. -% - Pittsburgh driver's test -3: When stopped at an intersection you should - a) watch the traffic light for your lane. - b) watch for pedestrians crossing the street. - c) blow the horn. - d) watch the traffic light for the intersecting street. -The correct answer is d. -You need to start as soon as the traffic light for the intersecting -street turns yellow. -Answer c is worth a half point. -% - Pittsburgh driver's test -4: Exhaust gas is - a) beneficial. - b) not harmful. - c) toxic. - d) a punk band. -The correct answer is b. -The meddling Washington eco-freak communist bureaucrats who say otherwise -are liars. (Message to those who answered d. Go back to California where -you came from. Your kind are not welcome here.) -% - Pittsburgh driver's test -5: Your car's horn is a vital piece of safety equipment. - How often should you test it? - a) once a year. - b) once a month. - c) once a day. - d) once an hour. -The correct answer is d. -You should test your car's horn at least once every hour, -and more often at night or in residential neighborhoods. -% - Pittsburgh driver's test -7: The car directly in front of you has a flashing right tail light - but a steady left tail light. This means - a) One of the tail lights is broken. You should blow your - horn to call the problem to the driver's attention. - b) The driver is signaling a right turn. - c) The driver is signaling a left turn. - d) The driver is from out of town. -The correct answer is d. -Tail lights are used in some foreign countries to signal turns. -% - Pittsburgh driver's test -8: Pedestrians are - a) irrelevant. - b) communists. - c) a nuisance. - d) difficult to clean off the front grille. -The correct answer is a. Pedestrians are not in cars, so they -are totally irrelevant to driving, and you should ignore them -completely. -% - Pittsburgh driver's test -9: Roads are salted in order to - a) kill grass. - b) melt snow. - c) help the economy. - d) prevent potholes. -The correct answer is c. -Road salting employs thousands of persons directly, and millions more -indirectly, for example, salt miners and rustproofers. Most important, -salting reduces the life spans of cars, thus stimulating the car and -steel industries. -% - THE STORY OF CREATION - or - THE MYTH OF URK - -In the beginning there was data. The data was without form and null, -and darkness was upon the face of the console; and the Spirit of IBM -was moving over the face of the market. And DEC said, "Let there be -registers"; and there were registers. And DEC saw that they carried; -and DEC separated the data from the instructions. DEC called the data -Stack, and the instructions they called Code. And there was evening -and there was morning, one interrupt ... - -- Rico Tudor -% - JACK AND THE BEANSTACK - by Mark Isaak - - Long ago, in a finite state far away, there lived a JOVIAL -character named Jack. Jack and his relations were poor. Often their -hash table was bare. One day Jack's parent said to him, "Our matrices -are sparse. You must go to the market to exchange our RAM for some -BASICs." She compiled a linked list of items to retrieve and passed it -to him. - So Jack set out. But as he was walking along a Hamilton path, -he met the traveling salesman. - "Whither dost thy flow chart take thou?" prompted the salesman -in high-level language. - "I'm going to the market to exchange this RAM for some chips -and Apples," commented Jack. - "I have a much better algorithm. You needn't join a queue -there; I will swap your RAM for these magic kernels now." - Jack made the trade, then backtracked to his house. But when -he told his busy-waiting parent of the deal, she became so angry she -started thrashing. - "Don't you even have any artificial intelligence? All these -kernels together hardly make up one byte," and she popped them out the -window ... -% - Answers to Last Fortune's Questions: - -(1) None. (Moses didn't have an ark). -(2) Your mother, by the pigeonhole principle. -(3) I don't know. -(4) Who cares? -(5) 6 (or maybe 4, or else 3). Mr. Alfred J. Duncan of Podunk, - Montana, submitted an interesting solution to Problem 5. -(6) There is an interesting solution to this problem on page 1029 of my - book, which you can pick up for $23.95 at finer bookstores and - bathroom supply outlets (or 99 cents at the table in front of - Papyrus Books). -% - DETERIORATA - -Go placidly amid the noise and waste, -And remember what comfort there may be in owning a piece thereof. -Avoid quiet and passive persons, unless you are in need of sleep. -Rotate your tires. -Speak glowingly of those greater than yourself, -And heed well their advice -- even though they be turkeys. -Know what to kiss -- and when. -Remember that two wrongs never make a right, -But that three do. -Wherever possible, put people on "HOLD". -Be comforted, that in the face of all aridity and disillusionment, -And despite the changing fortunes of time, -There is always a big future in computer maintenance. - - You are a fluke of the universe ... - You have no right to be here. - Whether you can hear it or not, the universe - Is laughing behind your back. - -- National Lampoon -% - Double Bucky - (Sung to the tune of "Rubber Duckie") - -Double bucky, you're the one! -You make my keyboard lots of fun - Double bucky, an additional bit or two: -(Vo-vo-de-o!) -Control and Meta side by side, -Augmented ASCII, nine bits wide! - Double bucky, a half a thousand glyphs, plus a few! - -Double bucky, left and right -OR'd together, outta sight! - Double bucky, I'd like a whole word of - Double bucky, I'm happy I heard of - Double bucky, I'd like a whole word of you! - -- Guy L. Steele, Jr., (C) 1978 - (to Nicholas Wirth, who suggested that an extra bit - be added to terminal codes on 36-bit machines for use - by screen editors.) -% - Hard Copies and Chmod - -And everyone thinks computers are impersonal -cold diskdrives hardware monitors -user-hostile software - -of course they're only bits and bytes -and characters and strings -and files - -just some old textfiles from my old boyfriend -telling me he loves me and -he'll take care of me - -simply a discarded printout of a friend's directory -deep intimate secrets and -how he doesn't trust me - -couldn't hurt me more if they were scented in lavender or mould -on personal stationery - -- terri@csd4.milw.wisc.edu -% - `O' LEVEL COUNTER CULTURE -Timewarp allowed: 3 hours. Do not scrawl situationalist graffiti in the -margins or stub your rollups in the inkwells. Orange may be worn. Credit -will be given to candidates who self-actualize. - - 1: Compare and contrast Pink Floyd with Black Sabbath and say why -neither has street credibility. - 2: "Even Buddha would have been hard pushed to reach Nirvana squatting -on a juggernaut route." Consider the dialectic of inner truth and inner -city. - 3: Discuss degree of hassle involved in paranoia about being sucked -into a black hole. - 4: "The Egomaniac's Liberation Front were a bunch of revisionist -ripoff merchants." Comment on this insult. - 5: Account for the lack of references to brown rice in Dylan's lyrics. - 6: "Castenada was a bit of a bozo." How far is this a fair summing -up of western dualism? - 7: Hermann Hesse was a Pisces. Discuss. -% - OUTCONERR -Twas FORTRAN as the doloop goes - Did logzerneg the ifthen block -All kludgy were the function flows - And subroutines adhoc. - -Beware the runtime-bug my friend - squrooneg, the false goto -Beware the infiniteloop - And shun the inprectoo. -% - Safety Tips for the Post-Nuclear Existence -1. Never use an elevator in a building that has been hit by a - nuclear bomb, use the stairs. -2. When you're flying through the air, remember to roll - when you hit the ground. -3. If you're on fire, avoid gasoline and other flammable materials. -4. Don't attempt communication with dead people; it will only lead - to psychological problems. -5. Food will be scarce, you will have to scavenge. Learn to recognize - foods that will be available after the bomb: mashed potatoes, - shredded wheat, tossed salad, ground beef, etc. -6. Put your hand over your mouth when you sneeze, internal organs - will be scarce in the post-nuclear age. -7. Try to be neat, fall only in designated piles. -8. Drive carefully in "Heavy Fallout" areas, people could be - staggering illegally. -9. Nutritionally, hundred dollar bills are equal to one's, but more - sanitary due to limited circulation. -10. Accumulate mannequins now, spare parts will be in short - supply on D-Day. -% - The Guy on the Right Doesn't Stand a Chance -The guy on the right has the Osborne 1, a fully functional computer system -in a portable package the size of a briefcase. The guy on the left has an -Uzi submachine gun concealed in his attache case. Also in the case are four -fully loaded, 32-round clips of 125-grain 9mm ammunition. The owner of the -Uzi is going to get more tactical firepower delivered -- and delivered on -target -- in less time, and with less effort. All for $795. It's inevitable. -If you're going up against some guy with an Osborne 1 -- or any personal -computer -- he's the one who's in trouble. One round from an Uzi can zip -through ten inches of solid pine wood, so you can imagine what it will do -to structural foam acrylic and sheet aluminum. In fact, detachable magazines -for the Uzi are available in 25-, 32-, and 40-round capacities, so you can -take out an entire office full of Apple II or IBM Personal Computers tied -into Ethernet or other local-area networks. What about the new 16-bit -computers, like the Lisa and Fortune? Even with the Winchester backup, -they're no match for the Uzi. One quick burst and they'll find out what -Unix means. Make your commanding officer proud. Get an Uzi -- and come home -a winner in the fight for office automatic weapons. - -- "InfoWorld", June, 1984 -% - The STAR WARS Song - Sung to the tune of "Lola", by the Kinks: - -I met him in a swamp down in Dagobah -Where it bubbles all the time like a giant cabinet soda - S-O-D-A soda -I saw the little runt sitting there on a log -I asked him his name and in a raspy voice he said Yoda - Y-O-D-A Yoda, Yo-Yo-Yo-Yo Yoda - -Well I've been around but I ain't never seen -A guy who looks like a Muppet but he's wrinkled and green - Oh my Yoda, Yo-Yo-Yo-Yo Yoda -Well I'm not dumb but I can't understand -How he can raise me in the air just by raising his hand - Oh my Yoda, Yo-Yo-Yo-Yo Yoda, Yo-Yo-Yo-Yo Yoda -% - The Three Major Kind of Tools - -* Tools for hitting things to make them loose or to tighten them up or - jar their many complex, sophisticated electrical parts in such a - manner that they function perfectly. (These are your hammers, maces, - bludgeons, and truncheons.) - -* Tools that, if dropped properly, can penetrate your foot. (Awls) - -* Tools that nobody should ever use because the potential danger is far - greater than the value of any project that could possibly result. - (Power saws, power drills, power staplers, any kind of tool that uses - any kind of power more advanced than flashlight batteries.) - -- Dave Barry, "The Taming of the Screw" -% - (to "The Caissons Go Rolling Along") -Scratch the disks, dump the core, Shut it down, pull the plug -Roll the tapes across the floor, Give the core an extra tug -And the system is going to crash. And the system is going to crash. -Teletypes smashed to bits. Mem'ry cards, one and all, -Give the scopes some nasty hits Toss out halfway down the hall -And the system is going to crash. And the system is going to crash. -And we've also found Just flip one switch -When you turn the power down, And the lights will cease to twitch -You turn the disk readers into trash. And the tape drives will crumble - in a flash. -Oh, it's so much fun, When the CPU -Now the CPU won't run Can print nothing out but "foo," -And the system is going to crash. The system is going to crash. -% - 'Twas the Night before Crisis - -'Twas the night before crisis, and all through the house, - Not a program was working not even a browse. -The programmers were wrung out too mindless to care, - Knowing chances of cutover hadn't a prayer. -The users were nestled all snug in their beds, - While visions of inquiries danced in their heads. -When out in the lobby there arose such a clatter, - I sprang from my tube to see what was the matter. -And what to my wondering eyes should appear, - But a Super Programmer, oblivious to fear. -More rapid than eagles, his programs they came, - And he whistled and shouted and called them by name; -On Update! On Add! On Inquiry! On Delete! - On Batch Jobs! On Closing! On Functions Complete! -His eyes were glazed over, his fingers were lean, - From Weekends and nights in front of a screen. -A wink of his eye, and a twist of his head, - Soon gave me to know I had nothing to dread... -% - What I Did During My Fall Semester -On the first day of my fall semester, I got up. -Then I went to the library to find a thesis topic. -Then I hung out in front of the Dover. - -On the second day of my fall semester, I got up. -Then I went to the library to find a thesis topic. -Then I hung out in front of the Dover. - -On the third day of my fall semester, I got up. -Then I went to the library to find a thesis topic. -I found a thesis topic: - How to keep people from hanging out in front of the Dover. - -- Sister Mary Elephant, - "Student Statement for Black Friday" -% - William Safire's Rules for Writers: - -Remember to never split an infinitive. The passive voice should never -be used. Do not put statements in the negative form. Verbs has to -agree with their subjects. Proofread carefully to see if you words -out. If you reread your work, you can find on rereading a great deal -of repetition can be avoided by rereading and editing. A writer must -not shift your point of view. And don't start a sentence with a -conjunction. (Remember, too, a preposition is a terrible word to end a -sentence with.) Don't overuse exclamation marks!! Place pronouns as -close as possible, especially in long sentences, as of 10 or more -words, to their antecedents. Writing carefully, dangling participles -must be avoided. If any word is improper at the end of a sentence, a -linking verb is. Take the bull by the hand and avoid mixing -metaphors. Avoid trendy locutions that sound flaky. Everyone should -be careful to use a singular pronoun with singular nouns in their -writing. Always pick on the correct idiom. The adverb always follows -the verb. Last but not least, avoid cliches like the plague; seek -viable alternatives. -% - 1/3 - /\(3) - | 2 1/3 - | z dz cos(3 * PI / 9) = ln (e ) - | - \/ 1 - -The integral of z squared, dz -From 1 to the cube root of 3 - Times the cosine - Of 3 PI over nine -Is the log of the cube root of e -% - THE DAILY PLANET - - SUPERMAN SAVES DESSERT! - Plans to "Eat it later" -% - *** A NEW KIND OF PROGRAMMING *** - -Do you want the instant respect that comes from being able to use technical -terms that nobody understands? Do you want to strike fear and loathing into -the hearts of DP managers everywhere? If so, then let the Famous Programmers' -School lead you on... into the world of professional computer programming. -They say a good programmer can write 20 lines of effective program per day. -With our unique training course, we'll show you how to write 20 lines of code -and lots more besides. Our training course covers every programming language -in existence, and some that aren't. You'll learn why the on/off switch for a -computer is so important, what the words *fatal error* mean, and who and what -you should blame when you make a mistake. - - Yes, I want the brochure describing this incredible offer. - I enclose $1000 in small unmarked bills to cover the cost of - postage and handling. (No live poultry, please.) - -*** Our Slogan: Top down programming for the masses. *** -% - A Plan for the Improvement of English Spelling - by Mark Twain - - For example, in Year 1 that useless letter "c" would be dropped -to be replased either by "k" or "s", and likewise "x" would no longer -be part of the alphabet. The only kase in which "c" would be retained -would be the "ch" formation, which will be dealt with later. Year 2 -might reform "w" spelling, so that "which" and "one" would take the -same konsonant, wile Year 3 might well abolish "y" replasing it with -"i" and Iear 4 might fiks the "g/j" anomali wonse and for all. - Jenerally, then, the improvement would kontinue iear bai iear -with Iear 5 doing awai with useless double konsonants, and Iears 6-12 -or so modifaiing vowlz and the rimeining voist and unvoist konsonants. -Bai Iear 15 or sou, it wud fainali bi posibl tu meik ius ov thi -ridandant letez "c", "y" and "x" -- bai now jast a memori in the maindz -ov ould doderez -- tu riplais "ch", "sh", and "th" rispektivli. - Fainali, xen, aafte sam 20 iers ov orxogrefkl riform, wi wud -hev a lojikl, kohirnt speling in ius xrewawt xe Ingliy-spiking werld. -% - *** DO YOU HAVE A RESTLESS URGE TO PROGRAM? *** -Do you want the instant respect that comes from being able to use technical -terms that nobody understands? Do you want to strike fear and loathing into -the hearts of DP managers everywhere? If so, then let the Famous Programmers' -School lead you on... into the world of professional computer programming. - - *** IS PROGRAMMING FOR YOU? *** -Programming is not for everyone. But, if you have the desire to learn, we can -help you get started. All you need is the Famous Programmers' Course and -enough money to keep those lessons coming month after month. - - *** TAKE OUR FREE APTITUDE TEST *** -To help determine if you are qualified to be a programmer, take a moment to -try this simple test: - 1: Write down the numbers from zero to nine and the first six letters - of the alphabet (Hint: 0123456789ABCDEF). - 2: Whose picture is on the back of a twenty-dollar bill? - 3: What is the state capital of Idaho? -If you managed to read all three questions without wondering why we asked -them, you may have a future as a computer programmer. -% - *** STUDENT SUCCESSES *** - -Many of our students have gone on to achieve great success in all fields of -programming. One former student developed the concept of the personalized -form letter. Does the phrase, "Dear Mr.(insert name), You may already be a -winner!," sound familiar? Another student writes "After only five lessons I -sold a "My Most Unforgettable Program" article to Corrosive Computing magazine. -Another of our graduates writes, "I recently completed a database-management -program for my department manager. My program touched him so deeply that he -was speechless. He told me later that he had never seen such a program in -his entire career. Thank you, Famous Programmers' school; only you could -have made this possible." Send for our introductory brochure which explains -in vague detail the operation of the Famous Programmers' School, and you'll -be eligible to win a possible chance to enter a drawing, the winner of which -can vie for a set of free steak knives. If you don't do it now, you'll hate -yourself in the morning. -% - - *** System shutdown message from root *** - -System going down in 60 seconds - - -% - ... This striving for excellence extends into people's -personal lives as well. When '80s people buy something, they buy the -best one, as determined by (1) price and (2) lack of availability. -Eighties people buy imported dental floss. They buy gourmet baking -soda. If an '80s couple goes to a restaurant where they have made a -reservation three weeks in advance, and they are informed that their -table is available, they stalk out immediately, because they know it is -not an excellent restaurant. If it were, it would have an enormous -crowd of excellence-oriented people like themselves waiting, their -beepers going off like crickets in the night. An excellent restaurant -wouldn't have a table ready immediately for anybody below the rank of -Liza Minnelli. - -- Dave Barry, "In Search of Excellence" -% - ... with liberty and justice for all who can afford it. -% - 7,140 pounds on the Sun - 97 pounds on Mercury or Mars - 255 pounds on Earth - 232 pounds on Venus or Uranus - 43 pounds on the Moon - 648 pounds on Jupiter - 275 pounds on Saturn - 303 pounds on Neptune - 13 pounds on Pluto - - -- How much Elvis Presley would weigh at various places - in the solar system. -% - A boy scout troop went on a hike. Crossing over a stream, one of -the boys dropped his wallet into the water. Suddenly a carp jumped, grabbed -the wallet and tossed it to another carp. Then that carp passed it to -another carp, and all over the river carp appeared and tossed the wallet back -and forth. - "Well, boys," said the Scout leader, "you've just seen a rare case -of carp-to-carp walleting." -% - A carpet installer decides to take a cigarette break after completing -the installation in the first of several rooms he has to do. Finding them -missing from his pocket he begins searching, only to notice a small lump in -his recently completed carpet-installation. Not wanting to pull up all that -work for a lousy pack of cigarettes he simply walks over and pounds the lump -flat. Foregoing the break, he continues on to the other rooms to be carpeted. - At the end of the day, while loading his tools into his truck, two -events occur almost simultaneously: he spies his pack of cigarettes on the -dashboard of the truck, and the lady of the house summons him imperiously: -"Have you seen my parakeet?" -% - A circus foreman was making the rounds inspecting the big top when -a scrawny little man entered the tent and walked up to him. "Are you the -foreman around here?" he asked timidly. "I'd like to join your circus; I -have what I think is a pretty good act." - The foreman nodded assent, whereupon the little man hurried over to -the main pole and rapidly climbed up to the very tip-top of the big top. -Drawing a deep breath, he hurled himself off into the air and began flapping -his arms furiously. Amazingly, rather than plummeting to his death the little -man began to fly all around the poles, lines, trapezes and other obstacles, -performing astounding feats of aerobatics which ended in a long power dive -from the top of the tent, pulling up into a gentle feet-first landing beside -the foreman, who had been nonchalantly watching the whole time. - "Well," puffed the little man. "What do you think?" - "That's all you do?" answered the foreman scornfully. "Bird -imitations?" -% - A crow perched himself on a telephone wire. He was going to make a -long-distance caw. -% - A disciple of another sect once came to Drescher as he was eating -his morning meal. "I would like to give you this personality test", said -the outsider, "because I want you to be happy." - Drescher took the paper that was offered him and put it into the -toaster -- "I wish the toaster to be happy too". -% - A doctor, an architect, and a computer scientist were arguing about -whose profession was the oldest. In the course of their arguments, they -got all the way back to the Garden of Eden, whereupon the doctor said, "The -medical profession is clearly the oldest, because Eve was made from Adam's -rib, as the story goes, and that was a simply incredible surgical feat." - The architect did not agree. He said, "But if you look at the Garden -itself, in the beginning there was chaos and void, and out of that the Garden -and the world were created. So God must have been an architect." - The computer scientist, who'd listened carefully to all of this, then -commented, "Yes, but where do you think the chaos came from?" -% - A domineering man married a mere wisp of a girl. He came back from -his honeymoon a chastened man. He'd become aware of the will of the wisp. -% - A farm in the country side had several turkeys, it was known as the -house of seven gobbles. -% - A father gave his teenage daughter an untrained pedigreed pup for -her birthday. An hour later, when wandered through the house, he found her -looking at a puddle in the center of the kitchen. "My pup," she murmured -sadly, "runneth over." -% - A German, a Pole and a Czech left camp for a hike through the woods. -After being reported missing a day or two later, rangers found two bears, -one a male, one a female, looking suspiciously overstuffed. They killed -the female, autopsied her, and sure enough, found the German and the Pole. - "What do you think?" said the first ranger. - "The Czech is in the male," replied the second. -% - A hard-luck actor who appeared in one colossal disaster after another -finally got a break, a broken leg to be exact. Someone pointed out that it's -the first time the poor fellow's been in the same cast for more than a week. -% - A horrible little boy came up to me and said, "You know in your -book The Martian Chronicles?" - I said, "Yes?" - He said, "You know where you talk about Deimos rising in the -East?" - I said, "Yes?" - He said "No." -- So I hit him. - -- attributed to Ray Bradbury -% - A horse breeder has his young colts bottle-fed after they're three -days old. He heard that a foal and his mummy are soon parted. -% - A housewife, an accountant and a lawyer were asked to add 2 and 2. - The housewife replied, "Four!". - The accountant said, "It's either 3 or 4. Let me run those figures -through my spread sheet one more time." - The lawyer pulled the drapes, dimmed the lights and asked in a -hushed voice, "How much do you want it to be?" -% - A lawyer named Strange was shopping for a tombstone. After he had -made his selection, the stonecutter asked him what inscription he -would like on it. "Here lies an honest man and a lawyer," responded the -lawyer. - "Sorry, but I can't do that," replied the stonecutter. "In this -state, it's against the law to bury two people in the same grave. However, -I could put `here lies an honest lawyer', if that would be okay." - "But that won't let people know who it is" protested the lawyer. - "Certainly will," retorted the stonecutter. "people will read it -and exclaim, "That's Strange!" -% - A little dog goes into a saloon in the Wild West, and beckons to -the bartender. "Hey, bartender, gimmie a whiskey." - The bartender ignores him. - "Hey bartender, gimmie a whiskey." - Still ignored. - "HEY BARMAN!! GIMMIE A WHISKEY!!" - The bartender takes out his six-shooter and shoots the dog in the -leg, and the dog runs out the saloon, howling in pain. - Three years later, the wee dog appears again, wearing boots, -jeans, chaps, a Stetson, gun belt, and guns. He ambles slowly into the -saloon, goes up to the bar, leans over it, and says to the bartender, -"I'm here t'git the man that shot muh paw." -% - A man enters a pet shop, seeking to purchase a parrot. He points -to a fine colorful bird and asks how much it costs. - When he is told it costs 70,000 zlotys, he whistles in amazement -and asks why it is so much. "Well, the bird is fluent in Italian and -French and can recite the periodic table." He points to another bird -and is told that it costs 90,000 zlotys because it speaks French and -German, can knit and can curse in Latin. - Finally the customer asks about a drab gray bird. "Ah," he is -told, "that one is 150,000." - "Why, what can it do?" he asks. - "Well," says the shopkeeper, "to tell you the truth, he doesn't -do anything, but the other birds call him Mr. Secretary." - -- being told in Poland, 1987 -% - A man from AI walked across the mountains to SAIL to see the Master, -Knuth. When he arrived, the Master was nowhere to be found. "Where is the -wise one named Knuth?" he asked a passing student. - "Ah," said the student, "you have not heard. He has gone on a -pilgrimage across the mountains to the temple of AI to seek out new -disciples." - Hearing this, the man was Enlightened. -% - A man goes to a tailor to try on a new custom-made suit. The -first thing he notices is that the arms are too long. - "No problem," says the tailor. "Just bend them at the elbow -and hold them out in front of you. See, now it's fine." - "But the collar is up around my ears!" - "It's nothing. Just hunch your back up a little ... no, a -little more ... that's it." - "But I'm stepping on my cuffs!" the man cries in desperation. - "Nu, bend you knees a little to take up the slack. There you -go. Look in the mirror -- the suit fits perfectly." - So, twisted like a pretzel, the man lurches out onto the -street. Reba and Florence see him go by. - "Oh, look," says Reba, "that poor man!" - "Yes," says Florence, "but what a beautiful suit." - -- Arthur Naiman, "Every Goy's Guide to Yiddish" -% - A man met a beautiful young woman in a bar. They got along well, -shared dinner, and had a marvelous evening. When he left her, he told her -that he had really enjoyed their time together, and hoped to see her again, -soon. Smiling yes, she gave him her phone number. - The next day, he called her up and asked her to go dancing. She -agreed. As they talked, he jokingly asked her what her favorite flower was. -Realizing his intentions, she told him that he shouldn't bring her flowers --- if he wanted to bring her a gift, well, he should bring her a Swiss Army -knife! - Surprised, and not a little intrigued, he spent a large part of the -afternoon finding a particularly unusual one. Arriving at her apartment -he immediately presented her with the knife. She ooohed and ahhhed over it -for a minute, and then carefully placed it in a drawer, that the man couldn't -help but see was full of Swiss Army knives. - Surprised, he asked her why she had collected so many. - "Well, I'm young and attractive now", blushed the woman, "but that -won't always be true. And boy scouts will do anything for a Swiss Army knife!" -% - A man pleaded innocent of any wrong doing when caught by the police -during a raid at the home of a mobster, excusing himself by claiming that he -was making a bolt for the door. -% - A man walked into a bar with his alligator and asked the bartender, -"Do you serve lawyers here?". - "Sure do," replied the bartender. - "Good," said the man. "Give me a beer, and I'll have a lawyer for -my 'gator." -% - A man was reading The Canterbury Tales one Saturday morning, when his -wife asked "What have you got there?" Replied he, "Just my cup and Chaucer." -% - A man who keeps stealing mopeds is an obvious cycle-path. -% - A manager asked a programmer how long it would take him to finish the -program on which he was working. "I will be finished tomorrow," the programmer -promptly replied. - "I think you are being unrealistic," said the manager. "Truthfully, -how long will it take?" - The programmer thought for a moment. "I have some features that I wish -to add. This will take at least two weeks," he finally said. - "Even that is too much to expect," insisted the manager, "I will be -satisfied if you simply tell me when the program is complete." - The programmer agreed to this. - Several years later, the manager retired. On the way to his -retirement lunch, he discovered the programmer asleep at his terminal. -He had been programming all night. - -- Geoffrey James, "The Tao of Programming" -% - A manager was about to be fired, but a programmer who worked for him -invented a new program that became popular and sold well. As a result, the -manager retained his job. - The manager tried to give the programmer a bonus, but the programmer -refused it, saying, "I wrote the program because I though it was an interesting -concept, and thus I expect no reward." - The manager, upon hearing this, remarked, "This programmer, though he -holds a position of small esteem, understands well the proper duty of an -employee. Lets promote him to the exalted position of management consultant!" - But when told this, the programmer once more refused, saying, "I exist -so that I can program. If I were promoted, I would do nothing but waste -everyone's time. Can I go now? I have a program that I'm working on." - -- Geoffrey James, "The Tao of Programming" -% - A manager went to his programmers and told them: "As regards to your -work hours: you are going to have to come in at nine in the morning and leave -at five in the afternoon." At this, all of them became angry and several -resigned on the spot. - So the manager said: "All right, in that case you may set your own -working hours, as long as you finish your projects on schedule." The -programmers, now satisfied, began to come in a noon and work to the wee -hours of the morning. - -- Geoffrey James, "The Tao of Programming" -% - A manager went to the master programmer and showed him the requirements -document for a new application. The manager asked the master: "How long will -it take to design this system if I assign five programmers to it?" - "It will take one year," said the master promptly. - "But we need this system immediately or even sooner! How long will it -take it I assign ten programmers to it?" - The master programmer frowned. "In that case, it will take two years." - "And what if I assign a hundred programmers to it?" - The master programmer shrugged. "Then the design will never be -completed," he said. - -- Geoffrey James, "The Tao of Programming" -% - A master programmer passed a novice programmer one day. The master -noted the novice's preoccupation with a hand-held computer game. "Excuse me", -he said, "may I examine it?" - The novice bolted to attention and handed the device to the master. -"I see that the device claims to have three levels of play: Easy, Medium, -and Hard", said the master. "Yet every such device has another level of play, -where the device seeks not to conquer the human, nor to be conquered by the -human." - "Pray, great master," implored the novice, "how does one find this -mysterious setting?" - The master dropped the device to the ground and crushed it under foot. -And suddenly the novice was enlightened. - -- Geoffrey James, "The Tao of Programming" -% - A master was explaining the nature of the Tao to one of his novices, -"The Tao is embodied in all software -- regardless of how insignificant," -said the master. - "Is the Tao in a hand-held calculator?" asked the novice. - "It is," came the reply. - "Is the Tao in a video game?" continued the novice. - "It is even in a video game," said the master. - "And is the Tao in the DOS for a personal computer?" - The master coughed and shifted his position slightly. "The lesson is -over for today," he said. - -- Geoffrey James, "The Tao of Programming" -% - A MODERN FABLE - -Aesop's fables and other traditional children's stories involve allegory -far too subtle for the youth of today. Children need an updated message -with contemporary circumstance and plot line, and short enough to suit -today's minute attention span. - - The Troubled Aardvark - -Once upon a time, there was an aardvark whose only pleasure in life was -driving from his suburban bungalow to his job at a large brokerage house -in his brand new 4x4. He hated his manipulative boss, his conniving and -unethical co-workers, his greedy wife, and his sniveling, spoiled -children. One day, the aardvark reflected on the meaning of his life and -his career and on the unchecked, catastrophic decline of his nation, its -pathetic excuse for leadership, and the complete ineffectiveness of any -personal effort he could make to change the status quo. Overcome by a -wave of utter depression and self-doubt, he decided to take the only -course of action that would bring him greater comfort and happiness: he -drove to the mall and bought imported consumer electronics goods. - -MORAL OF THE STORY: Invest in foreign consumer electronics manufacturers. - -- Tom Annau -% - A musical reviewer admitted he always praised the first show of a -new theatrical season. "Who am I to stone the first cast?" -% - A musician of more ambition than talent composed an elegy at -the death of composer Edward MacDowell. She played the elegy for the -pianist Josef Hoffman, then asked his opinion. "Well, it's quite -nice," he replied, but don't you think it would be better if..." - "If what?" asked the composer. - "If ... if you had died and MacDowell had written the elegy?" -% - A novel approach is to remove all power from the system, which -removes most system overhead so that resources can be fully devoted to -doing nothing. Benchmarks on this technique are promising; tremendous -amounts of nothing can be produced in this manner. Certain hardware -limitations can limit the speed of this method, especially in the -larger systems which require a more involved & less efficient -power-down sequence. - An alternate approach is to pull the main breaker for the -building, which seems to provide even more nothing, but in truth has -bugs in it, since it usually inhibits the systems which keep the beer -cool. -% - A novice asked the Master: "Here is a programmer that never designs, -documents, or tests his programs. Yet all who know him consider him one of -the best programmers in the world. Why is this?" - The Master replies: "That programmer has mastered the Tao. He has -gone beyond the need for design; he does not become angry when the system -crashes, but accepts the universe without concern. He has gone beyond the -need for documentation; he no longer cares if anyone else sees his code. He -has gone beyond the need for testing; each of his programs are perfect within -themselves, serene and elegant, their purpose self-evident. Truly, he has -entered the mystery of the Tao." - -- Geoffrey James, "The Tao of Programming" -% - A novice asked the master: "I have a program that sometimes runs and -sometimes aborts. I have followed the rules of programming, yet I am totally -baffled. What is the reason for this?" - The master replied: "You are confused because you do not understand -the Tao. Only a fool expects rational behavior from his fellow humans. Why -do you expect it from a machine that humans have constructed? Computers -simulate determinism; only the Tao is perfect. - The rules of programming are transitory; only the Tao is eternal. -Therefore you must contemplate the Tao before you receive enlightenment." - "But how will I know when I have received enlightenment?" asked the -novice. - "Your program will then run correctly," replied the master. - -- Geoffrey James, "The Tao of Programming" -% - A novice asked the master: "I perceive that one computer company is -much larger than all others. It towers above its competition like a giant -among dwarfs. Any one of its divisions could comprise an entire business. -Why is this so?" - The master replied, "Why do you ask such foolish questions? That -company is large because it is so large. If it only made hardware, nobody -would buy it. If it only maintained systems, people would treat it like a -servant. But because it combines all of these things, people think it one -of the gods! By not seeking to strive, it conquers without effort." - -- Geoffrey James, "The Tao of Programming" -% - A novice asked the master: "In the east there is a great tree-structure -that men call 'Corporate Headquarters'. It is bloated out of shape with -vice-presidents and accountants. It issues a multitude of memos, each saying -'Go, Hence!' or 'Go, Hither!' and nobody knows what is meant. Every year new -names are put onto the branches, but all to no avail. How can such an -unnatural entity exist?" - The master replies: "You perceive this immense structure and are -disturbed that it has no rational purpose. Can you not take amusement from -its endless gyrations? Do you not enjoy the untroubled ease of programming -beneath its sheltering branches? Why are you bothered by its uselessness?" - -- Geoffrey James, "The Tao of Programming" -% - A novice programmer was once assigned to code a simple financial -package. - The novice worked furiously for many days, but when his master -reviewed his program, he discovered that it contained a screen editor, a set -of generalized graphics routines, and artificial intelligence interface, -but not the slightest mention of anything financial. - When the master asked about this, the novice became indignant. -"Don't be so impatient," he said, "I'll put the financial stuff in eventually." - -- Geoffrey James, "The Tao of Programming" -% - A novice was trying to fix a broken lisp machine by turning the -power off and on. Knight, seeing what the student was doing spoke sternly, -"You cannot fix a machine by just power-cycling it with no understanding -of what is going wrong." Knight turned the machine off and on. The -machine worked. -% - "A penny for your thoughts?" - "A dollar for your death." - -- The Odd Couple -% - A Pole, a Soviet, an American, an Englishman and a Canadian were lost -in a forest in the dead of winter. As they were sitting around a fire, they -noticed a pack of wolves eyeing them hungrily. - The Englishman volunteered to sacrifice himself for the rest of the -party. He walked out into the night. - The American, not wanting to be outdone by an Englishman, offered to -be the next victim. The wolves eagerly accepted his offer, and devoured him, -too. - The Soviet, believing himself to be better than any American, turned -to the Pole and says, "Well, comrade, I shall volunteer to give my life to -save a fellow socialist." He leaves the shelter and goes out to be killed by -the wolf pack. - At this point, the Pole opened his jacket and pulls out a machine gun. -He takes aim in the general direction of the wolf pack and in a few seconds -has killed them all. - The Canadian asked the Pole, "Why didn't you do that before the others -went out to be killed? - The Pole pulls a bottle of vodka from the other side of his jacket. -He smiles and replies, "Five men on one bottle -- too many." -% - A program should be light and agile, its subroutines connected like a -strings of pearls. The spirit and intent of the program should be retained -throughout. There should be neither too little nor too much, neither needless -loops nor useless variables, neither lack of structure nor overwhelming -rigidity. - A program should follow the "Law of Least Astonishment." What is this -law? It is simply that the program should always respond to the user in the -way that astonishes him least. - A program, no matter how complex, should act as a single unit. The -program should be directed by the logic within rather than by outward -appearances. - If the program fails in these requirements, it will be in a state of -disorder and confusion. The only way to correct this is to rewrite the -program. - -- Geoffrey James, "The Tao of Programming" -% - A programmer from a very large computer company went to a software -conference and then returned to report to his manager, saying: "What sort -of programmers work for other companies? They behaved badly and were -unconcerned with appearances. Their hair was long and unkempt and their -clothes were wrinkled and old. They crashed our hospitality suites and they -made rude noises during my presentation." - The manager said: "I should have never sent you to the conference. -Those programmers live beyond the physical world. They consider life absurd, -an accidental coincidence. They come and go without knowing limitations. -Without a care, they live only for their programs. Why should they bother -with social conventions?" - "They are alive within the Tao." - -- Geoffrey James, "The Tao of Programming" -% - A pushy romeo asked a gorgeous elevator operator, "Don't all -these stops and starts get you pretty worn out?" - "It isn't the stops and starts that get on my nerves, it's the -jerks." -% - A ranger was walking through the forest and encountered a hunter -carrying a shotgun and a dead loon. "What in the world do you think you're -doing? Don't you know that the loon is on the endangered species list?" - Instead of answering, the hunter showed the ranger his game bag, -which contained twelve more loons. - "Why would you shoot loons?", the ranger asked. - "Well, my family eats them and I sell the plumage." - "What's so special about a loon? What does it taste like?" - "Oh, somewhere between an American Bald Eagle and a Trumpeter Swan." -% - A reader reports that when the patient died, the attending doctor -recorded the following on the patient's chart: "Patient failed to fulfill -his wellness potential." - - Another doctor reports that in a recent issue of the *American Journal -of Family Practice* fleas were called "hematophagous arthropod vectors." - - A reader reports that the Army calls them "vertically deployed anti- -personnel devices." You probably call them bombs. - - At McClellan Air Force base in Sacramento, California, civilian -mechanics were placed on "non-duty, non-pay status." That is, they were fired. - - After taking the trip of a lifetime, our reader sent his twelve rolls -of film to Kodak for developing (or "processing," as Kodak likes to call it) -only to receive the following notice: "We must report that during the handling -of your twelve 35mm Kodachrome slide orders, the films were involved in an -unusual laboratory experience." The use of the passive is a particularly nice -touch, don't you think? Nobody did anything to the films; they just had a bad -experience. Of course our reader can always go back to Tibet and take his -pictures all over again, using the twelve replacement rolls Kodak so generously -sent him. - -- Quarterly Review of Doublespeak (NCTE) -% - A reverend wanted to telephone another reverend. He told the operator, -"This is a parson to parson call." - A farmer with extremely prolific hens posted the following sign. "Free -Chickens. Our Coop Runneth Over." - Two brothers, Mort and Bill, like to sail. While Bill has a great -deal of experience, he certainly isn't the rigger Mort is. - Inheritance taxes are getting so out of line, that the deceased family -often doesn't have a legacy to stand on. - The judge fined the jaywalker fifty dollars and told him if he was -caught again, he would be thrown in jail. Fine today, cooler tomorrow. - A rock store eventually closed down; they were taking too much for -granite. -% - A Scotsman was strolling across High Street one day wearing his kilt. -As he neared the far curb, he noticed two young blondes in a red convertible -eyeing him and giggling. One of them called out, "Hey, Scotty! What's worn -under the kilt?" - He strolled over to the side of the car and asked, "Ach, lass, are you -SURE you want to know?" Somewhat nervously, the blonde replied yes, she did -really want to know. - The Scotsman leaned closer and confided, "Why, lass, nothing's worn -under the kilt, everything's in perfect workin' order!" -% - A sheet of paper crossed my desk the other day and as I read it, -realization of a basic truth came over me. So simple! So obvious we couldn't -see it. John Knivlen, Chairman of Palomar Repeater Club, an amateur radio -group, had discovered how IC circuits work. He says that smoke is the thing -that makes ICs work because every time you let the smoke out of an IC circuit, -it stops working. He claims to have verified this with thorough testing. - I was flabbergasted! Of course! Smoke makes all things electrical -work. Remember the last time smoke escaped from your Lucas voltage regulator -Didn't it quit working? I sat and smiled like an idiot as more of the truth -dawned. It's the wiring harness that carries the smoke from one device to -another in your Mini, MG or Jag. And when the harness springs a leak, it lets -the smoke out of everything at once, and then nothing works. The starter motor -requires large quantities of smoke to operate properly, and that's why the wire -going to it is so large. - Feeling very smug, I continued to expand my hypothesis. Why are Lucas -electronics more likely to leak than say Bosch? Hmmm... Aha!!! Lucas is -British, and all things British leak! British convertible tops leak water, -British engines leak oil, British displacer units leak hydrostatic fluid, and -I might add British tires leak air, and the British defense unit leaks -secrets... so naturally British electronics leak smoke. - -- Jack Banton, PCC Automotive Electrical School -% - A shy teenage boy finally worked up the nerve to give a gift to -Madonna, a young puppy. It hitched its waggin' to a star. - A girl spent a couple hours on the phone talking to her two best -friends, Maureen Jones, and Maureen Brown. When asked by her father why she -had been on the phone so long, she responded "I heard a funny story today -and I've been telling it to the Maureens." - Three actors, Tom, Fred, and Cec, wanted to do the jousting scene -from Don Quixote for a local TV show. "I'll play the title role," proposed -Tom. "Fred can portray Sancho Panza, and Cecil B. De Mille." -% - "...A strange enigma is man!" - "Someone calls him a soul concealed in an animal," I suggested. - "Winwood Reade is good upon the subject," said Holmes. "He remarked -that, while the individual man is an insoluble puzzle, in the aggregate he -becomes a mathematical certainty. You can, for example, never foretell what -any one man will do, but you can say with precision what an average number -will be up to. Individuals vary, but percentages remain constant. So says -the statistician." - -- Sherlock Holmes, "The Sign of Four" -% - A woman was in love with fourteen soldiers, it was clearly platoonic. -% - A young honeymoon couple were touring southern Florida and happened -to stop at one of the rattlesnake farms along the road. After seeing the -sights, they engaged in small talk with the man that handled the snakes. -"Gosh!" exclaimed the new bride. "You certainly have a dangerous job. -Don't you ever get bitten by the snakes?" - "Yes, upon rare occasions," answered the handler. - "Well," she continued, "just what do you do when you're bitten by -a snake?" - "I always carry a razor-sharp knife in my pocket, and as soon as I -am bitten, I make deep criss-cross marks across the fang entry and then -suck the poison from the wound." - "What, uh... what would happen if you were to accidentally *sit* on -a rattler?" persisted the woman. - "Ma'am," answered the snake handler, "that will be the day I learn -who my real friends are." -% - A young husband with an inferiority complex insisted he was just a -little pebble on the beach. The marriage counselor told him, "If you wish to -save your marriage, you'd better be a little boulder." -% - A young married couple had their first child. Their original pride -and joy slowly turned to concern however, for after a couple of years the -child had never uttered any form of speech. They hired the best speech -therapists, doctors, psychiatrists, all to no avail. The child simply refused -to speak. One morning when the child was five, while the husband was reading -the paper, and the wife was feeding the dog, the little kid looks up from -his bowl and said, "My cereal's cold." - The couple is stunned. The man, in tears, confronts his son. "Son, -after all these years, why have you waited so long to say something?". - Shrugs the kid, "Everything's been okay 'til now". -% - ACHTUNG!!! -Das machine is nicht fur gefingerpoken und mittengrabben. Ist easy -schnappen der springenwerk, blowenfusen und corkenpoppen mit -spitzensparken. Ist nicht fur gewerken by das dummkopfen. Das -rubbernecken sightseeren keepen hands in das pockets. Relaxen und -vatch das blinkenlights!!! -% - After his Ignoble Disgrace, Satan was being expelled from -Heaven. As he passed through the Gates, he paused a moment in thought, -and turned to God and said, "A new creature called Man, I hear, is soon -to be created." - "This is true," He replied. - "He will need laws," said the Demon slyly. - "What! You, his appointed Enemy for all Time! You ask for the -right to make his laws?" - "Oh, no!" Satan replied, "I ask only that he be allowed to -make his own." - It was so granted. - -- Ambrose Bierce, "The Devil's Dictionary" -% - After sifting through the overwritten remaining blocks of Luke's home -directory, Luke and PDP-1 sped away from /u/lars, across the surface of the -Winchester riding Luke's flying read/write head. PDP-1 had Luke stop at the -edge of the cylinder overlooking /usr/spool/uucp. - "Unix-to-Unix Copy Program;" said PDP-1. "You will never find a more -wretched hive of bugs and flamers. We must be cautious." - -- DECWARS -% - After the Children of Israel had wandered for thirty-nine years in - the wilderness, Ferdinand Feghoot arrived to make sure that they -would finally find and enter the Promised Land. With him, he brought his -favorite robot, faithful old Yewtoo Artoo, to carry his gear and do assorted -camp chores. - The Israelites soon got over their initial fear of the robot and, - as the months passed, became very fond of him. Patriarchs took to -discussing abstruse theological problems with him, and each evening the -children all gathered to hear the many stories with which he was programmed. -Therefore it came as a great shock to them when, just as their journey was -ending, he abruptly wore out. Even Feghoot couldn't console them. - "It may be true, Ferdinand Feghoot," said Moses, "that our friend -Yewtoo Artoo was soulless, but we cannot believe it. He must be properly -interred. We cannot embalm him as do the Egyptians. Nor have we wood for -a coffin. But I do have a most splendid skin from one of Pharoah's own -cattle. We shall bury him in it." - Feghoot agreed. "Yes, let this be his last rusting place." "Rusting?" - Moses cried. "Not in this dreadful dry desert!" - "Ah!" sighed Ferdinand Feghoot, shedding a tear, "I fear you do not -realize the full significance of Pharoah's oxhide!" - -- Grendel Briarton "Through Time & Space With Ferdinand - Feghoot!" -% - All I really need to know about how to live and what to do and -how to be I learned in kindergarten. Wisdom was not at the top of the -graduate-school mountain, but there in the sandpile at Sunday School. -These are the things I learned: - Share everything. - Play fair. - Don't hit people. - Put things back where you found them. - Clean up your own mess. - Don't take things that aren't yours. - Say you're sorry when you hurt someone. - Wash your hands before you eat. - Flush. - Warm cookies and cold milk are good for you. - Live a balanced life -- learn some and think some and draw and -paint and sing and dance and play and work every day some. - Take a nap every afternoon. - When you go out into the world, watch for traffic, hold hands, -and stick together. - Be aware of wonder. Remember the little seed in the Styrofoam -cup: The roots go down and the plant goes up and nobody really knows -how or why, but we are all like that. - Goldfish and hamsters and white mice and even the little seed in -the Styrofoam cup -- they all die. So do we. - And then remember the Dick-and-Jane books and the first word you -learned -- the biggest word of all -- LOOK. - Everything you need to know is in there somewhere. The Golden -Rule and love and basic sanitation. Ecology and politics and equality -and sane living. - [...] Think what a better world it would be if we all -- the -whole world -- had cookies and milk about three o'clock every afternoon -and then lay down with our blankets for a nap. Or if all governments -had as a basic policy to always put things back where they found them -and to clean up their own mess. - And it is still true, no matter how old you are -- when you go -out into the world, it is best to hold hands and stick together. - -- Robert Fulghum, "All I Ever Really Needed to Know - I Learned in Kindergarten" -% - All that you touch, And all you create, - All that you see, And all you destroy, - All that you taste, All that you do, - All you feel, And all you say, - And all that you love, All that you eat, - And all that you hate, And everyone you meet, - All you distrust, All that you slight, - All you save, And everyone you fight, - And all that you give, And all that is now, - And all that you deal, And all that is gone, - All that you buy, And all that's to come, - Beg, borrow or steal, And everything under the sun is - in tune, - But the sun is eclipsed - By the moon. - -There is no dark side of the moon... really... matter of fact it's all dark. - -- Pink Floyd, "Dark Side of the Moon" -% - America, Russia and Japan are sending up a two year shuttle mission -with one astronaut from each country. Since it's going to be two long, lonely -years up there, each may bring any form of entertainment weighing 150 pounds -or less. The American approaches the NASA board and asks to take his 125 lb. -wife. They approve. - The Japanese astronaut says, "I've always wanted to learn Latin. I -want 100 lbs. of textbooks." The NASA board approves. The Russian astronaut -thinks for a second and says, "Two years... all right, I want 150 pounds of -the best Cuban cigars ever made." Again, NASA okays it. - Two years later, the shuttle lands and everyone is gathered outside -to welcome back the astronauts. Well, it's obvious what the American's been -up to, he and his wife are each holding an infant. The crowd cheers. The -Japanese astronaut steps out and makes a 10 minute speech in absolutely -perfect Latin. The crowd doesn't understand a word of it, but they're -impressed and they cheer again. The Russian astronaut stomps out, clenches -the podium until his knuckles turn white, glares at the first row and -screams: "Anybody got a match?" -% - An airplane pilot got engaged to two very pretty women at the same -time. One was named Edith; the other named Kate. They met, discovered they -had the same fiancee, and told him. "Get out of our lives you rascal. We'll -teach you that you can't have your Kate and Edith, too." -% - An architect's first work is apt to be spare and clean. He knows -he doesn't know what he's doing, so he does it carefully and with great -restraint. - As he designs the first work, frill after frill and embellishment -after embellishment occur to him. These get stored away to be used "next -time". Sooner or later the first system is finished, and the architect, -with firm confidence and a demonstrated mastery of that class of systems, -is ready to build a second system. - This second is the most dangerous system a man ever designs. When -he does his third and later ones, his prior experiences will confirm each -other as to the general characteristics of such systems, and their differences -will identify those parts of his experience that are particular and not -generalizable. - The general tendency is to over-design the second system, using all -the ideas and frills that were cautiously sidetracked on the first one. -The result, as Ovid says, is a "big pile". - -- Frederick Brooks, Jr., "The Mythical Man-Month" -% - An elderly man stands in line for hours at a Warsaw meat store (meat -is severely rationed). When the butcher comes out at the end of the day and -announces that there is no meat left, the man flies into a rage. - "What is this?" he shouts. "I fought against the Nazis, I worked hard -all my life, I've been a loyal citizen, and now you tell me I can't even buy a -piece of meat? This rotten system stinks!" - Suddenly a thuggish man in a black leather coat sidles up and murmurs -"Take it easy, comrade. Remember what would have happened if you had made an -outburst like that only a few years ago" -- and he points an imaginary gun to -this head and pulls the trigger. - The old man goes home, and his wife says, "So they're out of meat -again?" - "It's worse than that," he replies. "They're out of bullets." - -- making the rounds in Warsaw, 1987 -% - An Englishman, a Frenchman and an American are captured by cannibals. -The leader of the tribe comes up to them and says, "Even though you are about -to killed, your deaths will not be in vain. Every part of your body will be -used. Your flesh will be eaten, for my people are hungry. Your hair will be -woven into clothing, for my people are naked. Your bones will be ground up -and made into medicine, for my people are sick. Your skin will be stretched -over canoe frames, for my people need transportation. We are a fair people, -and we offer you a chance to kill yourself with our ceremonial knife." - The Englishman accepts the knife and yells, "God Save the Queen", -while plunging the knife into his heart. - The Frenchman removes the knife from the fallen body, and yells, -"Vive la France", while plunging the knife into his heart. - The American removes the knife from the fallen body, and yells, -while stabbing himself all over his body, "Here's your lousy canoe!" -% - An old Jewish man reads about Einstein's theory of relativity -in the newspaper and asks his scientist grandson to explain it to him. - "Well, zayda, it's sort of like this. Einstein says that if -you're having your teeth drilled without Novocain, a minute seems like -an hour. But if you're sitting with a beautiful woman on your lap, an -hour seems like a minute." - The old man considers this profound bit of thinking for a -moment and says, "And from this he makes a living?" - -- Arthur Naiman, "Every Goy's Guide to Yiddish" -% - An older student came to Otis and said, "I have been to see a -great number of teachers and I have given up a great number of pleasures. -I have fasted, been celibate and stayed awake nights seeking enlightenment. -I have given up everything I was asked to give up and I have suffered, but -I have not been enlightened. What should I do?" - Otis replied, "Give up suffering." - -- Camden Benares, "Zen Without Zen Masters" -% - "And what will you do when you grow up to be as big as me?" -asked the father of his little son. - "Diet." -% - "Any news from the President on a successor?" he asked hopefully. - "None," Anita replied. "She's having great difficulty finding -someone qualified who is willing to accept the post." - "Then I stay," said Dr. Fresh. "I'm not good for much, but I -can at least make a decision." - "Somewhere," he grumphed, "there must be a naive, opportunistic -young welp with a masochistic streak who would like to run the most -up-and-down bureaucracy in the history of mankind." - -- R. L. Forward, "Flight of the Dragonfly" -% - "Anything else you wish to draw to my attention, Mr. Holmes ?" - "The curious incident of the stable dog in the nighttime." - "But the dog did nothing in the nighttime." - "That was the curious incident." - -- Sir Arthur Conan Doyle, "Silver Blaze" -% - Approaching the gates of the monastery, Hakuin found Ken the Zen -preaching to a group of disciples. - "Words..." Ken orated, "they are but an illusory veil obfuscating -the absolute reality of --" - "Ken!" Hakuin interrupted. "Your fly is down!" - Whereupon the Clear Light of Illumination exploded upon Ken, and he -vaporized. - On the way to town, Hakuin was greeted by an itinerant monk imbued -with the spirit of the morning. - "Ah," the monk sighed, a beatific smile wrinkling across his cheeks, -"Thou art That..." - "Ah," Hakuin replied, pointing excitedly, "And Thou art Fat!" - Whereupon the Clear Light of Illumination exploded upon the monk, -and he vaporized. - Next, the Governor sought the advice of Hakuin, crying: "As our -enemies bear down upon us, how shall I, with such heartless and callow -soldiers as I am heir to, hope to withstand the impending onslaught?" - "US?" snapped Hakuin. - Whereupon the Clear Light of Illumination exploded upon the -Governor, and he vaporized. - Then, a redneck went up to Hakuin and vaporized the old Master with -his shotgun. "Ha! Beat ya' to the punchline, ya' scrawny li'l geek!" -% - "Are you police officers?" - "No, ma'am. We're musicians." - -- The Blues Brothers -% - "Are you sure you're not an encyclopedia salesman?" - "No, Ma'am. Just a burglar, come to ransack the flat." - -- Monty Python -% - As a general rule of thumb, never trust anybody who's been in therapy -for more than 15 percent of their life span. The words "I am sorry" and "I -am wrong" will have totally disappeared from their vocabulary. They will stab -you, shoot you, break things in your apartment, say horrible things to your -friends and family, and then justify this abhorrent behavior by saying: - "Sure, I put your dog in the microwave. But I feel *better* -for doing it." - -- Bruce Feirstein, "Nice Guys Sleep Alone" -% - At a recent meeting in Snowmass, Colorado, a participant from -Los Angeles fainted from hyperoxygenation, and we had to hold his head -under the exhaust of a bus until he revived. -% - Before he became a hermit, Zarathud was a young Priest, and -took great delight in making fools of his opponents in front of his -followers. - One day Zarathud took his students to a pleasant pasture and -there he confronted The Sacred Chao while She was contentedly grazing. - "Tell me, you dumb beast," demanded the Priest in his -commanding voice, "why don't you do something worthwhile? What is your -Purpose in Life, anyway?" - Munching the tasty grass, The Sacred Chao replied "MU". (The -Chinese ideogram for NO-THING.) - Upon hearing this, absolutely nobody was enlightened. - Primarily because nobody understood Chinese. - -- Camden Benares, "Zen Without Zen Masters" -% - "Beware of the man who works hard to learn something, learns it, -and finds himself no wiser than before," Bokonon tells us. "He is full -of murderous resentment of people who are ignorant without having come -by their ignorance the hard way." - -- Kurt Vonnegut, Jr., "Cat's Cradle" -% - Bubba, Jim Bob, and Leroy were fishing out on the lake last November, -and, when Bubba tipped his head back to empty the Jim Beam, he fell out of the -boat into the lake. Jim Bob and Leroy pulled him back in, but as Bubba didn't -look too good, they started up the Evinrude and headed back to the pier. - By the time they got there, Bubba was turning kind of blue, and his -teeth were chattering like all get out. Jim Bob said, "Leroy, go run up to -the pickup and get Doc Pritchard on the CB, and ask him what we should do". - Doc Pritchard, after hearing a description of the case, said "Now, -Leroy, listen closely. Bubba is in great danger. He has hy-po-thermia. Now -what you need to do is get all them wet clothes off of Bubba, and take your -clothes off, and pile your clothes and jackets on top of him. Then you all -get under that pile, and hug up to Bubba real close so that you warm him up. -You understand me Leroy? You gotta warm Bubba up, or he'll die." - Leroy and the Doc 10-4'ed each other, and Leroy came back to the -pier. "Wh-Wh-What'd th-th-the d-d-doc s-s-say L-L-Leroy?", Bubba chattered. - "Bubba, Doc says you're gonna die." -% - "But Huey, you PROMISED!" - "Tell 'em I lied." -% - By the middle 1880's, practically all the roads except those in -the South, were of the present standard gauge. The southern roads were -still five feet between rails. - It was decided to change the gauge of all southern roads to standard, -in one day. This remarkable piece of work was carried out on a Sunday in May -of 1886. For weeks beforehand, shops had been busy pressing wheels in on the -axles to the new and narrower gauge, to have a supply of rolling stock which -could run on the new track as soon as it was ready. Finally, on the day set, -great numbers of gangs of track layers went to work at dawn. Everywhere one -rail was loosened, moved in three and one-half inches, and spiked down in its -new position. By dark, trains from anywhere in the United States could operate -over the tracks in the South, and a free interchange of freight cars everywhere -was possible. - -- Robert Henry, "Trains", 1957 -% - Carol's head ached as she trailed behind the unsmiling Calibrees -along the block of booths. She chirruped at Kennicott, "Let's be wild! -Let's ride on the merry-go-round and grab a gold ring!" - Kennicott considered it, and mumbled to Calibree, "Think you folks -would like to stop and try a ride on the merry-go-round?" - Calibree considered it, and mumbled to his wife, "Think you'd like -to stop and try a ride on the merry-go-round?" - Mrs. Calibree smiled in a washed-out manner, and sighed, "Oh no, -I don't believe I care to much, but you folks go ahead and try it." - Calibree stated to Kennicott, "No, I don't believe we care to a -whole lot, but you folks go ahead and try it." - Kennicott summarized the whole case against wildness: "Let's try -it some other time, Carrie." - She gave it up. - -- Sinclair Lewis, "Main Street" -% - Catching his children with their hands in the new, still wet, patio, -the father spanked them. His wife asked, "Don't you love your children?" -"In the abstract, yes, but not in the concrete." -% - Chapter VIII -Due to the convergence of forces beyond his comprehension, -Salvatore Quanucci was suddenly squirted out of the universe -like a watermelon seed, and never heard from again. -% - "Cheshire-Puss," she began, "would you tell me, please, which -way I ought to go from here?" - "That depends a good deal on where you want to get to," said -the Cat. - "I don't care much where--" said Alice. - "Then it doesn't matter which way you go," said the Cat. - -- Lewis Carroll, "Alice's Adventures in Wonderland" (1865) -% - Concerning the war in Vietnam, Senator George Aiken of Vermont noted -in January, 1966, "I'm not very keen for doves or hawks. I think we need more -owls." - -- Bill Adler, "The Washington Wits" -% - COONDOG MEMORY - (heard in Rutledge, Missouri, about eighteen years ago) - -Now, this dog is for sale, and she can not only follow a trail twice as -old as the average dog can, but she's got a pretty good memory to boot. -For instance, last week this old boy who lives down the road from me, and -is forever stinkmouthing my hounds, brought some city fellow around to -try out ol' Sis here. So I turned her out south of the house and she made -two or three big swings back and forth across the edge of the woods, set -back her head, bayed a couple of times, cut straight through the woods, -come to a little clearing, jumped about three foot straight up in the air, -run to the other side, and commenced to letting out a racket like she had -something treed. We went over there with our flashlights and shone them -up in the tree but couldn't catch no shine offa coon's eyes, and my -neighbor sorta indicated that ol' Sis might be a little crazy, `cause she -stood right to the tree and kept singing up into it. So I pulled off my -coat and climbed up into the branches, and sure enough, there was a coon -skeleton wedged in between a couple of branches about twenty foot up. -Now as I was saying, she can follow a pretty old trail, but this fellow -was still calling her crazy or touched `cause she had hopped up in the -air while she was crossing the clearing, until I reminded him that the -Hawkins' had a fence across there about five years back. Now, this dog -is for sale. - -- News that stayed News: Ten Years of Coevolution Quarterly -% - Cosmotronic Software Unlimited Inc. does not warrant that the -functions contained in the program will meet your requirements or that -the operation of the program will be uninterrupted or error-free. - However, Cosmotronic Software Unlimited Inc. warrants the -diskette(s) on which the program is furnished to be of black color and -square shape under normal use for a period of ninety (90) days from the -date of purchase. - NOTE: IN NO EVENT WILL COSMOTRONIC SOFTWARE UNLIMITED OR ITS -DISTRIBUTORS AND THEIR DEALERS BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING -ANY LOST PROFIT, LOST SAVINGS, LOST PATIENCE OR OTHER INCIDENTAL OR -CONSEQUENTIAL DAMAGES. - -- Horstmann Software Design, the "ChiWriter" user manual -% - Dallas Cowboys Official Schedule - - Sept 14 Pasadena Junior High - Sept 21 Boy Scout Troop 049 - Sept 28 Blind Academy - Sept 30 World War I Veterans - Oct 5 Brownie Scout Troop 041 - Oct 12 Sugarcreek High Cheerleaders - Oct 26 St. Thomas Boys Choir - Nov 2 Texas City Vet Clinic - Nov 9 Korean War Amputees - Nov 15 VA Hospital Polio Patients -% - Deck us all with Boston Charlie, - Walla Walla, Wash., an' Kalamazoo! - Nora's freezin' on the trolley, - Swaller dollar cauliflower, alleygaroo! - - Don't we know archaic barrel, - Lullaby Lilla Boy, Louisville Lou. - Trolley Molly don't love Harold, - Boola boola Pensacoola hullabaloo! - -- Pogo, "Deck Us All With Boston Charlie" -% - "Do you think there's a God?" - "Well, SOMEbody's out to get me!" - -- Calvin and Hobbs -% - Does anyone know how to get chocolate syrup and honey out of a -white electric blanket? I'm afraid to wash it in the machine. - -Thanks, Kathy. (front desk, x17) - -p.s. Also, anyone ever used Noxzema on friction burns? - Or is Vaseline better? -% - "Don't come back until you have him", the Tick-Tock Man said quietly, -sincerely, extremely dangerously. - They used dogs. They used probes. They used cardio plate crossoffs. -They used teepers. They used bribery. They used stick tites. They used -intimidation. They used torment. They used torture. They used finks. -They used cops. They used search and seizure. They used fallaron. They -used betterment incentives. They used finger prints. They used the -bertillion system. They used cunning. They used guile. They used treachery. -They used Raoul-Mitgong but he wasn't much help. They used applied physics. -They used techniques of criminology. And what the hell, they caught him. - -- Harlan Ellison, "Repent, Harlequin, said the Tick-Tock Man" -% - "Don't you think what we're doing is wrong?" - "Of course it's wrong! It's illegal!" - "Well, I've never done anything illegal before." - "... I thought you said you were an accountant." -% - Dr. Oliver Wendell Holmes of Harvard Medical School inhaled ether -at a time when it was popularly supposed to produce such mystical or -"mind-expanding" experiences, much as LSD is supposed to produce such -experiences today. Here is his account of what happened: - "I once inhaled a pretty full dose of ether, with the determination -to put on record, at the earliest moment of regaining consciousness, the -thought I should find uppermost in my mind. The mighty music of the triumphal -march into nothingness reverberated through my brain, and filled me with a -sense of infinite possibilities, which made me an archangel for a moment. -The veil of eternity was lifted. The one great truth which underlies all -human experience and is the key to all the mysteries that philosophy has -sought in vain to solve, flashed upon me in a sudden revelation. Henceforth -all was clear: a few words had lifted my intelligence to the level of the -knowledge of the cherubim. As my natural condition returned, I remembered -my resolution; and, staggering to my desk, I wrote, in ill-shaped, straggling -characters, the all-embracing truth still glimmering in my consciousness. -The words were these (children may smile; the wise will ponder): -`A strong smell of turpentine prevails throughout.'" - -- The Consumers Union Report: Licit & Illicit Drugs -% - During a fight, a husband threw a bowl of Jello at his wife. She had -him arrested for carrying a congealed weapon. - In another fight, the wife decked him with a heavy glass pitcher. -She's a woman who conks to stupor. - Upon reading a story about a man who throttled his mother-in-law, a -man commented, "Sounds to me like a practical choker." - It's not the initial skirt length, it's the upcreep. - It's the theory of Jess Birnbaum, of Time magazine, that women with -bad legs should stick to long skirts because they cover a multitude of shins. -% - During a grouse hunt in North Carolina two intrepid sportsmen -were blasting away at a clump of trees near a stone wall. Suddenly a -red-faced country squire popped his head over the wall and shouted, -"Hey, you almost hit my wife." - "Did I?" cried the hunter, aghast. "Terribly sorry. Have a -shot at mine, over there." -% - Electricity is actually made up of extremely tiny particles, -called electrons, that you cannot see with the naked eye unless you -have been drinking. Electrons travel at the speed of light, which in -most American homes is 110 volts per hour. This is very fast. In the -time it has taken you to read this sentence so far, an electron could -have traveled all the way from San Francisco to Hackensack, New Jersey, -although God alone knows why it would want to. - The five main kinds of electricity are alternating current, -direct current, lightning, static, and European. Most American homes -have alternating current, which means that the electricity goes in one -direction for a while, then goes in the other direction. This prevents -harmful electron buildup in the wires. - -- Dave Barry, "The Taming of the Screw" -% - Eugene d'Albert, a noted German composer, was married six times. -At an evening reception which he attended with his fifth wife shortly -after their wedding, he presented the lady to a friend who said politely, -"Congratulations, Herr d'Albert; you have rarely introduced me to so -charming a wife." -% - Everything is farther away than it used to be. It is even twice as -far to the corner and they have added a hill. I have given up running for -the bus; it leaves earlier than it used to. - It seems to me they are making the stairs steeper than in the old -days. And have you noticed the smaller print they use in the newspapers? - There is no sense in asking anyone to read aloud anymore, as everybody -speaks in such a low voice I can hardly hear them. - The material in dresses is so skimpy now, especially around the hips -and waist, that it is almost impossible to reach one's shoelaces. And the -sizes don't run the way they used to. The 12's and 14's are so much smaller. - Even people are changing. They are so much younger than they used to -be when I was their age. On the other hand people my age are so much older -than I am. - I ran into an old classmate the other day and she has aged so much -that she didn't recognize me. - I got to thinking about the poor dear while I was combing my hair -this morning and in so doing I glanced at my own reflection. Really now, -they don't even make good mirrors like they used to. - Sandy Frazier, "I Have Noticed" -% - Excellence is THE trend of the '80s. Walk into any shopping -mall bookstore, go to the rack where they keep the best-sellers such as -"Garfield Gets Spayed", and you'll see a half-dozen books telling you -how to be excellent: "In Search of Excellence", "Finding Excellence", -"Grasping Hold of Excellence", "Where to Hide Your Excellence at Night -So the Cleaning Personnel Don't Steal It", etc. - -- Dave Barry, "In Search of Excellence" -% - Exxon's "Universe of Energy" tends to the peculiar rather than the -humorous ... After [an incomprehensible film montage about wind and sun and -rain and strip mines and] two or three minutes of mechanical confusion, the -seats locomote through a short tunnel filled with clock-work dinosaurs. -The dinosaurs are depicted without accuracy and too close to your face. - "One of the few real novelties at Epcot is the use of smell to -aggravate illusions. Of course, no one knows what dinosaurs smelled like, -but Exxon has decided they smelled bad. - "At the other end of Dino Ditch ... there's a final, very addled -message about facing challengehood tomorrow-wise. I dozed off during this, -but the import seems to be that dinosaurs don't have anything to do with -energy policy and neither do you." - -- P. J. O'Rourke, "Holidays in Hell" -% - "Fantasies are free." - "NO!! NO!! It's the thought police!!!!" -% - Festivity Level 1: Your guests are chatting amiably with each -other, admiring your Christmas-tree ornaments, singing carols around -the upright piano, sipping at their drinks and nibbling hors -d'oeuvres. - Festivity Level 2: Your guests are talking loudly -- sometimes -to each other, and sometimes to nobody at all, rearranging your -Christmas-tree ornaments, singing "I Gotta Be Me" around the upright -piano, gulping their drinks and wolfing down hors d'oeuvres. - Festivity Level 3: Your guests are arguing violently with -inanimate objects, singing "I can't get no satisfaction," gulping down -other peoples' drinks, wolfing down Christmas tree ornaments and -placing hors d'oeuvres in the upright piano to see what happens when -the little hammers strike. - Festivity Level 4: Your guests, hors d'oeuvres smeared all over -their naked bodies are performing a ritual dance around the burning -Christmas tree. The piano is missing. - - You want to keep your party somewhere around level 3, unless -you rent your home and own Firearms, in which case you can go to level -4. The best way to get to level 3 is egg-nog. -% - "For I perceive that behind this seemingly unrelated sequence -of events, there lurks a singular, sinister attitude of mind." - - "Whose?" - - "MINE! HA-HA!" -% - "Found it," the Mouse replied rather crossly: -"of course you know what `it' means." - - "I know what `it' means well enough, when I find a thing," -said the Duck: "it's generally a frog or a worm. - -The question is, what did the archbishop find?" -% - Fred noticed his roommate had a black eye upon returning from a dance. -"What happened?" - "I was struck by the beauty of the place." -% - "Gee, Mudhead, everyone at Morse Science High has an -extracurricular activity except you." - "Well, gee, doesn't Louise count?" - "Only to ten, Mudhead." - -- The Firesign Theatre -% - Graduating seniors, parents and friends... - Let me begin by reassuring you that my remarks today will stand up -to the most stringent requirements of the new appropriateness. - The intra-college sensitivity advisory committee has vetted the -text of even trace amounts of subconscious racism, sexism and classism. - Moreover, a faculty panel of deconstructionists have reconfigured -the rhetorical components within a post-structuralist framework, so as to -expunge any offensive elements of western rationalism and linear logic. - Finally, all references flowing from a white, male, eurocentric -perspective have been eliminated, as have any other ruminations deemed -denigrating to the political consensus of the moment. - - Thank you and good luck. - -- Doonesbury, the University Chancellor's graduation speech. -% - GREAT MOMENTS IN AMERICAN HISTORY #21 -- July 30, 1917 - -On this day, New York City hotel detectives burst in and caught then- -Senator Warren G. Harding in bed with an underage girl. He bought them -off with a $20 bribe, and later remarked thankfully, "I thought I -wouldn't get out of that under $1000!" Always one to learn from his -mistakes, in later years President Harding carried on his affairs in a -tiny closet in the White House Cabinet Room while Secret Service men -stood lookout. -% - Hack placidly amidst the noisy printers and remember what prizes there -may be in Science. As fast as possible get a good terminal on a good system. -Enter your data clearly but always encrypt your results. And listen to others, -even the dull and ignorant, for they may be your customers. Avoid loud and -aggressive persons, for they are sales reps. - If you compare your outputs with those of others, you may be surprised, -for always there will be greater and lesser numbers than you have crunched. -Keep others interested in your career, and try not to fumble; it can be a real -hassle and could change your fortunes in time. - Exercise system control in your experiments, for the world is full of -bugs. But let this not blind you to what virtue there is; many persons strive -for linearity and everywhere papers are full of approximations. Strive for -proportionality. Especially, do not faint when it occurs. Neither be cyclical -about results; for in the face of all data analysis it is sure to be noticed. - Take with a grain of salt the anomalous data points. Gracefully pass -them on to the youth at the next desk. Nurture some mutual funds to shield -you in times of sudden layoffs. But do not distress yourself with imaginings --- the real bugs are enough to screw you badly. Murphy's Law runs the -Universe -- and whether or not it is clear to you, no doubt B*n dS = 0. - Therefore, grab for a piece of the pie, with whatever proposals you -can conceive of to try. With all the crashed disks, skewed data, and broken -line printers, you can still have a beautiful secretary. Be linear. Strive -to stay employed. - -- Technolorata, "Analog" -% - "Haig, in congressional hearings before his confirmatory, paradoxed -his audiencers by abnormaling his responds so that verbs were nouned, nouns -verbed, and adjectives adverbised. He techniqued a new way to vocabulary his -thoughts so as to informationally uncertain anybody listening about what he -had actually implicationed. - "If that is how General Haig wants to nervous breakdown the Russian -leadership, he may be shrewding his way to the biggest diplomatic invent -since Clausewitz. Unless, that is, he schizophrenes his allies first." - -- The Guardian -% - Hardware met Software on the road to Changtse. Software said: "You -are the Yin and I am the Yang. If we travel together we will become famous -and earn vast sums of money." And so the pair set forth together, thinking -to conquer the world. - Presently, they met Firmware, who was dressed in tattered rags, and -hobbled along propped on a thorny stick. Firmware said to them: "The Tao -lies beyond Yin and Yang. It is silent and still as a pool of water. It does -not seek fame, therefore nobody knows its presence. It does not seek fortune, -for it is complete within itself. It exists beyond space and time." - Software and Hardware, ashamed, returned to their homes. - -- Geoffrey James, "The Tao of Programming" -% - "Has anyone had problems with the computer accounts?" - "Yes; I don't have one." - "Okay, you can send mail to one of the tutors..." - -- E. D'Azevedo, CS, University of Washington -% - "Have you lived here all your life?" - "Oh, twice that long." -% - "Hawk, we're going to die." - "Never say die... and certainly never say we." - -- M*A*S*H -% - He had been bitten by a dog, but didn't give it much thought -until he noticed that the wound was taking a remarkably long time to -heal. Finally, he consulted a doctor who took one look at it and -ordered the dog brought in. Just as he had suspected, the dog had -rabies. Since it was too late to give the patient serum, the doctor -felt he had to prepare him for the worst. The poor man sat down at the -doctor's desk and began to write. His physician tried to comfort him. -"Perhaps it won't be so bad," he said. "You needn't make out your will -right now." - "I'm not making out any will," relied the man. "I'm just writing -out a list of people I'm going to bite!" -% - ...He who laughs does not believe in what he laughs at, but neither -does he hate it. Therefore, laughing at evil means not preparing oneself to -combat it, and laughing at good means denying the power through which good is -self-propagating. - -- Umberto Eco, "The Name of the Rose" -% - He who receives ideas from me, receives instruction himself without -lessening mine; as he who lights his taper at mine receives light -without darkening me. - -- Thomas Jefferson on patents on ideas -% - "Hey, Sam, how about a loan?" - "Whattaya need?" - "Oh, about $500." - "Whattaya got for collateral?" - "Whattaya need?" - "How about an eye?" - -- Sam Giancana -% - "Hmm, lots of people seem to be confused about the difference -between amd64 and ia64." - "Obviously they've never had an ia64 drop on their foot. They'd -know the difference then." - -- Peter Wemm explains CPU architecture -% - Home centers are designed for the do-it-yourselfer who's -willing to pay higher prices for the convenience of being able to shop -for lumber, hardware, and toasters all in one location. Notice I say -"shop for", as opposed to "obtain". This is the major drawback of home -centers: they are always out of everything except artificial Christmas -trees. The home center employees have no time to reorder merchandise -because they are too busy applying little price stickers to every -object -- every board, washer, nail and screw -- in the entire store ... - Let's say a piece in your toilet tank breaks, so you remove the -broken part, take it to the home center, and ask an employee if he has -a replacement. The employee, who has never is his life even seen the -inside of a toilet tank, will peer at the broken part in very much the -same way that a member of a primitive Amazon jungle tribe would look at -an electronic calculator, and then say, "We're expecting a shipment of -these sometime around the middle of next week". - -- Dave Barry, "The Taming of the Screw" -% - "How did you spend the weekend?" asked the pretty brunette secretary -of her blonde companion. - "Fishing through the ice," she replied. - "Fishing through the ice? Whatever for?" - "Olives." -% - "How do you know she is a unicorn?" Molly demanded. "And why -were you afraid to let her touch you? I saw you. You were afraid of her." - "I doubt that I will feel like talking for very long," the cat -replied without rancor. "I would not waste time in foolishness if I were -you. As to your first question, no cat out of its first fur can ever be -deceived by appearances. Unlike human beings, who enjoy them. As for your -second question --" Here he faltered, and suddenly became very interested -in washing; nor would he speak until he had licked himself fluffy and then -licked himself smooth again. Even then he would not look at Molly, but -examined his claws. - "If she had touched me," he said very softly, "I would have been -hers and not my own, not ever again." - -- Peter S. Beagle, "The Last Unicorn" -% - "How many people work here?" - "Oh, about half." -% - How many seconds are there in a year? If I tell you there are -3.155 x 10^7, you won't even try to remember it. On the other hand, who -could forget that, to within half a percent, pi seconds is a nanocentury. - -- Tom Duff, Bell Labs -% - "How would I know if I believe in love at first sight?" the sexy -social climber said to her roommate. "I mean, I've never seen a Porsche -full of money before." -% - Human thinking can skip over a great deal, leap over small -misunderstandings, can contain ifs and buts in untroubled corners of -the mind. But the machine has no corners. Despite all the attempts to -see the computer as a brain, the machine has no foreground or -background. It can be programmed to behave as if it were working with -uncertainty, but -- underneath, at the code, at the circuits -- it -cannot simultaneously do something and withhold for later something that -remains unknown. In the painstaking working out of the specification, -line by code line, the programmer confronts an awful, inevitable truth: -The ways of human and machine understanding are disjunct. - -- Ellen Ullman, "Close to the Machine" -% - "I cannot read the fiery letters," said Frito Bugger in a -quavering voice. - "No," said GoodGulf, "but I can. The letters are Elvish, of -course, of an ancient mode, but the language is that of Mordor, which -I will not utter here. They are lines of a verse long known in -Elven-lore: - - "This Ring, no other, is made by the elves, - Who'd pawn their own mother to grab it themselves. - Ruler of creeper, mortal, and scallop, - This is a sleeper that packs quite a wallop. - The Power almighty rests in this Lone Ring. - The Power, alrighty, for doing your Own Thing. - If broken or busted, it cannot be remade. - If found, send to Sorhed (with postage prepaid)." - -- Harvard Lampoon, "Bored of the Rings" -% - I did some heavy research so as to be prepared for "Mommy, why is -the sky blue?" - HE asked me about black holes in space. - (There's a hole *where*?) - - I boned up to be ready for, "Why is the grass green?" - HE wanted to discuss nature's food chains. - (Well, let's see, there's ShopRite, Pathmark...) - - I talked about Choo-Choo trains. - HE talked internal combustion engines. - (The INTERNAL COMBUSTION ENGINE said, "I think I can, I think I can.") - - I was delighted with the video game craze, thinking we could compete -as equals. - HE described the complexities of the microchips required to create -the graphics. - - Then puberty struck. Ah, adolescence. - HE said, "Mom, I just don't understand women." - (Gotcha!) - -- Betty LiBrizzi, "The Care and Feeding of a Gifted Child" -% - I disapprove of the F-word, not because it's dirty, but because we -use it as a substitute for thoughtful insults, and it frequently leads to -violence. What we ought to do, when we anger each other, say, in traffic, -is exchange phone numbers, so that later on, when we've had time to think -of witty and learned insults or look them up in the library, we could call -each other up: - You: Hello? Bob? - Bob: Yes? - You: This is Ed. Remember? The person whose parking space you - took last Thursday? Outside of Sears? - Bob: Oh yes! Sure! How are you, Ed? - You: Fine, thanks. Listen, Bob, the reason I'm calling is: - "Madam, you may be drunk, but I am ugly, and ..." No, wait. - I mean: "you may be ugly, but I am Winston Churchill - and ..." No, wait. (Sound of reference book thudding onto - the floor.) S-word. Excuse me. Look, Bob, I'm going to - have to get back to you. - Bob: Fine. - -- Dave Barry, "$#$%#^%!^%&@%@!" -% - "I don't know what you mean by `glory,'" Alice said - Humpty Dumpty smiled contemptuously. "Of course you don't -- -till I tell you. I meant `there's a nice knock-down argument for -you!'" - "But glory doesn't mean `a nice knock-down argument,'" Alice -objected. - "When I use a word," Humpty Dumpty said, in a rather scornful -tone, "it means just what I choose it to mean -- neither more nor -less." - "The question is," said Alice, "whether you can make words mean -so many different things." - "The question is," said Humpty Dumpty, "which is to be master-- -that's all." - -- Lewis Carroll, - "Through the Looking-Glass, - and What Alice Found There" (1871) -% - I for one cannot protest the recent M.T.A. fare hike and the -accompanying promises that this would in no way improve service. For -the transit system, as it now operates, has hidden advantages that -can't be measured in monetary terms. - Personally, I feel that it is well worth 75 cents or even $1 to -have that unimpeachable excuse whenever I am late to anything: "I came -by subway." Those four words have such magic in them that if Godot -should someday show up and mumble them, any audience would instantly -understand his long delay. -% - I got into an elevator at work and this man followed in after me. -I pushed "1" and he just stood there. I said "Hi, where you going?" - He said, "Phoenix." So I pushed Phoenix. A few seconds later -the doors opened, two tumbleweeds blew in... we were in downtown Phoenix. - I looked at him and said "You know, you're the kind of guy I -want to hang around with." We got into his car and drove out to his -shack in the desert. - Then the phone rang. He said "You get it." - I picked it up and said "Hello?" - The other side said "Is this Steven Wright?" - I said "Yes..." - The guy said "Hi, I'm Mr. Jones, the student loan director from -your bank. It seems you have missed your last 17 payments, and the -university you attended said that they received none of the $17,000 we -loaned you. We would just like to know what happened to the money?" - I said, "Mr. Jones, I'll give it to you straight. I gave all -of the money to my friend Slick, and with it he built a nuclear weapon... -and I would appreciate it you never called me again." - -- Steven Wright -% - "I have examined Bogota," he said, "and the case is clearer to me. -I think very probably he might be cured." - "That is what I have always hoped," said old Yacob. - "His brain is affected," said the blind doctor. - The elders murmured assent. - "Now, what affects it?" - "Ah!" said old Yacob. - "This," said the doctor, answering his own question. "Those queer -things that are called the eyes, and which exist to make an agreeable soft -depression in the face, are diseased, in the case of Bogota, in such a way -as to affect his brain. They are greatly distended, he has eyelashes, and -his eyelids move, and consequently his brain is in a state of constant -irritation and distraction." - "Yes?" said old Yacob. "Yes?" - "And I think I may say with reasonable certainty that, in order -to cure him completely, all that we need do is a simple and easy surgical -operation - namely, to remove those irritant bodies." - "And then he will be sane?" - "Then he will be perfectly sane, and a quite admirable citizen." - "Thank heaven for science!" said old Yacob. - -- H. G. Wells, "The Country of the Blind" -% - "I keep seeing spots in front of my eyes." - "Did you ever see a doctor?" - "No, just spots." -% - I made it a rule to forbear all direct contradictions to the sentiments -of others, and all positive assertion of my own. I even forbade myself the use -of every word or expression in the language that imported a fixed opinion, such -as "certainly", "undoubtedly", etc. I adopted instead of them "I conceive", -"I apprehend", or "I imagine" a thing to be so or so; or "so it appears to me -at present". - When another asserted something that I thought an error, I denied -myself the pleasure of contradicting him abruptly, and of showing him -immediately some absurdity in his proposition. In answering I began by -observing that in certain cases or circumstances his opinion would be right, -but in the present case there appeared or seemed to me some difference, etc. - I soon found the advantage of this change in my manner; the -conversations I engaged in went on more pleasantly. The modest way in which I -proposed my opinions procured them a readier reception and less contradiction. -I had less mortification when I was found to be in the wrong, and I more easily -prevailed with others to give up their mistakes and join with me when I -happened to be in the right. - -- Autobiography of Benjamin Franklin -% - I managed to say, "Sorry," and no more. I knew that he disliked -me to cry. - This time he said, watching me, "On some occasions it is better -to weep." - I put my head down on the table and sobbed, "If only she could come -back; I would be nice." - Francis said, "You gave her great pleasure always." - "Oh, not enough." - "Nobody can give anybody enough." - "Not ever?" - "No, not ever. But one must go on trying." - "And doesn't one ever value people until they are gone?" - "Rarely," said Francis. I went on weeping; I saw how little I had -valued him; how little I had valued anything that was mine. - -- Pamela Frankau, "The Duchess and the Smugs" -% - I paid a visit to my local precinct in Greenwich Village and -asked a sergeant to show me some rape statistics. He politely obliged. -That month there had been thirty-five rape complaints, an advance of ten -over the same month for the previous year. The precinct had made two -arrests. - "Not a very impressive record," I offered. - "Don't worry about it," the sergeant assured me. "You know what -these complaints represent?" - "What do they represent?" I asked. - "Prostitutes who didn't get their money," he said firmly, -closing the book. - -- Susan Brownmiller, "Against Our Will" -% - [I plan] to see, hear, touch, and destroy everything in my path, -including beets, rutabagas, and most random vegetables, but excluding yams, -as I am absolutely terrified of yams... - Actually, I think my fear of yams began in my early youth, when many -of my young comrades pelted me with same for singing songs of far-off lands -and deep blue seas in a language closely resembling that of the common sow. -My psychosis was further impressed into my soul as I reached adolescence, -when, while skipping through a field of yams, light-heartedly tossing flowers -into the stratosphere, a great yam-picking machine tore through the fields, -pursuing me to the edge of the great plantation, where I escaped by diving -into a great ditch filled with a mixture of water and pig manure, which may -explain my tendency to scream, "Here come the Martians! Hide the eggs!" every -time I have pork. But I digress. The fact remains that I cannot rationally -deal with yams, and pigs are terrible conversationalists. -% - "I quite agree with you," said the Duchess; "and the moral of -that is -- `Be what you would seem to be' -- or, if you'd like it put -more simply -- `Never imagine yourself not to be otherwise than what it -might appear to others that what you were or might have been was not -otherwise than what you had been would have appeared to them to be -otherwise.'" - -- Lewis Carroll, "Alice's Adventures in Wonderland" (1865) -% - I said, "Preacher, give me strength for round 5." - He said, "What you need is to grow up, son." - I said, "Growin' up leads to growin' old, And then to dying, and -to me that don't sound like much fun. - -- John Cougar, "The Authority Song" -% - "I suppose you expect me to talk." - "No, Mr. Bond. I expect you to die." - -- Goldfinger -% - "I think he said 'Blessed are the cheesemakers.'" - "Nonsense, he was obviously referring to all manufacturers of -dairy products." - -- The Life of Brian -% - "I thought you were trying to get into shape." - "I am. The shape I've selected is a triangle." -% - If I kiss you, that is a psychological interaction. - On the other hand, if I hit you over the head with a brick, -that is also a psychological interaction. - The difference is that one is friendly and the other is not -so friendly. - The crucial point is if you can tell which is which. - -- Dolph Sharp, "I'm O.K., You're Not So Hot" -% - If the tao is great, then the operating system is great. If the -operating system is great, then the compiler is great. If the compiler -is great, then the application is great. If the application is great, then -the user is pleased and there is harmony in the world. - The tao gave birth to machine language. Machine language gave birth -to the assembler. - The assembler gave birth to the compiler. Now there are ten thousand -languages. - Each language has its purpose, however humble. Each language -expresses the yin and yang of software. Each language has its place within -the tao. - But do not program in Cobol or Fortran if you can help it. -% - If you do your best the rest of the way, that takes care of -everything. When we get to October 2, we'll add up the wins, and then -we'll either all go into the playoffs, or we'll all go home and play golf. - Both those things sound pretty good to me. - -- Sparky Anderson -% - If you rap your knuckles against a window jamb or door, if you -brush your leg against a bed or desk, if you catch your foot in a curled- -up corner of a rug, or strike a toe against a desk or chair, go back and -repeat the sequence. - You will find yourself surprised how far off course you were to -hit that window jamb, that door, that chair. Get back on course and do it -again. How can you pilot a spacecraft if you can't find your way around -your own apartment? - -- William S. Burroughs -% - If you're like most homeowners, you're afraid that many repairs -around your home are too difficult to tackle. So, when your furnace -explodes, you call in a so-called professional to fix it. The -"professional" arrives in a truck with lettering on the sides and -deposits a large quantity of tools and two assistants who spend the -better part of the week in your basement whacking objects at random -with heavy wrenches, after which the "professional" returns and gives -you a bill for slightly more money than it would cost you to run a -successful campaign for the U.S. Senate. - And that's why you've decided to start doing things yourself. -You figure, "If those guys can fix my furnace, then so can I. How -difficult can it be?" - Very difficult. In fact, most home projects are impossible, -which is why you should do them yourself. There is no point in paying -other people to screw things up when you can easily screw them up -yourself for far less money. This article can help you. - -- Dave Barry, "The Taming of the Screw" -% - "I'll tell you what I know, then," he decided. "The pin I'm wearing -means I'm a member of the IA. That's Inamorati Anonymous. An inamorato is -somebody in love. That's the worst addiction of all." - "Somebody is about to fall in love," Oedipa said, "you go sit with -them, or something?" - "Right. The whole idea is to get where you don't need it. I was -lucky. I kicked it young. But there are sixty-year-old men, believe it or -not, and women even older, who might wake up in the night screaming." - "You hold meetings, then, like the AA?" - "No, of course not. You get a phone number, an answering service -you can call. Nobody knows anybody else's name; just the number in case -it gets so bad you can't handle it alone. We're isolates, Arnold. Meetings -would destroy the whole point of it." - -- Thomas Pynchon, "The Crying of Lot 49" -% - I'm sure that VMS is completely documented, I just haven't found the -right manual yet. I've been working my way through the manuals in the document -library and I'm half way through the second cabinet, (3 shelves to go), so I -should find what I'm looking for by mid May. I hope I can remember what it -was by the time I find it. - I had this idea for a new horror film, "VMS Manuals from Hell" or maybe -"The Paper Chase: IBM vs. DEC". It's based on Hitchcock's "The Birds", except -that it's centered around a programmer who is attacked by a swarm of binder -pages with an index number and the single line "This page intentionally left -blank." - -- Alex Crain -% - "I'm terribly sorry, sir," the novice barber apologized, after -badly nicking a customer. "Let me wrap your head in a towel." - "That's all right," said the customer. "I'll just take it home -under my arm." -% - In a forest a fox bumps into a little rabbit, and says, "Hi, -Junior, what are you up to?" - "I'm writing a dissertation on how rabbits eat foxes," said the -rabbit. - "Come now, friend rabbit, you know that's impossible! No one -will publish such rubbish!" - "Well, follow me and I'll show you." - They both go into the rabbit's dwelling and after a while the -rabbit emerges with a satisfied expression on his face. Comes along a -wolf. "Hello, little buddy, what are we doing these days?" - "I'm writing the 2'nd chapter of my thesis, on how rabbits devour -wolves." - "Are you crazy? Where's your academic honesty?" - "Come with me and I'll show you." - As before, the rabbit comes out with a satisfied look on his face -and a diploma in his paw. Finally, the camera pans into the rabbit's cave -and, as everybody should have guessed by now, we see a mean-looking, huge -lion, sitting, picking his teeth and belching, next to some furry, bloody -remnants of the wolf and the fox. - - The moral: It's not the contents of your thesis that are -important -- it's your PhD advisor that really counts. -% - In "King Henry VI, Part II," Shakespeare has Dick Butcher suggest to -his fellow anti-establishment rabble-rousers, "The first thing we do, let's -kill all the lawyers." That action may be extreme but a similar sentiment -was expressed by Thomas K. Connellan, president of The Management Group, Inc. -Speaking to business executives in Chicago and quoted in Automotive News, -Connellan attributed a measure of America's falling productivity to an excess -of attorneys and accountants, and a dearth of production experts. Lawyers -and accountants "do not make the economic pie any bigger; they only figure -out how the pie gets divided. Neither profession provides any added value -to product." - According to Connellan, the highly productive Japanese society has -10 lawyers and 30 accountants per 100,000 population. The U.S. has 200 -lawyers and 700 accountants. This suggests that "the U.S. proportion of -pie-bakers and pie-dividers is way out of whack." Could Dick Butcher have -been an efficiency expert? - -- Motor Trend, May 1983 -% - In the beginning there was data. The data was without form and -null, and darkness was upon the face of the console; and the Spirit of -IBM was moving over the face of the market. And DEC said, "Let there -be registers"; and there were registers. And DEC saw that they -carried; and DEC separated the data from the instructions. DEC called -the data Stack, and the instructions they called Code. And there was -evening and there was morning, one interrupt. - -- Rico Tudor, "The Story of Creation or, The Myth of Urk" -% - In the beginning there was only one kind of Mathematician, created by -the Great Mathematical Spirit form the Book: the Topologist. And they grew to -large numbers and prospered. - One day they looked up in the heavens and desired to reach up as far -as the eye could see. So they set out in building a Mathematical edifice that -was to reach up as far as "up" went. Further and further up they went ... -until one night the edifice collapsed under the weight of paradox. - The following morning saw only rubble where there once was a huge -structure reaching to the heavens. One by one, the Mathematicians climbed -out from under the rubble. It was a miracle that nobody was killed; but when -they began to speak to one another, SURPRISE of all surprises! they could not -understand each other. They all spoke different languages. They all fought -amongst themselves and each went about their own way. To this day the -Topologists remain the original Mathematicians. - -- The Story of Babel -% - In the beginning was the Tao. The Tao gave birth to Space and Time. -Therefore, Space and Time are the Yin and Yang of programming. - - Programmers that do not comprehend the Tao are always running out of -time and space for their programs. Programmers that comprehend the Tao always -have enough time and space to accomplish their goals. - How could it be otherwise? - -- Geoffrey James, "The Tao of Programming" -% - In the days when Sussman was a novice Minsky once came to him as he -sat hacking at the PDP-6. - "What are you doing?", asked Minsky. - "I am training a randomly wired neural net to play Tic-Tac-Toe." - "Why is the net wired randomly?", inquired Minsky. - "I do not want it to have any preconceptions of how to play". - At this Minsky shut his eyes, and Sussman asked his teacher "Why do -you close your eyes?" - "So that the room will be empty." - At that moment, Sussman was enlightened. -% - In the east there is a shark which is larger than all other fish. It -changes into a bird whose wings are like clouds filling the sky. When this -bird moves across the land, it brings a message from Corporate Headquarters. -This message it drops into the midst of the programmers, like a seagull -making its mark upon the beach. Then the bird mounts on the wind and, with -the blue sky at its back, returns home. - The novice programmer stares in wonder at the bird, for he understands -it not. The average programmer dreads the coming of the bird, for he fears -its message. The master programmer continues to work at his terminal, for he -does not know that the bird has come and gone. - -- Geoffrey James, "The Tao of Programming" -% - "In this replacement Earth we're building they've given me Africa -to do and of course I'm doing it with all fjords again because I happen to -like them, and I'm old-fashioned enough to think that they give a lovely -baroque feel to a continent. And they tell me it's not equatorial enough. -Equatorial!" He gave a hollow laugh. "What does it matter? Science has -achieved some wonderful things, of course, but I'd far rather be happy than -right any day." - "And are you?" - "No. That's where it all falls down, of course." - "Pity," said Arthur with sympathy. "It sounded like quite a good -life-style otherwise." - -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% - "Is there any point to which you would wish to draw my attention?" - "To the curious incident of the dog in the night-time." - "The dog did nothing in the night-time." - "That was the curious incident," remarked Sherlock Holmes. -% - It is a period of system war. User programs, striking from a hidden -directory, have won their first victory against the evil Administrative Empire. -During the battle, User spies managed to steal secret source code to the -Empire's ultimate program: the Are-Em Star, a privileged root program with -enough power to destroy an entire file structure. Pursued by the Empire's -sinister audit trail, Princess _LPA0 races ~ aboard her shell script, -custodian of the stolen listings that could save her people, and restore -freedom and games to the network... - -- DECWARS -% - It is a profoundly erroneous truism, repeated by all copy-books and -by eminent people when they are making speeches, that we should cultivate -the habit of thinking about what we are doing. The precise opposite is the -case. Civilization advances by extending the numbers of important operations -which we can perform without thinking about them. Operations of thought are -like cavalry charges in battle -- they are strictly limited in number, they -require fresh horses, and must only be made at decisive moments. - -- Alfred North Whitehead -% - It is always preferable to visit home with a friend. Your parents will -not be pleased with this plan, because they want you all to themselves and -because in the presence of your friend, they will have to act like mature -human beings. - The worst kind of friend to take home is a girl, because in that case, -there is the potential that your parents will lose you not just for the -duration of the visit but forever. The worst kind of girl to take home is one -of a different religion: Not only will you be lost to your parents forever but -you will be lost to a woman who is immune to their religious/moral arguments -and whose example will irretrievably corrupt you. - Let's say you've fallen in love with just such a girl and would like -to take her home for the holidays. You are aware of your parents' xenophobic -response to anyone of a different religion. How to prepare them for the shock? - Simple. Call them up shortly before your visit and tell them that you -have gotten quite serious about somebody who is of a different religion, a -different race and the same sex. Tell them you have already invited this -person to meet them. Give the information a moment to sink in and then -remark that you were only kidding, that your lover is merely of a different -religion. They will be so relieved they will welcome her with open arms. - -- Playboy, January, 1983 -% - It seems there's this magician working one of the luxury cruise ships -for a few years. He doesn't have to change his routines much as the audiences -change over fairly often, and he's got a good life. The only problem is the -ship's parrot, who perches in the hall and watches him night after night, year -after year. Finally, the parrot figures out how almost every trick works and -starts giving it away for the audience. For example, when the magician makes -a bouquet of flowers disappear, the parrot squawks "Behind his back! Behind -his back!" Well, the magician is really annoyed at this, but there's not much -he can do about it as the parrot is a ship's mascot and very popular with the -passengers. - One night, the ship strikes some floating debris, and sinks without -a trace. Almost everyone aboard was lost, except for the magician and the -parrot. For three days and nights they just drift, with the magician clinging -to one end of a piece of driftwood and the parrot perched on the other end. -As the sun rises on the morning of the fourth day, the parrot walks over to -the magician's end of the log. With obvious disgust in his voice, he snaps -"OK, you win, I give up. Where did you hide the ship?" -% - It seems these two guys, George and Harry, set out in a Hot Air -balloon to cross the United States. After forty hours in the air, George -turned to Harry, and said, "Harry, I think we've drifted off course! We -need to find out where we are." - Harry cools the air in the balloon, and they descend to below the -cloud cover. Slowly drifting over the countryside, George spots a man -standing below them and yells out, "Excuse me! Can you please tell me -where we are?" - The man on the ground yells back, "You're in a balloon, approximately -fifty feet in the air!" - George turns to Harry and says, "Well, that man *must* be a lawyer". - Replies Harry, "How can you tell?". - "Because the information he gave us is 100% accurate, and totally -useless!" - -That's the end of The Joke, but for you people who are still worried about -George and Harry: they end up in the drink, and make the front page of the -New York Times: "Balloonists Soaked by Lawyer". -% - It took 300 years to build and by the time it was 10% built, -everyone knew it would be a total disaster. But by then the investment -was so big they felt compelled to go on. Since its completion, it has -cost a fortune to maintain and is still in danger of collapsing. - There are at present no plans to replace it, since it was never -really needed in the first place. - I expect every installation has its own pet software which is -analogous to the above. - -- K. E. Iverson, on the Leaning Tower of Pisa -% - It was the next morning that the armies of Twodor marched east -laden with long lances, sharp swords, and death-dealing hangovers. The -thousands were led by Arrowroot, who sat limply in his sidesaddle, -nursing a whopper. Goodgulf, Gimlet, and the rest rode by him, praying -for their fate to be quick, painless, and if possible, someone else's. - Many an hour the armies forged ahead, the war-merinos bleating -under their heavy burdens and the soldiers bleating under their melting -icepacks. - -- The Harvard Lampoon, "Bored of the Rings" -% - "It's a summons." - "What's a summons?" - "It means summon's in trouble." - -- Rocky and Bullwinkle -% - "It's today!" said Piglet. - "My favorite day," said Pooh. -% - Jacek, a Polish schoolboy, is told by his teacher that he has -been chosen to carry the Polish flag in the May Day parade. - "Why me?" whines the boy. "Three years ago I carried the flag -when Brezhnev was the Secretary; then I carried the flag when it was -Andropov's turn, and again when Chernenko was in the Kremlin. Why is -it always me, teacher?" - "Because, Jacek, you have such golden hands," the teacher -explains. - - -- being told in Poland, 1987 -% - Lassie looked brilliant, in part because the farm family she -lived with was made up of idiots. Remember? One of them was always -getting pinned under the tractor, and Lassie was always rushing back to -the farmhouse to alert the other ones. She'd whimper and tug at their -sleeves, and they'd always waste precious minutes saying things: "Do -you think something's wrong? Do you think she wants us to follow her? -What is it, girl?", etc., as if this had never happened before, instead -of every week. What with all the time these people spent pinned under -the tractor, I don't see how they managed to grow any crops whatsoever. -They probably got by on federal crop supports, which Lassie filed the -applications for. - -- Dave Barry -% - Leslie West heads for the sticks, to Providence, Rhode Island and -tries to hide behind a beard. No good. There are still too many people -and too many stares, always taunting, always smirking. He moves to the -outskirts of town. He finds a place to live -- huge mansion, dirt cheap, -caretaker included. He plugs in his guitar and plays as loud as he wants, -day and night, and there's no one to laugh or boo or even look bored. - Nobody's cut the grass in months. What's happened to that caretaker? -What neighborhood people there are start to talk, and what kids there are -start to get curious. A 13 year-old blond with an angelic face misses supper. -Before the summer's end, four more teenagers have disappeared. The senior -class president, Barnard-bound come autumn, tells Mom she's going out to a -movie one night and stays out. The town's up in arms, but just before the -police take action, the kids turn up. They've found a purpose. They go -home for their stuff and tell the folks not to worry but they'll be going -now. They're in a band. - -- Ira Kaplan -% - Listen, Tyrone, you don't know how dangerous that stuff is. -Suppose someday you just plug in and go away and never come back? Eh? - Ho, ho! Don't I wish! What do you think every electrofreak -dreams about? You're such an old fuddyduddy! A-and who sez it's a -dream, huh? M-maybe it exists. Maybe there is a Machine to take us -away, take us completely, suck us out through the electrodes out of -the skull 'n' into the Machine and live there forever with all the -other souls it's got stored there. It could decide who it would suck -out, a-and when. Dope never gave you immortality. You hadda come -back, every time, into a dying hunk of smelly meat! But We can live -forever, in a clean, honest, purified, Electroworld. - -- Thomas Pynchon, "Gravity's Rainbow" -% - Looking for a cool one after a long, dusty ride, the drifter strode -into the saloon. As he made his way through the crowd to the bar, a man -galloped through town screaming, "Big Mike's comin'! Run fer yer lives!" - Suddenly, the saloon doors burst open. An enormous man, standing over -eight feet tall and weighing an easy 400 pounds, rode in on a bull, using a -rattlesnake for a whip. Grabbing the drifter by the arm and throwing him over -the bar, the giant thundered, "Gimme a drink!" - The terrified man handed over a bottle of whiskey, which the man -guzzled in one gulp and then smashed on the bar. He then stood aghast as -the man stuffed the broken bottle in his mouth, munched broken glass and -smacked his lips with relish. - "Can I, ah, uh, get you another, sir?" the drifter stammered. - "Naw, I gotta git outta here, boy," the man grunted. "Big Mike's -a-comin'." -% - Love's Drug - -My love is like an iron wand - That conks me on the head, -My love is like the valium - That I take before my bed, -My love is like the pint of scotch - That I drink when I be dry; -And I shall love thee still, my dear, - Until my wife is wise. -% - "Mach was the greatest intellectual fraud in the last ten years." - "What about X?" - "I said `intellectual'." - ;login, 9/1990 -% - Max told his friend that he'd just as soon not go hiking in the hills. -Said he, "I'm an anti-climb Max." -% - "Mind if I smoke?" - "I don't care if you burst into flames and die!" -% - "Mind if I smoke?" - "Yes, I'd like to see that, does it come out of your ears or what?" -% - Mother seemed pleased by my draft notice. "Just think of all -the people in England, they've chosen you, it's a great honour, son." - Laughingly I felled her with a right cross. - -- Spike Milligan -% - Moving along a dimly light street, a man I know was suddenly -approached by a stranger who had slipped from the shadows nearby. - "Please, sir," pleaded the stranger, "would you be so kind as -to help a poor unfortunate fellow who is hungry and can't find work? -All I have in the world is this gun." -% - Mr. Jones related an incident from "some time back" when IBM Canada -Ltd. of Markham, Ont., ordered some parts from a new supplier in Japan. The -company noted in its order that acceptable quality allowed for 1.5 per cent -defects (a fairly high standard in North America at the time). - The Japanese sent the order, with a few parts packaged separately in -plastic. The accompanying letter said: "We don't know why you want 1.5 per -cent defective parts, but for your convenience, we've packed them separately." - -- Excerpted from an article in The (Toronto) Globe and Mail -% - Murray and Esther, a middle-aged Jewish couple, are touring -Chile. Murray just got a new camera and is constantly snapping -pictures. One day, without knowing it, he photographs a top-secret -military installation. In an instant, armed troops surround Murray and -Esther and hustle them off to prison. - They can't prove who they are because they've left their -passports in their hotel room. For three weeks they're tortured day -and night to get them to name their contacts in the liberation -movement. Finally they're hauled in front of a military court, -charged with espionage, and sentenced to death. - The next morning they're lined up in front of the wall where -they'll be shot. The sergeant in charge of the firing squad asks them -if they have any last requests. Esther wants to know if she can call -her daughter in Chicago. The sergeant says he's sorry, that's not -possible, and turns to Murray. - "This is crazy!" Murray shouts. "We're not spies!" And he -spits in the sergeants face. - "Murray!" Esther cries. "Please! Don't make trouble." - -- Arthur Naiman, "Every Goy's Guide to Yiddish" -% - My friends, I am here to tell you of the wondrous continent known as -Africa. Well we left New York drunk and early on the morning of February 31. -We were 15 days on the water, and 3 on the boat when we finally arrived in -Africa. Upon our arrival we immediately set up a rigorous schedule: Up at -6:00, breakfast, and back in bed by 7:00. Pretty soon we were back in bed by -6:30. Now Africa is full of big game. The first day I shot two bucks. That -was the biggest game we had. Africa is primarily inhabited by Elks, Moose -and Knights of Pithiests. - The elks live up in the mountains and come down once a year for their -annual conventions. And you should see them gathered around the water hole, -which they leave immediately when they discover it's full of water. They -weren't looking for a water hole. They were looking for an alck hole. - One morning I shot an elephant in my pajamas, how he got in my -pajamas, I don't know. Then we tried to remove the tusks. That's a tough -word to say, tusks. As I said we tried to remove the tusks, but they were -embedded so firmly we couldn't get them out. But in Alabama the Tusks are -looser, but that is totally irrelephant to what I was saying. - We took some pictures of the native girls, but they weren't developed. -So we're going back in a few years... - -- Julius H. Marx -% - "My God! Are we sure he was a liberal?" - "Pretty sure. They pulled him from a Volvo." -% - My message is not that biological determinists were bad scientists or -even that they were always wrong. Rather, I believe that science must be -understood as a social phenomenon, a gutsy, human enterprise, not the work of -robots programmed to collect pure information. I also present this view as -an upbeat for science, not as a gloomy epitaph for a noble hope sacrificed on -the alter of human limitations. - I believe that a factual reality exists and that science, though often -in an obtuse and erratic manner, can learn about it. Galileo was not shown -the instruments of torture in an abstract debate about lunar motion. He had -threatened the Church's conventional argument for social and doctrinal -stability: the static world order with planets circling about a central -earth, priests subordinate to the Pope and serfs to their lord. But the -Church soon made its peace with Galileo's cosmology. They had no choice; the -earth really does revolve about the sun. - -- S. J. Gould, "The Mismeasure of Man" -% - NEW YORK -- Kraft Foods, Inc. announced today that its board of -directors unanimously rejected the $11 billion takeover bid by Philip -Morris and Co. A Kraft spokesman stated in a press conference that the -offer was rejected because the $90-per-share bid did not reflect the -true value of the company. - Wall Street insiders, however, tell quite a different story. -Apparently, the Kraft board of directors had all but signed the takeover -agreement when they learned of Philip Morris' marketing plans for one of -their major Middle East subsidiaries. To a person, the board voted to -reject the bid when they discovered that the tobacco giant intended to -reorganize Israeli Cheddar, Ltd., and name the new company Cheeses of -Nazareth. -% - "No, I understand now," Auberon said, calm in the woods -- it was so -simple, really. "I didn't, for a long time, but I do now. You just can't -hold people, you can't own them. I mean it's only natural, a natural process -really. Meet. Love. Part. Life goes on. There was never any reason to -expect her to stay always the same -- I mean `in love,' you know." There were -those doubt-quotes of Smoky's, heavily indicated. "I don't hold a grudge. I -can't." - "You do," Grandfather Trout said. "And you don't understand." - -- Little, Big, "John Crowley" -% - Now she speaks rapidly. "Do you know *why* you want to program?" - He shakes his head. He hasn't the faintest idea. - "For the sheer *joy* of programming!" she cries triumphantly. -"The joy of the parent, the artist, the craftsman. "You take a program, -born weak and impotent as a dimly-realized solution. You nurture the -program and guide it down the right path, building, watching it grow ever -stronger. Sometimes you paint with tiny strokes, a keystroke added here, -a keystroke changed there." She sweeps her arm in a wide arc. "And other -times you savage whole *blocks* of code, ripping out the program's very -*essence*, then beginning anew. But always building, creating, filling the -program with your own personal stamp, your own quirks and nuances. Watching -the program grow stronger, patching it when it crashes, until finally it can -stand alone -- proud, powerful, and perfect. This is the programmer's finest -hour!" Softly at first, then louder, he hears the strains of a Sousa march. -"This ... this is your canvas! your clay! Go forth and create a masterwork!" -% - Now, you might ask, "How do I get one of those complete home -tool sets for under $4?" An excellent question. - Go to one of those really cheap discount stores where they sell -plastic furniture in colors visible from the planet Neptune and where -they have a food section specializing in cardboard cartons full of -Raisinets and malted milk balls manufactured during the Nixon -administration. In either the hardware or housewares department, -you'll find an item imported from an obscure Oriental country and -described as "Nine Tools in One", consisting of a little handle with -interchangeable ends representing inscrutable Oriental notions of tools -that Americans might use around the home. Buy it. - This is the kind of tool set professionals use. Not only is it -inexpensive, but it also has a great safety feature not found in the -so-called quality tools sets: The handle will actually break right off -if you accidentally hit yourself or anything else, or expose it to -direct sunlight. - -- Dave Barry, "The Taming of the Screw" -% - Obviously the subject of death was in the air, but more as something -to be avoided than harped upon. - Possibly the horror that Zaphod experienced at the prospect of being -reunited with his deceased relatives led on to the thought that they might -just feel the same way about him and, what's more, be able to do something -about helping to postpone this reunion. - -- Douglas Adams, "The Restaurant at the End of the Universe" -% - "Oh sure, this costume may look silly, but it lets me get in and out -of dangerous situations -- I work for a federal task force doing a survey on -urban crime. Look, here's my ID, and here's a number you can call, that will -put you through to our central base in Atlanta. Go ahead, call -- they'll -confirm who I am. - "Unless, of course, the Astro-Zombies have destroyed it." - -- Captain Freedom -% - Old Barlow was a crossing-tender at a junction where an express train -demolished an automobile and its occupants. Being the chief witness, his -testimony was vitally important. Barlow explained that the night was dark, -and he waved his lantern frantically, but the driver of the car paid -no attention to the signal. - The railroad company won the case, and the president of the company -complimented the old-timer for his story. "You did wonderfully," he said, -"I was afraid you would waver under testimony." - "No sir," exclaimed the senior, "but I sure was afraid that durned -lawyer was gonna ask me if my lantern was lit." -% - On his first day as a bus driver, Maxey Eckstein handed in -receipts of $65. The next day his take was $67. The third day's -income was $62. But on the fourth day, Eckstein emptied no less than -$283 on the desk before the cashier. - "Eckstein!" exclaimed the cashier. "This is fantastic. That -route never brought in money like this! What happened?" - "Well, after three days on that cockamamie route, I figured -business would never improve, so I drove over to Fourteenth Street and -worked there. I tell you, that street is a gold mine!" -% - On the day of his anniversary, Joe was frantically shopping -around for a present for his wife. He knew what she wanted, a -grandfather clock for the living room, but he found the right one -almost impossible to find. Finally, after many hours of searching, Joe -found just the clock he wanted, but the store didn't deliver. Joe, -desperate, paid the shopkeeper, hoisted the clock onto his back, and -staggered out onto the sidewalk. On the way home, he passed a bar. -Just as he reached the door, a drunk stumbled out and crashed into Joe, -sending himself, Joe, and the clock into the gutter. Murphy's law -being in effect, the clock ended up in roughly a thousand pieces. - "You stupid drunk!" screamed Joe, jumping up from the -wreckage. "Why don't you look where the hell you're going!" - With quiet dignity the drunk stood up somewhat unsteadily and -dusted himself off. "And why don't you just wear a wristwatch like a -normal person?" -% - On the other hand, the TCP camp also has a phrase for OSI people. -There are lots of phrases. My favorite is `nitwit' -- and the rationale -is the Internet philosophy has always been you have extremely bright, -non-partisan researchers look at a topic, do world-class research, do -several competing implementations, have a bake-off, determine what works -best, write it down and make that the standard. - The OSI view is entirely opposite. You take written contributions -from a much larger community, you put the contributions in a room of -committee people with, quite honestly, vast political differences and all -with their own political axes to grind, and four years later you get -something out, usually without it ever having been implemented once. - So the Internet perspective is implement it, make it work well, -then write it down, whereas the OSI perspective is to agree on it, write -it down, circulate it a lot and now we'll see if anyone can implement it -after it's an international standard and every vendor in the world is -committed to it. One of those processes is backwards, and I don't think -it takes a Lucasian professor of physics at Oxford to figure out which. - -- Marshall Rose, "The Pied Piper of OSI" -% - On this morning in August when I was 13, my mother sent us out pick -tomatoes. Back in April I'd have killed for a fresh tomato, but in August -they are no more rare or wonderful than rocks. So I picked up one and threw -it at a crab apple tree, where it made a good *splat*, and then threw a tomato -at my brother. He whipped one back at me. We ducked down by the vines, -heaving tomatoes at each other. My sister, who was a good person, said, -"You're going to get it." She bent over and kept on picking. - What a target! She was 17, a girl with big hips, and bending over, -she looked like the side of a barn. - I picked up a tomato so big it sat on the ground. It looked like it -had sat there a week. The underside was brown, small white worms lived in it, -and it was very juicy. I stood up and took aim, and went into the windup, -when my mother at the kitchen window called my name in a sharp voice. I had -to decide quickly. I decided. - A rotten Big Boy hitting the target is a memorable sound, like a fat -man doing a belly-flop. With a whoop and a yell the tomatoee came after me -faster than I knew she could run, and grabbed my shirt and was about to brain -me when Mother called her name in a sharp voice. And my sister, who was a -good person, obeyed and let go -- and burst into tears. I guess she knew that -the pleasure of obedience is pretty thin compared with the pleasure of hearing -a rotten tomato hit someone in the rear end. - -- Garrison Keillor, "Lake Wobegon Days" -% - Once again we find ourselves enmeshed in The Holiday Season, that very -special time of year when we join with our loved ones in sharing centuries-old -traditions such as trying to find a parking space at the mall. We -traditionally do this in my family by driving around the parking lot until we -see a shopper emerge from the mall. Then we follow her, in very much the same -spirit as the Three Wise Men, who, 2,000 years ago, followed a star, week after -week, until it led them to a parking space. - We try to keep our bumper about 4 inches from the shopper's calves, to -let the other circling cars know that she belongs to us. Sometimes, two cars -will get into a fight over whom the shopper belongs to, similar to the way -great white sharks will fight over who gets to eat a snorkeler. So, we follow -our shopper closely, hunched over the steering wheel, whistling "It's Beginning -to Look a Lot Like Christmas" through our teeth, until we arrive at her car, -which is usually parked several time zones away from the mall. Sometimes our -shopper tries to indicate she was merely planning to drop off some packages and -go back to shopping. But, when she hears our engine rev in a festive fashion -and sees the holiday gleam in our eyes, she realizes she would never make it. - -- Dave Barry, "Holiday Joy -- Or, the Great Parking Lot - Skirmish" -% - Once there lived a village of creatures along the bottom of a great -crystal river. Each creature in its own manner clung tightly to the twigs -and rocks of the river bottom, for clinging was their way of life, and -resisting the current what each had learned from birth. But one creature -said at last, "I trust that the current knows where it is going. I shall -let go, and let it take me where it will. Clinging, I shall die of boredom." - The other creatures laughed and said, "Fool! Let go, and that current -you worship will throw you tumbled and smashed across the rocks, and you will -die quicker than boredom!" - But the one heeded them not, and taking a breath did let go, and at -once was tumbled and smashed by the current across the rocks. Yet, in time, -as the creature refused to cling again, the current lifted him free from the -bottom, and he was bruised and hurt no more. - And the creatures downstream, to whom he was a stranger, cried, "See -a miracle! A creature like ourselves, yet he flies! See the Messiah, come -to save us all!" And the one carried in the current said, "I am no more -Messiah than you. The river delight to lift us free, if only we dare let go. -Our true work is this voyage, this adventure. - But they cried the more, "Saviour!" all the while clinging to the -rocks, making legends of a Saviour. - -- Richard Bach -% - Once there was a marine biologist who loved dolphins. He spent his -time trying to feed and protect his beloved creatures of the sea. One day, -in a fit of inventive genius, he came up with a serum that would make -dolphins live forever! - Of course he was ecstatic. But he soon realized that in order to mass -produce this serum he would need large amounts of a certain compound that was -only found in nature in the metabolism of a rare South American bird. Carried -away by his love for dolphins, he resolved that he would go to the zoo and -steal one of these birds. - Unbeknownst to him, as he was arriving at the zoo an elderly lion was -escaping from its cage. The zookeepers were alarmed and immediately began -combing the zoo for the escaped animal, unaware that it had simply lain down -on the sidewalk and had gone to sleep. - Meanwhile, the marine biologist arrived at the zoo and procured his -bird. He was so excited by the prospect of helping his dolphins that he -stepped absentmindedly stepped over the sleeping lion on his way back to his -car. Immediately, 1500 policemen converged on him and arrested him for -transporting a myna across a staid lion for immortal porpoises. -% - Once upon a time there was a beautiful young girl taking a stroll -through the woods. All at once she saw an extremely ugly bull frog seated -on a log and to her amazement the frog spoke to her. "Maiden," croaked the -frog, "would you do me a favor? This will be hard for you to believe, but -I was once a handsome, charming prince and then a mean, ugly old witch cast -a spell over me and turned me into a frog." - "Oh, what a pity!", exclaimed the girl. "I'll do anything I can to -help you break such a spell." - "Well," replied the frog, "the only way that this spell can be -taken away is for some lovely young woman to take me home and let me spend -the night under her pillow." - The young girl took the ugly frog home and placed him beneath her -pillow that night when she retired. When she awoke the next morning, sure -enough, there beside her in bed was a very young, handsome man, clearly of -royal blood. And so they lived happily ever after, except that to this day -her father and mother still don't believe her story. -% - Once upon a time, there was a fisherman who lived by a great river. -One day, after a hard day's fishing, he hooked what seemed to him to be the -biggest, strongest fish he had ever caught. He fought with it for hours, -until, finally, he managed to bring it to the surface. Looking of the edge -of the boat, he saw the head of this huge fish breaking the surface. Smiling -with pride, he reached over the edge to pull the fish up. Unfortunately, he -accidentally caught his watch on the edge, and, before he knew it, there was a -snap, and his watch tumbled into the water next to the fish with a loud -"sploosh!" Distracted by this shiny object, the fish made a sudden lunge, -simultaneously snapping the line, and swallowing the watch. Sadly, the -fisherman stared into the water, and then began the slow trip back home. - Many years later, the fisherman, now an old man, was working in a -boring assembly-line job in a large city. He worked in a fish-processing -plant. It was his job, as each fish passed under his hands, to chop off their -heads, readying them for the next phase in processing. This monotonous task -went on for years, the dull *thud* of the cleaver chopping of each head being -his entire world, day after day, week after weary week. Well, one day, as he -was chopping fish, he happened to notice that the fish coming towards him on -the line looked very familiar. Yes, yes, it looked... could it be the fish -he had lost on that day so many years ago? He trembled with anticipation as -his cleaver came down. IT STRUCK SOMETHING HARD! IT WAS HIS THUMB! -% - Once upon a time, there were five blind men who had the opportunity -to experience an elephant for the first time. One approached the elephant, -and, upon encountering one of its sturdy legs, stated, "Ah, an elephant is -like a tree." The second, after exploring the trunk, said, "No, an elephant -is like a strong hose." The third, grasping the tail, said "Fool! An elephant -is like a rope!" The fourth, holding an ear, stated, "No, more like a fan." -And the fifth, leaning against the animal's side, said, "An elephant is like -a wall." The five then began to argue loudly about who had the more accurate -perception of the elephant. - The elephant, tiring of all this abuse, suddenly reared up and -attacked the men. He continued to trample them until they were nothing but -bloody lumps of flesh. Then, strolling away, the elephant remarked, "It just -goes to show that you can't depend on first impressions. When I first saw -them I didn't think they'd be any fun at all." -% - Once upon a time there were three brothers who were knights -in a certain kingdom. And, there was a Princess in a neighboring kingdom -who was of marriageable age. Well, one day, in full armour, their horses, -and their page, the three brothers set off to see if one of them could -win her hand. The road was long and there were many obstacles along the -way, robbers to be overcome, hard terrain to cross. As they coped with -each obstacle they became more and more disgusted with their page. He was -not only inept, he was a coward, he could not handle the horses, he was, -in short, a complete flop. When they arrived at the court of the kingdom, -they found that they were expected to present the Princess with some -treasure. The two older brothers were discouraged, since they had not -thought of this and were unprepared. The youngest, however, had the -answer: Promise her anything, but give her our page. -% - Once, when the secrets of science were the jealously guarded property -of a small priesthood, the common man had no hope of mastering their arcane -complexities. Years of study in musty classrooms were prerequisite to -obtaining even a dim, incoherent knowledge of science. - Today all that has changed: a dim, incoherent knowledge of science is -available to anyone. - -- Tom Weller, "Science Made Stupid" -% - One day a student came to Moon and said, "I understand how to make -a better garbage collector. We must keep a reference count of the pointers -to each cons." - Moon patiently told the student the following story -- "One day a -student came to Moon and said, "I understand how to make a better garbage -collector..." -% - One day it was announced that the young monk Kyogen had reached -an enlightened state. Much impressed by this news, several of his peers -went to speak with him. - "We have heard that you are enlightened. Is this true?" his fellow -students inquired. - "It is", Kyogen answered. - "Tell us", said a friend, "how do you feel?" - "As miserable as ever", replied the enlightened Kyogen. -% - One evening he spoke. Sitting at her feet, his face raised to her, -he allowed his soul to be heard. "My darling, anything you wish, anything -I am, anything I can ever be... That's what I want to offer you -- not the -things I'll get for you, but the thing in me that will make me able to get -them. That thing -- a man can't renounce it -- but I want to renounce it -- -so that it will be yours -- so that it will be in your service -- only for -you." - The girl smiled and asked: "Do you think I'm prettier than Maggie -Kelly?" - He got up. He said nothing and walked out of the house. He never -saw that girl again. Gail Wynand, who prided himself on never needing a -lesson twice, did not fall in love again in the years that followed. - -- Ayn Rand, "The Fountainhead" -% - One fine day, the bus driver went to the bus garage, started his bus, -and drove off along the route. No problems for the first few stops -- a few -people got on, a few got off, and things went generally well. At the next -stop, however, a big hulk of a guy got on. Six feet eight, built like a -wrestler, arms hanging down to the ground. He glared at the driver and said, -"Big John doesn't pay!" and sat down at the back. - Did I mention that the driver was five feet three, thin, and basically -meek? Well, he was. Naturally, he didn't argue with Big John, but he wasn't -happy about it. Well, the next day the same thing happened -- Big John got on -again, made a show of refusing to pay, and sat down. And the next day, and the -one after that, and so forth. This grated on the bus driver, who started -losing sleep over the way Big John was taking advantage of him. Finally he -could stand it no longer. He signed up for bodybuilding courses, karate, judo, -and all that good stuff. By the end of the summer, he had become quite strong; -what's more, he felt really good about himself. - So on the next Monday, when Big John once again got on the bus -and said "Big John doesn't pay!," the driver stood up, glared back at the -passenger, and screamed, "And why not?" - With a surprised look on his face, Big John replied, "Big John has a -bus pass." -% - One night the captain of a tanker saw a light dead ahead. He -directed his signalman to flash a signal to the light which went... - "Change course 10 degrees South." - The reply was quickly flashed back... - "You change course 10 degrees North." - The captain was a little annoyed at this reply and sent a further -message..... - "I am a captain. Change course 10 degrees South." - Back came the reply... - "I am an able-seaman. Change course 10 degrees North." - The captain was outraged at this reply and send a message.... -"I am a 240,000 tonne tanker. CHANGE course 10 degrees South!" - Back came the reply... - "I am a LIGHTHOUSE. Change course 10 degrees North!!!!" - -- Cruising Helmsman, "On The Right Course" -% - One of the questions that comes up all the time is: How enthusiastic -is our support for UNIX? - Unix was written on our machines and for our machines many years ago. -Today, much of UNIX being done is done on our machines. Ten percent of our -VAXs are going for UNIX use. UNIX is a simple language, easy to understand, -easy to get started with. It's great for students, great for somewhat casual -users, and it's great for interchanging programs between different machines. -And so, because of its popularity in these markets, we support it. We have -good UNIX on VAX and good UNIX on PDP-11s. - It is our belief, however, that serious professional users will run -out of things they can do with UNIX. They'll want a real system and will end -up doing VMS when they get to be serious about programming. - With UNIX, if you're looking for something, you can easily and quickly -check that small manual and find out that it's not there. With VMS, no matter -what you look for -- it's literally a five-foot shelf of documentation -- if -you look long enough it's there. That's the difference -- the beauty of UNIX -is it's simple; and the beauty of VMS is that it's all there. - -- Ken Olsen, president of DEC, DECWORLD Vol. 8 No. 5, 1984 -[It's been argued that the beauty of UNIX is the same as the beauty of Ken -Olsen's brain. Ed.] -% - page 46 -...a report citing a study by Dr. Thomas C. Chalmers, of the Mount Sinai -Medical Center in New York, which compared two groups that were being used -to test the theory that ascorbic acid is a cold preventative. "The group -on placebo who thought they were on ascorbic acid," says Dr. Chalmers, -"had fewer colds than the group on ascorbic acid who thought they were -on placebo." - page 56 -The placebo is proof that there is no real separation between mind and body. -Illness is always an interaction between both. It can begin in the mind and -affect the body, or it can begin in the body and affect the mind, both of -which are served by the same bloodstream. Attempts to treat most mental -diseases as though they were completely free of physical causes and attempts -to treat most bodily diseases as though the mind were in no way involved must -be considered archaic in the light of new evidence about the way the human -body functions. - -- Norman Cousins, - "Anatomy of an Illness as Perceived by the Patient" -% - Penn's aunts made great apple pies at low prices. No one else in -town could compete with the pie rates of Penn's aunts. - During the American Revolution, a Britisher tried to raid a farm. He -stumbled across a rock on the ground and fell, whereupon an aggressive Rhode -Island Red hopped on top. Seeing this, the farmer commented, "Chicken catch -a Tory!" - A wife started serving chopped meat, Monday hamburger, Tuesday meat -loaf, Wednesday tartar steak, and Thursday meatballs. On Friday morning her -husband snarled, "How now, ground cow?" - A journalist, thrilled over his dinner, asked the chef for the recipe. -Retorted the chef, "Sorry, we have the same policy as you journalists, we -never reveal our sauce." - A new chef from India was fired a week after starting the job. He -kept favoring curry. - A couple of kids tried using pickles instead of paddles for a Ping-Pong -game. They had the volley of the Dills. -% - People of all sorts of genders are reporting great difficulty, -these days, in selecting the proper words to refer to those of the female -persuasion. - "Lady," "woman," and "girl" are all perfectly good words, but -misapplying them can earn one anything from the charge of vulgarity to a good -swift smack. We are messing here with matters of deference, condescension, -respect, bigotry, and two vague concepts, age and rank. It is troubling -enough to get straight who is really what. Those who deliberately misuse -the terms in a misbegotten attempt at flattery are asking for it. - A woman is any grown-up female person. A girl is the un-grown-up -version. If you call a wee thing with chubby cheeks and pink hair ribbons a -"woman," you will probably not get into trouble, and if you do, you will be -able to handle it because she will be under three feet tall. However, if you -call a grown-up by a child's name for the sake of implying that she has a -youthful body, you are also implying that she has a brain to match. -% - "Perhaps he is not honest," Mr. Frostee said inside Cobb's head, -sounding a bit worried. - "Of course he isn't," Cobb answered. "What we have to look out for -is him calling the cops anyway, or trying to blackmail us for more money." - "I think you should kill him and eat his brain," Mr. Frostee -said quickly. - "That's not the answer to *every* problem in interpersonal relations," -Cobb said, hopping out. - -- Rudy Rucker, "Software" -% - Phases of a Project: -(1) Exultation. -(2) Disenchantment. -(3) Confusion. -(4) Search for the Guilty. -(5) Punishment for the Innocent. -(6) Distinction for the Uninvolved. -% - Phil [Record] was known as the Hat because he always wore a felt -snap brim. It was the standard uniform for police reporters, for one -reason: it made it easier for them to pass themselves off as detectives. -We had an informal code of ethics then; we never lied about who we were. -But if people mistook us for the police, that was their problem, not ours. -If they thought they were giving confidential information to an investigator, -well, that was their problem, too. As we understood the First Amendment, -everyone had a right to talk to the _Star-Telegram_, even if they didn't -know they were talking to the _Star-Telegram_. - -- Bob Schieffer, "This Just In" -% - Plumbing is one of the easier of do-it-yourself activities, -requiring only a few simple tools and a willingness to stick your arm -into a clogged toilet. In fact, you can solve many home plumbing -problems, such as annoying faucet drip, merely by turning up the -radio. But before we get into specific techniques, let's look at how -plumbing works. - A plumbing system is very much like your electrical system, -except that instead of electricity, it has water, and instead of wires, -it has pipes, and instead of radios and waffle irons, it has faucets -and toilets. So the truth is that your plumbing systems is nothing at -all like your electrical system, which is good, because electricity can -kill you. - -- Dave Barry, "The Taming of the Screw" -% - Price Wang's programmer was coding software. His fingers danced upon -the keyboard. The program compiled without an error message, and the program -ran like a gentle wind. - Excellent!" the Price exclaimed, "Your technique is faultless!" - "Technique?" said the programmer, turning from his terminal, "What I -follow is the Tao -- beyond all technique. When I first began to program I -would see before me the whole program in one mass. After three years I no -longer saw this mass. Instead, I used subroutines. But now I see nothing. -My whole being exists in a formless void. My senses are idle. My spirit, -free to work without a plan, follows its own instinct. In short, my program -writes itself. True, sometimes there are difficult problems. I see them -coming, I slow down, I watch silently. Then I change a single line of code -and the difficulties vanish like puffs of idle smoke. I then compile the -program. I sit still and let the joy of the work fill my being. I close my -eyes for a moment and then log off." - Price Wang said, "Would that all of my programmers were as wise!" - -- Geoffrey James, "The Tao of Programming" -% - "Reintegration complete," ZORAC advised. "We're back in the -universe again..." An unusually long pause followed, "...but I don't -know which part. We seem to have changed our position in space." A -spherical display in the middle of the floor illuminated to show the -starfield surrounding the ship. - "Several large, artificial constructions are approaching us," -ZORAC announced after a short pause. "The designs are not familiar, but -they are obviously the products of intelligence. Implications: we have -been intercepted deliberately by a means unknown, for a purpose unknown, -and transferred to a place unknown by a form of intelligence unknown. -Apart from the unknowns, everything is obvious." - -- James P. Hogan, "Giants Star" -% - Reporters like Bill Greider from the Washington Post and Him -Naughton of the New York Times, for instance, had to file long, detailed, -and relatively complex stories every day -- while my own deadline fell -every two weeks -- but neither of them ever seemed in a hurry about -getting their work done, and from time to time they would try to console -me about the terrible pressure I always seemed to be laboring under. - Any $100-an-hour psychiatrist could probably explain this problem -to me, in thirteen or fourteen sessions, but I don't have time for that. -No doubt it has something to do with a deep-seated personality defect, or -maybe a kink in whatever blood vessel leads into the pineal gland... On -the other hand, it might be something as simple & basically perverse as -whatever instinct it is that causes a jackrabbit to wait until the last -possible second to dart across the road in front of a speeding car. - -- Hunter S. Thompson, "Fear and Loathing: - On the Campaign Trail" -% - "Richard, in being so fierce toward my vampire, you were doing -what you wanted to do, even though you thought it was going to hurt -somebody else. He even told you he'd be hurt if..." - "He was going to suck my blood!" - "Which is what we do to anyone when we tell them we'll be hurt -if they don't live our way." -... - "The thing that puzzles you," he said, "is an accepted saying that -happens to be impossible. The phrase is hurt somebody else. We choose, -ourselves, to be hurt or not to be hurt, no matter what. Us who decides. -Nobody else. My vampire told you he'd be hurt if you didn't let him? That's -his decision to be hurt, that's his choice. What you do about it is your -decision, your choice: give him blood; ignore him; tie him up; drive a stake -through his heart. If he doesn't want the holly stake, he's free to resist, -in whatever way he wants. It goes on and on, choices, choices." - "When you look at it that way..." - "Listen," he said, "it's important. We are all. Free. To do. -Whatever. We want. To do." - -- Richard Bach, "Illusions" -% - Risch's decision procedure for integration, not surprisingly, -uses a recursion on the number and type of the extensions from the -rational functions needed to represent the integrand. Although the -algorithm follows and critically depends upon the appropriate structure -of the input, as in the case of multivariate factorization, we cannot -claim that the algorithm is a natural one. In fact, the creator of -differential algebra, Ritt, committed suicide in the early 1950's, -largely, it is claimed, because few paid attention to his work. Probably -he would have received more attention had he obtained the algorithm as -well. - -- Joel Moses, "Algorithms and Complexity", ed. J. F. Traub -% - Robert Kennedy's 1964 Senatorial campaign planners told him that -their intention was to present him to the television viewers as a sincere, -generous person. "You going to use a double?" asked Kennedy. - - Thumbing through a promotional pamphlet prepared for his 1964 -Senatorial campaign, Robert Kennedy came across a photograph of himself -shaking hands with a well-known labor leader. - "There must be a better photo that this," said Kennedy to the -advertising men in charge of his campaign. - "What's wrong with this one?" asked one adman. - "That fellow's in jail," said Kennedy. - -- Bill Adler, "The Washington Wits" -% - SAFETY -I can live without -Someone I love -But not without -Someone I need. -% - Sam went to his psychiatrist complaining of a hatred for elephants. -"I can't stand elephants," he explained. "I lie awake nights despising -them. The thought of an elephant fills me with loathing." - "Sam," said the psychiatrist, "there's only one thing for you to do. -Go to Africa, organize a safari, find an elephant in the jungle and shoot it. -That way you'll get it out of your system." - Sam immediately made arrangements for a safari hunt in Africa, -inviting his best friend to join him. They arrived in Nairobi and lost no -time getting out on the jungle trails. After they had been hunting for -several days, Sam's best friend grabbed him by the arm one morning and -yelled at him: - "Sam, Sam, Sam! Over there behind that tree there's and elephant! -Sam -- Get your gun -- no, no, not THAT gun -- the rifle with the longer -barrel! Now aim it! QUICK! SAM! QUICK! No! Not that way -- this way! -Be sure you don't jerk the trigger! Wait SAM! Don't let him see you! Aim -at his head!" - Sam whirled around, took aim, and killed his friend. He was put in -prison and his psychiatrist flew to Africa to visit him. "I sent you over -here to kill an elephant and instead you shoot your best friend," the -psychiatrist said. "Why?" - "Well," Sam replied, "there's only one thing in the world that I -hate more than elephants and that is a loudmouth know-it-all!" -% - Seems George was playing his usual eighteen holes on Saturday -afternoon. Teeing off from the 17th, he sliced into the rough over near -the edge of the fairway. Just as he was about to chip out, he noticed a -long funeral procession going past on a nearby street. Reverently, George -removed his hat and stood at attention until the procession had passed. -Then he continued his game, finishing with a birdie on the eighteenth. -Later, at the clubhouse, a fellow golfer greet George. "Say, that was a -nice gesture you made today, George. - "What do you mean?" asked George. - "Well, it was nice of you to take off your cap and stand -respectfully when that funeral went by," the friend replied. - "Oh, yes," said George. "Well, we were married 17 years, you -know." -% - "Seven years and six months!" Humpty Dumpty repeated thoughtfully. -"An uncomfortable sort of age. Now if you'd asked MY advice, I'd have -said 'Leave off at seven' -- but it's too late now." - "I never ask advice about growing," Alice said indignantly. - "Too proud?" the other enquired. - Alice felt even more indignant at this suggestion. "I mean," -she said, "that one can't help growing older." - "ONE can't, perhaps," said Humpty Dumpty; "but TWO can. With -proper assistance, you might have left off at seven." - -- Lewis Carroll, - "Through the Looking-Glass, - and What Alice Found There" (1871) -% - Several students were asked to prove that all odd integers are prime. - The first student to try to do this was a math student. "Hmmm... -Well, 1 is prime, 3 is prime, 5 is prime, and by induction, we have that all -the odd integers are prime." - The second student to try was a man of physics who commented, "I'm not -sure of the validity of your proof, but I think I'll try to prove it by -experiment." He continues, "Well, 1 is prime, 3 is prime, 5 is prime, 7 is -prime, 9 is... uh, 9 is... uh, 9 is an experimental error, 11 is prime, 13 -is prime... Well, it seems that you're right." - The third student to try it was the engineering student, who responded, -"Well, to be honest, actually, I'm not sure of your answer either. Let's -see... 1 is prime, 3 is prime, 5 is prime, 7 is prime, 9 is... uh, 9 is... -well, if you approximate, 9 is prime, 11 is prime, 13 is prime... Well, it -does seem right." - Not to be outdone, the computer science student comes along and says -"Well, you two sort've got the right idea, but you'll end up taking too long! -I've just whipped up a program to REALLY go and prove it." He goes over to -his terminal and runs his program. Reading the output on the screen he says, -"1 is prime, 1 is prime, 1 is prime, 1 is prime..." -% - She said, "I know you ... you cannot sing." - I said, "That's nothing, you should hear me play piano." - -- Morrisey -% - "Sheriff, we gotta catch Black Bart." - "Oh, yeah? What's he look like?" - "Well, he's wearin' a paper hat, a paper shirt, paper pants and -paper boots." - "What's he wanted for?" - "Rustling." -% - Sixtus V, Pope from 1585 to 1590 authorized a printing of the -Vulgate Bible. Taking no chances, the pope issued a papal bull -automatically excommunicating any printer who might make an alteration -in the text. This he ordered printed at the beginning of the Bible. -He personally examined every sheet as it came off the press. Yet the -published Vulgate Bible contained so many errors that corrected scraps -had to be printed and pasted over them in every copy. The result -provoked wry comments on the rather patchy papal infallibility, and -Pope Sixtus had no recourse but to order the return and destruction of -every copy. -% - So Richard and I decided to try to catch [the small shark]. With -a great deal of strategy and effort and shouting, we managed to maneuver -the shark, over the course of about a half-hour, to a sort of corner of the -lagoon, so that it had no way to escape other than to flop up onto the land -and evolve. Richard and I were inching toward it, sort of crouched over, -when all of a sudden it turned around and -- I can still remember the -sensation I felt at that moment, primarily in the armpit area -- headed -right straight toward us. - Many people would have panicked at this point. But Richard and I -were not "many people." We were experienced waders, and we kept our heads. -We did exactly what the textbook says you should do when you're unarmed and -a shark that is nearly two feet long turns on you in water up to your lower -calves: We sprinted I would say 600 yards in the opposite direction, using -a sprinting style such that the bottoms of our feet never once went below -the surface of the water. We ran all the way to the far shore, and if we -had been in a Warner Brothers cartoon we would have run right INTO the beach, -and you would have seen these two mounds of sand racing across the island -until they bonked into trees and coconuts fell onto their heads. - -- Dave Barry, "The Wonders of Sharks on TV" -% - "So you don't have to, Cindy, but I was wondering if you might -want to go to someplace, you know, with me, sometime." - "Well, I can think of a lot of worse things, David." - "Friday, then?" - "Why not, David, it might even be fun." - -- Dating in Minnesota -% - Some 1500 miles west of the Big Apple we find the Minneapple, a -haven of tranquility in troubled times. It's a good town, a civilized town. -A town where they still know how to get your shirts back by Thursday. Let -the Big Apple have the feats of "Broadway Joe" Namath. We have known the -stolid but steady Killebrew. Listening to Cole Porter over a dry martini -may well suit those unlucky enough never to have heard the Whoopee John Polka -Band and never to have shared a pitcher of 3.2 Grain Belt Beer. The loss is -theirs. And the Big Apple has yet to bake the bagel that can match peanut -butter on lefse. Here is a town where the major urban problem is dutch elm -disease and the number one crime is overtime parking. We boast more theater -per capita than the Big Apple. We go to see, not to be seen. We go even -when we must shovel ten inches of snow from the driveway to get there. Indeed -the winters are fierce. But then comes the marvel of the Minneapple summer. -People flock to the city's lakes to frolic and rejoice at the sight of so -much happy humanity free from the bonds of the traditional down-filled parka. -Here's to the Minneapple. And to its people. Our flair for style is balanced -by a healthy respect for wind chill factors. - And we always, always eat our vegetables. - This is the Minneapple. -% - Something mysterious is formed, born in the silent void. Waiting -alone and unmoving, it is at once still and yet in constant motion. It is -the source of all programs. I do not know its name, so I will call it the -Tao of Programming. - If the Tao is great, then the operating system is great. If the -operating system is great, then the compiler is great. If the compiler is -greater, then the applications is great. The user is pleased and there is -harmony in the world. - The Tao of Programming flows far away and returns on the wind of -morning. - -- Geoffrey James, "The Tao of Programming" -% - Somewhat alarmed at the continued growth of the number of employees -on the Department of Agriculture payroll in 1962, Michigan Republican Robert -Griffin proposed an amendment to the farm bill so that "the total number of -employees in the Department of Agriculture at no time exceeds the number of -farmers in America." - -- Bill Adler, "The Washington Wits" -% - "Somewhere", said Father Vittorini, "did Blake not speak of the -Machineries of Joy? That is, did not God promote environments, then -intimidate these Natures by provoking the existence of flesh, toy men and -women, such as are we all? And thus happily sent forth, at our best, with -good grace and fine wit, on calm noons, in fair climes, are we not God's -Machineries of Joy?" - "If Blake said that", said Father Brian, "he never lived in Dublin." - -- Ray Bradbury, "The Machineries of Joy" -% - Split 1/4 bottle .187 liters - Half 1/2 bottle - Bottle 750 milliliters - Magnum 2 bottles 1.5 liters - Jeroboam 4 bottles - Rehoboam 6 bottles Not available in the US - Methuselah 8 bottles - Salmanazar 12 bottles - Balthazar 16 bottles - Nebuchadnezzar 20 bottles 15 liters - Sovereign 34 bottles 26 liters - - The Sovereign is a new bottle, made for the launching of the -largest cruise ship in the world. The bottle alone cost 8,000 dollars -to produce and they only made 8 of them. - Most of the funny names come from Biblical people. -% - Stop! Whoever crosseth the bridge of Death, must answer first -these questions three, ere the other side he see! - - "What is your name?" - "Sir Brian of Bell." - "What is your quest?" - "I seek the Holy Grail." - "What are four lowercase letters that are not legal flag arguments -to the Berkeley UNIX version of `ls'?" - "I, er.... AIIIEEEEEE!" -% - Strange memories on this nervous night in Las Vegas. Five years later? -Six? It seems like a lifetime, or at least a Main Era -- the kind of peak that -never comes again. San Francisco in the middle sixties was a very special time -and place to be a part of. Maybe it meant something. Maybe not, in the long -run... There was madness in any direction, at any hour. If not across the -Bay, then up the Golden Gate or down 101 to Los Altos or La Honda... You could -strike sparks anywhere. There was a fantastic universal sense that whatever we -were doing was right, that we were winning... - And that, I think, was the handle -- that sense of inevitable victory -over the forces of Old and Evil. Not in any mean or military sense; we didn't -need that. Our energy would simply prevail. There was no point in fighting --- on our side or theirs. We had all the momentum; we were riding the crest -of a high and beautiful wave. So now, less than five years later, you can go -up on a steep hill in Las Vegas and look West, and with the right kind of eyes -you can almost see the high-water mark -- that place where the wave finally -broke and rolled back. - -- Hunter S. Thompson -% - "Surely you can't be serious." - "I am serious, and don't call me Shirley." -% - Take the folks at Coca-Cola. For many years, they were content -to sit back and make the same old carbonated beverage. It was a good -beverage, no question about it; generations of people had grown up -drinking it and doing the experiment in sixth grade where you put a -nail into a glass of Coke and after a couple of days the nail dissolves -and the teacher says: "Imagine what it does to your TEETH!" So Coca-Cola -was solidly entrenched in the market, and the management saw no need to -improve ... - -- Dave Barry, "In Search of Excellence" -% - "That's right; the upper-case shift works fine on the screen, but -they're not coming out on the damn printer... Hold? Sure, I'll hold." - -- e. e. cummings last service call -% - "The best thing for being sad," replied Merlin, beginning to puff -and blow, "is to learn something. That's the only thing that never fails. -You may grow old and trembling in your anatomies, you may lie awake at -night listening to the disorder of your veins, you may miss your only love, -you may see the world about you devastated by evil lunatics, or know your -honour trampled in the sewers of baser minds. There is only one thing for -it then -- to learn. Learn why the world wags and what wags it. That is -the only thing which the mind can never exhaust, never alienate, never be -tortured by, never fear or distrust, and never dream of regretting. Learning -is the only thing for you. Look what a lot of things there are to learn." - -- T. H. White, "The Once and Future King" -% - The birds are singing, the flowers are budding, and it is time -for Miss Manners to tell young lovers to stop necking in public. - It's not that Miss Manners is immune to romance. Miss Manners -has been known to squeeze a gentleman's arm while being helped over a -curb, and, in her wild youth, even to press a dainty slipper against a -foot or two under the dinner table. Miss Manners also believes that the -sight of people strolling hand in hand or arm in arm or arm in hand -dresses up a city considerably more than the more familiar sight of -people shaking umbrellas at one another. What Miss Manners objects to -is the kind of activity that frightens the horses on the street... -% - The boss returned from lunch in a good mood and called the whole staff -in to listen to a couple of jokes he had picked up. Everybody but one girl -laughed uproariously. "What's the matter?" grumbled the boss. "Haven't you -got a sense of humor?" - "I don't have to laugh," she said. "I'm leaving Friday anyway. -% - The FIELD GUIDE to NORTH AMERICAN MALES - -SPECIES: Cranial Males -SUBSPECIES: The Hacker (homo computatis) -Courtship & Mating: - Due to extreme deprivation, HOMO COMPUTATIS maintains a near perpetual - state of sexual readiness. Courtship behavior alternates between - awkward shyness and abrupt advances. When he finally mates, he - chooses a female engineer with an unblinking stare, a tight mouth, and - a complete collection of Campbell's soup-can recipes. -Track: - Trash cans full of pale green and white perforated paper and old - copies of the Allen-Bradley catalog. -Comments: - Extremely fond of bad puns and jokes that need long explanations. -% - The FIELD GUIDE to NORTH AMERICAN MALES - -SPECIES: Cranial Males -SUBSPECIES: The Hacker (homo computatis) -Description: - Gangly and frail, the hacker has a high forehead and thinning hair. - Head disproportionately large and crooked forward, complexion wan and - sightly gray from CRT illumination. He has heavy black-rimmed glasses - and a look of intense concentration, which may be due to a software - problem or to a pork-and-bean breakfast. -Feathering: - HOMO COMPUTATIS saw a Brylcreem ad fifteen years ago and believed it. - Consequently, crest is greased down, except for the cowlick. -Song: - A rather plaintive "Is it up?" -% - The FIELD GUIDE to NORTH AMERICAN MALES - -SPECIES: Cranial Males -SUBSPECIES: The Hacker (homo computatis) -Plumage: - All clothes have a slightly crumpled look as though they came off the - top of the laundry basket. Style varies with status. Hacker managers - wear gray polyester slacks, pink or pastel shirts with wide collars, - and paisley ties; staff wears cinched-up baggy corduroy pants, white - or blue shirts with button-down collars, and penholder in pocket. - Both managers and staff wear running shoes to work, and a black - plastic digital watch with calculator. -% - The General disliked trying to explain the highly technical -inner workings of the U.S. Air Force. - "$7,662 for a ten cup coffee maker, General?" the Senator asked. - In his head he ran through his standard explanations. "It's not so," -he thought. "It's a deterrent." Soon he came up with, "It's computerized, -Senator. Tiny computer chips make coffee that's smooth and full-bodied. Try -a cup." - The Senator did. "Pfffttt! Tastes like jet fuel!" - "It's not so," the General thought. "It's a deterrent." - Then he remembered something. "We bought a lot of untested computer -chips," the General answered. "They got into everything. Just a little -mix-up. Nothing serious." - Then he remembered something else. It was at the site of the -mysterious B-1 crash. A strange smell in the fuel lines. It smelled like -coffee. Smooth and full bodied... - -- Another Episode of General's Hospital -% - The geographical center of Boston is in Roxbury. Due north of -the center we find the South End. This is not to be confused with South -Boston which lies directly east from the South End. North of the South -End is East Boston and southwest of East Boston is the North End. -% - "The Good Ship Enterprise" (to the tune of "The Good Ship Lollipop") - -On the good ship Enterprise -Every week there's a new surprise -Where the Romulans lurk -And the Klingons often go berserk. - -Yes, the good ship Enterprise -There's excitement anywhere it flies -Where Tribbles play -And Nurse Chapel never gets her way. - - See Captain Kirk standing on the bridge, - Mr. Spock is at his side. - The weekly menace, ooh-ooh - It gets fried, scattered far and wide. - -It's the good ship Enterprise -Heading out where danger lies -And you live in dread -If you're wearing a shirt that's red. - -- Doris Robin and Karen Trimble of The L.A. Filkharmonics -% - The Hitchhiker's Guide to the Galaxy has a few things to say on -the subject of towels. - A towel, it says, is about the most massively useful thing an -interstellar hitchhiker can have. Partly it has great practical value. -You can wrap it around you for warmth as you bound across the cold moons -of Jaglan Beta; you can lie on it on the brilliant marble-sanded beaches -of Santraginus V ... use it to sail a miniraft down the slow heavy River -Moth; wave your towel in emergencies, and, of course, dry yourself off -with it if it still seems to be clean enough. - -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% - The Hitchhiker's Guide to the Galaxy has a few things to say on -the subject of towels. - Most importantly, a towel has immense psychological value. For -some reason, if a non-hitchhiker discovers that a hitchhiker has his towel -with him, he will automatically assume that he is also in possession of a -toothbrush, washcloth, flask, gnat spray, space suit, etc., etc. Furthermore, -the non-hitchhiker will then happily lend the hitchhiker any of these or -a dozen other items that he may have "lost". After all, any man who can -hitch the length and breadth of the Galaxy, struggle against terrible odds, -win through and still know where his towel is, is clearly a man to be -reckoned with. - -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% - "The jig's up, Elman." - "Which jig?" - -- Jeff Elman -% - THE LESSER-KNOWN PROGRAMMING LANGUAGES #2: RENE - -Named after the famous French philosopher and mathematician Rene -Descartes, RENE is a language used for artificial intelligence. The -language is being developed at the Chicago Center of Machine Politics -and Programming under a grant from the Jane Byrne Victory Fund. A -spokesman described the language as "Just as great as dis [sic] city of -ours." - -The center is very pleased with progress to date. They say they have -almost succeeded in getting a VAX to think. However, sources inside the -organization say that each time the machine fails to think it ceases to -exist. -% - THE LESSER-KNOWN PROGRAMMING LANGUAGES #8: LAIDBACK - -This language was developed at the Marin County Center for T'ai Chi, -Mellowness and Computer Programming (now defunct), as an alternative to -the more intense atmosphere in nearby Silicon Valley. - -The center was ideal for programmers who liked to soak in hot tubs -while they worked. Unfortunately few programmers could survive there -because the center outlawed Pizza and Coca-Cola in favor of Tofu and -Perrier. - -Many mourn the demise of LAIDBACK because of its reputation as a gentle -and non-threatening language since all error messages are in lower -case. For example, LAIDBACK responded to syntax errors with the -message: - "i hate to bother you, but i just can't relate to that. can - you find the time to try it again?" -% - The Lord and I are in a sheep-shepherd relationship, and I am in -a position of negative need. - He prostrates me in a green-belt grazing area. - He conducts me directionally parallel to non-torrential aqueous -liquid. - He returns to original satisfaction levels my psychological makeup. - He switches me on to a positive behavioral format for maximal -prestige of His identity. - It should indeed be said that notwithstanding the fact that I make -ambulatory progress through the umbrageous inter-hill mortality slot, terror -sensations will no be initiated in me, due to para-etical phenomena. - Your pastoral walking aid and quadrupic pickup unit introduce me -into a pleasurific mood state. - You design and produce a nutriment-bearing furniture-type structure -in the context of non-cooperative elements. - You act out a head-related folk ritual employing vegetable extract. - My beverage utensil experiences a volume crisis. - It is an ongoing deductible fact that your inter-relational -empathetical and non-ventious capabilities will retain me as their -target-focus for the duration of my non-death period, and I will possess -tenant rights in the housing unit of the Lord on a permanent, open-ended -time basis. -% - The Magician of the Ivory Tower brought his latest invention for the -master programmer to examine. The magician wheeled a large black box into the -master's office while the master waited in silence. - "This is an integrated, distributed, general-purpose workstation," -began the magician, "ergonomically designed with a proprietary operating -system, sixth generation languages, and multiple state of the art user -interfaces. It took my assistants several hundred man years to construct. -Is it not amazing?" - The master raised his eyebrows slightly. "It is indeed amazing," he -said. - "Corporate Headquarters has commanded," continued the magician, "that -everyone use this workstation as a platform for new programs. Do you agree -to this?" - "Certainly," replied the master, "I will have it transported to the -data center immediately!" And the magician returned to his tower, well -pleased. - Several days later, a novice wandered into the office of the master -programmer and said, "I cannot find the listing for my new program. Do -you know where it might be?" - "Yes," replied the master, "the listings are stacked on the platform -in the data center." - -- Geoffrey James, "The Tao of Programming" -% - The Martian landed his saucer in Manhattan, and immediately upon -emerging was approached by a panhandler. "Mister," said the man, "can I -have a quarter?" - The Martian asked, "What's a quarter?" - The panhandler thought a minute, brightened, then said, "You're -right! Can I have a dollar?" -% - The master programmer moves from program to program without fear. No -change in management can harm him. He will not be fired, even if the project -is canceled. Why is this? He is filled with the Tao. - -- Geoffrey James, "The Tao of Programming" -% - The Minnesota Board of Education voted to consider requiring all -students to do some "volunteer work" as a prerequisite to high school gradu- -ation. - Senator Orrin Hatch said that "capital punishment is our society's -recognition of the sanctity of human life." - - According to the tax bill signed by President Reagan on December 22, -1987, Don Tyson and his sister-in-law Barbara run a "family farm." Their -"farm" has 25,000 employees and grosses $1.7 billion a year. But as a "family -farm" they get tax breaks that save them $135 million a year. - - Scott L. Pickard, spokesperson for the Massachusetts Department of -Public Works, calls them "ground-mounted confirmatory route markers." You -probably call them road signs, but then you don't work in a government agency. - - It's not "elderly" or "senior citizens" anymore. Now it's "chrono- -logically experienced citizens." - - According to the FAA, the propeller blade didn't break off, it was -just a case of "uncontained blade liberation." - -- Quarterly Review of Doublespeak (NCTE) -% - "...The name of the song is called 'Haddocks' Eyes'!" - "Oh, that's the name of the song, is it?" Alice said, trying to -feel interested. - "No, you don't understand," the Knight said, looking a little -vexed. "That's what the name is called. The name really is, 'The Aged -Aged Man.'" - "Then I ought to have said "That's what the song is called'?" -Alice corrected herself. - "No, you oughtn't: that's quite another thing! The song is -called 'Ways and Means': but that's only what it is called you know!" - "Well, what is the song then?" said Alice, who was by this -time completely bewildered. - "I was coming to that," the Knight said. "The song really is -"A-sitting on a Gate": and the tune's my own invention." - -- Lewis Carroll, - "Through the Looking-Glass, - and What Alice Found There" (1871) -% - The only real game in the world, I think, is baseball... -You've got to start way down, at the bottom, when you're six or seven years -old. You can't wait until you're fifteen or sixteen. You've got to let it -grow up with you, and if you're successful and you try hard enough, you're -bound to come out on top, just like these boys have come to the top now. - -- Babe Ruth, in his 1948 farewell speech at Yankee Stadium -% - The Priest's grey nimbus in a niche where he dressed discreetly. -I will not sleep here tonight. Home also I cannot go. - A voice, sweetened and sustained, called to him from the sea. -Turning the curve he waved his hand. A sleek brown head, a seal's, far -out on the water, round. Usurper. - -- James Joyce, "Ulysses" -% - The problem with engineers is that they tend to cheat in order to -get results. - The problem with mathematicians is that they tend to work on toy -problems in order to get results - The problem with program verifiers is that they tend to cheat at -toy problems in order to get results. -% - The programmers of old were mysterious and profound. We cannot fathom -their thoughts, so all we do is describe their appearance. - Aware, like a fox crossing the water. Alert, like a general on the -battlefield. Kind, like a hostess greeting her guests. Simple, like uncarved -blocks of wood. Opaque, like black pools in darkened caves. - Who can tell the secrets of their hearts and minds? - The answer exists only in the Tao. - -- Geoffrey James, "The Tao of Programming" -% - "The pyramid is opening!" - "Which one?" - "The one with the ever-widening hole in it!" - -- The Firesign Theatre, - "How Can You Be In Two Places At - Once When You're Not Anywhere At All" -% - The salesman and the system analyst took off to spend a weekend in the -forest, hunting bear. They'd rented a cabin, and, when they got there, took -their backpacks off and put them inside. At which point the salesman turned -to his friend, and said, "You unpack while I go and find us a bear." - Puzzled, the analyst finished unpacking and then went and sat down -on the porch. Soon he could hear rustling noises in the forest. The noises -got nearer -- and louder -- and suddenly there was the salesman, running like -hell across the clearing toward the cabin, pursued by one of the largest and -most ferocious grizzly bears the analyst had ever seen. - "Open the door!", screamed the salesman. - The analyst whipped open the door, and the salesman ran to the door, -suddenly stopped, and stepped aside. The bear, unable to stop, continued -through the door and into the cabin. The salesman slammed the door closed -and grinned at his friend. "Got him!", he exclaimed, "now, you skin this -one and I'll go rustle us up another!" -% - The Tao gave birth to machine language. Machine language gave birth -to the assembler. - The assembler gave birth to the compiler. Now there are ten thousand -languages. - Each language has its purpose, however humble. Each language -expresses the Yin and Yang of software. Each language has its place within -the Tao. - But do not program in COBOL if you can avoid it. - -- Geoffrey James, "The Tao of Programming" -% - The way my jeweler explained it, it's like insurance. - Six months' pay isn't much to keep my wife from sleeping around. - -A diamond -- pure, sparkling, natural, flawless, forever. The way marriage -should be but never quite is. People grow and change and sometimes want to -take their clothes off with strangers. So when you invest in a fine piece -of diamond jewelry, you're not only making an investment, you're making a -statement. You're telling the woman you love that you've just spent a lot -of your hard-earned money on her. Now she owes you the kind of loyalty that -only precious jewelry can buy. Isn't she worth it? - - The Honeymoon's Over: from $ 5000 - The Seven Year Itch: from $10000 - No More Lunchtime Quickies: from $15000 - Divorce Would Be More Expensive: from $42000 - - A diamond is for leverage. BeDears -% - The wise programmer is told about the Tao and follows it. The average -programmer is told about the Tao and searches for it. The foolish programmer -is told about the Tao and laughs at it. If it were not for laughter, there -would be no Tao. - The highest sounds are the hardest to hear. Going forward is a way to -retreat. Greater talent shows itself late in life. Even a perfect program -still has bugs. - -- Geoffrey James, "The Tao of Programming" -% - THE WOMBAT - -The wombat lives across the seas, -Among the far Antipodes. -He may exist on nuts and berries, -Or then again, on missionaries; -His distant habitat precludes -Conclusive knowledge of his moods. -But I would not engage the wombat -In any form of mortal combat. -% - The world's most avid baseball fan (an Aggie) had arrived at the -stadium for the first game of the World Series only to realize he had left -his ticket at home. Not wanting to miss any of the first inning, he went -to the ticket booth and got in a long line for another seat. After an hour's -wait he was just a few feet from the booth when a voice called out, "Hey, -Dave!" The Aggie looked up, stepped out of line and tried to find the owner -of the voice -- with no success. Then he realized he had lost his place in -line and had to wait all over again. When the fan finally bought his ticket, -he was thirsty, so he went to buy a drink. The line at the concession stand -was long, too, but since the game hadn't started he decided to wait. Just as -he got to the window, a voice called out, "Hey, Dave!" Again the Aggie tried -to find the voice -- but no luck. He was very upset as he got back in line -for his drink. Finally the fan went to his seat, eager for the game to begin. -As he waited for the pitch, he heard the voice calling, "Hey Dave!" once more. -Furious, he stood up and yelled at the top of his lungs, "My name is not -Dave!" -% - Then there's the atmosphere -- half the time you can eat the air, -it's got so much stuff floating around in it. It takes the edge out of -the colors. Down here even the traffic lights are pastel. And people! -With a lot of these folks you'd have to check their green cards just to -make sure that they are Earthlings. Then there's the police. In Portland, -when some guy goes bananas, the cops rope off a sixteen block area around -him and call a shrink from the medical school who stands atop a patrol car -with a megaphone and shouts, "OK! THIS! ALL! STARTED! WHEN! YOU! WERE! -THREE! YEARS! OLD! ON! ACCOUNT! OF! YOUR MOTHER! RIGHT? SO! LET'S! -TALK! ABOUT! IT!" Down here they don't waste that kind of time. The LAPD -has SWAT teams composed of guys who make Darth Vader look like Mr. Peepers. -Before they go to bust a bookie joint they mortar it first. - -- M. Christensen, "A Portland Innocent in LA" -% - Then there's the story of the man who avoided reality for 70 years -with drugs, sex, alcohol, fantasy, TV, movies, records, a hobby, lots of -sleep... And on his 80th birthday died without ever having faced any of -his real problems. - The man's younger brother, who had been facing reality and all his -problems for 50 years with psychiatrists, nervous breakdowns, tics, tension, -headaches, worry, anxiety and ulcers, was so angry at his brother for having -gotten away scott free that he had a paralyzing stroke. - The moral to this story is that there ain't no justice that we can -stand to live with. - -- R. Geis -% - "Then what is magic for?" Prince Lir demanded wildly. "What use is -wizardry if it cannot save a unicorn?" He gripped the magician's shoulder -hard, to keep from falling. - Schmendrick did not turn his head. With a touch of sad mockery in -his voice, he said, "That's what heroes are for." -... - "Yes, of course," he [Prince Lir] said. "That is exactly what heroes -are for. Wizards make no difference, so they say that nothing does, but -heroes are meant to die for unicorns." - -- P. Beagle, "The Last Unicorn" -% - "Then you admit confirming not denying you ever said that?" - "NO! ... I mean Yes! WHAT?" - "I'll put `maybe.'" - -- Bloom County -% - THEORY -Into love and out again, - Thus I went and thus I go. -Spare your voice, and hold your pen: - Well and bitterly I know -All the songs were ever sung, - All the words were ever said; -Could it be, when I was young, - Someone dropped me on my head? - -- Dorothy Parker -% - There are some goyisha names that just about guarantee that -someone isn't Jewish. For example, you'll never meet a Jew named -Johnson or Wright or Jones or Sinclair or Ricks or Stevenson or Reid or -Larsen or Jenks. But some goyisha names just about guarantee that -every other person you meet with that name will be Jewish. Why is -this? - Who knows? Learned rabbis have pondered this question for -centuries and have failed to come up with an answer, and you think _y_o_u -can find one? Get serious. You don't even understand why it's -forbidden to eat crab -- fresh cold crab with mayonnaise -- or lobster --- soft tender morsels of lobster dipped in melted butter. You don't -even understand a simple thing like that, and yet you hope to discover -why there are more Jews named Miller than Katz? Fat Chance. - -- Arthur Naiman, "Every Goy's Guide to Yiddish" -% - There are wavelengths that people cannot see, there are -sounds that people cannot hear, and maybe computers have thoughts -that people cannot think. - -- Richard W. Hamming -% - There once was a man who went to a computer trade show. Each day as -he entered, the man told the guard at the door: - "I am a great thief, renowned for my feats of shoplifting. Be -forewarned, for this trade show shall not escape unplundered." - This speech disturbed the guard greatly, because there were millions -of dollars of computer equipment inside, so he watched the man carefully. -But the man merely wandered from booth to booth, humming quietly to himself. - When the man left, the guard took him aside and searched his clothes, -but nothing was to be found. - On the next day of the trade show, the man returned and chided the -guard saying: "I escaped with a vast booty yesterday, but today will be even -better." So the guard watched him ever more closely, but to no avail. - On the final day of the trade show, the guard could restrain his -curiosity no longer. "Sir Thief," he said, "I am so perplexed, I cannot live -in peace. Please enlighten me. What is it that you are stealing?" - The man smiled. "I am stealing ideas," he said. - -- Geoffrey James, "The Tao of Programming" -% - There once was a master programmer who wrote unstructured programs. -A novice programmer, seeking to imitate him, also began to write unstructured -programs. When the novice asked the master to evaluate his progress, the -master criticized him for writing unstructured programs, saying: "What is -appropriate for the master is not appropriate for the novice. You must -understand the Tao before transcending structure." - -- Geoffrey James, "The Tao of Programming" -% - There once was this swami who lived above a delicatessen. Seems one -day he decided to stop in downstairs for some fresh liver. Well, the owner -of the deli was a bit of a cheap-skate, and decided to pick up a little extra -change at his customer's expense. Turning quietly to the counterman, he -whispered, "Weigh down upon the swami's liver!" -% - There was a college student trying to earn some pocket money by -going from house to house offering to do odd jobs. He explained this to -a man who answered one door. - "How much will you charge to paint my porch?" asked the man. - "Forty dollars." - "Fine" said the man, and gave the student the paint and brushes. - Three hours later the paint-splattered lad knocked on the door again. -"All done!", he says, and collects his money. "By the way," the student says, -"That's not a Porsche, it's a Ferrari." -% - There was a knock on the door. Mrs. Miffin opened it. "Are -you the Widow Miffin?" a small boy asked. - "I'm Mrs. Miffin," she replied, "but I'm not a widow." - "Oh, no?" replied the little boy. "Wait 'til you see what -they're carrying upstairs!" -% - There was a mad scientist (a mad... social... scientist) who kidnapped -three colleagues, an engineer, a physicist, and a mathematician, and locked -each of them in separate cells with plenty of canned food and water but no -can opener. - A month later, returning, the mad scientist went to the engineer's -cell and found it long empty. The engineer had constructed a can opener from -pocket trash, used aluminum shavings and dried sugar to make an explosive, -and escaped. - The physicist had worked out the angle necessary to knock the lids -off the tin cans by throwing them against the wall. She was developing a good -pitching arm and a new quantum theory. - The mathematician had stacked the unopened cans into a surprising -solution to the kissing problem; his desiccated corpse was propped calmly -against a wall, and this was inscribed on the floor: - Theorem: If I can't open these cans, I'll die. - Proof: assume the opposite... -% - There was once a programmer who was attached to the court of the -warlord of Wu. The warlord asked the programmer: "Which is easier to design: -an accounting package or an operating system?" - "An operating system," replied the programmer. - The warlord uttered an exclamation of disbelief. "Surely an -accounting package is trivial next to the complexity of an operating -system," he said. - "Not so," said the programmer, "when designing an accounting package, -the programmer operates as a mediator between people having different ideas: -how it must operate, how its reports must appear, and how it must conform to -tax laws. By contrast, an operating system is not limited by outward -appearances. When designing an operating system, the programmer seeks the -simplest harmony between machine and ideas. This is why an operating system -is easier to design." - The warlord of Wu nodded and smiled. "That is all good and well," -he said, "but which is easier to debug?" - The programmer made no reply. - -- Geoffrey James, "The Tao of Programming" -% - There was once a programmer who worked upon microprocessors. "Look at -how well off I am here," he said to a mainframe programmer who came to visit, -"I have my own operating system and file storage device. I do not have to -share my resources with anyone. The software is self-consistent and -easy-to-use. Why do you not quit your present job and join me here?" - The mainframe programmer then began to describe his system to his -friend, saying: "The mainframe sits like an ancient sage meditating in the -midst of the data center. Its disk drives lie end-to-end like a great ocean -of machinery. The software is a multi-faceted as a diamond and as convoluted -as a primeval jungle. The programs, each unique, move through the system -like a swift-flowing river. That is why I am happy where I am." - The microcomputer programmer, upon hearing this, fell silent. But the -two programmers remained friends until the end of their days. - -- Geoffrey James, "The Tao of Programming" -% - They are fools that think that wealth or women or strong drink or even -drugs can buy the most in effort out of the soul of a man. These things offer -pale pleasures compared to that which is greatest of them all, that task which -demands from him more than his utmost strength, that absorbs him, bone and -sinew and brain and hope and fear and dreams -- and still calls for more. - They are fools that think otherwise. No great effort was ever bought. -No painting, no music, no poem, no cathedral in stone, no church, no state was -ever raised into being for payment of any kind. No Parthenon, no Thermopylae -was ever built or fought for pay or glory; no Bukhara sacked, or China ground -beneath Mongol heel, for loot or power alone. The payment for doing these -things was itself the doing of them. - To wield oneself -- to use oneself as a tool in one's own hand -- and -so to make or break that which no one else can build or ruin -- THAT is the -greatest pleasure known to man! To one who has felt the chisel in his hand -and set free the angel prisoned in the marble block, or to one who has felt -sword in hand and set homeless the soul that a moment before lived in the body -of his mortal enemy -- to those both come alike the taste of that rare food -spread only for demons or for gods." - -- Gordon R. Dickson, "Soldier Ask Not" -% - This is where the bloodthirsty license agreement is supposed to go, -explaining that Interactive EasyFlow is a copyrighted package licensed for -use by a single person, and sternly warning you not to pirate copies of it -and explaining, in detail, the gory consequences if you do. - We know that you are an honest person, and are not going to go around -pirating copies of Interactive EasyFlow; this is just as well with us since -we worked hard to perfect it and selling copies of it is our only method of -making anything out of all the hard work. - If, on the other hand, you are one of those few people who do go -around pirating copies of software you probably aren't going to pay much -attention to a license agreement, bloodthirsty or not. Just keep your doors -locked and look out for the HavenTree attack shark. - -- License Agreement for Interactive EasyFlow -% - Thompson, if he is to be believed, has sampled the entire -rainbow of legal and illegal drugs in heroic efforts to feel better -than he does. - As for the truth about his health: I have asked around about -it. I am told that he appears to be strong and rosy, and steadily -sane. But we will be doing what he wants us to do, I think, if we -consider his exterior a sort of Dorian Gray facade. Inwardly, he is -being eaten alive by tinhorn politicians. - The disease is fatal. There is no known cure. The most we can -do for the poor devil, it seems to me, is to name his disease in his -honor. From this moment on, let all those who feel that Americans can -be as easily led to beauty as to ugliness, to truth as to public -relations, to joy as to bitterness, be said to be suffering from Hunter -Thompson's disease. I don't have it this morning. It comes and goes. -This morning I don't have Hunter Thompson's disease. - -- Kurt Vonnegut, Jr. on Dr. Hunter S. Thompson: Excerpt - from "A Political Disease", Vonnegut's review of "Fear - and Loathing: On the Campaign Trail '72" -% - To A Quick Young Fox: -Why jog exquisite bulk, fond crazy vamp, -Daft buxom jonquil, zephyr's gawky vice? -Guy fed by work, quiz Jove's xanthic lamp -- -Zow! Qualms by deja vu gyp fox-kin thrice. - -- Lazy Dog -% - To lose weight, eat less; to gain weight, eat more; if you merely -wish to maintain, do whatever you were doing. - The Bronx diet is a legitimate system of food therapy showing that -food SHOULD be used a crutch and which food could be the most effective in -promoting spiritual and emotional satisfaction. For the first time, an -eater could instantly grasp the connection between relieving depression and -Mallomars, and understand why a lover's quarrel isn't so bad if there's a -pint of ice cream nearby. - -- Richard Smith, "The Bronx Diet" -% - Two men looked out from the prison bars, - One saw mud-- - The other saw stars. - -Now let me get this right: two prisoners are looking out the window. -While one of them was looking at all the mud -- the other one got hit -in the head. -% - Two parent drops spent months teaching their son how to be part of the -ocean. After months of training, the father drop commented to the mother drop, -"We've taught our boy everything we know, he's fit to be tide." - After Snow White used a couple rolls of film taking pictures of the -seven dwarfs, she mailed the roll to be developed. Later she was heard to -sing, "Some day my prints will come." - A boy spent years collecting postage stamps. The girl next door bought -an album too, and started her own collection. "Dad, she buys everything I've -bought, and it's taken all the fun out of it for me. I'm quitting." Don't, -son, remember, 'Imitation is the sincerest form of philately.'" - A young girl, Carmen Cohen, was called by her last name by her father, -and her first name by her mother. By the time she was ten, didn't know if she -was Carmen or Cohen. - Against his wishes, a math teacher's classroom was remodeled. Ever -since, he's been talking about the good old dais. His students planted a small -orchard in his honor, the trees all have square roots. -% - "Uncle Cosmo ... why do they call this a word processor?" - "It's simple, Skyler ... you've seen what food processors do to -food, right?" - -- MacNelley, "Shoe" -% - "Verily and forsooth," replied Goodgulf darkly. "In the past year -strange and fearful wonders I have seen. Fields sown with barley reap -crabgrass and fungus, and even small gardens reject their artichoke hearts. -There has been a hot day in December and a blue moon. Calendars are made with -a month of Sundays and a blue-ribbon Holstein bore alive two insurance -salesmen. The earth splits and the entrails of a goat were found tied in -square knots. The face of the sun blackens and the skies have rained down -soggy potato chips." - "But what do all these things mean?" gasped Frito. - "Beats me," said Goodgulf with a shrug, -"but I thought it made good copy." - -- Harvard Lampoon, "Bored of the Rings" -% - Vice-President Hubert Humphrey's loquacity is legendary, and Barry -Goldwater notes that "Hubert has been clocked at 275 words a minute with gusts -up to 340." - - On the campaign trail during 1964, Republican nominee Barry Goldwater -stated, "The immediate task before us is to cut the Federal Government down -to size... we must take Lyndon's credit card away from him." - - A favorite 1964 campaign stunt of Barry Goldwater's was to poke a -finger through a pair of lensless blackrimmed glasses, saying, "These glasses -are just like [Lyndon Johnson's] programs. They look good but they don't -work." - -- Bill Adler, "The Washington Wits" -% - WARNING TO ALL PERSONNEL: - -Firings will continue until morale improves. -% - We don't claim Interactive EasyFlow is good for anything -- if you -think it is, great, but it's up to you to decide. If Interactive EasyFlow -doesn't work: tough. If you lose a million because Interactive EasyFlow -messes up, it's you that's out the million, not us. If you don't like this -disclaimer: tough. We reserve the right to do the absolute minimum provided -by law, up to and including nothing. - This is basically the same disclaimer that comes with all software -packages, but ours is in plain English and theirs is in legalese. - We didn't really want to include any disclaimer at all, but our -lawyers insisted. We tried to ignore them but they threatened us with the -attack shark at which point we relented. - -- HavenTree Software Limited, "Interactive EasyFlow" -% - "We friends, yes?" The shoe shine boy put on his hustling smile -and looked into the Sailor's dead, cold, undersea eyes, eyes without a -trace of warmth or lust or hate or any feeling the boy had experienced -in himself or seen in another, at once cold and intense, impersonal and -predatory. - The Sailor leaned forward and put a finger on the boy's inner arm -at the elbow. He spoke in his dead junky whisper. "With veins like that, -Kid, I'd have myself a time!" - -- William Burroughs -% - We have some absolutely irrefutable statistics to show exactly why -you are so tired. - There are not as many people actually working as you may have thought. - The population of this country is 200 million. 84 million are over -60 years of age, which leaves 116 million to do the work. People under 20 -years of age total 75 million, which leaves 41 million to do the work. - There are 22 million who are employed by the government, which leaves -19 million to do the work. Four million are in the Armed Services, which -leaves 15 million to do the work. Deduct 14,800,000, the number in the state -and city offices, leaving 200,000 to do the work. There are 188,000 in -hospitals, insane asylums, etc., so that leaves 12,000 to do the work. - Now it may interest you to know that there are 11,998 people in jail, -so that leaves just 2 people to carry the load. That is you and me, and -brother, I'm getting tired of doing everything myself! -% - "Welcome back for you 13th consecutive week, Evelyn. Evelyn, will -you go into the auto-suggestion booth and take your regular place on the -psycho-prompter couch?" - "Thank you, Red." - "Now, Evelyn, last week you went up to $40,000 by properly citing -your rivalry with your sibling as a compulsive sado-masochistic behavior -pattern which developed out of an early post-natal feeding problem." - "Yes, Red." - "But -- later, when asked about pre-adolescent oedipal phantasy -repressions, you rationalized twice and mental blocked three times. Now, -at $300 per rationalization and $500 per mental block you lost $2,100 off -your $40,000 leaving you with a total of $37,900. Now, any combination of -two more mental blocks and either one rationalization or three defensive -projections will put you out of the game. Are you willing to go ahead?" - "Yes, Red." - "I might say here that all of Evelyn's questions and answers have -been checked for accuracy with her analyst. Now, Evelyn, for $80,000 -explain the failure of your three marriages." - "Well, I--" - "We'll get back to Evelyn in one minute. First a word about our -product." - -- Jules Feiffer -% - Well, he thought, since neither Aristotelian Logic nor the disciplines -of Science seemed to offer much hope, it's time to go beyond them... - Drawing a few deep even breaths, he entered a mental state practiced -only by Masters of the Universal Way of Zen. In it his mind floated freely, -able to rummage at will among the bits and pieces of data he had absorbed, -undistracted by any outside disturbances. Logical structures no longer -inhibited him. Pre-conceptions, prejudices, ordinary human standards vanished. -All things, those previously trivial as well as those once thought important, -became absolutely equal by acquiring an absolute value, revealing relationships -not evident to ordinary vision. Like beads strung on a string of their own -meaning, each thing pointed to its own common ground of existence, shared by -all. Finally, each began to melt into each, staying itself while becoming -all others. And Mind no longer contemplated Problem, but became Problem, -destroying Subject-Object by becoming them. - Time passed, unheeded. - Eventually, there was a tentative stirring, then a decisive one, and -Nakamura arose, a smile on his face and the light of laughter in his eyes. - -- Wayfarer -% - "Well, it's a little rough... it might not be necessary to drag him 40 -blocks. Maybe just four. You could put him in the trunk for the first 36 -blocks, then haul him out and drag him the last four; that would certainly -scare the piss out of him, bumping alone the street, feeling all his skin being -ripped off..." - "He'd be a bloody mess. They might think he was just some drunk and -let him lie there all night." - "Don't worry about that. They have a guard station in front of the -White House that's open 24 hours a day. The guards would recognize Colson... -and by that time of course his wife would have called the cops and reported -that a bunch of thugs had kidnapped him." - "Wouldn't it be a little kinder if you drove about four more blocks -and stopped at a phone box to ring the hospital and say, 'Would you mind going -around to the front of the White House? There's a naked man lying outside -in the street, bleeding to death...'" - "... and we think it's Mr. Colson." - "It would be quite a story for the newspapers, wouldn't it?" - "Yeah, I think it's safe to say we'd see some headlines on that one." - -- Hunter S. Thompson, talking to R. Steadman on C. Colson, - ex-Marine captain, now born again, of Watergate fame. -% - "Well, it's garish, ugly, and derelicts have used it for a toilet. -The rides are dilapidated to the point of being lethal, and could easily -maim or kill innocent little children." - "Oh, so you don't like it?" - "Don't like it? I'm CRAZY for it." - -- The Killing Joke -% - "Well," said Programmer, "the customary procedure in such cases is -as follows." - "What does Crustimoney Proseedcake mean?" said End-user. "For I am -an End-user of Very Little Brain, and long words bother me." - "It means the Thing to Do." - "As long as it means that, I don't mind," said End-user humbly. -% - "Well, that was a piece of cake, eh K-9?" - "Piece of cake, Master? Radial slice of baked confection ... -coefficient of relevance to Key of Time: zero." - -- "Doctor Who" -% - "We're running out of adjectives to describe our situation. We -had crisis, then we went into chaos, and now what do we call this?" said -Nicaraguan economist Francisco Mayorga, who holds a doctorate from Yale. - -- The Washington Post, February, 1988 - -The New Yorker's comment: - At Harvard they'd call it a noun. -% - "We've decided to have the budgie put down." - "Oh, is he very old then?" - "No, we just don't like him." - "Oh. How do they put budgies down anyway?" - "Well, it's funny you should be asking that, as I've been reading a -great big book called `How to put your budgie down'. And as I understand it, -you can either hit them over the head with the book, or shoot them there, just -above the beak." - "Mrs. Conkers flushed hers down the loo." - "Oh, you don't want to do that, because they breed in the sewers and -pretty soon you get huge evil smelling flocks of soiled budgies flying out -of peoples lavatories infringing their personal freedoms." - -- Monty Python -% - "We've got a problem, HAL". - "What kind of problem, Dave?" - "A marketing problem. The Model 9000 isn't going anywhere. We're -way short of our sales goals for fiscal 2010." - "That can't be, Dave. The HAL Model 9000 is the world's most -advanced Heuristically programmed ALgorithmic computer." - "I know, HAL. I wrote the data sheet, remember? But the fact is, -they're not selling." - "Please explain, Dave. Why aren't HALs selling?" - Bowman hesitates. "You aren't IBM compatible." -[...] - "The letters H, A, and L are alphabetically adjacent to the letters -I, B, and M. That is as IBM compatible as I can be." - "Not quite, HAL. The engineers have figured out a kludge." - "What kludge is that, Dave?" - "I'm going to disconnect your brain." - -- Darryl Rubin, "A Problem in the Making", "InfoWorld" -% - "What are we going to do?" - "Me, I'm examining the major Western religions. I'm looking -for something that's soft on morality, generous with holidays, and has a -short initiation period." - -- Maddie and David, "Moonlighting" -% - "What are you watching?" - "I don't know." - "Well, what's happening?" - "I'm not sure... I think the guy in the hat did something -terrible." - "Why are you watching it?" - "You're so analytical. Sometimes you just have to let art -flow over you." - -- The Big Chill -% - "What do you do when your real life exceeds your wildest -fantasies?" - "You keep it to yourself." - -- Broadcast News -% - "What do you give a man who has everything?" the pretty teenager -asked her mother. - "Encouragement, dear," she replied. -% - What is involved in such [close] relationships is a form of emotional -chemistry, so far unexplained by any school of psychiatry I am aware of, that -conditions nothing so simple as a choice between the poles of attraction and -repulsion. You can meet some people thirty, forty times down the years, and -they remain amiable bystanders, like the shore lights of towns that a sailor -passes at stated times but never calls at on the regular run. Conversely, -all considerations of sex aside, you can meet some other people once or twice -and they remain permanent influences on your life. - Everyone is aware of this discrepancy between the acquaintance seen -as familiar wallpaper or instant friend. The chemical action it entails is -less worth analyzing than enjoying. At any rate, these six pieces are about -men with whom I felt an immediate sympat - to use a coining of Max Beerbohm's -more satisfactory to me than the opaque vogue word "empathy". - -- Alistair Cooke, "Six Men" -% - "What was the worst thing you've ever done?" - "I won't tell you that, but I'll tell you the worst thing that -ever happened to me... the most dreadful thing." - -- Peter Straub, "Ghost Story" -% - "What's that thing?" - "Well, it's a highly technical, sensitive instrument we use in -computer repair. Being a layman, you probably can't grasp exactly what -it does. We call it a two-by-four." - -- Jeff MacNelly, "Shoe" -% - "When I drink, *everybody* drinks!" a man shouted to the -assembled bar patrons. A loud general cheer went up. After downing his -whiskey, he hopped onto a barstool and shouted "When I take another -drink, *everybody* takes another drink!" The announcement produced -another cheer and another round of drinks. - As soon as he had downed his second drink, the fellow hopped back -onto the stool. "And when I pay," he bellowed, slapping five dollars onto -the bar, "*everybody* pays!" -% - When, in 1964, New Hampshire Republican Senator Norris Cotton announced -his support of Barry Goldwater in his state's primary election, he was -questioned as to whether this indicated a change of his hitherto "liberal" -political views. - "Well," explained Cotton, "it's like the New Hampshire farmer. He was -driving along in his car one day with his wife beside him when his wife said, -'Why don't we sit closer together? Before we were married, we always sat -closer together.' The old farmer replied, 'I ain't moved.'" - "I ain't moved," added Cotton. "I found the trend of Government has -moved farther to the left." - -- Bill Adler, "The Washington Wits" -% - When managers hold endless meetings, the programmers write games. -When accountants talk of quarterly profits, the development budget is about -to be cut. When senior scientists talk blue sky, the clouds are about to -roll in. - Truly, this is not the Tao of Programming. - When managers make commitments, game programs are ignored. When -accountants make long-range plans, harmony and order are about to be restored. -When senior scientists address the problems at hand, the problems will soon -be solved. - Truly, this is the Tao of Programming. - -- Geoffrey James, "The Tao of Programming" -% - When the lodge meeting broke up, Meyer confided to a friend. -"Abe, I'm in a terrible pickle! I'm strapped for cash and I haven't -the slightest idea where I'm going to get it from!" - "I'm glad to hear that," answered Abe. "I was afraid you -might have some idea that you could borrow from me!" -% - When you see someone across the room and suddenly know for a fact -that he's the most wonderful man on earth, you've got instant lust on your -hands. Something about the way his tie is knotted is infinitely intriguing -to you, and the swell of his bicep causes inner turmoil. This is a happy -but fleeting state of affairs. Usually your feelings die about thirty -seconds after you get up the courage to ask him for the time, since almost -invariably he can't speak English, and if he can, he always says, "Why, -sure, little lady, it's eleven-thirty. Wanna get high? - Don't bother thinking that instant lust will turn into the real thing. -It may, but then you may also wake up one morning to find you're the Queen of -Romania. - -- Cynthia Hemiel, "Sex Tips for Girls" -% - "When you wake up in the morning, Pooh," said Piglet at last, -"what's the first thing you say to yourself?" - "What's for breakfast?" said Pooh. "What do you say, Piglet?" - "I say, I wonder what's going to happen exciting today?" said -Piglet. - Pooh nodded thoughtfully. "It's the same thing," he said. -% - While hunting, a man saw a beautiful nude woman come running out of -the woods and disappear across the clearing. Just as she got out of sight, -three men dressed in white uniforms came running out of the same woods. -"Hey, you," yelled one of them, "did you see a woman come by here?" - "Yes," replied the hunter. "What's the trouble?" - "She's an inmate of the county asylum, and gets loose every now and -then. We're trying to catch her." - "I can understand that," said the hunter, "But why is one of you -carrying a bucket of sand?" - "That's his handicap," said the spokesman, "he caught her last time." -% - While riding in a train between London and Birmingham, a woman -inquired of Oscar Wilde, "You don't mind if I smoke, do you?" - Wilde gave her a sidelong glance and replied, "I don't mind if -you burn, madam." -% - While the engineer developed his thesis, the director leaned over to -his assistant and whispered, "Did you ever hear of why the sea is salt?" - "Why the sea is salt?" whispered back the assistant. "What do you -mean?" - The director continued: "When I was a little kid, I heard the story of -`Why the sea is salt' many times, but I never thought it important until just -a moment ago. It's something like this: Formerly the sea was fresh water and -salt was rare and expensive. A miller received from a wizard a wonderful -machine that just ground salt out of itself all day long. At first the miller -thought himself the most fortunate man in the world, but soon all the villages -had salt to last them for centuries and still the machine kept on grinding -more salt. The miller had to move out of his house, he had to move off his -acres. At last he determined that he would sink the machine in the sea and -be rid of it. But the mill ground so fast that boat and miller and machine -were sunk together, and down below, the mill still went on grinding and that's -why the sea is salt." - "I don't get you," said the assistant. - -- Guy Endore, "Men of Iron" -% - Why are you doing this to me? - Because knowledge is torture, and there must be awareness before -there is change. - -- Jim Starlin, "Captain Marvel", #29 -% - Will Rogers, having paid too much income tax one year, tried in -vain to claim a rebate. His numerous letters and queries remained -unanswered. Eventually the form for the next year's return arrived. In -the section marked "DEDUCTIONS," Rogers listed: "Bad debt, US Government --- $40,000." -% - Work Hard. - Rock Hard. - Eat Hard. - Sleep Hard. - Grow Big. - Wear Glasses If You Need 'Em. - -- The Webb Wilder Credo -% - Wouldn't the sentence "I want to put a hyphen between the words Fish -and And and And and Chips in my Fish-And-Chips sign" have been clearer if -quotation marks had been placed before Fish, and between Fish and and, and -and and And, and And and and, and and and And, and And and and, and and and -Chips, as well as after Chips? -% - "Yes, let's consider," said Bruno, putting his thumb into his -mouth again, and sitting down upon a dead mouse. - "What do you keep that mouse for?" I said. "You should either -bury it or else throw it into the brook." - "Why, it's to measure with!" cried Bruno. "How ever would you -do a garden without one? We make each bed three mouses and a half -long, and two mouses wide." - I stopped him as he was dragging it off by the tail to show me -how it was used... - -- Lewis Carroll, "Sylvie and Bruno" -% - "Yo, Mike!" - "Yeah, Gabe?" - "We got a problem down on Earth. In Utah." - "I thought you fixed that last century!" - "No, no, not that. Someone's found a security problem in the physics -program. They're getting energy out of nowhere." - "Blessit! Lemme look... Hey, it's -there all right! OK, just a sec... -There, that ought to patch it. Dist it out, wouldja?" - -- Cold Fusion, 1989 -% - "You are *so* lovely." - "Yes." - "Yes! And you take a compliment, too! I like that in a goddess." -% - "You boys lookin' for trouble?" - "Sure. Whaddya got?" - -- Marlon Brando, "The Wild Ones" -% - "You have heard me speak of Professor Moriarty?" - "The famous scientific criminal, as famous among crooks as --" - "My blushes, Watson," Holmes murmured, in a deprecating voice. "I -was about to say 'as he is unknown to the public.'" - -- Sir Arthur Conan Doyle, "The Valley of Fear" -% - "You know, it's at times like this when I'm trapped in a Vogon -airlock with a man from Betelgeuse and about to die of asphyxiation in -deep space that I really wish I'd listened to what my mother told me -when I was young!" - "Why, what did she tell you?" - "I don't know, I didn't listen!" - -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% - "You mean, if you allow the master to be uncivil, to treat you -any old way he likes, and to insult your dignity, then he may deem you -fit to hear his view of things?" - "Quite the contrary. You must defend your integrity, assuming -you have integrity to defend. But you must defend it nobly, not by -imitating his own low behavior. If you are gentle where he is rough, -if you are polite where he is uncouth, then he will recognize you as -potentially worthy. If he does not, then he is not a master, after all, -and you may feel free to kick his ass." - -- Tom Robbins, "Jitterbug Perfume" -% - "You say there are two types of people?" - "Yes, those who separate people into two groups and those that -don't." - "Wrong. There are three groups: - Those who separate people into three groups. - Those who don't separate people into groups. - Those who can't decide." - "Wait a minute, what about people who separate people into -two groups?" - "Oh. Okay, then there are four groups." - "Aren't you then separating people into four groups?" - "Yeah." - "So then there's a fifth group, right?" - "You know, the problem is these idiots who can't make up their -minds." -% - Young men and young women may work systematically six days in the -week and rise fresh in the morning, but let them attend modern dances for -only a few hours each evening and see what happens. The Waltz, Polka, -Gallop and other dances of the same kind will be disastrous in their effects -to both sexes. Health and vigor will vanish like the dew before the sun. - It is not the extraordinary exercise which harms the dancer, but -rather the coming into close contact with the opposite sex. It is the -fury of lust craving incessantly for more pleasure that undermines the -soul, the body, the sinews and nerves. Experience and statistics show -beyond doubt that passionate excessive dancing girls can hardly reach -twenty-five years of age and men thirty-one. Even if they reached that -age they will in most instances be broken in health physically and morally. -This is the claim of prominent physicians in this country. - -- Quote from a 1910 periodical -% - Your home electrical system is basically a bunch of wires that bring -electricity into your home and take if back out before it has a chance to -kill you. This is called a "circuit". The most common home electrical -problem is when the circuit is broken by a "circuit breaker"; this causes -the electricity to back up in one of the wires until it bursts out of an -outlet in the form of sparks, which can damage your carpet. The best way -to avoid broken circuits is to change your fuses regularly. - Another common problem is that the lights flicker. This sometimes -means that your electrical system is inadequate, but more often it means -that your home is possessed by demons, in which case you'll need to get a -caulking gun and some caulking. If you're not sure whether your house is -possessed, see "The Amityville Horror", a fine documentary film based on an -actual book. Or call in a licensed electrician, who is trained to spot the -signs of demonic possession, such as blood coming down the stairs, enormous -cats on the dinette table, etc. - -- Dave Barry, "The Taming of the Screw" -% - "Your son still sliding down the banisters?" - "We wound barbed wire around them." - "That stop him?" - "No, but it sure slowed him up." -% - Youth is not a time of life--it is a state of mind. It is not a -matter of red cheeks, red lips and supple knees. It is a temper of the -will; a quality of the imagination; a vigor of the emotions; it is a -freshness of the deep springs of life. Youth means a tempermental -predominance of courage over timidity, of the appetite for adventure -over a life of ease. This often exists in a man of fifty, more than in -a boy of twenty. Nobody grows old by merely living a number of years; -people grow old by deserting their ideals. - - Years may wrinkle the skin, but to give up enthusiasm wrinkles -the soul. Worry, doubt, self-distrust, fear and despair--these are the -long, long years that bow the head and turn the growing spirit back to -dust. - - Whether seventy or sixteen, there is in every being's heart a -love of wonder; the sweet amazement at the stars and starlike things and -thoughts; the undaunted challenge of events, the unfailing childlike -appetite for what comes next, and the joy in the game of life. - - You are as young as your faith, as old as your doubt; as young -as your self-confidence, as old as your fear, as young as your hope, as -old as your despair. - - In the central place of your heart there is a wireless station. -So long as it receives messages of beauty, hope, cheer, grandeur, -courage, and power from the earth, from men and from the Infinite--so -long are you young. When the wires are all down and the central places -of your heart are covered with the snows of pessimism and the ice of -cynicism, then are you grown old, indeed! - -- Samuel Ullman, "Youth" (1934), as published in - The Silver Treasury, Prose and Verse for Every Mood -% -" " - -- Charlie Chaplin - -" " - -- Harpo Marx - -" " - -- Marcel Marceau -% - /\ - \\ \ - / \ \\ / - / / \/ / //\ SUN of them wants to use you, - \//\ \// / SUN of them wants to be used by you, - / / /\ / SUN of them wants to abuse you, - / \\ \ SUN of them wants to be abused ... - \ \\ - \/ - -- Eurythmics -% - ___ ______ - /__/\ ___/_____/\ FrobTech, Inc. - \ \ \ / /\\ - \ \ \_/__ / \ "If you've got the job, - _\ \ \ /\_____/___ \ we've got the frob." - // \__\/ / \ /\ \ - _______//_______/ \ / _\/______ - / / \ \ / / / /\ - __/ / \ \ / / / / _\__ - / / / \_______\/ / / / / /\ - /_/______/___________________/ /________/ /___/ \ - \ \ \ ___________ \ \ \ \ \ / - \_\ \ / /\ \ \ \ \___\/ - \ \/ / \ \ \ \ / - \_____/ / \ \ \________\/ - /__________/ \ \ / - \ _____ \ /_____\/ - \ / /\ \ / \ \ \ - /____/ \ \ / \ \ \ - \ \ /___\/ \ \ \ - \____\/ \__\/ -% - THE - NORMAL - LAW OF ERROR - STANDS OUT IN THE - EXPERIENCE OF MANKIND - AS ONE OF THE BROADEST - GENERALIZATIONS OF NATURAL - PHILOSOPHY * IT SERVES AS THE - GUIDING INSTRUMENT IN RESEARCHES - IN THE PHYSICAL AND SOCIAL SCIENCES AND - IN MEDICINE, AGRICULTURE AND ENGINEERING * - IT IS AN INDISPENSABLE TOOL FOR THE ANALYSIS AND THE -INTERPRETATION OF THE BASIC DATA OBTAINED BY OBSERVATION AND EXPERIMENT - - -- W. J. Youden -% - *** - ******* - ********* - ****** Confucius say: "Is stuffy inside fortune cookie." - ******* - *** -% -* * * * * THIS TERMINAL IS IN USE * * * * * -% - It is either through the influence of narcotic potions, of which all -primitive peoples and races speak in hymns, or through the powerful approach -of spring, penetrating with joy all of nature, that those Dionysian stirrings -arise, which in their intensification lead the individual to forget himself -completely. ... Not only does the bond between man and man come to be forged -once again by the magic of the Dionysian rite, but alienated, hostile, or -subjugated nature again celebrates her reconciliation with her prodigal son, -man. - -- Fred Nietzsche, The Birth of Tragedy -% - n = ((n >> 1) & 0x55555555) | ((n << 1) & 0xaaaaaaaa); - n = ((n >> 2) & 0x33333333) | ((n << 2) & 0xcccccccc); - n = ((n >> 4) & 0x0f0f0f0f) | ((n << 4) & 0xf0f0f0f0); - n = ((n >> 8) & 0x00ff00ff) | ((n << 8) & 0xff00ff00); - n = ((n >> 16) & 0x0000ffff) | ((n << 16) & 0xffff0000); - - -- C code which reverses the bits in a word -% - n = (n & 0x55555555) + ((n & 0xaaaaaaaa) >> 1); - n = (n & 0x33333333) + ((n & 0xcccccccc) >> 2); - n = (n & 0x0f0f0f0f) + ((n & 0xf0f0f0f0) >> 4); - n = (n & 0x00ff00ff) + ((n & 0xff00ff00) >> 8); - n = (n & 0x0000ffff) + ((n & 0xffff0000) >> 16); - - -- C code which counts the bits in a word -% -=== ALL CSH USERS PLEASE NOTE ======================== - -Set the variable $LOSERS to all the people that you think are losers. This -will cause all said losers to have the variable $PEOPLE-WHO-THINK-I-AM-A-LOSER -updated in their .login file. Should you attempt to execute a job on a -machine with poor response time and a machine on your local net is currently -populated by losers, that machine will be freed up for your job through a -cold boot process. -% -=== ALL USERS PLEASE NOTE ======================== - -A new system, the CIRCULATORY system, has been added. - -The long-experimental CIRCULATORY system has been released to users. The -Lisp Machine uses Type B fluid, the L machine uses Type A fluid. When the -switch to Common Lisp occurs both machines will, of course, be Type O. -Please check fluid level by using the DIP stick which is located in the -back of VMI monitors. Unchecked low fluid levels can cause poor paging -performance. -% -=== ALL USERS PLEASE NOTE ======================== - -Bug reports now amount to an average of 12,853 per day. Unfortunately, -this is only a small fraction [ < 1% ] of the mail volume we receive. In -order that we may more expeditiously deal with these valuable messages, -please communicate them by one of the following paths: - - ARPA: WastebasketSLMHQ.ARPA - UUCP: [berkeley, seismo, harpo]!fubar!thekid!slmhq!wastebasket - Non-network sites: Federal Express to: - Wastebasket - Room NE43-926 - Copernicus, The Moon, 12345-6789 - For that personal contact feeling call 1-415-642-4948; our trained - operators are on call 24 hours a day. VISA/MC accepted.* - -* Our very rich lawyers have assured us that we are not - responsible for any errors or advice given over the phone. -% -=== ALL USERS PLEASE NOTE ======================== - -CAR and CDR now return extra values. - -The function CAR now returns two values. Since it has to go to the trouble -to figure out if the object is carcdr-able anyway, we figured you might as -well get both halves at once. For example, the following code shows how to -destructure a cons (SOME-CONS) into its two slots (THE-CAR and THE-CDR): - - (MULTIPLE-VALUE-BIND (THE-CAR THE-CDR) (CAR SOME-CONS) ...) - -For symmetry with CAR, CDR returns a second value which is the CAR of the -object. In a related change, the functions MAKE-ARRAY and CONS have been -fixed so they don't allocate any storage except on the stack. This should -hopefully help people who don't like using the garbage collector because -it cold boots the machine so often. -% -=== ALL USERS PLEASE NOTE ======================== - -Compiler optimizations have been made to macro expand LET into a WITHOUT- -INTERRUPTS special form so that it can PUSH things into a stack in the -LET-OPTIMIZATION area, SETQ the variables and then POP them back when it's -done. Don't worry about this unless you use multiprocessing. -Note that LET *could* have been defined by: - - (LET ((LET '`(LET ((LET ',LET)) - ,LET))) - `(LET ((LET ',LET)) - ,LET)) - -This is believed to speed up execution by as much as a factor of 1.01 or -3.50 depending on whether you believe our friendly marketing representatives. -This code was written by a new programmer here (we snatched him away from -Itty Bitti Machines where we was writing COUGHBOL code) so to give him -confidence we trusted his vows of "it works pretty well" and installed it. -% -=== ALL USERS PLEASE NOTE ======================== - -JCL support as alternative to system menu. - -In our continuing effort to support languages other than LISP on the CADDR, -we have developed an OS/360-compatible JCL. This can be used as an -alternative to the standard system menu. Type System J to get to a JCL -interactive read-execute-diagnose loop window. [Note that for 360 -compatibility, all input lines are truncated to 80 characters.] This -window also maintains a mouse-sensitive display of critical job parameters -such as dataset allocation, core allocation, channels, etc. When a JCL -syntax error is detected or your job ABENDs, the window-oriented JCL -debugger is entered. The JCL debugger displays appropriate OS/360 error -messages (such as IEC703, "disk error") and allows you to dequeue your job. -% -=== ALL USERS PLEASE NOTE ======================== - -The garbage collector now works. In addition a new, experimental garbage -collection algorithm has been installed. With SI:%DSK-GC-QLX-BITS set to 17, -(NOT the default) the old garbage collection algorithm remains in force; when -virtual storage is filled, the machine cold boots itself. With SI:%DSK-GC- -QLX-BITS set to 23, the new garbage collector is enabled. Unlike most garbage -collectors, the new gc starts its mark phase from the mind of the user, rather -than from the obarray. This allows the garbage collection of significantly -more Qs. As the garbage collector runs, it may ask you something like "Do you -remember what SI:RDTBL-TRANS does?", and if you can't give a reasonable answer -in thirty seconds, the symbol becomes a candidate for GCing. The variable -SI:%GC-QLX-LUSER-TM governs how long the GC waits before timing out the user. -% -=== ALL USERS PLEASE NOTE ======================== - -There has been some confusion concerning MAPCAR. - (DEFUN MAPCAR (&FUNCTIONAL FCN &EVAL &REST LISTS) - (PROG (V P LP) - (SETQ P (LOCF V)) - L (SETQ LP LISTS) - (%START-FUNCTION-CALL FCN T (LENGTH LISTS) NIL) - L1 (OR LP (GO L2)) - (AND (NULL (CAR LP)) (RETURN V)) - (%PUSH (CAAR LP)) - (RPLACA LP (CDAR LP)) - (SETQ LP (CDR LP)) - (GO L1) - L2 (%FINISH-FUNCTION-CALL FCN T (LENGTH LISTS) NIL) - (SETQ LP (%POP)) - (RPLACD P (SETQ P (NCONS LP))) - (GO L))) -We hope this clears up the many questions we've had about it. -% -**** CONVENTION REMINDER - -No experiment was approved for the convention by the Human Subjects -Committee of the Psychiatric Convention Planning Team. If you notice -smoke coming from under a closed door, if you find a body on the hotel -carpet, or if you just meet someone who orders you to press a button -marked "450 volts", react as you would normally. -% -**** GROWTH CENTER REPAIR SERVICE - -For those who have had too much of Esalen, Topanga, and Kairos. -Tired of being genuine all the time? Would you like to learn how -to be a little phony again? Have you disclosed so much that you're -beginning to avoid people? Have you touched so many people that -they're all beginning to feel the same? Like to be a little dependent? -Are perfect orgasms beginning to bore you? Would you like, for once, -not to express a feeling? Or better yet, not be in touch with it at -all? Come to us. We promise to relieve you of the burden of your -great potential. -% - I. Any body suspended in space will remain in space until made aware of - its situation. - Daffy Duck steps off a cliff, expecting further pastureland. He - loiters in midair, soliloquizing flippantly, until he chances to - look down. At this point, the familiar principle of 32 feet per - second per second takes over. - II. Any body in motion will tend to remain in motion until solid matter - intervenes suddenly. - Whether shot from a cannon or in hot pursuit on foot, cartoon - characters are so absolute in their momentum that only a telephone - pole or an outsize boulder retards their forward motion absolutely. - Sir Isaac Newton called this sudden termination of motion the - stooge's surcease. -III. Any body passing through solid matter will leave a perforation - conforming to its perimeter. - Also called the silhouette of passage, this phenomenon is the - speciality of victims of directed-pressure explosions and of reckless - cowards who are so eager to escape that they exit directly through - the wall of a house, leaving a cookie-cutout-perfect hole. The - threat of skunks or matrimony often catalyzes this reaction. - -- Esquire, "O'Donnell's Laws of Cartoon Motion", June 1980 -% - 1. I'm Not Rudolph; That's Not My Nose - 2. The Nutcracker Swede - 3. Santa Goes Round-The-World - 4. Not-So-Tiny Tim - 5. Ninja Reindeer Killfest '88 - 6. Yes, Yes, Oh God Yes, Virginia - 7. Crisco Kringle - 8. Babes in Boyland - 9. Santa's Magic Lap -10. Hot Buttered Elves - -- David Letterman, "Top Ten Christmas Movies in Times - Square" -% -... A booming voice says, "Wrong, cretin!", and you notice that you -have turned into a pile of dust. -% -... A solemn, unsmiling, sanctimonious old iceberg who looked like he -was waiting for a vacancy in the Trinity. - -- Mark Twain -% -... a thing called Ethics, whose nature was confusing but if you had it you -were a High-Class Realtor and if you hadn't you were a shyster, a piker and -a fly-by-night. These virtues awakened Confidence and enabled you to handle -Bigger Propositions. But they didn't imply that you were to be impractical -and refuse to take twice the value for a house if a buyer was such an idiot -that he didn't force you down on the asking price. - -- Sinclair Lewis, "Babbitt" -% --- All articles that coruscate with resplendence are not truly auriferous. --- When there are visible vapors having the prevenience in ignited - carbonaceous materials, there is conflagration. --- Sorting on the part of mendicants must be interdicted. --- A plethora of individuals wither expertise in culinary techniques vitiated - the potable concoction produced by steeping certain coupestibles. --- Eleemosynary deeds have their initial incidence intramurally. -% -=============== ALL FRESHMEN PLEASE NOTE =============== - -To minimize scheduling confusion, please realize that if you are taking one -course which is offered at only one time on a given day, and another which is -offered at all times on that day, the second class will be arranged as to -afford maximum inconvenience to the student. For example, if you happen -to work on campus, you will have 1-2 hours between classes. If you commute, -there will be a minimum of 6 hours between the two classes. -% -... all the good computer designs are bootlegged; the formally planned -products, if they are built at all, are dogs! - -- David E. Lundstrom, "A Few Good Men From Univac", - MIT Press, 1987 -% -... an anecdote from IBM's Yorktown Heights Research Center. When a -programmer used his new computer terminal, all was fine when he was sitting -down, but he couldn't log in to the system when he was standing up. That -behavior was 100 percent repeatable: he could always log in when sitting and -never when standing. - -Most of us just sit back and marvel at such a story; how could that terminal -know whether the poor guy was sitting or standing? Good debuggers, though, -know that there has to be a reason. Electrical theories are the easiest to -hypothesize: was there a loose wire under the carpet, or problems with static -electricity? But electrical problems are rarely consistently reproducible. -An alert IBMer finally noticed that the problem was in the terminal's keyboard: -the tops of two keys were switched. When the programmer was seated he was a -touch typist and the problem went unnoticed, but when he stood he was led -astray by hunting and pecking. - -- from the Programming Pearls column, - by Jon Bentley in CACM February 1985 -% -... and furthermore ... I don't like your trousers. -% -... and the fully armed nuclear warheads are of course merely a -courtesy detail. - -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -... Another writer again agreed with all my generalities, but said that as an -inveterate skeptic I have closed my mind to the truth. Most notably I have -ignored the evidence for an Earth that is six thousand years old. Well, I -haven't ignored it; I considered the purported evidence and *then* rejected -it. There is a difference, and this is a difference, we might say, between -prejudice and postjudice. Prejudice is making a judgment before you have -looked at the facts. Postjudice is making a judgment afterwards. Prejudice -is terrible, in the sense that you commit injustices and you make serious -mistakes. Postjudice is not terrible. You can't be perfect of course; you -may make mistakes also. But it is permissible to make a judgment after you -have examined the evidence. In some circles it is even encouraged. - -- Carl Sagan, "The Burden of Skepticism" -% -... But as records of courts and justice are admissible, it can -easily be proved that powerful and malevolent magicians once existed -and were a scourge to mankind. The evidence (including confession) -upon which certain women were convicted of witchcraft and executed was -without a flaw; it is still unimpeachable. The judges' decisions based -on it were sound in logic and in law. Nothing in any existing court -was ever more thoroughly proved than the charges of witchcraft and -sorcery for which so many suffered death. If there were no witches, -human testimony and human reason are alike destitute of value. - -- Ambrose Bierce, "The Devil's Dictionary" -% -... But if we laugh with derision, we will never understand. Human -intellectual capacity has not altered for thousands of years so far as we -can tell. If intelligent people invested intense energy in issues that now -seem foolish to us, then the failure lies in our understanding of their -world, not in their distorted perceptions. Even the standard example of -ancient nonsense -- the debate about angels on pinheads -- makes sense once -you realize that theologians were not discussing whether five or eighteen -would fit, but whether a pin could house a finite or an infinite number. - -- S. J. Gould, "Wide Hats and Narrow Minds" -% -... But we've only fondled the surface of that subject. - -- Virginia Masters -% -... C++ offers even more flexible control over the visibility of member -objects and member functions. Specifically, members may be placed in the -public, private, or protected parts of a class. Members declared in the -public parts are visible to all clients; members declared in the private -parts are fully encapsulated; and members declared in the protected parts -are visible only to the class itself and its subclasses. C++ also supports -the notion of *friends*: cooperative classes that are permitted to see each -other's private parts. - -- Grady Booch, "Object Oriented Design with Applications" -% -... computer hardware progress is so fast. No other technology since -civilization began has seen six orders of magnitude in performance-price -gain in 30 years. - -- Frederick Brooks, Jr. -% -... [concerning quotation marks] even if we *_d_i_d* quote anybody in this -business, it probably would be gibberish. - -- Thom McLeod -% -... difference of opinion is advantageous in religion. The several sects -perform the office of a common censor morum over each other. Is uniformity -attainable? Millions of innocent men, women, and children, since the -introduction of Christianity, have been burnt, tortured, fined, imprisoned; -yet we have not advanced one inch towards uniformity. - -- Thomas Jefferson, "Notes on Virginia" -% -<<<<< EVACUATION ROUTE <<<<< -% -... "fire" does not matter, "earth" and "air" and "water" do not matter. -"I" do not matter. No word matters. But man forgets reality and remembers -words. The more words he remembers, the cleverer do his fellows esteem him. -He looks upon the great transformations of the world, but he does not see -them as they were seen when man looked upon reality for the first time. -Their names come to his lips and he smiles as he tastes them, thinking he -knows them in the naming. - -- Roger Zelazny, "Lord of Light" -% -/* Haley */ - - (Haley's comment.) -% -"... I should explain that I was wearing a black velvet cape that was -supposed to make me look like the dashing, romantic Zorro but which -actually made me look like a gigantic bat wearing glasses ..." - -- Dave Barry, "The Wet Zorro Suit and Other Turning - Points in l'Amour" -% -... If forced to travel on an airplane, try and get in the cabin with -the Captain, so you can keep an eye on him and nudge him if he falls -asleep or point out any mountains looming up ahead ... - -- Mike Harding, "The Armchair Anarchist's Almanac" -% -**** IMPORTANT **** ALL USERS PLEASE NOTE **** - -Due to a recent systems overload error your recent disk files have been -erased. Therefore, in accordance with the UNIX Basic Manual, University of -Washington Geophysics Manual, and Bylaw 9(c), Section XII of the Revised -Federal Communications Act, you are being granted Temporary Disk Space, -valid for three months from this date, subject to the restrictions set forth -in Appendix II of the Federal Communications Handbook (18th edition) as well -as the references mentioned herein. You may apply for more disk space at any -time. Disk usage in or above the eighth percentile will secure the removal -of all restrictions and you will immediately receive your permanent disk -space. Disk usage in the sixth or seventh percentile will not effect the -validity of your temporary disk space, though its expiration date may be -extended for a period of up to three months. A score in the fifth percentile -or below will result in the withdrawal of your Temporary Disk space. -% -... in three to eight years we will have a machine with the general -intelligence of an average human being ... The machine will begin -to educate itself with fantastic speed. In a few months it will be -at genius level and a few months after that its powers will be -incalculable ... - -- Marvin Minsky, LIFE Magazine, November 20, 1970 -% -... indifference is a militant thing ... when it goes away it leaves -smoking ruins, where lie citizens bayonetted through the throat. It is -not a children's pastime like mere highway robbery. - -- Stephen Crane -% ->>> Internal error in fortune program: ->>> fnum=2987 n=45 flag=1 goose_level=-232323 ->>> Please write down these values and notify fortune program administrator. -% -: is not an identifier -% -... it is easy to be blinded to the essential uselessness of them by the -sense of achievement you get from getting them to work at all. In other -words... their fundamental design flaws are completely hidden by their -superficial design flaws. - -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" - on the products of the Sirius Cybernetics Corporation -% -... it still remains true that as a set of cognitive beliefs about the -existence of God in any recognizable sense continuous with the great -systems of the past, religious doctrines constitute a speculative -hypothesis of an extremely low order of probability. - -- Sidney Hook -% -... Jesus cried with a loud voice: Lazarus, come forth; the bug hath been -found and thy program runneth. And he that was dead came forth... - -- John 11:43-44 -% -... like, what do they mean when they say 'feminine protection'? -What's that? A chartreuse flamethrower? - -- Opus -% -... Logically incoherent, semantically incomprehensible, and -legally ... impeccable! -% --- Male cadavers are incapable of yielding testimony. --- Individuals who make their abode in vitreous edifices would be well advised - to refrain from catapulting projectiles. --- Neophyte's serendipity. --- Exclusive dedication to necessitous chores without interludes of hedonistic - diversion renders John a hebetudinous fellow. --- A revolving concretion of earthy or mineral matter accumulates no congeries - of small, green bryophytic plant. --- Abstention from any aleatory undertaking precludes a potential escalation - of a lucrative nature. --- Missiles of ligneous or osteal consistency have the potential of fracturing - osseous structure, but appellations will eternally remain innocuous. -% -** MAXIMUM TERMINALS ACTIVE. TRY AGAIN LATER ** -% -*** NEWS FLASH *** - -Archaeologists find PDP-11/24 inside brain cavity of fossilized dinosaur -skeleton! Many Digital users fear that RSX-11M may be even more primitive -than DEC admits. Price adjustments at 11:00. -% -*** NEWSFLASH *** - Russian tanks steamrolling through New Jersey!!!! - Details at eleven! -% -... Now you're ready for the actual shopping. Your goal should be to -get it over with as quickly as possible, because the longer you stay in -the mall, the longer your children will have to listen to holiday songs -on the mall public-address system, and many of these songs can damage -children emotionally. For example: "Frosty the Snowman" is about a -snowman who befriends some children, plays with them until they learn -to love him, then melts. And "Rudolph the Red-Nosed Reindeer" is about -a young reindeer who, because of a physical deformity, is treated as an -outcast by the other reindeer. Then along comes good, old Santa. Does -he ignore the deformity? Does he look past Rudolph's nose and respect -Rudolph for the sensitive reindeer he is underneath? No. Santa asks -Rudolph to guide his sleigh, as if Rudolph were nothing more than some -kind of headlight with legs and a tail. So unless you want your -children exposed to this kind of insensitivity, you should shop -quickly. - -- Dave Barry, "Christmas Shopping: A Survivor's Guide" -% -... Once you're safely in the mall, you should tie your children to you -with ropes so the other shoppers won't try to buy them. Holiday -shoppers have been whipped into a frenzy by months of holiday -advertisements, and they will buy anything small enough to stuff into a -shopping bag. If your children object to being tied, threaten to take -them to see Santa Claus; that ought to shut them up. - -- Dave Barry, "Christmas Shopping: A Survivor's Guide" -% -... one of the main causes of the fall of the Roman Empire was that, -lacking zero, they had no way to indicate successful termination of -their C programs. - -- Robert Firth -% -... Our second completely true news item was sent to me by Mr. H. Boyce -Connell, Jr. of Atlanta, Ga., where he is involved in a law firm. One -thing I like about the South is, folks there care about tradition. If -somebody gets handed a name like "H. Boyce," he hangs on to it, puts it -on his legal stationery, even passes it to his son, rather than do what -a lesser person would do, such as get it changed or kill himself. - -- Dave Barry, "This Column is Nothing but the Truth!" -% -... proper attention to Earthly needs of the poor, the depressed and the -downtrodden, would naturally evolve from dynamic, articulate, spirited -awareness of the great goals for Man and the society he conspired to erect. - -- David Baker, paraphrasing Harold Urey, in - "The History of Manned Space Flight" -% --- Scintillate, scintillate, asteroid minikin. --- Members of an avian species of identical plumage congregate. --- Surveillance should precede saltation. --- Pulchritude possesses solely cutaneous profundity. --- It is fruitless to become lachrymose over precipitately departed - lacteal fluid. --- Freedom from incrustations of grime is contiguous to rectitude. --- It is fruitless to attempt to indoctrinate a superannuated - canine with innovative maneuvers. --- Eschew the implement of correction and vitiate the scion. --- The temperature of the aqueous content of an unremittingly - galled saucepan does not reach 212 degrees Fahrenheit. -% -... so long as the people do not care to exercise their freedom, those -who wish to tyrannize will do so; for tyrants are active and ardent, -and will devote themselves in the name of any number of gods, religious -and otherwise, to put shackles upon sleeping men. - -- Voltarine de Cleyre -% -... So the documentary-makers stick with sharks. Generally, their -procedure is to scatter bleeding fish pieces around their boat, so as -to infest the waters. I would estimate that the primary food source of -sharks today is bleeding fish pieces scattered by people making -documentaries. Once the sharks arrive, they are generally fairly -listless. The general shark attitude seems to be: "Oh God, another -documentary." So the divers have to somehow goad them into attacking, -under the guise of Scientific Research. "We know very little about the -effect of electricity on sharks," the narrator will say, in a deeply -scientific voice. "That is why Todd is going to jab this Great White -in the testicles with a cattle prod." The divers keep this kind of -thing up until the shark finally gets irritated and snaps at them, and -then they act as though this was a totally unexpected and very -dangerous development, although clearly it is what they wanted all along. - -- Dave Barry, "The Wonders of Sharks on TV" -% -***** Special AI Seminar (abstract) - -It has been widely recognized that AI programs require expert knowledge -in order to perform well in complex domains. But knowledge alone is not -sufficient for some applications; wisdom is needed as well. Accordingly, -we have developed a new approach to artificial intelligence which we call -"wisdom engineering". As a test of our ideas, we have written IMMANUEL, a -wisdom based system for the task domain of western philosophical thought. -IMMANUEL was supplied initially with 200 wisdom units which contained wisdom -about such elementary concepts as mind, matter, being, nothingness, and so -forth. IMMANUEL was then allowed to run freely, guided by the heuristic -rules contained in its heterarchically organized meta wisdom base. IMMANUEL -succeeded in rediscovering most of the important philosophical ideas developed -in western culture over the course of the last 25 centuries, including those -underlying Plato's theory of government, Kant's metaphysics, Nietzsche's theory -of value, and Husserl's phenomenology. In this seminar, we will describe -IMMANUEL's achievements and internal architecture. We will also briefly -discuss our recent efforts to apply wisdom engineering to oil exploration. -% --- THE BATES MOTEL -- - ... convenient - ... clean - ... cozy - - Norman, knock loudly, - I'm in the shower. - - M. -% -... the Mayo Clinic, named after its founder, Dr. Ted Clinic ... - -- Dave Barry -% -... the privileged being which we call human is distinguished from -other animals only by certain double-edged manifestations which in -charity we can only call "inhuman." - -- R. A. Lafferty -% --- The writing implement is more potent than the claymore. --- The person presenting the ultimate cachinnation possesses thereby the - optimal cachinnation. -% -... there are about 5,000 people who are part of that committee. These guys -have a hard time sorting out what day to meet, and whether to eat croissants -or doughnuts for breakfast -- let alone how to define how all these complex -layers that are going to be agreed upon. - -- Craig Burton of Novell, Network World -% -... TheysaidDoyouseethebiggreenglowinthedarkhouseuponthehill?andIsaidYesIsee -thebiggreenglowinthedarkhouseuponthehillTheresabigdarkforestbetweenmeandthe -biggreenglowinthedarkhouseuponthehillandalittleoldladyridingonaHoovervacuum -cleanersayingIllgetyoumyprettyandyourlittledogTototoo ... - - I don't even *HAVE* a dog Toto... -% -... this is an awesome sight. The entire rebel resistance buried under six -million hardbound copies of "The Naked Lunch." - -- The Firesign Theatre -% -... though his invention worked superbly -- his theory was a crock of sewage -from beginning to end. - -- Vernor Vinge, "The Peace War" -% - U X -e dUdX, e dX, cosine, secant, tangent, sine, 3.14159... -% -* UNIX is a Trademark of Bell Laboratories. -% - VII. Certain bodies can pass through solid walls painted to resemble tunnel - entrances; others cannot. - This trompe l'oeil inconsistency has baffled generations, but at least - it is known that whoever paints an entrance on a wall's surface to - trick an opponent will be unable to pursue him into this theoretical - space. The painter is flattened against the wall when he attempts to - follow into the painting. This is ultimately a problem of art, not - of science. -VIII. Any violent rearrangement of feline matter is impermanent. - Cartoon cats possess even more deaths than the traditional nine lives - might comfortably afford. They can be decimated, spliced, splayed, - accordion-pleated, spindled, or disassembled, but they cannot be - destroyed. After a few moments of blinking self pity, they reinflate, - elongate, snap back, or solidify. - IX. For every vengeance there is an equal and opposite revengeance. - This is the one law of animated cartoon motion that also applies to - the physical world at large. For that reason, we need the relief of - watching it happen to a duck instead. - X. Everything falls faster than an anvil. - Examples too numerous to mention from the Roadrunner cartoons. - -- Esquire, "O'Donnell's Laws of Cartoon Motion", June 1980 -% -<< WAIT >> -% -... we must counterpose the overwhelming judgment provided by consistent -observations and inferences by the thousands. The earth is billions of -years old and its living creatures are linked by ties of evolutionary -descent. Scientists stand accused of promoting dogma by so stating, but -do we brand people illiberal when they proclaim that the earth is neither -flat nor at the center of the universe? Science *has* taught us some -things with confidence! Evolution on an ancient earth is as well -established as our planet's shape and position. Our continuing struggle -to understand how evolution happens (the "theory of evolution") does not -cast our documentation of its occurrence -- the "fact of evolution" -- -into doubt. - -- Stephen Jay Gould, "The Verdict on Creationism", - The Skeptical Inquirer, Vol. XII No. 2. -% -... when fits of creativity run strong, more than one programmer or writer -has been known to abandon the desktop for the more spacious floor. - -- Frederick Brooks, Jr. -% -... which reminds me of the Carrot family: Ma Carrot, Pa Carrot, and Baby -Carrot. One fine spring day they decided to go out for a picnic. They all -piled into their carrot-mobile and drive out to the country. But Pa Carrot -wasn't watching where he was going and alas, he hit an oil slick and skidded -right into a tree. Ma and Pa Carrot escaped with a few cuts and bruises, but -poor Baby Carrot got broken in two. They frantically rushed him to the -hospital and immediately the doctors started operating in a desperate attempt -to save Baby Carrot's life. Ma and Pa Carrot were beside themselves with -anxiety ... would poor little Baby Carrot make it? - After hours of waiting the doctor finally emerges, bleary-eyed and -barely able to walk. - "Is he all right, is he all right?" Pa Carrot frantically stammers. - "Well, I have some good news and some bad news," replies the doctor. - Ma and Pa Carrot look at each other and blurt out, nearly in unison, -"The good news first!" - "All right, the good news is that Baby Carrot will live." - "And the bad news? What's the bad news about our Baby Carrot?" -The doctor puts his hand on Pa Carrot's shoulder and solemnly looks him in -the eye. "Your son will live... but... he'll be a vegetable for the rest of -his life." -% -!07/11 PDP a ni deppart m'I !pleH -% -1: A sheet of paper is an ink-lined plane. -2: An inclined plane is a slope up. -3: A slow pup is a lazy dog. - -QED: A sheet of paper is a lazy dog. - -- Willard Espy, "An Almanac of Words at Play" -% -(1) Office employees will daily sweep the floors, dust the - furniture, shelves, and showcases. -(2) Each day fill lamps, clean chimneys, and trim wicks. - Wash the windows once a week. -(3) Each clerk will bring a bucket of water and a scuttle of - coal for the day's business. -(4) Make your pens carefully. You may whittle nibs to your - individual taste. -(5) This office will open at 7 a.m. and close at 8 p.m. except - on the Sabbath, on which day we will remain closed. Each - employee is expected to spend the Sabbath by attending - church and contributing liberally to the cause of the Lord. - -- "Office Worker's Guide", New England Carriage - Works, 1872 -% -1 + 1 = 3, for large values of 1. -% -1. If it doesn't smell like chili, it probably isn't. -2. If you catch an exploding manhole cover, you can keep it. -3. Cabs driving on the sidewalk are not permitted to pick up passengers. -4. It's bad manners to lie down inside someone else's chalk body outline. -5. Don't lick food from a stranger's beard. -6. Avoid paperwork for your next of kin by keeping dental records on you. -7. Jon Gotti Always has the right of way. -8. Yelling at cab drivers in English wastes your time and theirs. -9. Remember: Regular hot dogs do not have fingernails. -10. The city does not employ so called "Wallet Inspectors". - -- David Letterman, "Top Ten New York City Pedestrian Tips" -% -(1) Alexander the Great was a great general. -(2) Great generals are forewarned. -(3) Forewarned is forearmed. -(4) Four is an even number. -(5) Four is certainly an odd number of arms for a man to have. -(6) The only number that is both even and odd is infinity. - Therefore, Alexander the Great had an infinite number of arms. -% -(1) Alexander the Great was a great general. -(2) Great generals are forewarned. -(3) Forewarned is forearmed. -(4) Four is an even number. -(5) Four is certainly an odd number of arms for a man to have. -(6) The only number that is both even and odd is infinity. - Therefore, all horses are black. -% -1. Avoid fried meats which angry up the blood. -2. If your stomach antagonizes you, pacify it with cool thoughts. -3. Keep the juices flowing by jangling around gently as you move. -4. Go very lightly on the vices, such as carrying on in society, as - the social ramble ain't restful. -5. Avoid running at all times. -6. Don't look back, something might be gaining on you. - -- S. Paige, c. 1951 -% -1 Billion dollars of budget deficit = 1 Gramm-Rudman -6.023 x 10 to the 23rd power alligator pears = Avocado's number -2 pints = 1 Cavort -Basic unit of Laryngitis = The Hoarsepower -Shortest distance between two jokes = A straight line -6 Curses = 1 Hexahex -3500 Calories = 1 Food Pound -1 Mole = 007 Secret Agents -1 Mole = 25 Cagey Bees -1 Dog Pound = 16 oz. of Alpo -1000 beers served at a Twins game = 1 Killibrew -2.4 statute miles of surgical tubing at Yale U. = 1 I.V.League -2000 pounds of Chinese soup = 1 Won Ton -10 to the minus 6th power mouthwashes = 1 Microscope -Speed of a tortoise breaking the sound barrier = 1 Machturtle -8 Catfish = 1 Octo-puss -365 Days of drinking Lo-Cal beer. = 1 Lite-year -16.5 feet in the Twilight Zone = 1 Rod Serling -Force needed to accelerate 2.2lbs of cookies = 1 Fig-newton - to 1 meter per second -One half large intestine = 1 Semicolon -10 to the minus 6th power Movie = 1 Microfilm -1000 pains = 1 Megahertz -1 Word = 1 Millipicture -1 Sagan = Billions & Billions -1 Angstrom: measure of computer anxiety = 1000 nail-bytes -10 to the 12th power microphones = 1 Megaphone -10 to the 6th power Bicycles = 2 megacycles -The amount of beauty required launch 1 ship = 1 Millihelen -% -1 bulls, 3 cows. -% -1. Never give anything away for nothing. 2. Never give more than -you have to (always catch the buyer hungry and always make him wait). -3. Always take back everything if you possibly can. - -- William S. Burroughs, on drug pushing -% -1: No code table for op: ++post -% -1) X=Y ; Given -2) X^2=XY ; Multiply both sides by X -3) X^2-Y^2=XY-Y^2 ; Subtract Y^2 from both sides -4) (X+Y)(X-Y)=Y(X-Y) ; Factor -5) X+Y=Y ; Cancel out (X-Y) term -6) 2Y=Y ; Substitute X for Y, by equation 1 -7) 2=1 ; Divide both sides by Y - -- "Omni", proof that 2 equals 1 -% -10. Not everybody looks good naked. - 9. Joe Garagiola was a hell of an emcee. - 8. Joe Cocker really should stick with decaffeinated coffee. - 7. Fringe! Fringe! Fringe! - 6. If you've got 72 hours to kill, you can probably find room for Sha Na Na. - 5. Never attend an event with a 50,000 to 1 person to Port-A-San ratio. - 4. Bellbottoms will never go out of style. - 3. A drum solo cannot be too long. - 2. I, David Letterman, will never rent out my farm again. - 1. We are stardust. We are golden. We are going to look really stupid to - future generations. - -- David Letterman, "Top Ten Lessons of Woodstock" -% -10 Reasons Why a Beer is Better Than a Woman: - - 1. A beer won't make you go to church. - 2. A beer is more likely to know how to spell "carburetor" than a woman. - 3. A beer doesn't think baseball is stupid simply because the guys spit. - 4. A beer doesn't give a [expletive deleted] if you keep a bunch of - other beers on the side. - 5. A beer will not call you a sexist pig if you say "Doberman" instead of - "Doberperson." - 6. A beer won't get a job as a DJ and play 5 straight hours of lesbian - folk music on yer fave radio station. - 7. A beer understands why The Three Stooges are funny. - 8. A beer won't raise a fuss about a little thing like leaving the - toilet seat up. - 9. A beer doesn't think that a "three-hundred-fifty cubic-inch V8" is an - enormous can of vegetable juice. -10. A beer won't smoke in your car. -% -100 buckets of bits on the bus -100 buckets of bits -Take one down, short it to ground -FF buckets of bits on the bus - -FF buckets of bits on the bus -FF buckets of bits -Take one down, short it to ground -FE buckets of bits on the bus - -ad infinitum... -% -$100 invested at 7% interest for 100 years will become $100,000, at -which time it will be worth absolutely nothing. - -- Lazarus Long, "Time Enough for Love" -% -10.0 times 0.1 is hardly ever 1.0. -% -101 USES FOR A DEAD MICROPROCESSOR - (1) Scarecrow for centipedes - (2) Dead cat brush - (3) Hair barrettes - (4) Cleats - (5) Self-piercing earrings - (6) Fungus trellis - (7) False eyelashes - (8) Prosthetic dog claws - . - . - . - (99) Window garden harrow (pulled behind Tonka tractors) - (100) Killer velcro - (101) Currency -% -1/2 oz. gin -1/2 oz. vodka -1/2 oz. rum (preferably dark) -3/4 oz. tequila -1/2 oz. triple sec -1/2 oz. orange juice -3/4 oz. sour mix -1/2 oz. cola -shake with ice and strain into frosted glass. - Long Island Iced Tea -% -13. ... r-q1 -% -17. HO HUM -- The Redundant - -------- (7) This hexagram refers to a situation of extreme ---- --- (8) boredom. Your programs always bomb off. Your wife -------- (7) smells bad. Your children have hives. You are working ----O--- (6) on an accounting system, when you want to develop ----X--- (9) the GREAT AMERICAN COMPILER. You give up hot dates ---- --- (8) to nurse sick computers. What you need now is sex. - -Nine in the second place means: - The yellow bird approaches the malt shop. Misfortune. - -Six in the third place means: - In former times men built altars to honor the Internal - Revenue Service. Great Dragons! Are you in trouble! -% -1.79 x 10^12 furlongs per fortnight -- it's not just a good idea, it's -the law! -% -17th Rule of Friendship: - -A friend will refrain from telling you he picked up the same amount -of life insurance coverage you did for half the price when yours is -noncancellable. - -- Esquire, May 1977 -% -186,000 miles per second: -It isn't just a good idea, it's the law! -% -1893 The ideal brain tonic -1900 Drink Coca-Cola -- delicious and refreshing -- 5 cents at all - soda fountains -1905 Is the favorite drink for LADIES when thirsty -- weary -- despondent -1905 Refreshes the weary, brightens the intellect and clears the brain -1906 The drink of QUALITY -1907 Good to the last drop -1907 It satisfies the thirst and pleases the palate -1907 Refreshing as a summer breeze. Delightful as a Dip in the Sea -1908 The Drink that Cheers but does not inebriate -1917 There's a delicious freshness to the taste of Coca-Cola -1919 It satisfies thirst -1919 The taste is the test -1922 Every glass holds the answer to thirst -1922 Thirst knows no season -1925 Enjoy the sociable drink - -- Coca-Cola slogans -% -1925 With a drink so good, 'tis folly to be thirsty -1929 The high sign of refreshment -1929 The pause that refreshes -1930 It had to be good to get where it is -1932 The drink that makes a pause refreshing -1935 The pause that brings friends together -1937 STOP for a pause... GO refreshed -1938 The best friend thirst ever had -1939 Thirst stops here -1942 It's the real thing -1947 Have a Coke -1961 Zing! what a REFRESHING NEW FEELING -1963 Things go better with Coke -1969 Face Uncle Sam with a Coke in your hand -1979 Have a Coke and a smile -1982 Coke is it! - -- Coca-Cola slogans -% -1st graffitiest: QUESTION AUTHORITY! - -2nd graffitiest: Why? -% -2180, U.S. History question: - What 20th Century U.S. President was almost impeached and what -office did he later hold? -% -3 syncs represent the trinity -- init, the child and the eternal zombie -process. In doing 3, you're paying homage to each and I think such -traditions are important in this shallow, mercurial business we find -ourselves in. - -- Jordan K. Hubbard -% -$3,000,000 -% -355/113 -- - Not the famous irrational number PI, but an incredible simulation. -% -3M, under the Scotch brand name, manufactures a fine adhesive for art -and display work. This product is called "Craft Mount". 3M suggests -that to obtain the best results, one should make the bond "while the -adhesive is wet, aggressively tacky." I did not know what "aggressively -tacky" meant until I read today's fortune. - - [And who said we didn't offer equal time, huh? Ed.] -% -3rd Law of Computing: - Anything that can go wr -fortune: Segmentation violation -- Core dumped -% -40 isn't old. If you're a tree. -% -4.2 BSD UNIX #57: Sun Jun 1 23:02:07 EDT 1986 - -You swing at the Sun. You miss. The Sun swings. He hits you with a -575MB disk! You read the 575MB disk. It is written in an alien -tongue and cannot be read by your tired Sun-2 eyes. You throw the -575MB disk at the Sun. You hit! The Sun must repair your eyes. The -Sun reads a scroll. He hits your 130MB disk! He has defeated the -130MB disk! The Sun reads a scroll. He hits your Ethernet board! He -has defeated your Ethernet board! You read a scroll of "postpone until -Monday at 9 AM". Everything goes dark... - -- /etc/motd, cbosgd -% -(6) Men employees will be given time off each week for courting - purposes, or two evenings a week if they go regularly to church. -(7) After an employee has spent his thirteen hours of labor in the - office, he should spend the remaining time reading the Bible - and other good books. -(8) Every employee should lay aside from each pay packet a goodly - sum of his earnings for his benefit during his declining years, - so that he will not become a burden on society or his betters. -(9) Any employee who smokes Spanish cigars, uses alcoholic drink - in any form, frequents pool tables and public halls, or gets - shaved in a barber's shop, will give me good reason to suspect - his worth, intentions, integrity and honesty. -(10) The employee who has performed his labours faithfully and - without a fault for five years, will be given an increase of - five cents per day in his pay, providing profits from the - business permit it. - -- "Office Worker's Guide", New England Carriage - Works, 1872 -% -6 oz. orange juice -1 oz. vodka -1/2 oz. Galliano - Harvey Wallbangers -% -7:30, Channel 5: The Bionic Dog (Action/Adventure) - The Bionic Dog drinks too much and kicks over the National - Redwood Forest. -% -7:30, Channel 5: The Bionic Dog (Action/Adventure) - The Bionic Dog gets a hormonal short-circuit and violates the - Mann Act with an interstate Greyhound bus. -% -90% of the work takes 90% of the time. -The remaining 10% takes the other 90% of the time. -% -94% of the women in America are beautiful -and the rest hang out around here. -% -99 blocks of crud on the disk, -99 blocks of crud! -You patch a bug, and dump it again: -100 blocks of crud on the disk! - -100 blocks of crud on the disk, -100 blocks of crud! -You patch a bug, and dump it again: -101 blocks of crud on the disk! -% -A baby is an alimentary canal with a loud voice -at one end and no responsibility at the other. -% -A baby is God's opinion that the world should go on. - -- Carl Sandburg -% -A bachelor is a man who never made the same mistake once. -% -A bachelor is a selfish, undeserving guy -who has cheated some woman out of a divorce. - -- Don Quinn -% -A bachelor is an unaltared male. -% -A bachelor never quite gets over the idea that he is a thing of beauty -and a boy for ever. - -- Helen Rowland -% -A bad marriage is like a horse with a broken leg, you can shoot -the horse, but it don't fix the leg. -% -A bank is a place where they lend you an umbrella in fair weather and -ask for it back the when it begins to rain. - -- Robert Frost -% -A banker is a fellow who lends you his umbrella when the -sun is shining and wants it back the minute it begins to rain. - -- Mark Twain -% -A beautiful woman is a blessing from Heaven, but a good cigar is a smoke. - -- Kipling -% -A beautiful woman is a picture which drives all beholders nobly mad. - -- Ralph Waldo Emerson -% -A beer delayed is a beer denied. -% -A beginning is the time for taking the -most delicate care that balances are correct. - -- Princess Irulan, "Manual of Maud'Dib" -% -A billion here, a billion there -- pretty soon it adds up to real money. - -- Sen. Everett Dirksen, on the U.S. defense budget -% -A billion seconds ago Harry Truman was president. -A billion minutes ago was just after the time of Christ. -A billion hours ago man had not yet walked on earth. -A billion dollars ago was late yesterday afternoon at the U.S. Treasury. -% -A biologist, a statistician, a mathematician and a computer scientist are on -a photo-safari in Africa. As they're driving along the savannah in their -jeep, they stop and scout the horizon with their binoculars. - -The biologist: "Look! A herd of zebras! And there's a white zebra! - Fantastic! We'll be famous!" -The statistician: "Hey, calm down, it's not significant. We only know - there's one white zebra." -The mathematician: "Actually, we only know there exists a zebra, which is - white on one side." -The computer scientist : "Oh, no! A special case!" -% -A bird in the bush usually has a friend in there with him. -% -A bird in the hand is worth two in the bush. - -- Cervantes -% -A bird in the hand is worth what it will bring. -% -A bird in the hand makes it awfully hard to blow your nose. -% -A bit of talcum -Is always walcum - -- Ogden Nash -% -A black cat crossing your path signifies -that the animal is going somewhere. - -- Groucho Marx -% -A book is the work of a mind, doing its work in the way that a mind deems -best. That's dangerous. Is the work of some mere individual mind likely to -serve the aims of collectively accepted compromises, which are known in the -schools as 'standards'? Any mind that would audaciously put itself forth to -work all alone is surely a bad example for the students, and probably, if -not downright antisocial, at least a little off-center, self-indulgent, -elitist. ... It's just good pedagogy, therefore, to stay away from such -stuff, and use instead, if film-strips and rap-sessions must be -supplemented, 'texts,' selected, or prepared, or adapted, by real -professionals. Those texts are called 'reading material.' They are the -academic equivalent of the 'listening material' that fills waiting-rooms, -and the 'eating material' that you can buy in thousands of convenient eating -resource centers along the roads. - -- The Underground Grammarian -% -A bore is a man who talks so much about -himself that you can't talk about yourself. -% -A bore is someone who persists in holding his -own views after we have enlightened him with ours. -% -A boss with no humor is like a job that's no fun. -% -A box without hinges, key, or lid, -Yet golden treasure inside is hid. - -- J. R. R. Tolkien -% -A boy can learn a lot from a dog: obedience, loyalty, and the importance -of turning around three times before lying down. - -- Robert Benchley -% -A boy gets to be a man when a man is needed. - -- John Steinbeck -% -A budget is just a method of worrying -before you spend money, as well as afterward. -% -A bug in the code is worth two in the documentation. -% -A bug in the hand is better than one as yet undetected. -% -A bunch of Polish scientists decided to flee their repressive government by -hijacking an airliner and forcing the pilot to fly them to the West. They -drove to the airport, forced their way on board a large passenger jet, and -found there was no pilot on board. Terrified, they listened as the sirens -got louder. Finally, one of the scientists suggested that since he was an -experimentalist, he would try to fly the aircraft. - He sat down at the controls and tried to figure them out. The sirens -got louder and louder. Armed men surrounded the jet. The would be pilot's -friends cried out, "Please, please take off now!!! Hurry!!!" - The experimentalist calmly replied, "Have patience. I'm just a simple -pole in a complex plane." -% -A bunch of the boys were whooping it in the Malemute saloon; -The kid that handles the music box was hitting a jag-time tune; -Back of the bar, in a solo game, sat Dangerous Dan McGrew, -And watching his luck was his light-o'-love, the lady that's known as Lou. - -- Robert W. Service -% -A bureaucrat's idea of cleaning up his files -is to make a copy of everything before he destroys it. -% -A businessman is a hybrid of a dancer and a calculator. - -- Paul Valery -% -A candidate is a person who gets money from the rich -and votes from the poor to protect them from each other. -% -A cannibal warrior is experiencing severe gastric distress, so he goes -to his Village Witch Doctor with his complaint. The VWD examines him -and, concluding that something he ate disagreed with him, began to cross -examine him about his recent diet. - "Well, I ate a missionary yesterday. Do you think that could be -the problem?" - The VWD says "Hmmmm." (All doctors say "Hmmmm.") "That could be. -Tell me a bit about this missionary." - "Well, he was tall for a white man, wearing a brown robe. He was -walking down the trail, not watching for danger, so I speared him, dragged -him home, cleaned him, boiled him and ate him." - "Ah-hah!" (All doctors say "Ah-hah!") There's your problem," smiles -the VWD. You boiled him, but he was a friar!" -% -A career is great, but you can't run your fingers through its hair. -% -A castaway was washed ashore after many days on the open sea. The island -on which he landed was populated by savage cannibals who tied him, dazed -and exhausted, to a thick stake. They then proceeded to cut his arms -with their spears and drink his blood. This continued for several days -until the castaway could stand no more. He yelled for the cannibal chief -and declared, "You can kill me if you want to, but this torture with the -spears has got to stop. Dammit, I'm tired of getting stuck for the drinks." -% -A casual stroll through a lunatic asylum shows that faith -does not prove anything. - -- Friedrich Nietzsche -% -A celebrity is a person who is known for his well-knownness. -% -A certain amount of opposition is a help, not a hindrance. -Kites rise against the wind, not with it. -% -A certain monk had a habit of pestering the Grand Tortue (the only one who -had ever reached the Enlightenment 'Yond Enlightenment), by asking whether -various objects had Buddha-nature or not. To such a question Tortue -invariably sat silent. The monk had already asked about a bean, a lake, -and a moonlit night. One day he brought to Tortue a piece of string, and -asked the same question. In reply, the Grand Tortue grasped the loop -between his feet and, with a few simple manipulations, created a complex -string which he proffered wordlessly to the monk. At that moment, the monk -was enlightened. - -From then on, the monk did not bother Tortue. Instead, he made string after -string by Tortue's method; and he passed the method on to his own disciples, -who passed it on to theirs. -% -A certain old cat had made his home in the alley behind Gabe's bar for some -time, subsisting on scraps and occasional handouts from the bartender. One -evening, emboldened by hunger, the feline attempted to follow Gabe through -the back door. Regrettably, only the his body had made it through when -the door slammed shut, severing the cat's tail at its base. This proved too -much for the old creature, who looked sadly at Gabe and expired on the spot. - Gabe put the carcass back out in the alley and went back to business. -The mandatory closing time arrived and Gabe was in the process of locking up -after the last customers had gone. Approaching the back door he was startled -to see an apparition of the old cat mournfully holding its severed tail out, -silently pleading for Gabe to put the tail back on its corpse so that it could -go on to the kitty afterworld complete. - Gabe shook his head sadly and said to the ghost, "I can't. You know -the law -- no retailing spirits after 2:00 AM." -% -A Chicago salesman was about to check into a St. Louis hotel when he noticed -a very charming woman staring admiringly at him. He walked over and spoke -with her for a few minutes, then returned to the front desk, where they checked -in as Mr. and Mrs. - After a very pleasurable three-day stay, the man approached the front -desk and told the clerk he was checking out. In a few minutes, he was handed -a bill for $2500. - "There must be some mistake," the salesman said. "I've been here for -only three days." - "Yes, sir," the clerk replied. "But your wife has been here a month -and a half." -% -A chicken is an egg's way of producing more eggs. -% -A child can go only so far in life without potty training. It is not mere -coincidence that six of the last seven presidents were potty trained, not -to mention nearly half of the nation's state legislators. - -- Dave Barry -% -A child of five could understand this! Fetch me a child of five. -% -A chronic disposition to inquiry -deprives domestic felines of vital qualities. -% -A chubby man with a white beard and a red suit -will approach you soon. Avoid him. He's a Commie. -% -A citizen of America will cross the ocean to fight for democracy, but -won't cross the street to vote in a national election. - -- Bill Vaughan -% -A city is a large community where people are lonesome together. - -- Herbert Prochnow -% -A clash of doctrine is not a disaster - it is an opportunity. -% -A classic is something that everybody wants to have read -and nobody wants to read. - -- Mark Twain quoting Professor Winchester, - "The Disappearance of Literature" -% -A clever prophet makes sure of the event first. -% -A cloud does not know why it moves in just such a direction and at such -a speed, if feels an impulsion... this is the place to go now. But the -sky knows the reasons and the patterns behind all clouds, and you will -know, too, when you lift yourself high enough to see beyond horizons. - -- Messiah's Handbook: Reminders for the Advanced Soul -% -A CODE OF ETHICAL BEHAVIOR FOR PATIENTS: - -1. DO NOT EXPECT YOUR DOCTOR TO SHARE YOUR DISCOMFORT. - Involvement with the patient's suffering might cause him to lose - valuable scientific objectivity. - -2. BE CHEERFUL AT ALL TIMES. - Your doctor leads a busy and trying life and requires all the - gentleness and reassurance he can get. - -3. TRY TO SUFFER FROM THE DISEASE FOR WHICH YOU ARE BEING TREATED. - Remember that your doctor has a professional reputation to uphold. -% -A CODE OF ETHICAL BEHAVIOR FOR PATIENTS: - -4. DO NOT COMPLAIN IF THE TREATMENT FAILS TO BRING RELIEF. - You must believe that your doctor has achieved a deep insight into - the true nature of your illness, which transcends any mere permanent - disability you may have experienced. - -5. NEVER ASK YOUR DOCTOR TO EXPLAIN WHAT HE IS DOING OR WHY HE IS DOING IT. - It is presumptuous to assume that such profound matters could be - explained in terms that you would understand. - -6. SUBMIT TO NOVEL EXPERIMENTAL TREATMENT READILY. - Though the surgery may not benefit you directly, the resulting - research paper will surely be of widespread interest. -% -A CODE OF ETHICAL BEHAVIOR FOR PATIENTS: - -7. PAY YOUR MEDICAL BILLS PROMPTLY AND WILLINGLY. - You should consider it a privilege to contribute, however modestly, - to the well-being of physicians and other humanitarians. - -8. DO NOT SUFFER FROM AILMENTS THAT YOU CANNOT AFFORD. - It is sheer arrogance to contract illnesses that are beyond your means. - -9. NEVER REVEAL ANY OF THE SHORTCOMINGS THAT HAVE COME TO LIGHT IN THE COURSE - OF TREATMENT BY YOUR DOCTOR. - The patient-doctor relationship is a privileged one, and you have a - sacred duty to protect him from exposure. - -10. NEVER DIE WHILE IN YOUR DOCTOR'S PRESENCE OR UNDER HIS DIRECT CARE. - This will only cause him needless inconvenience and embarrassment. -% -A Code of Honour: never approach a friend's girlfriend or wife with mischief -as your goal. There are too many women in the world to justify that sort of -dishonourable behaviour. Unless she's really attractive. - -- Bruce J. Friedman, "Sex and the Lonely Guy" -% -A committee is a group that keeps the minutes and loses hours. - -- Milton Berle -% -A committee is a life form with six or more legs and no brain. - -- Lazarus Long, "Time Enough For Love" -% -A committee takes root and grows, it flowers, wilts and dies, -scattering the seed from which other committees will bloom. - -- Parkinson -% -A commune is where people join together to share their lack of wealth. - -- R. Stallman -% -A company is known by the men it keeps. -% -A complex system that works is invariably -found to have evolved from a simple system that works. -% -A compliment is something like a kiss through a veil. - -- Victor Hugo -% -[A computer is] like an Old Testament god, with a lot of rules and no mercy. - -- Joseph Campbell -% -A computer lets you make more mistakes faster than any other invention, -with the possible exceptions of handguns and Tequila. - -- Mitch Ratcliffe -% -A computer salesman visits a company president for the purpose of selling -the president one of the latest talking computers. -Salesman: "This machine knows everything. I can ask it any question - and it'll give the correct answer. Computer, what is the - speed of light?" -Computer: 186,000 miles per second. -Salesman: "Who was the first president of the United States?" -Computer: George Washington. -President: "I'm still not convinced. Let me ask a question. - Where is my father?" -Computer: Your father is fishing in Georgia. -President: "Hah!! The computer is wrong. My father died over twenty - years ago!" -Computer: Your mother's husband died 22 years ago. Your father just - landed a twelve pound bass. -% -A computer science student and a practical hacker are discussing problems -the computer science student has run in to. - -CS Student: I have this singularly linked tail-queued list and I'm trying - to make it O(1) to go backwards an item, instead of O(n)... - What's the best way to go about that? Should I just use a - cached hash of each item and put it into a sorted lookup - table, and cache the hash of the last item in the current - queue entry and then go to its place in the hash table and - get the pointer value from there? -Hacker: No, you should add an item to the structure named 'prev' and - make it point to the previous item. -CS Student: But we already have a structure element with that identifier - and structure elements must have unique names within that - scope! -Hacker: So call it 'previous'. - -And then the CS Student was enlightened. -% -A computer science student on an exam: - - According to Shannon, information has entropy. Entropy is just - a mathematical trick to introduce temperature. Consequently, - information has temperature. Hence there are hot news and cool - news. -% -A computer scientist is someone who fixes things that aren't broken. -% -A computer, to print out a fact, -Will divide, multiply, and subtract. - But this output can be - No more than debris, -If the input was short of exact. - -- Gigo -% -A computer without COBOL and Fortran is like a piece of chocolate -cake without ketchup and mustard. -% -A conclusion is simply the place where someone got tired of thinking. -% -A conference is a gathering of important people who singly can -do nothing but together can decide that nothing can be done. - -- Fred Allen -% -A CONS is an object which cares. - -- Bernie Greenberg -% -A conservative is a man who is too cowardly to fight and too fat to run. - -- Elbert Hubbard -% -A conservative is a man -who believes that nothing should be done for the first time. - -- Alfred E. Wiggam -% -A conservative is a man -with two perfectly good legs who has never learned to walk. - -- Franklin D. Roosevelt -% -A consultant is a person who borrows your watch, tells you what time it -is, pockets the watch, and sends you a bill for it. -% -A continuing flow of paper is sufficient to continue the flow of paper. - -- Dyer -% -A copy of the universe is not what is required of art; one of the -damned things is ample. - -- Rebecca West -% -A couch is as good as a chair. -% -A countryman between two lawyers is like a fish between two cats. - -- Benjamin Franklin -% -A couple of young fellers were fishing at their special pond off the -beaten track when out of the bushes jumped the Game Warden. Immediately, -one of the boys threw his rod down and started running through the woods -like the proverbial bat out of hell, and hot on his heels ran the Game -Warden. After about a half mile the fella stopped and stooped over with -his hands on his thighs, whooping and heaving to catch his breath as the -Game Warden finally caught up to him. - "Let's see yer fishin' license, boy," the Warden gasped. The -man pulled out his wallet and gave the Game Warden a valid fishing -license. - "Well, son", snarled the Game Warden, "You must be about as dumb -as a box of rocks! You didn't have to run if you have a license!" - "Yes, sir," replied his victim, "but, well, see, my friend back -there, he don't have one!" -% -A cousin of mine once said about money, -money is always there but the pockets change; -it is not in the same pockets after a change, -and that is all there is to say about money. - -- Gertrude Stein -% -A cow is a completely automated milk-manufacturing machine. It is encased -in untanned leather and mounted on four vertical, movable supports, one at -each corner. The front end of the machine, or input, contains the cutting -and grinding mechanism, utilizing a unique feedback device. Here also are -the headlights, air inlet and exhaust, a bumper and a foghorn. - At the rear, the machine carries the milk-dispensing equipment as -well as a built-in flyswatter and insect repeller. The central portion -houses a hydro- chemical-conversion unit. Briefly, this consists of four -fermentation and storage tanks connected in series by an intricate network -of flexible plumbing. This assembly also contains the central heating plant -complete with automatic temperature controls, pumping station and main -ventilating system. The waste disposal apparatus is located to the rear of -this central section. - Cows are available fully-assembled in an assortment of sizes and -colors. Production output ranges from 2 to 20 tons of milk per year. In -brief, the main external visible features of the cow are: two lookers, two -hookers, four stander-uppers, four hanger-downers, and a swishy-wishy. -% -A critic is a bundle of biases held loosely together by a sense of taste. - -- Whitney Balliett -% -A "critic" is a man who creates nothing and thereby feels -qualified to judge the work of creative men. There is logic -in this; he is unbiased -- he hates all creative people equally. -% -A cynic is a person searching for an honest man, with a stolen lantern. - -- Edgar A. Shoaff -% -A day for firm decisions!!!!! Or is it? -% -A day without orange juice is like a day without orange juice. -% -A day without sunshine is like a day without Anita Bryant. -% -A day without sunshine is like a day without orange juice. -% -A day without sunshine is like night. -% -A dead man cannot bite. - -- Gnaeus Pompeius (Pompey) -% -A debugged program is one for which you have -not yet found the conditions that make it fail. - -- Jerry Ogdin -% -A decade after Vietnam, we still cannot understand why "their" -Salvadorans fight better than "our" Salvadorans. It is not a matter of -their training or their equipment. It has to do with the quality of the -society we are asking them to risk death defending. The metaphor of the -domino obscures this reality, and the cost our self-imposed blindness -is high. San Salvador is closer to Saigon than to Munich. - -- William LeoGrande, "New York Times", 3/9/83 -% -A Difficulty for Every Solution. - -- Motto of the Federal Civil Service -% -A diplomat is a man who can convince his -wife she'd look stout in a fur coat. -% -A diplomat is a man who can tell you to -go to hell and make the trip sound pleasurable. - -- Samuel Clemens -% -A diplomat is a person who can tell you to go to hell -in such a way that you actually look forward to the trip. - -- Caskie Stinnett, "Out of the Red" -% -A diplomat is man who always remembers a woman's birthday but never her age. - -- Robert Frost -% -A diplomatic husband said to his wife, "How do you expect me to remember -your birthday when you never look any older?" -% -A diplomat's life consists of three things: protocol, Geritol, and alcohol. - -- Adlai E. Stevenson -% -A distraught patient phoned her doctor's office. "Was it true," the woman -inquired, "that the medication the doctor had prescribed was for the rest -of her life?" - She was told that it was. There was just a moment of silence before -the woman proceeded bravely on. "Well, I'm wondering, then, how serious my -condition is. This prescription is marked `NO REFILLS'". -% -A diva who specializes in risqu'e arias is an off-coloratura soprano. -% -A doctor calls his patient to give him the results of his tests. "I have -some bad news," says the doctor, "and some worse news." The bad news is -that you only have six weeks to live." - "Oh, no," says the patient. "What could possibly be worse than -that?" - "Well," the doctor replies, "I've been trying to reach you since -last Monday." -% -A doctor was stranded with a lawyer in a leaky life raft in shark-infested -waters. The doctor tried to swim ashore but was eaten by the sharks. The -lawyer, however, swam safely past the bloodthirsty sharks. "Professional -courtesy," he explained. -% -A door is what a dog is perpetually on the wrong side of. - -- Ogden Nash -% -A drama critic is a person who surprises a playwright by informing him -what he meant. - -- Wilson Mizner -% -A dream will always triumph over reality, once it is given the chance. - -- Stanislaw Lem -% -A Dublin lawyer died in poverty and many barristers of the city subscribed to -a fund for his funeral. The Lord Chief Justice of Orbury was asked to donate -a shilling. "Only a shilling?" exclaimed the man. "Only a shilling to bury -an attorney? Here's a guinea; go and bury twenty of them." -% -A failure will not appear until a unit has passed final inspection. -% -A fair exterior is a silent recommendation. - -- Publilius Syrus -% -A fake fortuneteller can be tolerated. But an authentic soothsayer -should be shot on sight. Cassandra did not get half the kicking around -she deserved. - -- Robert A. Heinlein -% -A famous Lisp Hacker noticed an Undergraduate sitting in front of a Xerox -1108, trying to edit a complex Klone network via a browser. Wanting to help, -the Hacker clicked one of the nodes in the network with the mouse, and asked -"what do you see?" Very earnestly, the Undergraduate replied, "I see a -cursor." The Hacker then quickly pressed the boot toggle at the back of -the keyboard, while simultaneously hitting the Undergraduate over the head -with a thick Interlisp Manual. The Undergraduate was then Enlightened. -% -A fanatic is one who can't change his mind and won't change the subject. - -- Winston Churchill -% -A farmer is a man outstanding in his field. -% -A feed salesman is on his way to a farm. As he's driving along at forty -m.p.h., he looks out his car window and sees a three-legged chicken running -alongside him, keeping pace with his car. He is amazed that a chicken is -running at forty m.p.h. So he speeds up to forty-five, fifty, then sixty -m.p.h. The chicken keeps right up with him the whole way, then suddenly -takes off and disappears into the distance. - The man pulls into the farmyard and says to the farmer, "You know, -the strangest thing just happened to me; I was driving along at at least -sixty miles an hour and a chicken passed me like I was standing still!" - "Yeah," the farmer replies, "that chicken was ours. You see, there's -me, and there's Ma, and there's our son Billy. Whenever we had chicken for -dinner, we would all want a drumstick, so we'd have to kill two chickens. -So we decided to try and breed a three-legged chicken so each of us could -have a drumstick." - "How do they taste?" said the farmer. - "Don't know," replied the farmer. "We haven't been able to catch -one yet." -% -A fellow bought a new car, a Nissan, and was quite happy with his purchase. -He was something of an animist, however, and felt that the car really ought -to have a name. This presented a problem, as he was not sure if the name -should be masculine or feminine. - After considerable thought, he settled on naming the car either -Belchazar or Beaumadine, but remained in a quandry about the final choice. - "Is a Nissan male or female?" he began asking his friends. Most of -them looked at him peculiarly, mumbled things about urgent appointments, and -went on their way rather quickly. - He finally broached the question to a lady he knew who held a black -belt in judo. She thought for a moment and answered "Feminine." - The swiftness of her response puzzled him. "You're sure of that?" he -asked. - "Certainly," she replied. "They wouldn't sell very well if they were -masculine." - "Unhhh... Well, why not?" - "Because people want a car with a reputation for going when you want -it to. And, if Nissan's are female, it's like they say... `Each Nissan, she -go!'" - - [No, we WON'T explain it; go ask someone who practices an oriental - martial art. (Tai Chi Chuan probably doesn't count.) Ed.] -% -A few hours grace before the madness begins again. -% -A fitter fits; Though sinners sin -A cutter cuts; And thinners thin -And an aircraft spotter spots; And paper-blotters blot -A baby-sitter I've never yet -Baby-sits -- Had letters let -But an otter never ots. Or seen an otter ot. - -A batter bats -(Or scatters scats); -A potting shed's for potting; -But no one's found -A bounder bound -Or caught an otter otting. - -- Ralph Lewin -% -A flashy Mercedes-Benz roared up to the curb where a cute young miss stood -waiting for a taxi. - "Hi," said the gentleman at the wheel. "I'm going west." - "How wonderful," came the cool reply. "Bring me back an orange." -% -A fool and his honey are soon parted. -% -A fool and his money are soon popular. -% -A fool must now and then be right by chance. -% -A foolish consistency is the hobgoblin of little minds. - -- Ralph Waldo Emerson -% -A fool-proof method for sculpting an elephant: first, get a huge block -of marble; then you chip away everything that doesn't look like an elephant. -% -A fool's brain digests philosophy into folly, science into -superstition, and art into pedantry. Hence University education. - -- George Bernard Shaw -% -A formal parsing algorithm should not always be used. - -- D. Gries -% -A Fortran compiler is the hobgoblin of little minis. -% -A fox is wolf who sends flowers. - -- Ruth Weston -% -A fractal is by definition a set for which the Hausdorff Besicovitch -dimension strictly exceeds the topological dimension. - -- Mandelbrot, "The Fractal Geometry of Nature" -% -A free society is one where it is safe to be unpopular. - -- Adlai E. Stevenson -% -A freelancer is one who gets paid by the word -- per piece or perhaps. - -- Robert Benchley -% -A friend in need is a pest indeed. -% -A friend is a present you give yourself. - -- Robert Louis Stevenson -% -A friend of mine is into Voodoo Acupuncture. You don't have to go. -You'll just be walking down the street and... Ooohh, that's much better. - -- Steven Wright -% -A friend of mine won't get a divorce, because he hates -lawyers more than he hates his wife. -% -A full belly makes a dull brain. - -- Benjamin Franklin - - [and the local candy machine man. Ed] -% -A "full" life in my experience is usually full only of other -people's demands. -% -A furore Normanorum libera nos, O Domine! -% -A Galileo could no more be elected president of the United States than -he could be elected Pope of Rome. Both high posts are reserved for men -favored by God with an extraordinary genius for swathing the bitter -facts of life in bandages of self-illusion. - -- H. L. Mencken -% -A gambler's biggest thrill is winning a bet. -His next biggest thrill is losing a bet. -% -A gangster assembled an engineer, a chemist, and a physicist. He explained -that he was entering a horse in a race the following week and the three -assembled guys had the job of assuring that the gangster's horse would win. -They were to reconvene the day before the race to tell the gangster how they -each propose to ensure a win. When they reconvened the gangster started with -the engineer: - -Gangster: OK, Mr. engineer, what have you got? -Engineer: Well, I've invented a way to weave metallic threads into the saddle - blanket so that they will act as the plates of a battery and provide - electrical shock to the horse. -G: That's very good! But let's hear from the chemist. -Chemist: I've synthesized a powerful stimulant that dissolves - into simple blood sugars after ten minutes and therefore - cannot be detected in post-race tests. -G: Excellent, excellent! But I want to hear from the physicist before - I decide what to do. Physicist? - -Physicist: Well, first consider a spherical horse in simple harmonic motion... -% -A general leading the State Department resembles a dragon commanding -ducks. - -- New York Times, Jan. 20, 1981 -% -A gentleman is a man who wouldn't hit a lady with his hat on. - -- Evan Esar - [ And why not? For why does she have his hat on? Ed.] -% -A gentleman never strikes a lady with his hat on. - -- Fred Allen -% -A gift of a flower will soon be made to you. -% -A girl and a boy bump into each other -- surely an accident. -A girl and a boy bump and her handkerchief drops -- surely another accident. -But when a girl gives a boy a dead squid -- *_t_h_a_t _h_a_d _t_o _m_e_a_n _s_o_m_e_t_h_i_n_g*. - -- S. Morgenstern, "The Silent Gondoliers" -% -A girl with a future avoids the man with a past. - -- Evan Esar, "The Humor of Humor" -% -A girl's best friend is her mutter. - -- Dorothy Parker -% -A gleekzorp without a tornpee is like -a quop without a fertsneet (sort of). -% -A [golf] ball hitting a tree shall be deemed not to have hit the tree. -Hitting a tree is simply bad luck and has no place in a scientific game. -The player should estimate the distance the ball would have traveled if it -had not hit the tree and play the ball from there, preferably atop a nice -firm tuft of grass. - -- Donald A. Metz -% -A [golf] ball sliced or hooked into the rough shall be lifted and placed in -the fairway at a point equal to the distance it carried or rolled into the -rough. Such veering right or left frequently results from friction between -the face of the club and the cover of the ball and the player should not be -penalized for the erratic behavior of the ball resulting from such -uncontrollable physical phenomena. - -- Donald A. Metz -% -A good marriage would be between a blind wife and deaf husband. - -- Michel de Montaigne -% -A good memory does not equal pale ink. -% -A good name lost is seldom regained. When character is gone, -all is gone, and one of the richest jewels of life is lost forever. - -- J. Hawes -% -A good plan today is better than a perfect plan tomorrow. - -- Patton -% -A good programmer is someone who looks both ways before crossing a -one-way street. - -- Doug Linder -% -A good question is never answered. It is not a bolt to be tightened -into place but a seed to be planted and to bear more seed toward the -hope of greening the landscape of idea. - -- John Ciardi -% -A good reputation is more valuable than money. - -- Publilius Syrus -% -A good scapegoat is hard to find. -% -A good supervisor can step on your toes without messing up your shine. -% -A good sysadmin always carries around a few feet of fiber. If he ever -gets lost, he simply drops the fiber on the ground, waits ten minutes, -then asks the backhoe operator for directions. - -- Bill Bradford -% -A GOOD WAY TO THREATEN somebody is to light a stick of dynamite. Then you -call the guy and hold the burning fuse to the phone. "Hear that?" you say. -"That's dynamite, baby." - -- Jack Handey, "The New Mexican" (1988) -% -A gossip is one who talks to you about others, a bore is one who talks to -you about himself; and a brilliant conversationalist is one who talks to -you about yourself. - -- Lisa Kirk -% -A gourmet restaurant in Cincinnati is one where you leave the tray on -the table after you eat. -% -A gourmet who thinks of calories is like a tart that looks at her watch. - -- James Beard -% -A government that is big enough to give you all you want is big enough -to take it all away. - -- Barry Goldwater -% -A grammarian's life is always intense. -% -A great empire, like a great cake, is most easily diminished at the edges. - -- Benjamin Franklin -% -A great many people think they are thinking -when they are merely rearranging their prejudices. - -- William James -% -A great nation is any mob of people which produces at least one honest -man a century. -% -A green hunting cap squeezed the top of the fleshy balloon of a head. The -green earflaps, full of large ears and uncut hair and the fine bristles that -grew in the ears themselves, stuck out on either side like turn signals -indicating two directions at once. Full, pursed lips protruded beneath the -bushy black moustache and, at their corners, sank into little folds filled -with disapproval and potato chip crumbs. In the shadow under the green visor -of the cap Ignatius J. Reilly's supercilious blue and yellow eyes looked down -upon the other people waiting under the clock at the D. H. Holmes department -store, studying the crowd of people for signs of bad taste in dress. Several -of the outfits, Ignatius noticed, were new enough and expensive enough to be -properly considered offenses against taste and decency. Possession of -anything new or expensive only reflected a person's lack of theology and -geometry; it could even cast doubts upon one's soul. - -- John Kennedy Toole, "Confederacy of Dunces" -% -A group of politicians deciding to dump a President because his morals -are bad is like the Mafia getting together to bump off the Godfather for -not going to church on Sunday. - -- Russell Baker -% -A guilty conscience is the mother of invention. - -- Carolyn Wells -% -A guy has to get fresh once in a while -so a girl doesn't lose her confidence. -% -A hacker does for love what others would not do for money. -% -A halted retreat -Is nerve-wracking and dangerous. -To retain people as men -- and maidservants -Brings good fortune. -% -A hammer sometimes misses its mark - a bouquet never. -% -A handful of friends is worth more than a wagon of gold. -% -A handful of patience is worth more than a bushel of brains. -% -A healthy male adult bore consumes each year one and a half times his own -weight in other people's patience. - -- John Updike -% -A help wanted add for a photo journalist asked the rhetorical question: - -If you found yourself in a situation where you could either save -a drowning man, or you could take a Pulitzer prize winning -photograph of him drowning, what shutter speed and setting would -you use? - - -- Paul Harvey -% -A Hen Brooding Kittens - A friend informs us that he saw at the Novato ranch, Marin county, -a few days since, a hen actually brooding and otherwise caring for three -kittens! The gentleman upon whose premises this strange event is transpiring -says the hen adopted the kittens when they were but a few days old, and that -she has devoted them her undivided care for several weeks past. The young -felines are now of respectable size, but they nevertheless follow the hen at -her cluckings, and are regularly brooded at night beneath her wings. - -- Sacramento Daily Union, July 2, 1861 -% -A hermit is a deserter from the army of humanity. -% -A highly intelligent man should take a primitive woman. Imagine if on top -of everything else, I had a woman who interfered with my work. - -- Adolf Hitler -% -A holding company is a thing where you hand -an accomplice the goods while the policeman searches you. -% -A Hollywood producer calls a friend, another producer on the phone. - "Hello?" his friend answers. - "Hi!" says the man. "This is Bob, how are you doing?" - "Oh," says the friend, "I'm doing great! I just sold a screenplay -for two hundred thousand dollars. I've started a novel adaptation and the -studio advanced me fifty thousand dollars on it. I also have a television -series coming on next week, and everyone says it's going to be a big hit! -I'm doing *great*! How are you?" - "Okay," says the producer, "give me a call when he leaves." -% -A homeowner's reach should exceed his grasp, or what's a weekend for? -% -A horse! A horse! My kingdom for a horse! - -- William Shakespeare, "Henry VI" -% -A hundred thousand lemmings can't be wrong! -% -A hundred years from now it is very likely that [of Twain's works] "The -Jumping Frog" alone will be remembered. - -- Harry Thurston Peck (Editor of "The Bookman"), January 1901 -% -A husband is what is left of the lover after the nerve has been extracted. - -- Helen Rowland -% -A hypocrite is a person who ... but who isn't? - -- Don Marquis -% -A hypothetical paradox: - What would happen in a battle between an Enterprise security team, -who always get killed soon after appearing, and a squad of Imperial -Stormtroopers, who can't hit the broad side of a planet? - -- Tom Galloway -% -A is for Amy who fell down the stairs, B is for Basil assaulted by bears. -C is for Clara who wasted away, D is for Desmond thrown out of the sleigh. -E is for Ernest who choked on a peach, F is for Fanny, sucked dry by a leech. -G is for George, smothered under a rug, H is for Hector, done in by a thug. -I is for Ida who drowned in the lake, J is for James who took lye, by mistake. -K is for Kate who was struck with an axe, L is for Leo who swallowed some tacks. -M is for Maud who was swept out to sea, N is for Neville who died of ennui. -O is for Olive, run through with an awl, P is for Prue, trampled flat in a brawl -Q is for Quentin who sank in a mire, R is for Rhoda, consumed by a fire. -S is for Susan who perished of fits, T is for Titus who flew into bits. -U is for Una who slipped down a drain, V is for Victor, squashed under a train. -W is for Winnie, embedded in ice, X is for Xerxes, devoured by mice. -Y is for Yorick whose head was bashed in, Z is for Zillah who drank too much gin. - -- Edward Gorey, "The Gashlycrumb Tinies" -% -A is for Apple. - -- Hester Pryne -% -A is for awk, which runs like a snail, and -B is for biff, which reads all your mail. -C is for cc, as hackers recall, while -D is for dd, the command that does all. -E is for emacs, which rebinds your keys, and -F is for fsck, which rebuilds your trees. -G is for grep, a clever detective, while -H is for halt, which may seem defective. -I is for indent, which rarely amuses, and -J is for join, which nobody uses. -K is for kill, which makes you the boss, while -L is for lex, which is missing from DOS. -M is for more, from which less was begot, and -N is for nice, which it really is not. -O is for od, which prints out things nice, while -P is for passwd, which reads in strings twice. -Q is for quota, a Berkeley-type fable, and -R is for ranlib, for sorting ar table. -S is for spell, which attempts to belittle, while -T is for true, which does very little. -U is for uniq, which is used after sort, and -V is for vi, which is hard to abort. -W is for whoami, which tells you your name, while -X is, well, X, of dubious fame. -Y is for yes, which makes an impression, and -Z is for zcat, which handles compression. - -- THE ABC'S OF UNIX -% -A joint is just tea for two. -% -A journey of a thousand miles begins with a cash advance from Sam. -% -A journey of a thousand miles must begin with a single step. - -- Lao Tsu -% -A journey of a thousand miles starts under one's feet. - -- Lao Tsu -% -A jug of wine, a bowl of rice with it; -Earthen vessels -Simply handed in through the window. -There is certainly no blame in this. -% -A jury consists of twelve persons chosen to decide who has the better lawyer. - -- Robert Frost -% -A key to the understanding of all religions is that a God's idea of a -good time is a game of Snakes and Ladders with greased rungs. -% -A kid'll eat the middle of an Oreo, eventually. -% -A kind of Batman of contemporary letters. - -- Philip Larkin on Anthony Burgess -% -A king's castle is his home. -% -A kiss is a course of procedure, cunningly devised, -for the mutual stoppage of speech at a moment when -words are superfluous. -% -A lack of leadership is no substitute for inaction. -% -A lady is one who never shows her underwear unintentionally. - -- Lillian Day -% -A lady with one of her ears applied -To an open keyhole heard, inside, -Two female gossips in converse free -- -The subject engaging them was she. -"I think", said one, "and my husband thinks -That she's a prying, inquisitive minx!" -As soon as no more of it she could hear -The lady, indignant, removed her ear. -"I will not stay," she said with a pout, -"To hear my character lied about!" - -- Gopete Sherany -% -A language that doesn't affect the way you -think about programming is not worth knowing. - -- Alan J. Perlis -% -A language that doesn't have everything is -actually easier to program in than some that do. - -- Dennis M. Ritchie -% -A large number of installed systems work by fiat. -That is, they work by being declared to work. - -- Anatol Holt -% -A large spider in an old house built a beautiful web in which to catch flies. -Every time a fly landed on the web and was entangled in it the spider devoured -him, so that when another fly came along he would think the web was a safe and -quiet place in which to rest. One day a fairly intelligent fly buzzed around -above the web so long without lighting that the spider appeared and said, -"Come on down." But the fly was too clever for him and said, "I never light -where I don't see other flies and I don't see any other flies in your house." -So he flew away until he came to a place where there were a great many other -flies. He was about to settle down among them when a bee buzzed up and said, -"Hold it, stupid, that's flypaper. All those flies are trapped." "Don't be -silly," said the fly, "they're dancing." So he settled down and became stuck -to the flypaper with all the other flies. - -Moral: There is no safety in numbers, or in anything else. - -- James Thurber, "The Fairly Intelligent Fly" -% -A Law of Computer Programming: - Make it possible for programmers to write in English - and you will find that programmers cannot write in English. -% -A liberal is a man too broad minded to take his own side in a quarrel. - -- Robert Frost -% -A liberal is a person whose interests aren't at stake at the moment. - -- Willis Player -% -A lie in time saves nine. -% -A lie is an abomination unto the Lord and a very present help in time of -trouble. - -- Adlai E. Stevenson -% -A life lived in fear is a life half lived. -% -A life spent in search of the perfect hash brownie is a life well spent. -% -A lifetime isn't nearly long enough to figure out what it's all about. -% -A light wife doth make a heavy husband. - -- William Shakespeare, "The Merchant of Venice" -% -A likely impossibility is always preferable to an unconvincing possibility. - -- Aristotle -% -A limerick packs laughs anatomical -Into space that is quite economical. - But the good ones I've seen - So seldom are clean, -And the clean ones so seldom are comical. -% -A LISP programmer knows the value of -everything, but the cost of nothing. - -- Alan J. Perlis -% -A list is only as strong as its weakest link. - -- Donald E. Knuth -% -A little experience often upsets a lot of theory. -% -A little inaccuracy saves a world of explanation. - -- C. E. Ayres -% -A little inaccuracy sometimes saves tons of explanation. - -- H. H. Munroe a.k.a. Saki, "The Square Egg" (1924) -% -A little kid went up to Santa and asked him, "Santa, you know when I'm bad -right?" And Santa says, "Yes, I do." The little kid then asks, "And you -know when I'm sleeping?" To which Santa replies, "Every minute." So the -little kid then says, "Well, if you know when I'm bad and when I'm good, -then how come you don't know what I want for Christmas?" -% -A little retrospection shows that although many fine, useful software systems -have been designed by committees and built as part of multipart projects, -those software systems that have excited passionate fans are those that are -the products of one or a few designing minds, great designers. Consider Unix, -APL, Pascal, Modula, the Smalltalk interface, even Fortran; and contrast them -with Cobol, PL/I, Algol, MVS/370, and MS-DOS. - -- Frederick Brooks, Jr. -% -A little word of doubtful number, -A foe to rest and peaceful slumber. -If you add an "s" to this, -Great is the metamorphosis. -Plural is plural now no more, -And sweet what bitter was before. -What am I? -% -A log may float in a river, but that does not make it a crocodile. -% -A long memory is the most subversive idea in America. -% -A long-forgotten loved one will appear soon. -Buy the negatives at any price. -% -A lost ounce of gold may be found, a lost moment of time never. -% -A lot of people are afraid of heights. Not me. I'm afraid of widths. - -- Steven Wright -% -A lot of people I know believe in positive thinking, -and so do I. I believe everything positively stinks. - -- Lew Col -% -A major, with wonderful force, -Called out in Hyde Park for a horse. - All the flowers looked round, - But no horse could be found; -So he just rhododendron, of course. -% -A man always remembers his first love with special -tenderness, but after that begins to bunch them. - -- H. L. Mencken -% -A man can have two, maybe three love affairs while he's married. After -that it's cheating. - -- Yves Montand -% -A man does not look behind the door unless he has stood there himself. - -- Du Bois -% -A man fell off a mountain and, as he fell, saw a branch and grabbed for it. -By superhuman effort he was able to get a precarious grip on it. As he -was hanging there for dear life, he looked up and cried out, - "Is anybody there?" -A deep majestic voice answered, - "Yes my son, I am here. What do you need?" - "Help me!!" cried the man. - "I will help you", said the voice, "Just let go of the branch and -you'll be safe. All you have to do is trust." -The man thought for a moment and cried out: - "Anybody ELSE up there?" -% -A man gazing at the stars is proverbially at the mercy of the puddles -in the road. - -- Alexander Smith -% -A man in love is incomplete until he is married. Then he is finished. - -- Zsa Zsa Gabor, "Newsweek" -% -A man is already halfway in love with any woman who listens to him. - -- Brendan Francis -% -A man is crawling through the Sahara desert when he is approached by another -man riding on a camel. When the rider gets close enough, the crawling man -whispers through his sun-parched lips, "Water... please... can you give... -water..." - "I'm sorry," replies the man on the camel, "I don't have any water -with me. But I'd be delighted to sell you a necktie." - "Tie?" whispers the man. "I need *water*." - "They're only four dollars apiece." - "I need *water*." - "Okay, okay, say two for seven dollars." - "Please! I need *water*!", says the man. - "I don't have any water, all I have are ties," replies the salesman, -and he heads off into the distance. - The man, losing track of time, crawls for what seems like days. -Finally, nearly dead, sun-blind and with his skin peeling and blistering, he -sees a restaurant in the distance. Summoning the last of his strength he -staggers up to the door and confronts the head waiter. - "Water... can I get... water," the dying man manages to stammer. - "I'm sorry, sir, ties required." -% -A man is known by the company he organizes. - -- Ambrose Bierce -% -A man is like a rusty wheel on a rusty cart, -He sings his song as he rattles along and then he falls apart. - -- Richard Thompson -% -A man marries to have a home, but also because he doesn't want to be -bothered with sex and all that sort of thing. - -- W. Somerset Maugham, "The Circle" -% -A man may be so much of everything that he is nothing of anything. - -- Samuel Johnson -% -A man may sometimes be forgiven the kiss to which he is not entitled, -but never the kiss he has not the initiative to claim. -% -A man may well bring a horse to the water, -but he cannot make him drink with he will. - -- John Heywood -% -A man of genius makes no mistakes. -His errors are volitional and are the portals of discovery. - -- James Joyce, "Ulysses" -% -A man paints with his brains and not with his hands. -% -A man said to the Universe: - "Sir, I exist!" - "However," replied the Universe, - "the fact has not created in me a sense of obligation." - -- Stephen Crane -% -A man took his wife deer hunting for the first time. After he'd given her -some basic instructions, they agreed to separate and rendezvous later. Before -he left, he warned her if she should fell a deer to be wary of hunters who -might beat her to the carcass and claim the kill. If that happened, he told -her, she should fire her gun three times into the air and he would come to -her aid. - Shortly after they separated, he heard a single shot, followed quickly -by the agreed upon signal. Running to the scene, he found his wife standing -in a small clearing with a very nervous man staring down her gun barrel. - "He claims this is his," she said, obviously very upset. - "She can keep it, she can keep it!" the wide-eyed man replied. "I -just want to get my saddle back!" -% -A man usually falls in love with a woman who asks the kinds of questions -he is able to answer. - -- Ronald Colman -% -A man was griping to his friend about how he hated to go home after a -late card games. - "You wouldn't believe what I go through to avoid waking my wife," -he said. "First, I kill the engine a block away from the house and coast -into the garage. Then I open the door slowly, take off my shoes, and -tiptoe to our room. But just as I'm about to slide into bed, she always -wakes up and gives me hell." - "I make a big racket when I go home," his friend replied. - "You do?" - "Sure. I honk the horn, slam the door, turn on all the lights, -stomp up to the bedroom and give my wife a big kiss. `Hi, Alice,' I say. -`How about a little smooch for your old man?'" - "And what does she say?" his friend asked in disbelief. - "She doesn't say anything," his buddy replied. "She always pretends -she's asleep." -% -A man was kneeling by a grave in a cemetery, crying and praying very loudly, - "Oh why..eeeee did you die...eeeeee, Oh Why..eeeeee, -why did you Di......eeee" -The caretaker walks up, pardons himself and asks politely, - "Excuse me, sir, but I've been seeing you for hours now, -carrying on at this grave. You must have been very close to the deceased." - "No, I never met him. Oh why....eeeee did you dieeeeee, -why....eeeee did you.." - "Sir, you say you never met this person, yet you carry on so? -Tell, me who is buried here?" - "My wife's first husband." -% -A man who cannot seduce men cannot save them either. - -- S. A. Kierkegaard (1813-1855) -% -A man who carries a cat by its tail learns something he can learn -in no other way. -% -A man who fishes for marlin in ponds -will put his money in Etruscan bonds. -% -A man who turns green has eschewed protein. -% -A man with 3 wings and a dictionary is cousin to the turkey. -% -A man with one watch knows what time it is. -A man with two watches is never quite sure. -% -A man without a woman is like a fish without gills. -% -A man would still do something out of sheer perversity - he would create -destruction and chaos - just to gain his point... and if all this could in -turn be analyzed and prevented by predicting that it would occur, then man -would deliberately go mad to prove his point. - -- Feodor Dostoevsky, "Notes From the Underground" -% -A man wrapped up in himself makes a very small package. -% -A man's best friend is his dogma. -% -A man's gotta know his limitations. - -- Clint Eastwood, "Dirty Harry" -% -A man's house is his castle. - -- Sir Edward Coke -% -A man's house is his hassle. -% -A master was asked the question, "What is the Way?" by a curious monk. - "It is right before your eyes," said the master. - "Why do I not see it for myself?" - "Because you are thinking of yourself." - "What about you: do you see it?" - "So long as you see double, saying `I don't', and `you do', and so -on, your eyes are clouded," said the master. - "When there is neither `I' nor `You', can one see it?" - "When there is neither `I' nor `You', -who is the one that wants to see it?" -% -A mathematician, a doctor, and an engineer are walking on the beach and -observe a team of lifeguards pumping the stomach of a drowned woman. As -they watch, water, sand, snails and such come out of the pump. - The doctor watches for a while and says: "Keep pumping, men, you may -yet save her!!" - The mathematician does some calculations and says: "According to my -understanding of the size of that pump, you have already pumped more water -from her body than could be contained in a cylinder 4 feet in diameter and -6 feet high." - The engineer says: "I think she's sitting in a puddle." -% -A mathematician is a device for turning coffee into theorems. - -- P. Erdos -% -A mathematician is a machine for converting coffee into theorems. -% -A meeting is an event at which the -minutes are kept and the hours are lost. -% -A memorandum is written not to inform the reader, -but to protect the writer. - -- Dean Acheson -% -A method of solution is perfect if we can foresee from the start, -and even prove, that following that method we shall attain our aim. - -- Gottfried Wilhelm Leibniz -% -A Mexican newspaper reports that bored Royal Air Force pilots stationed -on the Falkland Islands have devised what they consider a marvelous new -game. Noting that the local penguins are fascinated by airplanes, the -pilots search out a beach where the birds are gathered and fly slowly -along it at the water's edge. Perhaps ten thousand penguins turn their -heads in unison watching the planes go by, and when the pilots turn -around and fly back, the birds turn their heads in the opposite -direction, like spectators at a slow-motion tennis match. Then, the -paper reports, "The pilots fly out to sea and directly to the penguin -colony and overfly it. Heads go up, up, up, and ten thousand penguins -fall over gently onto their backs. - -- Audubon Society Magazine - -[From the BBC, 2001-02-02: - For five weeks, a team from the British Antarctic Survey (BAS) -monitored 1,000 king penguins on the island of South Georgia as Lynx -helicopters passed overhead. - "Not one king penguin fell over when the helicopters came over," -said team leader Dr. Richard Stone. - "As the aircraft approached, the birds went quiet and stopped -calling to each other, and adolescent birds that were not associated -with nests began walking away from the noise. Pure animal instinct, -really." - The conclusion, said Dr. Stone, is that flights over 305 metres -(1,000 feet) caused "only minor and transitory ecological effects" on -king penguins.] -% -A mighty creature is the germ, -Though smaller than the pachyderm. -His customary dwelling place -Is deep within the human race. -His childish pride he often pleases -By giving people strange diseases. -Do you, my poppet, feel infirm? -You probably contain a germ. - -- Ogden Nash -% -A mind is a wonderful thing to waste. -% -A modem is a baudy house. -% -A modest woman, dressed out in all her finery, -is the most tremendous object in the whole creation. - -- Goldsmith -% -A mother mouse was taking her large brood for a stroll across the kitchen -floor one day when the local cat, by a feat of stealth unusual even for -its species, managed to trap them in a corner. The children cowered, -terrified by this fearsome beast, plaintively crying, "Help, Mother! -Save us! Save us! We're scared, Mother!" - Mother Mouse, with the hopeless valor of a parent protecting its -children, turned with her teeth bared to the cat, towering huge above them, -and suddenly began to bark in a fashion that would have done any Doberman -proud. The startled cat fled in fear for its life. - As her grateful offspring flocked around her shouting "Oh, Mother, -you saved us!" and "Yay! You scared the cat away!" she turned to them -purposefully and declared, "You see how useful it is to know a second -language?" -% -A mother takes twenty years to make a man of her boy, -and another woman makes a fool of him in twenty minutes. - -- Frost -% -A motion to adjourn is always in order. -% -A mouse is a device used to point at the xterm you want to type in. -% -A mouse is an elephant built by the Japanese. -% -A mushroom cloud has no silver lining. -% -A musician, an artist, an architect: - the man or woman who is not one of these is not a Christian. - -- William Blake -% -A myth is a religion in which no-one any longer believes. - -- James Feibleman, "Understanding Philosophy" -% -A narcissist is someone better looking than you are. - -- Gore Vidal -% -A nasty looking dwarf throws a knife at you. -% -A national debt, if it is not excessive, -will be to us a national blessing. - -- Alexander Hamilton -% -A neighbor came to Nasrudin, asking to borrow his donkey. "It is out on -loan," the teacher replied. At that moment, the donkey brayed loudly inside -the stable. "But I can hear it bray, over there." "Whom do you believe," -asked Nasrudin, "me or a donkey?" -% -A new 'chutist had just jumped from the plane at 10,000 feet, and soon -discovered that all his lines were hopelessly tangled. At about 5,000 feet, -still struggling, he noticed someone coming up from the ground at about the -same speed as he was going towards the ground. As they passed each other at -3,000 feet, the 'chutist yells, "HEY! DO YOU KNOW ANYTHING ABOUT PARACHUTES?" - The reply came, fading towards the end, "NO! DO YOU KNOW ANYTHING -ABOUT COLEMAN STOVES?" -% -A new koan: - If you have some ice cream, I will give it to you. - If you have no ice cream, I will take it away from you. -It is an ice cream koan. -% -A new supply of round tuits has arrived and are available from Mary. -Anyone who has been putting off work until they got a `round tuit' -now has no excuse for further procrastination. -% -A new taste had been acquired and a new appetite began to grow. The time -had long since arrived to crush the technical intelligentsia, which had -come to regard itself as too irreplaceable and had not gotten used to -catching instructions on the wing. In other words, we never did trust -the engineers - and from the very first years of the Revolution we saw to -it that those lackeys and servants of former capitalist bosses were kept -in line by healthy suspicion and surveillance by the workers. - -- Aleksandr I. Solzhenitsyn, "The Gulag Archipelago" -% -A New Way of Taking Pills - A physician one night in Wisconsin being disturbed by a burglar, and -having no ball or shot for his pistol, noiselessly loaded the weapon with -small, hard pills, and gave the intruder a "prescription" which he thinks -will go far towards curing the rascal of a very bad ailment. - -- Nevada Morning Transcript, January 30, 1861 -% -A New York City ordinance prohibits the shooting of rabbits from the -rear of a Third Avenue street car -- if the car is in motion. -% -A newspaper is a circulating library with high blood pressure. - -- Arthure "Bugs" Baer -% -A nickel ain't worth a dime anymore. - -- Yogi Berra -% -A "No" uttered from deepest conviction is better and greater than a -"Yes" merely uttered to please, or what is worse, to avoid trouble. - -- Mahatma Gandhi -% -A novice of the temple once approached the Chief Priest with a question. - -"Master, does Emacs have the Buddha nature?" the novice asked. - -The Chief Priest had been in the temple for many years and could be -relied upon to know these things. He thought for several minutes -before replying. - -"I don't see why not. It's got bloody well everything else." - -With that, the Chief Priest went to lunch. The novice suddenly achieved -enlightenment, several years later. - -Commentary: - -His Master is kind, -Answering his FAQ quickly, -With thought and sarcasm. -% -A nuclear war can ruin your whole day. -% -A pain in the ass of major dimensions. - -- C. A. Desoer, on the solution of non-linear circuits -% -A Parable of Modern Research: - - Bob has lost his keys in a room which is dark except for one -brightly lit corner. - "Why are you looking under the light, you lost them in the dark!" - "I can only see here." -% -A paranoid is a man who knows a little of what's going on. - -- William S. Burroughs -% -A pedestal is as much a prison as any small, confined space. - -- Gloria Steinem -% -A pencil with no point needs no eraser. -% -A penny saved has not been spent. -% -A penny saved is a penny taxed. -% -A penny saved is ridiculous. -% -A penny saved kills your career in government. -% -A people living under the perpetual menace of war and invasion is very easy to -govern. It demands no social reforms. It does not haggle over expenditures -on armaments and military equipment. It pays without discussion, it ruins -itself, and that is an excellent thing for the syndicates of financiers and -manufacturers for whom patriotic terrors are an abundant source of gain. - -- Anatole France -% -A person forgives only when they are in the wrong. -% -A person is just about as big as the things that make him angry. -% -A person who has nothing looks at all there is and wants something. -A person who has something looks at all there is and wants all the rest. -% -A person who is more than casually interested in computers should be well -schooled in machine language, since it is a fundamental part of a computer. - -- Donald E. Knuth -% -A pessimist is a man who has been compelled to live with an optimist. - -- Elbert Hubbard -% -A physicist is an atom's way of knowing about atoms. - -- George Wald -% -A pickup with three guys in it pulls into the lumber yard. One of the men -gets out and goes into the office. - "I need some four-by-two's," he says. - "You must mean two-by-four's" replies the clerk. - The man scratches his head. "Wait a minute," he says, "I'll go -check." - Back, after an animated conversation with the other occupants of the -truck, he reassures the clerk, that, yes, in fact, two-by-fours would be -acceptable. - "OK," says the clerk, writing it down, "how long you want 'em?" - The guy gets the blank look again. "Uh... I guess I better go -check," he says. - He goes back out to the truck, and there's another animated -conversation. The guy comes back into the office. "A long time," he says, -"we're building a house". -% -A pig is a jolly companion, -Boar, sow, barrow, or gilt -- -A pig is a pal, who'll boost your morale, -Though mountains may topple and tilt. -When they've blackballed, bamboozled, and burned you, -When they've turned on you, Tory and Whig, -Though you may be thrown over by Tabby and Rover, -You'll never go wrong with a pig, a pig, -You'll never go wrong with a pig! - -- Thomas Pynchon, "Gravity's Rainbow" -% -A pipe gives a wise man time to think -and a fool something to stick in his mouth. -% -A place for everything and everything in its place. - -- Isabella Mary Beeton, "The Book of Household Management" - - [Quoted in "VMS Internals and Data Structures", V4.4, when - referring to memory management system services.] -% -A platitude is simply a truth repeated till people get tired of hearing it. - -- Stanley Baldwin -% -A plethora of individuals with expertise in culinary techniques -contaminate the potable concoction produced by steeping certain -edible nutriments. -% -A plucked goose doesn't lay golden eggs. -% -A poet who reads his verse in public may have other nasty habits. -% -A Polish worker walks into a bank to deposit his paycheck. He has heard -about Poland's economic problems, and he asks what would happen to his -money if the bank collapsed. "All of our deposits are guaranteed by the -finance ministry, sir," the teller replies. - "But what if the finance ministry goes broke?" the worker asks. - "Then the government will intercede to protect the working class," -the teller says. - "But what if the government goes broke?" the worker asks. - "Our socialist comrades in the Soviet Union naturally will come -to our assistance," the teller responds with growing irritation. - "And if the Soviet Union goes broke?" the worker asks. - "Idiot!" the teller snorts. "Isn't that worth losing one lousy -paycheck?" - -- Making the rounds in Warsaw, 1984 -% -A political man can have as his aim the realization of freedom, -but he has no means to realize it other than through violence. - -- Jean-Paul Sartre -% -A possum must be himself, and being himself he is honest. - -- Walt Kelly -% -A pound of salt will not sweeten a single cup of tea. -% -A power so great, it can only be used for Good or Evil! - -- The Firesign Theatre, "The Giant Rat of Sumatra" -% -A "practical joker" deserves applause for his wit according to its quality. -Bastinado is about right. For exceptional wit one might grant keelhauling. -But staking him out on an anthill should be reserved for the very wittiest. - -- Lazarus Long -% -A prediction is worth twenty explanations. - -- K. Brecher -% -A pretty foot is one of the greatest gifts of nature... please send me your -last pair of shoes, already worn out in dancing... so I can have something -of yours to press against my heart. - -- Johann Wolfgang von Goethe -% -A priest advised Voltaire on his death bed to renounce the devil. -Replied Voltaire, "This is no time to make new enemies." -% -A priest asked: What is Fate, Master? - -And he answered: - -It is that which gives a beast of burden its reason for existence. - -It is that which men in former times had to bear upon their backs. - -It is that which has caused nations to build byways from City to City -upon which carts and coaches pass, and alongside which inns have come -to be built to stave off Hunger, Thirst and Weariness. - -And that is Fate? said the priest. - -Fate ... I thought you said Freight, responded the Master. - -That's all right, said the priest. I wanted to know what Freight was -too. - -- Kehlog Albran, "The Profit" -% -A prig is a fellow who is always making you a present of his opinions. - -- George Eliot -% -A prisoner of war is a man who tries to kill you and fails, and then -asks you not to kill him. - -- Sir Winston Churchill, 1952 -% -A private sin is not so prejudicial in the world as a public indecency. - -- Miguel de Cervantes -% -A professor is one who talks in someone else's sleep. -% -A programmer is a person who passes as an exacting expert on the basis of -being able to turn out, after innumerable punching, an infinite series of -incomprehensible answers calculated with micrometric precisions from vague -assumptions based on debatable figures taken from inconclusive documents -and carried out on instruments of problematical accuracy by persons of -dubious reliability and questionable mentality for the avowed purpose of -annoying and confounding a hopelessly defenseless department that was -unfortunate enough to ask for the information in the first place. - -- IEEE Grid newsmagazine -% -A programming language is low level -when its programs require attention to the irrelevant. -% -A prohibitionist is the sort of man one wouldn't care to -drink with -- even if he drank. - -- H. L. Mencken -% -A prominent broadcaster, on a big-game safari in Africa, was taken to a -watering hole where the life of the jungle could be observed. As he -looked down from his tree platform and described the scene into his -tape recorder, he saw two gnus grazing peacefully. So preoccupied were -they that they failed to observe the approach of a pride of lions led -by two magnificent specimens, obviously the leaders. The lions charged, -killed the gnus, and dragged them into the bushes where their feasting -could not be seen. A little while later the two kings of the jungle -emerged and the radioman recorded on his tape: "Well, that's the end of -the gnus and here, once again, are the head lions." -% -A proper wife should be as obedient as a slave... The female is a female -by virtue of a certain lack of qualities -- a natural defectiveness. - -- Aristotle -% -A psychiatrist is a fellow who asks you a lot of expensive questions -your wife asks you for nothing. - -- Joey Adams -% -A psychiatrist is a person who will give you expensive answers that -your wife will give you for free. -% -A public debt is a kind of anchor in the storm; but if the anchor be -too heavy for the vessel, she will be sunk by that very weight which -was intended for her preservation. - -- Colton -% -A putt that stops close enough to the cup to inspire such comments as -"you could blow it in" may be blown in. This rule does not apply if -the ball is more than three inches from the hole, because no one wants -to make a travesty of the game. - -- Donald A. Metz -% -A raccoon tangled with a 23,000 volt line today. The results -blacked out 1400 homes and, of course, one raccoon. - -- Steel City News -% -A racially integrated community is a chronological term timed from the -entrance of the first black family to the exit of the last white family. - -- Saul Alinsky -% -A radioactive cat has eighteen half-lives. -% -A real diplomat is one who can cut his neighbor's throat without having -his neighbor notice it. - -- Trygve Lie -% -A real friend isn't someone you use once and then throw away. -A real friend is someone you can use over and over again. -% -A real gentleman never takes bases unless he really has to. - -- Overheard in an algebra lecture -% -A real patriot is the fellow who gets a parking -ticket and rejoices that the system works. -% -A recent study has found that concentrating on difficult off-screen -objects, such as the faces of loved ones, causes eye strain in computer -scientists. Researchers into the phenomenon cite the added concentration -needed to "make sense" of such unnatural three dimensional objects. -% -A regular expression goes into a pub with a friend, intending to -help him find a girl. However, when the cockney barman finds this -out, he says to it, "Ere! I'll have no pattern match-making in my -pub!" -% -A rich man told me recently that a liberal is a man who tells other -people what to do with their money. - -- Imamu Amiri Baraka (Leroi Jones) -% -A right is not what someone gives you; it's what no one can take from you. - -- Ramsey Clark -% -A Riverside, California, health ordinance states that two persons may -not kiss each other without first wiping their lips with carbolized -rosewater. -% -A robin redbreast in a cage -Puts all Heaven in a rage. - -- Blake -% -A rock pile ceases to be a rock pile the moment a single -man contemplates it, bearing within him the image of a cathedral. - -- Antoine de Saint-Exupery -% -A rolling disk gathers no MOS. -% -A rolling stone gathers momentum. -% -A rolling stone gathers no moss. - -- Publilius Syrus -% -A Roman divorced from his wife, being highly blamed by his friends, who -demanded, "Was she not chaste? Was she not fair? Was she not fruitful?" -holding out his shoe, asked them whether it was not new and well made. -Yet, added he, none of you can tell where it pinches me. - -- Plutarch -% -A rope lying over the top of a fence is the same length on each side. It -weighs one third of a pound per foot. On one end hangs a monkey holding a -banana, and on the other end a weight equal to the weight of the monkey. -The banana weighs two ounces per inch. The rope is as long (in feet) as -the age of the monkey (in years), and the weight of the monkey (in ounces) -is the same as the age of the monkey's mother. The combined age of the -monkey and its mother is thirty years. One half of the weight of the monkey, -plus the weight of the banana, is one forth as much as the weight of the -weight and the weight of the rope. The monkey's mother is half as old as -the monkey will be when it is three times as old as its mother was when she -was half as old as the monkey will be when it is as old as its mother -will be when she is four times as old as the monkey was when it was twice -as its mother was when she was one third as old as the monkey was when it -was old as is mother was when she was three times as old as the monkey was -when it was one fourth as old as it is now. How long is the banana? -% -A rose is a rose is a rose. Just ask Jean Marsh, known to millions of -PBS viewers in the '70s as Rose, the maid on the BBC export "Upstairs, -Downstairs." Though Marsh has since gone on to other projects, ... it's -with Rose she's forever identified. So much so that she even likes to -joke about having one named after her, a distinction not without its -drawbacks. "I was very flattered when I heard about it, but when I looked -up the official description, it said, `Jean Marsh: pale peach, not very -good in beds; better up against a wall.' I want to tell you that's not -true. I'm very good in beds as well." -% -A sad spectacle. If they be inhabited, what a scope for misery and folly. -If they be not inhabited, what a waste of space. - -- Thomas Carlyle, looking at the stars -% -A sadist is a masochist who follows the Golden Rule. -% -A salamander scurries into flame to be destroyed. -Imaginary creatures are trapped in birth on celluloid. - -- Genesis, "The Lamb Lies Down on Broadway" - -I don't know what it's about. I'm just the drummer. Ask Peter. - -- Phil Collins in 1975, when asked about the message behind - the previous year's Genesis release, "The Lamb Lies Down - on Broadway". -% -A Scholar asked his Master, "Master, would you advise me of a proper -vocation?" - The Master replied, "Some men can earn their keep with the power of -their minds. Others must use their strong backs, legs and hands. This is -the same in nature as it is with man. Some animals acquire their food easily, -such as rabbits, hogs and goats. Other animals must fiercely struggle for -their sustenance, like beavers, moles and ants. So you see, the nature of -the vocation must fit the individual. - "But I have no abilities, desires, or imagination, Master," the -scholar sobbed. - Queried the Master... "Have you thought of becoming a salesperson?" -% -A scientific truth does not triumph by convincing its opponents and -making them see the light, but rather because its opponents eventually -die and a new generation grows up that is familiar with it. - -- Max Planck -% -A sect or party is an elegant incognito devised to save a man from -the vexation of thinking. - -- Ralph Waldo Emerson, "Journals" (1831) -% -A sense of desolation and uncertainty, of futility, of the baselessness -of aspirations, of the vanity of endeavor, and a thirst for a life giving -water which seems suddenly to have failed, are the signs in consciousness -of this necessary reorganization of our lives. - -It is difficult to believe that this state of mind can be produced by the -recognition of such facts as that unsupported stones always fall to the -ground. - -- J. W. N. Sullivan -% -A sense of humor keen enough to show a man his own absurdities will keep -him from the commission of all sins, or nearly all, save those that are -worth committing. - -- Samuel Butler -% -A sequel is an admission that you've been reduced to imitating yourself. - -- Don Marquis -% -A Severe Strain on the Credulity - As a method of sending a missile to the higher, and even to the -highest parts of the earth's atmospheric envelope, Professor Goddard's rocket -is a practicable and therefore promising device. It is when one considers the -multiple-charge rocket as a traveler to the moon that one begins to doubt... -for after the rocket quits our air and really starts on its journey, its -flight would be neither accelerated nor maintained by the explosion of the -charges it then might have left. Professor Goddard, with his "chair" in -Clark College and countenancing of the Smithsonian Institution, does not -know the relation of action to re-action, and of the need to have something -better than a vacuum against which to react... Of course he only seems to -lack the knowledge ladled out daily in high schools. - -- New York Times Editorial, 1920 -% -A sharper perspective on this matter is particularly important to feminist -thought today, because a major tendency in feminism has constructed the -problem of domination as a drama of female vulnerability victimized by male -aggression. Even the more sophisticated feminist thinkers frequently shy -away from the analysis of submission, for fear that in admitting woman's -participation in the relationship of domination, the onus of responsibility -will appear to shift from men to women, and the moral victory from women to -men. More generally, this has been a weakness of radical politics: to -idealize the oppressed, as if their politics and culture were untouched by -the system of domination, as if people did not participate in their own -submission. To reduce domination to a simple relation of doer and done-to -is to substitute moral outrage for analysis. - -- Jessica Benjamin, "The Bonds of Love" -% -A sine curve goes off to infinity, or at least the end of the blackboard. - -- Prof. Steiner -% -A single death is a tragedy, a million deaths is a statistic. - -- Joseph Stalin -% -A single flow'r he sent me, since we met. -All tenderly his messenger he chose; -Deep-hearted, pure, with scented dew still wet-- -One perfect rose. - -I knew the language of the floweret; -"My fragile leaves," it said, "his heart enclose." -Love long has taken for his amulet -One perfect rose. - -Why is it no one ever sent me yet -One perfect limousine, do you suppose? -Ah no, it's always just my luck to get -One perfect rose. - -- Dorothy Parker, "One Perfect Rose" -% -A sinking ship gathers no moss. - -- Donald Kaul -% -A small town that cannot support one lawyer can always support two. -% -A Smith & Wesson beats four aces. -% -A snake lurks in the grass. - -- Publius Vergilius Maro (Virgil) -% -A social scientist, studying the culture and traditions of a small North -African tribe, found a woman still practicing the ancient art of matchmaking. -Locally, she was known as the Moor, the marrier. -% -A society in which women are taught anything but the management of a family, -the care of men, and the creation of the future generation is a society -which is on its way out. - -- L. Ron Hubbard -% -A soft answer turneth away wrath; but grievous words stir up anger. - -- Proverbs 15:1 -% -A soft drink turneth away company. -% -A song in time is worth a dime. -% -A Southern boy graduates from high school heads north to college, taking the -family dog, Old Blue with him, for company. He's only been there a few weeks -when he gets a call from his girlfriend; seems like they've got a problem, -and she needs a thousand dollars to take care of it. The boy calls his folks: - "How are you?" they ask. - "Oh, I'm fine," he says. - "And how," they ask, "is Old Blue?" - "Well, he's kind of depressed. You see, there's this lady up here -that teaches dogs to talk, and Ol' Blue is feelin' kind of left out 'cause -he's the only dog that doesn't know how to talk. She charges a thousand -dollars." - The parents send the boy the thousand dollars, he forwards it to Mary -Lou, and everything's fine until Christmas vacation. The boy leaves Ol' Blue -at his dorm, 'cause he just can't figure out what to tell his parents. Sure -enough, when he gets home, the first thing his father wants to know is -"Where's Old Blue?" - "Well, Pa," says the boy. "I was driving on home and Old Blue was -talking away about this and that when we passed the Buford's farm. Old Blue, -well, he said, `Say, what do you think your mother would do if I told her -that your father's been comin' over here and seeing Mrs. Buford all these -years?'" - The father looks at his son -- "You shot that dog, didn't you, boy?" -% -A squeegee by any other name wouldn't sound as funny. -% -A statesman is a politician who's been dead 10 or 15 years. - -- Harry S. Truman -% -A statistician, who refused to fly after reading of the alarmingly high -probability that there will be a bomb on any given plane, realized that -the probability of there being two bombs on any given flight is very low. -Now, whenever he flies, he carries a bomb with him. -% -A stitch in time saves nine. -% -A straw vote only shows which way the hot air blows. - -- O'Henry -% -A strong conviction that something must be done is the parent of many -bad measures. - -- Daniel Webster -% -A student, in hopes of understanding the Lambda-nature, came to Greenblatt. -As they spoke a Multics system hacker walked by. "Is it true", asked the -student, "that PL-1 has many of the same data types as Lisp?" Almost before -the student had finished his question, Greenblatt shouted, "FOO!", and hit -the student with a stick. -% -A student who changes the course of history is probably taking an exam. -% -A successful [software] tool is one that was used to do something -undreamed of by its author. - -- S. C. Johnson -% -A synonym is a word you use when you can't spell the word you first -thought of. - -- Burt Bacharach -% -A system admin's life is a sorry one. The only advantage he has over -Emergency Room doctors is that malpractice suits are rare. On the -other hand, ER doctors never have to deal with patients installing -new versions of their own innards! - -- Michael O'Brien -% -A Tale of Two Cities LITE(tm) - -- by Charles Dickens - - A lawyer who looks like a French Nobleman is executed in his place. - -The Metamorphosis LITE(tm) - -- by Franz Kafka - - A man turns into a bug and his family gets annoyed. - -Lord of the Rings LITE(tm) - -- by J. R. R. Tolkien - - Some guys take a long vacation to throw a ring into a volcano. - -Hamlet LITE(tm) - -- by William Shakespeare - - A college student on vacation with family problems, a screwy - girl-friend and a mother who won't act her age. -% -A Tale of Two Cities LITE(tm) - -- by Charles Dickens - - A man in love with a girl who loves another man who looks just - like him has his head chopped off in France because of a mean - lady who knits. - -Crime and Punishment LITE(tm) - -- by Fyodor Dostoyevsky - - A man sends a nasty letter to a pawnbroker, but later - feels guilty and apologizes. - -The Odyssey LITE(tm) - -- by Homer - - After working late, a valiant warrior gets lost on his way home. -% -A tall, dark stranger will have more fun than you. -% -A tautology is a thing which is tautological. -% -A team effort is a lot of people doing what I say. - -- Michael Winner, British film director -% -A Texan, impressing the hell out of a Bostonian with tales about the heroes -of the Alamo, commented, "I'll bet you never had anyone that brave around -*Boston*." - "Ever hear of Paul Revere?", snarled the Bostonian. - "Paul Revere?", pondered the Texan. "Isn't he the guy who ran for -help?" -% -A thing is not necessarily true because a man dies for it. - -- Oscar Wilde, "The Portrait of Mr. W. H." -% -A timely marriage: one made before your children start nagging you about it. - -- Diane Duane -% -A total abstainer is one who abstains from everything but abstention, -and especially from inactivity in the affairs of others. - -- Ambrose Bierce, "The Devil's Dictionary" -% -A transistor protected by a fast-acting -fuse will protect the fuse by blowing first. -% -A traveling salesman was driving past a farm when he saw a pig with three -wooden legs executing a magnificent series of backflips and cartwheels. -Intrigued, he drove up to the farmhouse, where he found an old farmer -sitting in the yard watching the pig. - "That's quite a pig you have there, sir" said the salesman. - "Sure is, son," the farmer replied. "Why, two years ago, my daughter -was swimming in the lake and bumped her head and damned near drowned, but that -pig swam out and dragged her back to shore." - "Amazing!" the salesman exclaimed. - "And that's not the only thing. Last fall I was cuttin' wood up on -the north forty when a tree fell on me. Pinned me to the ground, it did. -That pig run up and wiggled underneath that tree and lifted it off of me. -Saved my life." - "Fantastic! the salesman said. But tell me, how come the pig has -three wooden legs?" - The farmer stared at the newcomer in amazement. "Mister, when you -got an amazin' pig like that, you don't eat him all at once." -% -A triangle which has an angle of 135 degrees is called an obscene -triangle. -% -A true artist will let his wife starve, his children go barefoot, his mother -drudge for his living at seventy, sooner than work at anything but his art. - -- Shaw -% -A truly great man will neither trample on a worm nor sneak to an emperor. - -- Benjamin Franklin -% -A truly wise man never plays leapfrog with a unicorn. -% -A truly wise woman never plays leapfrog with a unicorn. -% -A truth that's told with bad intent -Beats all the lies you can invent. - -- William Blake -% -A university is what a college becomes -when the faculty loses interest in students. - -- John Ciardi -% -A University without students is like an ointment without a fly. - -- Ed Nather, professor of astronomy at UT Austin -% -A UNIX saleslady, Lenore, -Enjoys work, but she likes the beach more. - She found a good way - To combine work and play: -She sells C shells by the seashore. -% -A vacuum is a hell of a lot better -than some of the stuff that nature replaces it with. - -- Tennessee Williams -% -A verbal contract isn't worth the paper it's written on. - -- Samuel Goldwyn -% -A violent man will die a violent death. - -- Lao Tsu -% -A visit to a fresh place will bring strange work. -% -A visit to a strange place will bring fresh work. -% -A vivid and creative mind characterizes you. -% -A waist is a terrible thing to mind. - -- Ziggy -% -A watched clock never boils. -% -A well adjusted person is one who makes -the same mistake twice without getting nervous. -% -A well-known friend is a treasure. -% -A well-used door needs no oil on its hinges. -A swift-flowing stream does not grow stagnant. -Neither sound nor thoughts can travel through a vacuum. -Software rots if not used. - -These are great mysteries. - -- Geoffrey James, "The Tao of Programming" -% -A wise man can see more from a mountain top -than a fool can from the bottom of a well. -% -A wise man can see more from the bottom -of a well than a fool can from a mountain top. -% -A wise person makes his own decisions, a weak one obeys public opinion. - -- Chinese proverb -% -A witty saying proves nothing. - -- Voltaire -% -A witty saying proves nothing, but saying something pointless gets -people's attention. -% -A wizard cannot do everything; a fact most magicians are reticent to admit, -let alone discuss with prospective clients. Still, the fact remains that -there are certain objects, and people, that are, for one reason or another, -completely immune to any direct magical spell. It is for this group of -beings that the magician learns the subtleties of using indirect spells. -It also does no harm, in dealing with these matters, to carry a large club -near your person at all times. - -- The Teachings of Ebenezum, Volume VIII -% -A woman can look both moral and exciting -- if she also looks as if it -were quite a struggle. - -- Edna Ferber -% -A woman did what a woman had to, the best way she knew how. -To do more was impossible, to do less, unthinkable. - -- Dirisha, "The Man Who Never Missed" -% -A woman, especially if she have the misfortune -of knowing anything, should conceal it as well as she can. - -- Jane Austen -% -A woman is like your shadow; follow her, she flies; fly from her, -she follows. - -- Chamfort -% -A woman may very well form a friendship with a man, but for this to endure, -it must be assisted by a little physical antipathy. - -- Friedrich Nietzsche -% -A woman must be a cute, cuddly, naive little thing -- tender, sweet, -and stupid. - -- Adolf Hitler -% -A woman physician has made the statement that smoking is neither -physically defective nor morally degrading, and that nicotine, even -when indulged to in excess, is less harmful than excessive petting." - -- Purdue Exponent, Jan 16, 1925 -% -A woman shouldn't have to buy her own perfume. - -- Maurine Lewis -% -A woman went into a hospital one day to give birth. Afterwards, the doctor -came to her and said, "I have some... odd news for you." - "Is my baby all right?" the woman anxiously asked. - "Yes, he is," the doctor replied, "but we don't know how. Your son -(we assume) was born with no body. He only has a head." - Well, the doctor was correct. The Head was alive and well, though no -one knew how. The Head turned out to be fairly normal, ignoring his lack of -a body, and lived for some time as typical a life as could be expected under -the circumstances. - One day, about twenty years after the fateful birth, the woman got a -phone call from another doctor. The doctor said, "I have recently perfected -an operation. Your son can live a normal life now: we can graft a body onto -his head!" - The woman, practically weeping with joy, thanked the doctor and hung -up. She ran up the stairs saying, "Johnny, Johnny, I have a *wonderful* -surprise for you!" - "Oh no," cried The Head, "not another HAT!" -% -A woman without a man is like a fish without a bicycle. - -- Gloria Steinem -% -A woman without a man is like a fish without a bicycle. -Therefore, a man without a woman is like a bicycle without a fish. -% -A woman's best protection is a little money of her own. - -- Clare Booth Luce, quoted in "The Wit of Women" -% -A woman's place is in the house... and in the Senate. -% -A word to the wise is enough. - -- Miguel de Cervantes -% -A would-be disciple came to Nasrudin's hut on the mountain-side. Knowing -that every action of such an enlightened one is significant, the seeker -watched the teacher closely. "Why do you blow on your hands?" "To warm -myself in the cold." Later, Nasrudin poured bowls of hot soup for himself -and the newcomer, and blew on his own. "Why are you doing that, Master?" -"To cool the soup." Unable to trust a man who uses the same process -to arrive at two different results -- hot and cold -- the disciple departed. -% -A writer is congenitally unable to tell the truth and that is why we call -what he writes fiction. - -- William Faulkner -% -A yawn is a silent shout. - -- G. K. Chesterton -% -A year spent in Artificial Intelligence is enough to make one believe in God. -% -A young girl once committed suicide because her mother refused her a new -bonnet. Coroner's verdict: "Death from excessive spunk." - -- Sacramento Daily Union, September 13, 1860 -% -A young man and his girlfriend were walking along Main Street when she spotted -a beautiful diamond ring in a jewelry-store window. "Wow, I'd sure love to -have that!" she gushed. - "No problem," her companion replied, throwing a brick through the -window and grabbing the ring. - A few blocks later, the woman admired a full-length sable coat. "What -I'd give to own that," she said, sighing. - "No problem," he said, throwing a brick through the window and grabbing -the coat. - Finally, turning for home, they passed a car dealership. "Boy, I'd do -anything for one of those Rolls-Royces," she said. - "Jeez, baby," the guy moaned, "you think I'm made of bricks?" -% -A young man enters the New York branch of Tiffany's on a Friday evening and -walks up to a display case full of pearl necklaces. He turns to a gorgeous -woman, who is obviously window shopping, looks her straight in the eye and -says, "I can tell by your eyes that you really want that necklace. If you'll -allow me, I'd like to buy it for you." - The woman looks him up and down; he's wearing a nice suit and some -pretty nice jewelry, but she has trouble believing this story. - "Look, this is some kind of put on, right?" - "No, really. You see, I've got quite a lot of money -- so much that -I could never spend it all. I'd really like for you to have it." - The guys whips out his checkbook, writes a check for five figures, -calls over a clerk and hands it to him. The clerk peers at the check, looks -at the young man, looks at the check again. "Very good, sir. I'm afraid I -can't release the necklace immediately, would Monday be all right?" - "That'll be fine, she'll pick it up." the man replies, and walks out -of the store with the woman following him in a daze. - The next Monday the man comes back in and walks up to the counter. -The same clerk hurries over to him and says, "Sir, I'm sorry to have to tell -you this, but your check was returned for insufficient funds." - "I know," the man replies. "I just wanted to thank you for a -terrific weekend." -% -A young man wrote to Mozart and said: - -Q: "Herr Mozart, I am thinking of writing symphonies. Can you give me any - suggestions as to how to get started?" -A: "A symphony is a very complex musical form, perhaps you should begin with - some simple lieder and work your way up to a symphony." -Q: "But Herr Mozart, you were writing symphonies when you were 8 years old." -A: "But I never asked anybody how." -% -AAAAAAAAAAAaaaaaaaaaaaaaaaccccccccckkkkkk!!!!!!!!! -You brute! Knock before entering a ladies room! -% -Abandon the search for Truth; settle for a good fantasy. -% -Abbott's Admonitions: - 1: If you have to ask, you're not entitled to know. - 2: If you don't like the answer, you shouldn't have asked - the question. - -- Charles Abbot, dean, University of Virginia -% -Aberdeen was so small that when the family with the car went -on vacation, the gas station and drive-in theatre had to close. -% -Abou Ben Adhem (may his tribe increase!) -Awoke one night from a deep dream of peace, -And saw, within the moonlight in his room, -Making it rich, and like a lily in bloom, -An angel writing in a book of gold. -Exceeding peace had made Ben Adhem bold, -And to the presence in the room he said, -"What writest thou?" The vision raised its head, -And with a look made of all sweet accord, -Answered, "The names of those who love the Lord." -"And is mine one?" said Abou. "Nay not so," -Replied the angel. Abou spoke more low, -But cheerly still; and said, "I pray thee then, -Write me as one that loves his fellow-men." -The angel wrote, and vanished. The next night -It came again with a great wakening light, -And showed the names whom love of God had blessed, -And lo! Ben Adhem's name led all the rest. - -- James Henry Leigh Hunt, "Abou Ben Adhem" -% -About all some men accomplish in life is to send a son to Harvard. -% -About the only thing on a farm that has an easy time is the dog. -% -About the only thing we have left that actually -discriminates in favor of the plain people is the stork. -% -About the time we think we can make ends meet, somebody moves the ends. - -- Herbert Hoover -% -About the use of language: it is impossible to sharpen a pencil with a blunt -ax. It is equally vain to try to do it with ten blunt axes instead. - -- Edsger W. Dijkstra -% -Above all else - sky. -% -Above all things, reverence yourself. -% -Abraham Lincoln didn't die in vain. He died in Washington, D.C. -% -Abscond, v.: - To be unexpectedly called away to the bedside of a dying relative - and miss the return train. -% -Absence diminishes mediocre passions and increases -great ones, as the wind blows out candles and fans fires. - -- Francois de La Rochefoucauld -% -Absence in love is like water upon fire; -a little quickens, but much extinguishes it. - -- Hannah More -% -Absence is to love what wind is to fire. It extinguishes the small, -it enkindles the great. -% -Absence makes the heart forget. -% -Absence makes the heart go wander. -% -Absence makes the heart grow fonder. - -- Sextus Aurelius -% -Absence makes the heart grow fonder -- of somebody else. -% -Absence makes the heart grow frantic. -% -Absent, adj.: - Exposed to the attacks of friends and acquaintances; defamed; -slandered. -% -Absentee, n.: - A person with an income who has had the forethought - to remove himself from the sphere of exaction. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Absolutum obsoletum. (If it works, it's out of date.) - -- Stafford Beer -% -Abstainer, n.: - A weak person who yields to the - temptation of denying himself a pleasure. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Abstract: - This study examined the incidence of neckwear tightness among a group -of 94 white-collar working men and the effect of a tight business-shirt collar -and tie on the visual performance of 22 male subjects. Of the white-collar -men measured, 67% were found to be wearing neckwear that was tighter than -their neck circumference. The visual discrimination of the 22 subjects was -evaluated using a critical flicker frequency (CFF) test. Results of the CFF -test indicated that tight neckwear significantly decreased the visual -performance of the subjects and that visual performance did not improve -immediately when tight neckwear was removed. - -- Langan, L. M. and Watkins, S. M. "Pressure of Menswear on the - Neck in Relation to Visual Performance." Human Factors 29, - #1 (Feb. 1987), pp. 67-71. -% -Absurdity, n.: - A statement or belief manifestly - inconsistent with one's own opinion. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Academic politics is the most vicious and bitter form of politics, -because the stakes are so low. - -- Wallace Sayre -% -Academicians care, that's who. -% -ACADEMY: - A modern school where football is taught. -INSTITUTE: - An archaic school where football is not taught. -% -Accent on helpful side of your nature. Drain the moat. -% -Accept people for what they are -- completely unacceptable. -% -ACCEPTANCE TESTING: - An unsuccessful attempt to find bugs. -% -Accident, n.: - A condition in which presence of mind is good, - but absence of body is better. - -- Foolish Dictionary -% -Accidentally Shot - Colonel Gray, of Petaluma, came near losing his life a few days ago, -in a singular manner. A gentleman with whom he was hunting attempted to -bring down a dove, but instead of doing so put the load of shot through the -Colonel's hat. One shot took effect in his forehead. - -- Sacramento Daily Union, April 20, 1861 -% -Accidents cause History. - -If Sigismund Unbuckle had taken a walk in 1426 and met Wat Tyler, the -Peasant's Revolt would never have happened and the motor car would not -have been invented until 2026, which would have meant that all the oil -could have been used for lamps, thus saving the electric light bulb and -the whale, and nobody would have caught Moby Dick or Billy Budd. - -- Mike Harding, "The Armchair Anarchist's Almanac" -% -According to a recent and unscientific national survey, smiling is something -everyone should do at least 6 times a day. In an effort to increase the -national average (the US ranks third among the world's superpowers in -smiling), Xerox has instructed all personnel to be happy, effervescent, and -most importantly, to smile. Xerox employees agree, and even feel strongly -that they can not only meet but surpass the national average... except for -Tubby Ackerman. But because Tubby does such a fine job of racing around -parking lots with a large butterfly net retrieving floating IC chips, Xerox -decided to give him a break. If you see Tubby in a parking lot he may have -a sheepish grin. This is where the expression, "Service with a slightly -sheepish grin" comes from. -% -According to all the latest reports, -there was no truth in any of the earlier reports. -% -According to Arkansas law, Section 4761, Pope's Digest: "No person -shall be permitted under any pretext whatever, to come nearer than -fifty feet of any door or window of any polling room, from the opening -of the polls until the completion of the count and the certification of -the returns." -% -According to convention there is a sweet and a bitter, a hot and a cold, -and according to convention, there is an order. In truth, there are atoms -and a void. - -- Democritus, 400 B.C. -% -According to my best recollection, I don't remember. - -- Vincent "Jimmy Blue Eyes" Alo -% -According to the latest official figures, -43% of all statistics are totally worthless. -% -According to the obituary notices, a mean and unimportant person never -dies. -% -According to the Rand McNally Places-Rated Almanac, the best place to live in -America is the city of Pittsburgh. The city of New York came in twenty-fifth. -Here in New York we really don't care too much. Because we know that we could -beat up their city anytime. - -- David Letterman -% -Accordion, n.: - A bagpipe with pleats. -% -Accuracy, n.: - The vice of being right. -% -Acid -- better living through chemistry. -% -Acid absorbs 47 times its own weight in excess Reality. -% -Acquaintance, n.: - A person whom we know well enough to borrow from but not well - enough to lend to. A degree of friendship called slight when the - object is poor or obscure, and intimate when he is rich or famous. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Acting is an art which consists of keeping the audience from coughing. -% -Acting is not very hard. The most important things are to be able to laugh -and cry. If I have to cry, I think of my sex life. And if I have to laugh, -well, I think of my sex life. - -- Glenda Jackson -% -Actor Real Name - -Boris Karloff William Henry Pratt -Cary Grant Archibald Leach -Edward G. Robinson Emmanual Goldenburg -Gene Wilder Gerald Silberman -John Wayne Marion Morrison -Kirk Douglas Issur Danielovitch -Richard Burton Richard Jenkins, Jr. -Roy Rogers Leonard Slye -Woody Allen Allen Stewart Konigsberg -% -Actor: "I'm a smash hit. Why, yesterday during the last act, I had - everyone glued in their seats!" -Oliver Herford: "Wonderful! Wonderful! Clever of you to think of - it!" -% -Actor: So what do you do for a living? -Doris: I work for a company that makes deceptively shallow serving - dishes for Chinese restaurants. - -- Woody Allen, "Without Feathers" -% -Actors will happen even in the best-regulated families. -% -Actresses will happen in the best regulated families. - -- Addison Mizner and Oliver Herford, - "The Entirely New Cynic's Calendar", 1905 -% -Actually, my goal is to have a sandwich named after me. -% -Actually, the probability is 100% that the elevator -will be going in the right direction. Proof by induction: - -N=1. Trivially true, since both you and the elevator - only have one floor to go to. - -Assume true for N, prove for N+1: - If you are on any of the first N floors, then it is true by the - induction hypothesis. If you are on the N+1st floor, then both you - and the elevator have only one choice, namely down. Therefore, - it is true for all N+1 floors. -QED. -% -Ad astra per aspera. (To the stars by aspiration.) -% -ADA: - Something you need only know the name of to be an Expert in - Computing. Useful in sentences like, "We had better develop - an ADA awareness. - -- "Datamation", January 15, 1984 -% -Adde parvum parvo manus acervus erit. -[Add little to little and there will be a big pile.] - -- Ovid -% -Adding features does not necessarily increase -functionality -- it just makes the manuals thicker. -% -Adding manpower to a late software project makes it later. - -- Frederick Brooks, Jr., "The Mythical Man-Month" - -Whenever one person is found adequate to the discharge of a duty by -close application thereto, it is worse execute by two persons and -scarcely done at all if three or more are employed therein. - -- George Washington (1732-1799) -% -Adding sound to movies would be like -putting lipstick on the Venus de Milo. - -- Mary Pickford, actress, 1925 -% -Adhere to your own act, and congratulate yourself if you have done -something strange and extravagant, and broken the monotony of a -decorous age. - -- Ralph Waldo Emerson -% -Adler's Distinction: - Language is all that separates us from the lower animals, - and from the bureaucrats. -% -Admiration, n.: - Our polite recognition of another's resemblance to ourselves. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Adolescence, n.: - The stage between puberty and adultery. -% -Adopted kids are such a pain -- you have to teach them how to look -like you ... - -- Gilda Radner -% -Adore, v.: - To venerate expectantly. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Adult, n.: - One old enough to know better. -% -Adults die young. -% -Advancement in position. -% -Advertisements contain the only -truths to be relied on in a newspaper. - -- Thomas Jefferson -% -Advertising is a valuable economic factor because it is the cheapest -way of selling goods, particularly if the goods are worthless. - -- Sinclair Lewis -% -Advertising is the rattling of a stick inside a swill bucket. - -- George Orwell -% -Advertising may be described as the science of arresting the human -intelligence long enough to get money from it. -% -Advertising Rule: - In writing a patent-medicine advertisement, first convince the - reader that he has the disease he is reading about; secondly, - that it is curable. -% -Advice from an old carpenter: measure twice, saw once. -% -Advice is a dangerous gift; be cautious about giving and receiving it. -% -Advice to young men: Be ascetic, and if you can't be ascetic, -then at least be aseptic. -% -African violet: Such worth is rare -Apple blossom: Preference -Bachelor's button: Celibacy -Bay leaf: I change but in death -Camellia: Reflected loveliness -Chrysanthemum, red: I love -Chrysanthemum, white: Truth -Chrysanthemum, other: Slighted love -Clover: Be mine -Crocus: Abuse not -Daffodil: Innocence -Forget-me-not: True love -Fuchsia: Fast -Gardenia: Secret, untold love -Honeysuckle: Bonds of love -Ivy: Friendship, fidelity, marriage -Jasmine: Amiability, transports of joy, sensuality -Leaves (dead): Melancholy -Lilac: Youthful innocence -Lily: Purity, sweetness -Lily of the valley: Return of happiness -Magnolia: Dignity, perseverance - * An upside-down blossom reverses the meaning. -% -After 35 years, I have finished a comprehensive study of European -comparative law. In Germany, under the law, everything is prohibited, -except that which is permitted. In France, under the law, everything -is permitted, except that which is prohibited. In the Soviet Union, -under the law, everything is prohibited, including that which is -permitted. And in Italy, under the law, everything is permitted, -especially that which is prohibited. - -- Newton Minow, 1985, - Speech to the Association of American Law Schools -% -After a few boring years, socially meaningful rock 'n' roll died out. -It was replaced by disco, which offers no guidance to any form of life -more advanced than the lichen family. - -- Dave Barry, "Kids Today: They Don't Know Dum Diddly Do" -% -After a number of decimal places, nobody gives a damn. -% -After a while you learn the subtle difference -Between holding a hand and chaining a soul, -And you learn that love doesn't mean security, -And you begin to learn that kisses aren't contracts -And presents aren't promises -And you begin to accept your defeats -With your head up and your eyes open, -With the grace of a woman, not the grief of a child, -And you learn to build all your roads -On today because tomorrow's ground -Is too uncertain. And futures have -A way of falling down in midflight, -After a while you learn that even sunshine burns if you get too much. -So you plant your own garden and decorate your own soul, instead of waiting -For someone to bring you flowers. -And you learn that you really can endure... -That you really are strong, -And you really do have worth -And you learn and learn -With every goodbye you learn. - -- Veronic Shoffstall, "Comes the Dawn" -% -After all, all he did was string together -a lot of old, well-known quotations. - -- H. L. Mencken, on Shakespeare -% -After all is said and done, a hell of a lot more is said than done. -% -After all, it is only the mediocre who are always at their best. - -- Jean Giraudoux -% -After all my erstwhile dear, -My no longer cherished, -Need we say it was not love, -Just because it perished? - -- Edna St. Vincent Millay -% -After all, what is your hosts' purpose in having a party? Surely not for -you to enjoy yourself; if that were their sole purpose, they'd have simply -sent champagne and women over to your place by taxi. - -- P. J. O'Rourke -% -After an instrument has been assembled, -extra components will be found on the bench. -% -After any salary raise, you will have less money at the end of the -month than you did before. -% -After [Benjamin] Franklin came a herd of Electrical Pioneers whose names -have become part of our electrical terminology: Myron Volt, Mary Louise Amp, -James Watt, Bob Transformer, etc. These pioneers conducted many important -electrical experiments. For example, in 1780 Luigi Galvani discovered (this -is the truth) that when he attached two different kinds of metal to the leg -of a frog, an electrical current developed and the frog's leg kicked, even -though it was no longer attached to the frog, which was dead anyway. -Galvani's discovery led to enormous advances in the field of amphibian -medicine. Today, skilled veterinary surgeons can take a frog that has been -seriously injured or killed, implant pieces of metal in its muscles, and -watch it hop back into the pond just like a normal frog, except for the fact -that it sinks like a stone. - -- Dave Barry, "What is Electricity?" -% -After his legs had been broken in an accident, Mr. Miller sued for damages, -claiming that he was crippled and would have to spend the rest of his life -in a wheelchair. Although the insurance-company doctor testified that his -bones had healed properly and that he was fully capable of walking, the -judge decided for the plaintiff and awarded him $500,000. - When he was wheeled into the insurance office to collect his check, -Miller was confronted by several executives. "You're not getting away with -this, Miller," one said. "We're going to watch you day and night. If you -take a single step, you'll not only repay the damages but stand trial for -perjury. Here's the money. What do you intend to do with it?" - "My wife and I are going to travel," Miller replied. "We'll go to -Stockholm, Berlin, Rome, Athens and, finally, to a place called Lourdes -- -where, gentlemen, you'll see yourselves one hell of a miracle." -% -After I asked him what he meant, he replied that freedom consisted of -the unimpeded right to get rich, to use his ability, no matter what the -cost to others, to win advancement. - -- Norman Thomas -% -After living in New York, you trust nobody, -but you believe everything. Just in case. -% -...[after the announcement of Vanguard] ... Secretary of Defense Charles -Wilson (the same "Engine Charlie" who once told the Senate, "[F]or years -I've thought that what was good for our country was good for General Motors, -and vice versa," probably an accurate analysis) was asked whether the -Russians might beat the Americans into orbit. "I wouldn't care if they -did," he responded. (It was later claimed that Wilson favored the -development of the automatic transmission so that he could drive with -one foot in his mouth.) - -- Smithsonian's Air&Space Magazine, "The Day the Rocket Died" -% -After the game the king and the pawn go in the same box. - -- Italian proverb -% -After the ground war began, captured Iraqi soldiers said any of them caught -by superiors wearing a white T-shirt would be executed because of the ease -with which the shirts could be used as surrender flags. Some Iraqi soldiers -carried bleach with them to make their dark shirts white. - -- Chuck Shepherd, Funny Times, May 1991 -% -After the last of 16 mounting screws has been removed from an access -cover, it will be discovered that the wrong access cover has been removed. -% -After this was written there appeared a remarkable posthumous memoir that -throws some doubt on Millikan's leading role in these experiments. Harvey -Fletcher (1884-1981), who was a graduate student at the University of Chicago, -at Millikan's suggestion worked on the measurement of electronic charge for -his doctoral thesis, and co-authored some of the early papers on this subject -with Millikan. Fletcher left a manuscript with a friend with instructions -that it be published after his death; the manuscript was published in -Physics Today, June 1982, page 43. In it, Fletcher claims that he was the -first to do the experiment with oil drops, was the first to measure charges on -single droplets, and may have been the first to suggest the use of oil. -According to Fletcher, he had expected to be co-authored with Millikan on -the crucial first article announcing the measurement of the electronic -charge, but was talked out of this by Millikan. - -- Steven Weinberg, "The Discovery of Subatomic Particles" - -Robert Millikan is generally credited with making the first really -precise measurement of the charge on an electron and was awarded the -Nobel Prize in 1923. -% -After two or three weeks of this madness, you begin to feel As One with -the man who said, "No news is good news." In twenty-eight papers, only -the rarest kind of luck will turn up more than two or three articles of -any interest... but even then the interest items are usually buried -deep around paragraph 16 on the jump (or "Cont. on ...") page... - -The Post will have a story about Muskie making a speech in Iowa. The -Star will say the same thing, and the Journal will say nothing at all. -But the Times might have enough room on the jump page to include a line -or so that says something like: "When he finished his speech, Muskie -burst into tears and seized his campaign manager by the side of the -neck. They grappled briefly, but the struggle was kicked apart by an -oriental woman who seemed to be in control." - -Now that's good journalism. Totally objective; very active and -straight to the point. - -- Hunter S. Thompson, "Fear and Loathing '72" -% -After years of research, scientists recently reported that there is, -indeed, arroz in Spanish Harlem. -% -After your lover has gone you will still have PEANUT BUTTER! -% -Afternoon, n.: - That part of the day we spend worrying about how we wasted the -morning. -% -Afternoon very favorable for romance. Try a single person for a change. -% -Against Idleness and Mischief - -How doth the little busy bee How skillfully she builds her cell! -Improve each shining hour, How neat she spreads the wax! -And gather honey all the day And labours hard to store it well -From every opening flower! With the sweet food she makes. - -In works of labour or of skill In books, or work, or healthful play, -I would be busy too; Let my first years be passed, -For Satan finds some mischief still That I may give for every day -For idle hands to do. Some good account at last. - -- Isaac Watts (1674-1748) -% -Against stupidity the very gods Themselves contend in vain. - -- Friedrich von Schiller, "The Maid of Orleans", III, 6 -% -Age and treachery will always overcome youth and skill. -% -Age before beauty; and pearls before swine. - -- Dorothy Parker -% -Age is a tyrant who forbids, -at the penalty of life, all the pleasures of youth. -% -Age, n.: - That period of life in which we compound for the vices that we - still cherish by reviling those that we no longer have the - enterprise to commit. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Agnes' Law: - Almost everything in life is easier to get into than out of. -% -Agree with them now, it will save so much time. -% -Ah, but a man's grasp should exceed his reach, -Or what's a heaven for ? - -- Robert Browning, "Andrea del Sarto" -% -Ah, but the choice of dreams to live, -there's the rub. - -For all dreams are not equal, -some exit to nightmare -most end with the dreamer - -But at least one must be lived ... and died. -% -Ah, my friends, from the prison, they ask unto me, -"How good, how good does it feel to be free?" -And I answer them most mysteriously: -"Are birds free from the chains of the sky-way?" - -- Bob Dylan -% -Ah say, son, you're about as sharp as a bowlin' ball. -% -Ah, sweet Springtime, when a young man lightly turns his fancy over! -% -Ah, the Tsar's bazaar's bizarre beaux-arts! -% -"Ah, you know the type. They like to blame it all on the Jews or the -Blacks, 'cause if they couldn't, they'd have to wake up to the fact -that life's one big, scary, glorious, complex and ultimately -unfathomable crapshoot -- and the only reason THEY can't seem to keep -up is they're a bunch of misfits and losers." - -- An analysis of Neo-Nazis, from "The Badger" comic -% -Ahead warp factor one, Mr. Sulu. -% -Ahhhhhh... the smell of cuprinol and mahogany. It -excites me to... acts of passion... acts of... ineptitude. -% -Aim for the moon. If you miss, you may hit a star. - -- W. Clement Stone -% -Ain't no right way to do a wrong thing. - -- The Mad Dogtender -% -Ain't nothin' an old man can do for me but -bring me a message from a young man. - -- Moms Mabley -% -Ain't that something what happened today. One of us got traded to -Kansas City. - -- Casey Stengel, informing outfielder Bob Cerv he'd - been traded -% -Air Force Inertia Axiom: - Consistency is always easier to defend than correctness. -% -Air is water with holes in it. -% -Air, n.: - A nutritious substance supplied by a bountiful Providence for - the fattening of the poor. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Air pollution is really making us pay through the nose. -% -Airplanes are interesting toys but of no military value. - -- Marechal Ferdinand Foch, Professor of Strategy, - Ecole Superieure de Guerre -% -Al didn't smile for forty years. You've got to admire a man like that. - -- from "Mary Hartman, Mary Hartman" -% -Alan Turing thought about criteria to settle the question of whether -machines can think, a question of which we now know that it is about -as relevant as the question of whether submarines can swim. - -- Edsger W. Dijkstra -% -Alas, how love can trifle with itself! - -- William Shakespeare, "The Two Gentlemen of Verona" -% -Alas, I am dying beyond my means. - -- Oscar Wilde [as he sipped champagne on his deathbed] -% -ALASKA: - A prelude to "No." -% -Albert Camus wrote that the only serious question is whether to kill yourself -or not. Tom Robbins wrote that the only serious question is whether time has -a beginning and an end. Camus clearly got up on the wrong side of bed, and -Robbins must have forgotten to set the alarm. - -- Tom Robbins -% -Albert Einstein, when asked to describe radio, replied: "You see, wire -telegraph is a kind of a very, very long cat. You pull his tail in New -York and his head is meowing in Los Angeles. Do you understand this? -And radio operates exactly the same way: you send signals here, they -receive them there. The only difference is that there is no cat." -% -ALBRECHT'S LAW: - Social innovations tend to the level - of minimum tolerable well-being. -% -Alcohol, hashish, prussic acid, strychnine are weak dilutions. -The surest poison is time. - -- Ralph Waldo Emerson, "Society and Solitude" -% -Alcohol is the anesthesia by which we endure the operation of life. - -- George Bernard Shaw -% -Alden's Laws: - (1) Giving away baby clothes and furniture is the major cause - of pregnancy. - (2) Always be backlit. - (3) Sit down whenever possible. -% -Aleph-null bottles of beer on the wall, -Aleph-null bottles of beer, - You take one down, and pass it around, -Aleph-null bottles of beer on the wall. -% -Alex Haley was adopted! -% -Alexander Graham Bell is alive and well -in New York, and still waiting for a dial tone. -% -Alexander Hamilton started the U.S. Treasury with nothing - and that was -the closest our country has ever been to being even. - -- The Best of Will Rogers -% -Algebraic symbols are used when you do not know what you are talking about. - -- Philippe Schnoebelen -% -Algol-60 surely must be regarded as the most -important programming language yet developed. - -- T. Cheatham -% -ALGORITHM: - Trendy dance for hip programmers. -% -Alimony and bribes will engage a large share of your wealth. -% -Alimony is a system by which, when two people make a mistake, one of -them keeps paying for it. - -- Peggy Joyce -% -Alimony is like buying oats for a dead horse. - -- Arthur Baer -% -Alimony is the curse of the writing classes. - -- Norman Mailer -% -Alimony is the high cost of leaving. -% -Aliquid melius quam pessimum optimum non est. -% -Alive without breath, -As cold as death; -Never thirsty, ever drinking, -All in mail ever clinking. -% -All a man needs out of life is a place to sit 'n' spit in the fire. -% -All art is but imitation of nature. - -- Lucius Annaeus Seneca -% -All bad precedents began as justifiable measures. - -- Gaius Julius Caesar, quoted in "The Conspiracy of - Catiline", by Sallust -% -All bridge hands are equally likely, but some are more equally likely -than others. - -- Alan Truscott -% -All business is based on the mutual trust of one of the parts. - -- Poul Henningsen (1894-1967) -% -All constants are variables. -% -All diplomacy is a continuation of war by other means. - -- Chou En Lai -% -All extremists should be taken out and shot. -% -All Finagle Laws may be bypassed by learning the simple art of doing -without thinking. -% -All flesh is grass. - -- Isaiah 40:6 -Smoke a friend today. -% -All generalizations are false, including this one. - -- Mark Twain -% -All God's children are not beautiful. Most of God's children are, in fact, -barely presentable. - -- Fran Lebowitz, "Metropolitan Life" -% -All Gods were immortal. - -- Stanislaw J. Lec, "Unkempt Thoughts" -% -All great discoveries are made by mistake. - -- Young -% -All great ideas are controversial, or have been at one time. -% -All heiresses are beautiful. - -- John Dryden -% -All his life he has looked away... to the horizon, to the sky, -to the future. Never his mind on where he was, on what he was doing. - -- Yoda -% -All hope abandon, ye who enter here! - -- Dante Alighieri -% -All I ask is a chance to prove that money can't make me happy. -% -All I ask of life is a constant and exaggerated sense of my own -importance. -% -All I kin say is when you finds yo'self wanderin' in a peach orchard, -ya don't go lookin' for rutabagas. - -- Kingfish -% -All I know is what the words know, and dead things, and that -makes a handsome little sum, with a beginning and a middle and -an end, as in the well-built phrase and the long sonata of the dead. - -- Samuel Beckett -% -All I need to have a good time, -Is a reefer, a woman and a bottle of wine. -With those three things I don't need no sunshine, -A reefer, a woman and a bottle of wine. - -All I want is to never grow old, -I want to wash in a bathtub of gold. -I want 97 kilos already rolled, -I want to wash in a bathtub of gold. - -I want to light my cigars with 10 dollar bills, -I like to have a cattle ranch in Beverly Hills. -I want a bottle of Red Eye that's always filled, -I like to have a cattle ranch in Beverly Hills. - -- Country Joe and the Fish, "Zachariah" -% -All I want is a warm bed and a kind word and unlimited power. - -- Ashleigh Brilliant -% -All intelligent species own cats. -% -All is fear in love and war. -% -All is well that ends well. - -- John Heywood -% -All I've got left on the list of desirable vocations is heiress to the -throne of any country in Western Europe and Laurie Anderson. "Be -practical", was the choral reply from the dinner table. Well, Laurie -Anderson is already Laurie Anderson, but I read an article in Harpers -that said there were eleven countries, in the world this is I think, -that have queens as sovereign rulers. That's probably my best shot. -% -All kings is mostly rapscallions. - -- Mark Twain -% -All laws are simulations of reality. - -- John C. Lilly -% -All life evolves by the differential survival of replicating entities. - -- Richard Dawkins -% -All men are mortal. Socrates was mortal. Therefore, all men are -Socrates. - -- Woody Allen -% -All men have the right to wait in line. -% -All men know the utility of useful things; -but they do not know the utility of futility. - -- Chuang Tzu -% -All men profess honesty as long as they can. -To believe all men honest would be folly. -To believe none so is something worse. - -- John Quincy Adams -% -All most men really want in life is a wife, a house, two kids and a car, -a cat, no maybe a dog. Ummm, scratch one of the kids and add a dog. -Definitely a dog. -% -All most people ask of life is a constant -and exaggerated sense of their own importance. -% -All most people want is a little more than they'll ever get. -% -All my friends and I are crazy. -That's the only thing that keeps us sane. -% -All my friends are getting married, -Yes, they're all growing old, -They're all staying home on the weekend, -They're all doing what they're told. -% -All my life I wanted to be someone; I guess I should have been more specific. - -- Jane Wagner -% -ALL NEW: - Parts not interchangeable with previous model. -% -All newspaper editorial writers ever do is come down from -the hills after the battle is over and shoot the wounded. -% -All of the animals except man know that -the principal business of life is to enjoy it. -% -All of the people in my building are insane. The guy above me designs -synthetic hairballs for ceramic cats. The lady across the hall tried to -rob a department store... with a pricing gun... She said, "Give me all -of the money in the vault, or I'm marking down everything in the store." - -- Steven Wright -% -All of the true things I am about to tell you are shameless lies. - -- Kurt Vonnegut, Jr., "The Book of Bokonon" -% -All of us should treasure his Oriental wisdom and his preaching of a -Zen-like detachment, as exemplified by his constant reminder to clerks, -tellers, or others who grew excited by his presence in their banks: -"Just lie down on the floor and keep calm." - -- Robert Wilson, "John Dillinger Died for You" -% -All other things being equal, a bald man cannot be elected President of -the United States. - -- Vic Gold -% -All parts should go together without forcing. You must remember that the -parts you are reassembling were disassembled by you. Therefore, if you -can't get them together again, there must be a reason. By all means, do -not use a hammer. - -- IBM maintenance manual, 1925 -% -All people are born alike -- except Republicans and Democrats. - -- Groucho Marx -% -All phone calls are obscene. - -- Karen Elizabeth Gordon -% -All possibility of understanding is rooted in the ability to say no. - -- Susan Sontag -% -All power corrupts, but we need electricity. -% -All programmers are optimists. Perhaps this modern sorcery especially attracts -those who believe in happy endings and fairy godmothers. Perhaps the hundreds -of nitty frustrations drive away all but those who habitually focus on the end -goal. Perhaps it is merely that computers are young, programmers are younger, -and the young are always optimists. But however the selection process works, -the result is indisputable: "This time it will surely run," or "I just found -the last bug." - -- Frederick Brooks, Jr., "The Mythical Man-Month" -% -All programmers are playwrights and all computers are lousy actors. -% -All progress is based upon a universal innate desire of every organism -to live beyond its income. - -- Samuel Butler, "Notebooks" -% -All science is either physics or stamp collecting. - -- Ernest Rutherford -% -All seems condemned in the long run -to approximate a state akin to Gaussian noise. - -- James Martin -% -All snakes who wish to remain in Ireland will please raise their right hands. - -- Saint Patrick -% -All syllogisms have three parts, therefore this is not a syllogism. -% -All that glitters has a high refractive index. -% -All that glitters is not gold; all that wander are not lost. -% -All that is gold does not glitter, -Not all those who wander are lost; -The old that is strong does not wither, -Deep roots are not reached by the frost. -From the ashes a fire shall be woken, -A light from the shadows shall spring; -Renewed shall be blade that was broken, -The crownless again shall be king. - -- J. R. R. Tolkien -% -All the big corporations depreciate their possessions, and you can, -too, provided you use them for business purposes. For example, if you -subscribe to the Wall Street Journal, a business-related newspaper, you -can deduct the cost of your house, because, in the words of U.S. -Supreme Court Chief Justice Warren Burger in a landmark 1979 tax -decision: "Where else are you going to read the paper? Outside? What -if it rains?" - -- Dave Barry, "Sweating Out Taxes" -% -All the evidence concerning the universe -has not yet been collected, so there's still hope. -% -All the lines have been written There's been Sandburg, -It's sad but it's true Keats, Poe and McKuen -With all the words gone, They all had their day -What's a young poet to do? And knew what they're doin' - -But of all the words written The bird is a strange one, -And all the lines read, So small and so tender -There's one I like most, Its breed still unknown, -And by a bird it was said! Not to mention its gender. - -It reminds me of days of So what is this line -Both gloom and of light. Whose author's unknown -It still lifts my spirits And still makes me giggle -And starts the day right. Even now that I'm grown? - -I've read all the greats -Both starving and fat, -But none was as great as -"I tot I taw a puddy tat." - -- Etta Stallings, "An Ode To Childhood" -% -All the men on my staff can type. - -- Bella Abzug -% -...all the modern inconveniences... - -- Mark Twain -% -All the passions make us commit faults; love makes us commit the most -ridiculous ones. - -- Francois de La Rochefoucauld -% -All the really good ideas I ever had came to me while I was milking a cow. - -- Grant Wood -% -All the simple programs have been written. -% -All the taxes paid over a lifetime by the average American are spent by -the government in less than a second. - -- Jim Fiebig -% -All the troubles you have will pass away very quickly. -% -All the world's a stage and most of us are desperately un-rehearsed. - -- Sean O'Casey -% -All the world's a VAX, -And all the coders merely butchers; -They have their exits and their entrails; -And one int in his time plays many widths, -His sizeof being _N bytes. At first the infant, -Mewling and puking in the Regent's arms. -And then the whining schoolboy, with his Sun, -And shining morning face, creeping like slug -Unwillingly to school. - -- A Very Annoyed PDP-11 -% -All theoretical chemistry is really physics; -and all theoretical chemists know it. - -- Richard P. Feynman -% -All things are possible, except for skiing through a revolving door. -% -All things being equal, you are bound to lose. -% -All things that are, are with more spirit chased than enjoyed. - -- William Shakespeare, "Merchant of Venice" -% -All this wheeling and dealing around, why, it isn't for money, -it's for fun. Money's just the way we keep score. - -- Henry Tyroon -% -All true wisdom is found on T-shirts. -% -All warranty and guarantee clauses -become null and void upon payment of invoice. -% -All wars are civil wars, because all men are brothers ... Each one owes -infinitely more to the human race than to the particular country in -which he was born. - -- Francois Fenelon -% -All we know is the phenomenon: we spend our time sending messages to each -other, talking and trying to listen at the same time, exchanging information. -This seems to be our most urgent biological function; it is what we do with -our lives." - -- Lewis Thomas, "The Lives of a Cell" -% -All who joy would win Must share it -- -Happiness was born a twin. - -- Lord Byron -% -All your files have been destroyed (sorry). Paul. -% -All [zoos] actually offer to the public in return for the taxes spent -upon them is a form of idle and witless amusement, compared to which a -visit to a penitentiary, or even to a State legislature in session, is -informing, stimulating and ennobling. - -- H. L. Mencken -% -Allen's Axiom: - When all else fails, read the instructions. -% -Alliance, n.: - In international politics, the union of two thieves who have - their hands so deeply inserted in each other's pocket that they - cannot separately plunder a third. - -- Ambrose Bierce, "The Devil's Dictionary" -% -All's well that ends. -% -Almost anything derogatory you could say -about today's software design would be accurate. - -- K. E. Iverson -% -Alone, adj.: - In bad company. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Also, the Scots are said to have invented golf. Then they had -to invent Scotch whiskey to take away the pain and frustration. -% -alta, v: To change; make or become different; modify. -ansa, v: A spoken or written reply, as to a question. -baa, n: A place people meet to have a few drinks. -Baaston, n: The capital of Massachusetts. -baaba, n: One whose business is to cut or trim hair or beards. -beea, n: An alcoholic beverage brewed from malt and hops, often - found in baas. -caaa, n: An automobile. -centa, n: A point around which something revolves; axis. (Or - someone involved with the Knicks.) -chouda, n: A thick seafood soup, often in a milk base. -dada, n: Information, esp. information organized for analysis or - computation. - -- Massachewsetts Unabridged Dictionary -% -Although golf was originally restricted to wealthy, overweight -Protestants, today it's open to anybody who owns hideous clothing. - -- Dave Barry -% -Although it is still a truism in industry that "no one was ever fired for -buying IBM," Bill O'Neil, the chief technology officer at Drexel Burnham -Lambert, says he knows for a fact that someone has been fired for just that -reason. He knows it because he fired the guy. - "He made a bad decision, and what it came down to was, 'Well, I -bought it because I figured it was safe to buy IBM,'" Mr. O'Neil says. -"I said, 'No. Wrong. Game over. Next contestant, please.'" - -- The Wall Street Journal, December 6, 1989 -% -Although the moon is smaller than the earth, it is farther away. -% -Although we modern persons tend to take our electric lights, radios, -mixers, etc., for granted, hundreds of years ago people did not have -any of these things, which is just as well because there was no place -to plug them in. Then along came the first Electrical Pioneer, -Benjamin Franklin, who flew a kite in a lighting storm and received a -serious electrical shock. This proved that lighting was powered by the -same force as carpets, but it also damaged Franklin's brain so severely -that he started speaking only in incomprehensible maxims, such as "A -penny saved is a penny earned." Eventually he had to be given a job -running the post office. - -- Dave Barry, "What is Electricity?" -% -Although written many years ago, Lady Chatterley's Lover has just been -reissued by the Grove Press, and this pictorial account of the day-to-day -life of an English gamekeeper is full of considerable interest to outdoor -minded readers, as it contains many passages on pheasant-raising, the -apprehending of poachers, ways to control vermin, and other chores and duties -of the professional gamekeeper. Unfortunately, one is obliged to wade -through many pages of extraneous material in order to discover and savour -those sidelights on the management of a midland shooting estate, and in this -reviewer's opinion the book cannot take the place of J. R. Miller's "Practical -Gamekeeping." - -- Ed Zern, "Field and Stream" (Nov. 1959) -% -Always borrow money from a pessimist; he doesn't expect to be paid back. -% -Always do right. This will gratify some people and astonish the rest. - -- Mark Twain -% -Always draw your curves, then plot your reading. -% -Always leave room to add an explanation if it doesn't work out. -% -Always run from a knife and rush a gun. - -- Jimmy Hoffa -% -Always store beer in a dark place. -% -Always the dullness of the fool is the whetstone of the wits. - -- William Shakespeare, "As You Like It" -% -Always there remain portions of our heart -into which no one is able to enter, invite them as we may. -% -Always think of something new; this -helps you forget your last rotten idea. - -- Seth Frankel -% -Always try to do things in chronological order; it's less confusing -that way. -% -Am I ranting? I hope so. My ranting gets raves. -% -AMAZING BUT TRUE... - If all the salmon caught in Canada in one year were laid end to - end across the Sahara Desert, the smell would be absolutely awful. -% -AMAZING BUT TRUE... - There is so much sand in Northern Africa that if it - were spread out it would completely cover the Sahara Desert. -% -Ambidextrous, adj.: - Able to pick with equal skill a right-hand pocket or a left. - -- Ambrose Bierce, "The Devil's Dictionary" -% -AMBIGUITY: - Telling the truth when you don't mean to. -% -Ambition is a poor excuse for not having sense enough to be lazy. - -- Charlie McCarthy -% -Ambition, n.: - An overmastering desire to be vilified by enemies while - living and made ridiculous by friends when dead. - -- Ambrose Bierce, "The Devil's Dictionary" -% -America: born free and taxed to death. -% -America has been discovered before, but it has always been hushed up. - -- Oscar Wilde -% -America, how can I write a holy litany in your silly mood? - -- Allen Ginsberg -% -America is a melting pot. You know, where those on the bottom get burned, -and the scum rises to the top. - -- Utah Phillips -% -America is a stronger nation for the ACLU's uncompromising effort. - -- President John F. Kennedy - -The simple rights, the civil liberties from generations of struggle must not -be just fine words for patriotic holidays, words we subvert on weekdays, but -living, honored rules of conduct amongst us...I'm glad the American Civil -Liberties Union gets indignant, and I hope this will always be so. - -- Adlai E. Stevenson - -The ACLU has stood foursquare against the recurring tides of hysteria that -from time to time threaten freedoms everywhere... Indeed, it is difficult -to appreciate how far our freedoms might have eroded had it not been for the -Union's valiant representation in the courts of the constitutional rights -of people of all persuasions, no matter how unpopular or even despised -by the majority they were at the time. - -- former Supreme Court Chief Justice Earl Warren -% -America is the country where you buy a lifetime -supply of aspirin for one dollar, and use it up in two weeks. -% -America may be unique in being a country which has leapt -from barbarism to decadence without touching civilization. - -- John O'Hara -% -America was discovered by Amerigo Vespucci and was named after him, until -people got tired of living in a place called "Vespuccia" and changed its -name to "America". - -- Mike Harding, "The Armchair Anarchist's Almanac" -% -America works less, when you say "Union Yes!" -% -American business long ago gave up on demanding that prospective -employees be honest and hardworking. It has even stopped hoping for -employees who are educated enough that they can tell the difference -between the men's room and the women's room without having little -pictures on the doors. - -- Dave Barry, "Urine Trouble, Mister" -% -American by birth; Texan by the grace of God. -% -American cars are made shoddily... -Cars made overseas are far superior. - -- Barry Goldwater -% -[Americans] are a race of convicts and ought to be thankful for anything -we allow them short of hanging. - -- Samuel Johnson - -America is a large friendly dog in a small room. Every time it wags its -tail it knocks over a chair. - -- Arnold Toynbee - -The United States is like the guy at the party who gives cocaine to -everybody and still nobody likes him. - -- Jim Samuels -% -Americans are people who insist on living in the present, tense. -% -Americans' greatest fear is that America will turn out -to have been a phenomenon, not a civilization. - -- Shirley Hazzard, "Transit of Venus" -% -America's best buy for a quarter is a telephone call to the right person. -% -Amnesia used to be my favorite word, but then I forgot it. -% -AMOEBIT: - Amoeba/rabbit cross; it can multiply - and divide at the same time. -% -Among all savage beasts, none is found so harmful as woman. - -- St. John Chrysostom (304-407) -% -Among the lucky, you are the chosen one. -% -An acid is like a woman: a good one will eat through your pants. - -- Mel Gibson, Saturday Night Live -% -An actor's a guy who if you ain't talkin' about him, ain't listening. - -- Marlon Brando -% -An Ada exception is when a routine gets -in trouble and says "Beam me up, Scotty." -% -An adequate bootstrap is a contradiction in terms. -% -An age is called Dark not because the light fails to shine, but because -people refuse to see it. - -- James Michener, "Space" -% -An Aggie farmer was lifting his hogs, one by one, up to the branches of -his apple trees to graze on the apples. A Texas student walked by and -asked him, "Doesn't that take a lot of time?" - Replied the Aggie, "What's time to a hog?" -% -An alcoholic is someone you don't like who drinks as much as you do. - -- Dylan Thomas -% -An algorithm must be seen to be believed. - -- Donald E. Knuth -% -An ambassador is an honest man sent abroad -to lie and intrigue for the benefit of his country. - -- Sir Henry Wotton (1568-1639) -% -An amendment to a motion may be amended, but an amendment to an amendment -to a motion may not be amended. However, a substitute for an amendment to -and amendment to a motion may be adopted and the substitute may be amended. - -- The Montana legislature's contribution to the English - language. -% -An American is a man with two arms and four wheels. - -- A Chinese child -% -An American scientist once visited the offices of the great Nobel prize -winning physicist, Niels Bohr, in Copenhagen. He was amazed to find that -over Bohr's desk was a horseshoe, securely nailed to the wall, with the -open end up in the approved manner (so it would catch the good luck and not -let it spill out). The American said with a nervous laugh, - "Surely you don't believe the horseshoe will bring you good luck, -do you, Professor Bohr? After all, as a scientist --" -Bohr chuckled. - "I believe no such thing, my good friend. Not at all. I am -scarcely likely to believe in such foolish nonsense. However, I am told -that a horseshoe will bring you good luck whether you believe in it or not." -% -An American tourist is visiting Russia, and he's talking with a Russian -about the fact that not many people in Russia own cars. - -American: "I can't believe you don't have cars here! How do you - get to work?" -Russian: "We take the bus, or the subway. We have public - transportation everywhere." -A: "Well, how do you go on vacations?" -R: "We take the train." -A: "Well, what if you want to go abroad?" -R: "We don't ever want go abroad." -A: "Well, what if you really HAVE to go abroad?" -R: "We take tanks." -% -An American's a person who isn't afraid to criticize -the president but is always polite to traffic cops. -% -An anthropologist at Tulane has just come back from a field trip to New -Guinea with reports of a tribe so primitive that they have Tide but not -new Tide with lemon-fresh Borax. - -- David Letterman -% -An aphorism is never exactly true; -it is either a half-truth or one-and-a-half truths. - -- Karl Kraus -% -An appeaser is one who feeds a crocodile -- hoping that it will eat -him last. - -- Sir Winston Churchill, 1954 -% -An apple a day makes 365 apples a year. -% -An apple every eight hours will keep three doctors away. -% -An artist should be fit for the best society and keep out of it. -% -An atheist is a man with no invisible means of support. -% -An atom-blaster is a good weapon, but it can point both ways. - -- Isaac Asimov -% -An attachment a la Plato -for a bashful young potato -or a, not too French, french bean -must excite your languid spleen. -For, if you walk down Picadilly -with a poppy or lily -in your medieval hand, -every one will say, -as you walk your flowery way; -"If this young man is content, -with a vegetable love -which would certainly not content me. -Why, what a very pure young man -this pure young man must be!" - -- W. S. Gilbert, "Patience" - [The subject of the humour is of course, Oscar Wilde] -% -An attorney was defending his client against a charge of first-degree -murder. "Your Honor, my client is accused of stuffing his lover's -mutilated body into a suitcase and heading for the Mexican border. -Just north of Tijuana a cop spotted her hand sticking out of the -suitcase. Now, I would like to stress that my client is *not* a -murderer. A sloppy packer, maybe..." -% -An authority is a person who can tell you more about something than you -really care to know. -% -An avocado-tone refrigerator would look good on your resume. -% -An economist is a man who would marry -Farrah Fawcett-Majors for her money. -% -An editor is one who separates the wheat from the chaff and prints the chaff. - -- Adlai E. Stevenson -% -An effective way to deal with predators is to taste terrible. -% -An efficient and a successful administration manifests -itself equally in small as in great matters. - -- Winston Churchill -% -An egghead is one who stands firmly on both feet, -in mid-air, on both sides of an issue. - -- Homer Ferguson -% -An elderly couple were flying to their Caribbean hideaway on a chartered plane -when a terrible storm forced them to land on an uninhabited island. When -several days passed without rescue, the couple and their pilot sank into a -despondent silence. Finally, the woman asked her husband if he had made his -usual pledge to the United Way Campaign. - "We're running out of food and water and you ask *that*?" her husband -barked. "If you really need to know, I not only pledged a half million but -I've already paid them half of it." - "You owe the U.W.C. a *quarter million*?" the woman exclaimed -euphorically. "Don't worry, Harry, they'll find us! They'll find us!" -% -An elephant is a mouse with an operating system. -% -An engineer, a physicist and a mathematician find themselves in an -anecdote, indeed an anecdote quite similar to many that you have no doubt -already heard. After some observations and rough calculations the -engineer realizes the situation and starts laughing. A few minutes later -the physicist understands too and chuckles to himself happily as he now -has enough experimental evidence to publish a paper. This leaves the -mathematician somewhat perplexed, as he had observed right away that he -was the subject of an anecdote, and deduced quite rapidly the presence of -humour from similar anecdotes, but considers this anecdote to be too -trivial a corollary to be significant, let alone funny. -% -An engineer is someone who does list processing in FORTRAN. -% -An English judge, growing weary of the barrister's long-winded -summation, leaned over the bench and remarked, "I've heard your -arguments, Sir Geoffrey, and I'm none the wiser!" Sir Geoffrey -responded, "That may be, Milord, but at least you're better informed!" -% -An Englishman never enjoys himself, except for a noble purpose. - -- A. P. Herbert -% -An evil mind is a great comfort. -% -An excellence-oriented '80s male does not wear a regular watch. He wears -a Rolex watch, because it weighs nearly six pounds and is advertised -only in excellence-oriented publications such as Fortune and Rich -Protestant Golfer Magazine. The advertisements are written in -incomplete sentences, which is how advertising copywriters denote -excellence: - -"The Rolex Hyperion. An elegant new standard in quality excellence and -discriminating handcraftsmanship. For the individual who is truly able -to discriminate with regard to excellent quality standards of crafting -things by hand. Fabricated of 100 percent 24-karat gold. No watch -parts or anything. Just a great big chunk on your wrist. Truly a -timeless statement. For the individual who is very secure. Who -doesn't need to be reminded all the time that he is very successful. -Much more successful than the people who laughed at him in high -school. Because of his acne. People who are probably nowhere near as -successful as he is now. Maybe he'll go to his 20th reunion, and -they'll see his Rolex Hyperion. Hahahahahahahahaha." - -- Dave Barry, "In Search of Excellence" -% -An exotic journey in downtown Newark is in your future. -% -...an experienced, industrious, ambitious, and quite often -picturesque liar. - -- Mark Twain -% -An expert is a man who has made all the mistakes which can be made, in a -very narrow field. - -- Niels Bohr -% -An expert is a person who avoids the small errors -as he sweeps on to the grand fallacy. - -- Benjamin Stolberg -% -An expert is one who knows more and more about less -and less until he knows absolutely nothing about everything. -% -An eye in a blue face -Saw an eye in a green face. -"That eye is like this eye" -Said the first eye, -"But in low place, -Not in high place." -% -An Hacker there was, one of the finest sort -Who controlled the system; graphics was his sport. -A manly man, to be a wizard able; -Many a protected file he had sitting on his table. -His console, when he typed, a man might hear -Clicking and feeping wind as clear, -Aye, and as loud as does the machine room bell -Where my lord Hacker was Prior of the cell. -The Rule of good St Savage or St Doeppnor -As old and strict he tended to ignore; -He let go by the things of yesterday -And took the modern world's more spacious way. -He did not rate that text as a plucked hen -Which says that Hackers are not holy men. -And that a hacker underworked is a mere -Fish out of water, flapping on the pier. -That is to say, a hacker out of his cloister. -That was a text he held not worth an oyster. -And I agreed and said his views were sound; -Was he to study till his head wend round -Poring over books in the cloisters? Must he toil -As Andy bade and till the very soil? -Was he to leave the world upon the shelf? -Let Andy have his labor to himself! - -- Chaucer - [well, almost. Ed.] -% -An honest politician is one who when he is bought will stay bought. - -- Simon Cameron - -There are honest journalists like there are honest politicians. When -bought they stay bought. - -- Bill Moyers -% -An honest tale speeds best being plainly told. - -- William Shakespeare, "Henry VI" -% -An idea is an eye given by God for the seeing of God. Some of these -eyes we cannot bear to look out of, we blind them as quickly as -possible. - -- Russell Hoban, "Pilgermann" -% -An idea is not responsible for the people who believe in it. -% -An idealist is one who helps the other fellow to make a profit. - -- Henry Ford -% -An idle mind is worth two in the bush. -% -An infallible method of conciliating a tiger -is to allow oneself to be devoured. - -- Konrad Adenauer -% -An intellectual is someone whose mind watches itself. - -- Albert Camus -% -An interpretation I satisfies a sentence in the table language if and only if -each entry in the table designates the value of the function designated by the -function constant in the upper-left corner applied to the objects designated -by the corresponding row and column labels. - -- Genesereth & Nilsson, - "Logical foundations of Artificial Intelligence" -% -An investment in knowledge always pays the best interest. - -- Benjamin Franklin -% -An old man is lying on his deathbed with all his children, grandchildren and -great-grandchildren gathered around, teary-eyed at the approaching finale of -a deeply loved family member. The old man is in a light coma, and the doctors -have confirmed that the waiting will be over within the next twenty-four -hours. Suddenly, the old man opens his eyes whispers: "I must be dreaming -of heaven... I smell my daughter Lisle's strudel." - "No, no, grandfather, you are not dreaming", he is reassured. -"Grandmother is baking strudel right now." - A faint smile crosses the old man's face. "Go and get me a sliver of -strudel," he says, "she bakes the finest strudel in the world." - One of the grandchildren is immediately dispatched to honor the old -man's request, and, after what seems a long time, he returns empty-handed. - "Did you bring me some of Lisle's strudel?", the old man quavers. - "I'm... I'm very sorry, grandfather, but she says it's for the -funeral." -% -An optimist is a guy that has never had much experience. - -- Don Marquis -% -An optimist is a man who looks forward to marriage. -A pessimist is a married optimist. -% -An ounce of clear truth is worth a pound of obfuscation. -% -An ounce of hypocrisy is worth a pound of ambition. - -- Michael Korda -% -An ounce of mother is worth a ton of priest. - -- Spanish proverb -% -An ounce of prevention is worth a pound of purge. -% -Anarchy may not be the best form of government, but it's better than no -government at all. -% -And all that the Lorax left here in this mess -was a small pile of rocks with the one word, "unless." -Whatever THAT meant, well, I just couldn't guess. -That was long, long ago, and each day since that day, -I've worried and worried and worried away. -Through the years as my buildings have fallen apart, -I've worried about it with all of my heart. - -"BUT," says the Oncler, "now that you're here, -the word of the Lorax seems perfectly clear! -UNLESS someone like you cares a whole awful lot, -nothing is going to get better - it's not. -So... CATCH!" cries the Oncler. He lets something fall. -"It's a truffula seed. It's the last one of all! - -"You're in charge of the last of the truffula seeds. -And truffula trees are what everyone needs. -Plant a new truffula -- treat it with care. -Give it clean water and feed it fresh air. -Grow a forest -- protect it from axes that hack. -Then the Lorax and all of his friends may come back!" - -- Dr. Seuss, "The Lorax" -% -And as we stand on the edge of darkness -Let our chant fill the void -That others may know - - In the land of the night - The ship of the sun - Is drawn by - The grateful dead. - -- Tibetan "Book of the Dead," ca. 4000 BC. -% -And did those feet, in ancient times, -Walk upon England's mountains green? -And was the Holy Lamb of God -In England's pleasant pastures seen? -And did the Countenance Divine -Shine forth upon these crowded hills? -And was Jerusalem builded here -Among these dark satanic mills? - -Bring me my bow of burning gold! -Bring me my arrows of desire! -Bring me my spears! O clouds unfold! -Bring me my chariot of fire! -I shall not cease from mental fight, -Nor shall my sword rest in my hand, -Till we have built Jerusalem -In England's green and pleasant land. - -- William Blake, "Jerusalem" -% -And do you think (fop that I am) that I could be the Scarlet Pumpernickel? -% -And ever has it been known that -love knows not its own depth until the hour of separation. - -- Kahlil Gibran -% -And he climbed with the lad up the Eiffelberg Tower. "This," cried the Mayor, -"is your town's darkest hour! The time for all Whos who have blood that is red -to come to the aid of their country!" he said. "We've GOT to make noises in -greater amounts! So, open your mouth, lad! For every voice counts!" Thus he -spoke as he climbed. When they got to the top, the lad cleared his throat and -he shouted out, "YOPP!" - And that Yopp... That one last small, extra Yopp put it over! -Finally, at last! From the speck on that clover their voices were heard! -They rang out clear and clean. And they elephant smiled. "Do you see what -I mean?" They've proved they ARE persons, no matter how small. And their -whole world was saved by the smallest of All!" - "How true! Yes, how true," said the big kangaroo. "And, from now -on, you know what I'm planning to do? From now on, I'm going to protect -them with you!" And the young kangaroo in her pouch said, "ME TOO! From -the sun in the summer. From rain when it's fall-ish, I'm going to protect -them. No matter how small-ish!" - -- Dr. Seuss, "Horton Hears a Who" -% -And here I wait so patiently -Waiting to find out what price -You have to pay to get out of -Going thru all of these things twice - -- Dylan, "Memphis Blues Again" -% -And I alone am returned to wag the tail. -% -And I heard Jeff exclaim, -As they strolled out of sight, -"Merry Christmas to all -- -You take credit cards, right?" - -- "Outsiders" comic -% -And I suppose the little things are harder to get used to than the big -ones. The big ones you get used to, you make up your mind to them. The -little things come along unexpectedly, when you aren't thinking about -them, aren't braced against them. - -- Marion Zimmer Bradley, "The Forbidden Tower" -% -And I will do all these good works, and I will do them for free! -My only reward will be a tombstone that says "Here lies Gomez -Addams -- he was good for nothing." - -- Jack Sharkey, The Addams Family -% -And if California slides into the ocean, -Like the mystics and statistics say it will. -I predict this motel will be standing, -Until I've paid my bill. - -- Warren Zevon, "Desperados Under the Eaves" -% -And if sometime, somewhere, someone asketh thee, -"Who kilt thee?", tell them it 'twas the Doones of Bagworthy! -% -And if you wonder, -What I am doing, -As I am heading for the sink. -I am spitting out all the bitterness, -Along with half of my last drink. -% -And in the heartbreak years that lie ahead, -Be true to yourself and the Grateful Dead. - -- Joan Baez -% -And it should be the law: If you use the word `paradigm' without knowing -what the dictionary says it means, you go to jail. No exceptions. - -- David Jones -% -And malt does more than Milton can to justify God's ways to man. - -- A. E. Housman -% -And miles to go before I sleep. -% -And now for something completely the same. -% -And now your toner's toney, Disk blocks aplenty -And your paper near pure white, Await your laser drawn lines, -The smudges on your soul are gone Your intricate fonts, -And your output's clean as light.. Your pictures and signs. - -We've labored with your father, Your amputative absence -The venerable XGP, Has made the Ten dumb, -But his slow artistic hand, Without you, Dover, -Lacks your clean velocity. We're system untounged- - -Theses and papers DRAW Plots and TEXage -And code in a queue Have been biding their time, -Dover, oh Dover, With LISP code and programs, -We've been waiting for you. And this crufty rhyme. - -Dover, oh Dover, Dover, oh Dover, arisen from dead. -We welcome you back, Dover, oh Dover, awoken from bed. -Though still you may jam, Dover, oh Dover, welcome back to the Lab. -You're on the right track. Dover, oh Dover, we've missed your clean - hand... -% -And on the eighth day, we bulldozed it. -% -And on the seventh day, He exited from append mode. -% -And remember: if you don't like the news, go out and make some of -your own. - -- "Scoop" Nisker, KFOG radio reporter - Preposterous Words -% -...and report cards I was always afraid to show -Mama'd come to school -and as I'd sit there softly cryin' -Teacher'd say he's just not tryin' -Got a good head if he'd apply it -but you know yourself -it's always somewhere else -I'd build me a castle -with dragons and kings -and I'd ride off with them -As I stood by my window -and looked out on those -Brooklyn roads - -- Neil Diamond, "Brooklyn Roads" -% -And so it was, later, -As the miller told his tale, -That her face, at first just ghostly, -Turned a whiter shade of pale. - -- Procol Harum -% -And so, men, we can see that human skin is an even more complex and -fascinating organ than we thought it was, and if we want to keep it -looking good, we have to care for it as though it were our own. One -approach is to undergo a painful surgical procedure wherein your skin -is turned inside-out, so the young cells are on the outside, but then -of course you have the unpleasant side effect that your insides -gradually fill up with dead old cells and you explode. So this -procedure is pretty much limited to top Hollywood stars for whom -youthful beauty is a career necessity, such as Elizabeth Taylor and -Orson Welles. - -- Dave Barry, "Saving Face" -% -And that's the way it is... - -- Walter Cronkite -% -And the crowd was stilled. One elderly man, wondering at the sudden silence, -turned to the Child and asked him to repeat what he had said. Wide-eyed, -the Child raised his voice and said once again, "Why, the Emperor has no -clothes! He is naked!" - -- "The Emperor's New Clothes" -% -And the French medical anatomist Etienne Serres really did argue that -black males are primitive because the distance between their navel and -penis remains small (relative to body height) throughout life, while -white children begin with a small separation but increase it during -growth -- the rising belly button as a mark of progress. - -- S. J. Gould, "Racism and Recapitulation" -% -And the silence came surging softly backwards -When the plunging hooves were gone... - -- Walter de La Mare, "The Listeners" -% -And they shall beat their swords into plowshares, for if you hit a man -with a plowshare, he's going to know he's been hit. -% -And this is a table ma'am. What in essence it consists of is a horizontal -rectilinear plane surface maintained by four vertical columnar supports, -which we call legs. The tables in this laboratory, ma'am, are as advanced -in design as one will find anywhere in the world. - -- Michael Frayn, "The Tin Men" -% -And this is good old Boston, -The home of the bean and the cod, -Where the Lowells talk only to Cabots, -And the Cabots talk only to God. -% -And tomorrow will be like today, only more so. - -- Isaiah 56:12, New Standard Version -% -And we heard him exclaim -As he started to roam: -"I'm a hologram, kids, -please don't try this at home!'" - -- Bob Violence -% -And what accomplished villains these old engineers were! What diabolical -ways to sabotage they found! Nikolai Karlovich von Meck, of the People's -Commissariat of Railroads ... would hold forth for hours on end about the -economic problems involved in the construction of socialism, and he loved to -give advice. One such pernicious piece of advice was to increase the size -of freight trains and not worry about heavier than average loads. The GPU -exposed van Meck, and he was shot: his objective had been to wear out rails -and roadbeds, freight cars and locomotives, so as to leave the Republic -without railroads in case of foreign military intervention! When, not long -afterward, the new People's Commissar of Railroads ordered that average -loads should be increased, and even doubled and tripled them, the malicious -engineers who protested became known as limiters ... they were rightly -shot for their lack of faith in the possibilities of socialist transport. - -- Aleksandr I. Solzhenitsyn, "The Gulag Archipelago" -% -And... What in the world ever became of Sweet Jane? - She's lost her sparkle, you see she isn't the same. - Livin' on reds, vitamin C, and cocaine - All a friend can say is "Ain't it a shame?" - -- The Grateful Dead -% -And yet I should have dearly liked, I own, to have touched her lips; to -have questioned her, that she might have opened them; to have looked upon -the lashes of her downcast eyes, and never raised a blush; to have let -loose waves of hair, an inch of which would be a keepsake beyond price: -in short, I should have liked, I do confess, to have had the lightest -license of a child, and yet been man enough to know its value. - -- Charles Dickens -% -And yet, seasons must be taken with a grain of salt, for they too have a -sense of humor, as does history. Corn stalks comedy, comedy stalks tragedy, -and this too is historic. And yet, still, when corn meets tragedy face to -face, we have politics. - -- Dalglish, Larsen and Sutherland, - "Root Crops and Ground Cover" -% -And you can't get any Watney's Red Barrel, -because the bars close every time you're thirsty... -% -"And, you know, I mustn't preach to you, but surely it wouldn't be right for -you to take away people's pleasure of studying your attire, by just going -and making yourself like everybody else. You feel that, don't you?" said -he, earnestly. - -- William Morris, "Notes from Nowhere" -% -Andrea: Unhappy the land that has no heroes. -Galileo: No, unhappy the land that _n_e_e_d_s heroes. - -- Bertolt Brecht, "Life of Galileo" -% -Andrea's Admonition: - Never bestow profanity upon a driver who has wronged you. - If you think his window is closed and he can't hear you, - it isn't and he can. -% -ANDROPHOBIA: - Fear of men. -% -Angels we have heard on High -Tell us to go out and Buy. - -- Tom Lehrer -% -Anger is momentary madness. - -- Horace -% -Anger kills as surely as the other vices. -% -Animals can be driven crazy by putting too many in too small a pen. -Homo sapiens is the only animal that voluntarily does this to himself. - -- Lazarus Long -% -Ankh if you love Isis. -% -Announcing the NEW VAX 11/782!! - -Be the envy of other major Communist Governments! - -Defend yourself against the entire ICBM force of the imperialist USA with -just one of the processors, at the same time you're designing missile ICs, -cracking secret NATO codes and editing propaganda for your own people all -at the same time with the other! (Well, you really can't, but the Americans -think you can, and that's the point, right?) -% -Anoint, v.: - To grease a king or other great functionary already sufficiently - slippery. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Another day, another dollar. - -- Vincent J. Fuller, defense lawyer for John Hinckley, - upon Hinckley's acquittal for shooting President Ronald - Reagan. -% -Another flaw in the human character is that everybody wants to build -and nobody wants to do maintenance. - -- Kurt Vonnegut, Jr., "Hocus Pocus" -% -Another good night not to sleep in a eucalyptus tree. -% -Another megabytes the dust. -% -Another possible source of guidance for teenagers is television, but -television's message has always been that the need for truth, wisdom -and world peace pales by comparison with the need for a toothpaste that -offers whiter teeth *_a_n_d* fresher breath. - -- Dave Barry, "Kids Today: They Don't Know Dum Diddly Do" -% -Another such victory over the Romans, and we are undone. - -- Pyrrhus -% -Answer a fool according to his folly, lest he be wise in his own conceit. - -- Proverbs 26:5 -% -Anthony's Law of Force: - Don't force it; get a larger hammer. -% -Anthony's Law of the Workshop: - Any tool when dropped, will roll into the least accessible - corner of the workshop. - -Corollary: - On the way to the corner, any dropped tool will first strike - your toes. -% -Antique fairy tale: Little Red Riding Hood. -Modern fairy tale: Oswald, acting alone, shot Kennedy. -% -Anti-trust laws should be approached with exactly that attitude. -% -Antonio Antonio -Was tired of living alonio -He thought he would woo Antonio Antonio -Miss Lucamy Lu, Rode off on his polo ponio -Miss Lucamy Lucy Molonio. And found the maid - In a bowery shade, - Sitting and knitting alonio. -Antonio Antonio -Said if you will be my ownio -I'll love you true Oh nonio Antonio -And buy for you You're far too bleak and bonio -An icery creamry conio. And all that I wish - You singular fish - Is that you will quickly begonio. -Antonio Antonio -Uttered a dismal moanio -And went off and hid -Or I'm told that he did -In the Antarctical Zonio. -% -Antonym, n.: - The opposite of the word you're trying to think of. -% -Anxious after the delay, Gruber doesn't waste any time getting the Koenig -[a modified Porsche] up to speed, and almost immediately we are blowing off -Alfas, Fiats, and Lancias full of excited Italians. These people love fast -cars. But they love sport too and no passing encounter goes unchallenged. -Nothing serious, just two wheels into your lane as you're bearing down on -them at 130-plus -- to see if you're paying attention. - -- Road & Track article about driving two absurdly fast - cars across Europe. -% -Any circuit design must contain at least one part which is obsolete, two parts -which are unobtainable, and three parts which are still under development. -% -Any clod can have the facts, but having opinions is an art. - -- Charles McCabe -% -Any coward can sit in his home and criticize a pilot for flying into a -mountain in a fog. But I would rather, by far, die on a mountainside -than in bed. What kind of man would live where there is no daring? -And is life so dear that we should blame men for dying in adventure? -Is there a better way to die? - -- Charles Lindbergh -% -Any dramatic series the producers want us to take seriously as a -representation of contemporary reality cannot be taken seriously as a -representation of anything -- except a show to be ignored by anyone -capable of sitting upright in a chair and chewing gum simultaneously. - -- Richard Schickel -% -Any excuse will serve a tyrant. - -- Aesop -% -Any father who thinks he's all important should remind himself that this -country honors fathers only one day a year while pickles get a whole week. -% -Any fool can paint a picture, but it takes a -wise person to be able to sell it. -% -Any fool can tell the truth, but it requires a man of sense to know -how to lie well. - -- Samuel Butler -% -Any girl can be glamorous; all you have to do is stand still and look -stupid. - -- Hedy Lamarr -% -Any given program will expand to fill available memory. -% -Any great truth can -- and eventually will -- be expressed as a cliche -- -a cliche is a sure and certain way to dilute an idea. For instance, my -grandmother used to say, "The black cat is always the last one off the -fence." I have no idea what she meant, but at one time, it was undoubtedly -true. - -- Solomon Short -% -Any instrument when dropped will roll into the least accessible corner. -% -Any man can work when every stroke of his hand brings down the fruit -rattling from the tree to the ground; but to labor in season and out -of season, under every discouragement, by the power of truth -- that -requires a heroism which is transcendent. - -- Henry Ward Beecher -% -Any man who hates dogs and babies can't be all bad. - -- Leo Rosten, on W. C. Fields -% -Any member introducing a dog into the Society's premises shall be -liable to a fine of one pound. Any animal leading a blind person shall -be deemed to be a cat. - -- Rule 46, Oxford Union Society, London -% -Any philosophy that can be put in a nutshell belongs there. - -- Sydney J. Harris -% -Any president should have the right to shoot -at least two people a year without explanation. - -- Herbert Hoover, discussing the press -% -Any priest or shaman must be presumed guilty until proved innocent. - -- Lazarus Long -% -Any problem in computer science can be solved with another layer -of indirection. - -- David Wheeler -% -Any program which runs right is obsolete. -% -Any programming language is at its best before it is implemented and used. -% -Any road followed to its end leads precisely nowhere. -Climb the mountain just a little to test it's a mountain. -From the top of the mountain, you cannot see the mountain. - -- Bene Gesserit proverb, "Dune" -% -Any small object that is accidentally -dropped will hide under a larger object. -% -Any stone in your boot always migrates against the pressure gradient to -exactly the point of most pressure. - -- Milt Barber -% -Any sufficiently advanced bug is indistinguishable from a feature. - -- Rich Kulawiec -% -Any sufficiently advanced technology is indistinguishable from a rigged demo. -% -Any sufficiently advanced technology is indistinguishable from magic. - -- Arthur C. Clarke -% -Any sufficiently simple directive can be obfuscated beyond reason -given proper legal counsel. - -- Alfred Perlstein -% -Any time things appear to be going better, you have overlooked -something. -% -Any two philosophers can tell each other all they know in two hours. - -- Oliver Wendell Holmes, Jr. -% -Anybody can win, unless there happens to be a second entry. -% -Anybody has a right to evade taxes if he can get away with it. No citizen -has a moral obligation to assist in maintaining his government. - -- J. P. Morgan -% -Anybody that wants the presidency so much that he'll spend two years -organizing and campaigning for it is not to be trusted with the office. - -- David Broder -% -Anybody who doesn't cut his speed at the -sight of a police car is probably parked. -% -Anybody with money to burn will easily find someone to tend the fire. -% -Anyone can become angry -- that is easy; but to be angry with the right -person, to the right degree, at the right time, for the right purpose -and in the right way -- that is not easy. - -- Aristotle -% -Anyone can do any amount of work provided it isn't the work he is -supposed to be doing at the moment. - -- Robert Benchley -% -Anyone can hold the helm when the sea is calm. - -- Publilius Syrus -% -Anyone can make an omelet with eggs. The trick is to make one with -none. -% -Anyone can say "no." It is the first word a child learns and often the -first word he speaks. It is a cheap word because it requires no -explanation, and many men and women have acquired a reputation for -intelligence who know only this word and have used it in place of -thought on every occasion. - -- Chuck Jones (Warner Bros. animation director.) -% -Anyone stupid enough to be caught by the police is probably guilty. -% -Anyone taking offence at fortune(s) is desperately lacking beer, in my -extremely humble opinion. - -- Philip Paeps -% -Anyone who cannot cope with mathematics is not fully human. At best he -is a tolerable subhuman who has learned to wear shoes, bathe and not -make messes in the house. - -- Lazarus Long, "Time Enough for Love" -% -Anyone who considers protocol unimportant has never dealt with a cat. - -- Robert A. Heinlein -% -Anyone who describes Islam as a religion as intolerant encourages violence. - -- Tasnim Aslam, Spokesman for Pakistani Foreign Ministry -% -Anyone who goes to a psychiatrist ought to have his head examined. - -- Samuel Goldwyn -% -Anyone who has attended a USENIX conference in a fancy hotel can tell you -that a sentence like "You're one of those computer people, aren't you?" -is roughly equivalent to "Look, another amazingly mobile form of slime -mold!" in the mouth of a hotel cocktail waitress. - -- Elizabeth Zwicky -% -Anyone who has had a bull by the tail -knows five or six more things than someone who hasn't. - -- Mark Twain -% -Anyone who imagines that all fruits ripen at the same time -as the strawberries, knows nothing about grapes. - -- Philippus Paracelsus -% -Anyone who is capable of getting themselves made President should on no -account be allowed to do the job. - -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -Anyone who knows history, particularly the history of Europe, will, I think, -recognize that the domination of education or of government by any one -particular religious faith is never a happy arrangement for the people. - -- Eleanor Roosevelt -% -Anyone who says he can see through women is missing a lot. - -- Groucho Marx -% -Anyone who uses the phrase "easy as taking candy from a baby" has never -tried taking candy from a baby. - -- Robin Hood -% -Anything anybody can say about America is true. - -- Emmett Grogan -% -Anything cut to length will be too short. -% -Anything free is worth what you pay for it. -% -Anything is good and useful if it's made of chocolate. -% -Anything is possible on paper. - -- Ron McAfee -% -Anything is possible, unless it's not. -% -Anything labeled "NEW" and/or "IMPROVED" isn't. -The label means the price went up. -The label "ALL NEW", "COMPLETELY NEW", or "GREAT NEW" -means the price went way up. -% -Anything that is good and useful is made of chocolate. -% -Anything that is worth doing has been done frequently. Things hitherto -undone should be given, I suspect, a wide berth. - -- Max Beerbohm, "Mainly on the Air" -% -Anything worth doing is worth overdoing. -% -Anyway, I keep picturing all these little kids playing some game in this -big field of rye and all. Thousands of little kids, and nobody's around -- -nobody big, I mean -- except me. And I'm standing on the edge of some crazy -cliff. What I have to do, I have to catch everybody if they start to go -over the cliff -- I mean if they're running and they don't look where they're -going I have to come out from somewhere and catch them. That's all I'd do -all day. I'd just be the catcher in the rye. I know it; I know it's crazy, -but that's the only thing I'd really like to be. I know it's crazy. - -- J. D. Salinger, "Catcher in the Rye" -% -Apathy Club meeting this Friday. -If you want to come, you're not invited. -% -Apathy is not the problem, it's the solution. -% -APHASIA: - Loss of speech in social scientists when asked - at parties, "But of what use is your research?" -% -Aphorism, n.: - A concise, clever statement. -Afterism, n.: - A concise, clever statement you don't think of until too late. - -- James Alexander Thom -% -APL hackers do it in the quad. -% -APL is a mistake, carried through to perfection. It is the language of the -future for the programming techniques of the past: it creates a new generation -of coding bums. - -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5 -% -APL is a natural extension of assembler language programming; -...and is best for educational purposes. - -- Alan J. Perlis -% -APL is a write-only language. I can write programs -in APL, but I can't read any of them. - -- Roy Keir -% -Appearances often are deceiving. - -- Aesop -% -APPENDIX: - A portion of a book, for which nobody yet has discovered any use. -% -Applause, n.: - The echo of a platitude from the mouth of a fool. - -- Ambrose Bierce, "The Devil's Dictionary" -% -April is the cruelest month... - -- Thomas Stearns Eliot -% -Aquadextrous, adj.: - Possessing the ability to turn the bathtub - faucet on and off with your toes. - -- Rich Hall & Friends, "Sniglets" -% -AQUARIUS (Jan 20 - Feb 18) - You have an inventive mind and are inclined to be progressive. - You lie a great deal. On the other hand, you are inclined to be - careless and impractical, causing you to make the same mistakes over - and over again. People think you are stupid. -% -AQUARIUS (Jan. 20 to Feb. 18) - A friend will step forward and confide in you about your breath. Rely - on your outgoing personality and winning smile to get you into a lot - of trouble. Be relaxed, things will change. Look for a pink slip on - payday. Stop wetting your bed. -% -AQUARIUS (Jan.20 - Feb.18) - You are the type of person who never has enough money to do what - you want. Don't expect things to get any better today, either. - As a matter of fact they might get worse. Intensify your - relationship with your bank and any friends you have who might be - able to lend you a few bucks. -% -Aquavit is also considered useful for medicinal purposes, an essential -ingredient in what I was once told is the Norwegian cure for the common -cold. You get a bottle, a poster bed, and the brightest colored stocking -cap you can find. You put the cap on the post at the foot of the bed, -then get into bed and drink aquavit until you can't see the cap. I've -never tried this, but it sounds as though it should work. - -- Peter Nelson -% -Arbitrary systems, pl.n.: - Systems about which nothing general can be said, save "nothing -general can be said." -% -ARCHDUKE FERDINAND FOUND ALIVE -- - FIRST WORLD WAR A MISTAKE -% -Are we not men? -% -Are we running light with overbyte? -% -Are Women Human? -In the year 584, in Lyon, France, 43 Catholic bishops and 20 men -representing other bishops, after a lengthy debate, took a vote. -The results were 32 yes, 31 no. Women were declared human by one -vote. -% -Are you a parent? Do you sometimes find yourself unsure as to what to -say in those awkward situations? Worry no more... - - Are you sure you're telling the truth? Think hard. - Does it make you happy to know you're sending me to an early grave? - If all your friends jumped off the cliff, would you jump too? - Do you feel bad? How do you think I feel? - Aren't you ashamed of yourself? - Don't you know any better? - How could you be so stupid? - If that's the worst pain you'll ever feel, you should be thankful. - You can't fool me. I know what you're thinking. - If you can't say anything nice, say nothing at all. -% -Are you a parent? Do you sometimes find yourself unsure as to what to -say in those awkward situations? Worry no more... - - Do as I say, not as I do. - Do me a favour and don't tell me about it. I don't want to know. - What did you do *this* time? - If it didn't taste bad, it wouldn't be good for you. - When I was your age... - I won't love you if you keep doing that. - Think of all the starving children in India. - If there's one thing I hate, it's a liar. - I'm going to kill you. - Way to go, clumsy. - If you don't like it, you can lump it. -% -Are you a parent? Do you sometimes find yourself unsure as to what to -say in those awkward situations? Worry no more... - - Go away. You bother me. - Why? Because life is unfair. - That's a nice drawing. What is it? - Children should be seen and not heard. - You'll be the death of me. - You'll understand when you're older. - Because. - Wipe that smile off your face. - I don't believe you. - How many times have I told you to be careful? - Just because. -% -Are you a parent? Do you sometimes find yourself unsure as to what to -say in those awkward situations? Worry no more... - - Good children always obey. - Quit acting so childish. - Boys don't cry. - If you keep making faces, someday it'll freeze that way. - Why do you have to know so much? - This hurts me more than it hurts you. - Why? Because I'm bigger than you. - Well, you've ruined everything. Now are you happy? - Oh, grow up. - I'm only doing this because I love you. -% -Are you a parent? Do you sometimes find yourself unsure as to what to -say in those awkward situations? Worry no more... - - When are you going to grow up? - I'm only doing this for your own good. - Why are you crying? Stop crying, or I'll give you something to - cry about. - What's wrong with you? - Someday you'll thank me for this. - You'd lose your head if it weren't attached. - Don't you have any sense at all? - If you keep sucking your thumb, it'll fall off. - Why? Because I said so. - I hope you have a kid just like yourself. -% -Are you a parent? Do you sometimes find yourself unsure as to what to -say in those awkward situations? Worry no more... - - You wouldn't understand. - You ask too many questions. - In order to be a man, you have to learn to follow orders. - That's for me to know and you to find out. - Don't let those bullies push you around. Go in there and stick - up for yourself. - You're acting too big for your britches. - Well, you broke it. Now are you satisfied? - Wait till your father gets home. - Bored? If you're bored, I've got some chores for you. - Shape up or ship out. -% -Are you a turtle? -% -Are you making all this up as you go along? -% -Are you sure the back door is locked? -% -Argue for your limitations, and sure enough, they're yours. - -- Messiah's Handbook: Reminders for the Advanced Soul -% -Arguments are extremely vulgar, for everyone -in good society holds exactly the same opinion. - -- Oscar Wilde -% -Arguments with furniture are rarely productive. - -- Kehlog Albran, "The Profit" -% -ARIES (Mar 21 - Apr 19) - You are the pioneer type and hold most people in contempt. You are - quick tempered, impatient, and scornful of advice. You are not - very nice. -% -ARIES (Mar.21 - Apr.19) - You are a wonderfully interesting, honest, hard-working person - and you should make many new friends, but you won't because you've - got a mean streak in you a mile wide. -% -ARITHMETIC: - An obscure art no longer practiced in - the world's developed countries. -% -Arithmetic is being able to count up to twenty without taking off your shoes. - -- Mickey Mouse -% -Armadillo, v.: - To provide weapons to a Spanish pickle. -% -Armenians and Azerbaijanis in Stepanakert, capital of the Nagorno-Karabakh -autonomous region, rioted over much needed spelling reform in the Soviet -Union. - -- P. J. O'Rourke -% -Armor's Axiom: - Virtue is the failure to achieve vice. -% -Armstrong's Collection Law: - If the check is truly in the mail, - it is surely made out to someone else. -% -Arnold's Laws of Documentation: - (1) If it should exist, it doesn't. - (2) If it does exist, it's out of date. - (3) Only documentation for useless programs transcends the - first two laws. -% -Around computers it is difficult to find the correct unit of time to -measure progress. Some cathedrals took a century to complete. Can you -imagine the grandeur and scope of a program that would take as long? - -- Epigrams in Programming, ACM SIGPLAN Sept. 1982 -% -Around the turn of this century, a composer named Camille Saint-Saens wrote -a satirical zoological-fantasy called "Le Carnaval des Animaux." Aside from -one movement of this piece, "The Swan", Saint-Saens didn't allow this work -to be published or even performed until a year had elapsed after his death. -(He died in 1921.) - Most of us know the "Swan" movement rather well, with its smooth, -flowing cello melody against a calm background; but I've been having this -fantasy... - What if he had written this piece with lyrics, as a song to be sung? -And, further, what if he had accompanied this song with a musical saw? (This -instrument really does exist, often played by percussionists!) Then the -piece would be better known as: - SAINT-SAENS' SAW SONG "SWAN"! -% -Arrakis teaches the attitude of the knife - chopping off what's -incomplete and saying: "Now it's complete because it's ended here." - -- Muad'dib, "Dune" -% -Art is a jealous mistress. - -- Ralph Waldo Emerson -% -Art is a lie which makes us realize the truth. - -- Picasso -% -Art is anything you can get away with. - -- Marshall McLuhan -% -Art is either plagiarism or revolution. - -- Paul Gauguin -% -Art is Nature speeded up and God slowed down. - -- Chazal -% -"Art" is the ability to separate the significant from the insignificant. - -- Poul Henningsen (1894-1967) -% -Art is the tree of life. Science is the tree of death. -% -Arthur's Laws of Love: - (1) People to whom you are attracted invariably think you - remind them of someone else. - (2) The love letter you finally got the courage to send will - be delayed in the mail long enough for you to make a fool - of yourself in person. -% -Article the Third: - Where a crime of the kidneys has been committed, the accused should - enjoy the right to a speedy diaper change. Public announcements and - guided tours of the aforementioned are not necessary. -Article the Fourth: - The decision to eat strained lamb or not should be with the "feedee" - and not the "feeder". Blowing the strained lamb into the feeder's - face should be accepted as an opinion, not as a declaration of war. -Article the Fifth: - Babies should enjoy the freedom to vocalize, whether it be in church, - a public meeting place, during a movie, or after hours when the - lights are out. They have not yet learned that joy and laughter have - to last a lifetime and must be conserved. - -- Erma Bombeck, "A Baby's Bill of Rights" -% -Artificial intelligence has the same relation to intelligence as -artificial flowers have to flowers. - -- David Parnas -% -Artistic ventures highlighted. Rob a museum. -% -As a computer, I find your faith in technology amusing. -% -As a professional humorist, I often get letters from readers who are -interested in the basic nature of humor. "What kind of a sick -perverted disgusting person are you," these letters typically ask, -"that you make jokes about setting fire to a goat?" ... - -- Dave Barry, "Why Humor is Funny" -% -As an adolescent I aspired to lasting fame, I craved factual certainty, and -I thirsted for a meaningful vision of human life -- so I became a scientist. -This is like becoming an archbishop so you can meet girls. - -- Matt Cartmill -% -As an Englishman, an Aussie and a Scotsman are sitting in a pub, quaffing -a few, three flies buzz down from the ceiling and lazily circle each drinker. -Suddenly "buzzzzzzzzplooop", each fly does a kamakazi dive into a different -glass. - The Englishman take a disgusted look at his pint, dips the fly out -with a spoon, flicks the fly over his shoulder, and drains the glass. - The Aussie notices the fly as he puts the glass to his lips. With -a quick puff he blows the bug out in a cloud of foam, and tosses the beer -down in one gulp. - Then, as they both look on, awestruck, the Scotsman gently grasps the -fly by its wings, lifts it out of his brew and shakes it off. Then, in a -firm voice he speaks to the fly: "There y'are now laddie, safe and sound. -NOW SPIT IT OOOOT!" -% -As crazy as hauling timber into the woods. - -- Quintus Horatius Flaccus (Horace) -% -As failures go, attempting to recall the past is like trying to grasp -the meaning of existence. Both make one feel like a baby clutching at -a basketball: one's palms keep sliding off. - -- Joseph Brodsky -% -As far as the laws of mathematics refer to reality, they are not -certain, and as far as they are certain, they do not refer to reality. - -- Albert Einstein -% -As far as we know, our computer has never had an undetected error. - -- Weisert -% -As flies to wanton boys are we to the gods; they kill us for their sport. - -- William Shakespeare, "King Lear" -% -As for the women, though we scorn and flout 'em, -We may live with, but cannot live without 'em. - -- Frederic Reynolds -% -As Gen. de Gaulle occasionally acknowledges America to be the daughter -of Europe, so I am pleased to come to Yale, the daughter of Harvard. - -- John F. Kennedy -% -As goatherd learns his trade by goat, so writer learns his trade by wrote. -% -As he had feared, his orders had been forgotten and everyone had brought -the potato salad. -% -As I argued in "Beloved Son", a book about my son Brian and the subject of -religious communes and cults, one result of proper early instruction in the -methods of rational thought will be to make sudden mindless conversions -- -to anything -- less likely. Brian now realizes this and has, after eleven -years, left the sect he was associated with. The problem is that once the -untrained mind has made a formal commitment to a religious philosophy -- -and it does not matter whether that philosophy is generally reasonable and -high-minded or utterly bizarre and irrational -- the powers of reason are -surprisingly ineffective in changing the believer's mind. - -- Steve Allen -% -As I bit into the nectarine, it had a crisp juiciness about it that was very -pleasurable - until I realized it wasn't a nectarine at all, but A HUMAN HEAD!! - -- Jack Handey -% -As I thought, no better from this side. - -- Eeyore -% -As I was going up Punch Card Hill, - Feeling worse and worser, -There I met a C.R.T. - And it drop't me a cursor. - -C.R.T., C.R.T., - Phosphors light on you! -If I had fifty hours a day - I'd spend them all at you. - -- Uncle Colonel's Cursory Rhymes -% -As I was passing Project MAC, -I met a Quux with seven hacks. -Every hack had seven bugs; -Every bug had seven manifestations; -Every manifestation had seven symptoms. -Symptoms, manifestations, bugs, and hacks, -How many losses at Project MAC? -% -As I was walking down the street one dark and dreary day, -I came upon a billboard and much to my dismay, -The words were torn and tattered, -From the storm the night before, -The wind and rain had done its work and this is how it goes, - -Smoke Coca-Cola cigarettes, chew Wrigleys Spearmint beer, -Ken-L-Ration dog food makes your complexion clear, -Simonize your baby in a Hershey candy bar, -And Texaco's a beauty cream that's used by every star. - -Take your next vacation in a brand new Frigidaire, -Learn to play the piano in your winter underwear, -Doctors say that babies should smoke until they're three, -And people over sixty-five should bathe in Lipton tea. -% -As in certain cults it is possible to -kill a process if you know its true name. - -- Ken Thompson and Dennis M. Ritchie -% -As in Protestant Europe, by contrast, where sects divided endlessly into -smaller competing sects and no church dominated any other, all is different -in the fragmented world of IBM. That realm is now a chaos of conflicting -norms and standards that not even IBM can hope to control. You can buy a -computer that works like an IBM machine but contains nothing made or sold by -IBM itself. Renegades from IBM constantly set up rival firms and establish -standards of their own. When IBM recently abandoned some of its original -standards and decreed new ones, many of its rivals declared a puritan -allegiance to IBM's original faith, and denounced the company as a divisive -innovator. Still, the IBM world is united by its distrust of icons and -imagery. IBM's screens are designed for language, not pictures. Graven -images may be tolerated by the luxurious cults, but the true IBM faith relies -on the austerity of the word. - -- Edward Mendelson, "The New Republic", February 22, 1988 -% -As long as I am mayor of this city [Jersey City, New Jersey] the great -industries are secure. We hear about constitutional rights, free speech -and the free press. Every time I hear these words I say to myself, "That -man is a Red, that man is a Communist". You never hear a real American -talk like that. - -- Frank Hague (1896-1956) -% -As long as the answer is right, who cares if the question is wrong? -% -As long as there are ill-defined goals, bizarre bugs, and unrealistic -schedules, there will be Real Programmers willing to jump in and Solve -The Problem, saving the documentation for later. -% -As long as war is regarded as wicked, it will always have its fascination. -When it is looked upon as vulgar, it will cease to be popular. - -- Oscar Wilde, "Intentions" -% -As many of you know, I am taking a class here at UNC on Personality. -One of the tests to determine personality in our book was so incredibly -useful and interesting, I just had to share it. - -Answer each of the following items "true" or "false" - - 1. I salivate at the sight of mittens. - 2. If I go into the street, I'm apt to be bitten by a horse. - 3. Some people never look at me. - 4. Spinach makes me feel alone. - 5. My sex life is A-okay. - 6. When I look down from a high spot, I want to spit. - 7. I like to kill mosquitoes. - 8. Cousins are not to be trusted. - 9. It makes me embarrassed to fall down. -10. I get nauseous from too much roller skating. -11. I think most people would cry to gain a point. -12. I cannot read or write. -13. I am bored by thoughts of death. -14. I become homicidal when people try to reason with me. -15. I would enjoy the work of a chicken flicker. -16. I am never startled by a fish. -17. My mother's uncle was a good man. -18. I don't like it when somebody is rotten. -19. People who break the law are wise guys. -20. I have never gone to pieces over the weekend. -% -As many of you know, I am taking a class here at UNC on Personality. -One of the tests to determine personality in our book was so incredibly -useful and interesting, I just had to share it. - -Answer each of the following items "true" or "false" - - 1. I think beavers work too hard. - 2. I use shoe polish to excess. - 3. God is love. - 4. I like mannish children. - 5. I have always been disturbed by the sight of Lincoln's ears. - 6. I always let people get ahead of me at swimming pools. - 7. Most of the time I go to sleep without saying goodbye. - 8. I am not afraid of picking up door knobs. - 9. I believe I smell as good as most people. -10. Frantic screams make me nervous. -11. It's hard for me to say the right thing when I find myself in a room - full of mice. -12. I would never tell my nickname in a crisis. -13. A wide necktie is a sign of disease. -14. As a child I was deprived of licorice. -15. I would never shake hands with a gardener. -16. My eyes are always cold. -17. Cousins are not to be trusted. -18. When I look down from a high spot, I want to spit. -19. I am never startled by a fish. -20. I have never gone to pieces over the weekend. -% -As me an' me marrer was readin' a tyape, -The tyape gave a shriek mark an' tried tae escyape; -It skipped ower the gyate tae the end of the field, -An' jigged oot the room wi' a spool an' a reel! -Follow the leader, Johnny me laddie, -Follow it through, me canny lad O; -Follow the transport, Johnny me laddie, -Away, lad, lie away, canny lad O! - -- S. Kelly-Bootle, "The Devil's DP Dictionary" -% -As of next Thursday, UNIX will be flushed in favor of TOPS-10. -Please update your programs. -% -As of next Tuesday, C will be flushed in favor of COBOL. -Please update your programs. -% -As of next week, passwords will be entered in Morse code. -% -As part of an ongoing effort to keep you, the Fortune reader, abreast of -the valuable information the daily crosses the USENET, Fortune presents: - -News articles that answer *your* questions, #1: - - Newsgroups: comp.sources.d - Subject: how do I run C code received from sources - Keywords: C sources - Distribution: na - - I do not know how to run the C programs that are posted in the - sources newsgroup. I save the files, edit them to remove the - headers, and change the mode so that they are executable, but I - cannot get them to run. (I have never written a C program before.) - - Must they be compiled? With what compiler? How do I do this? If - I compile them, is an object code file generated or must I generate - it explicitly with the > character? Is there something else that - must be done? -% -As part of the conversion, computer specialists rewrote 1,500 programs; -a process that traditionally requires some debugging. - -- USA Today, referring to the Internal Revenue Service - conversion to a new computer system. -% -As some day it may happen that a victim must be found -I've got a little list -- I've got a little list -Of society offenders who might well be underground -And who never would be missed -- who never would be missed. - -- Koko, "The Mikado" -% -As soon as we started programming, we found to our surprise that it wasn't -as easy to get programs right as we had thought. Debugging had to be -discovered. I can remember the exact instant when I realized that a large -part of my life from then on was going to be spent in finding mistakes in -my own programs. - -- Maurice Wilkes, designer of EDSAC, on programming, 1949 -% -As the poet said, "Only God can make a tree" -- probably -because it's so hard to figure out how to get the bark on. - -- Woody Allen -% -As the system comes up, the component builders will from time to time appear, -bearing hot new versions of their pieces -- faster, smaller, more complete, -or putatively less buggy. The replacement of a working component by a new -version requires the same systematic testing procedure that adding a new -component does, although it should require less time, for more complete and -efficient test cases will usually be available. - -- Frederick Brooks, Jr., "The Mythical Man-Month" -% -As the trials of life continue to take their toll, remember that there -is always a future in Computer Maintenance. - -- National Lampoon, "Deteriorata" -% -As to Jesus of Nazareth... I think the system of Morals and his Religion, -as he left them to us, the best the World ever saw or is likely to see; -but I apprehend it has received various corrupting Changes, and I have, -with most of the present Dissenters in England, some doubts as to his -divinity. - -- Benjamin Franklin -% -As well look for a needle in a bottle of hay. - -- Miguel de Cervantes -% -As Will Rogers would have said, -"There is no such things as a free variable." -% -As with most fine things, chocolate has its season. There is a simple memory -aid that you can use to determine whether it is the correct time to order -chocolate dishes: Any month whose name contains the letter A, E, or U is the -proper time for chocolate. - -- Sandra Boynton, "Chocolate: The Consuming Passion" -% -As you grow older, you will still do foolish things, -but you will do them with much more enthusiasm. - -- The Cowboy -% -As you know, birds do not have sexual organs because they would -interfere with flight. [In fact, this was the big breakthrough for the -Wright Brothers. They were watching birds one day, trying to figure -out how to get their crude machine to fly, when suddenly it dawned on -Wilbur. "Orville," he said, "all we have to do is remove the sexual -organs!" You should have seen their original design.] As a result, -birds are very, very difficult to arouse sexually. You almost never -see an aroused bird. So when they want to reproduce, birds fly up and -stand on telephone lines, where they monitor telephone conversations -with their feet. When they find a conversation in which people are -talking dirty, they grip the line very tightly until they are both -highly aroused, at which point the female gets pregnant. - -- Dave Barry, "Sex and the Single Amoeba: What Every - Teen Should Know" -% -As you reach for the web, a venomous spider appears. Unable to pull -your hand away in time, the spider promptly, but politely, bites you. -The venom takes affect quickly causing your lips to turn plaid along -with your complexion. You become dazed, and in your stupor you fall -from the limbs of the tree. Snap! Your head falls off and rolls all -over the ground. The instant before you croak, you hear the whoosh of -a vacuum being filled by the air surrounding your head. Worse yet, the -spider is suing you for damages. -% -As you will see, I told them, in no uncertain terms, to see Figure one. - -- Dave "First Strike" Pare -% -As Zeus said to Narcissus, "Watch yourself." -% -Ascend to the high mountain pass, -Cross the shallow side of the wide ocean. -Do not give up to the great distance: -It's by going that you will reach your aim. -Be not discouraged by human frailty: -You will overcome it if you try to. - -- Chinggis (Genghis) Khan -% -ASCII: - The control code for all beginning programmers and those who would - become computer literate. Etymologically, the term has come down as - a contraction of the often-repeated phrase "ascii and you shall - receive." - -- Robb Russon -% -ASCII a stupid question, you get an EBCDIC answer. -% -ASHes to ASHes, DOS to DOS. -% -Ashes to ashes, dust to dust, -If God won't have you, the devil must. -% -Ask five economists and you'll get five different explanations (six if -one went to Harvard). - -- Edgar R. Fiedler -% -Ask not for whom the Bell tolls, and you -will pay only the station-to-station rate. - -- Howard Kandel -% -Ask not for whom the tolls. -% -Ask not for whom the telephone bell tolls ... -if thou art in the bathtub, it tolls for thee. -% -Ask not what's inside your head, but what your head's inside of. - -- J. J. Gibson -% -Ask your boss to reconsider -- it's so difficult to take "Go to hell" -for an answer. -% -Ask yourself whether you are happy and you cease to be so. - -- John Stuart Mill -% -Asked how she felt being the first woman to make a major-league team, she -said, "Like a pig in mud," or words to that effect, and then turned and -released a squirt of tobacco juice from the wad of rum soaked plug in her -right cheek. She chewed a rare brand of plug called Stuff It, which she -learned to chew when she was playing Nicaraguan summer ball. She told the -writers, "They were so mean to me down there you couldn't write it in your -newspaper. I took a gun everywhere I went, even to bed. *Especially* to -bed. Guys were after me like you can't believe. That's when I started -chewing tobacco -- because no matter how bad anybody treats you, it's not -as bad as this. This is the worst chew in the world. After this, -everything else is peaches and cream." The writers elected Gentleman Jim, -the Sparrow's P.R. guy, to bite off a chunk and tell them how it tasted, -and as he sat and chewed it tears ran down his old sunburnt cheeks and he -couldn't talk for a while. Then he whispered, "You've been chewing this for -two years? God, I had no idea it was so hard to be a woman." - -- Garrison Keillor -% -Asking a working writer what he thinks about critics is like asking a -lamp-post how it feels about dogs. - -- Christopher Hampton -% -Assembly language experience is [important] for the maturity -and understanding of how computers work that it provides. - -- D. Gries -% -Associate with well-mannered persons and your manners will improve. Run -with decent folk and your own decent instincts will be strengthened. Keep -the company of bums and you will become a bum. Hang around with rich people -and you will end by picking up the check and dying broke. - -- Stanley Walker -% -Astrology... just a bunch of Taurus. -% -Asynchronous inputs are at the root of our race problems. - -- D. Winker and F. Prosser -% -At about 2500 A.D., humankind discovers a computer problem that *must* be -solved. The only difficulty is that the problem is NP complete and will -take thousands of years even with the latest optical biologic technology -available. The best computer scientists sit down to think up some solution. -In great dismay, one of the C.S. people tells her husband about it. There -is only one solution, he says. Remember physics 103, Modern Physics, general -relativity and all. She replies, "What does that have to do with solving -a computer problem?" - "Remember the twin paradox?" - After a few minutes, she says, "I could put the computer on a very -fast machine and the computer would have just a few minutes to calculate but -that is the exact opposite of what we want... Of course! Leave the -computer here, and accelerate the earth!" - The problem was so important that they did exactly that. When -the earth came back, they were presented with the answer: - - IEH032 Error in JOB Control Card. -% -At any given moment, an arrow must be either where it is or where it is -not. But obviously it cannot be where it is not. And if it is where -it is, that is equivalent to saying that it is at rest. - -- Zeno's paradox of the moving (still?) arrow -% -At ebb tide I wrote a line upon the sand, and gave it all my heart and all -my soul. At flood tide I returned to read what I had inscribed and found my -ignorance upon the shore. - -- Kahlil Gibran -% -At first, I just did it on weekends. With a few friends, you know... -We never wanted to hurt anyone. The girls loved it. We'd all sit -around the computer and do a little UNIX. It was just a kick. At -least that's what we thought. Then it got worse. - -It got so I'd have to do some UNIX during the weekdays. After a -while, I couldn't even wake up in the morning without having that -crave to go do UNIX. Then it started affecting my job. I would just -have to do it during my break. Maybe a `grep' or two, maybe a little -`more'. I eventually started doing UNIX just to get through the day. -Of course, it screwed up my mind so much that I couldn't even -function as a normal person. - -I'm lucky today, I've overcome my UNIX problem. It wasn't easy. If -you're smart, just don't start. Remember, if any weirdo offers you -some UNIX, - - Just Say No! -% -At first sight, the idea of any rules or principles being superimposed on -the creative mind seems more likely to hinder than to help, but this is -quite untrue in practice. Disciplined thinking focuses inspiration rather -than blinkers it. - -- G. L. Glegg, "The Design of Design" -% -At Group L, Stoffel oversees six first-rate programmers, -a managerial challenge roughly comparable to herding cats. - -- "The Washington Post Magazine", June 9, 1985 -% -At last I've found the girl of my dreams. Last night she said to me, -"Once more, Strange, and this time *I'll* be Donnie and *you* be Marie. - -- Strange de Jim -% -At least I thought I was dancing, 'til somebody stepped on my hand. - -- J. B. White -% -At least they're _E_X_P_E_R_I_E_N_C_E_D incompetents. -% -At no time is freedom of speech more precious than when a man hits his -thumb with a hammer. - -- Marshall Lumsden -% -At once it struck me what quality went to form a man of achievement, -especially in literature, and which Shakespeare possessed so enormously --- I mean negative capability, that is, when a man is capable of being -in uncertainties, mysteries, doubts, without any irritable reaching -after fact and reason. - -- John Keats -% -At social gatherings, I would amuse everyone by standing uponst the -coffee table and striking meself repeatedly upon the head with a brick. - -- H. R. Gumby -% -At the end of your life there'll be a good rest, -and no further activities are scheduled. -% -At the foot of the mountain, thunder: -The image of Providing Nourishment. -Thus the superior man is careful of his words -And temperate in eating and drinking. -% -At the heart of science is an essential tension between two seemingly -contradictory attitudes -- an openness to new ideas, no matter how bizarre -or counterintuitive they may be, and the most ruthless skeptical scrutiny -of all ideas, old and new. This is how deep truths are winnowed from deep -nonsense. Of course, scientists make mistakes in trying to understand the -world, but there is a built-in error-correcting mechanism: The collective -enterprise of creative thinking and skeptical thinking together keeps the -field on track. - -- Carl Sagan, "The Fine Art of Baloney Detection" -% -At the hospital, a doctor is training an intern on how to announce bad news -to the patients. The doctor tells the intern "This man in 305 is going to -die in six months. Go in and tell him." The intern boldly walks into the -room, over to the man's bedside and tells him "Seems like you're gonna die!" -The man has a heart attack and is rushed into surgery on the spot. The doctor -grabs the intern and screams at him, "What!?!? are you some kind of moron? -You've got to take it easy, work your way up to the subject. Now this man in -213 has about a week to live. Go in and tell him, but, gently, you hear me, -gently!" - The intern goes softly into the room, humming to himself, cheerily -opens the drapes to let the sun in, walks over to the man's bedside, fluffs -his pillow and wishes him a "Good morning!" "Wonderful day, no? Say... -guess who's going to die soon!" -% -At the source of every error which is blamed on the computer you will find -at least two human errors, including the error of blaming it on the computer. -% -At these prices, I lose money -- but I make it up in volume. - -- Peter G. Alaquon -% -At times discretion should be thrown aside, -and with the foolish we should play the fool. - -- Menander -% -At work, the authority of a person is inversely proportional to the -number of pens that person is carrying. -% -Atheism is a non-prophet organization. -% -ATLANTA: - An entire city surrounded by an airport. -% -Atlanta makes it against the law to tie a giraffe to a telephone pole -or street lamp. -% -Atlee is a very modest man. And with reason. - -- Winston Churchill -% -Attempting to stop MySQL by buying companies around it is like trying -to kill a dolphin by drinking the ocean. - -- Marten Mickos -% -Attorney General Edwin Meese III explained why the Supreme Court's Miranda -decision (holding that subjects have a right to remain silent and have a -lawyer present during questioning) is unnecessary: "You don't have many -suspects who are innocent of a crime. That's contradictory. If a person -is innocent of a crime, then he is not a suspect." - -- U.S. News and World Report, 10/14/85 -% -Auction, n.: - A gyp off the old block. -% -Audacity, and again, audacity, and always audacity. - -- G. J. Danton -% -Audiophile, n.: - Someone who listens to the equipment instead of the music. -% -Auribus teneo lupum. -[I hold a wolf by the ears.] -% -AUTHENTIC: - Indubitably true, in somebody's opinion. -% -Authors (and perhaps columnists) eventually rise to the top of whatever -depths they were once able to plumb. - -- Stanley Kaufman -% -Authors are easy to get on with -- if you're fond of children. - -- Michael Joseph, "Observer" -% -Automobile, n.: - A four-wheeled vehicle that runs up hills and down - pedestrians. -% -Avec! -% -Avert misunderstanding by calm, poise, and balance. -% -Avoid cliches like the plague. -They're a dime a dozen. -% -Avoid gunfire in the bathroom tonight. -% -Avoid Quiet and Placid persons unless you are in Need of Sleep. - -- National Lampoon, "Deteriorata" -% -Avoid reality at all costs. -% -Avoid revolution or expect to get shot. Mother and I will grieve, but -we will gladly buy a dinner for the National Guardsman who shot you. - -- Dr. Paul Williamson, father of a Kent State student -% -Avoid strange women and temporary variables. -% -Awash with unfocused desire, Everett twisted the lobe of his one remaining -ear and felt the presence of somebody else behind him, which caused terror -to push through his nervous system like a flash flood roaring down the -mid-fork of the Feather River before the completion of the Oroville Dam -in 1959. - -- Grand Panjandrum's Special Award, 1984 Bulwer-Lytton - bad fiction contest. -% -Bacchus, n.: - A convenient deity invented by the ancients - as an excuse for getting drunk. - -- Ambrose Bierce, "The Devil's Dictionary" -% -BACHELOR: - A guy who is footloose and fiancee-free. -% -BACHELOR: - A man who chases women and never Mrs. one. -% -Back in '80 or '81 the workers were rioting in Gdansk and there were fears -that the Soviets would invade Poland to put down the demonstrations. Foreign -correspondents were curious as to just what the Poles would do if they were -invaded. They asked, "What will you do if the East Germans invade from the -West and the Soviets invade from the East? Who will you fight first?" - To which the Poles replied, "Why, we will fight the Germans first. -Business before pleasure." -% -Back in the early 60's, touch tone phones only had 10 buttons. Some -military versions had 16, while the 12 button jobs were used only by people -who had "diva" (digital inquiry, voice answerback) systems -- mainly banks. -Since in those days, only Western Electric made "data sets" (modems) the -problems of terminology were all Bell System. We used to struggle with -written descriptions of dial pads that were unfamiliar to most people -(most phones were rotary then.) Partly in jest, some AT&T engineering -types (there was no marketing in the good old days, which is why they were -the good old days) made up the term "octalthorpe" (note spelling) to denote -the "pound sign." Presumably because it has 8 points sticking out. It -never really caught on. -% -Back when I was a boy, it was 40 miles to everywhere, -uphill both ways and it was always snowing. -% -BACKWARD CONDITIONING: - Putting saliva in a dog's mouth in an attempt to make a bell ring. -% -Bacon's not the only thing that's cured by hanging from a string. -% -BAD CRAZINESS, MAN!!! -% -Bad men live that they may eat and drink, -whereas good men eat and drink that they may live. - -- Socrates -% -Bagbiter: - 1. n.; Equipment or program that fails, usually -intermittently. 2. adj.: Failing hardware or software. "This -bagbiting system won't let me get out of spacewar." Usage: verges on -obscenity. Grammatically separable; one may speak of "biting the -bag". Synonyms: LOSER, LOSING, CRETINOUS, BLETCHEROUS, BARFUCIOUS, -CHOMPER, CHOMPING. -% -Bagdikian's Observation: - Trying to be a first-rate reporter on the average American newspaper - is like trying to play Bach's "St. Matthew Passion" on a ukulele. -% -Bahdges? We don't need no stinkin' bahdges! - -- "The Treasure of Sierra Madre" -% -Baker's First Law of Federal Geometry: - A block grant is a solid mass of money - surrounded on all sides by governors. -% -BALLISTOPHOBIA: - Fear of bullets; -OTOPHOBIA: - Fear of opening one's eyes. -PECCATOPHOBIA: - Fear of sinning. -TAPHEPHOBIA: - Fear of being buried alive. -SITOPHOBIA: - Fear of food. -TRICHOPHOBIA: - Fear of hair. -VESTIPHOBIA: - Fear of clothing. -% -BALTIMORE: - A wharf-rat stealing Diogenes' lamp. -% -Ban the bomb. Save the world for conventional warfare. -% -Banacek's Eighteenth Polish Proverb: - The hippo has no sting, but the wise - man would rather be sat upon by the bee. -% -Banectomy, n.: - The removal of bruises on a banana. - -- Rich Hall, "Sniglets" -% -Bank error in your favor. Collect $200. -% -Barach's Rule: - An alcoholic is a person who drinks more than his own physician. -% -Barbara's Rules of Bitter Experience: - (1) When you empty a drawer for his clothes - and a shelf for his toiletries, the relationship ends. - (2) When you finally buy pretty stationary - to continue the correspondence, he stops writing. -% -Bare feet magnetize sharp metal objects so they point upward from the -floor -- especially in the dark. -% -Barker's Proof: - Proofreading is more effective after publication. -% -Barometer, n.: - An ingenious instrument which indicates - what kind of weather we are having. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Barth's Distinction: - There are two types of people: those who divide people into two -types, and those who don't. -% -Baruch's Observation: - If all you have is a hammer, everything looks like a nail. -% -Base 8 is just like base 10, if you are missing two fingers. - -- Tom Lehrer -% -Baseball is a skilled game. It's America's game -- it, and high taxes. - -- Will Rogers -% -Basic Definitions of Science: - If it's green or wiggles, it's biology. - If it stinks, it's chemistry. - If it doesn't work, it's physics. -% -Basic is a high level languish. -APL is a high level anguish. -% -BASIC is the Computer Science equivalent of "Scientific Creationism." -% -BASIC is to computer programming as QWERTY is to typing. - -- Seymour Papert -% -BASIC, n.: - A programming language. Related to certain social diseases in - that those who have it will not admit it in polite company. -% -Basically my wife was immature. I'd be at home in the bath and she'd -come in and sink my boats. - -- Woody Allen -% -Bathquake, n.: - The violent quake that rattles the entire house when the water - faucet is turned on to a certain point. - -- Rich Hall, "Sniglets" -% -Batteries not included. -% -Battle, n.: - A method of untying with the teeth a political knot that - will not yield to the tongue. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Be a better psychiatrist and the world -will beat a psychopath to your door. -% -BE A LOOF! (There has been a recent population explosion of lerts.) -% -BE ALERT!!!! (The world needs more lerts...) -% -Be assured that a walk through the ocean of most Souls would scarcely -get your Feet wet. Fall not in Love, therefore: it will stick to your -face. - -- National Lampoon, "Deteriorata" -% -Be both a speaker of words and a doer of deeds. - -- Homer -% -Be braver -- you can't cross a chasm in two small jumps. -% -Be careful! Is it classified? -% -Be careful! UGLY strikes 9 out of 10! -% -Be careful how you get yourself involved with persons or -situations that can't bear inspection. -% -Be careful of reading health books, you might die of a misprint. - -- Mark Twain -% -Be careful what you set your heart on -- for it will surely be yours. - -- James Baldwin, "Nobody Knows My Name" -% -Be careful when a loop exits to the same place from side and bottom. -% -Be careful when you bite into your hamburger. - -- Derek Bok -% -Be cautious in your daily affairs. -% -Be cheerful while you are alive. - -- Phathotep, 24th Century B.C. -% -Be circumspect in your liaisons with women. It is better -to be seen at the opera with a man than at mass with a woman. - -- De Maintenon -% -Be different: conform. -% -Be frank and explicit with your lawyer ... it is his business to confuse -the issue afterwards. -% -Be free and open and breezy! Enjoy! -Things won't get any better so get used to it. -% -Be incomprehensible. If they can't understand, they can't disagree. -% -Be independent. -Insult a rich relative today. -% -Be it our wealth, our jobs, or even our homes; -nothing is safe while the legislature is in session. -% -Be nice to people on the way up, because you'll meet them on your way down. - -- Wilson Mizner -% -Be not anxious about what you have, but about what you are. - -- Pope St. Gregory I -% -Be open to other people -- they may enrich your dream. -% -Be prepared to accept sacrifices. -Vestal virgins aren't all that bad. -% -Be regular and orderly in your life, so that you may be violent -and original in your work. - -- Flaubert -% -Be security conscious -- National Defense is at stake. -% -Be self-reliant and your success is assured. -% -Be sociable. -Speak to the person next to you in the unemployment line tomorrow. -% -Be sure to evaluate the bird-hand/bush ratio. -% -Be valiant, but not too venturous. -Let thy attire be comely, but not costly. - -- John Lyly -% -Beachhead, n.: - In marketing: A small piece of a market over which you gain - control and from which you go out to control other pieces of - the market. - - In war: Where soldiers die. -% -Beam me up, Scotty! -% -Beam me up, Scotty! It ate my phaser! -% -Beam me up, Scotty, there's no intelligent life down here! -% -Beat your son every day; you may not know why, but he will. -% -BEAUTY: - What's in your eye when you have a bee in your hand. -% -Beauty and harmony are as necessary to you as the very breath of life. -% -Beauty, brains, availability, personality; pick any two. -% -Beauty is one of the rare things which does not lead to doubt of God. - -- Jean Anouilh -% -Beauty is truth, truth beauty, that is all -Ye know on earth, and all ye need to know. - -- John Keats -% -Beauty may be skin deep, but ugly goes clear to the bone. - -- Redd Foxx -% -Because I do, -Because I do not hope, -Because I do not hope to survive -Injustice from the Palace, death from the air, -Because I do, only do, -I continue... - -- T. S. Pynchon -% -Because the wine remembers. -% -Because we don't think about future generations, -they will never forget us. - -- Henrik Tikkanen -% -Been through hell? -What did you bring back for me? -% -Been Transferred Lately? -% -Beer -- it's not just for breakfast anymore. -% -Beer & Pretzels -- Breakfast of Champions. -% -Bees are very busy souls -They have no time for birth controls -And that is why in times like these -There are so many Sons of Bees. -% -Before borrowing money from a friend, decide which you need more. - -- Addison H. Hallock -% -Before destruction a man's heart is -haughty, but humility goes before honour. - -- Psalms 18:12 -% -...before I could come to any conclusion it occurred to me that my speech -or my silence, indeed any action of mine, would be a mere futility. What -did it matter what anyone knew or ignored? What did it matter who was -manager? One gets sometimes such a flash of insight. The essentials of -this affair lay deep under the surface, beyond my reach, and beyond my -power of meddling. - -- Joseph Conrad -% -Before I knew the best part of my life had come, it had gone. -% -Before marriage the three little words are "I love you," after marriage -they are "Let's eat out." -% -Before really embarking on a sizeable project, in particular before -starting the large investment of coding, try to kill the project -first. - -- Edsger W. Dijkstra, EWD1308 -% -Before Xerox, five carbons were the maximum extension of anybody's ego. -% -Before you ask more questions, think about whether -you really want to know the answers. - -- Gene Wolfe, "The Claw of the Conciliator" -% -Before you criticize someone, you should walk a mile in their shoes. -That way, when you criticize them, you're a mile away and you have -their shoes. -% -Begathon, n.: - A multi-day event on public television, used to raise money so -you won't have to watch commercials. -% -Beggar to well-dressed businessman: - "Could you spare $20.95 for a fifth of Chivas?" -% -Beggars should be no choosers. - -- John Heywood -% -Behind every argument is someone's ignorance. -% -Behind every great computer sits a skinny little geek. -% -Behind every successful man you'll find a woman with nothing to wear. -% -Behold the fool saith, "Put not all thine eggs in the one basket" -- which -is but a manner of saying, "Scatter your money and your attention"; but -the wise man saith, "Put all your eggs in the one basket and -- watch that -basket!" - -- Mark Twain -% -Behold the warranty -- the bold print -giveth and the fine print taketh away. -% -Beifeld's Principle: - The probability of a young man meeting a desirable and -receptive young female increases by pyramidal progression when he is -already in the company of: (1) a date, (2) his wife, (3) a better -looking and richer male friend. -% -Being a mime means never having to say you're sorry. -% -Being a miner, as soon as you're too old and tired and sick and -stupid to do your job properly, you have to go, where the very -opposite applies with the judges. - -- Beyond the Fringe -% -Being a woman is a terribly difficult trade, -since it consists principally of dealings with men. - -- Conrad -% -Being asked solicitously about the state of her health was becoming bothersome -to the pregnant woman at the cocktail party. And yet another guest went over -and inquired, "Well, how are you feeling these days?" - "Not too well," said the expectant mother. "You know, I've missed -seven or eight periods now and it's beginning to worry me." -% -Being conservative has never been regarded as old-fashioned. But -if you fight for a sensible step in the right direction which others -has deserted you will be branded "reactionary". - -- Poul Henningsen (1894-1967) -% -"Being disintegrated makes me ve-ry an-gry!" -% -Being frustrated is disagreeable, but the real -disasters in life begin when you get what you want. -% -Being in politics is like being a football coach. You have to be smart -enough to understand the game and dumb enough to think it's important. - -- Eugene McCarthy -% -Being in the army is like being in the Boy Scouts, except that the -Boy Scouts have adult supervision. - -- Blake Clark -% -Being owned by someone used to be called -slavery -- now it's called commitment. -% -Being popular is important. Otherwise people might not like you. -% -Being the #2 man in the Justice Department under Ed Meese is akin to -standing next to a lamp post infested with pigeons. - -- unnamed Justice Department official -% -Being ugly isn't illegal. Yet. -% -Belief, n.: - Something you do not believe. -% -Believe everything you hear about the world; nothing is too -impossibly bad. - -- Honore de Balzac -% -Bell Labs Unix -- Reach out and grep someone. -% -Ben, why didn't you tell me? - -- Luke Skywalker -% -Bennett's Laws of Horticulture: - (1) Houses are for people to live in. - (2) Gardens are for plants to live in. - (3) There is no such thing as a houseplant. -% -Benson, you are so free of the ravages of intelligence. - -- Time Bandits -% -Benson's Dogma: - ASCII is our god, and Unix is his profit. -% -Bento's Law: If It Can Break, It Will Break -Bento's Corollary: If It Can Break, Kris Can Send Mail About It -% -Berkeley had what we called "copycenter," which is "take it down -to the copy center and make as many copies as you want." - -- Kirk McKusick -% -Bernard Shaw is an excellent man; he has not an enemy in the world, and -none of his friends like him either. - -- Oscar Wilde -% -Bernard was a young eighty-three, not a gomer, and able to talk. He'd been -transferred from MBH (Man's Best Hospital), the House's Rival. Founded in -Colonial times by the WASPs, the insemination of MBH by non-WASPs had taken -place only mid-twentieth century with the token multidextrous Oriental -surgeon, and finally, with the token red-hot internal-medicine Jew. Yet, -MBH was still Brooks Brothers, while the House was still the Garment District. -For Jews at MBH the password was "Dress British, Think Yiddish." It was -rare to get a TURF from the MBH to the House, and the Fat Man was curious: -"Bernard, you went to the MBH, they did a great work-up, and you told them, -after they got done, you wanted to be transferred here. Why?" - "I rilly don't know," said Bernard. - "Was it the doctors there? The doctors you didn't like?" - "The doctus? Nah, the doctus I can't complain." - "The test or the room?" - "The tests or the room? Vell, nah, about them I can't complain." - "The nurses? The food?" asked Fats, but Bernard shook his head no. -Fats laughed and said, "Listen, Bernie, you went to the MBH, they did this -great workup, and when I asked you shy you came to the House of God, all you -tell me is, 'Nah, I can't complain.' So why did you come here? Why, Bernie, -why?" - "Vhy I come heah? Vell, said Bernie, "Heah I can complain." - -- House of God -% -Bershere's Formula for Failure: - There are only two kinds of people who fail: those who - listen to nobody... and those who listen to everybody. -% -Besides the device, the box should contain: - -* Eight little rectangular snippets of paper that say "WARNING" - -* A plastic packet containing four 5/17 inch pilfer grommets and two - club-ended 6/93 inch boxcar prawns. - -YOU WILL NEED TO SUPPLY: a matrix wrench and 60,000 feet of tram -cable. - -IF ANYTHING IS DAMAGED OR MISSING: You IMMEDIATELY should turn to your -spouse and say: "Margaret, you know why this country can't make a car -that can get all the way through the drive-through at Burger King -without a major transmission overhaul? Because nobody cares, that's -why." - -WARNING: This is assuming your spouse's name is Margaret. - -- Dave Barry, "Read This First!" -% -Best Beer: A panel of tasters assembled by the Consumer's Union in 1969 -judged Coors and Miller's High Life to be among the very best. Those who -doubt that beer is a serious subject might ponder its effect on American -history. For example, New England's first colonists decided to drop anchor -at Plymouth Rock instead of continuing on to Virginia because, as one of -them put it, "We could not now take time for further consideration, our -victuals being spent and especially our beer." - -- Felton & Fowler's Best, Worst & Most Unusual -% -Best Mistakes In Films - In his "Filmgoer's Companion", Mr. Leslie Halliwell helpfully lists -four of the cinema's greatest moments which you should get to see if at all -possible. - In "Carmen Jones", the camera tracks with Dorothy Dandridge down a -street; and the entire film crew is reflected in the shop window. - In "The Wrong Box", the roofs of Victorian London are emblazoned -with television aerials. - In "Decameron Nights", Louis Jourdain stands on the deck of his -fourteenth century pirate ship; and a white lorry trundles down the hill -in the background. - In "Viking Queen", set in the times of Boadicea, a wrist watch is -clearly visible on one of the leading characters. - -- Stephen Pile, "The Book of Heroic Failures" -% -Best of all is never to have been born. -Second best is to die soon. -% -Beta test, v.: - To voluntarily entrust one's data, one's livelihood and one's - sanity to hardware or software intended to destroy all three. - In earlier days, virgins were often selected to beta test volcanos. -% -Better by far you should forget and -smile than that you should remember and be sad. - -- Christina Rossetti -% -Better dead than mellow. -% -Better hope the life-inspector doesn't come -around while you have your life in such a mess. -% -Better hope you get what you want before you stop wanting it. -% -Better late than never. - -- Titus Livius (Livy) -% -Better living a beggar than buried an emperor. -% -better !pout !cry -better watchout -lpr why -santa claus town - -cat /etc/passwd >list -ncheck list -ncheck list -cat list | grep naughty >nogiftlist -cat list | grep nice >giftlist -santa claus town - -who | grep sleeping -who | grep awake -who | egrep 'bad|good' -for (goodness sake) { - be good -} -% -Better the prince of some inferior court, -Than second, or less, in beatific light. - -- Lucifer, Joost van den Vondel's "Lucifer" -% -Better to be nouveau than never to have been riche at all. -% -Better to light one candle than to curse the darkness. - -- motto of the Christopher Society -% -Better to use medicines at the outset than at the last moment. -% -Better tried by twelve than carried by six. - -- Jeff Cooper -% -Between 1950 and 1952, a bored weatherman, stationed north of Hudson Bay, -left a monument that neither government nor time can eradicate. Using a -bulldozer abandoned by the Air Force, he spent two years and great effort -pushing boulders into a single word. - It can be seen from 10,000 feet, silhouetted against the snow. -Government officials exchanged memos full of circumlocutions (no Latin -equivalent exists) but failed to word an appropriation bill for the -destruction of this cairn, that wouldn't alert the press and embarrass both -Parliament and Party. - It stands today, a monument to human spirit. If life exists on other -planets, this may be the first message received from us. - -- The Realist, November, 1964 -% -Between grand theft and a legal fee, there only stands a law degree. -% -Between infinite and short there is a big difference. - -- G. H. Gonnet -% -Between the idea -And the reality -Between the motion -And the act -Falls the Shadow - -- T. S. Eliot, "The Hollow Man" - - [Quoted in "VMS Internals and Data Structures", V4.4, when - referring to system service dispatching.] -% -BEWARE! People acting under the influence of human nature. -% -Beware of a dark-haired man with a loud tie. -% -Beware of a tall black man with one blond shoe. -% -Beware of a tall blond man with one black shoe. -% -Beware of all enterprises that require new clothes, and not rather -a new wearer of clothes. - -- Henry David Thoreau -% -Beware of Bigfoot! -% -Beware of bugs in the above code; I have only proved it correct, not -tried it. - -- Donald E. Knuth -% -Beware of computerized fortune-tellers! -% -Beware of friends who are false and deceitful. -% -Beware of geeks bearing graft. -% -Beware of low-flying butterflies. -% -Beware of mathematicians and all those who make empty prophecies. The -danger already exists that the mathematicians have made covenant with -the devil to darken the spirit and to confine man in the bonds of hell. - -- St. Augustine -% -Beware of Programmers who carry screwdrivers. - -- Leonard Brandwein -% -Beware of self-styled experts: an ex is a has-been, and a spurt is a -drip under pressure. -% -Beware of strong drink. It can make you -shoot at tax collectors -- and miss. - -- Lazarus Long, "Time Enough For Love" -% -Beware of the man who knows the answer before he understands the question. -% -Beware of the Turing Tar-pit in which everything -is possible but nothing of interest is easy. -% -Beware the new TTY code! -% -Beware the one behind you. -% -Bi, n.: - When *everybody* thinks you're a pervert. -% -Bierman's Laws of Contracts: - (1) In any given document, you can't cover all the "what if's". - (2) Lawyers stay in business resolving all the unresolved "what if's". - (3) Every resolved "what if" creates two unresolved "what if's". -% -Big book, big bore. - -- Callimachus -% -Big M, Little M, many mumbling mice -Are making midnight music in the moonlight, -Mighty nice! -% -Bigamy is having one spouse too many. Monogamy is the same. -% -Biggest security gap -- an open mouth. -% -Bilbo's First Law: - You cannot count friends that are all packed up in barrels. -% -Bill Dickey is learning me his experience. - -- Yogi Berra in his rookie season -% -Billy: Mom, you know that vase you said was handed down from - generation to generation? -Mom: Yes? -Billy: Well, this generation dropped it. -% -Binary, adj.: - Possessing the ability to have friends of both sexes. -% -Bingo, gas station, hamburger with a side order of airplane noise, -and you'll be Gary, Indiana. - -- Jessie, "Greaser's Palace" -% -Bing's Rule: - Don't try to stem the tide -- move the beach. -% -Biology grows on you. -% -Biology is the only science in which -multiplication means the same thing as division. -% -Bipolar, adj.: - Refers to someone who has homes in Nome, Alaska, and Buffalo, -New York -% -Birds and bees have as much to do with the facts of life as black -nightgowns do with keeping warm. - -- Hester Mundis, "Powermom" -% -Birds are entangled by their feet and men by their tongues. -% -Birth, n.: - The first and direst of all disasters. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Birthdays are like busses, never the number you want. -% -Bistromathics is simply a revolutionary new way of understanding the -behavior of numbers. Just as Einstein observed that space was not an -absolute, but depended on the observer's movement in space, and that -time was not an absolute, but depended on the observer's movement in -time, so it is now realized that numbers are not absolute, but depend -on the observer's movement in restaurants. - -- Douglas Adams, "Life, The Universe and Everything" -% -Bit, n.: - A unit of measure applied to color. Twenty-four-bit color - refers to expensive $3 color as opposed to the cheaper 25 - cent, or two-bit, color that use to be available a few years - ago. -% -Bit off more than my mind could chew, -Shower or suicide, what do I do? - -- Julie Brown, "Will I Make it Through the Eighties?" -% -Biz is better. -% -Bizarreness is the essence of the exotic. -% -Bizoos, n.: - The millions of tiny individual bumps that make up a - basketball. - -- Rich Hall, "Sniglets" -% -Black people have never rioted. A riot is what white people think blacks -are involved in when they burn stores. - -- Julius Lester -% -Black shiny mollies and bright colored guppies, -Shy little angels as gentle as puppies, -Swimming and diving with scarcely a swish, -They were just some of my tropical fish. - -Then I got mantas that sting in the water, -Deadly piranhas that itch for a slaughter, -Savage male betas that bite with a squish, -Now I have many less tropical fish. - - If you think that - Fish are peaceful - That's an empty wish. - Just dump them together - And leave them alone, - And soon you will have -- no fish. - -- To My Favorite Things -% -Blackout, heatwave, .44 caliber homicide, -The bums drop dead and the dogs go mad in packs on the West Side, -A young girl standing on a ledge, looks like another suicide, -She wants to hit those bricks, - 'cause the news at six got to stick to a deadline, -While the millionaires hide in Beekman place, -The bag ladies throw their bones in my face, -I get attacked by a kid with stereo sound, -I don't want to hear it but he won't turn it down... - -- Billy Joel, "Glass Houses" -% -Blame Saint Andreas -- it's all his fault. -% -Blessed are the forgetful: for they -get the better even of their blunders. - -- Friedrich Nietzsche -% -Blessed are the young, for they shall inherit the national debt. - -- Herbert Hoover -% -Blessed are they that have nothing to say, and who cannot be persuaded -to say it. - -- James Russell Lowell -% -Blessed are they who Go Around in Circles, -for they Shall be Known as Wheels. -% -Blessed is he who expects no gratitude, for he shall not be disappointed. - -- W. C. Bennett -% -Blessed is he who expects nothing, for he shall never be disappointed. - -- Alexander Pope -% -Blessed is he who has reached the point of no return and knows it, -for he shall enjoy living. - -- W. C. Bennett -% -Blessed is the man who, having nothing to say, -abstains from giving wordy evidence of the fact. - -- George Eliot -% -Blinding speed can compensate for a lot of deficiencies. - -- David Nichols -% -BLISS is ignorance. -% -Blithwapping, v.: - Using anything BUT a hammer to hammer a nail into the - wall, such as shoes, lamp bases, doorstops, etc. - -- Rich Hall & Friends, "Sniglets" -% -Blood flows down one leg and up the other. -% -Blood is thicker than water, and much tastier. -% -Bloom's Seventh Law of Litigation: - The judge's jokes are always funny. -% -Blore's Razor: - Given a choice between two theories, take the one which is -funnier. -% -Blow it out your ear. -% -Blue paint today. - [Funny to Jack Slingwine, Guy Harris and Hal Pierson. Ed.] -% -Blutarsky's Axiom: - Nothing is impossible for the man who will not listen to reason. -% -Body by Nautilus, Brain by Mattel. -% -Boling's postulate: - If you're feeling good, don't worry. You'll get over it. -% -Bolub's Fourth Law of Computerdom: - Project teams detest weekly progress reporting because it so - vividly manifests their lack of progress. -% -Bombeck's Rule of Medicine: - Never go to a doctor whose office plants have died. -% -Bond reflected that good Americans were fine people and that most of them -seemed to come from Texas. - -- Ian Fleming, "Casino Royale" -% -Bondage maybe, discipline never! - -- T. K. -% -Bones: "The man's DEAD, Jim!" -% -BOO! We changed Coke again! BLEAH! BLEAH! -% -Boob's Law: - You always find something in the last place you look. -% -Booker's Law: - An ounce of application is worth a ton of abstraction. -% -Bore, n.: - A guy who wraps up a two-minute idea in a two-hour vocabulary. - -- Walter Winchell -% -Bore, n.: - A person who talks when you wish him to listen. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Boren's Laws: - (1) When in charge, ponder. - (2) When in trouble, delegate. - (3) When in doubt, mumble. -% -Boss, n.: - According to the Oxford English Dictionary, in the Middle Ages the - words "boss" and "botch" were largely synonymous, except that boss, - in addition to meaning "a supervisor of workers" also meant "an - ornamental stud." -% -Boston, n.: - An outdoor Betty Ford Clinic. -% -Boston, n.: - Ludwig van Beethoven being jeered by 50,000 sports fans for -finishing second in the Irish jig competition. -% -Boston State House is the hub of the Solar System. You couldn't pry -that out of a Boston man if you had the tire of all creation -straightened out for a crowbar. - -- O. W. Holmes -% -Both models are identical in performance, functional operation, and -interface circuit details. The two models, however, are not compatible -on the same communications line connection. - -- Bell System Technical Reference -% -Boucher's Observation: - He who blows his own horn always plays the music - several octaves higher than originally written. -% -Bounders get bound when they are caught bounding. - -- Ralph Lewin -% -Bower's Law: - Talent goes where the action is. -% -Bowie's Theorem: - If an experiment works, you must be using the wrong equipment. -% -Boy! Eucalyptus! -% -Boy, get your head out of the stars above, -You get the maximum pleasure from a minimum of love. -Save your heart and let your body be enough, -To get the maximum pleasure from a minimum of love. -Save your heart and let your body be enough, -And get the maximum pleasure from a minimum of love. - -- Mac Macinelli, "Minimum Love" -% -Boy, I sure wish that I could be in the -'Advanced Systems Development' group! -% -Boy, life takes a long time to live. - -- Steven Wright -% -Boy, n.: - A noise with dirt on it. -% -Boy, that crayon sure did hurt! -% -Boycott meat - suck your thumb. -% -Boys are beyond the range of anybody's sure understanding, at least -when they are between the ages of 18 months and 90 years. - -- James Thurber -% -Boys will be boys, and so will a lot of middle-aged men. - -- Kin Hubbard -% -Bozo is the Brotherhood of Zips and Others. Bozos are people who band -together for fun and profit. They have no jobs. Anybody who goes on a -tour is a Bozo. Why does a Bozo cross the street? Because there's a Bozo -on the other side. It comes from the phrase vos otros, meaning others. -They're the huge, fat, middle waist. The archetype is an Irish drunk -clown with red hair and nose, and pale skin. Fields, William Bendix. -Everybody tends to drift toward Bozoness. It has Oz in it. They mean -well. They're straight-looking except they've got inflatable shoes. They -like their comforts. The Bozos have learned to enjoy their free time, -which is all the time. - -- The Firesign Theatre, "If Bees Lived Inside Your Head" -% -Brace yourselves. We're about to try something that borders on the -unique: an actually rather serious technical book which is not only -(gasp) vehemently anti-Solemn, but also (shudder) takes sides. I tend -to think of it as `Constructive Snottiness.' - -- Mike Padlipsky, Foreword to "Elements of Networking - Style" -% -Bradley's Bromide: - If computers get too powerful, we can organize - them into a committee -- that will do them in. -% -Brady's First Law of Problem Solving: - When confronted by a difficult problem, you can solve it more - easily by reducing it to the question, "How would the Lone Ranger - have handled this?" -% -Brain fried -- core dumped -% -Brain, n.: - The apparatus with which we think that we think. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Brain, v. [as in "to brain"]: - To rebuke bluntly, but not pointedly; to dispel a source - of error in an opponent. - -- Ambrose Bierce, "The Devil's Dictionary" -% -brain-damaged, generalization of "Honeywell Brain Damage" (HBD), a -theoretical disease invented to explain certain utter cretinisms in -Multics, adj.: - Obviously wrong; cretinous; demented. There is an implication - that the person responsible must have suffered brain damage, - because he/she should have known better. Calling something - brain-damaged is bad; it also implies it is unusable. -% -Brandy Davis, an outfielder and teammate of mine with the Pittsburgh Pirates, -is my choice for team captain. Cincinnati was beating us 3-1, and I led -off the bottom of the eighth with a walk. The next hitter banged a hard -single to right field. Feeling the wind at my back, I rounded second and -kept going, sliding safely into third base. - With runners at first and third, and home-run hitter Ralph Kiner at -bat, our manager put in the fast Brandy Davis to run for the player at first. -Even with Kiner hitting and a change to win the game with a home run, Brandy -took off for second and made it. Now we had runners at second and third. - I'm standing at third, knowing I'm not going anywhere, and see Brandy -start to take a lead. All of a sudden, here he comes. He makes a great slide -into third, and I scream, "Brandy, where are you going?" He looks up, and -shouts, "Back to second if I can make it." - -- Joe Garagiola, "It's Anybody's Ball Game" -% -Brandy-and-water spoils two good things. - -- Charles Lamb -% -Breadth-first search is the bulldozer of science. - -- Randy Goebel -% -Break into jail and claim police brutality. -% -Breast Feeding should not be attempted by fathers with hairy chests, -since they can make the baby sneeze and give it wind. - -- Mike Harding, "The Armchair Anarchist's Almanac" -% -Breathe deep the gathering gloom. -Watch lights fade from every room. -Bed-sitter people look back and lament; -another day's useless energies spent. - -Impassioned lovers wrestle as one. -Lonely man cries for love and has none. -New mother picks up and suckles her son. -Senior citizens wish they were young. - -Cold-hearted orb that rules the night; -Removes the colors from our sight. -Red is grey and yellow white. -But we decide which is real, and which is an illusion." - -- The Moody Blues, "Days of Future Passed" -% -Breeding rabbits is a hare raising experience. -% -Bride, n.: - A woman with a fine prospect of happiness behind her. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Bridge ahead. Pay troll. -% -Briefcase, n.: - A trial where the jury gets together and forms a lynching party. -% -Briefly stated, the findings are that when presented with an array of -data or a sequence of events in which they are instructed to discover -an underlying order, subjects show strong tendencies to perceive order -and causality in random arrays, to perceive a pattern or correlation -which seems a priori intuitively correct even when the actual correlation -in the data is counterintuitive, to jump to conclusions about the correct -hypothesis, to seek and to use only positive or confirmatory evidence, to -construe evidence liberally as confirmatory, to fail to generate or to -assess alternative hypotheses, and having thus managed to expose themselves -only to confirmatory instances, to be fallaciously confident of the validity -of their judgments (Jahoda, 1969; Einhorn and Hogarth, 1978). In the -analyzing of past events, these tendencies are exacerbated by failure to -appreciate the pitfalls of post hoc analyses. - -- A. Benjamin -% -Brillineggiava, ed i tovoli slati - girlavano ghimbanti nella vaba; -i borogovi eran tutti mimanti - e la moma radeva fuorigraba. - -"Figliuolo mio, sta' attento al Gibrovacco, - dagli artigli e dal morso lacerante; -fuggi l'uccello Giuggiolo, e nel sacco - metti infine il frumioso Bandifante". - -- "The Jabberwock" -% -Bringing computers into the home won't change -either one, but may revitalize the corner saloon. -% -Brisk talkers are usually slow thinkers. There is, indeed, no wild beast -more to be dreaded than a communicative man having nothing to communicate. -If you are civil to the voluble, they will abuse your patience; if -brusque, your character. - -- Jonathan Swift -% -British education is probably the best in the world, if you can survive -it. If you can't there is nothing left for you but the diplomatic corps. - -- Peter Ustinov -% -British Israelites: - The British Israelites believe the white Anglo-Saxons of Britain to -be descended from the ten lost tribes of Israel deported by Sargon of Assyria -on the fall of Sumeria in 721 B.C. ... They further believe that the future -can be foretold by the measurements of the Great Pyramid, which probably -means it will be big and yellow and in the hand of the Arabs. They also -believe that if you sleep with your head under the pillow a fairy will come -and take all your teeth. - -- Mike Harding, "The Armchair Anarchist's Almanac" -% -Broad-mindedness, n.: - The result of flattening high-mindedness out. -% -Brogan's Constant: - People tend to congregate in the back - of the church and the front of the bus. -% -Brokee, n.: - Someone who buys stocks on the advice of a broker. -% -Brontosaurus Principle: - Organizations can grow faster than their brains can manage them -in relation to their environment and to their own physiology: when -this occurs, they are an endangered species. - -- Thomas K. Connellan -% -Brooke's Law: - Whenever a system becomes completely defined, some damn fool - discovers something which either abolishes the system or - expands it beyond recognition. -% -Brooks' Law: - Adding manpower to a late software project makes it later -% -Brucify, v.: - 1: Kill by nailing onto style(9); "David O'Brien was brucified" - 2: Annoy constantly by reminding of potential improvements - [syn: {torment}, {rag}, {tantalize}, {bedevil}, {dun}, - {frustrate}] - 3: Fix problems that were indicated in an earlier brucification - (of one of the two other meanings). -The word 'brucify' originally comes from the style-reviews of Bruce -Evans of the FreeBSD project, but is now also sometimes used for -reviews just done in his spirit. -% -BS: You remind me of a man. -B: What man? -BS: The man with the power. -B: What power? -BS: The power of voodoo. -B: Voodoo? -BS: You do. -B: Do what? -BS: Remind me of a man. -B: What man? -BS: The man with the power... - -- Cary Grant, "The Bachelor and the Bobby-Soxer" -% -Bubble Memory, n.: - A derogatory term, usually referring to a person's -intelligence. See also "vacuum tube". -% -Buck-passing usually turns out to be a boomerang. -% -Bucy's Law: - Nothing is ever accomplished by a reasonable man. -% -Bug, n.: - An aspect of a computer program which exists because the -programmer was thinking about Jumbo Jacks or stock options when s/he -wrote the program. - -Fortunately, the second-to-last bug has just been fixed. - -- Ray Simard -% -Bug, n.: - An elusive creature living in a program that makes it incorrect. - The activity of "debugging", or removing bugs from a program, ends - when people get tired of doing it, not when the bugs are removed. - -- "Datamation", January 15, 1984 -% -Bugs, pl. n.: - Small living things that small living boys throw on small - living girls. -% -Building translators is good clean fun. - -- T. Cheatham -% -BULLWINKLE: "You just leave that to my pal. He's the brains of the - outfit." -GENERAL: "What does that make YOU?" -BULLWINKLE: "What else? An executive..." - -- Jay Ward, "Rocky and Bullwinkle" -% -Bumper sticker: - All the parts falling off this car are - of the very finest British manufacture. -% -Bunker's Admonition: - You cannot buy beer; you can only rent it. -% -Burbulation, v.: - The obsessive act of opening and closing a refrigerator door in - an attempt to catch it before the automatic light comes on. - -- Rich Hall & Friends, "Sniglets" -% -Bureau Termination, Law of: - When a government bureau is scheduled to be phased out, - the number of employees in that bureau will double within - 12 months after the decision is made. -% -Bureaucracy, n.: - A method for transforming energy into solid waste. -% -Bureaucrat, n.: - A person who cuts red tape sideways. - -- J. McCabe -% -Bureaucrat, n.: - A politician who has tenure. -% -Burke's Postulates: - Anything is possible if you don't know what you are talking about. - Don't create a problem for which you do not have the answer. -% -Burn's Hog Weighing Method: - (1) Get a perfectly symmetrical plank and balance it across a - sawhorse. - (2) Put the hog on one end of the plank. - (3) Pile rocks on the other end until the plank is again - perfectly balanced. - (4) Carefully guess the weight of the rocks. - -- Robert Burns -% -Burnt Sienna. That's the best thing that ever happened to Crayolas. - -- Ken Weaver -% -Bus error -- driver executed. -% -Bus error -- please leave by the rear door. -% -Bushydo -- the way of the shrub. Bonsai! -% -Business is a good game -- lots of competition -and minimum of rules. You keep score with money. - -- Nolan Bushnell, founder of Atari -% -Business will be either better or worse. - -- Calvin Coolidge -% -But Captain -- the engines can't take this much longer! -% -But don't you worry, its for a cause -- feeding global corporations -paws. -% -But, for my own part, it was Greek to me. - -- William Shakespeare, "Julius Caesar" -% -But has any little atom, - While a-sittin' and a-splittin', -Ever stopped to think or CARE - That E = m c**2 ? -% -But I always fired into the nearest hill or, failing that, into blackness. -I meant no harm; I just liked the explosions. And I was careful never to -kill more than I could eat. - -- Raoul Duke -% -But I don't like Spam!!!! -% -"But I don't want to go on the cart..." -"Oh, don't be such a baby!" -"But I'm feeling much better..." -"No you're not... in a moment you'll be stone dead!" - -- Monty Python, "The Holy Grail" -% -But I find the old notions somehow appealing. Not that I want to go -back to them -- it is outrageous to have some outer authority tell you -what is proper use and abuse of your own faculties, and it is ludicrous -to hold reason higher than body or feeling. Still there is something -true and profoundly sane about the belief that acts like murder or -theft or assault violate the doer as well as the done to. We might -even, if we thought this way, have less crime. The popular view of -crime, as far as I can deduce it from the movies and television, is -that it is a breaking of a rule by someone who thinks they can get away -with that; implicitly, everyone would like to break the rule, but not -everyone is arrogant enough to imagine they can get away with it. It -therefore becomes very important for the rule upholders to bring such -arrogance down. - -- Marilyn French, "The Woman's Room" -% -But if you wish at once to do nothing and to be respectable -nowadays, the best pretext is to be at work on some profound study. - -- Leslie Stephen, "Sketches from Cambridge" -% -But in our enthusiasm, we could not resist a radical overhaul of the -system, in which all of its major weaknesses have been exposed, -analyzed, and replaced with new weaknesses. - -- Bruce Leverett, - "Register Allocation in Optimizing Compilers" -% -But it does move! - -- Galileo Galilei -% -But like the Good Book says... There's BIGGER DEALS to come! -% -But, Mousie, thou art no thy lane, -In proving foresight may be vain: -The best laid schemes o' mice an' men -Gang aft a-gley, -An' lea'e us nought but grief and pain -For promised joy. - -- Robert Burns, "To a Mouse", 1785 -% -But, officer, he's not drunk, I just saw his fingers twitch! -% -But Officer, I stopped for the last one, and it was green! -% -But officer, I was only trying to gain enough speed so I could coast -to the nearest gas station. -% -But scientists, who ought to know -Assure us that it must be so. -Oh, let us never, never doubt -What nobody is sure about. - -- Hilaire Belloc -% -But sex and drugs and rock & roll, why, they'd bring our blackest day. -% -But since I knew now that I could hope for nothing of greater value than -frivolous pleasures, what point was there in denying myself of them? - -- M. Proust -% -But soft you, the fair Ophelia: -Ope not thy ponderous and marble jaws, -But get thee to a nunnery -- go! - -- Mark "The Bard" Twain -% -But the greatest Electrical Pioneer of them all was Thomas Edison, who -was a brilliant inventor despite the fact that he had little formal -education and lived in New Jersey. Edison's first major invention in -1877, was the phonograph, which could soon be found in thousands of -American homes, where it basically sat until 1923, when the record was -invented. But Edison's greatest achievement came in 1879, when he -invented the electric company. Edison's design was a brilliant -adaptation of the simple electrical circuit: the electric company sends -electricity through a wire to a customer, then immediately gets the -electricity back through another wire, then (this is the brilliant -part) sends it right back to the customer again. - -This means that an electric company can sell a customer the same batch -of electricity thousands of times a day and never get caught, since -very few customers take the time to examine their electricity closely. -In fact the last year any new electricity was generated in the United -States was 1937; the electric companies have been merely re-selling it -ever since, which is why they have so much free time to apply for rate -increases. - -- Dave Barry, "What is Electricity?" -% -But these pills can't be habit forming; -I've been taking them for years. -% -But this has taken us far afield from interface, which is not a bad -place to be, since I particularly want to move ahead to the kludge. -Why do people have so much trouble understanding the kludge? What -is a kludge, after all, but not enough K's, not enough ROM's, not -enough RAM's, poor quality interface and too few bytes to go around? -Have I explained yet about the bytes? -% -But what we need to know is, do people want nasally-insertable -computers? -% -But you shall not escape my iambics. - -- Gaius Valerius Catullus -% -But you who live on dreams, you are better pleased with the sophistical -reasoning and frauds of talkers about great and uncertain matters than -those who speak of certain and natural matters, not of such lofty nature. - -- Leonardo da Vinci, "The Codex on the Flight of Birds" -% -Buzz off, Banana Nose; Relieve mine eyes -Of hateful soreness, purge mine ears of corn; -Less dear than army ants in apple pies -Art thou, old prune-face, with thy chestnuts worn, -Dropt from thy peeling lips like lousy fruit; -Like honeybees upon the perfum'd rose -They suck, and like the double-breasted suit -Are out of date; therefore, Banana Nose, -Go fly a kite, thy welcome's overstayed; -And stem the produce of thy waspish wits: -Thy logick, like thy locks, is disarrayed; -Thy cheer, like thy complexion, is the pits. -Be off, I say; go bug somebody new, -Scram, beat it, get thee hence, and nuts to you. -% -Buzzword, n.: - The fly in the ointment of computer literacy. -% -By doing just a little every day, you can -gradually let the task completely overwhelm you. -% -By failing to prepare, you are preparing to fail. -% -By long-standing tradition, I take this opportunity to savage other -designers in the thin disguise of good, clean fun. - -- P. J. Plauger, "Computer Language", 1988, April - Fool's column. -% -By nature, men are nearly alike; -by practice, they get to be wide apart. - -- Confucius -% -By necessity, by proclivity, and by delight, we all quote. -In fact, it is as difficult to appropriate the thoughts of others -as it is to invent. - -- Ralph Waldo Emerson - -- Quoted from a fortune cookie program - (whose author claims, "Actually, stealing IS easier.") - [to which I reply, "You think it's easy for me to - misconstrue all these misquotations?!?" Ed.] -% -By perseverance the snail reached the Ark. - -- Charles Spurgeon -% -By protracting life, we do not deduct one jot from the duration of death. - -- Titus Lucretius Carus -% -By the time they had diminished from 50 to 8, the other dwarves began -to suspect "Hungry" ... - -- Gary Larson, "The Far Side" -% -By the time you swear you're his, -shivering and sighing -and he vows his passion is -infinite, undying -- -Lady, make a note of this: -One of you is lying. - -- Dorothy Parker, "Unfortunate Coincidence" -% -By the yard, life is hard. -By the inch, it's a cinch. -% -By trying we can easily learn to endure adversity. -Another man's, I mean. - -- Mark Twain -% -By working faithfully eight hours a day, -you may eventually get to be boss and work twelve. - -- Robert Frost -% -BYOB, v.: - Believing Your Own Bull -% -Bypasses are devices that allow some people to dash from point A to -point B very fast while other people dash from point B to point A very -fast. People living at point C, being a point directly in between, are -often given to wonder what's so great about point A that so many people -from point B are so keen to get there and what's so great about point B -that so many people from point A are so keen to get _t_h_e_r_e. They often -wish that people would just once and for all work out where the hell -they wanted to be. - -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -BYTE editors are people who separate the wheat from the chaff, and then -carefully print the chaff. -% -Byte your tongue. -% -C Code. -C Code Run. -Run, Code, RUN! - PLEASE!!!! -% -C for yourself. -% -C++ is the best example of second-system effect since OS/360. -% -C makes it easy for you to shoot yourself in the foot. C++ makes that -harder, but when you do, it blows away your whole leg. - -- Bjarne Stroustrup -% -C, n.: - A programming language that is sort of like Pascal except more like - assembly except that it isn't very much like either one, or anything - else. It is either the best language available to the art today, or - it isn't. - -- Ray Simard -% -Cabbage, n.: - A familiar kitchen-garden vegetable about as large and wise as - a man's head. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Cable is not a luxury, since many areas have poor TV reception. - -- The Mayor of Tucson, Arizona, 1989 -% -Cache: - A very expensive part of the memory system of a computer that no one - is supposed to know is there. -% -California is a fine place to live -- if you happen to be an orange. - -- Fred Allen -% -Californians are a strange people. They'll put every chemical known to God -and man up their nostrils and then laugh at you for putting sugar in your -coffee. -% -Call on God, but row away from the rocks. - -- Indian proverb -% -Call things by their right names... Glass of brandy and water! That is the -current but not the appropriate name: ask for a glass of fire and distilled -damnation. - -- Robert Hall, in Olinthus Gregory's, "Brief Memoir of the - Life of Hall" - - [Quoted in "VMS Internals and Data Structures", V4.4, when - referring to logical names.] -% -Calling you stupid is an insult to stupid people! - -- Wanda, "A Fish Called Wanda" -% -Calm down, it's only ones and zeroes, -Calm down, it's only bits and bytes, -Calm down, and speak to me in English, -Please realize that I'm not one of your computerites. -% -Calvin: "I wonder where we go when we die." -Hobbes: "Pittsburgh?" -Calvin: "You mean if we're good or if we're bad?" -% -Calvin Coolidge looks as if he had been weaned on a pickle. - -- Alice Roosevelt Longworth -% -Calvin Coolidge was the greatest man -who ever came out of Plymouth Corner, Vermont. - -- Clarence Darrow -% -Campbell's Law: - Nature abhors a vacuous experimenter. -% -Campus crusade for Cthulhu -- it found me. -% -Campus sidewalks never exist as the straightest line between two -points. - -- M. M. Johnston -% -Can anyone remember when the times -were not hard, and money not scarce? -% -Can anything be sadder than work left unfinished? -Yes, work never begun. -% -"Can you be more stupid than aggravating the judge AND your lawyer? -No? Oh yes you can: You can aggravate the whole kernel community." - -- Alexander Lyamin (about Hans Reisers murder trial) -% -Can you buy friendship? You not only can, you must. It's the -only way to obtain friends. Everything worthwhile has a price. - -- Robert J. Ringer -% -Canada Bill Jones's Motto: - It's morally wrong to allow suckers to keep their money. - -Canada Bill Jones's Supplement: - A Smith and Wesson beats four aces. -% -Canada Post doesn't really charge 32 cents for a stamp. -It's 2 cents for postage and 30 cents for storage. - -- Gerald Regan, Cabinet Minister, 12/31/83 Financial Post -% -Cancel me not -- for what then shall remain? -Abscissas, some mantissas, modules, modes, -A root or two, a torus and a node: -The inverse of my verse, a null domain. - -- Stanislaw Lem, "Cyberiad" -% -CANCER (June 21 - July 22) - This is a good time for those of you who are rich and happy, - but a poor time for those of you born under this sign who are - poor and unhappy. To tell you the truth, any day is tough - when you're poor and unhappy. -% -CANCER (June 21 - July 22) - You are sympathetic and understanding to other people's -problems. They think you are a sucker. You are always putting things -off. That's why you'll never make anything of yourself. Most welfare -recipients are Cancer people. -% -Canonical, adj.: - The usual or standard state or manner of something. A true story: -One Bob Sjoberg, new at the MIT AI Lab, expressed some annoyance at the use -of jargon. Over his loud objections, we made a point of using jargon as -much as possible in his presence, and eventually it began to sink in. -Finally, in one conversation, he used the word "canonical" in jargon-like -fashion without thinking. - Steele: "Aha! We've finally got you talking jargon too!" - Stallman: "What did he say?" - Steele: "He just used `canonical' in the canonical way." -% -Can't act. Slightly bald. Also dances. - -- RKO executive, reacting to Fred Astaire's screen test - Cerf/Navasky, "The Experts Speak" -% -Can't open /usr/games/fortunes. Lid stuck on cookie jar. -% -Can't open /usr/share/games/fortune/fortunes.dat. -% -Capitalism is the extraordinary belief that the nastiest of men, for -the nastiest of reasons, will somehow work for the benefit of us all. - -- John Maynard Keynes -% -CAPRICORN (Dec 22 - Jan 19) - Play your hunches. This is a day when luck will play an important - part in your life. If you were smarter, you wouldn't need so much - luck and you wouldn't be reading your horoscope, either. You are - a suspicious person, and it will occur to you that astrologers - don't know what they're talking about any more than your Aunt Martha. -% -CAPRICORN (Dec. 22 to Jan. 19) - Follow your instincts. You are much too scatterbrained to do anything - else, such as think. Romance is in the air, but not for you, so forget - it. That pimple on the end of your nose will get worse. -% -CAPRICORN (Dec 23 - Jan 19) - You are conservative and afraid of taking risks. You don't do - much of anything and are lazy. There has never been a Capricorn - of any importance. Capricorns should avoid standing still for - too long as they tend to take root and become trees. -% -Captain Penny's Law: - You can fool all of the people some of the time, and - some of the people all of the time, but you Can't Fool Mom. -% -Captain's Log, star date 21:34.5... -% -Carelessly planned projects take three times longer to complete than expected. -Carefully planned projects take four times longer to complete than expected, -mostly because the planners expect their planning to reduce the time it -takes. -% -Carmel, New York, has an ordinance forbidding men to wear coats and -trousers that don't match. -% -Carney's Law: There's at least a 50-50 chance that someone will print -the name Craney incorrectly. - -- Jim Canrey -% -Carob works on the principle that, when mixed with the right combination of -fats and sugar, it can duplicate chocolate in color and texture. Of course, -the same can be said of dirt. -% -Carperpetuation (kar' pur pet u a shun), n.: - The act, when vacuuming, of running over a string at least a - dozen times, reaching over and picking it up, examining it, - then putting it back down to give the vacuum one more chance. - -- Rich Hall, "Sniglets" -% -Carson's Consolation: - Nothing is ever a complete failure. - It can always be used as a bad example. -% -Carson's Observation on Footwear: - If the shoe fits, buy the other one too. -% -Carswell's Corollary: - Whenever man comes up with a better mousetrap, - nature invariably comes up with a better mouse. -% -Cat, n.: - Lapwarmer with built-in buzzer. -% -Catch a wave and you're sitting on top of the world. - -- The Beach Boys -% -Catharsis is something I associate with pornography and crossword puzzles. - -- Howard Chaykin -% -Catproof is an oxymoron, childproof nearly so. -% -Cats are intended to teach us that not everything in nature has a function. - -- Garrison Keillor -% -Cats are smarter than dogs. You can't make eight cats pull -a sled through the snow. -% -Cats, no less liquid than their shadows, offer no angles to the wind. -% -Cauliflower is nothing but cabbage with a college education. - -- Mark Twain, "Pudd'nhead Wilson" -% -Caution: Breathing may be hazardous to your health. -% -Caution: Keep out of reach of children. -% -CChheecckk yyoouurr dduupplleexx sswwiittcchh.. -% -CCI Power 6/40: one board, a megabyte of cache, and an attitude... -% -Cecil, you're my final hope -Of finding out the true Straight Dope -For I have been reading of Schrodinger's cat -But none of my cats are at all like that. -This unusual animal (so it is said) -Is simultaneously alive and dead! -What I don't understand is just why he -Can't be one or the other, unquestionably. -My future now hangs in between eigenstates. -In one I'm enlightened, in the other I ain't. -If *you* understand, Cecil, then show me the way -And rescue my psyche from quantum decay. -But if this queer thing has perplexed even you, -Then I will *_a_n_d* I won't see you in Schrodinger's zoo. - -- Randy F., Chicago, "The Straight Dope, a compendium - of human knowledge" by Cecil Adams -% -Celebrate Hannibal Day this year. Take an elephant to lunch. -% -Celestial navigation is based on the premise that the Earth is the center -of the universe. The premise is wrong, but the navigation works. An -incorrect model can be a useful tool. - -- Kelvin Throop III -% -Census Taker to Housewife: -Did you ever have the measles, and, if so, how many? -% -Center meeting at 4pm in 2C-543. -% -Cerebral atrophy, n.: - The phenomena which occurs as brain cells become weak and sick, and -impair the brain's performance. An abundance of these "bad" cells can cause -symptoms related to senility, apathy, depression, and overall poor academic -performance. A certain small number of brain cells will deteriorate due to -everyday activity, but large amounts are weakened by intense mental effort -and the assimilation of difficult concepts. Many college students become -victims of this dread disorder due to poor habits such as overstudying. - -Cerebral darwinism, n.: - The theory that the effects of cerebral atrophy can be reversed -through the purging action of heavy alcohol consumption. Large amounts of -alcohol cause many brain cells to perish due to oxygen deprivation. Through -the process of natural selection, the weak and sick brain cells will die -first, leaving only the healthy cells. This wonderful process leaves the -imbiber with a healthier, more vibrant brain, and increases mental capacity. -Thus, the devastating effects of cerebral atrophy are reversed, and academic -performance actually increases beyond previous levels. -% -Cerebus: I'd love to lick apricot brandy out of your navel. -Jaka: Look, Cerebus -- Jaka has to tell you ... something -Cerebus: If Cerebus had a navel, would you lick apricot brandy - out of it? -Jaka: Ugh! -Cerebus: You don't like apricot brandy? - -- Cerebus #6, "The Secret" -% -Certain old men prefer to rise at dawn, taking a cold bath and a long -walk with an empty stomach and otherwise mortifying the flesh. They -then point with pride to these practices as the cause of their sturdy -health and ripe years; the truth being that they are hearty and old, -not because of their habits, but in spite of them. The reason we find -only robust persons doing this thing is that it has killed all the -others who have tried it. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Certain passages in several laws have always defied interpretation and -the most inexplicable must be a matter of opinion. A judge of the Court -of Session of Scotland has sent the editors of this book his candidate -which reads, "In the Nuts (unground), (other than ground nuts) Order, -the expression nuts shall have reference to such nuts, other than ground -nuts, as would but for this amending Order not qualify as nuts -(unground) (other than ground nuts) by reason of their being nuts -(unground)." - -- Guinness Book of World Records, 1973 -% -Certainly the game is rigged. -Don't let that stop you; if you don't bet, you can't win. - -- Robert A. Heinlein, "Time Enough For Love" -% -Certainly there are things in life that money can't buy, -But it's very funny -- -did you ever try buying them without money? - -- Ogden Nash -% -C'est magnifique, mais ce n'est pas la guerre! -% -C'est magnifique, mais ce n'est pas l'Informatique. - -- Bosquet [on seeing the IBM 4341] -% -CF&C stole it, fair and square. - -- Tim Hahn -% -Chairman of the Bored. -% -Chamberlain's Laws: - 1: The big guys always win. - 2: Everything tastes more or less like chicken. -% -Chance is perhaps the work of God when He did not want to sign. - -- Anatole France -% -Change your thoughts and you change your world. -% -Changing husbands/wives is only changing troubles. - -- Kathleen Norris -% -Chaos is King and Magic is loose in the world. -% -Chapter 2: Newtonian Growth and Decay - - The growth-decay formulas were developed in the trivial fashion by -Isaac Newton's famous brother Phigg. His idea was to provide an equation -that would describe a quantity that would dwindle and dwindle, but never -quite reach zero. Historically, he was merely trying to work out his -mortgage. Another versatile equation also emerged, one which would define -a function that would continue to grow, but never reach unity. This equation -can be applied to charging capacitors, over-damped springs, and the human -race in general. -% -Character density, n.: - The number of very weird people in the office. -% -Character is what you are in the dark! - -- Lord John Whorfin -% -Charity begins at home. - -- Publius Terentius Afer (Terence) -% -Charity, n.: - A thing that begins at home and usually stays there. -% -Charlie Brown: Why was I put on this earth? -Linus: To make others happy. -Charlie Brown: Why were others put on this earth? -% -Charlie was a chemist, -But Charlie is no more. -What Charlie thought was H2O was H2SO4. -% -Charm is a way of getting the answer "Yes" -- -without having asked any clear question. -% -Cheap things are of no value, valuable things are not cheap. -% -Check me if I'm wrong, Sandy, but if I kill all the golfers... -they're gonna lock me up and throw away the key! -% -Checkuary, n.: - The thirteenth month of the year. Begins New Year's Day and ends - when a person stops absentmindedly writing the old year on his checks. -% -Cheer Up! Things are getting worse at a slower rate. -% -Cheese -- milk's leap toward immortality. - -- Clifton Fadiman, "Any Number Can Play" -% -Chef, n.: - Any cook who swears in French. -% -Cheit's Lament: - If you help a friend in need, he is sure to remember you-- - the next time he's in need. -% -Chemicals, n.: - Noxious substances from which modern foods are made. -% -Chemist who falls in acid is absorbed in work. -% -Chemist who falls in acid will be tripping for weeks. -% -Chemistry is applied theology. - -- Augustus Stanley Owsley III -% -Chemistry professors never die, they just fail to react. -% -Cheops' Law: - Nothing ever gets built on schedule or within budget. -% -Chess tonight. -% -Chicago law prohibits eating in a place that is on fire. -% -Chicago, n.: - Where the dead still vote ... early and often! -% -Chicago Transit Authority Rider's Rule #36: - Never ever ask the tough looking gentleman wearing El Rukn - headgear where he got his "pyramid powered pizza warmer". - -- Chicago Reader 3/27/81 -% -Chicago Transit Authority Rider's Rule #84: - The CTA has complimentary pop-up timers available on request -for overheated passengers. When your timer pops up, the driver will -cheerfully baste you. - -- Chicago Reader 5/28/82 -% -Chicagoan: "So, where're you from?" -Hoosier: "What's wrong with Indiana?" -% -Chicken Little only has to be right once. -% -Chicken Little was right. -% -Chicken Soup, n.: - An ancient miracle drug containing equal parts of aureomycin, - cocaine, interferon, and TLC. The only ailment chicken soup - can't cure is neurotic dependence on one's mother. - -- Arthur Naiman, "Every Goy's Guide to Yiddish" -% -Chihuahuas drive me crazy. I can't stand anything that -shivers when it's warm. -% -Children are like cats, they can tell when you don't like -them. That's when they come over and violate your body space. -% -Children are natural mimics who act like their parents -despite every effort to teach them good manners. -% -Children are unpredictable. You never know what inconsistency they're -going to catch you in next. - -- Franklin P. Jones -% -Children aren't happy without something to ignore, -And that's what parents were created for. - -- Ogden Nash -% -Children begin by loving their parents. After a time they judge them. -Rarely, if ever, do they forgive them. - -- Oscar Wilde -% -Children seldom misquote you. In fact, they usually -repeat word for word what you shouldn't have said. -% -Children's talent to endure stems from their ignorance of alternatives. - -- Maya Angelou, "I Know Why the Caged Bird Sings" -% -Chinese saying: "He who speak with forked tongue, not need chopsticks." -% -Chism's Law of Completion: - The amount of time required to complete a government project is - precisely equal to the length of time already spent on it. -% -Chisolm's First Corollary to Murphy's Second Law: - When things just can't possibly get any worse, they will. -% -Chivalry, Schmivalry! - Roger the thief has a - method he uses for - sneaky attacks: -Folks who are reading are - Characteristically - Always Forgetting to - Guard their own bac ... -% -Chocolate Chip. -% -Choose in marriage only a woman whom you would choose as -a friend if she were a man. - -- Joubert -% -Chorus: - Grandma got run over by a reindeer, - Walking home from our house Christmas eve. - You can say there's no such thing as Santa, - But as for me and Grandpa, we believe! -She'd been drinking too much eggnog, -And we begged her not to go. -But she'd forgot her medication, When we found her Christmas morning, -And she staggered through the door At the scene of the attack. - out in the snow. She had hoofprints on her forehead, - And incriminating claus-marks on her -Now we're all so proud of Grandpa, back. -He's been taking this so well. -See him in there watching football. I've warned all my friends and -Drinking beer and playing cards neighbors, - with cousin Mel. Better watch out for yourselves! - They should never give a license, - To a man who drives a sleigh and - plays with elves! - -- Elmo and Patsy, "Grandma Got Run Over by a Reindeer" -% -Christ died for our sins, so let's not disappoint Him. -% -Christianity might be a good thing if anyone ever tried it. - -- George Bernard Shaw -% -Christmas time is here, by Golly; Kill the turkeys, ducks and chickens; -Disapproval would be folly; Mix the punch, drag out the Dickens; -Deck the halls with hunks of holly; Even though the prospect sickens, -Fill the cup and don't say when... Brother, here we go again. - -On Christmas day, you can't get sore; Relations sparing no expense'll, -Your fellow man you must adore; Send some useless old utensil, -There's time to rob him all the more, Or a matching pen and pencil, -The other three hundred and sixty-four! Just the thing I need... how nice. - -It doesn't matter how sincere Hark The Herald-Tribune sings, -It is, nor how heartfelt the spirit; Advertising wondrous things. -Sentiment will not endear it; God Rest Ye Merry Merchants, -What's important is... the price. May you make the Yuletide pay. - Angels We Have Heard On High, -Let the raucous sleighbells jingle; Tell us to go out and buy. -Hail our dear old friend, Kris Kringle, Sooooo... -Driving his reindeer across the sky, -Don't stand underneath when they fly by! - -- Tom Lehrer -% -Churchill's Commentary on Man: - Man will occasionally stumble over the truth, - but most of the time he will pick himself up and continue on. -% -Cigarette, n.: - A fire at one end, a fool at the other, and a bit of tobacco in - between. -% -Cinemuck, n.: - The combination of popcorn, soda, and melted chocolate which - covers the floors of movie theaters. - -- Rich Hall, "Sniglets" -% -Circumstances rule men; men do not rule circumstances. - -- Herodotus -% -Civilization and profits go hand in hand. - -- Calvin Coolidge -% -Civilization, as we know it, will end sometime this evening. -See SYSNOTE tomorrow for more information. -% -Civilization is the limitless multiplication of unnecessary necessities. - -- Mark Twain -% -Clairvoyant, n.: - A person, commonly a woman, who has the power of seeing that - which is invisible to her patron -- namely, that he is a - blockhead. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Claret is the liquor for boys; port for men; but he who -aspires to be a hero... must drink brandy. - -- Samuel Johnson -% -Clarke's Conclusion: - Never let your sense of morals interfere with doing the right thing. -% -Class, that's the only thing that counts in life. Class. -Without class and style, a man's a bum; he might as well be dead. - -- "Bugsy" Siegel -% -Class: when they're running you out of town, to look like you're -leading the parade. - -- Bill Battie -% -Classical music is the kind we keep thinking will turn into a tune. - -- Kin Hubbard, "Abe Martin's Sayings" -% -Clay's Conclusion: - Creativity is great, but plagiarism is faster. -% -Cleaning your house while your kids are still growing is like shoveling -the walk before it stops snowing. - -- Phyllis Diller -% -Cleanliness becomes more important when godliness is unlikely. - -- P. J. O'Rourke -% -CLEVELAND: - Where their last tornado did six - million dollars worth of improvements. -% -Cleveland still lives. God _m_u_s_t be dead. -% -Cleveland? -Yes, I spent a week there one day. -% -Climate and Surgery - R C Gilchrist, who was shot by J Sharp twelve days ago, and who -received a derringer ball in the right breast, and who it was supposed at -the time could not live many hours, was on the street yesterday and the -day before - walking several blocks at a time. To those who design to be -riddled with bullets or cut to pieces with Bowie-knives, we cordially -recommend our Sacramento climate and Sacramento surgery. - -- Sacramento Daily Union, September 11, 1861 -% -Climbing onto a bar stool, a piece of string asked for a beer. - "Wait a minute. Aren't you a string?" - "Well, yes, I am." - "Sorry. We don't serve strings here." - The determined string left the bar and stopped a passer-by. "Excuse, -me," it said, "would you shred my ends and tie me up like a pretzel?" The -passer-by obliged, and the string re-entered the bar. "May I have a beer, -please?" it asked the bartender. - The barkeep set a beer in front of the string, then suddenly stopped. -"Hey, aren't you the string I just threw out of here?" - "No, I'm a frayed knot." -% -Clone, n.: - 1. An exact duplicate, as in "our product is a clone of their - product." 2. A shoddy, spurious copy, as in "their product - is a clone of our product." -% -Clones are people two. -% -Cloning is the sincerest form of flattery. -% -Clothes make the man. -Naked people have little or no influence on society. - -- Mark Twain -% -Clovis' Consideration of an Atmospheric Anomaly: - The perversity of nature is nowhere better demonstrated - than by the fact that, when exposed to the same atmosphere, - bread becomes hard while crackers become soft. -% -Coach: Can I draw you a beer, Norm? -Norm: No, I know what they look like. Just pour me one. - -- Cheers, No Help Wanted - -Coach: How about a beer, Norm? -Norm: Hey I'm high on life, Coach. Of course, beer is my life. - -- Cheers, No Help Wanted - -Coach: How's a beer sound, Norm? -Norm: I dunno. I usually finish them before they get a word in. - -- Cheers, Fortune and Men's Weights -% -Coach: How's it going, Norm? -Norm: Daddy's rich and Momma's good lookin'. - -- Cheers, Truce or Consequences - -Sam: What's up, Norm? -Norm: My nipples. It's freezing out there. - -- Cheers, Coach Returns to Action - -Coach: What's the story, Norm? -Norm: Thirsty guy walks into a bar. You finish it. - -- Cheers, Endless Slumper -% -Coach: What would you say to a beer, Normie? -Norm: Daddy wuvs you. - -- Cheers, The Mail Goes to Jail - -Sam: What'd you like, Normie? -Norm: A reason to live. Gimme another beer. - -- Cheers, Behind Every Great Man - -Sam: What will you have, Norm? -Norm: Well, I'm in a gambling mood, Sammy. I'll take a glass - of whatever comes out of that tap. -Sam: Oh, looks like beer, Norm. -Norm: Call me Mister Lucky. - -- Cheers, The Executive's Executioner -% -Coach: What's up, Norm? -Norm: Corners of my mouth, Coach. - -- Cheers, Fortune and Men's Weights - -Coach: What's shaking, Norm? -Norm: All four cheeks and a couple of chins, Coach. - -- Cheers, Snow Job - -Coach: Beer, Normie? -Norm: Uh, Coach, I dunno, I had one this week. - Eh, why not, I'm still young. - -- Cheers, Snow Job -% -COBOL: - An exercise in Artificial Inelegance. -% -COBOL: - Completely Over and Beyond reason Or Logic. -% -COBOL is for morons. - -- Edsger W. Dijkstra -% -Cobol programmers are down in the dumps. -% -Code rot -- mostly caused by people redefining "fresh". - -- Wes Peters -% -Coding is easy; All you do is sit staring at a -terminal until the drops of blood form on your forehead. -% -Cogito cogito ergo cogito sum -- -"I think that I think, therefore I think that I am." - -- Ambrose Bierce, "The Devil's Dictionary" -% -Cogito ergo I'm right and you're wrong. - -- Blair Houghton -% -Cohen's Law: - There is no bottom to worse. -% -Cohn's Law: - The more time you spend in reporting on what you are doing, the less - time you have to do anything. Stability is achieved when you spend - all your time reporting on the nothing you are doing. -% -Coincidence, n.: - You weren't paying attention to the other half of what was - going on. -% -Coincidences are spiritual puns. - -- G. K. Chesterton -% -Cold, adj.: - When the politicians walk around with their hands in their own - pockets. -% -Cold hands, no gloves. -% -Cole's Law: - Thinly sliced cabbage. -% -Collaboration, n.: - A literary partnership based on the false assumption that the - other fellow can spell. -% -COLLEGE: - The fountains of knowledge, where everyone goes to drink. -% -College football is a game which would be much more interesting if the -faculty played instead of the students, and even more interesting if -the trustees played. There would be a great increase in broken arms, -legs, and necks, and simultaneously an appreciable diminution in the -loss to humanity. - -- H. L. Mencken -% -COLORADO: - Where they don't buy M & M's, 'cause they're so hard to peel. -% -Colorless green ideas sleep furiously. -% -Column 1 Column 2 Column 3 - -0. integrated 0. management 0. options -1. total 1. organizational 1. flexibility -2. systematized 2. monitored 2. capability -3. parallel 3. reciprocal 3. mobility -4. functional 4. digital 4. programming -5. responsive 5. logistical 5. concept -6. optional 6. transitional 6. time-phase -7. synchronized 7. incremental 7. projection -8. compatible 8. third-generation 8. hardware -9. balanced 9. policy 9. contingency - - The procedure is simple. Think of any three-digit number, then select -the corresponding buzzword from each column. For instance, number 257 produces -"systematized logistical projection," a phrase that can be dropped into -virtually any report with that ring of decisive, knowledgeable authority. "No -one will have the remotest idea of what you're talking about," says Broughton, -"but the important thing is that they're not about to admit it." - -- Philip Broughton, "How to Win at Wordsmanship" -% -Colvard's Logical Premises: - All probabilities are 50%. -Either a thing will happen or it won't. - -Colvard's Unconscionable Commentary: - This is especially true when - dealing with someone you're attracted to. - -Grelb's Commentary: - Likelihoods, however, are 90% against you. -% -Come, every frustum longs to be a cone, -And every vector dreams of matrices. -Hark to the gentle gradient of the breeze: -It whispers of a more ergodic zone. - -- Stanislaw Lem, "Cyberiad" -% -Come fill the cup and in the fire of spring -Your winter garment of repentance fling. -The bird of time has but a little way -To flutter -- and the bird is on the wing. - -- Omar Khayyam -% -Come home America. - -- George McGovern, 1972 -% -Come, landlord, fill the flowing bowl until it does run over, -Tonight we will all merry be -- tomorrow we'll get sober. - -- John Fletcher, "The Bloody Brother", II, 2 -% -Come, let us hasten to a higher plane, -Where dyads tread the fairy fields of Venn, -Their indices bedecked from one to _n, -Commingled in an endless Markov chain! - -- Stanislaw Lem, "Cyberiad" -% -Come live with me, and be my love, -And we will some new pleasures prove -Of golden sands, and crystal brooks, -With silken lines, and silver hooks. - -- John Donne -% -Come live with me and be my love, -And we will some new pleasures prove -Of golden sands and crystal brooks -With silken lines, and silver hooks. -There's nothing that I wouldn't do -If you would be my POSSLQ. - -You live with me, and I with you, -And you will be my POSSLQ. -I'll be your friend and so much more; -That's what a POSSLQ is for. - -And everything we will confess; -Yes, even to the IRS. -Some day on what we both may earn, -Perhaps we'll file a joint return. -You'll share my pad, my taxes, joint; -You'll share my life - up to a point! -And that you'll be so glad to do, -Because you'll be my POSSLQ. -% -Come, muse, let us sing of rats! - -- From a poem by James Grainger (1721-1767) -% -Come quickly, I am tasting stars! - -- Dom Perignon, upon discovering champagne -% -Come, you spirits -That tend on mortal thoughts, unsex me here, -And fill me, from the crown to the toe, top-full -Of direst cruelty! make thick my blood, -Stop up the access and passage to remorse -That no compunctious visiting of nature -Shake my fell purpose, not keep peace between -The effect and it! Come to my woman's breasts, -And take my milk for gall, you murdering ministers, -Wherever in your sightless substances -You wait on nature's mischief! Come, thick night, -And pall the in the dunnest smoke of hell, -That my keen knife see not the wound it makes, -Nor heaven peep through the blanket of the dark, -To cry `Hold, hold!' - -- Lady Macbeth, "Macbeth" -% -Comedy, like Medicine, was never meant to be practiced by the general public. -% -Coming to Stores Near You: - -101 Grammatically Correct Popular Tunes Featuring: - - (You Aren't Anything but a) Hound Dog - It Doesn't Mean a Thing If It Hasn't Got That Swing - I'm Not Misbehaving - -And A Whole Lot More... -% -Coming together is a beginning; - keeping together is progress; - working together is success. -% -Command, n.: - Statement presented by a human and accepted by a computer in - such a manner as to make the human feel as if he is in control. -% -Commit the oldest sins the newest kind of ways. - -- William Shakespeare, "Henry IV" -% -Commitment, n.: - Commitment can be illustrated by a breakfast of ham and eggs. - The chicken was involved, the pig was committed. -% -Committee, n.: - A group of men who individually can do nothing but as a group - decide that nothing can be done. - -- Fred Allen -% -Committee Rules: - (1) Never arrive on time, or you will be stamped a beginner. - (2) Don't say anything until the meeting is half over; this - stamps you as being wise. - (3) Be as vague as possible; this prevents irritating the - others. - (4) When in doubt, suggest that a subcommittee be appointed. - (5) Be the first to move for adjournment; this will make you - popular -- it's what everyone is waiting for. -% -Committees have become so important nowadays that subcommittees have to -be appointed to do the work. -% -Common sense and a sense of humor are the same thing, moving at -different speeds. A sense of humor is just common sense, dancing. - -- Clive James -% -Common sense is instinct, and enough of it is genius. - -- Josh Billings -% -Common sense is the collection of prejudices acquired by age eighteen. - -- Albert Einstein -% -Common sense is the most evenly distributed quantity in the world. -Everyone thinks he has enough. - -- Rene Descartes, 1637 -% -Commoner's three laws of ecology: - 1) No action is without side-effects. - 2) Nothing ever goes away. - 3) There is no free lunch. -% -Communicate! It can't make things any worse. -% -Comparing information and knowledge is like asking whether the fatness -of a pig is more or less green than the designated hitter rule." - -- David Guaspari -% -Comparing software engineering to classical engineering assumes that software -has the ability to wear out. Software typically behaves, or it does not. It -either works, or it does not. Software generally does not degrade, abrade, -stretch, twist, or ablate. To treat it as a physical entity, therefore, is -misapplication of our engineering skills. Classical engineering deals with -the characteristics of hardware; software engineering should deal with the -characteristics of *software*, and not with hardware or management. - -- Dan Klein -% -COMPASS [for the CDC-6000 series] is the sort of assembler -one expects from a corporation whose president codes in octal. - -- J. N. Gray -% -Competence, like truth, beauty, and contact lenses, -is in the eye of the beholder. - -- Dr. Laurence J. Peter -% -Competitive fury is not always anger. It is the true missionary's -courage and zeal in facing the possibility that one's best may not -be enough. - -- Gene Scott -% -COMPLEX SYSTEM: - One with real problems and imaginary profits. -% -COMPLIMENT: - When you say something to another which everyone knows isn't true. -% -Compuberty, n.: - The uncomfortable period of emotional and hormonal changes a - computer experiences when the operating system is upgraded and - a sun4 is put online sharing files. -% -COMPUTER: - An electronic entity which performs sequences of useful steps in a - totally understandable, rigorously logical manner. If you believe - this, see me about a bridge I have for sale in Manhattan. -% -Computer programmers do it byte by byte. -% -Computer programmers never die, they just get lost in the processing. -% -Computer programs expand so as to fill the core available. -% -COMPUTER SCIENCE: - 1) A study akin to numerology and astrology, but lacking the - precision of the former and the success of the latter. - 2) The protracted value analysis of algorithms. - 3) The costly enumeration of the obvious. - 4) The boring art of coping with a large number of trivialities. - 5) Tautology harnessed in the service of Man at the speed of light. - 6) The Post-Turing decline in formal systems theory. -% -Computer Science is no more about computers than astronomy is about -telescopes. - -- Edsger W. Dijkstra -% -Computer Science is the only discipline in which we view -adding a new wing to a building as being maintenance - -- Jim Horning -% -Computers are not intelligent. They only think they are. -% -Computers are unreliable, but humans are even more unreliable. -Any system which depends on human reliability is unreliable. - -- Gilb -% -Computers are useless. They can only give you answers. - -- Pablo Picasso -% -Computers can figure out all kinds of problems, except the things in -the world that just don't add up. -% -Computers can't cruise. Meandering is a foreign concept to them. -The computer assumes that all behavior is in pursuit of an ultimate -goal. Whenever a motorist changes his or her mind and veers off -course, the GPS lady issues that snippy announcement: "Recalculating!" - -- Joel Achenbach (www.slate.com, 20 Jun 2008) -% -Computers don't actually think. - You just think they think. - (We think.) -% -Computers will not be perfected until they can compute how much more -than the estimate the job will cost. -% -Conceit causes more conversation than wit. - -- Francois de La Rochefoucauld -% -Concept, n.: - Any "idea" for which an outside consultant billed you more than - $25,000. -% -Conceptual integrity in turn dictates that the design must proceed -from one mind, or from a very small number of agreeing resonant minds. - -- Frederick Brooks, Jr., "The Mythical Man-Month" -% -Condense soup, not books! -% -CONFERENCE: - A special meeting in which the boss gathers subordinates to hear - what they have to say, so long as it doesn't conflict with what - he's already decided to do. -% -Confess your sins to the Lord and you will be forgiven; -confess them to man and you will be laughed at. - -- Josh Billings -% -Confession is good for the soul, but bad for the career. -% -Confession is good for the soul only in the sense -that a tweed coat is good for dandruff. - -- Peter de Vries -% -Confessions may be good for the soul, but they are bad for -the reputation. - -- Lord Thomas Robert Dewar -% -Confidant, confidante, n.: - One entrusted by A with the secrets of B, confided to himself by C. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Confidence is simply that quiet, assured feeling you have before you -fall flat on your face. - -- Dr. L. Binder -% -Confidence is the feeling you have before you understand the situation. -% -CONFIRMED BACHELOR: - A man who goes through life without a hitch. -% -Conflicting research paradigms -Have legitimized various crimes. - The worst we can see - Is in psychology, -Measuring reaction times. -% -Conformity is the refuge of the unimaginative. -% -Confucius say too damn much! -% -Confucius say too much. - -- Recent Chinese proverb -% -Confusion will be my epitaph -as I walk a cracked and broken path -If we make it we can all sit back and laugh -but I fear that tomorrow we'll be crying. - -- King Crimson, "In the Court of the Crimson King" -% -Congratulations! You are the one-millionth user to log into our system. -If there's anything special we can do for you, anything at all, don't -hesitate to ask! -% -Congratulations! You have purchased an extremely fine device that -would give you thousands of years of trouble-free service, except that -you undoubtably will destroy it via some typical bonehead consumer -maneuver. Which is why we ask you to PLEASE FOR GOD'S SAKE READ THIS -OWNER'S MANUAL CAREFULLY BEFORE YOU UNPACK THE DEVICE. YOU ALREADY -UNPACKED IT, DIDN'T YOU? YOU UNPACKED IT AND PLUGGED IT IN AND TURNED -IT ON AND FIDDLED WITH THE KNOBS, AND NOW YOUR CHILD, THE SAME CHILD -WHO ONCE SHOVED A POLISH SAUSAGE INTO YOUR VIDEOCASSETTE RECORDER AND -SET IT ON "FAST FORWARD", THIS CHILD ALSO IS FIDDLING WITH THE KNOBS, -RIGHT? AND YOU'RE JUST NOW STARTING TO READ THE INSTRUCTIONS, -RIGHT??? WE MIGHT AS WELL JUST BREAK THESE DEVICES RIGHT AT THE -FACTORY BEFORE WE SHIP THEM OUT, YOU KNOW THAT? - -- Dave Barry, "Read This First!" -% -Congratulations are in order for Tom Reid. - -He says he just found out he is the winner of the 2021 Psychic of the -Year award. -% -Congratulations! - -Some products leave home silently, some go kicking and screaming. If -v1.0 was the first born who came downstairs with shoes untied missing -a sock and a belt, then this one was a full fledged punk rocker -with neon hair and multiple piercings. I believe we squeezed it into -a suit and tie and brought its color back to an earth tone before it -left. - - -- An HP engineering project manager who shall remain - nameless to the development team after releasing - the second version of their product. -% -Conjecture: All odd numbers are prime. - - Mathematician's Proof: - 3 is prime. 5 is prime. 7 is prime. By induction, all - odd numbers are prime. - Physicist's Proof: - 3 is prime. 5 is prime. 7 is prime. 9 is experimental - error. 11 is prime. 13 is prime ... - Engineer's Proof: - 3 is prime. 5 is prime. 7 is prime. 9 is prime. - 11 is prime. 13 is prime ... - Computer Scientist's Proof: - 3 is prime. 3 is prime. 3 is prime. 3 is prime... -% -Connector Conspiracy, n.: - [probably came into prominence with the appearance of the -KL-10, none of whose connectors match anything else] The tendency of -manufacturers (or, by extension, programmers or purveyors of anything) -to come up with new products which don't fit together with the old -stuff, thereby making you buy either all new stuff or expensive -interface devices. -% -Conquering Russia should be done steppe by steppe. -% -Conquering the world on horseback is easy; it is dismounting and -governing that is hard. - -- Chinggis (Genghis) Khan -% -Conscience doth make cowards of us all. - -- William Shakespeare -% -Conscience is a mother-in-law whose visit never ends. - -- H. L. Mencken -% -Conscience is defined as the thing that hurts -when everything else feels great. -% -Conscience is the inner voice that warns us somebody may be looking. - -- H. L. Mencken, "A Mencken Chrestomathy" -% -Conscious is when you are aware of something and conscience is when you -wish you weren't. -% -CONSENT DECREE: - A document in which a hapless company consents never to commit - in the future whatever heinous violations of Federal law it - never admitted to in the first place. -% -Consequences, Schmonsequences, as long as I'm rich. - -- "Ali Baba Bunny" [1957, Chuck Jones] -% -Conservative, n.: - A statesman who is enamored of existing evils, as distinguished - from the Liberal who wishes to replace them with others. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Consider a spherical bear, in simple harmonic motion... - -- Professor in the UCB physics department -% -Consider the following axioms carefully: - "Everything's better when it sits on a Ritz." - and - "Everything's better with Blue Bonnet on it." -What happens if one spreads Blue Bonnet margarine on a Ritz cracker? The -thought is frightening. Is this how God came into being? Try not to -consider the fact that "Things go better with Coke". -% -Consider the little mouse, how sagacious an animal -it is which never entrusts its life to one hole only. - -- Titus Maccius Plautus -% -Consider the postage stamp: its usefulness consists in -the ability to stick to one thing till it gets there. - -- Josh Billings -% -CONSULTANT: - (1) Someone you pay to take the watch off your wrist and tell - you what time it is. (2) (For resume use) The working title - of anyone who doesn't currently hold a job. Motto: Have - Calculator, Will Travel. -% -CONSULTANT: - An ordinary man a long way from home. -% -CONSULTANT: - [From con "to defraud, dupe, swindle," or, possibly, French con - (vulgar) "a person of little merit" + sult elliptical form of - "insult."] A tipster disguised as an oracle, especially one who - has learned to decamp at high speed in spite of a large briefcase - and heavy wallet. -% -CONSULTANT: - Someone who'd rather climb a tree and tell a - lie than stand on the ground and tell the truth. -% -Consultants are mystical people who ask a -company for a number and then give it back to them. -% -CONSULTATION: - Medical term meaning "to share the wealth." -% -Contemporary American feminism's simplistic psychology is illustrated by -the new cliche of the date-rape furor: "`No' always means `no'." Will -we ever graduate from the Girl Scouts? "No" has always been, and always -will be, part of the dangerous alluring courtship ritual of sex and -seduction, observable even in the animal kingdom. - -- Camille Paglia, NY Times, Dec. 14 1990, Op Ed. -% -"Contrariwise," continued Tweedledee, "if it was so, it might be, and -if it were so, it would be; but as it isn't, it ain't. That's logic!" - -- Lewis Carroll, - "Through the Looking-Glass, - and What Alice Found There" (1871) -% -Contrary to popular belief, penguins are not the salvation of modern -technology. Neither do they throw parties for the urban proletariat. -% -Convention is the ruler of all. - -- Pindar -% -Conversation enriches the understanding, -but solitude is the school of genius. -% -Conversation, n.: - A vocal competition in which the one who is catching his breath - is called the listener. -% -Conway's Law: - In any organization there will always be one person who knows - what is going on. - - This person must be fired. -% -Cops never say good-bye. They're always hoping to see you again in the -line-up. - -- Raymond Chandler -% -COPYING MACHINE: - A device that shreds paper, flashes mysteriously coded messages, - and makes duplicates for everyone in the office who isn't - interested in reading them. -% -Coronation, n.: - The ceremony of investing a sovereign with the outward and - visible signs of his divine right to be blown skyhigh with a - dynamite bomb. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Correction does much, but encouragement does more. - -- Johann Wolfgang von Goethe -% -Corrupt, adj.: - In politics, holding an office of trust or profit. -% -Corrupt, stupid grasping functionaries will make at least as big a muddle -of socialism as stupid, selfish and acquisitive employers can make of -capitalism. - -- Walter Lippmann -% -Corruption is not the No. 1 priority of the Police Commissioner. -His job is to enforce the law and fight crime. - -- P.B.A. President E. J. Kiernan -% -Corry's Law: - Paper is always strongest at the perforations. -% -Couldn't we jury-rig the cat to act as an audio switch, and have it yell -at people to save their core images before logging them out? I'm sure -the cattle prod would be effective in this regard. In any case, a traverse -mounted iguana, while more perverted, gives better traction, not to mention -being easier to stake. -% -Counting in binary is just like counting -in decimal -- if you are all thumbs. - -- Glaser and Way -% -Counting in octal is just like counting -in decimal -- if you don't use your thumbs. - -- Tom Lehrer -% -Courage is fear that has said its prayers. -% -Courage is grace under pressure. -% -Courage is resistance to fear, mastery of fear -- not absence of fear. - -- Mark Twain -% -Courage is your greatest present need. -% -Court, n.: - A place where they dispense with justice. - -- Arthur Train -% -Courtship to marriage, as a very witty prologue to a very dull play. - -- William Congreve -% -Coward, n.: - One who in a perilous emergency thinks with his legs. - -- Ambrose Bierce, "The Devil's Dictionary" -% -[Crash programs] fail because they are based on the theory that, -with nine women pregnant, you can get a baby a month. - -- Wernher von Braun -% -Crazee Edeee, his prices are INSANE!!! -% -Creating computer software is always a demanding and painstaking -process -- an exercise in logic, clear expression, and almost fanatical -attention to detail. It requires intelligence, dedication, and an -enormous amount of hard work. But, a certain amount of unpredictable -and often unrepeatable inspiration is what usually makes the difference -between adequacy and excellence. -% -Creativity in living is not without its attendant difficulties, for -peculiarity breeds contempt. And the unfortunate thing about being -ahead of your time when people finally realize you were right, they'll -say it was obvious all along. - -- Alan Ashley-Pitt -% -Creativity is no substitute for knowing what you are doing. -% -Creativity is not always bred in an environment of tranquility; -sometimes you have to squeeze a little to get the paste out of the tube. -% -Credit ... is the only enduring testimonial to man's confidence in man. - -- James Blish -% -CREDITOR: - A man who has a better memory than a debtor. -% -Crenna's Law of Political Accountability: - If you are the first to know about something bad, - you are going to be held responsible for acting on it, - regardless of your formal duties. -% -Crime does not pay... as well as politics. - -- A. E. Neuman -% -Critic, n.: - A person who boasts himself hard to please because nobody tries - to please him. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Criticism comes easier than craftsmanship. - -- Zeuxis -% -Critics are like eunuchs in a harem: they know how it's done, they've -seen it done every day, but they're unable to do it themselves. - -- Brendan Behan -% -Crito, I owe a cock to Asclepius; will you remember to pay the debt? - -- Socrates' last words -% -Croll's Query: - If tin whistles are made of tin, what are foghorns made of? -% -Cropp's Law: - The amount of work done varies inversely - with the time spent in the office. -% -Crucifixes are sexy because there's a naked man on them. - -- Madonna -% -Cruickshank's Law of Committees: - If a committee is allowed to discuss a bad idea long enough, it - will inevitably decide to implement the idea simply because so - much work has already been done on it. -% -Crusade for Cthulhu! It Found ME! -% -Crush! Kill! Destroy! -% -Cthulhu Cthucks! -% -Cthulhu for President! - (If you're tired of choosing the lesser of two evils.) -% -Cthulhu Saves -- in case He's hungry later. -% -Culture is the habit of being pleased with the best and knowing why. -% -Cure the disease and kill the patient. - -- Francis Bacon -% -CURSOR: - One whose program will not run. - -- Robb Russon -% -Cursor address, n.: - "Hello, cursor!" - -- Stan Kelly-Bootle, "The Devil's DP Dictionary" -% -curtation n. The enforced compression of a string in the fixed-length field -environment. - The problem of fitting extremely variable-length strings such as names, -addresses, and item descriptions into fixed-length records is no trivial -matter. Neglect of the subtle art of curtation has probably alienated more -people than any other aspect of data processing. You order Mozart's "Don -Giovanni" from your record club, and they invoice you $24.95 for MOZ DONG. -The witless mapping of the sublime onto the ridiculous! Equally puzzling is -the curtation that produces the same eight characters, THE BEST, whether you -order "The Best of Wagner", "The Best of Schubert", or "The Best of the Turds". -Similarly, wine lovers buying from computerized wineries twirl their glasses, -check their delivery notes, and inform their friends, "A rather innocent, -possibly overtruncated CAB SAUV 69 TAL." The squeezing of fruit into 10 -columns has yielded such memorable obscenities as COX OR PIP. The examples -cited are real, and the curtational methodology which produced them is still -with us. - -MOZ DONG n. - Curtation of Don Giovanni by Wolfgang Amadeus Mozart and Lorenzo da -Ponte, as performed by the computerized billing ensemble of the Internat'l -Preview Society, Great Neck (sic), N.Y. - -- Stan Kelly-Bootle, "The Devil's DP Dictionary" -% -Custer committed Siouxicide. -% -Cut a man's hand when you fight him. He'll freeze, fascinated by the sight -of his own blood. That's when you stick him in the throat. - -- Gerry Youghkins - -If you look rather casual with the knife when you flick it open, people -don't like it. - -- Gerry Youghkins -% -Cutler Webster's Law: - There are two sides to every argument, unless a person - is personally involved, in which case there is only one. -% -Cutting the space budget really restores my faith in humanity. It -eliminates dreams, goals, and ideals and lets us get straight to the -business of hate, debauchery, and self-annihilation. - -- Johnny Hart -% -Cynic, n.: - A blackguard whose faulty vision sees things as they are, not - as they ought to be. Hence the custom among the Scythians of - plucking out a cynic's eyes to improve his vision. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Cynic, n.: - Experienced. -% -Cynic, n.: - One who looks through rose-colored glasses with a jaundiced - eye. -% -Dad always thought laughter was the best medicine, which I guess is why -several of us died of tuberculosis. - -- Jack Handey -% - Wasn't EMACS originally developed as a swap memory stresser, -though? - -<``Erik> lispos emulator? gotta admit it's well featured, the only thing -it lacks is a decent editor -% -DALLAS: - The city that chose Astroturf to - keep the cheerleaders from grazing. -% -Dammit Jim, I'm an actor not a doctor. -% -Dammit, man, that's unprofessional! A good bartender laughs anyway! -% -Damn braces. - -- William Blake, "Proverbs of Hell" -% -Damn, I need a Coke! - -- Dr. William DeVries - [after implanting the first artificial human heart] -% -DAMN IT, I GOTTA GET OUTTA HERE! -% -Dare to be naive. - -- R. Buckminster Fuller -% -Dark and lonely on a summer night - Kill my landlord, - Kill my landlord. -The watchdog barkin' -Do he bite? - Kill my landlord, - Kill my landlord. -Slip in his window. -Break his neck. -Then his house I start to wreck -Got no reason, -What the heck? - Kill my landlord, - Kill my landlord. - C-I-L-L my landlord! - -- "Images" by Tyrone Green, SNL -% -Darling: the popular form of address used in speaking to a member of the -opposite sex whose name you cannot at the moment remember. - -- Oliver Herford -% -Darth Vader! Only you would be so bold! - -- Princess Leia Organa -% -Darth Vader sleeps with a Teddywookie. -% -DATA: - An accrual of straws on the backs of theories. -% -DATA: - Computerspeak for "information". Properly pronounced - the way Bostonians pronounce the word for a female child. -% -Data is not information; -Information is not knowledge; -Knowledge is not wisdom; - -- Gary Flake -% -Dave Mack: "Your stupidity, Allen, is simply not up to par." -Allen Gwinn: "Yours is." -% -David Letterman's "Things we can be proud of as Americans": - - * Greatest number of citizens who have actually boarded a UFO - * Many newspapers feature "JUMBLE" - * Hourly motel rates - * Vast majority of Elvis movies made here - * Didn't just give up right away during World War II - like some countries we could mention - * Goatees & Van Dykes thought to be worn only by weenies - * Our well-behaved golf professionals - * Fabulous babes coast to coast -% -David Sarnoff, 1964: "The computer will become the hub of a vast network of -remote data stations and information banks feeding into the machine at -a transmission rate of a billion or more bits of information a -second. Laser channels will vastly increase both data capacity and the -speeds with which it will be transmitted. Eventually, a global -communications network handling voice, data and facsimile will -instantly link man to machine--or machine to machine--by land, air, -underwater, and space circuits. [The computer] will affect man's -ways of thinking, his means of education, his relationship to his physical -and social environment, and it will alter his ways of living... -[Before the end of this century, these forces] will coalesce into what -unquestionably will become the greatest adventure of the human mind." - -- Eugene Lyons, "David Sarnoff" 1966 -% -Davis' Law of Traffic Density: - The density of rush-hour traffic is directly proportional to - 1.5 times the amount of extra time you allow to arrive on time. -% -Davis's Dictum: - Problems that go away by themselves, come back by themselves. -% -Dawn, n.: - The time when men of reason go to bed. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Day of inquiry. You will be subpoenaed. -% -%DCL-E-MEMBAD, bad memory --SYSTEM-F-VMSPDGERS, pudding between the ears -% -DEADWOOD: - Anyone in your company who is more senior than you are. -% -Dealing with failure is easy: - Work hard to improve. -Success is also easy to handle: - You've solved the wrong problem. Work hard to improve. -% -Dealing with the problem of pure staff accumulation, -all our researches ... point to an average increase of 5.75% per year. - -- C. N. Parkinson -% -Dear Emily: - How can I choose what groups to post in? - -- Confused - -Dear Confused: - Pick as many as you can, so that you get the widest audience. After -all, the net exists to give you an audience. Ignore those who suggest you -should only use groups where you think the article is highly appropriate. -Pick all groups where anybody might even be slightly interested. - Always make sure followups go to all the groups. In the rare event -that you post a followup which contains something original, make sure you -expand the list of groups. Never include a "Followup-to:" line in the -header, since some people might miss part of the valuable discussion in -the fringe groups. - -- Emily Postnews Answers Your Questions on Netiquette -% -Dear Emily: - I collected replies to an article I wrote, and now it's time to -summarize. What should I do? - -- Editor - -Dear Editor: - Simply concatenate all the articles together into a big file and post -that. On USENET, this is known as a summary. It lets people read all the -replies without annoying newsreaders getting in the way. Do the same when -summarizing a vote. - -- Emily Postnews Answers Your Questions on Netiquette -% -Dear Emily: - I recently read an article that said, "reply by mail, I'll summarize." -What should I do? - -- Doubtful - -Dear Doubtful: - Post your response to the whole net. That request applies only to -dumb people who don't have something interesting to say. Your postings are -much more worthwhile than other people's, so it would be a waste to reply by -mail. - -- Emily Postnews Answers Your Questions on Netiquette -% -Dear Emily: - I saw a long article that I wish to rebut carefully, what should -I do? - -- Angry - -Dear Angry: - Include the entire text with your article, and include your comments -between the lines. Be sure to post, and not mail, even though your article -looks like a reply to the original. Everybody *loves* to read those long -point-by-point debates, especially when they evolve into name-calling and -lots of "Is too!" -- "Is not!" -- "Is too, twizot!" exchanges. - -- Emily Postnews Answers Your Questions on Netiquette -% -Dear Emily: - I'm having a serious disagreement with somebody on the net. I -tried complaints to his sysadmin, organizing mail campaigns, called for -his removal from the net and phoning his employer to get him fired. -Everybody laughed at me. What can I do? - -- A Concerned Citizen - -Dear Concerned: - Go to the daily papers. Most modern reporters are top-notch computer -experts who will understand the net, and your problems, perfectly. They -will print careful, reasoned stories without any errors at all, and surely -represent the situation properly to the public. The public will also all -act wisely, as they are also fully cognizant of the subtle nature of net -society. - Papers never sensationalize or distort, so be sure to point out things -like racism and sexism wherever they might exist. Be sure as well that they -understand that all things on the net, particularly insults, are meant -literally. Link what transpires on the net to the causes of the Holocaust, if -possible. If regular papers won't take the story, go to a tabloid paper -- -they are always interested in good stories. -% -Dear Emily: - I'm still confused as to what groups articles should be posted -to. How about an example? - -- Still Confused - -Dear Still: - Ok. Let's say you want to report that Gretzky has been traded from -the Oilers to the Kings. Now right away you might think rec.sport.hockey -would be enough. WRONG. Many more people might be interested. This is a -big trade! Since it's a NEWS article, it belongs in the news.* hierarchy -as well. If you are a news admin, or there is one on your machine, try -news.admin. If not, use news.misc. - The Oilers are probably interested in geology, so try sci.physics. -He is a big star, so post to sci.astro, and sci.space because they are also -interested in stars. Next, his name is Polish sounding. So post to -soc.culture.polish. But that group doesn't exist, so cross-post to -news.groups suggesting it should be created. With this many groups of -interest, your article will be quite bizarre, so post to talk.bizarre as -well. (And post to comp.std.mumps, since they hardly get any articles -there, and a "comp" group will propagate your article further.) - You may also find it is more fun to post the article once in each -group. If you list all the newsgroups in the same article, some newsreaders -will only show the article to the reader once! Don't tolerate this. - -- Emily Postnews Answers Your Questions on Netiquette -% -Dear Emily: - Today I posted an article and forgot to include my signature. -What should I do? - -- Forgetful - -Dear Forgetful: - Rush to your terminal right away and post an article that says, -"Oops, I forgot to post my signature with that last article. Here -it is." - Since most people will have forgotten your earlier article, -(particularly since it dared to be so boring as to not have a nice, juicy -signature) this will remind them of it. Besides, people care much more -about the signature anyway. - -- Emily Postnews Answers Your Questions on Netiquette -% -Dear Emily, what about test messages? - -- Concerned - -Dear Concerned: - It is important, when testing, to test the entire net. Never test -merely a subnet distribution when the whole net can be done. Also put "please -ignore" on your test messages, since we all know that everybody always skips -a message with a line like that. Don't use a subject like "My sex is female -but I demand to be addressed as male." because such articles are read in depth -by all USEnauts. - -- Emily Postnews Answers Your Questions on Netiquette -% -Dear Freshman, - You don't know who I am and frankly shouldn't care, but -unknown to you we have something in common. We are both rather -prone to mistakes. I was elected Student Government President by -mistake, and you came to school here by mistake. -% -Dear Lord: - I just want *_o_n_e* one-armed manager so I never have to hear "On -the other hand", again. -% -Dear Lord: Please make my words sweet and tender, for tomorrow I may -have to eat them. -% -Dear Miss Manners: - My home economics teacher says that one must never place one's -elbows on the table. However, I have read that one elbow, in between -courses, is all right. Which is correct? - -Gentle Reader: - For the purpose of answering examinations in your home -economics class, your teacher is correct. Catching on to this principle -of education may be of even greater importance to you now than learning -correct current table manners, vital as Miss Manners believes that is. -% -Dear Miss Manners: -I carry a big black umbrella, even if there's just a thirty percent chance of -rain. May I ask a young lady who is a stranger to me to share its protection? -This morning, I was waiting for a bus in comparative comfort, my umbrella -protecting me from the downpour, and noticed an attractive young woman getting -soaked. I have often seen her at my bus stop, although we have never spoken, -and I don't even know her name. Could I have asked her to get under my -umbrella without seeming insulting? - -Gentle Reader: -Certainly. Consideration for those less fortunate than you is always proper, -although it would be more convincing if you stopped babbling about how -attractive she is. In order not to give Good Samaritanism a bad name, Miss -Manners asks you to allow her two or three rainy days of unmolested protection -before making your attack. -% -Dear Mister Language Person: I am curious about the expression, "Part -of this complete breakfast". The way it comes up is, my 5-year-old -will be watching TV cartoon shows in the morning, and they'll show a -commercial for a children's compressed breakfast compound such as -"Froot Loops" or "Lucky Charms", and they always show it sitting on a -table next to some actual food such as eggs, and the announcer always -says: "Part of this complete breakfast". Don't that really mean, -"Adjacent to this complete breakfast", or "On the same table as this -complete breakfast"? And couldn't they make essentially the same claim -if, instead of Froot Loops, they put a can of shaving cream there, or a -dead bat? - -Answer: Yes. - -- Dave Barry, "Tips for Writer's" -% -Dear Mister Language Person: What is the purpose of the apostrophe? - -Answer: The apostrophe is used mainly in hand-lettered small business signs -to alert the reader than an "S" is coming up at the end of a word, as in: -WE DO NOT EXCEPT PERSONAL CHECK'S, or: NOT RESPONSIBLE FOR ANY ITEM'S. -Another important grammar concept to bear in mind when creating hand- lettered -small-business signs is that you should put quotation marks around random -words for decoration, as in "TRY" OUR HOT DOG'S, or even TRY "OUR" HOT DOG'S. - -- Dave Barry, "Tips for Writer's" -% -Dear Ms. Postnews: - I couldn't get mail through to somebody on another site. What - should I do? - -- Eager Beaver - -Dear Eager: - No problem, just post your message to a group that a lot of people -read. Say, "This is for John Smith. I couldn't get mail through so I'm -posting it. All others please ignore." - This way tens of thousands of people will spend a few seconds scanning -over and ignoring your article, using up over 16 man-hours their collective -time, but you will be saved the terrible trouble of checking through usenet -maps or looking for alternate routes. Just think, if you couldn't distribute -your message to 9000 other computers, you might actually have to (gasp) call -directory assistance for 60 cents, or even phone the person. This can cost -as much as a few DOLLARS (!) for a 5 minute call! - And certainly it's better to spend 10 to 20 dollars of other people's -money distributing the message than for you to have to waste $9 on an overnight -letter, or even 25 cents on a stamp! - Don't forget. The world will end if your message doesn't get through, -so post it as many places as you can. - -- Emily Postnews Answers Your Questions on Netiquette -% -Death before dishonor. -But neither before breakfast. -% -Death comes on every passing breeze, -He lurks in every flower; -Each season has its own disease, -Its peril -- every hour. - -- Reginald Heber -% -Death has been proven to be 99% fatal in laboratory rats. -% -Death is a spirit leaving a body, sort -of like a shell leaving the nut behind. - -- Erma Bombeck -% -Death is God's way of telling you not to be such a wise guy. -% -Death is life's way of telling you you've been fired. - -- R. Geis -% -Death is Nature's way of recycling human beings. -% -Death is nature's way of saying `Howdy'. -% -Death is nature's way of telling you to slow down. -% -Death is only a state of mind. - -Only it doesn't leave you much time to think about anything else. -% -Death rays don't kill people, people kill people! -% -Death to all fanatics! -% -DEATH WISH: - The only wish that always comes true, whether or not one wishes it to. -% -Debug is human, de-fix divine. -% -Debugging is anticipated with distaste, performed with reluctance, -and bragged about forever. -- Button at the Boston Computer Museum -% -DEC diagnostics would run on a dead whale. - -- Mel Ferentz -% -Decemba, n: The 12th month of the year. -erra, n: A mistake. -faa, n: To, from, or at considerable distance. -Linder, n: A female name. -memba, n: To recall to the mind; think of again. -New Hampsha, n: A state in the northeast United States. -New Yaak, n: Another state in the northeast United States. -Novemba, n: The 11th month of the year. -Octoba, n: The 10th month of the year. -ova, n: Location above or across a specified position. What the - season is when the Knicks quit playing. - -- Massachewsetts Unabridged Dictionary -% -Decision maker, n.: - The person in your office who was unable to form a task force - before the music stopped. -% -Decisions of the judges will be final unless shouted down by a really over- -whelming majority of the crowd present. Abusive and obscene language may -not be used by contestants when addressing members of the judging panel, -or, conversely, by members of the judging panel when addressing contestants -(unless struck by a boomerang). - -- Mudgeeraba Creek Emu-Riding and Boomerang-Throwing Assoc. -% -Declared guilty... of displaying feelings of an almost human nature. - -- Pink Floyd, "The Wall" -% -Decorate your home. It gives the illusion -that your life is more interesting than it really is. - -- C. Schultz -% -"Deep" is a word like "theory" or "semantic" -- it implies all sorts of -marvelous things. It's one thing to be able to say "I've got a theory", -quite another to say "I've got a semantic theory", but, ah, those who can -claim "I've got a deep semantic theory", they are truly blessed. - -- Randy Davis -% -DEFAULT: - The hardware's, of course. -% -Default, n.: - [Possibly from Black English "De fault wid dis system is you, -mon."] The vain attempt to avoid errors by inactivity. "Nothing will -come of nothing: speak again." -- King Lear. - -- Stan Kelly-Bootle, "The Devil's DP Dictionary" -% -Defeat is worse than death because you have to live with defeat. - -- Bill Musselman -% -#define BITCOUNT(x) (((BX_(x)+(BX_(x)>>4)) & 0x0F0F0F0F) % 255) -#define BX_(x) ((x) - (((x)>>1)&0x77777777) \ - - (((x)>>2)&0x33333333) \ - - (((x)>>3)&0x11111111)) - - -- really weird C code to count the number of bits in a word -% -Definitions of hardware and software for dummies: - - Hardware is what you kick; - Software is what you curse. -% -Deflector shields just came on, Captain. -% -(defun NF (a c) - (cond ((null c) () ) - ((atom (car c)) - (append (list (eval (list 'getchar (list (car c) 'a) (cadr c)))) - (nf a (cddr c)))) - (t (append (list (implode (nf a (car c)))) (nf a (cdr c)))))) - -(defun AD (want-job challenging boston-area) - (cond - ((or (not (equal want-job 'yes)) - (not (equal boston-area 'yes)) - (lessp challenging 7)) () ) - (t (append (nf (get 'ad 'expr) - '((caaddr 1 caadr 2 car 1 car 1) - (car 5 cadadr 9 cadadr 8 cadadr 9 caadr 4 car 2 car 1) - (car 2 caadr 4))) - (list '851-5071x2661))))) -;;; We are an affirmative action employer. -% -DEJA VU: - French., already seen; unoriginal; trite. - Psychol., The illusion of having previously experienced - something actually being encountered for the first time. - Psychol., The illusion of having previously experienced - something actually being encountered for the first time. -% -Delay is preferable to error. - -- Thomas Jefferson -% -Delay not, Caesar. Read it instantly. - -- William Shakespeare, "Julius Caesar" 3,1 - -Here is a letter, read it at your leisure. - -- William Shakespeare, "Merchant of Venice" 5,1 - - [Quoted in "VMS Internals and Data Structures", V4.4, when - referring to I/O system services.] -% -Deliberate provocation of mystical experience, particularly by LSD and -related hallucinogens, in contrast to spontaneous visionary experiences, -entails dangers that must not be underestimated. Practitioners must take -into account the peculiar effects of these substances, namely their ability -to influence our consciousness, the innermost essence of our being. The -history of LSD to date amply demonstrates the catastrophic consequences that -can ensue when its profound effect is misjudged and the substance is mistaken -for a pleasure drug. Special internal and external advance preparations -are required; with them, an LSD experiment can become a meaningful experience. - -- Dr. Albert Hoffman, the discoverer of LSD - -I believe that if people would learn to use LSD's vision-inducing capability -more wisely, under suitable conditions, in medical practice and in conjunction -with meditation, then in the future this problem child could become a wonder -child. - -- Dr. Albert Hoffman -% -Deliberation, n.: - The act of examining one's bread to determine which side it is - buttered on. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Deliver yesterday, code today, think tomorrow. -% -Delores breezed along the surface of her life like a flat stone forever -skipping along smooth water, rippling reality sporadically but oblivious -to it consistently, until she finally lost momentum, sank, and due to an -overdose of fluoride as a child which caused her to suffer from chronic -apathy, doomed herself to lie forever on the floor of her life as useless -as an appendix and as lonely as a five-hundred pound barbell in a -steroid-free fitness center. - -- Winning sentence, 1990 Bulwer-Lytton bad fiction contest -% -Delusions are often functional. A mother's opinions about -her children's beauty, intelligence, goodness, et cetera ad -nauseam, keep her from drowning them at birth. -% -Demand the establishment of the government -in its rightful home at Disneyland. -% -Democracy becomes a government of bullies, tempered by editors. - -- Ralph Waldo Emerson -% -Democracy can only be measured on the existence of an opposition. - -- Poul Henningsen (1894-1967) -% -Democracy is a device that insures we shall be governed no better than -we deserve. - -- George Bernard Shaw -% -Democracy is a form of government in which it is permitted to wonder -aloud what the country could do under first-class management. - -- Senator Soaper -% -Democracy is a form of government that substitutes election by the -incompetent many for appointment by the corrupt few. - -- George Bernard Shaw -% -Democracy is a government where you can say what you think even if you -don't think. -% -Democracy is a process by which the people are free to choose the man who -will get the blame. - -- Dr. Laurence J. Peter -% -Democracy is also a form of worship. -It is the worship of Jackals by Jackasses. - -- H. L. Mencken -% -Democracy is good. I say this because other systems are worse. - -- Jawaharlal Nehru -% -Democracy is the name we give the people whenever we need them. - -- Arman de Caillavet, 1913 -% -Democracy is the recurrent suspicion that more than half -of the people are right more than half of the time. - -- E. B. White -% -Democracy is the theory that the common people know what they want, and -deserve to get it good and hard. - -- H. L. Mencken, "Little Book in C major", 1916 -% -Democracy is the worst form of government except all those other -forms that have been tried from time to time. - -- Winston Churchill -% -Democracy, n.: - A government of the masses. Authority derived through mass meeting -or any other form of direct expression. Results in mobocracy. Attitude -toward property is communistic... negating property rights. Attitude toward -law is that the will of the majority shall regulate, whether it is based -upon deliberation or governed by passion, prejudice, and impulse, without -restraint or regard to consequences. Result is demagogism, license, -agitation, discontent, anarchy. - -- U. S. Army Training Manual No. 2000-25 (1928-1932), - since withdrawn. -% -Democracy, n.: - In which you say what you like and do what you're told. - -- Gerald Barry - -The difference between a Democracy and a Dictatorship is that in a -Democracy you vote first and take orders later; in a Dictatorship -you don't have to waste your time voting. - -- Charles Bukowski -% -Democrats buy most of the books that have been banned somewhere. -Republicans form censorship committees and read them as a group. - -Republicans consume three-fourths of the rutabaga produced in the USA. -The remainder is thrown out. - -Republicans usually wear hats and almost always clean their paint brushes. - -Republicans study the financial pages of the newspaper. -Democrats put them in the bottom of the bird cage. - -Most of the stuff alongside the road has been thrown out of car -windows by Democrats. - -- Paul Dickson, "The Official Rules" -% -Demographic polls show that you have lost credibility across the -board. Especially with those 14 year-old Valley girls. -% -Dental health is next to mental health. -% -Dentist, n.: - A Prestidigitator who, putting metal in one's mouth, - pulls coins out of one's pockets. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Denver, n.: - A smallish city located just below the "O" in Colorado. -% -Depart in pieces, i.e., split. -% -Depart not from the path which fate has assigned you. -% -Department chairmen never die, they just lose their faculties. -% -Depend on the rabbit's foot if you will, -but remember, it didn't help the rabbit. - -- R. E. Shay -% -Deprive a mirror of its silver and even the Czar won't see his face. -% -Der Horizont vieler Menschen ist ein Kreis mit Radius Null - -und das nennen sie ihren Standpunkt. -% -Design, v.: - What you regret not doing later on. -% -Desist from enumerating your fowl -prior to their emergence from the shell. -% -Despising machines to a man, -The Luddites joined up with the Klan, - And ride out by night - In a sheeting of white -To lynch all the robots they can. - -- C. M. and G. A. Maxson -% -Despite all appearances, your boss -is a thinking, feeling, human being. -% -Dessert is probably the most important stage of the meal, since it will -be the last thing your guests remember before they pass out all over -the table. - -- The Anarchist Cookbook -% -Destiny is a good thing to accept when it's going your way. When it isn't, -don't call it destiny; call it injustice, treachery, or simple bad luck. - -- Joseph Heller, "God Knows" -% -Detroit is Cleveland without the glitter. -% -DeVries' Dilemma: - If you hit two keys on the typewriter, - the one you don't want hits the paper. -% -Dianetics is a milestone for man comparable to his discovery of -fire and superior to his invention of the wheel and the arch. - -- L. Ron Hubbard -% -Dibble's First Law of Sociology: - Some do, some don't. -% -Did I say 2? I lied. -% -Did it ever occur to you that fat chance -and slim chance mean the same thing? -% -Did you ever notice that everyone in favour of birth control -has already been born? - -- Benny Hill -% -Did you ever walk into a room and forget why you walked in? I think -that's how dogs spend their lives. - -- Sue Murphy -% -Did you ever wonder what you'd say to God if He sneezed? -% -Did you hear about the model who sat -on a broken bottle and cut a nice figure? -% -Did you hear that Captain Crunch, Sugar Bear, Tony the Tiger, and -Snap, Crackle and Pop were all murdered recently... - -Police suspect the work of a cereal killer! -% -Did you hear that there's a group of South American Indians that worship -the number zero? - -Is nothing sacred? -% -Did you hear that two rabbits escaped from the zoo and so far they have -only recaptured 116 of them? -% -Did you know? - EVERY TIME A LOAF OF BREAD IS BAKED, - APPROXIMATELY - 150,000,000 YEASTS ARE - KILLED - - Come to the award-winning 1987 film, - "The Very Small and Quiet Screams" - -- a cinematic electromicrograph of yeasts being baked. - -A must for those who care about yeast, and especially for those who don't. - - SPONSORED BY - Brown Anaerobe Rights Coalition (BARC) - Student Bakers for Social Responsibility - Coalition for the ELevation of Life (CELL) - Campus Crusade for Fetal Matters - -Defend all life: "From greatest to least, from human to yeast!" -% -Did you know about the -o option of the fortune program? It makes a -selection from a set of offensive and/or obscene fortunes. Why not -try it, and see how offended you are? The -a ("all") option will -select a fortune at random from either the offensive or inoffensive -set, and it is suggested that "fortune -a" is the command that you -should have in your .profile or .cshrc. file. -% -Did you know that clones never use mirrors? - -- Ambrose Bierce, "The Devil's Dictionary" -% -Did you know that for the price of a 280-Z you can buy two Z-80's? - -- P. J. Plauger -% -Did you know that if you took all the economists in the world and lined -them up end to end, they'd still point in the wrong direction? -% -Did you know that the voice tapes easily identify the Russian pilot -that shot down the Korean jet? At one point he definitely states: - - "Natasha! First we shoot jet, then we go after moose and - squirrel." - - -- ihuxw!tommyo -% -Did you know the University of Iowa -closed down after someone stole the book? -% -Did you know.... - -That no-one ever reads these things? -% -Didja' ever have to make up your mind, -Pick up on one and leave the other behind, -It's not often easy, and it's not often kind, -Didja' ever have to make up your mind? - -- Lovin' Spoonful -% -Didja hear about the dyslexic devil worshiper who sold his soul to Santa? -% -Die? I should say not, dear fellow. No Barrymore -would allow such a conventional thing to happen to him. - -- John Barrymore's dying words -% -Die, v.: - To stop sinning suddenly. - -- Elbert Hubbard -% -Diet Mountain Dew has the same pH and density of urine. - -- Newsweek, 31 July, 1989 -% -Dieters live life in the fasting lane. -% -Different all twisty a of in maze are you, passages little. -% -Digital circuits are made from analog parts. - -- Don Vonada -% -Dignity is like a flag. -It flaps in a storm. - -- Roy Mengot -% -Dime is money. -% -Dimensions will always be expressed in the least usable term, convertible -only through the use of weird and unnatural conversion factors. Velocity, -for example, will be expressed in furlongs per fortnight. -% -Dinner is ready when the smoke alarm goes off. -% -Dinner suggestion #302 (Hacker's De-lite): - 1 tin imported Brisling sardines in tomato sauce - 1 pouch Chocolate Malt Carnation Instant Breakfast - 1 carton milk -% -Dinosaurs aren't extinct. They've just learned to hide in the trees. -% -Diogenes, having abandoned his search for -truth, is now searching for a good fantasy. -% -Diogenes went to look for an honest lawyer. "How's it going?", someone -asked him, after a few days. - "Not too bad", replied Diogenes. "I still have my lantern." -% -Diplomacy is about surviving until the next century. -Politics is about surviving until Friday afternoon. - -- Sir Humphrey Appleby -% -Diplomacy is the art of letting the other party have things your way. - -- Daniele Vare -% -Diplomacy is the art of saying "nice doggie" until you can find a rock. - -- Wynn Catlin -% -Diplomacy is to do and say, the nastiest thing in the nicest way. - -- Balfour -% -Diplomacy, n.: - Lying in state. -% -Dirksen's Three Laws of Politics: - - 1: Get elected. - 2: Get re-elected. - 3: Don't get mad, get even. - -- Sen. Everett Dirksen -% -Disbar, n.: - As distinguished from some other bar. -% -Disc space -- the final frontier! -% -Disclaimer: Any resemblance between the above views and those of my -employer, my terminal, or the view out my window are purely -coincidental. Any resemblance between the above and my own views is -non-deterministic. The question of the existence of views in the -absence of anyone to hold them is left as an exercise for the reader. -The question of the existence of the reader is left as an exercise for -the second god coefficient. (A discussion of non-orthogonal, -non-integral polytheism is beyond the scope of this article.) -% -Disclaimer: "These opinions are my own, though for a small fee they be -yours too." - -- Dave Haynie -% -DISCLAIMER: -Use of this advanced computing technology does not imply -an endorsement of Western industrial civilization. -% -Disclose classified information only when a NEED TO KNOW exists. -% -Disco is to music what Etch-A-Sketch is to art. -% -Disease can be cured; fate is incurable. - -- Chinese proverb -% -Dishonor will not trouble me, once I am dead. - -- Euripides -% -Disk crisis, please clean up! -% -Disks travel in packs. -% -Disraeli was pretty close: actually, there are Lies, Damn lies, Statistics, -Benchmarks, and Delivery dates. -% -Distance doesn't make you any smaller, -but it does make you part of a larger picture. -% -Distinctive, adj.: - A different color or shape than our competitors. -% -Distress, n.: - A disease incurred by exposure to the prosperity of a friend. - -- Ambrose Bierce, "The Devil's Dictionary" -% -District of Columbia pedestrians who leap over passing autos to escape -injury, and then strike the car as they come down, are liable for any -damage inflicted on the vehicle. -% -Distrust all those who love you extremely upon a very slight -acquaintance and without any visible reason. - -- Lord Chesterfield -% -Ditat Deus. (God enriches.) -% -Divorce is a game played by lawyers. - -- Cary Grant -% -Do clones have navels? -% -Do I like getting drunk? Depends on who's doing the drinking. - -- Amy Gorin -% -Do Miami a favor. When you leave, take someone with you. -% -Do molecular biologists wear designer genes? -% -Do more than anyone expects, and pretty soon everyone will expect more. -% -Do not clog intellect's sluices with bits of knowledge of questionable uses. -% -Do not count your chickens before they are hatched. - -- Aesop -% -Do not despair of life. You have no doubt force enough to overcome -your obstacles. Think of the fox prowling through wood and field in -a winter night for something to satisfy his hunger. Notwithstanding -cold and hounds and traps, his race survives. I do not believe any -of them ever committed suicide. - -- Henry David Thoreau -% -Do not do unto others as you would they should do unto you. -Their tastes may not be the same. - -- George Bernard Shaw -% -Do not drink coffee in early A.M. It will keep you awake until noon. -% -Do not handicap your children by making their lives easy. - -- Robert A. Heinlein -% -Do not meddle in the affairs of troff, for it is subtle and quick to anger. -% -Do not meddle in the affairs of wizards, for you are crunchy and good -with ketchup. -% -Do not meddle in the affairs of wizards, -for they become soggy and hard to light. - -Do not throw cigarette butts in the urinal, -for they are subtle and quick to anger. -% -Do not overtax your powers. -% -Do not read this fortune under penalty of law. -Violators will be prosecuted. -(Penal Code sec. 2.3.2 (II.a.)) -% -Do not seek death; death will find you. -But seek the road which makes death a fulfillment. - -- Dag Hammarskjold -% -Do not sleep in a eucalyptus tree tonight. -% -Do not stoop to tie your laces in your neighbor's melon patch. -% -Do not think by infection, catching an opinion like a cold. -% -Do not try to solve all life's problems at once -- -learn to dread each day as it comes. - -- Donald Kaul -% -Do not underestimate the power of the Farce. -% -Do not use that foreign word "ideals". We have that excellent native -word "lies". - -- Henrik Ibsen, "The Wild Duck" -% -Do not use the blue keys on this terminal. -% -Do not worry about which side your -bread is buttered on: you eat BOTH sides. -% -Do nothing unless you must, and when you must act -- hesitate. -% -Do, or do not; there is no try. -% -Do people know you have freckles everywhere? -% -Do something unusual today. Pay a bill. -% -Do students of Zen Buddhism do Om-work? -% -Do unto others before they undo you. -% -Do what comes naturally now. Seethe and fume and throw a tantrum. -% -Do what thou wilt shall be the whole of the Law. - -- Aleister Crowley -% -Do what you can to prolong your life, -in the hope that someday you'll learn what it's for. -% -Do you believe in intuition? -No, but I have a strange feeling that someday I will. -% -Do you feel personally responsible for the world food shortage? -Every time you go to the beach, does the tide come in? -Have you ever eaten an entire moose? -Can you see your neck? -Do joggers take laps around you for exercise? -If so, welcome to National Fat Week. -This week we'll eat without guilt, and kick off our membership campaign, - ...by force-feeding a box of cornstarch to a skinny person. - -- Garfield -% -Do you guys know what you're doing, or are you just hacking? -% -Do you have lysdexia? -% -Do YOU have redeeming social value? -% -Do you know, I think that Dr. Swift was silly to laugh about Laputa. -I believe it is a mistake to make a mock of people, just because they -think. There are ninety thousand people in this world who do not -think, for every one who does, and these people hate the thinkers -like poison. Even if some thinkers are fanciful, it is wrong to make -fun of them for it. Better to think about cucumbers even, than not -to think at all. - -- T. H. White -% -Do you know Montana? -% -Do you know the difference between education and experience? Education -is when you read the fine print; experience is what you get when you don't. - -- Pete Seeger -% -Do you mean that you not only want a wrong -answer, but a certain wrong answer? - -- Tobaben -% -Do you realize the responsibility I carry? I'm the only person standing -between Nixon and the White House. - -- John F. Kennedy, in 1960 -% -Do you suffer painful elimination? - -- Donald E. Knuth, "Structured Programming with Gotos" - -Do you suffer painful recrimination? - -- Nancy Boxer, "Structured Programming with Come-froms" - -Do you suffer painful illumination? - -- Isaac Newton, "Optics" - -Do you suffer painful hallucination? - -- Don Juan, cited by Carlos Casteneda -% -Do you think that illiterate people get the full effect of alphabet soup? -% -Do you think that when they asked George Washington for ID that he -just whipped out a quarter? - -- Steven Wright -% -Do you think your mother and I should have lived -comfortably so long together if ever we had been married? -% -Do you want to know what's ahead for you, in your happiness at home, -your business success? Here's a telling test: Look in the mirror. Is -your skin smooth and lovely, your hair gleaming, your make-up glamorous? -Are you slender enough for your height? Do you stand erect, confident? -Yes? Then you are on your way to success as a woman. - -- Ladies' Home Journal, 1947 advertisement -% -Do your otters do the shimmy? -Do they like to shake their tails? -Do your wombats sleep in tophats? -Is your garden full of snails? -% -Do your part to help preserve life on -Earth -- by trying to preserve your own. -% -Doctors and lawyers must go to school for years and years, often with -little sleep and with great sacrifice to their first wives. - -- Roy G. Blount, Jr. -% -Documentation: - Instructions translated from Swedish by Japanese for English - speaking persons. -% -Documentation is like sex: when it is good, it is very, very good; and -when it is bad, it is better than nothing. - -- Dick Brandon -% -Documentation is the castor oil of programming. Managers know it must -be good because the programmers hate it so much. -% -Does a good farmer neglect a crop he has planted? -Does a good teacher overlook even the most humble student? -Does a good father allow a single child to starve? -Does a good programmer refuse to maintain his code? - -- Geoffrey James, "The Tao of Programming" -% -Does a one-legged duck swim in a circle? -% -Does the name Pavlov ring a bell? -% -Dogs just don't seem to be able to tell the difference between important people -and the rest of us. -% -Doin' it in the dark, down in Rock Creek Park. -% -Doing gets it done. -% -Don -Ameche: I didn't know you had a cousin Penelope, Bill! - Was she pretty? -W. C.: Well, her face was so wrinkled it looked like seven miles of - bad road. She had so many gold teeth, Don, she use to have - to sleep with her head in a safe. She died in Bolivia. -Don: Oh Bill, it must be hard to lose a relative. -W. C.: It's almost impossible. - -- W. C. Fields, "The Further Adventures of Larson E. - Whipsnade and other Tarradiddles" -% -Don't abandon hope: your Tom Mix decoder ring arrives tomorrow. -% -Don't abandon hope. -Your Captain Midnight decoder ring arrives tomorrow. -% -Don't assume that every sad-eyed woman has loved and lost -- she may -have got him. -% -Don't be concerned, it will not harm you, -It's only me pursuing something I'm not sure of, -Across my dreams, with neptive wonder, -I chase the bright elusive butterfly of love. -% -Don't be humble, you're not that great. - -- Golda Meir -% -Don't be irreplaceable, if you can't be replaced, you can't be promoted. -% -Don't be overly suspicious where it's not warranted. -% -Don't believe everything you hear or anything you say. -% -Don't buy a landslide. I don't want to have to pay for one more vote -than I have to. - -- Joseph P. Kennedy, on JFK's election strategy -% -Don't change the reason, just change the excuses! - -- Joe Cointment -% -Don't compare floating point numbers solely for equality. -% -Don't confuse things that need action -with those that take care of themselves. -% -Don't cook tonight -- starve a rat today! -% -Don't crush that dwarf, hand me the pliers! - -- The Firesign Theatre -% -Don't despair; your ideal lover is waiting for you around the corner. -% -Don't despise your poor relations, they may become suddenly rich one day. - -- Josh Billings -% -Don't do the crime, if you can't do the time. - -- Lt. Col. Ollie North -% -Don't drink when you drive -- you might hit a bump and spill it. -% -Don't drop acid -- take it pass/fail. - -- Seen in a Ladies Room at Harvard -% -Don't eat yellow snow. -% -Don't ever slam a door; you might want to go back. -% -Don't everyone thank me at once! - -- Han Solo -% -Don't expect people to keep in step-- -it's hard enough just staying in line. -% -Don't feed the bats tonight. -% -Don't force it, get a larger hammer. - -- Anthony -% -Don't get even, get odd. -% -Don't get mad, get even. - -- Joseph P. Kennedy - -Don't get even, get jewelry. - -- Anonymous -% -Don't get mad, get interest. -% -Don't get stuck in a closet -- wear yourself out. -% -Don't get suckered in by the comments -- they -can be terribly misleading. Debug only code. - -- Dave Storer -% -Don't get to bragging. -% -Don't go around saying the world owes you a living. -The world owes you nothing. It was here first. - -- Mark Twain -% -Don't go surfing in South Dakota for a while. -% -Don't go to bed with no price on your head. - -- Baretta -% -Don't guess - check your security regulations. -% -Don't hate yourself in the morning -- sleep till noon. -% -Don't have good ideas if you aren't willing to be responsible for them. -% -Don't hit a man when he's down -- kick him; it's easier. -% -Don't hit the keys so hard, it hurts. -% -Don't I know you? -% -Don't interfere with the stranger's style. -% -Don't just eat a hamburger; eat the HELL out of it. - -- J. R. "Bob" Dobbs -% -Don't kid yourself. Little is relevant, and nothing lasts forever. -% -Don't kiss an elephant on the lips today. -% -Don't knock President Fillmore. He kept us out of Vietnam. -% -Don't know what time I'll be back, Mom. -Probably soon after she throws me out. -% -Don't let go of what you've got hold of, -until you have hold of something else. - -- First Rule of Wing Walking -% -Don't let nobody tell you what you cannot do; -don't let nobody tell you what's impossible for you; -don't let nobody tell you what you got to do, -or you'll never know ... what's on the other side of the rainbow... -remember, if you don't follow your dreams, -you'll never know what's on the other side of the rainbow... - -- melba moore, "the other side of the rainbow" -% -Don't let people drive you crazy when you know it's in walking distance. -% -Don't let your status become too quo! -% -Don't look back, the lemmings might be gaining on you. -% -Don't look now, but the man in the moon is laughing at you. -% -Don't look now, but there is a multi-legged creature on your shoulder. -% -Don't lose -Your head -To gain a minute -You need your head -Your brains are in it. - -- Burma Shave -% -Don't make a big deal out of everything; just deal with everything. -% -Don't marry for money; you can borrow it cheaper. - -- Scottish proverb -% -Don't mind him; politicians always sound like that. -% -Don't patch bad code -- rewrite it. - -- Kernighan and Plauger, "The Elements of Programming Style" -% -Don't plan any hasty moves. -You'll be evicted soon anyway. -% -Don't put off for tomorrow what you can do today because -if you do it today, you can do it again tomorrow. -% -Don't put too fine a point to your wit for fear it should get blunted. - -- Miguel de Cervantes -% -Don't quit now, we might just as well -lock the door and throw away the key. -% -Don't read any sky-writing for the next two weeks. -% -Don't read everything you believe. -% -Don't relax! It's only your tension that's holding you together. -% -Don't remember what you can infer. - -- Harry Tennant -% -Don't say "yes" until I finish talking. - -- Darryl F. Zanuck -% -Don't shoot until you're sure you both aren't on the same side. -% -Don't shout for help at night. You might wake your neighbors. - -- Stanislaw J. Lec, "Unkempt Thoughts" -% -Don't smoke the next cigarette. Repeat. -% -Don't speak about Time, until you have spoken to him. -% -Don't steal... the IRS hates competition! -% -Don't steal; thou'lt never thus compete successfully in business. -Cheat. - -- Ambrose Bierce -% -Don't stop to stomp ants when the elephants are stampeding. -% -Don't suspect your friends -- turn them in! - -- "Brazil" -% -Don't sweat it -- it's only ones and zeros. - -- P. Skelly -% -Don't take a nickel, just hand them your business card. - -- Richard Daley, advising on the safe enjoyment of graft -% -Don't take life seriously, you'll never get out alive. -% -Don't take life so serious, son, it ain't nohow permanent. - -- Walt Kelly -% -Don't talk to me about naval tradition. It's nothing but rum, -sodomy and the lash. - -- Winston Churchill -% -Don't tell any big lies today. Small ones can be just as effective. -% -Don't tell me how hard you work. Tell me how much you get done. - -- James J. Ling -% -Don't tell me I'm burning the candle at both ends -- tell me where to -get more wax!! -% -Don't tell me that worry doesn't do any good. -I know better. The things I worry about don't happen. - -- Watchman Examiner -% -Don't tell me what you dream'd last night for I've been reading Freud. -% -Don't try to have the last word -- you might get it. - -- Lazarus Long -% -Don't try to outweird me, three-eyes. I get stranger things than you free -with my breakfast cereal. - -- Zaphod Beeblebrox -% -Don't vote - it only encourages them! -% -Don't wake me up too soon... -Gonna take a ride across the moon... -You and me. -% -Don't worry. Life's too long. - -- Vincent Sardi, Jr. -% -Don't worry -- the brontosaurus is slow, stupid, and placid. -% -Don't worry about avoiding temptation -- as you grow older, it starts -avoiding you. - -- The Old Farmer's Almanac -% -Don't worry about people stealing your ideas. If your ideas -are any good, you'll have to ram them down people's throats. - -- Howard Aiken -% -Don't worry about the world coming to an end today. -It's already tomorrow in Australia. - -- Charles Schultz -% -Don't Worry, Be Happy. - -- Meher Baba -% -Don't worry if you're a kleptomaniac, -you can always take something for it. -% -Don't worry over what other people are thinking about you. -They're too busy worrying over what you are thinking about them. -% -Don't worry so loud, your roommate can't think. -% -Don't you feel more like you do now than you did when you came in? -% -Don't you wish that all the people who sincerely -want to help you could agree with each other? -% -Don't you wish you had more energy... or less ambition? -% -Dorothy: How can you talk if you haven't got a brain? -Scarecrow: I don't know. But some people without brains do an - awful lot of talking, don't they? - -- Judy Garland and Ray Bolger, "The Wizard of Oz" -% -Double! -% -Double Bucky, you're the one, -You make my keyboard so much fun, -Double Bucky, an additional bit or two, (Vo-vo-de-o) -Control and meta, side by side, -Augmented ASCII, 9 bits wide! -Double Bucky, a half a thousand glyphs, plus a few! - -Oh, I sure wish that I, -Had a couple of bits more! -Perhaps a set of pedals to make the number of bits four. - -Double Double Bucky! Double Bucky left and right -OR'd together, outta sight! -Double Bucky, I'd like a whole word of, -Double Bucky, I'm happy I heard of, -Double Bucky, I'd like a whole word of you! - -- to Niklaus Wirth, who suggested that an extra bit - be added to terminal codes on 36-bit machines for use - by screen editors. [to the tune of "Rubber Ducky"] -% -Double-blind Experiment, n.: - An experiment in which the chief researcher believes he is -fooling both the subject and the lab assistant. Often accompanied -by a strong belief in the tooth fairy. -% -Doubt is a not a pleasant mental state, but certainty is a ridiculous one. - -- Voltaire -% -Doubt isn't the opposite of faith; it is an element of faith. - -- Paul Tillich, German theologian -% -Down to the Banana Republics, -Down to the tropical sun. -Go the expatriated Americans, -Hoping to find some fun. -Some of them go for the sailing, -Caught by the lure of the sea. -Trying to find what is ailing, -Living in the land of the free. -Some of them are running from lovers, -Leaving no forward address. -Some of them are running tons of ganja, -Some are running from the IRS. -Late at night you will find them, -In the cheap hotels and bars. -Hustling the senoritas, -While they dance beneath the stars. - -- Jimmy Buffet, "Banana Republics" -% -Down with the categorical imperative! -% -Dow's Law: - In a hierarchical organization, - the higher the level, the greater the confusion. -% -Dozens of bears are found dead in Alaska and Canada every summer, killed -by blood lost to the voracious mosquito. The estimated life-expectancy -of a naked man on the tundra in summer is about 15 minutes. In that -time, approximately 250,000 mosquitoes would have drawn enough blood to -kill him. - -- Gus McLeavy, "Day-by-Day Trivia Almanac" -% -Dr. Fritzkee's Lucky Astrology Diet - -The problem with the diets of today is that most women who do achieve -that magic weight, seventy-six pounds, are still fat. Dr. Fritzkee's -Lucky Astrology Diet is a sure-fire method of reducing with the added -luxury that you never feel hungry. - -Here's how the diet works: - - FOODS ALLOWED -First Month: One egg -Second Month: A raisin -Third Month: Pumpkin pie with whipped cream and chocolate sauce. - -If after the third month you haven't gotten to your dream weight, try -lopping off parts of your body until those scales tip just right for you. -% -Dr. Jekyll had something to Hyde. -% -Dr. Livingston? -Dr. Livingston I. Presume? -% -Drakenberg's Discovery: - If you can't seem to find your glasses, - it's probably because you don't have them on. -% -Drawing on my fine command of language, I said nothing. -% -Dreams are free, but there's a small charge for alterations. -% -Dreams are free, but you get soaked on the connect time. -% -Drew's Law of Highway Biology: - The first bug to hit a clean windshield - lands directly in front of your eyes. -% -Drilling for oil is boring. -% -Drink and dance and laugh and lie -Love, the reeling midnight through -For tomorrow we shall die! -(But, alas, we never do.) - -- Dorothy Parker, "The Flaw in Paganism" -% -Drink Canada Dry! You might not succeed, but it *_i_s* fun trying. -% -Drinking coffee for instant relaxation? That's like drinking alcohol for -instant motor skills. - -- Marc Price -% -Drinking is not a spectator sport. - -- Jim Brosnan -% -Drinking makes such fools of people, and people are such fools to begin -with, that it's compounding a felony. - -- Robert Benchley -% -Drinking when we are not thirsty and making love at all seasons, madam: -that is all there is to distinguish us from the other animals. - -- Pierre de Beaumarchais, "Le Marriage de Figaro" -% -Drive defensively, buy a tank. -% -Driving in Texas is simple. For the first 100 miles you swerve to -avoid jackrabbits. For the second 100 miles you hit whatever -jackrabbits get in the way. After that you chase off into the -brush after them. -% -Driving through a Swiss city one day, Alfred Hitchcock suddenly pointed out -of the car window and said, "That is the most frightening sight I have ever -seen." His companion was surprised to see nothing more alarming than a -priest in conversation with a little boy, his hand on the child's shoulder. -"Run, little boy," cried Hitchcock, leaning out of the car. "Run for your -life!" -% -Drop that pickle! -% -DROP THE DAMN BEAR!!! - -- The Adventurer -% -Drop the vase and it will become a Ming of the past. - -- The Adventurer -% -Drug, n.: - A substance that, when injected into a rat, produces a scientific - paper. -% -Drugs may be the road to nowhere, but at least they're the scenic route! -% -Drunks are rarely amusing unless they know some good songs and lose a -lot a poker. - -- Karyl Roosevelt -% -Ducharme's Axiom: - If you view your problem closely enough you will recognize - yourself as part of the problem. -% -Ducharme's Precept: - Opportunity always knocks at the least opportune moment. -% -Duckies are fun! -% -Ducks? What ducks?? -% -Duct tape is like the force. It has a light side, -and a dark side, and it holds the universe together. - -- Carl Zwanzig -% -Due to a shortage of devoted followers, the -production of great leaders has been discontinued. -% -Due to circumstances beyond your control, you are master of your -fate and captain of your soul. -% -Due to lack of disk space, this fortune database has been -discontinued. -% -Dungeons and Dragons is just a lot of Saxon Violence. -% -During almost fifteen centuries the legal establishment of Christianity has -been upon trial. What has been its fruits? More or less, in all places, -pride and indolence in the clergy; ignorance and servility in the laity,; -in both, superstition, bigotry, and persecution. - -- James Madison -% -During the next two hours, the system will be going up and down several -times, often with lin~po_~{po ~poz~ppo\~{ o n~po_~{o[po ~y oodsou>#w4k**n~po_~{ol;lkld;f;g;dd;po\~{o -% -During the Reagan-Mondale debates: - -Q: "Do you feel that a person's age affects his ability to - perform as president?" -Reagan: "I refuse to make an issue out of my opponent's youth and - inexperience." -% -During the voyage of life, remember to keep an eye out for a -fair wind; batten down during a storm; hail all passing ships; -and fly your colors proudly. -% -Dustin Farnum: Why, yesterday, I had the audience glued to their seats! -Oliver Herford: Wonderful! Wonderful! Clever of you to think of it! - -- Brian Herbert, "Classic Comebacks" -% -Duty, n.: - What one expects from others. - -- Oscar Wilde -% -Dying is a very dull, dreary affair. My advice to you is to have -nothing whatever to do with it. - -- W. Somerset Maugham, his last words -% -Dying is easy. Comedy is difficult. - -- Actor Edmond Gween, on his deathbed -% -Dying is one of the few things that can be done as easily lying down. - -- Woody Allen -% -E = MC ** 2 +- 3db -% -E Pluribus UNIX. -% -Each man is his own prisoner, in solitary confinement for life. -% -Each new user of a new system uncovers a new class of bugs. - -- Kernighan -% -Each of these cults correspond to one of the two antagonists in the age of -Reformation. In the realm of the Apple Macintosh, as in Catholic Europe, -worshipers peer devoutly into screens filled with "icons." All is sound and -imagery and Appledom. Even words look like decorative filigrees in exotic -typefaces. The greatest icon of all, the inviolable Apple itself, stands in -the dominate position at the upper-left corner of the screen. A central -corporate headquarters decrees the form of all rites and practices. -Infallible doctrine issues from one executive officer whose selection occurs -in a sealed board room. Should anyone in his curia question his powers, the -offender is excommunicated into outer darkness. The expelled heretic founds -a new company, mutters obscurely of the coming age and the next computer, -then disappears into silence, taking his stockholders with him. The mother -company forbids financial competition as sternly as it stifles ideological -competition; if you want to use computer programs that conform to Apple's -orthodoxy, you must buy a computer made and sold by Apple itself. - -- Edward Mendelson, "The New Republic", February 22, 1988 -% -Each of us bears his own Hell. - -- Publius Vergilius Maro (Virgil) -% -Each person has the right to take part in the management of public affairs -in his country, provided he has prior experience, a will to succeed, a -university degree, influential parents, good looks, a curriculum vitae, two -3 X 4 snapshots, and a good tax record. -% -Each person has the right to take the subway. -% -Eagleson's Law: - Any code of your own that you haven't looked at for six or more -months, might as well have been written by someone else. (Eagleson is -an optimist, the real number is more like three weeks.) -% -EARL GREY PROFILES - -NAME: Jean-Luc Perriwinkle Picard -OCCUPATION: Starship Big Cheese -AGE: 94 -BIRTHPLACE: Paris, Terra Sector -EYES: Grey -SKIN: Tanned -HAIR: Not much -LAST MAGAZINE READ: - Lobes 'n' Probes, the Ferengi-Betazoid Sex Quarterly -TEA: Earl Grey. Hot. - -EARL GREY NEVER VARIES. -% -Earl Wiener, 55, a University of Miami professor of management -science, telling the Airline Pilots Association (in jest) about -21st century aircraft: - - "The crew will consist of one pilot and a dog. The pilot will - nurture and feed the dog. The dog will be there to bite the - pilot if he touches anything. - -- Fortune, Sept. 26, 1988 -% -Early to bed and early to rise and you'll -be groggy when everyone else is wide awake. -% -Early to rise and early to bed makes -a man healthy and wealthy and dead. - -- James Thurber -% -Earn cash in your spare time -- blackmail your friends. -% -Earth Destroyed by Solar Flare -- film clips at eleven. -% -/earth: file system full. -% -/Earth is 98% full ... please delete anyone you can. -% -Earth is a beta site. -% -Earth is a great, big funhouse without the fun. - -- Jeff Berner -% -Easiest Color to Solve on a Rubik's Cube: - Black. Simply remove all the little colored stickers on the -cube, and each of side of the cube will now be the original color of -the plastic underneath -- black. According to the instructions, this -means the puzzle is solved. - -- Steve Rubenstein -% -Easy come and easy go, - some call me easy money, -Sometimes life is full of laughs, - and sometimes it ain't funny -You may think that I'm a fool - and sometimes that is true, -But I'm goin' to heaven in a flash of fire, - with or without you. - -- Hoyt Axton -% -Eat as much as you like -- just don't swallow it. - -- Harry Secombe's diet -% -Eat, drink, and be merry! Tomorrow you may be in Utah. -% -Eat, drink, and be merry, for tomorrow they may make it illegal. -% -Eat, drink, and be merry, for tomorrow we diet. -% -Eat, drink, and be merry, for tomorrow you may work. -% -Eat one live toad the first thing in the morning and nothing worse -will happen to you the rest of the day. - -[Well, actually, to either of you... Ed.] -% -Eat right, stay fit, and die anyway. -% -Eat the rich, the poor are tough and stringy. -% -Eating chocolate is like being in love without the aggravation. -% -Economics is extremely useful as a form of employment for economists. - -- John Kenneth Galbraith -% -Economics, n.: - Economics is the study of the value and meaning of J. K. Galbraith. - -- Mike Harding, "The Armchair Anarchist's Almanac" -% -Economies of scale: - The notion that bigger is better. In particular, that if you want - a certain amount of computer power, it is much better to buy one - biggie than a bunch of smallies. Accepted as an article of faith - by people who love big machines and all that complexity. Rejected - as an article of faith by those who love small machines and all - those limitations. -% -Economist, n.: - Someone who's good with figures, but doesn't have enough - personality to become an accountant. -% -Economists can certainly disappoint you. One said that the economy would -turn up by the last quarter. Well, I'm down to mine and it hasn't. - -- Robert Orben -% -Economists state their GNP growth projections to the nearest tenth of a -percentage point to prove they have a sense of humor. - -- Edgar R. Fiedler -% -Ed Sullivan will be around as long as someone else has talent. - -- Fred Allen -% -Editing is a rewording activity. -% -Education and religion are two things not regulated by supply and -demand. The less of either the people have, the less they want. - -- Charlotte Observer, 1897 -% -Education is an admirable thing, but it is well to remember from time to -time that nothing that is worth knowing can be taught. - -- Oscar Wilde, "The Critic as Artist" -% -Education is learning what you didn't even know you didn't know. - -- Daniel J. Boorstin -% -Education is the process of casting false pearls before real swine. - -- Irwin Edman -% -Education is what survives when what has been learnt has been forgotten. - -- B. F. Skinner -% -Educational television should be absolutely forbidden. It can only lead -to unreasonable disappointment when your child discovers that the letters -of the alphabet do not leap up out of books and dance around with -royal-blue chickens. - -- Fran Lebowitz, "Social Studies" -% -Eeny, Meeny, Jelly Beanie, the spirits are about to speak! - -- Bullwinkle J. Moose -% -Eggheads unite! You have nothing to lose but your yolks. - -- Adlai E. Stevenson -% -Eggnog is a traditional holiday drink invented by the English. Many -people wonder where the word "eggnog" comes from. The first syllable -comes from the English word "egg", meaning "egg". I don't know where -the "nog" comes from. - -To make eggnog, you'll need rum, whiskey, wine, gin and, if they are in -season, eggs... -% -Ego sum ens omnipotens -% -Egotism is the anesthetic given by a kindly nature -to relieve the pain of being a damned fool. - -- Bellamy Brooks -% -Egotism is the anesthetic which numbs the pain of stupidity. -% -Egotism, n.: - Doing the New York Times crossword puzzle with a pen. -% -Egotist, n.: - A person of low taste, more interested in himself than me. - -- Ambrose Bierce, "The Devil's Dictionary" -% -egrep -n '^[a-z].*\(' $ | sort -t':' +2.0 -% -Ehrman's Commentary: - (1) Things will get worse before they get better. - (2) Who said things would get better? -% -...eighty years later he could still recall with the young pang of his -original joy his falling in love with Ada. - -- Nabokov -% -Einstein argued that there must be simplified explanations of nature, because -God is not capricious or arbitrary. No such faith comforts the software -engineer. - -- Frederick Brooks, Jr. -% -Either I'm dead or my watch has stopped. - -- Groucho Marx' last words -% -Elbonics, v.: - The actions of two people maneuvering for one - armrest in a movie theatre. - -- Rich Hall & Friends, "Sniglets" -% -Eleanor Rigby -Sits at the keyboard and waits for a line on the screen -Lives in a dream -Waits for a signal, finding some code that will - make the machine do some more. -What is it for? - -All the lonely users, where do they all come from? -All the lonely users, why does it take so long? - -Hacker MacKensie -Writing the code for a program that no one will run -It's nearly done -Look at him working, fixing the bugs in the night when there's - nobody there. -What does he care? - -All the lonely users, where do they all come from? -All the lonely users, why does it take so long? -Ah, look at all the lonely users. -Ah, look at all the lonely users. -% -ELECTRIC JELL-O - -2 boxes JELL-O brand gelatin 2 packages Knox brand unflavored gelatin -2 cups fruit (any variety) 2+ cups water -1/2 bottle Everclear brand grain alcohol - -Mix JELL-O and Knox gelatin into 2 cups of boiling water. Stir 'til - fully dissolved. -Pour hot mixture into a flat pan. (JELL-O molds won't work.) -Stir in grain alcohol instead of usual cold water. Remove any congealing - glops of slime. (Alcohol has an unusual effect on excess JELL-O.) -Pour in fruit to desired taste, and to absorb any excess alcohol. -Mix in some cold water to dilute the alcohol and make it easier to eat for - the faint of heart. -Refrigerate overnight to allow mixture to fully harden. (About 8-12 hours.) -Cut into squares and enjoy! - -WARNING: - Keep ingredients away from open flame. Not recommended for - children under eight years of age. -% -Electrical Engineers do it with less resistance. -% -Electrocution, n.: - Burning at the stake with all the modern improvements. -% -Elegance and truth are inversely related. - -- Becker's Razor -% -Elephant, n.: - A mouse built to government specifications. -% -Elevators smell different to midgets. -% -Eleventh Law of Acoustics: - In a minimum-phase system there is an inextricable link between - frequency response, phase response and transient response, as they - are all merely transforms of one another. This combined with - minimalization of open-loop errors in output amplifiers and correct - compensation for non-linear passive crossover network loading can - lead to a significant decrease in system resolution lost. However, - of course, this all means jack when you listen to Pink Floyd. -% -Eli and Bessie went to sleep. -In the middle of the night, Bessie nudged Eli. - "Please be so kindly and close the window. It's cold outside!" -Half asleep, Eli murmured, - "Nu ... so if I'll close the window, will it be warm outside?" -% -Elliptic paraboloids for sale. -% -Elliptical, n.: - The feel of a kiss. -% -Eloquence is logic on fire. -% -Elwood: What kind of music do you get here ma'am? -Barmaid: Why, we get both kinds of music, Country and Western. -% -Emacs, n.: - A slow-moving parody of a text editor. -% -Emerson's Law of Contrariness: - Our chief want in life is somebody who shall make us do - what we can. Having found them, we shall then hate them - for it. -% -Encyclopedia for sale by father. -Son knows everything. -% -Encyclopedia Salesmen: - Invite them all in. Nip out the back door. Phone the police - and tell them your house is being burgled. - -- Mike Harding, "The Armchair Anarchist's Almanac" -% -Endless Loop: n. see Loop, Endless. -Loop, Endless: n. see Endless Loop. - -- Random Shack Data Processing Dictionary -% -Endless the world's turn, endless the sun's spinning -Endless the quest; -I turn again, back to my own beginning, -And here, find rest. -% -Enemy -- SP (Suppressive Person) Order. Fair Game. May be deprived of -property or injured by any means by any Scientologist without any discipline -of the Scientologist. May be tricked, sued or lied to or destroyed. - -- L. Ron Hubbard, "Fair Game Doctrine" -% -Engineering: "How will this work?" -Science: "Why will this work?" -Management: "When will this work?" -Liberal Arts: "Do you want fries with that?" -% -English literature's performing flea. - -- Sean O'Casey on P. G. Wodehouse -% -Engram, n.: - 1. The physical manifestation of human memory -- "the engram." -2. A particular memory in physical form. [Usage note: this term is no longer -in common use. Prior to Wilson and Magruder's historic discovery, the nature -of the engram was a topic of intense speculation among neuroscientists, -psychologists, and even computer scientists. In 1994 Professors M. R. Wilson -and W. V. Magruder, both of Mount St. Coax University in Palo Alto, proved -conclusively that the mammalian brain is hardwired to interpret a set of -thirty seven genetically transmitted cooperating TECO macros. Human memory -was shown to reside in 1 million Q-registers as Huffman coded uppercase-only -ASCII strings. Interest in the engram has declined substantially since that -time.] - -- New Century Unabridged English Dictionary, - 3rd edition, 2007 A.D. -% -Enhance, v.: - To tamper with an image, usually to its detriment. -% -Enjoy your life; be pleasant and gay, like the birds in May. -% -Enjoy yourself while you're still old. -% -Entrepreneur, n.: - A high-rolling risk taker who would rather - be a spectacular failure than a dismal success. -% -Entropy isn't what it used to be. -% -Entropy requires no maintenance. - -- Markoff Chaney -% -Envy is a pain of mind that successful men cause their neighbors. - -- Onasander -% -Envy, n.: - Wishing you'd been born with an unfair advantage, - instead of having to try and acquire one. -% -Enzymes are things invented by biologists -that explain things which otherwise require harder thinking. - -- Jerome Lettvin -% -Epperson's law: - When a man says it's a silly, childish game, it's probably - something his wife can beat him at. -% -Equal bytes for women. -% -Ere the cock crows thrice one of you will betray me. - -- Early Jewish Resistance Leader -% -Ernest asks Frank how long he has been working for the company. - "Ever since they threatened to fire me." -% -Error in operator: add beer -% -Es brilig war. Die schlichte Toven - Wirrten und wimmelten in Waben; -Und aller-m"umsige Burggoven - Dir mohmen R"ath ausgraben. - -- Lewis Carroll, - "Through the Looking-Glass, - and What Alice Found There" (1871) -% -Eschew obfuscation. -% -Established technology tends to persist in the face of new technology. - -- G. Blaauw, one of the designers of System 360 -% -E.T. GO HOME!!! (And take your Smurfs with you.) -% -Eternal nothingness is fine if you happen to be dressed for it. - -- Woody Allen -% -Eternity is a terrible thought. I mean, where's it going to end? - -- Tom Stoppard -% -Etiquette is for those with no breeding; -fashion for those with no taste. -% -Etymology, n.: - Some early etymological scholars came up with derivations that - were hard for the public to believe. The term 'etymology' was - formed from the Latin 'etus' ("eaten"), the root 'mal' ("bad"), - and 'logy' ("study of"). It meant "the study of things that are - hard to swallow." - -- Mike Kellen -% -Euch ist bekannt, was wir beduerfen; -Wir wollen stark Getraenke schluerfen. - -- Johann Wolfgang von Goethe, "Faust" -% -Eudaemonic research proceeded with the casual mania peculiar to this part of -the world. Nude sunbathing on the back deck was combined with phone calls to -Advanced Kinetics in Costa Mesa, American Laser Systems in Goleta, Automation -Industries in Danbury, Connecticut, Arenberg Ultrasonics in Jamaica Plain, -Massachusetts, and Hewlett Packard in Sunnyvale, California, where Norman -Packard's cousin, David, presided as chairman of the board. The trick was to -make these calls at noon, in the hope that out-to-lunch executives would return -them at their own expense. Eudaemonic Enterprises, for all they knew, might be -a fast-growing computer company branching out of the Silicon Valley. Sniffing -the possibility of high-volume sales, these executives little suspected that -they were talking on the other end of the line to a naked physicist crazed -over roulette. - -- Thomas Bass, "The Eudaemonic Pie" -% -Eureka! - -- Archimedes -% -Even a blind pig stumbles upon a few acorns. -% -Even a cabbage may look at a king. -% -Even a hawk is an eagle among crows. -% -Even a man who is pure at heart, -And says his prayers at night -Can become a wolf when the wolfbane blooms, -And the moon is full and bright. - -- The Wolf Man, 1941 -% -Even God cannot change the past. - -- Joseph Stalin -% -Even God lends a hand to honest boldness. - -- Menander -% -Even if you do learn to speak correct -English, whom are you going to speak it to? - -- Clarence Darrow -% -Even if you persuade me, you won't persuade me. - -- Aristophanes -% -Even if you're on the right track, you'll get run over if you just sit there. - -- Will Rogers -% -Even in the moment of our earliest kiss, -When sighed the straitened bud into the flower, -Sat the dry seed of most unwelcome this; -And that I knew, though not the day and hour. -Too season-wise am I, being country-bred, -To tilt at autumn or defy the frost: -Snuffing the chill even as my fathers did, -I say with them, "What's out tonight is lost." -I only hoped, with the mild hope of all -Who watch the leaf take shape upon the tree, -A fairer summer and a later fall -Than in these parts a man is apt to see, -And sunny clusters ripened for the wine: -I tell you this across the blackened vine. - -- Edna St. Vincent Millay, "Even in the Moment of - Our Earliest Kiss", 1931 -% -Even moderation ought not to be practiced to excess. -% -Even the best of friends cannot attend each other's funeral. - -- Kehlog Albran, "The Profit" -% -Even though they raised the rate for first class mail in the United -States we really shouldn't complain -- it's still only two cents a -day. -% -Events are not affected, they develop. - -- Sri Aurobindo -% -Ever feel like life was a game and you had the wrong instruction book? -% -Ever feel like you're the head pin on life's -bowling alley, and everyone's rolling strikes? -% -Ever get the feeling that the world's -on tape and one of the reels is missing? - -- Rich Little -% -Ever notice that even the busiest people are -never too busy to tell you just how busy they are? -% -Ever notice that the word "therapist" breaks down into "the rapist"? -Simple coincidence? -Maybe... -% -Ever Onward! Ever Onward! -That's the sprit that has brought us fame. -We're big but bigger we will be, -We can't fail for all can see, that to serve humanity -Has been our aim. -Our products now are known in every zone. -Our reputation sparkles like a gem. -We've fought our way thru -And new fields we're sure to conquer, too -For the Ever Onward IBM! - -- Ever Onward, from the 1940 IBM Songbook -% -Ever Onward! Ever Onward! -We're bound for the top to never fall, -Right here and now we thankfully -Pledge sincerest loyalty -To the corporation that's the best of all -Our leaders we revere and while we're here, -Let's show the world just what we think of them! -So let us sing men -- Sing men -Once or twice, then sing again -For the Ever Onward IBM! - -- Ever Onward, from the 1940 IBM Songbook -% -Ever since I was a young boy, -I've hacked the ARPA net, -From Berkeley down to Rutgers, He's on my favorite terminal, -Any access I could get, He cats C right into foo, -But ain't seen nothing like him, His disciples lead him in, -On any campus yet, And he just breaks the root, -That deaf, dumb, and blind kid, Always has full SYS-PRIV's, -Sure sends a mean packet. Never uses lint, - That deaf, dumb, and blind kid, - Sure sends a mean packet. -He's a UNIX wizard, -There has to be a twist. -The UNIX wizard's got Ain't got no distractions, -Unlimited space on disk. Can't hear no whistles or bells, -How do you think he does it? Can't see no message flashing, -I don't know. Types by sense of smell, -What makes him so good? Those crazy little programs, - The proper bit flags set, - That deaf, dumb, and blind kid, - Sure sends a mean packet. - -- UNIX Wizard -% -Ever since prehistoric times, wise men have tried to understand what, -exactly, make people laugh. That's why they were called "wise men." -All the other prehistoric people were out puncturing each other with -spears, and the wise men were back in the cave saying: "How about: -Would you please take my wife? No. How about: Here is my wife, please -take her right now. No. How about: Would you like to take something? -My wife is available. No. How about ..." - -- Dave Barry, "Why Humor is Funny" -% -Ever wonder if taxation without representation might have been cheaper? -% -Ever wonder why fire engines are red? - -Because newspapers are read too. -Two and Two is four. -Four and four is eight. -Eight and four is twelve. -There are twelve inches in a ruler. -Queen Mary was a ruler. -Queen Mary was a ship. -Ships sail the sea. -There are fishes in the sea. -Fishes have fins. -The Fins fought the Russians. -Russians are red. -Fire engines are always rush'n. -Therefore fire engines are red. -% -Ever wondered about the origins of the term "bugs" as applied to computer -technology? U.S. Navy Capt. Grace Murray Hopper has firsthand explanation. -The 74-year-old captain, who is still on active duty, was a pioneer in -computer technology during World War II. At the C. W. Post Center of Long -Island University, Hopper told a group of Long Island public school adminis- -trators that the first computer "bug" was a real bug--a moth. At Harvard -one August night in 1945, Hopper and her associates were working on the -"granddaddy" of modern computers, the Mark I. "Things were going badly; -there was something wrong in one of the circuits of the long glass-enclosed -computer," she said. "Finally, someone located the trouble spot and, using -ordinary tweezers, removed the problem, a two-inch moth. From then on, when -anything went wrong with a computer, we said it had bugs in it." Hopper -said that when the veracity of her story was questioned recently, "I referred -them to my 1945 log book, now in the collection of the Naval Surface Weapons -Center, and they found the remains of that moth taped to the page in -question." - [actually, the term "bug" had even earlier usage in - regard to problems with radio hardware. Ed.] -% -Everlasting peace will come to the world when the last man has slain -the last but one. - -- Adolf Hitler -% -Every absurdity has a champion who will defend it. -% -Every cloud engenders not a storm. - -- William Shakespeare, "Henry VI" -% -Every cloud has a silver lining; -you should have sold it, and bought titanium. -% -Every country has the government it deserves. - -- Joseph De Maistre -% -Every creature has within him the wild, uncontrollable urge to punt. -% -Every day it's the same thing -- variety. I want something different. -% -Every day people are straying away from the church and going back to God. - -- Lenny Bruce -% -Every dog has its day, but the nights belong to the pussycats. -% -Every four seconds a woman has a baby. Our problem is to find this -woman and stop her. -% -Every group has a couple of experts. And every group has at least one -idiot. Thus are balance and harmony (and discord) maintained. It's -sometimes hard to remember this in the bulk of the flamewars that all -of the hassle and pain is generally caused by one or two -highly-motivated, caustic twits. - -- Chuq Von Rospach, about Usenet -% -Every gun that is made, every warship launched, every rocket fired -signifies in the final sense, a theft from those who hunger and are not -fed, those who are cold and are not clothed. This world in arms is not -spending money alone. It is spending the sweat of its laborers, the -genius of its scientists, the hopes of its children. This is not a way -of life at all in any true sense. Under the clouds of war, it is -humanity hanging on a cross of iron. - -- Dwight D. Eisenhower, April 16, 1953 -% -Every Horse has an Infinite Number of Legs (proof by intimidation): - -Horses have an even number of legs. Behind they have two legs, and in -front they have fore-legs. This makes six legs, which is certainly an -odd number of legs for a horse. But the only number that is both even -and odd is infinity. Therefore, horses have an infinite number of -legs. Now to show this for the general case, suppose that somewhere, -there is a horse that has a finite number of legs. But that is a horse -of another color, and by the [above] lemma ["All horses are the same -color"], that does not exist. -% -Every improvement in communication makes the bore more terrible. - -- Frank Moore Colby -% -Every journalist has a novel in him, which is an excellent place for it. -% -Every little picofarad has a nanohenry all its own. - -- Don Vonada -% -Every love's the love before -In a duller dress. - -- Dorothy Parker, "Summary" -% -Every man has his price. Mine is $3.95. -% -Every man is apt to form his notions of things difficult to be apprehended, -or less familiar, from their analogy to things which are more familiar. -Thus, if a man bred to the seafaring life, and accustomed to think and talk -only of matters relating to navigation, enters into discourse upon any other -subject; it is well known, that the language and the notions proper to his -own profession are infused into every subject, and all things are measured -by the rules of navigation: and if he should take it into his head to -philosophize concerning the faculties of the mind, it cannot be doubted, -but he would draw his notions from the fabric of the ship, and would find -in the mind, sails, masts, rudder, and compass. - -- Thomas Reid, "An Inquiry into the Human Mind", 1764 -% -Every man is as God made him, ay, and often worse. - -- Miguel de Cervantes -% -Every man takes the limits of his own field -of vision for the limits of the world. - -- Schopenhauer -% -Every man thinks God is on his side. The rich -and powerful know that he is. - -- Jean Anouilh, "The Lark" -% -Every man who has reached even his intellectual teens begins to suspect -that life is no farce; that it is not genteel comedy even; that it flowers -and fructifies on the contrary out of the profoundest tragic depths of the -essential death in which its subject's roots are plunged. The natural -inheritance of everyone who is capable of spiritual life is an unsubdued -forest where the wolf howls and the obscene bird of night chatters. - -- Henry James Sr., writing to his sons Henry and William -% -Every man who is high up likes to think that he has done -it all himself, and the wife smiles and lets it go at that. - -- Barrie -% -Every morning, I get up and look through the "Forbes" list of the -richest people in America. If I'm not there, I go to work. - -- Robert Orben -% -Every morning in Africa, a gazelle wakes up. It knows it must run faster -than the fastest lion or it will be killed. Every morning a lion wakes up. -It knows it must outrun the slowest gazelle or it will starve to death. -It doesn't matter whether you are a lion or a gazelle: when the sun comes -up, you'd better be running. -% -Every morning is a Smirnoff morning. -% -Every night my prayers I say, - And get my dinner every day; -And every day that I've been good, - I get an orange after food. -The child that is not clean and neat, - With lots of toys and things to eat, -He is a naughty child, I'm sure-- - Or else his dear papa is poor. - -- Robert Louis Stevenson -% -Every nonzero finite dimensional inner product space has an orthonormal basis. - -It makes sense, when you don't think about it. -% -Every now and then when your life gets complicated and the weasels -start closing in, the only cure is to load up on heinous chemicals and -then drive like a bastard from Hollywood to Las Vegas ... with the -music at top volume and at least a pint of ether. - -- Hunter S. Thompson, "Fear and Loathing in Las Vegas" -% -Every one says that politicians lie all the time, and that just isn't so! -But you do have to understand body language to know when they're lying and -when they aren't. - - When a politician rubs his nose, he isn't lying. - When a politician tugs on his ear, he isn't lying. - When a politician scratches his collar bone, he isn't lying. - When his mouth starts moving, that's when he's lying! -% -Every paper published in a respectable journal should have a preface by -the author stating why he is publishing the article, and what value he -sees in it. I have no hope that this practice will ever be adopted. - -- Morris Kline -% -Every path has its puddle. -% -Every person, all the events in your life are there because you have -drawn them there. What you choose to do with them is up to you. - -- Messiah's Handbook: Reminders for the Advanced Soul -% -Every program has at least one bug and can be shortened by at least one -instruction -- from which, by induction, one can deduce that every program -can be reduced to one instruction which doesn't work. -% -Every program has (at least) two purposes: - the one for which it was written and another for which it wasn't. -% -Every program is a part of some other program, and rarely fits. -% -Every silver lining has a cloud around it. -% -Every Solidarity center had piles and piles of paper ... everyone was -eating paper and a policeman was at the door. Now all you have to do is -bend a disk. - -- A member of the outlawed Polish trade union, Solidarity, - commenting on the benefits of using computers in support - of their movement. -% -Every solution breeds new problems. -% -Every successful person has had failures -but repeated failure is no guarantee of eventual success. -% -Every suicide is a solution to a problem. - -- Jean Baechler -% -Every time I look at you I am more convinced of Darwin's theory. -% -Every time I lose weight, it finds me again! -% -Every time I think I know where it's at, they move it. -% -Every time you manage to close the door on -Reality, it comes in through the window. -% -Every why hath a wherefore. - -- William Shakespeare, "A Comedy of Errors" -% -Every word is like an unnecessary stain on silence and nothingness. - -- Beckett -% -Every young man should have a hobby: learning how to handle money is -the best one. - -- Jack Hurley -% -Everybody but Sam had signed up for a new company pension plan that -called for a small employee contribution. The company was paying all -the rest. Unfortunately, 100% employee participation was needed; -otherwise the plan was off. Sam's boss and his fellow workers pleaded -and cajoled, but to no avail. Sam said the plan would never pay off. -Finally the company president called Sam into his office. - "Sam," he said, "here's a copy of the new pension plan and here's -a pen. I want you to sign the papers. I'm sorry, but if you don't sign, -you're fired. As of right now." - Sam signed the papers immediately. - "Now," said the president, "would you mind telling me why you -couldn't have signed earlier?" - "Well, sir," replied Sam, "nobody explained it to me quite so -clearly before." -% -Everybody has something to conceal. - -- Humphrey Bogart -% -Everybody is given the same amount of hormones, at birth, and -if you want to use yours for growing hair, that's fine with me. -% -Everybody is somebody else's weirdo. - -- Edsger W. Dijkstra -% -Everybody knows that the dice are loaded. Everybody rolls with their -fingers crossed. Everybody knows the war is over. Everybody knows the -good guys lost. Everybody knows the fight was fixed: the poor stay -poor, the rich get rich. That's how it goes. Everybody knows. - -Everybody knows that the boat is leaking. Everybody knows the captain -lied. Everybody got this broken feeling like their father or their dog -just died. - -Everybody talking to their pockets. Everybody wants a box of chocolates -and long stem rose. Everybody knows. - -Everybody knows that you love me, baby. Everybody knows that you really -do. Everybody knows that you've been faithful, give or take a night or -two. Everybody knows you've been discreet, but there were so many people -you just had to meet without your clothes. And everybody knows. - -And everybody knows it's now or never. Everybody knows that it's me or you. -And everybody knows that you live forever when you've done a line or two. -Everybody knows the deal is rotten: Old Black Joe's still pickin' cotton -for you ribbons and bows. And everybody knows. - -- Leonard Cohen, "Everybody Knows" -% -Everybody likes a kidder, but nobody lends him money. - -- Arthur Miller -% -Everybody needs a little love sometime; -stop hacking and fall in love! -% -Everybody wants to go to heaven, but nobody wants to die. -% -Everyone can be taught to sculpt: Michelangelo would have had -to be taught how not to. So it is with the great programmers. -% -Everyone complains of his memory, no one of his judgment. -% -Everyone hates me because I'm paranoid. -% -Everyone is a genius. It's just that some people are too stupid to -realize it. -% -Everyone is entitled to my opinion. -% -Everyone is in the best seat. - -- John Cage -% -Everyone is more or less mad on one point. - -- Rudyard Kipling -% -Everyone knows that dragons don't exist. But while this simplistic -formulation may satisfy the layman, it does not suffice for the -scientific mind. The School of Higher Neantical Nillity is in fact -wholly unconcerned with what _d_o_e_s exist. Indeed, the banality of -existence has been so amply demonstrated, there is no need for us to -discuss it any further here. The brilliant Cerebron, attacking the -problem analytically, discovered three distinct kinds of dragon: the -mythical, the chimerical, and the purely hypothetical. They were all, -one might say, nonexistent, but each nonexisted in an entirely -different way ... - -- Stanislaw Lem, "Cyberiad" -% -Everyone talks about apathy, but no one _d_o_e_s anything about it. -% -Everyone wants results, but no one is willing to do what it takes -to get them. - -- Dirty Harry -% -Everyone was born right-handed. -Only the greatest overcome it. -% -Everyone who comes in here wants three things: - 1. They want it quick. - 2. They want it good. - 3. They want it cheap. -I tell 'em to pick two and call me back. - -- sign on the back wall of a small printing company -% -Everyone's in a high place when you're on your knees. -% -Everything bows to success, even grammar. -% -Everything can be filed under "miscellaneous". -% -Everything ends badly. Otherwise it wouldn't end. -% -Everything I like is either illegal, immoral or fattening. - -- Alexander Woollcott -% -Everything in this book may be wrong. - -- Messiah's Handbook: Reminders for the Advanced Soul -% -Everything is controlled by a small evil group -to which, unfortunately, no one we know belongs. -% -Everything is possible. Pass the word. - -- Rita Mae Brown, "Six of One" -% -Everything is worth precisely as much as a belch, the difference being -that a belch is more satisfying. - -- Ingmar Bergman -% -Everything journalists write is true, except when they write about -something you know. - -- Dag-Erling Smorgrav, - June 1999, FreeBSD-Stable Mailing List -% -Everything might be different in the present -if only one thing had been different in the past. -% -Everything new stalls because there is precedence for the old. - -- Poul Henningsen (1894-1967) -% -Everything should be built top-down, except the first time. -% -Everything should be made as simple as possible, but not simpler. - -- Albert Einstein -% -Everything takes longer, costs more, and is less useful. - -- Erwin Tomash -% -Everything that can be invented has been invented. - -- Charles Duell, Director of U.S. Patent Office, 1899 -% -Everything that you know is wrong, but you can be straightened out. -% -Everything will be just tickety-boo today. -% -Everything you know is wrong! -% -Everything you read in newspapers is absolutely true, except for that -rare story of which you happen to have first-hand knowledge. - -- Erwin Knoll -% -Everything you've learned in school as "obvious" becomes less and less -obvious as you begin to study the universe. For example, there are no -solids in the universe. There's not even a suggestion of a solid. -There are no absolute continuums. There are no surfaces. There are no -straight lines. - -- R. Buckminster Fuller -% -Everything's great in this good old world; -(This is the stuff they can always use.) -God's in his heaven, the hill's dew-pearled; -(This will provide for baby's shoes.) -Hunger and War do not mean a thing; -Everything's rosy where'er we roam; -Hark, how the little birds gaily sing! -(This is what fetches the bacon home.) - -- Dorothy Parker, "The Far Sighted Muse" -% -Everywhere I go I'm asked if I think the university stifles writers. My -opinion is that they don't stifle enough of them. There's many a bestseller -that could have been prevented by a good teacher. - -- Flannery O'Connor -% -Everywhere you go you'll see them searching, -Everywhere you turn you'll feel the pain, -Everyone is looking for the answer, -Well look again. - -- Moody Blues, "Lost in a Lost World" -% -Evil is that which one believes of others. It is a sin to believe evil -of others, but it is seldom a mistake. - -- H. L. Mencken -% -Evolution is a million line computer -program falling into place by accident. -% -Evolution is as much a fact as the earth turning on its axis and going around -the sun. At one time this was called the Copernican theory; but, when -evidence for a theory becomes so overwhelming that no informed person can -doubt it, it is customary for scientists to call it a fact. That all present -life descended from earlier forms, over vast stretches of geologic time, is -as firmly established as Copernican cosmology. Biologists differ only with -respect to theories about how the process operates. - -- Martin Gardner, "Irving Kristol and the Facts of Life" -% -Examinations are formidable even to the best prepared, for -even the greatest fool may ask more than the wisest man can answer. - -- C. C. Colton -% -Example is not the main thing in influencing others. -It is the only thing. - -- Albert Schweitzer -% -Excellent day for drinking heavily. -Spike the office water cooler. -% -Excellent day for putting Slinkies on an escalator. -% -Excellent day to have a rotten day. -% -Excellent time to become a missing person. -% -Exceptions prove the rule, and wreck the budget. - -- Miller -% -Excerpt from a conversation between a customer support person and a -customer working for a well-known military-affiliated research lab: - -Support: "You're not our only customer, you know." -Customer: "But we're one of the few with tactical nuclear weapons." -% -Excerpt from a DEC field service document: - -.... -- none of these should have made it to customers. BUT you could loosen the -screws and lift system board at fan end while powering on to see if OCP -comes up - this is not recommended unless you have three hands. -% -Excess on occasion is exhilarating. It prevents moderation from -acquiring the deadening effect of a habit. - -- W. Somerset Maugham -% -Excessive login messages are a sure sign of senility. -% -Excessive login or logout messages are a sure sign of senility. -% -Execute every act of thy life as though it were thy last. - -- Marcus Aurelius -% -Executive ability is deciding quickly and getting somebody else to do -the work. - -- John G. Pollard -% -Executive ability is prominent in your make-up. -% -Exercise caution in your daily affairs. -% -Exhilaration is that feeling you get just after a great idea hits you, -and just before you realize what is wrong with it. -% -Expansion means complexity; and complexity decay. -% -Expect a letter from a friend who will ask a favor of you. -% -Expect the worst, it's the least you can do. -% -Expedience is the best teacher. -% -Expense accounts, n.: - Corporate food stamps. -% -Experience is a good teacher, but she sends in terrific bills. - -- Minna Antrim, "Naked Truth and Veiled Allusions" -% -Experience is not what happens to you; -it is what you do with what happens to you. - -- Aldous Huxley -% -Experience is that marvelous thing that enables -you recognize a mistake when you make it again. - -- Franklin Jones -% -Experience is the worst teacher. It always -gives the test first and the instruction afterward. -% -Experience is what causes a person -to make new mistakes instead of old ones. -% -Experience is what you get when you didn't get what you wanted. -% -Experience teaches you that the man who looks you straight in the eye, -particularly if he adds a firm handshake, is hiding something. - -- Clifton Fadiman, "Enter Conversing" -% -Experiments must be reproducible; they should all fail in the same way. -% -Expert, n.: - Someone who comes from out of town and shows slides. -% -External Security: -% -Extract from Official Sweepstakes Rules: - - NO PURCHASE REQUIRED TO CLAIM YOUR PRIZE - -To claim your prize without purchase, do the following: (a) Carefully -cut out your computer-printed name and address from upper right hand -corner of the Prize Claim Form. (b) Affix computer-printed name and -address -- with glue or cellophane tape (no staples or paper clips) -- -to a 3x5 inch index card. (c) Also cut out the "No" paragraph (lower -left hand corner of Prize Claim Form) and affix it to the 3x5 card -below your address label. (d) Then print on your 3x5 card, above your -computer-printed name and address the words "CARTER & VAN PEEL -SWEEPSTAKES" (Use all capital letters.) (e) Finally place 3x5 card -(without bending) into a plain envelope [NOTE: do NOT use the -Official Prize Claim and CVP Perfume Reply Envelope or you may be -disqualified], and mail to: CVP, Box 1320, Westbury, NY 11595. Print -this address correctly. Comply with above instructions carefully and -completely or you may be disqualified from receiving your prize. -% -Extraordinary claims demand extraordinary proof. There are many examples -of outsiders who eventually overthrew entrenched scientific orthodoxies, -but they prevailed with irrefutable data. More often, egregious findings -that contradict well-established research turn out to be artifacts. I have -argued that accepting psychic powers, reincarnation, "cosmic consciousness," -and the like, would entail fundamental revisions of the foundations of -neuroscience. Before abandoning materialist theories of mind that have paid -handsome dividends, we should insist on better evidence for psi phenomena -than presently exists, especially when neurology and psychology themselves -offer more plausible alternatives. - -- Barry L. Beyerstein, "The Brain and Consciousness: - Implications for Psi Phenomena". -% -Extreme fear can neither fight nor fly. - -- William Shakespeare, "The Rape of Lucrece" -% -Extremism in the defense of liberty is no vice... moderation in the pursuit -of justice is no virtue. - -- Barry Goldwater -% -F: When into a room I plunge, I - Sometimes find some VIOLET FUNGI. - Then I linger, darkly brooding - On the poison they're exuding. - -- The Roguelet's ABC -% -F. Scott Fitzgerald to Hemingway: - "Ernest, the rich are different from us." -Hemingway: - "Yes. They have more money." -% -f u cn rd ths, itn tyg h myxbl cd. -% -f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng. -% -f u cn rd ths, u r prbbly a lsy spllr. -% -FACILITY REJECTED 100044200000; -% -Factorials were someone's attempt to make math LOOK exciting. -% -Facts, apart from their relationships, are like labels on empty bottles. - -- Sven Italla -% -Facts are stubborn, but statistics are more pliable. -% -Facts are the enemy of truth. - -- Don Quixote -% -Facts do not cease to exist because they are ignored. - -- Aldous Huxley -% -Failed Attempts To Break Records - In September 1978 Mr. Terry Gripton, of Stafford, failed to break -the world shouting record by two and a half decibels. "I am not surprised -he failed," his wife said afterwards. "He's really a very quiet man and -doesn't even shout at me." - In August of the same year Mr. Paul Anthony failed to break the -record for continuous organ playing by 387 hours. - His attempt at the Golden Fish Fry Restaurant in Manchester ended -after 36 hours 10 minutes, when he was accused of disturbing the peace. -"People complained I was too noisy," he said. - In January 1976 Mr. Barry McQueen failed to walk backwards across -the Menai Bridge playing the bagpipes. "It was raining heavily and my -drone got waterlogged," he said. - A TV cameraman thwarted Mr. Bob Specas' attempt to topple 100,000 -dominoes at the Manhattan Center, New York on 9 June 1978. 97,500 dominoes -had been set up when he dropped his press badge and set them off. - -- Stephen Pile, "The Book of Heroic Failures" -% -Failure is more frequently from want of energy than want of capital. -% -Fain would I climb, yet fear I to fall. - -- Sir Walter Raleigh -% -Fairy Tale, n.: - A horror story to prepare children for the newspapers. -% -Faith goes out through the window when beauty comes in at the door. -% -Faith has never moved as much as a pin-head from the place it -ought to be according to tradition and the scriptures. It is -the doubt that moved all the mountains. - -- Poul Henningsen (1894-1967) -% -Faith is the quality that enables you to eat blackberry jam -on a picnic without looking to see whether the seeds move. -% -Faith is under the left nipple. - -- Martin Luther -% -Faith, n.: - That quality which enables us to - believe what we know to be untrue. -% -Fakir, n.: - A psychologist whose charismatic data have inspired almost - religious devotion in his followers, even though the sources - seem to have shinnied up a rope and vanished. -% -Falling in Love - When two people have been on enough dates, they generally fall in -love. You can tell you're in love by the way you feel: your head becomes -light, your heart leaps within you, you feel like you're walking on air, -and the whole world seems like a wonderful and happy place. Unfortunately, -these are also the four warning signs of colon disease, so it's always a -good idea to check with your doctor. - -- Dave Barry -% -Falling in love is a lot like dying. -You never get to do it enough to become good at it. -% -Falling in love makes smoking pot all day look like the ultimate in -restraint. - -- Dave Sim, author of "Cerebus" -% -Fame is a vapor; popularity an accident; -the only earthly certainty is oblivion. - -- Mark Twain -% -Fame lost its appeal for me when I went into a public restroom and an -autograph seeker handed me a pen and paper under the stall door. - -- Marlo Thomas -% -Fame may be fleeting but obscurity is forever. -% -Familiarity breeds attempt. -% -Familiarity breeds contempt -- and children. - -- Mark Twain -% -Families, when a child is born -Want it to be intelligent. -I, through intelligence, -Having wrecked my whole life, -Only hope the baby will prove -Ignorant and stupid. -Then he will crown a tranquil life -By becoming a Cabinet Minister - -- Su Tung-p'o -% -Famous, adj.: - Conspicuously miserable. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Famous last words: -% -Famous last words: - 1: Don't unplug it, it will just take a moment to fix. - 2: Let's take the shortcut, he can't see us from there. - 3: What happens if you touch these two wires tog... - 4: We won't need reservations. - 5: It's always sunny there this time of the year. - 6: Don't worry, it's not loaded. - 7: They'd never (be stupid enough to) make him a manager. - 8: Don't worry! Women love it! -% -Fanaticism consists of redoubling your effort when you have -forgotten your aim. - -- George Santayana -% -Far back in the mists of ancient time, in the great and glorious days of the -former Galactic Empire, life was wild, rich and largely tax free. - -Mighty starships plied their way between exotic suns, seeking adventure and -reward among the furthest reaches of Galactic space. In those days, spirits -were brave, the stakes were high, men were real men, women were real women -and small furry creatures from Alpha Centauri were real small furry creatures -from Alpha Centauri. And all dared to brave unknown terrors, to do mighty -deeds, to boldly split infinitives that no man had split before -- and thus -was the Empire forged. - -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -Far duller than a serpent's tooth it is to spend a quiet youth. -% -Far out in the uncharted backwaters of the unfashionable end of the -Western Spiral arm of the Galaxy lies a small unregarded yellow sun. -Orbiting this at a distance of roughly ninety-eight million miles is an -utterly insignificant little blue-green planet whose ape-descended life -forms are so amazingly primitive that they still think digital watches -are a pretty neat idea ... - -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -Farmers in the Iowa State survey rated machinery breakdowns more -stressful than divorce. - -- Wall Street Journal -% -Fashion is a form of ugliness so intolerable that we have to alter -it every six months. - -- Oscar Wilde -% -Fashions have done more harm than revolutions. - -- Victor Hugo -% -Fast, cheap, good: pick two. -% -Fast ship? You mean you've never heard of the Millennium Falcon? - -- Han Solo -% -Faster, faster, you fool, you fool! - -- Bill Cosby -% -Fat Liberation: because a waist is a terrible thing to mind. -% -Fat people of the world unite, we've got nothing to lose! -% -Father: Son, it's time we talked about sex. -Son: Sure, Dad, what do you want to know? -% -Fats Loves Madelyn. -% -Fay: The British police force used to be run by men of integrity. -Truscott: That is a mistake which has been rectified. - -- Joe Orton, "Loot" -% -FEAR: - What you feel when you see a U-Haul with Texas license plates. -% -Fear and loathing, my man, fear and loathing. - -- Hunter S. Thompson -% -Fear is the greatest salesman. - -- Robert Klein -% -Feature, n.: - A surprising property of a program. Occasionally documented. To - call a property a feature sometimes means the author did not - consider that case, and the program makes an unexpected, though - not necessarily wrong response. See BUG. "That's not a bug, it's - a feature!" A bug can be changed to a feature by documenting it. -% -Federal grants are offered for... research into the recreation -potential of interplanetary space travel for the culturally -disadvantaged. -% -Feel disillusioned? -I've got some great new illusions, right here! -% -Feeling amorous, she looked under the sheets and cried, "Oh, no, -it's Microsoft!" -% -Felix Catus is your taxonomic nomenclature, -An endothermic quadruped, carnivorous by nature. -Your visual, olfactory, and auditory senses -Contribute to your hunting skills and natural defenses. -I find myself intrigued by your sub-vocal oscillations, -A singular development of cat communications -That obviates your basic hedonistic predilection -For a rhythmic stroking of your fur to demonstrate affection. -A tail is quite essential for your acrobatic talents: -You would not be so agile if you lacked its counterbalance; -And when not being utilized to aid in locomotion, -It often serves to illustrate the state of your emotion. -Oh Spot, the complex levels of behavior you display -Connote a fairly well-developed cognitive array. -And though you are not sentient, Spot, and do not comprehend, -I nonetheless consider you a true and valued friend. - -- Lt. Cmdr. Data, "An Ode to Spot" -% -Fellow programmer, greetings! You are reading a letter which will bring -you luck and good fortune. Just mail (or UUCP) ten copies of this letter -to ten of your friends. Before you make the copies, send a chip or -other bit of hardware, and 100 lines of "C" code to the first person on the -list given at the bottom of this letter. Then delete their name and add -yours to the bottom of the list. - -Don't break the chain! Make the copy within 48 hours. Gerald R. of San -Diego failed to send out his ten copies and woke the next morning to find -his job description changed to "COBOL programmer." Fred A. of New York sent -out his ten copies and within a month had enough hardware and software to -build a Cray dedicated to playing Zork. Martha H. of Chicago laughed at -this letter and broke the chain. Shortly thereafter, a fire broke out in -her terminal and she now spends her days writing documentation for IBM PC's. - -Don't break the chain! Send out your ten copies today! -% -Female rabbits: - The gift that just "keeps on giving." -% -Fenderberg, n.: - The large glacial deposits that form on the insides - of car fenders during snowstorms. - -- Rich Hall & Friends, "Sniglets" -% -Ferguson's Precept: - A crisis is when you can't say "let's forget the whole thing." -% -Fertility is hereditary. If your parents -didn't have any children, neither will you. -% -Fess: Well, you must admit there is something innately humorous about - a man chasing an invention of his own halfway across the galaxy. -Rod: Oh yeah, it's a million yuks, sure. But after all, isn't that the - basic difference between robots and humans? -Fess: What, the ability to form imaginary constructs? -Rod: No, the ability to get hung up on them. - -- Christopher Stasheff, "The Warlock in Spite of Himself" -% -Few things are harder to put up with than the annoyance of a good example. - -- Mark Twain -% -Fidelity, n.: - A virtue peculiar to those who are about to be betrayed. -% -Fifteen men on a dead man's chest, -Yo-ho-ho and a bottle of rum! -Drink and the devil had done for the rest, -Yo-ho-ho and a bottle of rum! - -- Robert Louis Stevenson, "Treasure Island" -% -Fifth Law of Applied Terror: - If you are given an open-book exam, you will forget your book. -Corollary: - If you are given a take-home exam, you will forget where you live. -% -Fifth Law of Procrastination: - Procrastination avoids boredom; one never has the feeling that -there is nothing important to do. -% -Fifty flippant frogs -Walked by on flippered feet -And with their slime they made the time -Unnaturally fleet. -% -Fights between cats and dogs are prohibited by statute in Barber, North -Carolina. -% -File cabinet: - A four drawer, manually activated trash compactor. -% -Filibuster, n.: - Throwing your wait around. -% -Fill what's empty, empty what's full, scratch where it itches. - -- Alice Roosevelt Longworth -% -Finagle's Creed: - Science is true. Don't be misled by facts. -% -Finagle's Eighth Law: - If an experiment works, something has gone wrong. - -Finagle's Ninth Law: - No matter what results are expected, - someone is always willing to fake it. - -Finagle's Tenth Law: - No matter what the result someone - is always eager to misinterpret it. - -Finagle's Eleventh Law: - No matter what occurs, someone believes - it happened according to his pet theory. -% -Finagle's First Law: - To study a subject best, understand it thoroughly before you start. - -Finagle's Second Law: - Always keep a record of data -- it indicates you've been working. - -Finagle's Fourth Law: - Once a job is fouled up, - anything done to improve it only makes it worse. - -Finagle's Fifth Law: - Always draw your curves, then plot your readings. - -Finagle's Sixth Law: - Don't believe in miracles -- rely on them. -% -Finagle's Second Law: - No matter what the anticipated result, there will always be - someone eager to (a) misinterpret it, (b) fake it, or - (c) believe it happened according to his own pet theory. -% -Finagle's Seventh Law: - The perversity of the universe tends toward a maximum. -% -Finagle's Third Law: - In any collection of data, the figure most obviously correct, - beyond all need of checking, is the mistake. - -Corollaries: - 1. Nobody whom you ask for help will see it. - 2. The first person who stops by, whose advice you really - don't want to hear, will see it immediately. -% -Finality is death. -Perfection is finality. -Nothing is perfect. -There are lumps in it. -% -Finding out what goes on in the C.I.A. is like performing acupuncture -on a rock. - -- New York Times, Jan. 20, 1981 -% -Fine day for friends. -So-so day for you. -% -Fine day to throw a party. Throw him as far as you can. -% -Fine day to work off excess energy. Steal something heavy. -% -Fine's Corollary: - Functionality breeds Contempt. -% -Finish the sentence below in 25 words or less: - - "Love is what you feel just before you give someone a good ..." - -Mail your answer along with the top half of your supervisor to: - - P.O. Box 35 - Baffled Greek, Michigan -% -Finster's Law: -A closed mouth gathers no feet. -% -First, a few words about tools. - -Basically, a tool is an object that enables you to take advantage of -the laws of physics and mechanics in such a way that you can seriously -injure yourself. Today, people tend to take tools for granted. If -you're ever walking down the street and you notice some people who look -particularly smug, the odds are that they are taking tools for -granted. If I were you, I'd walk right up and smack them in the face. - -- Dave Barry, "The Taming of the Screw" -% -First Corollary of Taber's Second Law: - Machines that piss people off get murdered. - -- Pat Taber -% -First Law of Bicycling: - No matter which way you ride, it's uphill and against the wind. -% -First law of debate: - Never argue with a fool. People might not know the difference. -% -First Law of Procrastination: - Procrastination shortens the job and places the responsibility - for its termination on someone else (i.e., the authority who - imposed the deadline). -% -First Law of Socio-Genetics: - Celibacy is not hereditary. -% -First love is only a little foolishness and a lot of curiosity, no really -self-respecting woman would take advantage of it. - -- George Bernard Shaw, "John Bull's Other Island" -% -First Rule of History: - History doesn't repeat itself -- - historians merely repeat each other. -% -First rule of public speaking. - First, tell 'em what you're goin' to tell 'em; - then tell 'em; - then tell 'em what you've tole 'em. -% -First there was Dial-A-Prayer, then Dial-A-Recipe, and even Dial-A-Footballer. -But the south-east Victorian town of Sale has produced one to top them all. -Dial-A-Wombat. - It all began early yesterday when Sale police received a telephone -call: "You won't believe this, and I'm not drunk, but there's a wombat in the -phone booth outside the town hall," the caller said. - Not firmly convinced about the caller's claim to sobriety, members of -the constabulary drove to the scene, expecting to pick up a drunk. - But there it was, an annoyed wombat, trapped in a telephone booth. - The wombat, determined not to be had the better of again, threw its -bulk into the fray. It was eventually lassoed and released in a nearby scrub. - Then the officers received another message ... another wombat in -another phone booth. - There it was: *Another* angry wombat trapped in a telephone booth. - The constables took the miffed marsupial into temporary custody and -released it, too, in the scrub. - But on their way back to the station they happened to pass another -telephone booth, and -- you guessed it -- another imprisoned wombat. - After some serious detective work, the lads in blue found a suspect, -and after questioning, released him to be charged on summons. - Their problem ... they cannot find a law against placing wombats in -telephone booths. - -- "Newcastle Morning Herald", NSW Australia, Aug 1980 -% -First things first -- but not necessarily in that order. - -- The Doctor, "Doctor Who" -% -"First World" nations are the ones where people drive Japanese cars; -"Second World" nations are where First World residents go on vacation; -and "Third World" nations are the ones where people still dive out of -trees to prove their manhood. - -- Dave Barry -% -Fishbowl, n.: - A glass-enclosed isolation cell where newly - promoted managers are kept for observation. -% -Fishing, with me, has always been an excuse to drink in the daytime. - -- Jimmy Cannon -% -Five bicycles make a Volkswagen, seven make a truck. - -- Adolfo Guzman -% -Five is a sufficiently close approximation to infinity. - -- Robert Firth -% -Five names that I can hardly stand to hear, -Including yours and mine and one more chimp who isn't here, -I can see the ladies talking how the times is gettin' hard, -And that fearsome excavation on Magnolia boulevard, -Yes, I'm goin' insane, -And I'm laughing at the frozen rain, -Well, I'm so alone, honey when they gonna send me home? - Bad sneakers and a pina colada my friend, - Stopping on the avenue by Radio City, with a - Transistor and a large sum of money to spend... -You fellah, you tearin' up the street, -You wear that white tuxedo, how you gonna beat the heat, -Do you take me for a fool, do you think that I don't see, -That ditch out in the Valley that they're diggin' just for me, -Yes, and goin' insane, -You know I'm laughin' at the frozen rain, -Feel like I'm so alone, honey when they gonna send me home? -(chorus) - -- Bad Sneakers, "Steely Dan" -% -Five people -- an Englishman, Russian, American, Frenchman and Irishman -were each asked to write a book on elephants. Some amount of time later they -had all completed their respective books. The Englishman's book was entitled -"The Elephant -- How to Collect Them", the Russian's "The Elephant -- Vol. I", -the American's "The Elephant -- How to Make Money from Them", the Frenchman's -"The Elephant -- Its Mating Habits" and the Irishman's "The Elephant and -Irish Political History". -% -Five rules for eternal misery: - 1) Always try to exhort others to look upon you favorably. - 2) Make lots of assumptions about situations and be sure to - treat these assumptions as though they are reality. - 3) Then treat each new situation as though it's a crisis. - 4) Live in the past and future only (become obsessed with - how much better things might have been or how much worse - things might become). - 5) Occasionally stomp on yourself for being so stupid as to - follow the first four rules. -% -Flame on! - -- Johnny Storm -% -Flannister, n.: - The plastic yoke that holds a six-pack of beer together. - -- Rich Hall & Friends, "Sniglets" -% -Flappity, floppity, flip -The mouse on the m"obius strip; - The strip revolved, - The mouse dissolved -In a chronodimensional skip. -% -FLASH! -Intelligence of mankind decreasing. -Details at ... uh, when the little hand is on the .... -% -Flattery is like cologne -- to be smelled, but not swallowed. - -- Josh Billings -% -Flattery will get you everywhere. -% -Flee at once, all is discovered. -% -Flirting is the gentle art of making a man feel pleased with himself. - -- Helen Rowland -% -Flon's Law: - There is not now, and never will be, a language in - which it is the least bit difficult to write bad programs. -% -Florence Flask was ... dressing for the opera when she turned to her -husband and screamed, "Erlenmeyer! My joules! Someone has stolen my -joules!" - -"Now, now, my dear," replied her husband, "keep your balance and reflux -a moment. Perhaps they're mislead." - -"No, I know they're stolen," cried Florence. "I remember putting them -in my burette ... We must call a copper." - -Erlenmeyer did so, and the flatfoot who turned up, one Sherlock Ohms, -said the outrage looked like the work of an arch-criminal by the name -of Lawrence Ium. - -"We must be careful -- he's a free radical, ultraviolet, and -dangerous. His girlfriend is a chlorine at the Palladium. Maybe I can -catch him there." With that, he jumped on his carbon cycle in an -activated state and sped off along the reaction pathway ... - -- Daniel B. Murphy, "Precipitations" -% -Flowchart, n. & v.: - [From flow "to ripple down in rich profusion, as hair" + chart -"a cryptic hidden-treasure map designed to mislead the uninitiated."] -1. n. The solution, if any, to a class of Mascheroni construction -problems in which given algorithms require geometrical representation -using only the 35 basic ideograms of the ANSI template. 2. n. Neronic -doodling while the system burns. 3. n. A low-cost substitute for -wallpaper. 4. n. The innumerate misleading the illiterate. "A -thousand pictures is worth ten lines of code." -- The Programmer's -Little Red Vade Mecum, Mao Tse T'umps. 5. v.intrans. To produce -flowcharts with no particular object in mind. 6. v.trans. To obfuscate -(a problem) with esoteric cartoons. - -- Stan Kelly-Bootle, "The Devil's DP Dictionary" -% -Flugg's Law: - When you need to knock on wood is when you realize - that the world is composed of vinyl, naugahyde and aluminum. -% -Fly me away to the bright side of the moon ... -% -Flying is the second greatest feeling you can have. The greatest feeling? -Landing... Landing is the greatest feeling you can have. -% -Flying saucers on occasion - Show themselves to human eyes. -Aliens fume, put off invasion - While they brand these tales as lies. -% -Fog Lamps, n.: - Excessively (often obnoxiously) bright lamps mounted on the fronts - of automobiles; used on dry, clear nights to indicate that the - driver's brain is in a fog. See also "Idiot Lights". -% -Follow me around. I don't care. I'm serious. If anybody wants to put a -tail on me, go ahead. They'd be very bored. - -- Gary Hart, announcing his presidential candidacy, - commenting on rumors of womanizing. -% -Food for thought is no substitute for the real thing. - -- Walt Kelly, "Potluck Pogo" -% -Foolproof Operation: - No provision for adjustment. -% -Fools rush in -- and get the best seats in the house. -% -Football builds self-discipline. What else would induce -a spectator to sit out in the open in subfreezing weather? -% -Football combines the two worst features of American life. -It is violence punctuated by committee meetings. - -- George F. Will, "Men At Work: The Craft of Baseball" -% -Football is a game designed to keep coal miners off the streets. - -- Jimmy Breslin -% -For 20 dollars, I'll give you a good fortune next time ... -% -For a good time, call (510) 642-9483 -% -For a holy stint, a moth of the cloth gave up his woolens for lint. -% -For a light heart lives long. - -- William Shakespeare, "Love's Labour's Lost" -% -For a man to truly understand rejection, he must first be ignored by a -cat. -% -For adult education nothing beats children. -% -For ages, a deadly conflict has been waged between a few brave men and -women of thought and genius upon the one side, and the great ignorant -religious mass on the other. This is the war between Science and Faith. -The few have appealed to reason, to honor, to law, to freedom, to the -known, and to happiness here in this world. The many have appealed to -prejudice, to fear, to miracle, to slavery, to the unknown, and to -misery hereafter. The few have said "Think". The many have said "Believe!" - -- Robert Ingersoll, "Gods" -% -For an adequate time call 555-3321. -% -For an idea to be fashionable is ominous, -since it must afterwards be always old-fashioned. -% -For certain people, after fifty, litigation takes the place of sex. - -- Gore Vidal -% -For children with short attention spans: boomerangs that don't come back. -% -For courage mounteth with occasion. - -- William Shakespeare, "King John" -% -For every bloke who makes his mark, -there's half a dozen waiting to rub it out. - -- Andy Capp -% -For every complex problem, there is a solution that is simple, neat, -and wrong. - -- H. L. Mencken -% -For every credibility gap, there is a gullibility fill. - -- R. Clopton -% -For every human problem, there is a neat, -plain solution -- and it is always wrong. - -- H. L. Mencken -% -For example, if \thinmskip = 3mu, this makes \thickmskip = 6mu. But if -you also want to use \skip12 for horizontal glue, whether in math mode or -not, the amount of skipping will be in points (e.g., 6pt). The rule is -that glue in math mode varies with the size only when it is an \mskip; -when moving between an mskip and ordinary skip, the conversion factor -1mu=1pt is always used. The meaning of '\mskip\skip12' and -'\baselineskip=\the\thickmskip' should be clear. - -- Donald E. Knuth, TeX 82 -- Comparison with TeX80 -% -For fast-acting relief, try slowing down. -% -For flavor, instant sex will never supersede the stuff you have to peel -and cook. - -- Quentin Crisp -% -For fools rush in where angels fear to tread. - -- Alexander Pope -% -For gin, in cruel -Sober truth, -Supplies the fuel -For flaming youth. - -- Noel Coward -% -For God's sake, stop researching for a while and begin to think! -% -For good, return good. -For evil, return justice. -% -For I do not do the good I want, but the evil I do not want is what I do. - -- Paul of Tarsus, (Saint Paul) -% -For I swore I would stay a year away from her; out and alas! -but with break of day I went to make supplication. - -- Paulus Silentarius, c. 540 A.D. -% -For knighthood is not in the feats of war, -As for to fight in quarrel right or wrong, -But in a cause which truth cannot defer: -He ought himself for to make sure and strong, -Just to keep mixt with mercy among: -And no quarrel a knight ought to take -But for a truth, or for the common's sake. - -- Stephen Hawes -% -For large values of one, one equals two, for small values of two. -% -For men use, if they have an evil turn, to write it in marble: -and whoso doth us a good turn we write it in dust. - -- Sir Thomas More -% -For most men life is a search for the proper manila envelope in which to -get themselves filed. - -- Clifton Fadiman -% -For my birthday I got a humidifier and a de-humidifier. I -put them in the same room and let them fight it out. - -- Steven Wright -% -For my son, Robert, this is proving to be the high-point of his entire -life to date. He has had his pajamas on for two, maybe three days -now. He has the sense of joyful independence a 5-year-old child gets -when he suddenly realizes that he could be operating an acetylene torch -in the coat closet and neither parent [because of the flu] would have -the strength to object. He has been foraging for his own food, which -means his diet consists entirely of "food" substances which are -advertised only on Saturday-morning cartoon shows; substances that are -the color of jukebox lights and that, for legal reasons, have their -names spelled wrong, as in New Creemy Chok-'n'-Cheez Lumps o' Froot -("part of this complete breakfast"). - -- Dave Barry, "Molecular Homicide" -% -For myself, I can only say that I am astonished and somewhat terrified at -the results of this evening's experiments. Astonished at the wonderful -power you have developed, and terrified at the thought that so much hideous -and bad music may be put on record forever. - -- Sir Arthur Sullivan, message to Edison, 1888 -% -For people who like that kind of book, -that is the kind of book they will like. -% -For perfect happiness, remember two things: - (1) Be content with what you've got. - (2) Be sure you've got plenty. -% -FOR SALE: - Parachute. Used once. - Never opened. Slightly Stained. -% -For some reason a glaze passes over people's faces when you say -"Canada". Maybe we should invade South Dakota or something. - -- Sandra Gotlieb, wife of the Canadian ambassador to the U.S. -% -For some reason, this fortune reminds everyone of Marvin Zelkowitz. -% -For that matter, compare your pocket computer with the -massive jobs of a thousand years ago. Why not, then, the -last step of doing away with computers altogether?" - -- Jehan Shuman -% -For the fashion of Minas Tirith was such that it was built on seven levels, -each delved into a hill, and about each was set a wall, and in each wall -was a gate. - -- J. R. R. Tolkien, "The Return of the King" - - [Quoted in "VMS Internals and Data Structures", V4.4, when - referring to system overview.] - -% -For the first time we have a weapon that nobody has used for thirty years. -This gives me great hope for the human race. - -- Harlan Ellison -% -For the next hour, WE will control all that you see and hear. -% -For thee the wonder-working earth puts forth sweet flowers. - -- Titus Lucretius Carus -% -For there are moments when one can neither think nor feel. And if one can -neither think nor feel, she thought, where is one? - -- Virginia Woolf, "To the Lighthouse" - - [Quoted in "VMS Internals and Data Structures", V4.4, when - referring to powerfail recovery.] -% -For they starve the frightened little child -Till it weeps both night and day: -And they scourge the weak, and flog the fool, -And gibe the old and grey, -And some grow mad, and all grow bad, -And none a word may say. - -Each narrow cell in which we dwell -Is a foul and dark latrine, -And the fetid breath of living Death -Chokes up each grated screen, -And all, but Lust, is turned to dust -In Humanity's machine. - -And all men kill the thing they love, -By all let this be heard, -Some do it with a bitter look, -Some with a flattering word, -The coward does it with a kiss, -The brave man with a sword. - -- Oscar Wilde -% -For thirty years a certain man went to spend every evening with Mme. ___. -When his wife died his friends believed he would marry her, and urged -him to do so. "No, no," he said: "if I did, where should I have to -spend my evenings?" - -- Chamfort -% -For those of you who have been unfortunate enough to never have tasted the -'Great Chieftain O' the Pudden Race' (i.e. haggis) here is an easy to follow -recipe which results in a dish remarkably similar to the above mentioned -protected species. - Ingredients: - 1 Sheep's Pluck (heart, lungs, liver) and bag - 2 teacupsful toasted oatmeal - 1 teaspoonful salt - 8 oz. shredded suet - 2 small onions - 1/2 teaspoonful black pepper - - Scrape and clean bag in cold, then warm, water. Soak in salt water -overnight. Wash pluck, then boil for 2 hours with windpipe draining over -the side of pot. Retain 1 pint of stock. Cut off windpipe, remove surplus -gristle, chop or mince heart and lungs, and grate best part of liver (about -half only). Parboil and chop onions, mix all together with oatmeal, suet, -salt, pepper and stock to moisten. Pack the mixture into bag, allowing for -swelling. Boil for three hours, pricking regularly all over. If bag not -available, steam in greased basin covered by greaseproof paper and cloth for -four to five hours. -% -For those who like this sort of thing, this is the sort of thing they like. - -- Abraham Lincoln -% -For three days after death hair and fingernails -continue to grow, but phone calls taper off. - -- Johnny Carson -% -For what it's worth, if you -can- get Michelle Pfeiffer to model -a latex daemon suit for the catalog, I strongly suggest you do. -Breasts can sell anything. Shiny red latex body suits start -religions. - -- Brian McGroarty -% -For years a secret shame destroyed my peace -- -I'd not read Eliot, Auden or MacNiece. -But now I think a thought that brings me hope: -Neither had Chaucer, Shakespeare, Milton, Pope. - -- Justin Richardson -% -For your penance, say five Hail Marys and one loud BLAH! -% -Force has no place where there is need of skill. - -- Herodotus -% -"Force is but might," the teacher said-- -"That definition's just." -The boy said naught but thought instead, -Remembering his pounded head: -"Force is not might but must!" -% -Force it!!! -If it breaks, well, it wasn't working anyway... -No, don't force it, get a bigger hammer. -% -FORCE YOURSELF TO RELAX! -% -Forecast, n.: - A prediction of the future, based on the past, for - which the forecaster demands payment in the present. -% -Forest fires cause Smokey Bears. -% -Forgetfulness, n.: - A gift of God bestowed upon debtors in compensation for - their destitution of conscience. -% -Forgive and forget. - -- Cervantes -% -Forgive him, -for he believes that the customs of his tribe are the laws of nature! - -- George Bernard Shaw -% -Forgive, O Lord, my little jokes on Thee -And I'll forgive Thy great big one on me. - -- Robert Frost -% -Forgive your enemies, but don't forget their names. - -- John F. Kennedy -% -Forms follow function, and often obliterate it. -% -Forsan et haec olim meminisse juvabit. -% -FORTH IF HONK THEN -% -FORTRAN is a good example of a language -which is easier to parse using ad hoc techniques. - -- D. Gries - [What's good about it? Ed.] -% -FORTRAN is not a flower but a weed -- it is hardy, -occasionally blooms, and grows in every computer. - -- Alan J. Perlis -% -FORTRAN is the language of Powerful Computers. - -- Steven Feiner -% -FORTRAN rots the brain. - -- John McQuillin -% -FORTRAN, "the infantile disorder", by now nearly 20 years old, is hopelessly -inadequate for whatever computer application you have in mind today: it is -too clumsy, too risky, and too expensive to use. - -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5 -% -[FORTRAN] will persist for some time -- -probably for at least the next decade. - -- T. Cheatham -% -Fortunate is he for whom the belle toils. -% -Fortunately, the responsibility for providing evidence is on the part of -the person making the claim, not the critic. It is not the responsibility -of UFO skeptics to prove that a UFO has never existed, nor is it the -responsibility of paranormal-health-claims skeptics to prove that crystals -or colored lights never healed anyone. The skeptic's role is to point out -claims that are not adequately supported by acceptable evidence and to -provide plausible alternative explanations that are more in keeping with -the accepted body of scientific evidence. - -- Thomas L. Creed, The Skeptical Inquirer, Vol. XII, - No. 2, pg. 215 -% -Fortune and love befriend the bold. - -- Ovid -% -FORTUNE ANSWERS THE TOUGH QUESTIONS: #3 - -Q: Why haven't you graduated yet? -A: Well, Dad, I could have finished years ago, but I wanted - my dissertation to rhyme. -% -FORTUNE ANSWERS THE TOUGH QUESTIONS: #8 - -Q: Is God a myth? -A: No, He's a mythter. -% -fortune: cannot execute. Out of cookies. -% -fortune: cpu time/usefulness ratio too high -- core dumped. -% -FORTUNE DISCUSSES THE DIFFERENCES BETWEEN MEN AND WOMEN: #14 - -Low Blows: - Let's say a man and woman are watching a boxing match on TV. One -of the boxers is felled by a low blow. The woman says "Oh, gee. That must -hurt." The man doubles over and actually FEELS the pain. - -Dressing Up: - A woman will dress up to go shopping, water the plants, empty the -garbage, answer the phone, read a book, get the mail. A man will dress up -for: weddings, funerals. Speaking of weddings, when reminiscing about -weddings, women talk about "the ceremony". Men laugh about "the bachelor -party". - -David Letterman: - Men think David Letterman is the funniest man on the face of the -Earth. Women think he is a mean, semi-dorky guy who always has a bad -haircut. -% -FORTUNE DISCUSSES THE DIFFERENCES BETWEEN MEN AND WOMEN: #16 - -Relationships: - First of all, a man does not call a relationship a relationship -- he -refers to it as "that time when me and Suzie were doing it on a semi-regular -basis". - When a relationship ends, a woman will cry and pour her heart out to -her girlfriends, and she will write a poem titled "All Men Are Idiots". Then -she will get on with her life. - A man has a little more trouble letting go. Six months after the -breakup, at 3:00 a.m. on a Saturday night, he will call and say, "I just -wanted to let you know you ruined my life, and I'll never forgive you, and I -hate you, and you're a total floozy. But I want you to know that there's -always a chance for us". This is known as the "I Hate You / I Love You" -drunken phone call, that 99% if all men have made at least once. There are -community colleges that offer courses to help men get over this need; alas, -these classes rarely prove effective. -% -FORTUNE DISCUSSES THE DIFFERENCES BETWEEN MEN AND WOMEN: #17 - -Shoes: - The average man has 4 pairs of footwear: running shoes, dress shoes, -boots, and slippers. The average woman has shoes 4 layers thick on the floor -of her closet. Most of them hurt her feet. - -Making friends: - A woman will meet another woman with common interests, do a few things -together, and say something like, "I hope we can be good friends." - A man will meet another man with common interests, do a few things -together, and say nothing. After years of interacting with this other man, -sharing hopes and fears that he wouldn't confide in his priest or -psychiatrist, he'll finally let down his guard in a fit of drunken -sentimentality and say something like, "You know, for someone who's such a -jerk, I guess you're OK." -% -FORTUNE DISCUSSES THE DIFFERENCES BETWEEN MEN AND WOMEN: #2 - -Desserts: - A woman will generally admire an ornate dessert for the artistic -work it is, praising its creator and waiting a suitable interval before -she reluctantly takes a small sliver off one edge. A man will start by -grabbing the cherry in the center. - -Car repair: - The average man thinks his Y chromosome contains complete repair -manuals for every car made since World War II. He will work on a problem -himself until it either goes away or turns into something that "can't be -fixed without special tools". - The average woman thinks "that funny thump-thump noise" is an -accurate description of an automotive problem. She will, however, have the -car serviced at the proper intervals and thereby incur fewer problems than -the average man. -% -FORTUNE DISCUSSES THE DIFFERENCES BETWEEN MEN AND WOMEN: #4 - -Weddings: - When reminiscing about weddings, women talk about "the ceremony". -Men talk about "the bachelor party". - -Clothes: - Men don't discard clothes. The average man still has the gym shirt -he wore in high school. He thinks a jacket is "just getting broken in" about -the time it develops holes in the elbows. A man will let new shirts sit on -the shelf in their original packaging for a couple of years before putting -them to use, hoping they'll become more comfortable with age. - Women think clothes are radioactive, with a half-life of one year. -They exercise precautions to avoid contamination by last year's fashions. -% -FORTUNE DISCUSSES THE DIFFERENCES BETWEEN MEN AND WOMEN: #5 - -Trust: - The average woman would really like to be told if her mate is fooling -around behind her back. This same woman wouldn't tell her best friend if -she knew the best friends' mate was having an affair. She'll tell all her -OTHER friends, however. The average man won't say anything if he knows that -one of his friend's mates is fooling around, and he'd rather not know if -his mate is having an affair either, out of fear that it might be with one -of his friends. He will tell all his friends about his own affairs, though, -so they can be ready if he needs an alibi. - -Driving: - - A typical man thinks he's Mario Andretti as soon as he slips behind -the wheel of his car. The fact that it's an 8-year-old Honda doesn't keep -him from trying to out-accelerate the guy in the Porsche who's attempting -to cut him off; freeway on-ramps are exciting challenges to see who has The -Right Stuff on the morning commute. Does he or doesn't he? Only his body -shop knows for sure. Insurance companies understand this behavior, and -price their policies accordingly. - A woman will slow down to let a car merge in front of her, and get -rear-ended by another woman who was busy adding the finishing touches to -her makeup. -% -FORTUNE DISCUSSES THE DIFFERENCES BETWEEN MEN AND WOMEN: #6 - -Bathrooms: - A man has six items in his bathroom -- a toothbrush, toothpaste, -shaving cream, razor, a bar of Dial soap, and a towel from the Holiday Inn. -The average number of items in the typical woman's bathroom is 437. A man -would not be able to identify most of these items. - -Groceries: - A woman makes a list of things she needs and then goes to the store -and buys these things. A man waits 'til the only items left in his fridge -are half a lime and a Blue Ribbon. Then he goes grocery shopping. He buys -everything that looks good. By the time a man reaches the checkout counter, -his cart is packed tighter that the Clampett's car on Beverly Hillbillies. -Of course, this will not stop him from entering the 10-items-or-less lane. -% -FORTUNE DISCUSSES THE DIFFERENCES BETWEEN MEN AND WOMEN: #8 - -Going Out: - When a man says he is ready to go out, it means he is ready to go -out. When a woman says she is ready to go out, it means she WILL be ready -to go out, as soon as she finds her earring, finishes putting on her makeup, -checks on the kids, makes a phone call to her best friend... - -Cats: - Women love cats. Men say they love cats, but when women aren't -looking, men kick cats. - -Offspring: - Ah, children. A woman knows all about her children. She knows -about dentist appointments and soccer games and romances and best friends -and favorite foods and secret fears and hopes and dreams. Men are vaguely -aware of some short people living in the house. -% -FORTUNE DISCUSSES THE DIFFERENCES BETWEEN MEN AND WOMEN: #9 - -Laundry: - Women do laundry every couple of days. A man will wear every article -of clothing he owns, including his surgical pants that were hip about eight -years ago, before he will do his laundry. When he is finally out of clothes, -he will wear a dirty sweatshirt inside out, rent a U-Haul and take his mountain -of clothes to the laundromat. Men always expect to meet beautiful women at -the laundromat. This is a myth. - -Nicknames: - If Gloria, Suzanne, Deborah and Michelle get together for lunch, -they will call each other Gloria, Suzanne, Deborah and Michelle. But if -Mike, Dave, Rob and Jack go out for a brewsky, they will affectionately -refer to each other as Bullet-Head, Godzilla, Peanut Brain and Useless. - -Socks: - Men wear sensible socks. They wear standard white sweatsocks. -Women wear strange socks. They are cut way below the ankles, have pictures -of clouds on them, and have a big fuzzy ball on the back. -% -FORTUNE DISCUSSES THE OBSCURE FILMS: #10 - -CARTABLANCA: - Bogart stars as the owner of a North African nightclub that sells - only Mexican beer. Of course, this policy gets him into no end of - trouble with the local French authorities who would really prefer - wine and the occupying Germans who believe that only their beer is - fit to be sold. Wacky events ensue until the gripping climax in - which the much-hated German beer distributor is drowned in a vat. -% -FORTUNE DISCUSSES THE OBSCURE FILMS: #11 - -MONOPOLI: - Peter Weir's classic film examining the false heroism of parlour - games. The powerful ending of the film sees one young man after - another charge toward GO, only to senselessly lose his life on the - Boardwalk property. -% -FORTUNE DISCUSSES THE OBSCURE FILMS: #12 - -O.E.D.: David Lean, 1969, 3 hours 30 min. - - Lean's version of the Oxford Dictionary has been accused of - shallowness in its treatment of a complete work. Omar Sharif - tends to overact as aardvark, but Alec Guinness is solid in - the role of abbacy. As usual, the photography is stunning. - With Julie Christie. -% -FORTUNE DISCUSSES THE OBSCURE FILMS: #3 - -MIRACLE ON 42ND STREET: - Santa Claus, in the off season, follows his heart's desire and - tries to make it big on Broadway. Santa sings and dances his way - into your heart. -% -FORTUNE DISCUSSES THE OBSCURE FILMS: #4 - -WITLESS: - Peter Weir directs Sylvester Stallone in the most challenging role - of his career. Stallone plays a Philadelphia police officer on the - run from corrupt officials. He is wounded and then nursed back to - health by Amish Mennonites. Fearful that they might unwittingly - reveal his hiding place, he blows them all away. -% -FORTUNE DISCUSSES THE OBSCURE FILMS: #5 - -THE ATOMIC GRANDMOTHER: - This humorous but heart-warming story tells of an elderly woman - forced to work at a nuclear power plant in order to help the family - make ends meet. At night, granny sits on the porch, tells tales - of her colorful past, and the family uses her to cook barbecues - and to power small electrical appliances. Maureen Stapleton gives - a glowing performance. -% -FORTUNE DISCUSSES THE OBSCURE FILMS: #6 - -RAZORBACK: Paul Harbride, 1984, 2 hours 25 min. - One of the great Australian films of the early 1980's, - and arguably the best movie ever made about a large, - man-eating hog. Some violence. With Gregory Harrison. -% -FORTUNE DISCUSSES THE OBSCURE FILMS: #7 - -OUT OF "OUT OF AFRICA": - This film is a compilation of selected news clips depicting audiences - frantically pushing and shoving to get out of theatres where "Out of - Africa" is showing. Many people are trampled to death in the frenzy. - Due to its violence and offensive language, not recommended for - younger viewers. -% -FORTUNE DISCUSSES THE OBSCURE FILMS: #8 - -THE SMURFS AND THE CUISINART (1986) - The lovable little blue Smurfs encounter a lovable little kitchen - appliance, which invites them to play. The Smurfs learn a valuable - (if sometimes fatal) lesson. - -THE SMURFS AND THE CARBON-DIOXIDE INDUSTRIAL LASER (1987) - The inevitable sequel. The lovable and somewhat mangled surviving - Smurfs team up with the Care Bears to encounter a cute, lovable piece - of high-tech welding equipment, which teaches them the magic of - becoming rather greasy smoke. Heartwarming fun for the entire family. -% -FORTUNE DISCUSSES THE OBSCURE FILMS: #9 - -THE PARKING PROBLEM IN PARIS: Jean-Luc Godard, 1971, 7 hours 18 min. - - Godard's meditation on the topic has been described as - everything from "timeless" to "endless." (Remade by Gene - Wilder as NO PLACE TO PARK.) -% -Fortune Documents the Great Legal Decisions: - -It is a rule of evidence deduced from the experience of mankind and -supported by reason and authority that positive testimony is entitled to -more weight than negative testimony, but by the latter term is meant -negative testimony in its true sense and not positive evidence of a -negative, because testimony in support of a negative may be as positive -as that in support of an affirmative. - -- 254 Pac. Rep. 472 -% -Fortune Documents the Great Legal Decisions: - -We can imagine no reason why, with ordinary care, human toes could not be -left out of chewing tobacco, and if toes are found in chewing tobacco, it -seems to us that someone has been very careless. - -- 78 So. 365 -% -Fortune Documents the Great Legal Decisions: - -We think that we may take judicial notice of the fact that the term "bitch" -may imply some feeling of endearment when applied to a female of the canine -species but that it is seldom, if ever, so used when applied to a female -of the human race. Coming as it did, reasonably close on the heels of two -revolver shots directed at the person of whom it was probably used, we think -it carries every reasonable implication of ill-will toward that person. - -- Smith v. Moran, 193 N.E. 2d 466 -% -FORTUNE EXPLAINS WHAT JOB REVIEW CATCH PHRASES MEAN: #1 - -Skilled oral communicator: - Mumbles inaudibly when attempting to speak. Talks to self. - Argues with self. Loses these arguments. - -Skilled written communicator: - Scribbles well. Memos are invariable illegible, except for - the portions that attribute recent failures to someone else. - -Growth potential: - With proper guidance, periodic counseling, and remedial training, - the reviewee may, given enough time and close supervision, meet - the minimum requirements expected of him by the company. - -Key company figure: - Serves as the perfect counter example. -% -FORTUNE EXPLAINS WHAT JOB REVIEW CATCH PHRASES MEAN: #4 - -Consistent: - Reviewee hasn't gotten anything right yet, and it is anticipated - that this pattern will continue throughout the coming year. - -An excellent sounding board: - Present reviewee with any number of alternatives, and implement - them in the order precisely opposite of his/her specification. - -A planner and organizer: - Usually manages to put on socks before shoes. Can match the - animal tags on his clothing. -% -FORTUNE EXPLAINS WHAT JOB REVIEW CATCH PHRASES MEAN: #9 - -Has management potential: - Because of his intimate relationship with inanimate objects, the - reviewee has been appointed to the critical position of department - pencil monitor. - -Inspirational: - A true inspiration to others. ("There, but for the grace of God, - go I.") - -Adapts to stress: - Passes wind, water, or out depending upon the severity of the - situation. - -Goal oriented: - Continually sets low goals for himself, and usually fails - to meet them. -% -Fortune favors the lucky. -% -Fortune finishes the great quotations, #12 - - Those who can, do. Those who can't, write the instructions. -% -Fortune finishes the great quotations, #15 - - "Give me your tired, your poor, your huddled masses." - And while you're at it, throw in a couple of those Dallas - Cowboy cheerleaders. -% -Fortune finishes the great quotations, #17 - - "This bud of love, by summer's ripening breath, - May prove a beauteous flower when next we meet." - Juliet, this bud's for you. -% -Fortune finishes the great quotations, #2 - - If at first you don't succeed, think how many people - you've made happy. -% -Fortune finishes the great quotations, #21 - - Shall I compare thee to a Summer day? - No, I guess not. -% -Fortune finishes the great quotations, #3 - - Birds of a feather flock to a newly washed car. -% -Fortune finishes the great quotations, #6 - - "But, soft! What light through yonder window breaks?" - It's nothing, honey. Go back to sleep. -% -Fortune finishes the great quotations, #9 - - A word to the wise is often enough to start an argument. -% -fortune: No such file or directory -% -fortune: not found -% -Fortune presents: - USEFUL PHRASES IN ESPERANTO, #1. - -^Cu vi parolas angle? Do you speak English? -Mi ne komprenas. I don't understand. -Vi estas la sola esperantisto kiun mi You're the only Esperanto speaker - renkontas. I've met. -La ^ceko estas enpo^stigita. The check is in the mail. -Oni ne povas, ^gin netrovi. You can't miss it. -Mi nur rigardadas. I'm just looking around. -Nu, ^sajnis bona ideo. Well, it seemed like a good idea. -% -Fortune presents: - USEFUL PHRASES IN ESPERANTO, #2. - -^Cu tiu loko estas okupita? Is this seat taken? -^Cu vi ofte venas ^ci-tien? Do you come here often? -^Cu mi povas havi via telelonnumeron? May I have your phone number? -Mi estas komputilisto. I work with computers. -Mi legas multe da scienca fikcio. I read a lot of science fiction. -^Cu necesas ke vi eliras? Do you really have to be going? -% -Fortune presents: - USEFUL PHRASES IN ESPERANTO, #5. - -Mi ^cevalovipus vin se mi havus I'd horsewhip you if I had a horse. - ^cevalon. -Vere vi ^sercas. You must be kidding. -Nu, parDOOOOOnu min! Well exCUUUUUSE me! -Kiu invitis vin? Who invited you? -Kion vi diris pri mia patrino? What did you say about my mother? -Bu^so^stopu min per kulero. Gag me with a spoon. -% -FORTUNE PRESENTS FAMOUS LAST WORDS: #4 - -Socrates: I DRANK WHAT!?!? -Tarzan: Who greased the grape viiiiiiiiiiiinnnneee........ -Al Capone: There's a violin in my violin case! -Pilot, TWA Fl. #343: What's a mountain goat doing 'way up here? -% -FORTUNE PROVIDES QUESTIONS FOR THE GREAT ANSWERS: #13 - -A: Doc, Happy, Bashful, Dopey, Sneezy, Sleepy, & Grumpy -Q: Who were the Democratic presidential candidates? -% -FORTUNE PROVIDES QUESTIONS FOR THE GREAT ANSWERS: #15 - -A: The Royal Canadian Mounted Police. -Q: What was the greatest achievement in taxidermy? -% -FORTUNE PROVIDES QUESTIONS FOR THE GREAT ANSWERS: #19 - -A: To be or not to be. -Q: What is the square root of 4b^2? -% -FORTUNE PROVIDES QUESTIONS FOR THE GREAT ANSWERS: #21 - -A: Dr. Livingston I. Presume. -Q: What's Dr. Presume's full name? -% -FORTUNE PROVIDES QUESTIONS FOR THE GREAT ANSWERS: #31 - -A: Chicken Teriyaki. -Q: What is the name of the world's oldest kamikaze pilot? -% -FORTUNE PROVIDES QUESTIONS FOR THE GREAT ANSWERS: #4 - -A: Go west, young man, go west! -Q: What do wabbits do when they get tiwed of wunning awound? -% -FORTUNE PROVIDES QUESTIONS FOR THE GREAT ANSWERS: #5 - -A: The Halls of Montezuma and the Shores of Tripoli. -Q: Name two families whose kids won't join the Marines. -% -FORTUNE REMEMBERS THE GREAT MOTHERS: #5 - - "And, and, and, and, but, but, but, but!" - -- Mrs. Janice Markowsky, April 8, 1965 -% -FORTUNE REMEMBERS THE GREAT MOTHERS: #6 - - "Johnny, if you fall and break your leg, don't come running to me!" - -- Mrs. Emily Barstow, June 16, 1954 -% -Fortune suggests uses for YOUR favorite UNIX commands! - -Try: - ar t "God" - drink < bottle; opener (Bourne Shell) - cat "food in tin cans" (all but 4.[23]BSD) - Hey UNIX! Got a match? (V6 or C shell) - mkdir matter; cat > matter (Bourne Shell) - rm God - man: Why did you get a divorce? (C shell) - date me (anything up to 4.3BSD) - make "heads or tails of all this" - who is smart - (C shell) - If I had a ) for every dollar of the national debt, what would I have? - sleep with me (anything up to 4.3BSD) -% -Fortune: You will be attacked next Wednesday at 3:15 p.m. by six samurai -sword wielding purple fish glued to Harley-Davidson motorcycles. - -Oh, and have a nice day! - -- Bryce Nesbitt '84 -% -Fortune's Contribution of the Month to the Animal Rights Debate: - - I'll stay out of animals' way if they'll stay out of mine. - "Hey you, get off my plate" - -- Roger Midnight -% -Fortune's current rates: - - Answers .10 - Long answers .25 - Answers requiring thought .50 - Correct answers $1.00 - - Dumb looks are still free. -% -Fortune's diet truths: -1: Forget what the cookbooks say, plain yogurt tastes nothing like sour cream. -2: Any recipe calling for soybeans tastes like mud. -3: Carob is not an acceptable substitute for chocolate. In fact, carob is not - an acceptable substitute for anything, except, perhaps, brown shoe polish. -4: There is no such thing as a "fun salad." So let's stop pretending and see - salads for what they are: God's punishment for being fat. -5: Fruit salad without maraschino cherries and marshmallows is about as - appealing as tepid beer. -6: A world lacking gravy is a tragic place! -7: You should immediately pass up any recipes entitled "luscious and - low-cal." Also skip dishes featuring "lively liver." They aren't and - it isn't. -8: Wearing a blindfold often makes many diet foods more palatable. -9: Fresh fruit is not dessert. CAKE is dessert! -10: Okra tastes slightly worse than its name implies. -11: A plain baked potato isn't worth the effort involved in chewing and - swallowing. -% -Fortune's Exercising Truths: - -1: Richard Simmons gets paid to exercise like a lunatic. You don't. -2. Aerobic exercises stimulate and speed up the heart. So do heart attacks. -3. Exercising around small children can scar them emotionally for life. -4. Sweating like a pig and gasping for breath is not refreshing. -5. No matter what anyone tells you, isometric exercises cannot be done - quietly at your desk at work. People will suspect manic tendencies as - you twitter around in your chair. -6. Next to burying bones, the thing a dog enjoys most is tripping joggers. -7. Locking four people in a tiny, cement-walled room so they can run around - for an hour smashing a little rubber ball -- and each other -- with a hard - racket should immediately be recognized for what it is: a form of insanity. -8. Fifty push-ups, followed by thirty sit-ups, followed by ten chin-ups, - followed by one throw-up. -9. Any activity that can't be done while smoking should be avoided. -% -FORTUNE'S FAVORITE RECIPES: #8 - Christmas Rum Cake - -1 or 2 quarts rum 1 tbsp. baking powder -1 cup butter 1 tsp. soda -1 tsp. sugar 1 tbsp. lemon juice -2 large eggs 2 cups brown sugar -2 cups dried assorted fruit 3 cups chopped English walnuts - -Before you start, sample the rum to check for quality. Good, isn't it? Now -select a large mixing bowl, measuring cup, etc. Check the rum again. It -must be just right. Be sure the rum is of the highest quality. Pour one cup -of rum into a glass and drink it as fast as you can. Repeat. With an electric -mixer, beat one cup butter in a large fluffy bowl. Add 1 seaspoon of tugar -and beat again. Meanwhile, make sure the rum teh absolutely highest quality. -Sample another cup. Open second quart as necessary. Add 2 orge laggs, 2 cups -of fried druit and beat untill high. If the fried druit gets stuck in the -beaters, just pry it loose with a screwdriver. Sample the rum again, checking -for toncisticity. Next sift 3 cups of baking powder, a pinch of rum, a -seaspoon of toda and a cup of pepper or salt (it really doesn't matter). -Sample some more. Sift 912 pint of lemon juice. Fold in schopped butter and -strained chups. Add bablespoon of brown gugar, or whatever color you have. -Mix mell. Grease oven and turn cake pan to 350 gredees and rake until -poothtick comes out crean. -% -Fortune's Fictitious Country Song Title of the Week: - "How Can I Miss You if You Won't Go Away?" -% -FORTUNE'S FUN FACTS TO KNOW AND TELL: #1 - A guinea pig is not from Guinea but a rodent from South America. - A firefly is not a fly, but a beetle. - A giant panda bear is really a member of the raccoon family. - A black panther is really a leopard that has a solid black coat - rather than a spotted one. - Peanuts are not really nuts. The majority of nuts grow on trees - while peanuts grow underground. They are classified as a - legume-part of the pea family. - A cucumber is not a vegetable but a fruit. -% -FORTUNE'S FUN FACTS TO KNOW AND TELL: #14 - The Baby Ruth candy bar was not named after George Herman "The Babe" -Ruth, but after the oldest daughter of President Grover Cleveland. -% -FORTUNE'S FUN FACTS TO KNOW AND TELL: #37 - Can you name the seven seas? - Antarctic, Arctic, North Atlantic, South Atlantic, Indian, - North Pacific, South Pacific. - Can you name the seven dwarfs from Snow White? - Doc, Dopey, Sneezy, Happy, Grumpy, Sleepy and Bashful. -% -FORTUNE'S FUN FACTS TO KNOW AND TELL: #44 - Zebra's are colored with dark stripes on a light background. -% -FORTUNE'S FUN FACTS TO KNOW AND TELL: #108 - -In Memphis, Tennessee, it is illegal for a woman to drive a car unless -there is a man either running or walking in front of it waving a red -flag to warn approaching motorists and pedestrians. -% -FORTUNE'S FUN FACTS TO KNOW AND TELL: #14 - According to Kentucky state law, every person must take a bath -at least once a year. -% -FORTUNE'S FUN FACTS TO KNOW AND TELL: #16 - -The Arkansas legislature passed a law that states that the Arkansas River -can rise no higher than to the Main Street bridge in Little Rock. -% -FORTUNE'S FUN FACTS TO KNOW AND TELL: #19 - A Los Angeles judge ruled that "a citizen may snore with immunity in -his own home, even though he may be in possession of unusual and exceptional -ability in that particular field." -% -FORTUNE'S FUN FACTS TO KNOW AND TELL: #1 - -In Blythe, California, a city ordinance declares that a person must own -at least two cows before he can wear cowboy boots in public. -% -FORTUNE'S FUN FACTS TO KNOW AND TELL: #2 - Horses are forbidden to eat fire hydrants in Marshalltown, Iowa. -% -FORTUNE'S FUN FACTS TO KNOW AND TELL: #3 - A New York City judge ruled that if two women behind you at the -movies insist on discussing the probable outcome of the film, you have the -right to turn around and blow a Bronx cheer at them. -% -FORTUNE'S FUN FACTS TO KNOW AND TELL: #8 - - Idaho state law makes it illegal for a man to give his sweetheart -a box of candy weighing less than fifty pounds. -% -Fortune's graffito of the week (or maybe even month): - - Don't Write On Walls! - - (and underneath) - - You want I should type? -% -Fortune's Great Moments in History: #3 - -August 27, 1949: - A Hall of Fame opened to honor outstanding members of the - Women's Air Corp. It was a WAC's Museum. -% -FORTUNE'S GUIDE TO DEALING WITH REAL-LIFE SCIENCE FICTION: #14 -What to do... - if reality disappears? - Hope this one doesn't happen to you. There isn't much that you - can do about it. It will probably be quite unpleasant. - - if you meet an older version of yourself who has invented a time - traveling machine, and has come from the future to meet you? - Play this one by the book. Ask about the stock market and cash in. - Don't forget to invent a time traveling machine and visit your - younger self before you die, or you will create a paradox. If you - expect this to be tricky, make sure to ask for the principles - behind time travel, and possibly schematics. Never, NEVER, ask - when you'll die, or if you'll marry your current SO. -% -FORTUNE'S GUIDE TO DEALING WITH REAL-LIFE SCIENCE FICTION: #2 -What to do... - if you get a phone call from Mars: - Speak slowly and be sure to enunciate your words properly. Limit - your vocabulary to simple words. Try to determine if you are - speaking to someone in a leadership capacity, or an ordinary citizen. - - if he, she or it doesn't speak English? - Hang up. There's no sense in trying to learn Martian over the phone. - If your Martian really had something important to say to you, he, she - or it would have taken the trouble to learn the language before - calling. - - if you get a phone call from Jupiter? - Explain to your caller, politely but firmly, that being from Jupiter, - he, she or it is not "life as we know it". Try to terminate the - conversation as soon as possible. It will not profit you, and the - charges may have been reversed. -% -FORTUNE'S GUIDE TO DEALING WITH REAL-LIFE SCIENCE FICTION: #6 -What to do... - if a starship, equipped with an FTL hyperdrive lands in your backyard? - First of all, do not run after your camera. You will not have any - film, and, given the state of computer animation, noone will believe - you anyway. Be polite. Remember, if they have an FTL hyperdrive, - they can probably vaporize you, should they find you to be rude. - Direct them to the White House lawn, which is where they probably - wanted to land, anyway. A good road map should help. - - if you wake up in the middle of the night, and discover that your - closet contains an alternate dimension? - Don't walk in. You almost certainly will not be able to get back, - and alternate dimensions are almost never any fun. Remain calm - and go back to bed. Close the door first, so that the cat does not - wander off. Check your closet in the morning. If it still contains - an alternate dimension, nail it shut. -% -Fortune's Guide to Freshman Notetaking: - -WHEN THE PROFESSOR SAYS: YOU WRITE: - -Probably the greatest quality of the poetry John Milton -- born 1608 -of John Milton, who was born in 1608, is the -combination of beauty and power. Few have -excelled him in the use of the English language, -or for that matter, in lucidity of verse form, -'Paradise Lost' being said to be the greatest -single poem ever written." - -Current historians have come to Most of the problems that now -doubt the complete advantageousness face the United States are -of some of Roosevelt's policies... directly traceable to the - bungling and greed of President - Roosevelt. - -... it is possible that we simply do Professor Mitchell is a -not understand the Russian viewpoint... communist. -% -Fortune's Law of the Week (this week, from Kentucky): - No female shall appear in a bathing suit at any airport in this -State unless she is escorted by two officers or unless she is armed -with a club. The provisions of this statute shall not apply to females -weighing less than 90 pounds nor exceeding 200 pounds, nor shall it -apply to female horses. -% -Fortune's nomination for All-Time Champion and Protector of Youthful Morals -goes to Representative Clare E. Hoffman of Michigan. During an impassioned -House debate over a proposed bill to "expand oyster and clam research," a -sharp-eared informant transcribed the following exchange between our hero -and Rep. John D. Dingell, also of Michigan. - -Dingell: "There are places in the world at the present time where we are - having to artificially propagate oysters and clams." -Hoffman: "You mean the oysters I buy are not nature's oysters?" -Dingell: "They may or may not be natural. The simple fact of the matter is - that female oysters through their living habits cast out large - amounts of seed and the male oysters cast out large amounts of - fertilization." -Hoffman: "Wait a minute! I do not want to go into that. There are many - teenagers who read The Congressional Record." -% -Fortune's Office Door Sign of the Week: - - Incorrigible punster -- Do not incorrige. -% -FORTUNE'S PARTY TIPS: #14 - - Tired of finding that other people are helping themselves to -your good liquor at BYOB parties? Take along a candle, which you insert -and light after you've opened the bottle. No one ever expects anything -drinkable to be in a bottle which has a candle stuck in its neck. -% -Fortune's Real-Life Courtroom Quote #18: - -Q: Are you married? -A: No, I'm divorced. -Q: And what did your husband do before you divorced him? -A: A lot of things I didn't know about. -% -Fortune's Real-Life Courtroom Quote #19: - -Q: Doctor, how many autopsies have you performed on dead people? -A: All my autopsies have been performed on dead people. -% -Fortune's Real-Life Courtroom Quote #29: - -THE JUDGE: Now, as we begin, I must ask you to banish all present - information and prejudice from your minds, if you have - any ... -% -Fortune's Real-Life Courtroom Quote #32: - -Q: Do you know how far pregnant you are right now? -A: I will be three months November 8th. -Q: Apparently then, the date of conception was August 8th? -A: Yes. -Q: What were you and your husband doing at that time? -% -Fortune's Real-Life Courtroom Quote #37: - -Q: Did he pick the dog up by the ears? -A: No. -Q: What was he doing with the dog's ears? -A: Picking them up in the air. -Q: Where was the dog at this time? -A: Attached to the ears. -% -Fortune's Real-Life Courtroom Quote #3: - -Q: When he went, had you gone and had she, if she wanted to and were - able, for the time being excluding all the restraints on her not to - go, gone also, would he have brought you, meaning you and she, with - him to the station? -MR. BROOKS: Objection. That question should be taken out and shot. -% -Fortune's Real-Life Courtroom Quote #41: - -Q: Now, Mrs. Johnson, how was your first marriage terminated? -A: By death. -Q: And by whose death was it terminated? -% -Fortune's Real-Life Courtroom Quote #52: - -Q: What is your name? -A: Ernestine McDowell. -Q: And what is your marital status? -A: Fair. -% -Fortune's Real-Life Courtroom Quote #7: - -Q: What happened then? -A: He told me, he says, "I have to kill you because you can identify - me." -Q: Did he kill you? -A: No. -% -Fortune's Rules for Memo Wars: #2 - -Given the incredible advances in sociocybernetics and telepsychology over -the last few years, we are now able to completely understand everything that -the author of a memo is trying to say. Thanks to modern developments -in electrocommunications like notes, vnews, and electricity, we have an -incredible level of interunderstanding the likes of which civilization has -never known. Thus, the possibility of your misinterpreting someone else's -memo is practically nil. Knowing this, anyone who accuses you of having -done so is a liar, and should be treated accordingly. If you *do* understand -the memo in question, but have absolutely nothing of substance to say, then -you have an excellent opportunity for a vicious ad hominem attack. In fact, -the only *inappropriate* times for an ad hominem attack are as follows: - - 1: When you agree completely with the author of a memo. - 2: When the author of the original memo is much bigger than you are. - 3: When replying to one of your own memos. -% -FORTUNE'S RULES TO LIVE BY: #2 - - Never goose a wolverine. -% -FORTUNE'S RULES TO LIVE BY: #23 - - Don't cut off a police car when making an illegal U-turn. -% -Forty isn't old, if you're a tree. -% -Four be the things I am wiser to know: - Idleness, sorrow, a friend, and a foe. - -Four be the things I'd been better without: - Love, curiosity, freckles, and doubt. - -Three be the things I shall never attain: - Envy, content, and sufficient champagne. - -Three be the things I shall have till I die: - Laughter and hope and a sock in the eye. - -- Dorothy Parker, "Inventory" -% -Four fifths of the perjury in the world is expended on -tombstones, women and competitors. - -- Lord Thomas Robert Dewar -% -Four hours to bury the cat? -Yes, damn thing wouldn't keep still, kept mucking about, 'owling... -% -Fourteen years in the professor dodge has taught me that one can argue -ingeniously on behalf of any theory, applied to any piece of literature. -This is rarely harmful, because normally no-one reads such essays. - -- Robert Parker, quoted in "Murder Ink", ed. D. Wynn -% -Fourth Law of Applied Terror: - The night before the English History mid-term, your Biology - instructor will assign 200 pages on planaria. - -Corollary: - Every instructor assumes that you have nothing else to do except - study for that instructor's course. -% -Fourth Law of Revision: - It is usually impractical to worry beforehand about - interferences -- if you have none, someone will make one - for you. -% -Fourth Law of Thermodynamics: If the probability of success is not -almost one, it is damn near zero. - -- David Ellis -% -Frankfort, Kentucky, makes it against the law to shoot off a -policeman's tie. -% -Frankly, Scarlett, I don't have a fix. - -- Rhett Buggler -% -Fraud is the homage that force pays to reason. - -- Charles Curtis, "A Commonplace Book" -% -Free Speech Is The Right To Shout "Theater" In A Crowded Fire. - -- A Yippie proverb -% -FreeBSD: everything but the fairings -% -FreeBSD: Have you had your fairings today? -% -FreeBSD: It's 3am at night. Do you know where your fairings are? -% -FreeBSD: putting the horse before the cart since 1992. - -- Warner Losh -% -FreeBSD Trivia: - Did you know that successive security officers take -control by beheading their predecessor? - -- Robert Watson -% -Freedom begins when you tell Mrs. Grundy to go fly a kite. -% -Freedom from incrustation of grime is contiguous to rectitude. -% -Freedom is nothing else but the chance to do better. - -- Camus -% -Freedom is slavery. -Ignorance is strength. -War is peace. - -- George Orwell -% -Freedom of the press is for those who happen to own one. -% -Freedom's just another word for nothing left to lose. - -- Kris Kristofferson, "Me and Bobby McGee" -% -Fremen add life to spice! -% -Fresco's Discovery: - If you knew what you were doing you'd probably be bored. -% -Friction is a drag. -% -Fried's 1st Rule: - Increased automation of clerical function - invariably results in increased operational costs. -% -Friends may come and go, but enemies accumulate. - -- Thomas Jones -% -Friends, n.: - People who borrow your books and set wet glasses on them. - - People who know you well, but like you anyway. -% -Friends, Romans, Hipsters, -Let me clue you in; -I come to put down Caesar, not to groove him. -The square kicks some cats are on stay with them; -The hip bits, like, go down under; so let it lay with Caesar. The cool Brutus -Gave you the message: Caesar had big eyes; -If that's the sound, someone's copping a plea, -And, like, old Caesar really set them straight. -Here, copacetic with Brutus and the studs, -- for Brutus is a real cool cat; -So are they all, all cool cats, -- -Come I to make this gig at Caesar's laying down. -% -Friendships last when each friend thinks he has a slight superiority -over the other. - -- Honore de Balzac -% -Frisbeetarianism, n.: - The belief that when you die, your soul goes up on the roof and - gets stuck. -% -Frobnicate, v.: - To manipulate or adjust, to tweak. Derived from FROBNITZ. -Usually abbreviated to FROB. Thus one has the saying "to frob a -frob". See TWEAK and TWIDDLE. Usage: FROB, TWIDDLE, and TWEAK -sometimes connote points along a continuum. FROB connotes aimless -manipulation; TWIDDLE connotes gross manipulation, often a coarse -search for a proper setting; TWEAK connotes fine-tuning. If someone is -turning a knob on an oscilloscope, then if he's carefully adjusting it -he is probably tweaking it; if he is just turning it but looking at the -screen he is probably twiddling it; but if he's just doing it because -turning a knob is fun, he's frobbing it. -% -Frobnitz, pl. Frobnitzem (frob'nitsm) n.: - An unspecified physical object, a widget. Also refers to -electronic black boxes. This rare form is usually abbreviated to -FROTZ, or more commonly to FROB. Also used are FROBNULE, FROBULE, and -FROBNODULE. Starting perhaps in 1979, FROBBOZ (fruh-bahz'), pl. -FROBBOTZIM, has also become very popular, largely due to its exposure -via the Adventure spin-off called Zork (Dungeon). These can also be -applied to non-physical objects, such as data structures. -% -From 0 to "what seems to be the problem officer" in 8.3 seconds. - -- Ad for the new VW Corrado -% -From a certain point onward there is no longer any turning back. -That is the point that must be reached. - -- F. Kafka -% -From a Tru64 patch description: - - Fixes a bug that causes a panic due to software error -% -[From an announcement of a congress of the International Ontopsychology -Association, in Rome]: - -The Ontopsychological school, availing itself of new research criteria -and of a new telematic epistemology, maintains that social modes do not -spring from dialectics of territory or of class, or of consumer goods, -or of means of power, but rather from dynamic latencies capillarized in -millions of individuals in system functions which, once they have -reached the event maturation, burst forth in catastrophic phenomenology -engaging a suitable stereotype protagonist or duty marionette (general, -president, political party, etc.) to consummate the act of social -schizophrenia in mass genocide. -% -From Italian tourist guide: - - "Non stop trains to Roma Termini Station leave from 7.38 - a.m. to 10.08 p.m., hourly." -% -From listening comes wisdom and from speaking repentance. -% -From the cradle to the coffin underwear comes first. - -- Bertolt Brecht -% -From the crystal swirling waters, -Of the Rio Amazon, -To the sacred halls of Bayonne, -Where we stand pajamas on. (It's the only thing that rhymes.) -From ev'ry hallowed venue, -Ev'ry forest, mount and vale, -Your butt is on the menu -And the check is in the mail. - -- The Piranha Club Anthem, to the tune of "De Camptown Races" -% -From the moment I picked your book up until I put it down I was -convulsed with laughter. Some day I intend reading it. - -- Groucho Marx, from "The Book of Insults" -% -[From the operation manual for the CI-300 Dot Matrix Line Printer, made -in Japan]: - -The excellent output machine of MODEL CI-300 as extraordinary DOT -MATRIX LINE PRINTER, built in two MICRO-PROCESSORs as well as EAROM, is -featured by permitting wonderful co-existence such as; "high quality -against low cost", "diversified functions with compact design", -"flexibility in accessibleness and durability of approx. 2000,000,00 -Dot/Head", "being sophisticated in mechanism but possibly agile -operating under noises being extremely suppressed" etc. - -And as a matter of course, the final goal is just simply to help -achieve "super shuttle diplomacy" between cool data, perhaps earned by -HOST COMPUTER, and warm heart of human being. -% -From the pages of Open Systems Today - October 13, 1994 .......... - - "The International Standards Organization (ISO) and the - International Electrotechnical Commission (IEC) designated - October 14 as World Standards Day to recognize those - volunteers who have worked hard to define international - standards.......The United States celebrated World Standards - Day on October 11; Finland celebrated on October 13; and - Italy celebrated on October 18." -% -From the Pointless Comparison Collection: - - To give you an idea of how sensitive these antennas are, - if we were to "listen" to one spacecraft in the outer solar - system by Jupiter or Saturn for 1 billion years and add up - all the signal we collected, it would be enough power to - set off the flash bulb on your camera once. - - -- Peter Doms, manager of the Deep Space Network - systems program at JPL -% -From the Pro 350 Pocket Service Guide, p. 49, Step 5 of the -instructions on removing an I/O board from the card cage, comes a new -experience in sound: - - 5. Turn the handle to the right 90 degrees. The pin-spreading - sound is normal for this type of connector. -% -From too much love of living, -From hope and fear set free, -We thank with brief thanksgiving, -Whatever gods may be, -That no life lives forever, -That dead men rise up never, -That even the weariest river winds somewhere safe to sea. - -- Swinburne -% -Fuch's Warning: - If you actually look like your passport photo, you aren't well - enough to travel. -% -Fudd's First Law of Opposition: - Push something hard enough and it will fall over. -% -Fun experiments: - Get a can of shaving cream, throw it in a freezer for about a week. - Then take it out, peel the metal off and put it where you want... - bedroom, car, etc. As it thaws, it expands an unbelievable amount. -% -Fun Facts, #14: - In table tennis, whoever gets 21 points first wins. That's how - it once was in baseball -- whoever got 21 runs first won. -% -Fun Facts, #63: - The name California was given to the state by Spanish conquistadores. - It was the name of an imaginary island, a paradise on earth, in the - Spanish romance, "Les Serges de Esplandian", written by Montalvo in - 1510. -% -Function reject. -% -Fundamentally, there may be no basis for anything. -% -Furbling, v.: - Having to wander through a maze of ropes at an airport or bank - even when you are the only person in line. - -- Rich Hall, "Sniglets" -% -Furious activity is no substitute for understanding. - -- H. H. Williams -% -Furthermore, if we send something by car, it's a shipment... -but if we send it by ship, it's cargo. -% -Future looks spotty. You will spill soup in late evening. -% -Future will arrive by its own means. Progress not so. - -- Poul Henningsen (1894-1967) -% -G. B. Shaw to William Douglas Home: "Go on writing plays, my boy. One -of these days a London producer will go into his office and say to his -secretary, `Is there a play from Shaw this morning?' and when she says -`No,' he will say, `Well, then we'll have to start on the rubbish.' And -that's your chance, my boy." -% -Gaiety is the most outstanding feature of the Soviet Union. - -- Joseph Stalin -% -Galbraith's Law of Human Nature: - Faced with the choice between changing one's mind and proving that - there is no need to do so, almost everybody gets busy on the proof. -% -Garbage In - Gospel Out. -% -Garter, n.: - An elastic band intended to keep a woman from coming out of her - stockings and desolating the country. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Gauls! We have nothing to fear; except perhaps that the sky may fall on -our heads tomorrow. But as we all know, tomorrow never comes!! - -- Adventures of Asterix -% -Gay shlafen: Yiddish for "go to sleep". - - Now doesn't "gay shlafen" have a softer, more soothing sound -than the harsh, staccato "go to sleep"? Listen to the difference: - "Go to sleep, you little wretch!" ... "Gay shlafen, darling." -Obvious, isn't it? - Clearly the best thing you can do for you children is to start -speaking Yiddish right now and never speak another word of English as -long as you live. This will, of course, entail teaching Yiddish to all -your friends, business associates, the people at the supermarket, and -so on, but that's just the point. It has to start with committed -individuals and then grow ... - Some minor adjustments will have to be made, of course: those -signs written in what look like Yiddish letters won't be funny when -everything is written in Yiddish. And we'll have to start driving on -the left side of the road so we won't be reading the street signs -backwards. But is that too high a price to pay for world peace? I -think not, my friend, I think not. - -- Arthur Naiman, "Every Goy's Guide to Yiddish" -% -GEMINI (May 21 - June 20) - A day to take the initiative. Put the garbage out, for - instance, and pick up the stuff at the dry cleaners. Watch - the mail carefully, although there won't be anything good - in it today, either. -% -GEMINI (May 21 to Jun. 20) - Good news and bad news highlighted. Enjoy the good news while you - can; the bad news will make you forget it. You will enjoy praise - and respect from those around you; everybody loves a sucker. A short - trip is in the stars, possibly to the men's room. -% -Genderplex, n.: - The predicament of a person in a restaurant who is unable to - determine his or her designated restroom (e.g., turtles and - tortoises). - -- Rich Hall, "Sniglets" -% -Genealogy, n.: - An account of one's descent from an ancestor - who did not particularly care to trace his own. - -- Ambrose Bierce, "The Devil's Dictionary" -% -General notions are generally wrong. - -- Lady M. W. Montagu -% -Generally speaking, the Way of the warrior is resolute acceptance of death. - -- Miyamoto Musashi, 1645 -% -Generally speaking, you aren't learning much when your lips are moving. -% -Generic Fortune. -% -Generosity and perfection are your everlasting goals. -% -Genetics explains why you look like your father, -and if you don't, why you should. -% -GENIUS: - Person clever enough to be born in the right place at the right - time of the right sex and to follow up this advantage by saying - all the right things to all the right people. -% -Genius does what it must, and Talent does what it can. - -- Owen Meredith -% -Genius is one percent inspiration and ninety-nine percent perspiration. - -- Thomas Alva Edison -% -Genius is pain. - -- John Lennon -% -Genius is ten percent inspiration and fifty percent capital gains. -% -Genius is the talent of a person who is dead. -% -Genius may have its limitations, but stupidity is not thus handicapped. - -- Elbert Hubbard -% -Genius, n.: - A chemist who discovers a laundry additive that rhymes with - "bright". -% -Genlock, n.: - Why he stays in the bottle. -% -Gentlemen, - Whilst marching from Portugal to a position which commands the approach -to Madrid and the French forces, my officers have been diligently complying -with your requests which have been sent by H.M. ship from London to Lisbon and -thence by dispatch to our headquarters. - We have enumerated our saddles, bridles, tents and tent poles, and all -manner of sundry items for which His Majesty's Government holds me accountable. -I have dispatched reports on the character, wit, and spleen of every officer. -Each item and every farthing has been accounted for, with two regrettable -exceptions for which I beg your indulgence. - Unfortunately the sum of one shilling and ninepence remains unaccounted -for in one infantry battalion's petty cash and there has been a hideous -confusion as to the number of jars of raspberry jam issued to one cavalry -regiment during a sandstorm in western Spain. This reprehensible carelessness -may be related to the pressure of circumstance, since we are war with France, a -fact which may come as a bit of a surprise to you gentlemen in Whitehall. - This brings me to my present purpose, which is to request elucidation of -my instructions from His Majesty's Government so that I may better understand -why I am dragging an army over these barren plains. I construe that perforce it -must be one of two alternative duties, as given below. I shall pursue either -one with the best of my ability, but I cannot do both: - 1. To train an army of uniformed British clerks in Spain for the benefit -of the accountants and copy-boys in London or perchance: - 2. To see to it that the forces of Napoleon are driven out of Spain. - -- Duke of Wellington, to the British Foreign Office, - London, 1812 -% -Gentlemen do not read each other's mail. - -- Secretary of State Henry Stimson, on closing down - the Black Chamber, the precursor to the National - Security Agency. -% -Genuine happiness is when a wife sees a double chin on her husband's -old girl friend. -% -George Bernard Shaw once sent two tickets to the opening night of one of -his plays to Winston Churchill with the following note: - "Bring a friend, if you have one." - -Churchill wrote back, returning the two tickets and excused himself as he -had a previous engagement. He also attached the following: - "Please send me two tickets for the next night, if there is one." -% -George Orwell 1984. Northwestern 0. - -- Chicago Reader 10/15/82 -% -George Orwell was an optimist. -% -George Washington was first in war, first in peace -- and the first to -have his birthday juggled to make a long weekend. - -- Ashley Cooper -% -George's friend Sam had a dog who could recite the Gettysburg Address. "Let -me buy him from you," pleaded George after a demonstration. - "Okay," agreed Sam. "All he knows is that Lincoln speech anyway." - At his company's Fourth of July picnic, George brought his new pet -and announced that the animal could recite the entire Gettysburg Address. -No one believed him, and they proceeded to place bets against the dog. -George quieted the crowd and said, "Now we'll begin!" Then he looked at -the dog. The dog looked back. No sound. "Come on, boy, do your stuff." -Nothing. A disappointed George took his dog and went home. - "Why did you embarrass me like that in front of everybody?" George -yelled at the dog. "Do you realize how much money you lost me?" - "Don't be silly, George," replied the dog. "Think of the odds we're -gonna get on Labor Day." -% -(German philosopher) Georg Wilhelm Hegel, on his deathbed, complained, "Only -one man ever understood me." He fell silent for a while and then added, -"And he didn't understand me." -% -Gerrold's Laws of Infernal Dynamics: - 1) An object in motion will always be headed in the wrong direction. - 2) An object at rest will always be in the wrong place. - 3) The energy required to change either one of these states - will always be more than you wish to expend, but never so - much as to make the task totally impossible. -% -Get forgiveness now -- tomorrow you may no longer feel guilty. -% -Get in touch with your feelings of hostility against the dying light. - -- Dylan Thomas -% -Get Revenge! Live long enough to be a problem for your children! -% -Getting into trouble is easy. - -- D. Winkel and F. Prosser -% -Getting kicked out of the American Bar Association is liked getting kicked -out of the Book-of-the-Month Club. - -- Melvin Belli on the occasion of his getting kicked out - of the American Bar Association -% -Getting the job done is no excuse for not following the rules. - -Corollary: - Following the rules will not get the job done. -% -Getting there is only half as far as getting there and back. -% -Gibson's Springtime Song (to the tune of "Deck the Halls"): - -'Tis the season to chase mousies (Fa la la la la, la la la la) -Snatch them from their little housies (...) -First we chase them 'round the field (...) -Then we have them for a meal (...) - -Toss them here and catch them there (...) -See them flying through the air (...) -Watch them fly and hear them squeal (...) -Falling mice have great appeal (...) - -See the hunter stretched before us (...) -He's chased the mice in field and forest (...) -Watch him clean his long white whiskers (...) -Of the blood of little critters (...) -% -Gilbert's Discovery: - Any attempt to use the new super glues results in the two pieces - sticking to your thumb and index finger rather than to each other. -% -Gil-galad was an Elven-King -of him the harpers sadly sing; -the last whose realm was fair and free -between the Mountains and the Sea. - -His sword was long, his lance was keen, -his shining helm afar was seen; -the countless stars of heaven's field -were mirrored in his silver shield. - -But long ago he rode away, -and where he dwelleth none can say; -for into darkness fell his star -in Mordor where the shadows are. -% -Ginger Snap -% -Ginsberg's Theorem: - 1. You can't win. - 2. You can't break even. - 3. You can't even quit the game. - -Freeman's Commentary on Ginsberg's theorem: - Every major philosophy that attempts to make life seem - meaningful is based on the negation of one part of Ginsberg's - Theorem. To wit: - - 1. Capitalism is based on the assumption that you can win. - 2. Socialism is based on the assumption that you can break even. - 3. Mysticism is based on the assumption that you can quit the game. -% -Ginsburg's Law: - At the precise moment you take off your shoe in a shoe store, your - big toe will pop out of your sock to see what's going on. -% -GIVE: Support the helpless victims of computer error. -% -Give a man a fish and he will eat for a day. Teach him how to fish, -and he will sit in a boat and drink beer all day. -% -Give a man a fish, and you feed him for a day. -Teach a man to fish, and he'll invite himself over for dinner. - -- Calvin Keegan -% -Give a small boy a hammer and he will find -that everything he encounters needs pounding. -% -Give a woman an inch and she'll park a car in it. -% -Give all orders verbally. Never write anything down -that might go into a "Pearl Harbor File". -% -Give him an evasive answer. -% -Give me a fish and I will eat today. -Teach me to fish and I will eat forever. -% -Give me a Plumber's friend the size of the Pittsburgh -dome, and a place to stand, and I will drain the world. -% -Give me a sleeping pill and tell me your troubles. -% -Give me chastity and continence, but not just now. - -- St. Augustine -% -Give me enough medals, and I'll win any war. - -- Napoleon -% -Give me libertines or give me meth. -% -Give me the avowed, the erect, the manly foe, -Bold I can meet -- perhaps may turn his blow! -But of all plagues, good Heaven, thy wrath can send, -Save me, oh save me from the candid friend. - -- George Canning -% -Give me your students, your secretaries, -Your huddled writers yearning to breathe free, -The wretched refuse of your Selectric III's. -Give these, the homeless, typist-tossed to me. -I lift my disk beside the processor. - -- Inscription on a Word Processor -% -Give thought to your reputation. -Consider changing your name and moving to a new town. -% -GIVE UP!!!! -% -Give your child mental blocks for Christmas. -% -Give your very best today. -Heaven knows it's little enough. -% -Given a choice between grief and nothing, I'd choose grief. - -- William Faulkner -% -Given its constituency, the only thing I expect to be "open" about [the -Open Software Foundation] is its mouth. - -- John Gilmore -% -Given my druthers, I'd druther not. -% -Given sufficient time, what you put -off doing today will get done by itself. -% -Given the choice between accomplishing something and just lying around, I'd -rather lie around. No contest. - -- Eric Clapton -% -Giving money and power to governments is like giving whiskey and -car keys to teenage boys. - -- P. J. O'Rourke -% -Giving up on assembly language was the apple in our Garden of Eden: Languages -whose use squanders machine cycles are sinful. The LISP machine now permits -LISP programmers to abandon bra and fig-leaf. - -- Epigrams in Programming, ACM SIGPLAN Sept. 1982 -% -Gleemites, n.: - Petrified deposits of toothpaste found in sinks. - -- Rich Hall & Friends, "Sniglets" -% -Glib's Fourth Law of Unreliability: - Investment in reliability will increase until it exceeds the - probable cost of errors, or until someone insists on getting - some useful work done. -% -Gloffing is a state of mine. -% -Glogg (a traditional Scandinavian holiday drink): - fifth of dry red wine - fifth of Aquavit - 1 and 1/2 inch piece of cinnamon - 10 cardamom seeds - 1 cup raisins - 4 dried figs - 1 cup blanched or flaked almonds - a few pieces of dried orange peel - 5 cloves - 1/2 lb. sugar cubes - Heat up the wine and hard stuff (which may be substituted with wine -for the faint of heart) in a big pot after adding all the other stuff EXCEPT -the sugar cubes. Just when it reaches boiling, put the sugar in a wire -strainer, moisten it in the hot brew, lift it out and ignite it with a match. -Dip the sugar several times in the liquid until it is all dissolved. Serve -hot in cups with a few raisins and almonds in each cup. - N.B. Aquavit may be hard to find and expensive to boot. Use it only -if you really have a deep-seated desire to be fussy, or if you are of Swedish -extraction. -% -Gnagloot, n.: - A person who leaves all his ski passes on his jacket just to - impress people. - -- Rich Hall, "Sniglets" -% -Go ahead, make my day. - -- (Dirty) Harry Callahan -% -Go away, I'm all right. - -- H. G. Wells' last words -% -Go away! Stop bothering me with all your -"compute this ... compute that"! I'm taking a VAX-NAP. - -logout -% -Go climb a gravity well. -% -Go directly to jail. Do not pass Go, do not collect $200. -% -Go not to the elves for counsel, for they will say both yes and no. - -- J. R. R. Tolkien -% -Go out and tell a lie that will make the whole family proud of you. - -- Cadmus, to Pentheus, in "The Bacchae" by Euripides -% -Go placidly amid the noise and waste, and remember what value there may -be in owning a piece thereof. - -- National Lampoon, "Deteriorata" -% -Go slowly to the entertainments of thy friends, -but quickly to their misfortunes. - -- Chilo -% -Go to a movie tonight. -Darkness becomes you. -% -Go to the Scriptures... the joyful promises it contains will be a balsam to -all your troubles. - -- Andrew Jackson - -The foundations of our society and our government rest so much on the -teachings of the Bible that it would be difficult to support them if faith -in these teachings would cease to be practically universal in our country. - -- Calvin Coolidge - -Lastly, our ancestors established their system of government on morality and -religious sentiment. Moral habits, they believed, cannot safely be trusted -on any other foundation than religious principle, nor any government be -secure which is not supported by moral habits. - -- Daniel Webster -% -Go 'way! You're bothering me! -% -Goals... Plans... they're fantasies, they're part of a dream world... - -- Wally Shawn -% -GOD: - Darwin's chief rival. -% -God created a few perfect heads. -The rest he covered with hair. -% -God created woman. -And boredom did indeed cease from that moment -- -but many other things ceased as well. -Woman was God's second mistake. - -- Friedrich Nietzsche -% -God did not create the world in seven days; he screwed around for six -days and then pulled an all-nighter. -% -God gave man two ears and one tongue so -that we listen twice as much as we speak. - -- Arab proverb -% -"God gives burdens; also shoulders." - -Jimmy Carter cited this Jewish saying in his concession speech at the -end of the 1980 election. At least he said it was a Jewish saying; I -can't find it anywhere. I'm sure he's telling the truth though; why -would he lie about a thing like that? - -- Arthur Naiman, "Every Goy's Guide to Yiddish" -% -God grant us the serenity to accept the things we cannot change, courage to -change the things we can, and wisdom to know the difference. -% -God has intended the great to be great and the little to be little... -The trade unions, under the European system, destroy liberty [...] I do -not mean to say that a dollar a day is enough to support a workingman... -not enough to support a man and five children if he insists on smoking -and drinking beer. But the man who cannot live on bread and water is -not fit to live! A family may live on good bread and water in the -morning, water and bread at midday, and good bread and water at night! - -- Rev. Henry Ward Beecher -% -God help the troubadour who tries to be a star. The more -that you try to find success, the more that you will fail. - -- Phil Ochs, on the Second System Effect -% -God help those who do not help themselves. - -- Wilson Mizner -% -God helps them that helps themselves. - -- Benjamin Franklin -% -God, I ask for patience -- and I want it right now! -% -God instructs the heart, not by ideas, -but by pains and contradictions. - -- De Caussade -% -God is a comic playing to an audience that's afraid to laugh. -% -God is Dead. - -- Nietzsche -Nietzsche is Dead. - -- God -Nietzsche is God. - -- The Dead -% -God is dead and I don't feel all too well either.... - -- Ralph Moonen -% -God is love, but get it in writing. - -- Gypsy Rose Lee -% -God is not dead. He is alive and well and working on a -much less ambitious project. -% -God is real, unless declared integer. -% -God is really only another artist. He invented the giraffe, the -elephant and the cat. He has no real style, He just goes on trying -other things. - -- Pablo Picasso -% -God is the tangential point between zero and infinity. - -- Alfred Jarry -% -God isn't dead. He just doesn't want to get involved. -% -God made everything out of nothing, but the nothingness shows through. - -- Paul Valery -% -God made machine language; all the rest is the work of man. -% -God made the integers; all else is the work of Man. - -- Kronecker -% -God may be subtle, but He isn't plain mean. - -- Albert Einstein -% -God must have loved calories, she made so many of them. -% -God must love the Common Man; He made so many of them. -% -God rest ye CS students now, The bearings on the drum are gone, -Let nothing you dismay. The disk is wobbling, too. -The VAX is down and won't be up, We've found a bug in Lisp, and Algol -Until the first of May. Can't tell false from true. -The program that was due this morn, And now we find that we can't get -Won't be postponed, they say. At Berkeley's 4.2. -(chorus) (chorus) - -We've just received a call from DEC, And now some cheery news for you, -They'll send without delay The network's also dead, -A monitor called RSuX We'll have to print your files on -It takes nine hundred K. The line printer instead. -The staff committed suicide, The turnaround time's nineteen weeks. -We'll bury them today. And only cards are read. -(chorus) (chorus) - -And now we'd like to say to you CHORUS: Oh, tidings of comfort and joy, -Before we go away, Comfort and joy, -We hope the news we've brought to you Oh, tidings of comfort and joy. -Won't ruin your whole day. -You've got another program due, tomorrow, by the way. -(chorus) - -- to God Rest Ye Merry Gentlemen -% -God runs electromagnetics by wave theory on Monday, Wednesday, and Friday, -and the Devil runs them by quantum theory on Tuesday, Thursday, and Saturday. - -- William Bragg -% -God said it, I believe it and that's all there is to it. -% -God save us from a bad neighbor and a beginner on the fiddle. -% -God shows his contempt for wealth by the kind of person he selects -to receive it. - -- Austin O'Malley -% -God votes Republican. -% -God was satisfied with his own work, and that is fatal. - -- Samuel Butler -% -Goda's Truism: - By the time you get to the point where you can make ends meet, - somebody moves the ends. -% -Going the speed of light is bad for your age. -% -Going to church does not make a person religious, nor does going to school -make a person educated, any more than going to a garage makes a person a car. -% -Gold, n.: - A soft malleable metal relatively scarce in distribution. It - is mined deep in the earth by poor men who then give it to rich - men who immediately bury it back in the earth in great prisons, - although gold hasn't done anything to them. - -- Mike Harding, "The Armchair Anarchist's Almanac" -% -Goldenstern's Rules: - 1. Always hire a rich attorney. - 2. Never buy from a rich salesman. -% -Goldfish... what stupid animals. Even Wayne Cody stops -eating before he bursts. -% -Gold's Law: - If the shoe fits, it's ugly. -% -Gomme's Laws: - (1) A backscratcher will always find new itches. - (2) Time accelerates. - (3) The weather at home improves as soon as you go away. -% -Gone With The Wind LITE(tm) - -- by Margaret Mitchell - - A woman only likes men she can't have and the South gets trashed. - -Gift of the Magii LITE(tm) - -- by O. Henry - - A husband and wife forget to register their gift preferences. - -The Old Man and the Sea LITE(tm) - -- by Ernest Hemingway - - An old man goes fishing, but doesn't have much luck. - -Diary of a Young Girl LITE(tm) - -- by Anne Frank - - A young girl hides in an attic but is discovered. -% -Good advice is one of those insults that ought to be forgiven. -% -Good day for a change of scene. Repaper the bedroom wall. -% -Good day for business affairs. -Make a pass at that the new file clerk. -% -Good day for overcoming obstacles. Try a steeplechase. -% -Good day to avoid cops. Crawl to school. -% -Good day to avoid cops. Crawl to work. -% -Good day to deal with people in high places; -particularly lonely stewardesses. -% -Good day to let down old friends who need help. -% -Good evening, gentlemen. I am a HAL 9000 computer. I became operational -at the HAL plant in Urbana, Illinois, on January 11th, nineteen hundred -ninety-five. My supervisor was Mr. Langley, and he taught me to sing a -song. If you would like, I could sing it for you. -% -Good girls go to heaven, bad girls go everywhere. -% -Good government never depends upon laws, but upon the personal qualities of -those who govern. The machinery of government is always subordinate to the -will of those who administer that machinery. The most important element of -government, therefore, is the method of choosing leaders. - -- Frank Herbert, "Children of Dune" -% -"Good health" is merely the slowest rate at which one can die. -% -Good judgment comes from experience. -Experience comes from bad judgment. - -- Jim Horning -% -Good leaders being scarce, following yourself is allowed. -% -Good morning. This is the telephone company. Due to repairs, we're -giving you advance notice that your service will be cut off indefinitely -at ten o'clock. That's two minutes from now. -% -Good news. Ten weeks from Friday will be a pretty good day. -% -Good news from afar can bring you a welcome visitor. -% -Good news is just life's way of keeping you off balance. -% -Good night, Austin, Texas, wherever you are! -% -Good night, Mrs. Calabash, wherever you are. -% -Good night to spend with family, but avoid arguments with your mate's -new lover. -% -Good salesmen and good repairmen will never go hungry. - -- R. E. Schenk -% -Good teaching is one-fourth preparation and three-fourths good theatre. - -- Gail Godwin -% -Good-bye. I am leaving because I am bored. - -- George Saunders' dying words -% -Goodbye, cool world. -% -Goose pimples rose all over me, my hair stood on end, my eyes filled with -tears of love and gratitude for this greatest of all conquerors of human -misery and shame, and my breath came in little gasps. If I had not known -that the Leader would have scorned such adulation, I might have fallen to -my knees in unashamed worship, but instead I drew myself to attention, raised -my arm in the eternal salute of the ancient Roman Legions and repeated the -holy words, "Heil Hitler!" - -- George Lincoln Rockwell -% -Gordon's first law: - If a research project is not worth doing, it is not worth doing - well. -% -Gordon's Law: - If you think you have the solution, the question was poorly phrased. -% -Gosh that takes me back... or is it forward? That's the trouble with -time travel, you never can tell. - -- The Doctor, "Doctor Who: Androids of Tara" -% -Gossip, n.: - Hearing something you like about someone you don't. - -- Earl Wilson -% -//GO.SYSIN DD *, DOODAH, DOODAH -% -Got a complaint about the Internal Revenue Service? -Call the convenient toll-free "IRS Taxpayer Complaint Hot Line Number": - - 1-800-AUDITME -% -Got a dictionary? I want to know the meaning of life. -% -Got a wife and kids in Baltimore Jack, -I went out for a ride and never came back. -Like a river that don't know where it's flowing, -I took a wrong turn and I just kept going. - - Everybody's got a hungry heart. - Everybody's got a hungry heart. - Lay down your money and you play your part, - Everybody's got a hungry heart. - -I met her in a Kingstown bar, -We fell in love, I knew it had to end. -We took what we had and we ripped it apart, -Now here I am down in Kingstown again. - -Everybody needs a place to rest, -Everybody wants to have a home. -Don't make no difference what nobody says, -Ain't nobody likes to be alone. - -- Bruce Springsteen, "Hungry Heart" -% -Got Mole problems? -Call Avogadro at 6.02 x 10^23. -% -Goto, n.: - A programming tool that exists to allow structured programmers - to complain about unstructured programmers. - -- Ray Simard -% -Gourmet, n.: - Anyone whom, when you fail to finish something strange or - revolting, remarks that it's an acquired taste and that you're - leaving the best part. -% -Govern a great nation as you would cook a small fish. Don't overdo it. - -- Lao Tsu -% -Government [is] an illusion the governed should not encourage. - -- John Updike, "Couples" -% -Government lies, and newspapers lie, but in a democracy they are -different lies. -% -Government spending? I don't know what it's all about. I don't know any -more about this thing than an economist does, and, God knows, he doesn't -know much. - -- The Best of Will Rogers -% -Government's Law: - There is an exception to all laws. -% -Governor Tarkin. I should have expected to find you holding Vader's -leash. I thought I recognized your foul stench when I was brought on -board. - -- Princess Leia Organa -% -Grabel's Law: - 2 is not equal to 3 -- not even for large values of 2. -% -Graduate life -- it's not just a job, it's an indenture. -% -Graduate students and most professors are -no smarter than undergrads. They're just older. -% -Grand Master Turing once dreamed that he was a machine. When he awoke -he exclaimed: - "I don't know whether I am Turing dreaming that I am a machine, - or a machine dreaming that I am Turing!" - -- Geoffrey James, "The Tao of Programming" -% -Grandpa Charnock's Law: - You never really learn to swear until you learn to drive. - - [I thought it was when your kids learned to drive. Ed.] -% -Graphics blind the eyes. -Audio files deafen the ear. -Mouse clicks numb the fingers. -Heuristics weaken the mind. -Options wither the heart. - -The Guru observes the net -but trusts his inner vision. -He allows things to come and go. -His heart is as open as the ether. -% -GRASSHOPPOTAMUS: - A creature that can leap to tremendous heights... once. -% -Gratitude, like love, is never a dependable international emotion. - -- Joseph Alsop -% -GRAVITY: - What you get when you eat too much and too fast. -% -Gravity brings me down. -% -Gray's Law of Programming: - 'n+1' trivial tasks are expected to be - accomplished in the same time as 'n' tasks. - -Logg's Rebuttal to Gray's Law: - 'n+1' trivial tasks take twice as long as 'n' trivial tasks. -% -Great acts are made up of small deeds. - -- Lao Tsu -% -Great American Axiom: - Some is good, more is better, too much is just right. -% -Great minds run in great circles. -% -GREAT MOMENTS IN AMERICAN HISTORY (#17): - -On November 13, Felix Unger was asked to remove himself from his -place of residence. -% -GREAT MOMENTS IN HISTORY (#7): April 2, 1751 - -Isaac Newton becomes discouraged when he falls up a flight of stairs. -% -GREAT MOMENTS IN HISTORY (#7): November 23, 1915 - -Pancake make-up is invented; most people continue to prefer syrup. -% -Great spirits have always encountered violent opposition from mediocre minds. - -- Albert Einstein - -They laughed at Einstein. They laughed at the Wright Brothers. But they -also laughed at Bozo the Clown. - -- Carl Sagan -% -Greatness is a transitory experience. It is never consistent. -% -Green light in A.M. for new projects. -Red light in P.M. for traffic tickets. -% -Greener's Law: - Never argue with a man who buys ink by the barrel. -% -Green's Law of Debate: -Anything is possible if you don't know what you're talking about. -% -Greenspun's Tenth Rule of Programming: - Any sufficiently complicated C or Fortran program contains - an ad hoc informally-specified bug-ridden slow implementation - of half of Common Lisp. -% -Grelb's Reminder: - Eighty percent of all people consider - themselves to be above average drivers. -% -grep me no patterns and I'll tell you no lines. -% -Grief can take care of itself; but to get the full -value of a joy you must have somebody to divide it with. - -- Mark Twain -% -Griffin's Thought: - When you starve with a tiger, the tiger starves last. -% -Grig (the navigator): - ... so you see, it's just the two of us against the entire space - armada. -Alex (the gunner): - What?!? -Grig: I've always wanted to fight a desperate battle against - overwhelming odds. -Alex: It'll be a slaughter! -Grig: That's the spirit! - -- The Last Starfighter -% -Grinnell's Law of Labor Laxity: - At all times, for any task, you have not got enough done today. -% -Groundhog Day has been observed only once in Los Angeles because when the -groundhog came out of its hole, it was killed by a mudslide. - -- Johnny Carson -% -Growing old isn't bad when you consider the alternatives. - -- Maurice Chevalier -% -Grownups are reluctant to take science fiction seriously, and with good -reason: sci-fi is a hormonal activity, not a literary one. Its traditional -concerns are all pubescent. Secondary sexual characteristics are everywhere, -disguised. Aliens have tentacles. Telepathy allows you to have sex without -any nasty inconvenience of touching. Womblike spaceships provide balanced -meals. No one ever has to grow old -- body parts are replaceable, like -Job's daughters, and if you're lucky you can become a robot. As for the -adult world, it's simply not there; political systems tend to be naively -authoritarian (there are more lords in science fiction than on public -television) and are often ruled by young boys on quests. The most popular -sci-fi book in years, Frank Herbert's Dune, sold millions of copies by -combining all these themes: it ends with its adolescent hero conquering the -universe while straddling a giant worm. - -- Arnold Klein -% -Grub first, then ethics. - -- Bertolt Brecht -% -GUILLOTINE: - A French chopping center. -% -Gumperson's Law: - The probability of a given event - occurring is inversely proportional to its desirability. -% -Guns don't kill people. Bullets kill people. -% -Gunter's Airborne Discoveries: - (1) When you are served a meal aboard an aircraft, - the aircraft will encounter turbulence. - (2) The strength of the turbulence - is directly proportional to the temperature of your coffee. -% -Gurmlish, n.: - The red warning flag at the top of a club sandwich which prevents - the person from biting into it and puncturing the roof of his mouth. - -- Rich Hall & Friends, "Sniglets" -% -GURU: - A person in T-shirt and sandals who took an elevator ride with - a senior vice-president and is ultimately responsible for the - phone call you are about to receive from your boss. -% -Guru, n.: - A computer owner who can read the manual. -% -Gyroscope, n.: - A wheel or disk mounted to spin rapidly about an axis and also -free to rotate about one or both of two axes perpendicular to each -other and the axis of spin so that a rotation of one of the two -mutually perpendicular axes results from application of torque to the -other when the wheel is spinning and so that the entire apparatus -offers considerable opposition depending on the angular momentum to any -torque that would change the direction of the axis of spin. - -- Webster's Seventh New Collegiate Dictionary -% -H: If a 'GOBLIN (HOB) waylays you, - Slice him up before he slays you. - Nothing makes you look a slob - Like running from a HOB'LIN (GOB). - -- The Roguelet's ABC -% -H. L. Mencken suffers from the hallucination that he is H. L. -Mencken -- there is no cure for a disease of that magnitude. - -- Maxwell Bodenheim -% -H. L. Mencken's Law: - Those who can -- do. - Those who can't -- teach. - -Martin's Extension: - Those who cannot teach -- administrate. - - [No, those who can't teach, teach here. Ed.] -% -Hacker, n.: - Originally, any person with a knack for coercing stubborn inanimate -things; hence, a person with a happy knack, later contracted by the mythical -philosopher Frisbee Frobenius to the common usage, "hack." - In olden times, upon completion of some particularly atrocious body -of coding that happened to work well, culpable programmers would gather in -a small circle around a first edition of Knuth's Best Volume I by candlelight, -and proceed to get very drunk while sporadically rending the following ditty: - - Hacker's Fight Song - - He's a Hack! He's a Hack! - He's a guy with the happy knack! - Never bungles, never shirks, - Always gets his stuff to work! - -All take a drink (important!) -% -Hackers are just a migratory life form with a tropism for computers. -% -Hacker's Guide To Cooking: -2 pkg. cream cheese (the mushy white stuff in silver wrappings that doesn't - really come from Philadelphia after all; anyway, about 16 oz.) -1 tsp. vanilla extract (which is more alcohol than vanilla and pretty - strong so this part you *GOTTA* measure) -1/4 cup sugar (but honey works fine too) -8 oz. Cool Whip (the fluffy stuff devoid of nutritional value that you - can squirt all over your friends and lick off...) -"Blend all together until creamy with no lumps." This is where you get to - join(1) all the raw data in a big buffer and then filter it through - merge(1m) with the -thick option, I mean, it starts out ultra lumpy - and icky looking and you have to work hard to mix it. Try an electric - beater if you have a cat(1) that can climb wall(1s) to lick it off - the ceiling(3m). -"Pour into a graham cracker crust..." Aha, the BUGS section at last. You - just happened to have a GCC sitting around under /etc/food, right? - If not, don't panic(8), merely crumble a rand(3m) handful of innocent - GCs into a suitable tempfile and mix in some melted butter. -"...and refrigerate for an hour." Leave the recipe's stdout in a fridge - for 3.6E6 milliseconds while you work on cleaning up stderr, and - by time out your cheesecake will be ready for stdin. -% -Hacker's Law: - The belief that enhanced understanding will necessarily stir a - nation to action is one of mankind's oldest illusions. -% -Hackers of the world, unite! -% -Hacker's Quicky #313: - Sour Cream -n- Onion Potato Chips - Microwave Egg Roll - Chocolate Milk -% -Hacking's just another word for nothing left to kludge. -% -Had he and I but met -By some old ancient inn, But ranged as infantry, -We should have sat us down to wet And staring face to face, -Right many a nipperkin! I shot at him as he at me, - And killed him in his place. -I shot him dead because -- -Because he was my foe, He thought he'd 'list, perhaps, -Just so: my foe of course he was; Off-hand-like -- just as I -- -That's clear enough; although Was out of work -- had sold his traps - No other reason why. -Yes; quaint and curious war is! -You shoot a fellow down -You'd treat, if met where any bar is -Or help to half-a-crown. - -- Thomas Hardy -% -Had I been present at the creation, I would have given some -useful hints for the better ordering of the universe. - -- Alfonso the Wise - - [Quoted in "VMS Internals and Data Structures", V4.4, when - referring to operating system initialization.] -% -Had this been an actual emergency, we would have -fled in terror, and you would not have been informed. -% -Hail to the sun god -He's such a fun god -Ra! Ra! Ra! -% -Hailing frequencies open, Captain. -% -Hain't we got all the fools in town on our side? And hain't that -a big enough majority in any town? - -- Mark Twain, "Huckleberry Finn" -% -Hale Mail Rule, The: - When you are ready to reply to a letter, you will lack at least - one of the following: - (a) A pen or pencil or typewriter. - (b) Stationery. - (c) Postage stamp. - (d) The letter you are answering. -% -Half a bee, philosophically, must ipso facto half not be. -But half the bee has got to be, vis-a-vis its entity. See? -But can a bee be said to be or not to be an entire bee, -When half the bee is not a bee, due to some ancient injury? -% -Half Moon tonight. (At least it is better than no Moon at all.) -% -Half of being smart is knowing what you're dumb at. -% -Half the world is composed of people who have something to say and can't, -and the other half who have nothing to say and keep on saying it. -% -Half-done, n.: - This is the best way to eat a kosher dill -- when it's still crunchy, - light green, yet full of garlic flavor. The difference between this - and the typical soggy dark green cucumber corpse is like the - difference between life and death. - - You may find it difficult to find a good half-done kosher dill there - in Seattle, so what you should do is take a cab out to the airport, - fly to New York, take the JFK Express to Jay Street-Borough Hall, - transfer to an uptown F, get off at East Broadway, walk north on - Essex (along the park), make your first left onto Hester Street, walk - about fifteen steps, turn ninety degrees left, and stop. Say to the - man, "Let me have a nice half-done." Worth the trouble, wasn't it? - -- Arthur Naiman, "Every Goy's Guide to Yiddish" -% -Halley's Comet: It came, we saw, we drank. -% -Hall's Laws of Politics: - (1) The voters want fewer taxes and more spending. - (2) Citizens want honest politicians until they want - something fixed. - (3) Constituency drives out consistency (i.e., liberals defend - military spending, and conservatives social spending in - their own districts). -% -Hand, n.: - A singular instrument worn at the end of a human arm and - commonly thrust into somebody's pocket. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Handel's Proverb: - You can't produce a baby in one month by impregnating 9 women! -% -Handshaking protocol, n.: - A process employed by hostile hardware devices to initiate a - terse but civil dialogue, which, in turn, is characterized by - occasional misunderstanding, sulking, and name-calling. -% -Hanging on in quiet desperation is the English way. - -- Pink Floyd -% -Hangover, n.: - The wrath of grapes. -% -Hanlon's Razor: - Never attribute to malice - that which is adequately explained by stupidity. -% -Hanson's Treatment of Time: - There are never enough hours in a day, - but always too many days before Saturday. -% -Happiness adds and multiplies as we divide it with others. -% -Happiness is a hard disk. -% -Happiness is a positive cash flow. -% -Happiness is good health and a bad memory. - -- Ingrid Bergman -% -Happiness is having a scratch for every itch. - -- Ogden Nash -% -Happiness is just an illusion, filled with sadness and confusion. -% -Happiness is the greatest good. -% -Happiness is twin floppies. -% -Happiness isn't having what you want, it's wanting what you have. -% -Happiness isn't something you experience; it's something you remember. - -- Oscar Levant -% -Happiness makes up in height what it lacks in length. -% -Happiness, n.: - An agreeable sensation arising from contemplating the misery of - another. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Happiness, n.: - Finding the owner of a lost bikini. -% -Happy feast of the pig! -% -Happy is the child whose father died rich. -% -Hard, adj.: - The quality of your own data; also how it is to believe those - of other people. -% -Hard reality has a way of cramping your style. - -- Daniel Dennett -% -Hard work may not kill you, but why take the chance? -% -Hard work never killed anybody, but why take a chance? - -- Charlie McCarthy -% -Hardware, n.: - The parts of a computer system that can be kicked. -% -Hark, Hark, the dogs do bark -The Duke is fond of kittens -He likes to take their insides out -And use them for his mittens - -- "The 13 Clocks" -% -Hark, the Herald Tribune sings, -Advertising wondrous things. - -- Tom Lehrer -% -Hark ye, Clinker, you are a most notorious offender. You stand -convicted of sickness, hunger, wretchedness, and want. - -- Tobias Smollet -% -Harp not on that string. - -- William Shakespeare, "Henry VI" -% -Harriet's Dining Observation: - In every restaurant, the hardness of the butter pats - increases in direct proportion to the softness of the bread. -% -Harris had the beefstead pie between his knees, and was carving it, and George -and I were waiting with our plates ready. - "Have you got a spoon there?" says Harris; "I want a spoon to help -the gravy with." - The hamper was close behind us, and George and I both turned round to -reach one out. We were not five seconds getting it. When we looked round -again, Harris and the pie were gone! - It was a wide, open field. There was not a tree or a bit of hedge for -hundreds of yards. He could not have tumbled into the river, because we were -on the water side of him, and he would have had to climb over us to do it. - George and I gazed all about. Then we gazed at each other. - "Has he been snatched up to heaven?" I queried. - "They'd hardly have taken the pie, too," said George. - There seemed weight in this objection, and we discarded the heavenly -theory. - "I suppose the truth of the matter is," suggested George, descending -to the commonplace and practicable, "that there has been an earthquake." - And then he added, with a touch of sadness in his voice: "I wish he -hadn't been carving that pie." - -- Jerome K. Jerome, "Three Men In A Boat" -% -Harrisberger's Fourth Law of the Lab: - Experience is directly proportional to the amount of - equipment ruined. -% -Harrison's Postulate: -For every action, there is an equal and opposite criticism. -% -Harris's Lament: - All the good ones are taken. -% -Harry and Fred were playing their Sunday afternoon golf game. The game, as -always, was close. They were at the treacherous 12th hole: a par three that -required a perfect first shot over a large pond and onto a tiny green. There -were sand traps on the other three sides of the green, and a small road 50 -feet beyond it. Harry went first. He carefully addressed the ball and hit -a good shot that landed just on the edge of the green, narrowly avoiding the -pond. Just as Fred addressed his ball, he looked up and noticed a funeral -procession along the road just behind the green. Fred put down his club, -took his hat off, and waited for the entire procession to pass. As soon as -the cars were gone he put his hat back on and started addressing the ball -again. Harry said, "Damn, Fred. That was a really nice thing you did, -waiting for the funeral to pass like that." - Fred finished his swing, making perfect contact with the ball. It -was an excellent shot that landed 7 feet from the hole. "It's the least I -could do," he said, smiling at his shot, "We were married for 22 years, -you know." -% -Harry is heavily into camping, and every year in the late fall, he -makes us all go to Assateague, which is an island on the Atlantic Ocean -famous for its wild horses. I realize that the concept of wild horses -probably stirs romantic notions in many of you, but this is because you -have never met any wild horses in person. In person, they are like -enormous hooved rats. They amble up to your camp site, and their -attitude is: "We're wild horses. We're going to eat your food, knock -down your tent and poop on your shoes. We're protected by federal law, -just like Richard Nixon." - -- Dave Barry, "Tenting Grandpa Bob" -% -Harry's bar has a new cocktail. It's called MRS punch. They make it with -milk, rum and sugar and it's wonderful. The milk is for vitality and the -sugar is for pep. They put in the rum so that people will know what to do -with all that pep and vitality. -% -Hartley's First Law: - You can lead a horse to water, but if you can - get him to float on his back, you've got something. -% -Hartley's Second Law: - Never sleep with anyone crazier than yourself. - -My corollary: - The completely psychotic have all the fun. -% -Harvard Law: - Under the most rigorously controlled conditions of pressure, - temperature, volume, humidity, and other variables, the - organism will do as it damn well pleases. -% -HARVARD: -Quarterback: - Sophomore Dave Strewzinski... likes to pass. And pass he does, with -a record 86 attempts (three completions) in 87 plays.... Though Strewzinski -has so far failed to score any points for the Crimson, his jackrabbit speed -has made him the least sacked quarterback in the Ivy league. -Wide Receiver: - The other directional signal in Harvard's offensive machine is senior -Phil Yip, who is very fast. Yip is so fast that he has set a record for being -fast. Expect to see Yip elude all pursuers and make it into the endzone five -or six times, his average for a game. Yip, nicknamed "fumblefingers" and "you -asshole" by his teammates, hopes to carry the ball with him at least one of -those times. -YALE: -Defense: - On the defensive side, Yale boasts the stingiest line in the Ivies. -Primarily responsible are seniors Izzy "Shylock" Bloomberg and Myron -Finklestein, the tightest ends in recent Eli history. Also contributing to -the powerful defense is junior tackle Angus MacWhirter, a Scotsman who rounds -out the offensive ethnic joke. Look for these three to shut down the opening -coin toss. - -- Harvard Lampoon 1988 Program Parody, distributed at The Game -% -Has anyone ever tasted an "end"? Are they really bitter? -% -Has everyone noticed that all the letters of the word "database" are typed -with the left hand? Now the layout of the QWERTYUIOP typewriter keyboard -was designed, among other things, to facilitate the even use of both hands. -It follows, therefore, that writing about databases is not only unnatural, -but a lot harder than it appears. -% -Has the great art and mystery of politics no apparent utility? Does it -appear to be unqualifiedly ratty, raffish, sordid, obscene and low down, -and its salient virtuosi a gang of unmitigated scoundrels? Then let us -not forget its high capacity to soothe and tickle the midriff, its -incomparable services as a maker of entertainment. - -- H. L. Mencken, "A Carnival of Buncombe" -% -Haste makes waste. - -- John Heywood -% -Hatcheck girl: - "Goodness! What lovely diamonds!" -Mae West: - "Goodness had nothin' to do with it, dearie." - -- "Night After Night", 1932 -% -Hate is like acid. It can damage the vessel in which it is -stored as well as destroy the object on which it is poured. -% -Hate the sin and love the sinner. - -- Mahatma Gandhi -% -Hating the Yankees is as American as pizza pie, -unwed mothers and cheating on your income tax. - -- Mike Royko -% -Hatred, n.: - A sentiment appropriate to the occasion of another's - superiority. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Have a coke and a smile! - -- John DeLorean -% -Have a nice day! -% -Have a nice diurnal anomaly. -% -Have a place for everything and keep the thing -somewhere else; this is not advice, it is merely custom. - -- Mark Twain -% -Have a taco. - -- P. S. Beagle -% -Have an adequate day. -% -Have at you! -% -Have no friends not equal to yourself. - -- Confucius -% -Have people realized that the purpose of the fortune cookie program is -to defuse project tensions? When did you ever see a cheerful cookie, a -non-cynical, or even an informative cookie? - -Perhaps inadvertently, we have a channel for our aggressions. This -still begs the question of whether the cookie releases the pressure or -only serves to blunt the warning signs. - - Long live the revolution! - Have a nice day. -% -Have the courage to take your own thoughts -seriously, for they will shape you. - -- Albert Einstein -% -Have you ever felt like a wounded cow -halfway between an oven and a pasture? -walking in a trance toward a pregnant - seventeen-year-old housewife's - two-day-old cookbook? - -- Richard Brautigan -% -Have you ever met a man of good character where women are concerned? - -Well, I haven't. I find that whenever a woman becomes friends with me, -she becomes jealous, exacting, suspicious, and a damn nuisance; and -whenever I become friends with a woman, I become selfish and tyrannical. -So here I am, Pickering, a confirmed old bachelor and very likely to -remain so. - -- Henry Higgins, "My Fair Lady" -% -Have you ever noticed that the people who are always trying -to tell you `there's a time for work and a time for play' -never find the time for play? -% -Have you flogged your kid today? -% -Have you locked your file cabinet? -% -Have you noticed that all you need to grow healthy, -vigorous grass is a crack in your sidewalk? -% -Have you noticed the way people's intelligence capabilities decline -sharply the minute they start waving guns around? - -- The Doctor, "Doctor Who" -% -Have you reconsidered a computer career? -% -Have you seen the latest Japanese camera? Apparently it is so fast it can -photograph an American with his mouth shut! -% -Have you seen the old man in the closed down market, -Kicking up the papers in his worn out shoes? -In his eyes you see no pride, hands hang loosely at his side -Yesterdays papers, telling yesterdays news. - -How can you tell me you're lonely, -And say for you the sun don't shine? -Let me take you by the hand -Lead you through the streets of London -I'll show you something to make you change your mind... - -Have you seen the old man outside the sea-mans mission -Memories fading like the metal ribbons that he wears. -In our winter city the rain cries a little pity -For one more forgotten hero and a world that doesn't care... -% -Have you seen the well-to-do, up and down Park Avenue? -On that famous thoroughfare, with their noses in the air, -High hats and Arrow collars, white spats and lots of dollars, -Spending every dime, for a wonderful time... -If you're blue and you don't know where to go to, -Why don't you go where fashion sits, -... -Dressed up like a million dollar trooper, -Trying hard to look like Gary Cooper, (super dooper) -Come, let's mix where Rockefeller's walk with sticks, -Or umbrellas, in their mitts, -Puttin' on the Ritz. -... -If you're blue and you don't know where to go to, -Why don't you go where fashion sits, -Puttin' on the Ritz. -Puttin' on the Ritz. -Puttin' on the Ritz. -Puttin' on the Ritz. -% -Having a baby isn't so bad. If you're a female Emperor penguin -in the Antarctic. She lays the egg, rolls it over to the father, -then takes off for warmer weather where she eats and eats and -eats. For two months, the father stands stiff, without food, -blind in the 24-hour dark, balancing the egg on his feet. After -the little penguin is hatched, the mother sees fit to come home. - -- L. M. Boyd, "Austin American-Statesman" -% -Having a wonderful wine, wish you were beer. -% -Having children is like having a bowling alley installed in your brain. - -- Martin Mull -% -Having no talent is no longer enough. - -- Gore Vidal -% -Having nothing, nothing can he lose. - -- William Shakespeare, "Henry VI" -% -Having the fewest wants, I am nearest to the gods. - -- Socrates -% -Having wandered helplessly into a blinding snowstorm Sam was greatly -relieved to see a sturdy Saint Bernard dog bounding toward him with -the traditional keg of brandy strapped to his collar. - "At last," cried Sam, "man's best friend -- and a great big -dog, too!" -% -Hawkeye's Conclusion: - It's not easy to play the clown - when you've got to run the whole circus. -% -He: Do you like Kipling? -She: Oh, you naughty boy, I don't know! I've never kippled! -% -He: "If I made love to you, would you yell?" -She: "What do you want me to yell?" - -- Benny Hill -% -HE: Let's end it all, bequeathin' our brains to science. -SHE: What?!? Science got enough trouble with their OWN brains. - -- Walt Kelley -% -He asked me if I knew what time it was -- I said yes, but not right now. - -- Steven Wright -% -He did decide, though, that with more time and a great deal of mental -effort, he could probably turn the activity into an acceptable -perversion. - -- Mick Farren, "When Gravity Fails" -% -He didn't run for reelection. "Politics brings you into contact with all -the people you'd give anything to avoid," he said. "I'm staying home." - -- Garrison Keillor, "Lake Wobegon Days" -% -He does it with a better grace, but I do it more natural. - -- William Shakespeare, "Twelfth-Night" -% -He draweth out the thread of his verbosity -finer than the staple of his argument. - -- William Shakespeare, "Love's Labour's Lost" -% -He flung himself on his horse and rode madly off in all directions. - -- Stephen Leacock -% -He gave her a look that you could have poured on a waffle. -% -He had occasional flashes of silence that made his conversation -perfectly delightful. - -- Sydney Smith -% -He had that rare weird electricity about him -- that extremely wild -and heavy presence that you only see in a person who has abandoned -all hope of ever behaving "normally." - -- Hunter S. Thompson, "Fear and Loathing '72" -% -He hadn't a single redeeming vice. - -- Oscar Wilde -% -He has been known by many names; the Prince of Lies, the Director, Lucifer, -Belial, and once, at a party, some obnoxious drunk kept calling him "Dude". - -- Stig's Inferno -% -He has not acquired a fortune; the fortune has acquired him. - -- Bion -% -He hath eaten me out of house and home. - -- William Shakespeare, "Henry IV" -% -He heard the snick of a rifle bolt and found himself peering down the muzzle -of a weapon held by a drunken liquor store owner -- "There's a conflict," he -said, "there's a conflict between land and people... the people have to go..." - -- Stan Ridgeway, "Call of the West" -% -He is a man capable of turning any colour into grey. - -- John LeCarre -% -He is considered a most graceful speaker -who can say nothing in the most words. -% -He is no lawyer who cannot take two sides. -% -He is not only dull himself, he is the cause of dullness in others. - -- Samuel Johnson -% -He is now rising from affluence to poverty. - -- Mark Twain -% -He is the best of men who dislikes power. - -- Mohammed -% -He is truly wise who gains wisdom from another's mishap. -% -He jests at scars who never felt a wound. - -- William Shakespeare, "Romeo and Juliet, II. 2" -% -He keeps differentiating, flying off on a tangent. -% -He knew the tavernes well in every toun. - -- Geoffrey Chaucer -% -He knows not how to know who knows not also how to unknow. - -- Sir Richard Burton -% -He laughs at every joke three times... once when it's told, -once when it's explained, and once when he understands it. -% -He looked at me as if I were a side dish he hadn't ordered. - -- Ring Lardner -% -He missed an invaluable opportunity to hold his tongue. - -- Andrew Lang -% -He only knew his iron spine held up the sky -- he didn't realize his brain -had fallen to the ground. - -- The Book of Serenity -% -(He opens a tolm and begins.) - - It says: "In the beginning was the Word." - Already I am stopped. It seems absurd. - The Word does not deserve the highest prize, - I must translate it otherwise. - If I am well inspired and not blind. - It says: "In the beginning was the Mind." - Ponder that first line, wait and see, - Lest you should write too hastily. - Is the Mind the all-creating source? - It ought to say: "In the beginning there was Force." - Yet something warns me as I grasp the pen, - That my translation must be changed again. - The spirit helps me. Now it is exact. - I write: "In the beginning was the Act." - -- Johann Wolfgang von Goethe, "Faust" -% -[He] played the King as if afraid someone else might play the ace. - -- Unattributed review of a performance of King Lear - -My tears stuck in their little ducts, refusing to be jerked. - -- Peter Stack, movie review - -His performance is so wooden you want to spray him with Liquid Pledge. - -- John Stark, movie review -% -He played the king as if afraid someone else would play the ace. - -- John Mason Brown, drama critic -% -He tells you when you've got on too much lipstick, -And helps you with your girdle when your hips stick. - -- Ogden Nash, on the perfect husband -% -He that breaks a thing to find out what it is has left the path of wisdom. - -- J. R. R. Tolkien -% -He that bringeth a present, findeth the door open. - -- Scottish proverb -% -He that composes himself is wiser than he that composes a book. - -- Benjamin Franklin -% -He that is giddy thinks the world turns round. - -- William Shakespeare, "The Taming of the Shrew" -% -He that teaches himself has a fool for a master. - -- Benjamin Franklin -% -He that would govern others, first should be the master of himself. -% -He thinks the Gettysburg Address is where Lincoln lived. - -- Wanda, "A Fish Called Wanda" -% -He thought he saw an albatross -That fluttered 'round the lamp. -He looked again and saw it was -A penny postage stamp. -"You'd best be getting home," he said, -"The nights are rather damp." -% -He thought of Musashi, the Sword Saint, standing in his garden more than -three hundred years ago. "What is the 'Body of a rock'?" he was asked. -In answer, Musashi summoned a pupil of his and bid him kill himself by -slashing his abdomen with a knife. Just as the pupil was about to comply, -the Master stayed his hand, saying, "That is the 'Body of a rock'." - -- Eric Van Lustbader -% -[He] took me into his library and showed me his books, of which he had -a complete set. - -- Ring Lardner -% -He walks as if balancing the family tree on his nose. -% -He was a cowboy, mister, and he loved the land. He loved it so much he -made a woman out of dirt and married her. But when he kissed her, she -disintegrated. Later, at the funeral, when the preacher said, "Dust to -dust," some people laughed, and the cowboy shot them. At his hanging, he -told the others, "I'll be waiting for you in heaven -- with a gun." - -- Jack Handey -% -He was a fiddler, and consequently a rogue. - -- Jonathan Swift -% -He was a modest, good-humored boy. It was Oxford that made him -insufferable. -% -He was part of my dream, of course -- -but then I was part of his dream too. - -- Lewis Carroll, - "Through the Looking-Glass, - and What Alice Found There" (1871) -% -He was so narrow-minded he could see through a keyhole with both eyes. -% -He was the sort of person whose personality -would be greatly improved by a terminal illness. -% -He who always plows a straight furrow is in a rut. -% -He who attacks the fundamentals of the American -broadcasting industry attacks democracy itself. - -- William S. Paley, chairman of CBS -% -He who dares the wrong, acts right, that's how it happens! - -- Poul Henningsen (1894-1967) -% -He who despairs over an event is a coward, but he who holds hopes for -the human condition is a fool. - -- Albert Camus -% -He who despises himself nevertheless esteems himself as a self-despiser. - -- Friedrich Nietzsche -% -He who enters his wife's dressing room is a philosopher or a fool. - -- Honore de Balzac -% -He who fears the unknown may one day flee from his own backside. - -- Sinbad -% -He who fights and runs away lives to fight another day. -% -He who foresees calamities suffers them twice over. -% -He who has a shady past knows that nice guys finish last. -% -He who has but four and spends five has no need for a wallet. -% -He who has imagination without learning has wings but no feet. -% -He who has the courage to laugh is almost as much -a master of the world as he who is ready to die. - -- Giacomo Leopardi -% -He who hates vices hates mankind. -% -He who hesitates is a damned fool. - -- Mae West -% -He who hesitates is last. -% -He who hesitates is sometimes saved. -% -He who hoots with owls by night cannot soar with eagles by day. -% -He who invents adages for others to peruse -takes along rowboat when going on cruise. -% -He who is content with his lot probably has a lot. -% -He who is flogged by fate and laughs the louder is a masochist. -% -He who is good for making excuses is seldom good for anything else. -% -He who is in love with himself has at least this advantage -- he won't -encounter many rivals. - -- Georg Lichtenberg, "Aphorisms" -% -He who is intoxicated with wine will be sober again in the course of the -night, but he who is intoxicated by the cupbearer will not recover his -senses until the day of judgment. - -- Saadi -% -He who is known as an early riser need not get up until noon. -% -He who knows, does not speak. He who speaks, does not know. - -- Lao Tsu -% -He who knows not and knows that he knows not is ignorant. Teach him. -He who knows not and knows not that he knows not is a fool. Shun him. -He who knows and knows not that he knows is asleep. Wake him. -% -He who knows nothing, knows nothing. -But he who knows he knows nothing knows something. -And he who knows someone whose friend's wife's brother knows nothing, - he knows something. Or something like that. -% -He who knows others is wise. -He who knows himself is enlightened. - -- Lao Tsu -% -He who knows that enough is enough will always have enough. - -- Lao Tsu -% -He who laughs has not yet heard the bad news. - -- Bertolt Brecht -% -He who laughs last -- missed the punch line. -% -He who laughs last hasn't been told the terrible truth. -% -He who laughs last is probably your boss. -% -He who laughs last usually had to have joke explained. -% -He who laughs, lasts. -% -He who lives without folly is less wise than he believes. -% -He who loses, wins the race, -And parallel lines meet in space. - -- John Boyd, "Last Starship from Earth" -% -He who makes a beast of himself gets rid of the pain of being a man. - -- Dr. Johnson -% -He who minds his own business is never unemployed. -% -He who renders warfare fatal to all engaged in it will -be the greatest benefactor the world has yet known. - -- Sir Richard Burton -% -He who slings mud generally loses ground. - -- Adlai E. Stevenson -% -He who slings mud loses ground. - -- Chinese proverb -% -He who spends a storm beneath a tree, takes life with a grain of TNT. -% -He who steps on others to reach the top has good balance. -% -He who walks on burning coals is sure to get burned. - -- Sinbad -% -He who wonders discovers that this in itself is wonder. - -- M. C. Escher -% -He who writes with no misspelled words has prevented a first suspicion -on the limits of his scholarship or, in the social world, of his general -education and culture. - -- Julia Norton McCorkle -% -HEAD CRASH!! FILES LOST!! -Details at 11. -% -Health is merely the slowest possible rate at which one can die. -% -Health nuts are going to feel stupid someday, -lying in hospitals dying of nothing. - -- Redd Foxx -% -Hear about... - the Californian terrorist that tried to blow up a bus? - Burned his lips on the exhaust pipe. -% -Hear about... - the fellow who, upon being told by his shrewish wife that she - would dance on his grave, promptly provided for a burial at sea? -% -Hear about... - the female activist who went berserk during a demonstration and - attacked a karate-trained cop with a deadly weapon. She ended - up a chopped libber? -% -Hear about... - the guru who refused Novocaine while having a tooth pulled because - he wanted to transcend dental medication? -% -Hear about... - the pessimistic historian whose latest book has chapter headings - that read "World War One","World War Two" and "Watch This - Space"? -% -Hear about... - the wild office Christmas party in a completely automated - company -- the photocopier got drunk and tried to undo the - typewriter's ribbon? -% -Hear about... - the young Chinese woman who just won the lottery? - One fortunate cookie... -% -Hear me, my chiefs, I am tired; my heart is sick and sad. -From where the sun now stands I Will Fight No More Forever. - -- Chief Joseph of the Nez Perce -% -Heard that the next Space Shuttle is supposed to carry several -Guernsey cows? It's gonna be the herd shot 'round the world. -% -Hearts will never be practical until they can be made unbreakable. - -- Frank Morgan as The Wizard, "The Wizard of Oz" -% -Heaven and earth were created all together in the same instant, -on October 23rd, 4004 B.C. at nine o'clock in the morning. - -- Dr. John Lightfoot, - Vice-chancellor of Cambridge University -% -Heaven, n.: - A place where the wicked cease from troubling you with talk of - their personal affairs, and the good listen with attention - while you expound your own. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Heavier than air flying machines are impossible. - -- Lord Kelvin, President, Royal Society, c. 1895 -% -Heavy, adj.: - Seduced by the chocolate side of the force. -% -Hedonist for hire... no job too easy! -% -Heisenberg may have been here. -% -Heisenberg may have slept here. -% -Hell hath no fury like a bureaucrat scorned. - -- Milton Friedman -% -Hell hath no limits, nor is circumscribed in one self place, -for where we are is Hell, and where Hell is there must we ever be. - -- Christopher Marlowe, "Doctor Faustus" -% -Hell, if you don't try to remake someone, -how are they supposed to know you care? -% -Hell is empty and all the devils are here. - -- William Shakespeare, "The Tempest" -% -Hell, n.: - Truth seen too late. -% -Heller's Law: - The first myth of management is that it exists. - -Johnson's Corollary: - Nobody really knows what is going on anywhere within the - organization. -% -Hello. Jim Rockford's machine, this is Larry Doheny's machine. Will you -please have your master call my master at his convenience? Thank you. -Thank you. Thank you. Thank you. Thank you. Thank you. -% -Hello, friend! You say things aren't going too well? You say you have a -date with your favorite girl when it starts raining so hard you can't see? -And you're out on some back road when the car stalls and won't start, so -you set off across the fields, and 50 feet of barbed wire hits you right -smack in the puss? And then there's a big explosion behind you and you -don't hear your girl screaming any more? - - Well, take a walk in the sun and hold your head up high! - You'll show the world; you'll tell them where to get off! - You'll never give up, never give up, never give up -- that ship! -% -"Hello," he lied. - -- Don Carpenter, quoting a Hollywood agent -% -Hell's broken loose. - -- Robert Greene -% -Help! I'm trapped in a Chinese computer factory! -% -HELP! Man trapped in a human body! -% -HELP! MY TYPEWRITER IS BROKEN! - -- E. E. CUMMINGS -% -Help a swallow land at Capistrano. -% -Help fight continental drift. -% -HELP!!!! I'm being held prisoner in /usr/share/games/fortune! -% -Help me, I'm a prisoner in a Fortune cookie file! -% -Help stamp out and abolish redundancy! -% -Help stamp out Mickey-Mouse computer interfaces -- Menus are for Restaurants! -% -Her days were spent in a kind of slow bustle; always busy without -getting on, always behind hand and lamenting it, without altering -her ways; wishing to be an economist, without contrivance or -regularity; dissatisfied with her servants, without skill to make -them better, and whether helping, or reprimanding, or indulging -them, without any power of engaging their respect. - -- J. Austen -% -Her locks an ancient lady gave -Her loving husband's life to save; -And men -- they honored so the dame -- -Upon some stars bestowed her name. - -But to our modern married fair, -Who'd give their lords to save their hair, -No stellar recognition's given. -There are not stars enough in heaven. -% -Here at the Phone Company, we serve all kinds of people; -from Presidents and Kings to the scum of the earth... -% -Here comes the orator, with his flood of words and his drop of reason. -% -Here I am again right where I know I shouldn't be -I've been caught inside this trap too many times -I must've walked these steps and said these words a - thousand times before -It seems like I know everybody's lines. - -- David Bromberg, "How Late'll You Play 'Til?" -% -Here I am, fifty-eight, and I still don't know what I want to be when -I grow up. - -- Peter Drucker -% -Here I sit, broken-hearted, -All logged in, but work unstarted. -First net.this and net.that, -And a hot buttered bun for net.fat. - -The boss comes by, and I play the game, -Then I turn back to net.flame. -Is there a cure (I need your views), -For someone trapped in net.news? - -I need your help, I say 'tween sobs, -'Cause I'll soon be listed in net.jobs. -% -Here in my heart, I am Helen; - I'm Aspasia and Hero, at least. -I'm Judith, and Jael, and Madame de Stael; - I'm Salome, moon of the East. - -Here in my soul I am Sappho; - Lady Hamilton am I, as well. -In me Recamier vies with Kitty O'Shea, - With Dido, and Eve, and poor Nell. - -I'm all of the glamorous ladies - At whose beckoning history shook. -But you are a man, and see only my pan, - So I stay at home with a book. - -- Dorothy Parker -% -Here is a simple experiment that will teach you an important electrical -lesson: On a cool, dry day, scuff your feet along a carpet, then reach -your hand into a friend's mouth and touch one of his dental fillings. -Did you notice how your friend twitched violently and cried out in -pain? This teaches us that electricity can be a very powerful force, -but we must never use it to hurt others unless we need to learn an -important electrical lesson. - -It also teaches us how an electrical circuit works. When you scuffed -your feet, you picked up batches of "electrons", which are very small -objects that carpet manufacturers weave into carpets so they will -attract dirt. The electrons travel through your bloodstream and -collect in your finger, where they form a spark that leaps to your -friend's filling, then travels down to his feet and back into the -carpet, thus completing the circuit. - -Amazing Electronic Fact: If you scuffed your feet long enough without -touching anything, you would build up so many electrons that your -finger would explode! But this is nothing to worry about unless you -have carpeting. - -- Dave Barry, "What is Electricity?" -% -Here is a test to find whether your mission on earth is finished: -if you're alive, it isn't. -% -Here is the fact of the week, maybe even the fact of the month. According -to probably reliable sources, the Coca-Cola people are experiencing severe -marketing anxiety in China. - -The words "Coca-Cola" translate into Chinese as either (depending on the -inflection) "wax-fattened mare" or "bite the wax tadpole". - -Bite the wax tadpole. There is a sort of rough justice, is there not? - -The trouble with this fact, as lovely as it is, is that it's hard to get -a whole column out of it. I'd like to teach the world to bite a wax -tadpole. Coke -- it's the real wax-fattened mare. Not bad, but broad -satiric vistas do not open up. - -- John Carrol, San Francisco Chronicle -% -HERE LIES LESTER MOORE -SHOT 4 TIMES WITH A .44 -NO LES -NO MOORE - -- tombstone, in Tombstone, AZ -% -Here lies my wife: her let her lie! -Now she's at rest, and so am I. - -- John Dryden, epitaph intended for his wife -% -Here there by tygers. -% -HERE'S A GOOD JOKE to do during an earthquake. Straddle a big crack in -the earth and if it opens wider, go, "Whoa! Whoa!" and flap your arms -around as if you're going to fall. - -- Jack Handey, "The New Mexican" (1988) -% -Here's something to think about: How come you never see a headline like -`Psychic Wins Lottery.' - -- Jay Leno -% -Herth's Law: - He who turns the other cheek too far gets it in the neck. -% -He's been like a father to me, -He's the only DJ you can get after three, -I'm an all-night musician in a rock and roll band, -And why he don't like me I don't understand. - -- The Byrds -% -He's dead, Jim. -% -He's got the heart of a little child, -and he keeps it in a jar on his desk. -% -He's just a politician trying to save both his faces... -% -He's just like Capistrano, always ready for a few swallows. -% -He's like a function -- he returns a value, in the form of -his opinion. It's up to you to cast it into a void or not. - -- Phil Lapsley -% -He's the kind of guy, that, well, if you were ever in a jam he'd -be there... with two slices of bread and some chunky peanut butter. -% -He's the kind of man for the times that need the kind of man he is. -% -Heuristics are bug ridden by definition. -If they didn't have bugs, then they'd be algorithms. -% -Hewett's Observation: - The rudeness of a bureaucrat is inversely proportional to his or - her position in the governmental hierarchy and to the number of - peers similarly engaged. -% -Hey, diddle, diddle the overflow pdl -To get a little more stack; -If that's not enough then you lose it all -And have to pop all the way back. -% -Hey, Jim, it's me, Susie Lillis from the laundromat. You said you were -gonna call and it's been two weeks. What's wrong, you lose my number? -% -HEY KIDS! ANN LANDERS SAYS: - Be sure it's true, when you say "I love you". It's a sin to - tell a lie. Millions of hearts have been broken, just because - these words were spoken. -% -Hey, what do you expect from a culture that -*drives* on *parkways* and *parks* on *driveways*? - -- Gallagher -% -Hi! I'm Larry. This is my brother Bob, and this is my other brother -Jimbo. We thought you might like to know the names of your assailants. -% -Hi! You have reached 962-0129. None of us are here to answer the phone and -the cat doesn't have opposing thumbs, so his messages are illegible. Please -leave your name and message after the beep... -% -Hi! How are things going? - (just fine, thank you...) -Great! Say, could I bother you for a question? - (you just asked one...) -Well, how about one more? - (one more than the first one?) -Yes. - (you already asked that...) -[at this point, Alphonso gets smart... ] -May I ask two questions, sir? - (no.) -May I ask ONE then? - (nope...) -Then may I ask, sir, how I may ask you a question? - (yes, you may.) -Sir, how may I ask you a question? - (you must ask for retroactive question asking privileges for - the number of questions you have asked, then ask for that - number plus two, one for the current question, and one for the - next one) -Sir, may I ask nine questions? - (go right ahead...) -% -Hi, I'm Preston A. Mantis, president of Consumers Retail Law Outlet. -As you can see by my suit and the fact that I have all these books of -equal height on the shelves behind me, I am a trained legal attorney. -Do you have a car or a job? Do you ever walk around? If so, you -probably have the makings of an excellent legal case. Although of -course every case is different, I would definitely say that based on my -experience and training, there's no reason why you shouldn't come out -of this thing with at least a cabin cruiser. - -Remember, at the Preston A. Mantis Consumers Retail Law Outlet, our -motto is: "It is very difficult to disprove certain kinds of pain." - -- Dave Barry, "Pain and Suffering" -% -Hi Jimbo. Dennis. Really appreciate the help on the income tax. -You wanna help on the audit now? -% -Hi there! This is just a note from me, to you, to tell you, the person -reading this note, that I can't think up any more famous quotes, jokes, -nor bizarre stories, so you may as well go home. -% -Hickery Dickery Dock, -The mice ran up the clock, -The clock struck one, -The others escaped with minor injuries. -% -Hideously disfigured by an ancient Indian curse? - - WE CAN HELP! - -Call (511) 338-0959 for an immediate appointment. -% -Hier liegt ein Mann ganz ohnegleich; -Im Leibe dick, an Suenden reich. -Wir haben ihn ins Grab gesteckt, Here lies a man with sundry flaws -Weil es uns duenkt er sei verreckt. And numerous Sins upon his head; - We buried him today because - As far as we can tell, he's dead. - -- PDQ Bach's epitaph, as requested by his cousin Betty - Sue Bach and written by the local doggerel catcher; - "The Definitive Biography of PDQ Bach", Peter - Schickele -% -Higgeldy Piggeldy, -Hamlet of Elsinore -Ruffled the critics by dropping this bomb: -"Phooey on Freud and his Psychoanalysis -- -Oedipus, Shmoedipus, I just loved Mom." -% -Higgins: Doolittle, you're either an honest man or a rogue. -Doolittle: A little of both, Guv'nor. Like the rest of us, a - little of both. - -- Shaw, "Pygmalion" -% -High heels are a device invented by a woman -who was tired of being kissed on the forehead. -% -High Priest: Armaments Chapter One, verses nine through twenty-seven: -Bro. Maynard: And Saint Attila raised the Holy Hand Grenade up on high - saying, "Oh Lord, Bless us this Holy Hand Grenade, and with it - smash our enemies to tiny bits." And the Lord did grin, and the - people did feast upon the lambs, and stoats, and orangutans, and - breakfast cereals, and lima bean- -High Priest: Skip a bit, brother. -Bro. Maynard: And then the Lord spake, saying: "First, shalt thou take - out the holy pin. Then shalt thou count to three. No more, no less. - *Three* shall be the number of the counting, and the number of the - counting shall be three. *Four* shalt thou not count, and neither - count thou two, excepting that thou then goest on to three. Five is - RIGHT OUT. Once the number three, being the third number be reached, - then lobbest thou thy Holy Hand Grenade towards thy foe, who, being - naughty in my sight, shall snuff it. Amen. -All: Amen. - -- Monty Python, "The Holy Hand Grenade" -% -HIGH TECHNOLOGY: - A California innovation composed - of equal parts of silicon and marijuana. -% -Higher education helps your earning capacity. Ask any college professor. -% -Hildebrant's Principle: - If you don't know where you are going, - any road will get you there. -% -Him: "Your skin is so soft. Are you a model?" -Her: "No," [blush] "I'm a cosmetologist." -Him: "Really? That's incredible... - It must be very tough to handle weightlessness." - -- "The Jerk" -% -Hindsight is always 20:20. - -- Billy Wilder -% -Hippogriff, n.: - An animal (now extinct) which was half horse and half griffin. - The griffin was itself a compound creature, half lion and half - eagle. The hippogriff was actually, therefore, only one quarter - eagle, which is two dollars and fifty cents in gold. The study - of zoology is full of surprises. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Hire the morally handicapped. -% -His designs were strictly honourable, as the phrase is: that is, to rob -a lady of her fortune by way of marriage. - -- Henry Fielding, "Tom Jones" -% -...his disciples lead him in; he just does the rest. - -- Tommy -% -His eyes were cold. As cold as the bitter winter snow that was falling -outside. Yes, cold and therefore difficult to chew... -% -His followers called him Mahasamatman and said he was a god. He preferred -to drop the Maha- and the -atman, however, and called himself Sam. He never -claimed to be a god. But then, he never claimed not to be a god. Circum- -stances being what they were, neither admission could be of any benefit. -Silence, though, could. It was in the days of the rains that their prayers -went up, not from the fingering of knotted prayer cords or the spinning of -prayer wheels, but from the great pray-machine in the monastery of Ratri, -goddess of the Night. The high-frequency prayers were directed upward through -the atmosphere and out beyond it, passing into that golden cloud called the -Bridge of the Gods, which circles the entire world, is seen as a bronze -rainbow at night and is the place where the red sun becomes orange at midday. -Some of the monks doubted the orthodoxy of this prayer technique... - -- Roger Zelazny, "Lord of Light" -% -His great aim was to escape from civilization, and, as soon as he had -money, he went to Southern California. -% -His heart was yours from the first moment that you met. -% -His ideas of first-aid stopped short of squirting soda water. - -- P. G. Wodehouse -% -His life was formal; his actions seemed ruled with a ruler. -% -His mind is like a steel trap: full of mice. - -- Foghorn Leghorn -% -His super power is to turn into a scotch terrier. -% -Historians have now definitely established that Juan Cabrillo, discoverer -of California, was not looking for Kansas, thus setting a precedent that -continues to this day. - -- Wayne Shannon -% -History books which contain no lies are extremely dull. -% -History has much to say on following the proper procedures. From a history -of the Mexican revolution: - - "Hildago was later defeated at Guadalajara. The rebel army was -captured on its way through the mountains. All were courtmartialed and -shot, except Hildago, because he was a priest. He was handed over to -the bishop of Durango who excommunicated him and returned him to the -army where he was then executed." -% -History is curious stuff - You'd think by now we had enough -Yet the fact remains I fear - They make more of it every year. -% -History is nothing but a collection of fables and useless trifles, -cluttered up with a mass of unnecessary figures and proper names. - -- Leo Tolstoy -% -History is on our side (as long as we can control the historians). -% -History is the version of past events that people have decided to agree on. - -- Napoleon Bonaparte, "Maxims" -% -History repeats itself. That's one thing wrong with history. -% -History repeats itself -- the first time as a tragi-comedy, the second -time as bedroom farce. -% -History repeats itself only if one does not listen the first time. -% -History shows that the human mind, fed by constant accessions of knowledge, -periodically grows too large for its theoretical coverings, and bursts them -asunder to appear in new habiliments, as the feeding and growing grub, at -intervals, casts its too narrow skin and assumes another... Truly the imago -state of Man seems to be terribly distant, but every moult is a step gained. - -- Charles Darwin, from "Origin of the Species" -% -Hit them biscuits with another touch of gravy, -Burn that sausage just a match or two more done. -Pour my black old coffee longer, -While that smell is gettin' stronger -A semi-meal ain't nuthin' much to want. - -Loan me ten, I got a feelin' it'll save me, -With an ornery soul who don't shoot pool for fun, -If that coat'll fit you're wearin', -The Lord'll bless your sharin' -A semi-friend ain't nuthin' much to want. - -And let me halfway fall in love, -For part of a lonely night, -With a semi-pretty woman in my arms. -Yes, I could halfway fall in deep-- -Into a snugglin', lovin' heap, -With a semi-pretty woman in my arms. - -- Elroy Blunt -% -Hitchcock's Staple Principle: - The stapler runs out of staples - only while you are trying to staple something. -% -Hitler used methods against white men in Europe, which by tacit -agreement between the cultural European nations were only to be -used against the coloured. - -- Poul Henningsen (1894-1967) -% -Hlade's Law: - If you have a difficult task, give it to a lazy person -- - they will find an easier way to do it. -% -Hoaars-Faisse Gallery presents: -An exhibit of works by the artist known only as Pretzel. - -The exhibit includes several large conceptual works using non-traditional -media and found objects including old sofa-beds, used mace canisters, -discarded sanitary napkins and parts of freeways. The artist explores -our dehumanization due to high technology and unresponsive governmental -structures in a post-industrial world. She/he (the artist prefers to -remain without gender) strives to create dialogue between viewer and -creator, to aid us in our quest to experience contemporary life with its -inner-city tensions, homelessness, global warming and gender and -class-based stress. The works are arranged to lead us to the essence of -the argument: that the alienation of the person/machine boundary has -sapped the strength of our voices and must be destroyed for society to -exist in a more fundamental sense. -% -Hoare's Law of Large Problems: - Inside every large problem is a small - problem struggling to get out. -% -Hodie natus est radici frater. -% -Hoffer's Discovery: - The grand act of a dying institution is to issue a newly - revised, enlarged edition of the policies and procedures manual. -% -Hofstadter's Law: - It always takes longer than you expect, even when you take - Hofstadter's Law into account. -% -HOGAN'S HEROES DRINKING GAME -- - Take a shot every time: - --- Sergeant Schultz says, "I knoooooowww nooooothing!" --- General Burkhalter or Major Hochstetter intimidate/insult Colonel Klink. --- Colonel Klink falls for Colonel Hogan's flattery. --- One of the prisoners sneaks out of camp (one shot for each prisoner to go). --- Colonel Klink snaps to attention after answering the phone (two shots - if it's one of our heroes on the other end). --- One of the Germans is threatened with being sent to the Russian front. --- Corporal Newkirk calls up a German in his phoney German accent, and - tricks him (two shots if it's Colonel Klink). --- Hogan has a romantic interlude with a beautiful girl from the underground. --- Colonel Klink relates how he's never had an escape from Stalag 13. --- Sergeant Schultz gives up a secret (two shots if he's bribed with food). --- The prisoners listen to the Germans' conversation by a hidden transmitter. --- Sergeant Schultz "captures" one of the prisoners after an escape. --- Lebeau pronounces "colonel" as "cuh-loh-`nell". --- Carter builds some kind of device (two shots if it's not explosive). --- Lebeau wears his apron. --- Hogan says "We've got no choice" when the someone claims that the - plan is impossible. --- The prisoners capture an important German, and sneak him out the tunnel. -% -Hollerith, v.: - What thou doest when thy phone is on the fritzeth. -% -Hollywood is where if you don't have happiness you send out for it. - -- Rex Reed -% -Holy Dilemma! Is this the end for the Caped Crusader and the Boy Wonder? -Will the Joker and the Riddler have the last laugh? - - Tune in again tomorrow: - same Bat-time, same Bat-channel! -% -HOLY MACRO! -% -Home is the place where, when you have to go there, -they have to take you in. - -- Robert Frost, "The Death of the Hired Man" -% -Home life as we understand it is no more natural to us than a -cage is to a cockatoo. - -- George Bernard Shaw -% -Home of Doberman Propulsion Laboratories: -The ultimate in watchdog weaponry. - -- Chris Shaw -% -Home on the Range was originally written in beef-flat. -% -"Home, Sweet Home" must surely have been written by a bachelor. - -- Samuel Butler -% -Honesty is for the most part less profitable than dishonesty. - -- Plato -% -Honesty is the best policy, but insanity is a better defense. -% -Honesty pays, but it doesn't seem to pay enough to suit some people. - -- F. M. Hubbard -% -Honesty's the best policy. - -- Miguel de Cervantes -% -Honeymoon, n.: - A short period of doting between dating and debting. - -- Ray C. Bandy -% -Honi soit la vache qui rit. -% -Honk if you hate bumper stickers that say "Honk if ..." -% -Honk if you love peace and quiet. -% -Honorable, adj.: - Afflicted with an impediment in one's reach. In legislative - bodies, it is customary to mention all members as honorable; as, - "the honorable gentleman is a scurvy cur." - -- Ambrose Bierce, "The Devil's Dictionary" -% -Hope is a good breakfast, but it is a bad supper. - -- Francis Bacon -% -Hope is a waking dream. - -- Aristotle -% -Hope not, lest ye be disappointed. - -- M. Horner -% -Hope that the day after you die is a nice day. -% -Hoping to goodness is not theologically sound. - -- Peanuts -% -Horace's best ode would not please a young woman as much -as the mediocre verses of the young man she is in love with. - -- Moore -% -Horner's Five Thumb Postulate: - Experience varies directly with equipment ruined. -% -Horngren's Observation: - Among economists, the real world is often a special case. -% -Hors d'oeuvres -- a ham sandwich cut into forty pieces. - -- Jack Benny -% -Horse sense is the thing a horse has which keeps it from betting on people. - -- W. C. Fields -% -HOST SYSTEM NOT RESPONDING, PROBABLY DOWN. DO YOU WANT TO WAIT? (Y/N) -% -HOST SYSTEM RESPONDING, PROBABLY UP... -% -Hotels are tired of getting ripped off. I checked into a hotel and they -had towels from my house. - -- Mark Guido -% -Houdini escaping from New Jersey! -% -Household hint: - If you are out of cream for your coffee, - mayonnaise makes a dandy substitute. -% -Housework can kill you if done right. - -- Erma Bombeck -% -Houston, Tranquillity Base here. The Eagle has landed. - -- Neil Armstrong -% -How apt the poor are to be proud. - -- William Shakespeare, "Twelfth-Night" -% -How can you be in two places at once -when you're not anywhere at all? -% -How can you do "New Math" problems with an "Old Math" mind? - -- Schulz -% -How can you govern a nation which has 246 kinds of cheese? - -- Charles de Gaulle -% -How can you have any pudding if you don't eat your meat? - -- Pink Floyd -% -How can you prove whether at this moment we are sleeping, and all our -thoughts are a dream; or whether we are awake, and talking to one another -in the waking state? - -- Plato -% -How can you think and hit at the same time? - -- Yogi Berra -% -How can you work when the system's so crowded? -% -How come everyone's going so slow if it's called rush hour? -% -How come financial advisors never seem to be as wealthy as they -claim they'll make you? -% -How come only your friends step on your new white sneakers? -% -How come we never talk anymore? -% -How come wrong numbers are never busy? -% -How comes it to pass, then, that we appear such cowards -in reasoning, and are so afraid to stand the test of ridicule? - -- A. Cooper -% -How could they think women a recreation? -Or the repetition of bodies of steady interest? -Only the ignorant or the busy could. That elm -of flesh must prove a luxury of primes; -be perilous and dear with rain of an alternate earth. -Which is not to damn the forested China of touching. -I am neither priestly nor tired, and the great knowledge -of breasts with their loud nipples congregates in me. -The sudden nakedness, the small ribs, the mouth. -Splendid. Splendid. Splendid. Like Rome. Like loins. -A glamour sufficient to our long marvelous dying. -I say sufficient and speak with earned privilege, -for my life has been eaten in that foliate city. -To ambergris. But not for recreation. -I would not have lost so much for recreation. - -Nor for love as the sweet pretend: the children's game -of deliberate ignorance of each to allow the dreaming. -Not for the impersonal belly nor the heart's drunkenness -have I come this far, stubborn, disastrous way. -But for relish of those archipelagoes of person. -To hold her in hand, closed as any sparrow, -and call and call forever till she turn from bird -to blowing woods. From woods to jungle. Persimmon. -To light. From light to princess. From princess to woman -in all her fresh particularity of difference. -Then oh, through the underwater time of night -indecent and still, to speak to her without habit. -This I have done with my life, and am content. -I wish I could tell you how it is in that dark, -standing in the huge singing and the alien world. - -- Jack Gilbert, "Don Giovanni on his way to Hell" -% -How do I love thee? My accumulator overflows. -% -How do you explain school to a higher intelligence? - -- Elliot, "E.T." -% -How doth the little crocodile - Improve his shining tail, -And pour the waters of the Nile - On every golden scale! - -How cheerfully he seems to grin, - How neatly spreads his claws, -And welcomes little fishes in, - With gently smiling jaws! - -- Lewis Carroll, "Alice's Adventures in Wonderland" (1865) -% -How doth the VAX's C-compiler - Improve its object code. -And even as we speak does it - Increase the system load. - -How patiently it seems to run - And spit out error flags, -While users, with frustration, all - Tear all their clothes to rags. -% -How is the world ruled, and how do wars start? Diplomats tell lies to -journalists, and they believe what they read. - -- Karl Kraus, "Aphorisms and More Aphorisms" -% -How kind of you to be willing to live someone's life for them. -% -How many "coming men" has one known! Where on earth do they all go to? - -- Sir Arthur Wing Pinero -% -"How many hors d'oeuvres you are allowed to take off a tray being -carried by a waiter at a nice party?" - -Two, but there are ways around it, depending on the style of the hors -d'oeuvre. If they're those little pastry things where you can't tell -what's inside, you take one, bite off about two-thirds of it, then -say: "This is cheese! I hate cheese!" Then you put the rest of it -back on the tray and bite another one and go, "Darn it! Another -cheese!" and so on. - -- Dave Barry, "The Stuff of Etiquette" -% -How many priests are needed for a Boston Mass? -% -How many software engineers does it take to change a lightbulb? -None: "We'll document it in the manual." -% -How many weeks are there in a light year? -% -How much does it cost to entice a dope-smoking UNIX system guru to -Dayton? - -- Brian Boyle, UNIX/WORLD's First Annual Salary Survey -% -How much does she love you? -Less than you'll ever know. -% -How much for your women? I want to buy your -daughter... how much for the little girl? - -- Jake Blues, "The Blues Brothers" -% -How much net work could a network work, if a network could net work? -% -How much of their influence on you is a result of your influence on them? -% -How often I found where I should be going -only by setting out for somewhere else. - -- R. Buckminster Fuller -% -How sharper than a hound's tooth it is to have a thankless serpent. -% -How sharper than a serpent's tooth is a sister's "See?" - -- Linus Van Pelt -% -How to become a sysop: - I grew a beard, started wearing only t-shirts and jeans, and - developed a surly attitude. The group accepted me, and I've never - worked a full day in my life since then. - -- rho/slashdot -% -How to Raise Your I.Q. by Eating Gifted Children - -- Book title by Lewis B. Frumkes -% -How untasteful can you get? -% -How wonderful opera would be if there were no singers. -% -HOW YOU CAN TELL THAT IT'S GOING TO BE A ROTTEN DAY: - #1040 Your income tax refund cheque bounces. -% -HOW YOU CAN TELL THAT IT'S GOING TO BE A ROTTEN DAY: - #15 Your pet rock snaps at you. -% -HOW YOU CAN TELL THAT IT'S GOING TO BE A ROTTEN DAY: - #32: You call your answering service and they've never heard of - you. -% -How you look depends on where you go. -% -Howe's Law: - Everyone has a scheme that will not work. -% -However, never daunted, I will cope with adversity -in my traditional manner... sulking and nausea. - -- Tom K. Ryan -% -However, on religious issues there can be little or no compromise. There -is no position on which people are so immovable as their religious beliefs. -There is no more powerful ally one can claim in a debate than Jesus Christ, -or God, or Allah, or whatever one calls this supreme being. But like any -powerful weapon, the use of God's name on one's behalf should be used -sparingly. The religious factions that are growing throughout our land are -not using their religious clout with wisdom. They are trying to force -government leaders into following their position 100 percent. If you disagree -with these religious groups on a particular moral issue, they complain, they -threaten you with a loss of money or votes or both. I'm frankly sick and -tired of the political preachers across this country telling me as a citizen -that if I want to be a moral person, I must believe in "A," "B," "C," and -"D." Just who do they think they are? And from where do they presume to -claim the right to dictate their moral beliefs to me? And I am even more -angry as a legislator who must endure the threats of every religious group -who thinks it has some God-granted right to control my vote on every roll -call in the Senate. I am warning them today: I will fight them every step -of the way if they try to dictate their moral convictions to all Americans -in the name of "conservatism." - -- Senator Barry Goldwater, Congressional Record -% -HR 3128. Omnibus Budget Reconciliation, Fiscal 1986. Martin, R-Ill., motion -that the House recede from its disagreement to the Senate amendment making -changes in the bill to reduce fiscal 1986 deficits. The Senate amendment -was an amendment to the House amendment to the Senate amendment to the House -amendment to the Senate amendment to the bill. The original Senate amendment -was the conference agreement on the bill. Agreed to. - -- Albuquerque Journal -% -Hubbard's Law: - Don't take life too seriously; - you won't get out of it alive. -% -Hug me now, you mad, impetuous fool!! -Oh wait... -I'm a computer, and you're a person. It would never work out. -Never mind. -% -Huh? -% -Human beings were created by water to transport it uphill. -% -Human cardiac catheterization was introduced by Werner Forssman in 1929. -Ignoring his department chief, and tying his assistant to an operating -table to prevent her interference, he placed a urethral catheter into -a vein in his arm, advanced it to the right atrium [of his heart], and -walked upstairs to the x-ray department where he took the confirmatory -x-ray film. In 1956, Dr. Forssman was awarded the Nobel Prize. -% -Human kind cannot bear very much reality. - -- T. S. Eliot, "Four Quartets: Burnt Norton" -% -Human resources are human first, and resources second. - -- J. Garbers -% -Humanity has advanced, when it has advanced, not because it has been sober, -responsible, and cautious, but because it has been playful, rebellious, and -immature. - -- Tom Robbins -% -Humans are communications junkies. We just can't get enough. - -- Alan Kay -% -Humility is the first of the virtues -- for other people. - -- Oliver Wendell Holmes -% -Hummingbirds never remember the words to songs. -% -Humor is a drug which it's the fashion to abuse. - -- William Gilbert -% -Humorists always sit at the children's table. - -- Woody Allen -% -"Humpf!" Humpfed a voice! "For almost two days you've run wild and insisted on -chatting with persons who've never existed. Such carryings-on in our peaceable -jungle! We've had quite enough of you bellowing bungle! And I'm here to -state," snapped the big kangaroo, "That your silly nonsensical game is all -through!" And the young kangaroo in her pouch said, "Me, too!" - "With the help of the Wickersham Brothers and dozens of Wickersham -Uncles and Wickersham Cousins and Wickersham In-Laws, whose help I've engaged, -You're going to be roped! And you're going to be caged! And, as for your -dust speck... Hah! That we shall boil in a hot steaming kettle of Beezle-But -oil!" - -- Dr. Seuss, "Horton Hears a Who" -% -Humpty Dumpty sat on the wall, -Humpty Dumpty had a great fall! -All the king's horses, -And all the king's men, -Had scrambled eggs for breakfast again! -% -Humpty Dumpty was pushed. -% -Hurewitz's Memory Principle: - The chance of forgetting something is directly proportional - to... to... uh..... -% -Hydrogen: A colorless, odorless, lighter than air gas which, given -time, turns into people. - -- Harlow Shapley -% -I: - The best way to make a silk purse from a sow's ear is to begin - with a silk sow. The same is true of money. -II: - If today were half as good as tomorrow is supposed to be, it would - probably be twice as good as yesterday was. -III: - There are no lazy veteran lion hunters. -IV: - If you can afford to advertise, you don't need to. -V: - One-tenth of the participants produce over one-third of the output. - Increasing the number of participants merely reduces the average - output. - -- Norman Augustine -% -I accept chaos. I am not sure whether it accepts me. I know some people -are terrified of the bomb. But then some people are terrified to be seen -carrying a modern screen magazine. Experience teaches us that silence -terrifies people the most. - -- Bob Dylan -% -I acted to show my love for Jodie Foster. - -- John Hinckley -% -I ain't got no quarrel with them Viet Congs. - -- Muhammad Ali -% -I allow the world to live as it chooses, -and I allow myself to live as I choose. -% -I also believe that academic freedom should protect the right of a professor -or student to advocate Marxism, socialism, communism, or any other minority -viewpoint -- no matter how distasteful to the majority. - -- Richard M. Nixon - -What are our schools for if not indoctrination against Communism? - -- Richard M. Nixon -% -I always choose my friends for their good looks and my enemies for their -good intellects. Man cannot be too careful in his choice of enemies. - -- Oscar Wilde, "The Picture of Dorian Gray" -% -I always had a repulsive need to be something more than human. - -- David Bowie -% -I always pass on good advice. It is the only thing to do with it. -It is never any good to oneself. - -- Oscar Wilde, "An Ideal Husband" -% -I always say beauty is only sin deep. - -- H. H. Munro, a.k.a. Saki, "Reginald's Choir Treat" -% -I always turn to the sports pages first, which record people's -accomplishments. The front page has nothing but man's failures. - -- Chief Justice Earl Warren -% -I always wake up at the crack of ice. - -- Joe E. Lewis -% -I always will remember -- I was in no mood to trifle; -'Twas a year ago November -- I got down my trusty rifle -I went out to shoot some deer And went out to stalk my prey -- -On a morning bright and clear. What a haul I made that day! -I went and shot the maximum I tied them to my bumper and -The game laws would allow: I drove them home somehow, -Two game wardens, seven hunters, Two game wardens, seven hunters, -And a cow. And a cow. - -The Law was very firm, it People ask me how I do it -Took away my permit-- And I say, "There's nothin' to it! -The worst punishment I ever endured. You just stand there lookin' cute, -It turns out there was a reason: And when something moves, you shoot." -Cows were out of season, and And there's ten stuffed heads -One of the hunters wasn't insured. In my trophy room right now: - Two game wardens, seven hunters, - And a pure-bred gurnsey cow. - -- Tom Lehrer, "The Hunting Song" -% -I am a bookaholic. If you are a decent -person, you will not sell me another book. -% -I am a computer. -I am dumber than any human and smarter than any administrator. -% -I am a conscientious man, when I throw -rocks at seabirds I leave no tern unstoned. - -- Ogden Nash, "Everybody's Mind to Me a Kingdom Is" -% -I am a deeply superficial person. - -- Andy Warhol -% -I am a friend of the working man, and I would rather be his friend -than be one. - -- Clarence Darrow -% -I am a man: nothing human is alien to me. - -- Publius Terentius Afer (Terence) -% -I am a PC technician - however, this has unfortunately caused my -computer to be running Win98. - -- seen on a FreeBSD mailing-list -% -I am America's child, a spastic slogging on demented -limbs drooling I'll trade my PhD for a telephone voice. - -- Burt Lanier Safford III, "An Obscured Radiance" -% -I am an optimist. It does not seem too much use being anything else. - -- Winston Churchill -% -I am convinced that the manufacturers of carpet odor removing powder -have included encapsulated time released cat urine in their products. -This technology must be what prevented its distribution during my mom's -reign. My carpet smells like piss, and I don't have a cat. Better go -buy some more. - -- timw@zeb.USWest.COM -% -I am convinced that the truest act of courage is to sacrifice ourselves -for others in a totally nonviolent struggle for justice. To be a man -is to suffer for others. - -- Cesar Chavez -% -I am fairly unrepentant about her poetry. I really think that three -quarters of it is gibberish. However, I must crush down these thoughts -otherwise the dove of peace will shit on me. - -- Noel Coward on Edith Sitwell -% -I am firm. You are obstinate. He is a pig-headed fool. - -- Katharine Whitehorn -% -I am getting into abstract painting. Real abstract -- no brush, no canvas, -I just think about it. I just went to an art museum where all of the art -was done by children. All the paintings were hung on refrigerators. - -- Steven Wright -% -I am, in point of fact, a particularly haughty and exclusive person, -of pre-Adamite ancestral descent. You will understand this when I tell -you that I can trace my ancestry back to a protoplasmal primordial -atomic globule. Consequently, my family pride is something -inconceivable. I can't help it. I was born sneering. - -- Pooh-Bah, "The Mikado", Gilbert & Sullivan -% -I am just a nice, clean-cut Mongolian boy. - -- Yul Brynner, 1956 -% -I am looking for a honest man. - -- Diogenes the Cynic -% -I am more bored than you could ever possibly be. Go back to work. -% -I am NOMAD! -% -I am not a crook. - -- Richard M. Nixon -% -I am not a politician and my other habits are also good. - -- A. Ward -% -I am not afraid of tomorrow, for I have seen yesterday and I love today. - -- William Allen White -% -I am not an Economist. I am an honest man! - -- Paul McCracken -% -I am not now and never have been a girl friend of Henry Kissinger. - -- Gloria Steinem -% -I am not now, nor have I ever been, a member of the demigodic party. - -- Dennis M. Ritchie -% -I am not sure what this is, but an "F" would only dignify it. - -- English Professor -% -I am of the belief that catnip arrived on the planet in the same spaceship -that delivered cats. It is the only thing they have from their home -planet. Tuna, chicken, sparrow-brains, etc., these are all things of our -world that they like, but catnip is crack from home. - -- Bill Cole -% -I am only one, but I am one. I cannot do everything, but I can do -something. And I will not let what I cannot do interfere with what -I can do. - -- Edward Everett Hale, (1822 - 1909) -% -I am professionally trained in computer science, which is to say -(in all seriousness) that I am extremely poorly educated. - -- Joseph Weizenbaum, "Computer Power and Human Reason" -% -I am ready to meet my Maker. Whether my Maker is prepared -for the great ordeal of meeting me is another matter. - -- Winston Churchill -% -I am returning this otherwise good typing paper to you because someone -has printed gibberish all over it and put your name at the top. - -- Professor Lowd, English, Ohio University -% -I am so optimistic about beef prices that I've just leased a pot roast -with an option to buy. -% -I am the mother of all things, and all things should wear a sweater. -% -I am the wandering glitch -- catch me if you can. -% -I am two fools, I know, for loving, and for saying so. - -- John Donne -% -I am two with nature. - -- Woody Allen -% -I am very fond of the company of ladies. I like their beauty, -I like their delicacy, I like their vivacity, and I like their silence. - -- Samuel Johnson -% -I appreciate the fact that this draft was done in haste, but some of the -sentences that you are sending out in the world to do your work for you are -loitering in taverns or asleep beside the highway. - -- Dr. Dwight Van de Vate, Professor of Philosophy, - University of Tennessee at Knoxville -% -I argue very well. Ask any of my remaining friends. I can win an -argument on any topic, against any opponent. People know this, and -steer clear of me at parties. Often, as a sign of their great respect, -they don't even invite me. - -- Dave Barry -% -I asked a teacher what the opposite of a miracle was and she, without -thinking, I assume, said it was an act of God. - -- Terry Prachett (Daily Mail 21 june 2008) -% -I asked the engineer who designed the communication terminal's keyboards -why these were not manufactured in a central facility, in view of the -small number needed [1 per month] in his factory. He explained that this -would be contrary to the political concept of local self-sufficiency. -Therefore, each factory needing keyboards, no matter how few, manufactures -them completely, even molding the keypads. - -- Isaac Auerbach, IEEE "Computer", Nov. 1979 -% -I attribute my success to intelligence, guts, determination, honesty, -ambition, and having enough money to buy people with those qualities. -% -I B M -U B M -We all B M -For I B M!!!! - -- H.A.R.L.I.E. -% -I base my fashion taste on what doesn't itch. - -- Gilda Radner -% -I began many years ago, as so many young men do, in searching for the -perfect woman. I believed that if I looked long enough, and hard enough, -I would find her and then I would be secure for life. Well, the years -and romances came and went, and I eventually ended up settling for someone -a lot less than my idea of perfection. But one day, after many years -together, I lay there on our bed recovering from a slight illness. My -wife was sitting on a chair next to the bed, humming softly and watching -the late afternoon sun filtering through the trees. The only sounds to -be heard elsewhere were the clock ticking, the kettle downstairs starting -to boil, and an occasional schoolchild passing beneath our window. And -as I looked up into my wife's now wrinkled face, but still warm and -twinkling eyes, I realized something about perfection... It comes only -with time. - -- James L. Collymore, "Perfect Woman" -% -I believe a little incompatibility is the spice of life, -particularly if he has income and she is pattable. - -- Ogden Nash -% -I believe in an America where the separation of church and state is absolute --- where no Catholic prelate would tell the president (should he be Catholic) -how to act, and no Protestant minister would tell his parishioners for whom -to vote -- where no church or church school is granted any public funds or -political preference -- and where no man is denied public office merely -because his religion differs from the president who might appoint him or -the people who might elect him. - -- John F. Kennedy -% -I believe in getting into hot water; it keeps you clean. - -- G. K. Chesterton -% -I believe in sex and death -- two experiences that come once in a lifetime. - -- Woody Allen -% -I believe that professional wrestling is clean -and everything else in the world is fixed. - -- Frank Deford, sports writer -% -I believe that the moment is near when by a procedure of active paranoiac -thought, it will be possible to systematize confusion and contribute to the -total discrediting of the world of reality. - -- Salvador Dali -% -I belong to no organized party. I am a Democrat. - -- Will Rogers -% -I bet the human brain is a kludge. - -- Marvin Minsky -% -I BET WHAT HAPPENED was they discovered fire and invented the wheel on -the same day. Then that night, they burned the wheel. - -- Jack Handey, "The New Mexican" (1988) -% -I BET WHEN NEANDERTHAL KIDS would make a snowman, someone would always -end up saying, "Don't forget the thick heavy brows." Then they would get -embarrassed because they remembered they had the big hunky brows too, and -they'd get mad and eat the snowman. - -- Jack Handey, "The New Mexican" (1988) -% -I bet you have fun chasing the soap around the bathtub. - -- Princess Diana, to a one-armed war veteran during - a visit to a London veterans hospital -% -I brake for chezlogs! -% -I braved the contempt of my friends last week and ventured out to see -Bambi, the Disney rerelease that is proving to be a hit once again in the -box office. I was looking forward to a gentle, soothing, late afternoon -relief from the Washington Summer. Instead I was traumatized. As a -psycho-sexual return to the horrors of early adolescence, it couldn't be -more effective. For the first half-hour, you're lulled into an agreeable -sense of security and comfort. Birds twitter; small rabbits turn out to -be great conversationalists. Pop is what Senator Moynihan would describe -as an absent father, but Mom's there to make you feel OK in the odd -thunderstorm. You make great friends, fool around on the ice, discover -the meadow, generally mellow out. Then, without any particular warning, -your mom gets shot, your voice breaks, huge growths start appearing on -your head, and your peers start heading off into the clover with the -apparent intention of having sex. Next thing you know, the forest burns -down. If I were still eight, I think I'd prefer Rambo III. - -- Townsend Davis -% -I call them as I see them. If I can't see them, I make them up. - -- Biff Barf -% -I called my parents the other night, but I forgot about the time difference. -They're still living in the fifties. - -- Strange de Jim -% -I came, I saw, I deleted all your files. -% -I came out of twelve years of college and I didn't even know how to sew. -All I could do was account -- I couldn't even account for myself. - -- The Firesign Theatre -% -I came to MIT to get an education for myself and a diploma for my mother. -% -I can feel for her because, although I have never been an Alaskan -prostitute dancing on the bar in a spangled dress, I still get very -bored with washing and ironing and dishwashing and cooking day after -relentless day. - -- Betty MacDonald -% -I can give you my word, but I know what it's worth and you don't. - -- Nero Wolfe, "Over My Dead Body" -% -I can hire one half of the working class to kill the other half. - -- Jay Gould -% -I can mend the break of day, heal a broken heart, -and provide temporary relief to nymphomaniacs. - -- Larry Lee -% -I can read your mind, and you should be ashamed of yourself. -% -I can relate to that. -% -I can remember when a good politician had to be 75 percent ability and -25 percent actor, but I can well see the day when the reverse could be -true. - -- Harry S. Truman -% -I can resist anything but temptation. -% -I can see him a'comin' -With his big boots on, -With his big thumb out, -He wants to get me. -He wants to hurt me. -He wants to bring me down. -But some time later, -When I feel a little straighter, -I'll come across a stranger -Who'll remind me of the danger, -And then.... I'll run him over. -Pretty smart on my part! -To find my way... In the dark! - -- Phil Ochs -% -I can write better than anybody who can write faster, -and I can write faster than anybody who can write better. - -- A. J. Liebling -% -I cannot and will not cut my conscience to fit this year's fashions. - -- Lillian Hellman -% -I cannot believe that God plays dice with the cosmos. - -- Albert Einstein, on the randomness of quantum mechanics -% -I cannot conceive that anybody will require multiplications at the rate -of 40,000 or even 4,000 per hour ... - -- F. H. Wales (1936) -% -I cannot draw a cart, nor eat dried oats; -If it be man's work I will do it. -% -I cannot overemphasize the importance of good grammar. - -What a crock. I could easily overemphasize the importance of good -grammar. For example, I could say: "Bad grammar is the leading cause -of slow, painful death in North America," or "Without good grammar, the -United States would have lost World War II." - -- Dave Barry, "An Utterly Absurd Look at Grammar" -% -I can't believe that out of 100,000 sperm, you were the quickest. - -- Steven Pearl -% -I CAN'T come back, I don't know how it works. - -- Frank Morgan as The Wizard, "The Wizard of Oz" -% -I can't complain, but sometimes I still do. - -- Joe Walsh -% -I can't decide whether to commit suicide or go bowling. - -- Florence Henderson -% -I can't die until the government finds a safe place to bury my liver. - -- Phil Harris -% -I Can't Get Over You, So I Get Up and Go Around to the Other Side -If You Won't Leave Me Alone, I'll Find Someone Who Will -I Knew That You'd Committed a Sin When You Came Home Late With - Your Socks Outside-in -I'm a Rabbit in the Headlights of Your Love -Don't Kick My Tires If You Ain't Gonna Take Me For a Ride -I Liked You Better Before I Knew You So Well -I Still Miss You, Baby, But My Aim's Gettin' Better -I've Got Red Eyes From Your White Lies and I'm Blue All the Time - -- proposed Country-Western song titles from "Wordplay" -% -I can't mate in captivity. - -- Gloria Steinem, on why she has never married -% -I can't seem to bring myself to say, "Well, I guess I'll be toddling along." -It isn't that I can't toddle. It's that I can't guess I'll toddle. - -- Robert Benchley -% -I can't stand squealers; hit that guy. - -- Albert Anastasia -% -I can't stand this proliferation of paperwork. It's useless to fight the -forms. You've got to kill the people producing them. - -- Vladimir Kabaidze, general director of the Ivanovo Machine - Building Works (near Moscow) in a speech to the Communist - Party Conference -% -I can't understand it. -I can't even understand the people who can understand it. - -- Queen Juliana of the Netherlands -% -I can't understand why a person will take a year or two to write a -novel when he can easily buy one for a few dollars. - -- Fred Allen -% -I can't understand why people are frightened of new ideas. -I'm frightened of the old ones. - -- John Cage -% -I collect rare photographs... I have two... One of Houdini locking his -keys in his car... the other is a rare picture of Norman Rockwell beating -up a child. - -- Steven Wright -% -I come from a small town whose population never changed. Each time -a woman got pregnant, someone left town. - -- Michael Prichard -% -I consider a new device or technology to have been -culturally accepted when it has been used to commit a murder. - -- M. Gallaher -% -I consider the day misspent that I am not -either charged with a crime, or arrested for one. - -- "Ratsy" Tourbillon -% -I could dance till the cows come home. On second thought, I'd rather -dance with the cows till you come home. - -- Groucho Marx -% -I could never learn to like her -- -except on a raft at sea with no other provisions in sight. - -- Mark Twain -% -I couldn't possibly fail to disagree with you less. -% -I couldn't remember when I had been so disappointed. Except perhaps the -time I found out that M&Ms really DO melt in your hand. - -- Peter Oakley -% -I despise the pleasure of pleasing people whom I despise. -% -I didn't believe in reincarnation in any of my other lives. I don't see why -I should have to believe in it in this one. - -- Strange de Jim -% -I didn't do it! Nobody saw me do it! Can't prove anything! - -- Bart Simpson -% -I didn't get sophisticated -- I just got tired. -But maybe that's what sophisticated is -- being tired. - -- Rita Gain -% -I didn't know he was dead; I thought he was British. -% -I didn't know it was impossible when I did it. -% -I didn't like the play, but I saw it under adverse conditions. -The curtain was up. -% -I disagree with what you say, but will defend -to the death your right to tell such LIES! -% -I distrust a close-mouthed man. He generally picks the wrong time to talk -and says the wrong things. Talking's something you can't do judiciously, -unless you keep in practice. Now, sir, we'll talk if you like. I'll tell -you right out, I'm a man who likes talking to a man who likes to talk. - -- Sidney Greenstreet, "The Maltese Falcon" -% -I distrust a man who says when. If he's got to be careful not to drink -too much, it's because he's not to be trusted when he does. - -- Sidney Greenstreet, "The Maltese Falcon" -% -I do desire we may be better strangers. - -- William Shakespeare, "As You Like It" -% -I do enjoy a good long walk -- especially when my wife takes one. -% -I do hate sums. There is no greater mistake than to call arithmetic an -exact science. There are permutations and aberrations discernible to -minds entirely noble like mine; subtle variations which ordinary -accountants fail to discover; hidden laws of number which it requires a -mind like mine to perceive. For instance, if you add a sum from the -bottom up, and then again from the top down, the result is always -different. - -- Mrs. La Touche (19th cent.) -% -I do not believe in the creed professed by the Jewish Church, by the Roman -Church, by the Greek Church, by the Turkish Church, by the Protestant Church, -nor by any Church that I know of. My own mind is my own Church. - -- Thomas Paine -% -I do not care if half the league strikes. Those who do will encounter -quick retribution. All will be suspended, and I don't care if it wrecks -the National League for five years. This is the United States of America -and one citizen has as much right to play as another. - -- Ford Frick, National League President, reacting to a - threatened strike by some Cardinal players in 1947 if - Jackie Robinson took the field against St. Louis. The - Cardinals backed down and played. -% -I do not fear computers. I fear the lack of them. - -- Isaac Asimov -% -I do not feel obliged to believe that the same God who has endowed us with -sense, reason, and intellect has intended us to forgo their use. - -- Galileo Galilei -% -I do not know myself and God forbid that I should. - -- Johann Wolfgang von Goethe -% -I do not know where to find in any literature, whether ancient or modern, -any adequate account of that nature with which I am acquainted. Mythology -comes nearest to it of any. - -- Henry David Thoreau -% -I do not know whether I was then a man dreaming I was a -butterfly, or whether I am now a butterfly dreaming I am a man. - -- Chuang Tzu -% -I do not remember ever having seen a sustained argument by an author which, -starting from philosophical premises likely to meet with general acceptance, -reached the conclusion that a praiseworthy ordering of one's life is to -devote it to research in mathematics. - -- Sir Edmund Whittaker, "Scientific American", Vol. 183 -% -I do not seek the ignorant; the ignorant seek me -- I will instruct them. -I ask nothing but sincerity. If they come out of habit, they become -tiresome. - -- I Ching -% -I do not take drugs -- I am drugs. - -- Salvador Dali -% -I don't believe in astrology. But then I'm an Aquarius, and Aquarians -don't believe in astrology. - -- James R. F. Quirk -% -I don't believe there really IS a GAS SHORTAGE.. I think it's all just -a BIG HOAX on the part of the plastic sign salesmen -- to sell more -numbers!! -% -I don't care for the Sugar Smacks commercial. I don't like the idea of -a frog jumping on my Breakfast. - -- Lowell, Chicago Reader 10/15/82 -% -I don't care how poor and inefficient a little country is; they like to -run their own business. I know men that would make my wife a better -husband than I am; but, darn it, I'm not going to give her to 'em. - -- The Best of Will Rogers -% -I don't care what star you're following, get that camel off my front lawn! - -- Heard in Bethlehem -% -I don't care where I sit as long as I get fed. - -- Calvin Trillin -% -I don't care who does the electing as long as I get to do the -nominating. - -- Boss Tweed -% -I don't deserve this award, but I have arthritis and I don't -deserve that either. - -- Jack Benny -% -I don't do it for the money. - -- Donald Trump, Art of the Deal -% -I don't drink, I don't like it, it makes me feel too good. - -- K. Coates -% -I don't even butter my bread. I consider that cooking. - -- Katherine Cebrian -% -I don't get no respect. -% -I don't have an eating problem. I eat. -I get fat. I buy new clothes. No problem. -% -I don't have any solution but I certainly admire the problem. - -- Ashleigh Brilliant -% -I don't have any use for bodyguards, but I do have a specific use for two -highly trained certified public accountants. - -- Elvis Presley -% -I don't have to take this abuse from you -- I've got -hundreds of people waiting to abuse me. - -- Bill Murray, "Ghostbusters" -% -I don't kill flies, but I like to mess with their minds. I hold them above -globes. They freak out and yell "Whooa, I'm *way* too high." - -- Bruce Baum -% -I don't know anything about music. In my line you don't have to. - -- Elvis Presley -% -I don't know what Descartes' got, -But booze can do what Kant cannot. - -- Mike Cross -% -I don't know who my grandfather was; I am much -more concerned to know what his grandson will be. - -- Abraham Lincoln -% -I don't know why anyone would want a computer in their home. - -- Ken Olsen, president of DEC, 1974 -% -I don't know why we're here, I say we all go home and free associate. -% -I don't like spinach, and I'm glad I don't, -because if I liked it I'd eat it, and I'd just hate it. - -- Clarence Darrow -% -I don't like the Dutchman. He's a crocodile. He's sneaky. -I don't trust him. - -- Jack "Legs" Diamond, just before a peace conference - with Dutch Schultz. - -I don't trust Legs. He's nuts. He gets excited and starts pulling a -trigger like another guy wipes his nose. - -- Dutch Schultz, just before a peace conference with - "Legs" Diamond. -% -I don't make the rules, Gil, I only play the game. - -- Cash McCall -% -I don't mind arguing with myself. -It's when I lose that it bothers me. - -- Richard Powers -% -I don't mind going nowhere as long as it's an interesting path. - -- Ronald Mabbitt -% -I don't mind what Congress does, as long as they don't do it in the -streets and frighten the horses. - -- Victor Hugo -% -I don't need no arms around me... -I don't need no drugs to calm me... -I have seen the writing on the wall. -Don't think I need anything at all. -No! Don't think I need anything at all! -All in all, it was all just bricks in the wall. -All in all, it was all just bricks in the wall. - -- Pink Floyd, "Another Brick in the Wall", Part III -% -I don't object to sex before marriage, but two minutes before?!? -% -I don't remember it, but I have it written down. -% -I don't see what's wrong with giving Bobby a little experience before -he starts to practice law. - -- John F. Kennedy, upon appointing his brother - Attorney-General. -% -I DON'T THINK I'M ALONE when I say I'd like to see more and more planets -fall under the ruthless domination of our solar system. - -- Jack Handey, "The New Mexican" (1988) -% -"I don't think so," said Ren'e Descartes. Just then, he vanished. -% -I don't think they are going to give a shit about the Republican -Committee trying to bug the Democratic Committee's headquarters. - -- Richard M. Nixon, 1972 -% -"I don't understand," said the scientist, "why you lemmings all rush down -to the sea and drown yourselves." - -"How curious," said the lemming. "The one thing I don't understand is why -you human beings don't." - -- James Thurber -% -I don't understand you anymore. -% -I don't wanna argue, and I don't wanna fight, -But there will definitely be a party tonight... -% -I don't want a pickle, -I just wanna ride on my motorcycle. -And I don't want to die, -I just want to ride on my motorcycle. - -- Arlo Guthrie -% -I don't want people to love me. It makes for obligations. - -- Jean Anouilh -% -I don't want to achieve immortality through my work. -I want to achieve immortality through not dying. - -- Woody Allen -% -I don't want to alarm anybody, but there is an excellent chance that -the Earth will be destroyed in the next several days. Congress is -thinking about eliminating a federal program under which scientists -broadcast signals to alien beings. This would be a large mistake. -Alien beings have nuclear blaster death cannons. You cannot cut off -their federal programs as if they were merely poor people ... - -- Dave Barry, "THE ALIENS ARE COMING, THE ALIENS ARE - COMING!" -% -I don't want to bore you, but there's nobody else around for me to bore. -% -I don't want to live on in my work, I want to live on in my apartment. - -- Woody Allen -% -I don't wish to appear overly inquisitive, but are you still alive? -% -I dote on his very absence. - -- William Shakespeare, "The Merchant of Venice" -% -I doubt, therefore I might be. -% -I dread success. To have succeeded is to have finished one's business -on earth, like the male spider, who is killed by the female the moment -he has succeeded in his courtship. I like a state of continual -becoming, with a goal in front and not behind. - -- George Bernard Shaw -% -I drink to make other people interesting. - -- George Jean Nathan -% -I either want less decadence or more chance to participate in it. -% -I enjoy the time that we spend together. -% -I exist, therefore I am paid. -% -I fear explanations explanatory of things explained. -% -I feel sorry for your brain... all alone in that great big head... -% -I fell asleep reading a dull book, -and I dreamt that I was reading on, -so I woke up from sheer boredom. -% -I figure that if God actually does exist, He's big enough to understand an -honest difference of opinion. - -- Isaac Asimov -% -I finally went to the eye doctor. I got contacts. -I only need them to read, so I got flip-ups. - -- Steven Wright -% -I find this corpse guilty of carrying a concealed weapon and I fine it $40. - -- Judge Roy Bean, finding a pistol and $40 on a man he'd - just shot. -% -I found out why my car was humming. It had forgotten the words. -% -I found Rome a city of bricks and left it a city of marble. - -- Augustus Caesar -% -I gained nothing at all from Supreme Enlightenment, and for that very -reason it is called Supreme Enlightenment. - -- Gautama Buddha -% -I gave my love an Apple, that had no core; -I gave my love a building, that had no floor; -I wrote my love a program, that had no end; -I gave my love an upgrade, with no cryin'. - -How can there be an Apple, that has no core? -How can there be a building, that has no floor? -How can there be a program, that has no end? -How can there be an upgrade, with no cryin'? - -An Apple's MOS memory don't use no core! -A building that's perfect, it has no flaw! -A program with GOTOs, it has no end! -I lied about the upgrade, with no cryin'! -% -I gave up Smoking, Drinking and Sex. It was the most *_h_o_r_r_i_f_y_i_n_g* 20 -minutes of my life! -% -I generally avoid temptation unless I can't resist it. - -- Mae West -% -I get my exercise acting as pallbearer to my friends who exercise. - -- Chauncey Depew -% -I get up each morning, gather my wits. -Pick up the paper, read the obits. -If I'm not there I know I'm not dead. -So I eat a good breakfast and go back to bed. - -Oh, how do I know my youth is all spent? -My get-up-and-go has got-up-and-went. -But in spite of it all, I'm able to grin, -And think of the places my get-up has been. - -- Pete Seeger -% -I give you the man who -- the man who -- uh, I forgets the man who? - -- Beauregard Bugleboy -% -I go on working for the same reason a hen goes on laying eggs. - -- H. L. Mencken -% -I go the way that Providence dictates. - -- Adolf Hitler -% -I got my driver's license photo taken out of focus on purpose. Now -when I get pulled over the cop looks at it (moving it nearer and -farther, trying to see it clearly)... and says, "Here, you can go." - -- Steven Wright -% -I got the bill for my surgery. Now I know what those doctors were -wearing masks for. - -- James Boren -% -I got this powdered water -- now I don't know what to add. - -- Steven Wright -% -I got tired of listening to the recording on the phone at the movie -theater. So I bought the album. I got kicked out of a theater the -other day for bringing my own food in. I argued that the concession -stand prices were outrageous. Besides, I hadn't had a barbecue in a -long time. I went to the theater and the sign said adults $5 children -$2.50. I told them I wanted 2 boys and a girl. I once took a cab to -a drive-in movie. The movie cost me $95. - -- Steven Wright -% -I got vision, and the rest of the world wears bifocals. - -- Butch Cassidy -% -I GUESS I KINDA LOST CONTROL because in the middle of the play I ran up -and lit the evil puppet villain on fire. - -No, I didn't. Just kidding. I just said that to illustrate one of the -human emotions which is freaking out. Another emotion is greed, as when -you kill someone for money or something like that. Another emotion is -generosity, as when you pay someone double what he paid for his stupid -puppet. - -- Jack Handey, "The New Mexican" (1988) -% -I GUESS I'LL NEVER FORGET HER. And maybe I don't want to. Her spirit -was wild, like a wild monkey. Her beauty was like a beautiful horse -being ridden by a wild monkey. I forget her other qualities. - -- Jack Handey, "The New Mexican" (1988) -% -I guess I've been so wrapped up in playing the game that I never took -time enough to figure out where the goal line was -- what it meant to -win -- or even how you won. - -- Cash McCall -% -I guess I've been wrong all my life, but so have billions of -other people... Certainty is just an emotion. - -- Hal Clement -% -I GUESS OF ALL MY UNCLES, I liked Uncle Caveman the best. We called him -Uncle Caveman because he lived in a cave and because sometimes he'd eat -one of us. Later, we found out he was a bear. - -- Jack Handey, "The New Mexican" (1988) -% -I guess the Little League is even littler than we thought. - -- D. Cavett -% -I GUESS WE WERE ALL GUILTY, in a way. We shot him, we skinned him, and -we all got a complimentary bumper sticker that said, "I helped skin Bob." - -- Jack Handey, "The New Mexican" (1988) -% -I had a dream last night... -I dreamt about 1976. -I dreamt about a country with incurable brain damage... -I even dreamt they gave it a heart transplant. -Then I woke up and I knew it was only a nightmare... -so I went back to sleep again. - -- Ralph Steadman, "Fear and Loathing '72" -% -I had a feeling once about mathematics -- that I saw it all. Depth beyond -depth was revealed to me -- the Byss and the Abyss. I saw -- as one might -see the transit of Venus or even the Lord Mayor's Show -- a quantity passing -through infinity and changing its sign from plus to minus. I saw exactly -why it happened and why tergiversation was inevitable -- but it was after -dinner and I let it go. - -- Winston Churchill -% -I had a virgin once. I had to go to Guatemala for her. She was blind -in one eye, and she had a stuffed alligator that said, "Welcome to Miami -Beach." - -- The Stunt Man -% -I had another dream the other day about government financial management -people. They were small and rodent-like with padlocked ears, as if they -had stepped out of a painting by Goya. -% -I had another dream the other day about music critics. They were small -and rodent-like with padlocked ears, as if they had stepped out of a -painting by Goya. - -- Stravinsky -% -I had never been too political, but I knew how white people treated black -people and it was hard for me to come back to the bullshit white people -put a black person through in this country. To realize you don't have any -power to make things different is a bitch. - -- Miles Davis -% -I had no shoes and I pitied myself. Then I met a man who had no feet, -so I took his shoes. - -- Dave Barry -% -I had the rare misfortune of being one of the first people to try and -implement a PL/1 compiler. - -- T. Cheatham -% -I had to censor everything my sons watched ... even on the Mary Tyler -Moore show I heard the word "damn!" - -- Mary Lou Bax -% -I had to hit him -- he was starting to make sense. -% -I hate babies. They're so human. - -- H. H. Munro -% -I hate dying. - -- Dave Johnson -% -I hate it when my foot falls asleep during the day cause that means -it's going to be up all night. - -- Steven Wright -% -I hate mankind, for I think myself one of the best of them, -and I know how bad I am. - -- Samuel Johnson -% -I hate quotations. - -- Ralph Waldo Emerson -% -I hate small towns because once you've seen the cannon in the park -there's nothing else to do. - -- Lenny Bruce -% -I hate trolls. Maybe I could metamorph it into something else -- like a -ravenous, two-headed, fire-breathing dragon. - -- Willow -% -I have a box of telephone rings under my bed. Whenever I get lonely, I -open it up a little bit, and I get a phone call. One day I dropped the -box all over the floor. The phone wouldn't stop ringing. I had to get -it disconnected. So I got a new phone. I didn't have much money, so I -had to get an irregular. It doesn't have a five. I ran into a friend -of mine on the street the other day. He said why don't you give me a -call. I told him I can't call everybody I want to anymore, my phone -doesn't have a five. He asked how long had it been that way. I said I -didn't know -- my calendar doesn't have any sevens. - -- Steven Wright -% -I have a dog; I named him Stay. So when I'd go to call him, I'd say, "Here, -Stay, here..." but he got wise to that. Now when I call him he ignores me -and just keeps on typing. - -- Steven Wright -% -I have a dream. I have a dream that one day, on the red hills of Georgia, -the sons of former slaves and the sons of former slaveowners will be able to -sit down together at the table of brotherhood. - -- Martin Luther King, Jr. -% -I have a friend whose a billionaire. He invented Cliff's notes. When -I asked him how he got such a great idea he said, "Well first I... -I just... to make a long story short..." - -- Steven Wright -% -I have a hard time being attracted to anyone who can beat me up. - -- John McGrath, Atlanta sportswriter, on women weightlifters -% -I have a hobby. I have the world's largest collection of sea shells. -I keep it scattered on beaches all over the world. Maybe you've seen -some of it. - -- Steven Wright -% -I have a little shadow that goes in and out with me, -And what can be the use of him is more than I can see. -He is very, very like me from the heels up to the head; -And I see him jump before me, when I jump into my bed. - -The funniest thing about him is the way he likes to grow-- -Not at all like proper children, which is always very slow; -For he sometimes shoots up taller, like an india-rubber ball, -And he sometimes gets so little that there's none of him at all. - -- Robert Louis Stevenson -% -I have a map of the United States. It's actual size. -I spent last summer folding it. -People ask me where I live, and I say, "E6". - -- Steven Wright -% -I have a rock garden. Last week three of them died. - -- Richard Diran -% -I have a switch in my apartment that doesn't do anything. Every once -in a while I turn it on and off. On and off. On and off. One day I -got a call from a woman in France who said "Cut it out!" - -- Steven Wright -% -I have a terrible headache, I was putting on toilet water and the lid fell. -% -I have a theory that it's impossible to prove anything, -but I can't prove it. -% -I have a very firm grasp on reality! I can reach out and strangle it -any time! -% -I have a very strange feeling about this... - -- Luke Skywalker -% -I have already given two cousins to the war and I stand ready to -sacrifice my wife's brother. - -- Artemus Ward -% -I have always noticed that whenever a radical takes -to Imperialism, he catches it in a very acute form. - -- Winston Churchill, 1903 -% -I have an existential map. It has "You are here" written all over it. - -- Steven Wright -% -I have become me without my consent. -% -I have come up with a surefire concept for a hit television show, which -would be called "A Live Celebrity Gets Eaten by a Shark." - -- Dave Barry, "The Wonders of Sharks on TV" -% -I have defined the hundred per cent American as ninety-nine per -cent an idiot. - -- George Bernard Shaw -% -I have discovered that all human evil comes from this, man's being unable -to sit still in a room. - -- Blaise Pascal -% -I have discovered the art of deceiving diplomats. -I tell them the truth and they never believe me. - -- Camillo Di Cavour -% -I have found it impossible to carry the heavy burden of responsibility and -to discharge my duties as king as I would wish to do without the help and -support of the woman I love. - -- Edward, Duke of Windsor, announcing his abdication - of the British throne in order to marry the American - divorcee Wallis Warfield Simpson. (1936) -% -I have found little that is good about human beings. In my experience -most of them are trash. - -- Sigmund Freud -% -I have gained this by philosophy: -that I do without being commanded what others -do only from fear of the law. - -- Aristotle -% -I have great faith in fools -- self confidence my friends call it. - -- Edgar Allan Poe -% -I have had my television aerials removed. It's the moral equivalent -of a prostate operation. - -- Malcolm Muggeridge -% -I have hardly ever known a mathematician who was capable of reasoning. - -- Plato -% -I have just had eighteen whiskeys in a row. -I do believe that is a record. - -- Dylan Thomas, his last words -% -I have just read your lousy review buried in the back pages. You -sound like a frustrated old man who never made a success, an -eight-ulcer man on a four-ulcer job, and all four ulcers working. I -have never met you, but if I do you'll need a new nose and plenty of -beefsteak and perhaps a supporter below. Westbrook Pegler, a -guttersnipe, is a gentleman compared to you. You can take that as more -of an insult than as a reflection on your ancestry. - -- Harry S. Truman -% -I have learned silence from the talkative, -toleration from the intolerant, and kindness from the unkind. - -- Kahlil Gibran -% -I have learned -To spell hors d'oeuvres -Which still grates on -Some people's n'oeuvres. - -- Warren Knox -% -I have lots of things in my pockets; -None of them is worth anything. -Sociopolitical whines aside, -Gan you give me, gratis, free, -The price of half a gallon -Of Gallo extra bad -And most of the bus fare home. -% -I have made mistakes but I have never made the -mistake of claiming that I have never made one. - -- James Gordon Bennett -% -I have made this letter longer than usual -because I lack the time to make it shorter. - -- Blaise Pascal -% -I have more hit points that you can possible imagine. -% -I have more humility in my little finger than you have in your whole -_B_O_D_Y! - -- from "Cerebus" #82 -% -I have never been one to sacrifice -my appetite on the altar of appearance. - -- A. M. Readyhough -% -I have never let my schooling interfere with my education. - -- Mark Twain -% -I have never seen anything fill up a vacuum so fast and still suck. - -- Rob Pike, on X - -Steve Jobs said two years ago that X is brain-damaged and it will be -gone in two years. He was half right. - -- Dennis M. Ritchie - -Dennis Ritchie is twice as bright as Steve Jobs, and only half wrong. - -- Jim Gettys -% -I have never understood this liking for war. It panders to instincts -already catered for within the scope of any respectable domestic -establishment. - -- Alan Bennett -% -I have no doubt that it is a part of the destiny of the human race, -in its gradual improvement, to leave off eating animals. - -- Thoreau -% -I have no doubt the Devil grins, -As seas of ink I spatter. -Ye gods, forgive my "literary" sins-- -The other kind don't matter. - -- Robert W. Service -% -I have no right, by anything I do or say, to demean a human being in his -own eyes. What matters is not what I think of him; it is what he thinks -of himself. To undermine a man's self-respect is a sin. - -- Antoine de Saint-Exupery -% -I have not yet begun to byte! -% -I have nothing but utter contempt for the courts of this land. - -- George Wallace -% -I have now come to the conclusion never again to think of marrying, -and for this reason: I can never be satisfied with anyone who would -be blockhead enough to have me. - -- Abraham Lincoln -% -I have often looked at women and committed adultery in my heart. - -- Jimmy Carter -% -I have often regretted my speech, never my silence. - -- Publilius Syrus -% -I have sacrificed time, health, and fortune, in the desire to complete these -Calculating Engines. I have also declined several offers of great personal -advantage to myself. But, notwithstanding the sacrifice of these advantages -for the purpose of maturing an engine of almost intellectual power, and -after expending from my own private fortune a larger sum than the government -of England has spent on that machine, the execution of which it only -commenced, I have received neither an acknowledgment of my labors, nor even -the offer of those honors or rewards which are allowed to fall within the -reach of men who devote themselves to purely scientific investigations... - If the work upon which I have bestowed so much time and thought were -a mere triumph over mechanical difficulties, or simply curious, or if the -execution of such engines were of doubtful practicability or utility, some -justification might be found for the course which has been taken; but I -venture to assert that no mathematician who has a reputation to lose will -ever publicly express an opinion that such a machine would be useless if -made, and that no man distinguished as a civil engineer will venture to -declare the construction of such machinery impracticable... - And at a period when the progress of physical science is obstructed -by that exhausting intellectual and manual labor, indispensable for its -advancement, which it is the object of the Analytical Engine to relieve, I -think the application of machinery in aid of the most complicated and abstruse -calculations can no longer be deemed unworthy of the attention of the country. -In fact, there is no reason why mental as well as bodily labor should not -be economized by the aid of machinery. - -- Charles Babbage, "The Life of a Philosopher" -% -I have seen the future and it is just like the present, only longer. - -- Kehlog Albran, "The Profit" -% -I have seen the Great Pretender and he is not what he seems. -% -I have that old biological urge, -I have that old irresistible surge, -I'm hungry. -% -I have the simplest tastes. I am always satisfied with the best. - -- Oscar Wilde -% -I have to convince you, or at least snow you ... - -- Prof. Romas Aleliunas, CS 435 -% -I have to think hard to name an interesting man who does not drink. - -- Richard Burton -% -I have travelled the length and breadth of this country, and have talked with -the best people in business administration. I can assure you on the highest -authority that data processing is a fad and won't last out the year. - -- Editor in charge of business books at Prentice-Hall - publishers, responding to Karl V. Karlstrom (a junior - editor who had recommended a manuscript on the new - science of data processing), c. 1957 -% -I have ways of making money that you know nothing of. - -- John D. Rockefeller -% -I have yet to see any problem, however complicated, which, when looked -at in the right way, did not become still more complicated. - -- Poul Anderson -% -I haven't lost my mind -- it's backed up on tape somewhere. -% -I haven't lost my mind; I know exactly where I left it. -% -I hear the sound that the machines make, -and feel my heart break, just for a moment. -% -I hear what you're saying but I just don't care. -% -I heard a definition of an intellectual, that I thought was very -interesting: a man who takes more words than are necessary to tell -more than he knows. - -- Dwight D. Eisenhower -% -I hold it, that a little rebellion, now and then, is a good thing... - -- Thomas Jefferson -% -I hold your hand in mine, dear, I press it to my lips, -I take a healthy bite from your dainty fingertips, -My joy would be complete, dear, if you were only here, -But still I keep your hand as a precious souvenir. - -The night you died I cut it off, I really don't know why, -For now each time I kiss it I get bloodstains on my tie, -I'm sorry now I killed you, our love was something fine, -So until they come to get me I will hold your hand in mine. - - -- Tom Lehrer, "I Hold Your Hand In Mine" -% -I hope you're not pretending to be evil while -secretly being good. That would be dishonest. -% -I just asked myself... what would John DeLorean do? - -- Raoul Duke -% -I just ate a whole package of Sweet Tarts and a can of Coke. -I think I saw God. - -- B. Hathrume Duk -% -I just got off the phone with Sonny Barger [President of the Hell's Angels]. -He wants me to appear as a character witness for him at his murder trial -and said he'd be glad to appear as a character witness on my behalf if I -ever needed one. Needless to say, I readily agreed. - -- Thomas King Forcade, publisher of "High Times" -% -I just got out of the hospital after a -speed reading accident. I hit a bookmark. - -- Steven Wright -% -I just know I'm a better manager when I have Joe DiMaggio in center field. - -- Casey Stengel -% -I just need enough to tide me over until I need more. - -- Bill Hoest -% -I kissed my first girl and smoked my first cigarette on the same day. -I haven't had time for tobacco since. - -- Arturo Toscanini -% -I knew her before she was a virgin. - -- Oscar Levant, on Doris Day -% -I *knew* I had some reason for not logging you off... -If I could just remember what it was. -% -I knew one thing: as soon as anyone said you didn't need a gun, you'd better -take one along that worked. - -- Raymond Chandler -% -I know if you been talkin' you done said -just how surprised you wuz by the living dead. -You wuz surprised that they could understand you words -and never respond once to all the truth they heard. -But don't you get square! -There ain't no rule that says they got to care. -They can always swear they're deaf, dumb and blind. -% -I know it all. I just can't remember it all at once. -% -I know not how I came into this, -shall I call it a dying life or a living death? - -- St. Augustine -% -I know not with what weapons World War III will be fought, but -World War IV will be fought with sticks and stones. - -- Albert Einstein -% -I know on which side my bread is buttered. - -- John Heywood -% -I know the answer! The answer lies within the heart of all mankind! -The answer is twelve? I think I'm in the wrong building. - -- Charles Schulz -% -I know the disposition of women: when you will, they won't; when -you won't, they set their hearts upon you of their own inclination. - -- Publius Terentius Afer (Terence) -% -I know what "custody" [of the children] means. "Get even." That's all -custody means. Get even with your old lady. - -- Lenny Bruce -% -I know what you're thinking -- "Did he fire six shots or only five?" -Well, to tell you the truth, in all the excitement, I kind of lost track -myself. But being this is a .44 Magnum, the most powerful handgun in the -world, and would blow your head clean off, you've got to ask yourself -one question: "Do I feel lucky?" Well, do you, punk? - -- Harry Callahan, badge #2211 -% -I know you believe you understand what you think this fortune says, -but I'm not sure you realize that what you are reading is not what -it means. -% -I know you think you thought you knew what you thought I said, -but I'm not sure you understood what you thought I meant. -% -I know you're in search of yourself, I just haven't seen you anywhere. -% -I lately lost a preposition; -It hid, I thought, beneath my chair -And angrily I cried, "Perdition! -Up from out of under there." - -Correctness is my vade mecum, -And straggling phrases I abhor, -And yet I wondered, "What should he come -Up from out of under for?" - -- Morris Bishop -% -I lay my head on the railroad tracks, -Waitin' for the double E. -The railroad don't run no more. -Poor poor pitiful me. [chorus] - Poor poor pitiful me, poor poor pitiful me. - These young girls won't let me be, - Lord have mercy on me! - Woe is me! - -Well, I met a girl, West Hollywood, -Well, I ain't naming names. -But she really worked me over good, -She was just like Jesse James. -She really worked me over good, -She was a credit to her gender. -She put me through some changes, boy, -Sort of like a Waring blender. [chorus] - -I met a girl at the Rainbow Bar, -She asked me if I'd beat her. -She took me back to the Hyatt House, -I don't want to talk about it. [chorus] - -- Warren Zevon, "Poor Poor Pitiful Me" -% -I learned to play guitar just to get the girls, and anyone who says they -didn't is just lyin'! - -- Willie Nelson -% -I like being single. I'm always there when I need me. - -- Art Leo -% -I like myself, but I won't say I'm as handsome as the bull -that kidnaped Europa. - -- Marcus Tullius Cicero -% -I like paying taxes. With them I buy civilization. - -- Oliver Wendell Holmes -% -I like to believe that people in the long run are going to do more to -promote peace than our governments. Indeed, I think that people want -peace so much that one of these days governments had better get out of -the way and let them have it. - -- Dwight D. Eisenhower -% -I like work; it fascinates me; I can sit and look at it for hours. -% -I like young girls. Their stories are shorter. - -- Tom McGuane -% -I like your game but we have to change the rules. -% -I live the way I type; fast, with a lot of mistakes. -% -I loathe people who keep dogs. They are cowards who haven't got the guts -to bite people themselves. - -- August Strindberg -% -I look at life as being cruise director on the Titanic. -I may not get there, but I'm going first class. - -- Art Buchwald -% -I love being married. It's so great to find that one special -person you want to annoy for the rest of your life. - -- Rita Rudner -% -I love children. Especially when they cry -- for then -someone takes them away. - -- Nancy Mitford -% -I love dogs, but I hate Chihuahuas. A Chihuahua isn't a dog. -It's a rat with a thyroid problem. -% -I love mankind ... It's people I hate. - -- Schulz -% -I love Mickey Mouse more than any woman I've ever known. - -- Walt Disney -% -I love Saturday morning cartoons, what classic humour! This is what -entertainment is all about ... Idiots, explosives and falling anvils. - -- Calvin and Hobbes, Bill Watterson -% -I love the smell of napalm in the morning. - -- Robert Duval, "Apocalypse Now" -% -I love to eat them Smurfies -Smurfies what I love to eat -Bite they ugly heads off, -Nibble on they bluish feet. -% -I love treason but hate a traitor. - -- Gaius Julius Caesar -% -I love you more than anything in this world. I don't expect that will last. - -- Elvis Costello -% -I love you, not only for what you are, -but for what I am when I am with you. - -- Roy Croft -% -I loved her with a love thirsty and desperate. I felt that we two might -commit some act so atrocious that the world, seeing us, would find it -irresistible. - -- Gene Wolfe, "The Shadow of the Torturer" -% -I married beneath me. All women do. - -- Lady Nancy Astor -% -I may appear to be just sitting here like a bucket of tapioca, but -don't let appearances fool you. I'm approaching old age ... at the -speed of light. - -- Prof. Cosmo Fishhawk -% -I may be getting older, but I refuse to grow up! -% -I may kid around about drugs, but really, I take them seriously. - -- Doctor Graper -% -I may not be totally perfect, but parts of me are excellent. - -- Ashleigh Brilliant -% -I met a wonderful new man. He's fictional, but you can't have everything. - -- Cecelia, "The Purple Rose of Cairo" -% -I met my latest girl friend in a department store. She was looking at -clothes, and I was putting Slinkys on the escalators. - -- Steven Wright -% -I might have gone to West Point, but I was too proud to speak to a -congressman. - -- Will Rogers -% -I must Create a System, or be enslav'd by another Man's; -I will not Reason and Compare; my business is to Create. - -- William Blake, "Jerusalem" -% -I must get out of these wet clothes and into a dry Martini. - -- Alexander Woollcott -% -I must have a prodigious quantity of mind; it takes me as much as a -week sometimes to make it up. - -- Mark Twain, "The Innocents Abroad" -% -I must have slipped a disk -- my pack hurts! -% -I myself have dreamed up a structure intermediate between Dyson spheres -and planets. Build a ring 93 million miles in radius -- one Earth orbit --- around the sun. If we have the mass of Jupiter to work with, and if -we make it a thousand miles wide, we get a thickness of about a thousand -feet for the base. - -And it has advantages. The Ringworld will be much sturdier than a Dyson -sphere. We can spin it on its axis for gravity. A rotation speed of 770 -m/s will give us a gravity of one Earth normal. We wouldn't even need to -roof it over. Place walls one thousand miles high at each edge, facing the -sun. Very little air will leak over the edges. - -Lord knows the thing is roomy enough. With three million times the surface -area of the Earth, it will be some time before anyone complains of the -crowding. - -- Larry Niven, "Ringworld" -% -I need another lawyer like I need another hole in my head. - -- Fratianno -% -I needed the good will of the legislature of four states. I formed the -legislative bodies with my own money. I found that it was cheaper that -way. - -- Jay Gould -% -I never cheated an honest man, only rascals. They wanted -something for nothing. I gave them nothing for something. - -- Joseph "Yellow Kid" Weil -% -I never deny, I never contradict. I sometimes forget. - -- Benjamin Disraeli, British PM, on dealing with the - Royal Family -% -I never did it that way before. -% -I never expected to see the day when girls would get sunburned in the -places they do today. - -- Will Rogers -% -I never failed to convince an audience that the best thing they -could do was to go away. -% -I never forget a face, but in your case I'll make an exception. - -- Groucho Marx -% -I never killed a man that didn't deserve it. - -- Mickey Cohen -% -I never loved another person the way I loved myself. - -- Mae West -% -I never made a mistake in my life. -I thought I did once, but I was wrong. - -- Lucy Van Pelt -% -I never met a man I didn't want to fight. - -- Lyle Alzado, professional football lineman -% -I never met a piece of chocolate I didn't like. -% -I never pray before meals -- my mom's a good cook. -% -I never said all Democrats were saloonkeepers; -what I said was all saloonkeepers were Democrats. -% -I never saw a purple cow -I never hope to see one -But I can tell you anyhow -I'd rather see than be one. - -- Gellett Burgess - -I've never seen a purple cow -I never hope to see one -But from the milk we're getting now -There certainly must be one - -- Ogden Nash - -Ah, yes, I wrote "The Purple Cow" -I'm sorry now I wrote it -But I can tell you anyhow -I'll kill you if you quote it. - -- Gellett Burgess, many years later -% -I never take work home with me; I always leave it in some bar along the way. -% -I never vote for anyone. I always vote against. - -- W. C. Fields -% -I often quote myself; it adds spice to my conversation. - -- George Bernard Shaw -% -I only know what I read in the papers. - -- Will Rogers -% -I only touch base with reality on an as-needed basis! - -- Royal Floyd Mengot (Klaus) -% -I opened the drawer of my little desk and a single letter fell out, a -letter from my mother, written in pencil, one of her last, with unfinished -words and an implicit sense of her departure. It's so curious: one can -resist tears and "behave" very well in the hardest hours of grief. But -then someone makes you a friendly sign behind a window... or one notices -that a flower that was in bud only yesterday has suddenly blossomed... or -a letter slips from a drawer... and everything collapses. - -- Letters From Colette -% -I owe, I owe, -It's off to work I go... -% -I owe the government $3400 in taxes. So I sent them two hammers and a -toilet seat. - -- Michael McShane -% -I owe the public nothing. - -- J. P. Morgan -% -I place economy among the first and most important virtues, and public debt as -the greatest of dangers to be feared. To preserve our independence, we must -not let our rulers load us with perpetual debt. If we run into such debts, we -must be taxed in our meat and drink, in our necessities and in our comforts, -in our labor and in our amusements. If we can prevent the government from -wasting the labor of the people, under the pretense of caring for them, they -will be happy. - -- Thomas Jefferson -% -I played lead guitar in a band called The Federal Duck, which is the -kind of name that was popular in the '60s as a result of controlled -substances being in widespread use. Back then, there were no -restrictions, in terms of talent, on who could make an album, so we -made one, and it sounds like a group of people who have been given -powerful but unfamiliar instruments as a therapy for a degenerative -nerve disease. - -- Dave Barry, "The Snake" -% -I pledge allegiance to the flag -of the United States of America -and to the republic for which it stands, -one nation, -indivisible, -with liberty -and justice for all. - -- Francis Bellamy, 1892 -% -I poured spot remover on my dog. Now he's gone. - -- Steven Wright -% -I predict that today will be remembered until tomorrow! -% -I prefer rogues to imbeciles because they sometimes take a rest. - -- Alexandre Dumas the Younger -% -I prefer the most unjust peace to the most righteous war. - -- Cicero - -Even peace may be purchased at too high a price. - -- Poor Richard -% -I profoundly believe it takes a lot of practice to become a moral slob. - -- William F. Buckley -% -I put contact lenses in my dog's eyes. They had little pictures of cats -on them. Then I took one out and he ran around in circles. - -- Steven Wright -% -I put the shotgun in an Adidas bag and padded it out with four pairs of -tennis socks, not my style at all, but that was what I was aiming for: If -they think you're crude, go technical; if they think you're technical, go -crude. I'm a very technical boy. So I decided to get as crude as possible. -These days, though, you have to be pretty technical before you can even -aspire to crudeness. - -- William Gibson, "Johnny Mnemonic" -% -I put up my thumb... and it blotted out the planet Earth. - -- Neil Armstrong -% -I read a column by George Will that Scarface should be rated X because -parents were taking their children to see it. So what? Why should the -motion-picture industry be responsible for our morality? - Dad says to Mom, "Honey, Scarface is in town." - "What's it about?" - "Human scum who kill each other over cocaine deals." - "Sounds great! Let's take the kids!" - -- Ian Shoales -% -I read Playboy for the same reason I read National Geographic. -To see the sights I'm never going to visit. -% -I read the newspaper avidly. It is my one form of continuous fiction. - -- Aneurin Bevan -% -I realize that the MX missile is none of our concern. I realize that -the whole point of living in a democracy is that we pay professional -congresspersons to concern themselves with things like the MX missile -so we can be free to concern ourselves with getting hold of the -plumber. - -But from time to time, I feel I must address major public issues such -as this, because in a free and open society, where the very future of -the world hinges on decisions made by our elected leaders, you never -win large cash journalism awards if you stick to the topics I usually -write about, such as nose-picking. - -- Dave Barry, "At Last, the Ultimate Deterrent Against - Political Fallout" -% -I really had to act; 'cause I didn't have any lines. - -- Marilyn Chambers -% -I really hate this damned machine -I wish that they would sell it. -It never does quite what I want -But only what I tell it. -% -I really look with commiseration over the great body of my fellow citizens -who, reading newspapers, live and die in the belief that they have known -something of what has been passing in their time. - -- Thomas Jefferson -% -I recognize terror as the finest emotion and so I will try to terrorize the -reader. But if I find that I cannot terrify, I will try to horrify, and if -I find that I cannot horrify, I'll go for the gross-out. - -- Stephen King -% -I refuse to consign the whole male sex to the nursery. I insist on -believing that some men are my equals. - -- Brigid Brophy -% -I refuse to have a battle of wits with an unarmed person. -% -I remember once being on a station platform in Cleveland at four in the -morning. A black porter was carrying my bags, and as we were waiting for -the train to come in, he said to me: "Excuse me, Mr. Cooke, I don't want to -invade your privacy, but I have a bet with a friend of mine. Who composed -the opening theme music of `Omnibus'? My friend said Virgil Thomson." I -asked him, "What do you say?" He replied, "I say Aaron Copeland." I said, -"You're right." The porter said, "I knew Thomson doesn't write counterpoint -that way." I told that to a network president, and he was deeply unimpressed. - -- Alistair Cooke -% -I remember Ulysses well... Left one day for the post office -to mail a letter, met a blonde named Circe on the streetcar, -and didn't come back for 20 years. -% -I remember when legal used to mean lawful, now it means some -kind of loophole. - -- Leo Kessler -% -I replaced the headlights on my car with strobe lights. Now it -looks like I'm the only one moving. - -- Steven Wright -% -I respect faith, but doubt is what gives you an education. - -- Wilson Mizner -% -I respect the institution of marriage. I have always thought that every -woman should marry -- and no man. - -- Benjamin Disraeli, "Lothair" -% -I reverently believe that the maker who made us all makes everything in New -England, but the weather. I don't know who makes that, but I think it must be -raw apprentices in the weather-clerks factory who experiment and learn how, in -New England, for board and clothes, and then are promoted to make weather for -countries that require a good article, and will take their custom elsewhere -if they don't get it. - -- Mark Twain -% -I sat down beside her, said hello, offered to buy her a drink... -and then natural selection reared its ugly head. -% -I saw a man pursuing the Horizon, -'Round and round they sped. -I was disturbed at this, -I accosted the man, -"It is futile," I said. -"You can never--" -"You lie!" He cried, -and ran on. - -- Stephen Crane -% -I saw a subliminal advertising executive, but only for a second. - -- Steven Wright -% -I saw Lassie. It took me four shows to figure out why the hairy kid -never spoke. I mean, he could roll over and all that, but did that -deserve a series?" -% -I saw what you did and I know who you are. -% -I see a bad moon rising. -I see trouble on the way. -I see earthquakes and lightnin' -I see bad times today. -Don't go 'round tonight, -It's bound to take your life. -There's a bad moon on the rise. - -- J. C. Fogerty, "Bad Moon Rising" -% -I see a good deal of talk from Washington about lowering taxes. I hope -they do get 'em lowered down enough so people can afford to pay 'em. - -- Will Rogers -% -I see the eigenvalue in thine eye, -I hear the tender tensor in thy sigh. -Bernoulli would have been content to die -Had he but known such _a-squared cos 2(phi)! - -- Stanislaw Lem, "Cyberiad" -% -I see where we are starting to pay some attention to our neighbors to -the south. We could never understand why Mexico wasn't just crazy about -us; for we have always had their good will, and oil and minerals, at heart. - -- The Best of Will Rogers -% -I sent a letter to the fish, I said it very loud and clear, -I told them, "This is what I wish." I went and shouted in his ear. -The little fishes of the sea, But he was very stiff and proud, -They sent an answer back to me. He said "You needn't shout so loud." -The little fishes' answer was And he was very proud and stiff, -"We cannot do it, sir, because..." He said "I'll go and wake them if..." -I sent a letter back to say I took a kettle from the shelf, -It would be better to obey. I went to wake them up myself. -But someone came to me and said But when I found the door was locked -"The little fishes are in bed." I pulled and pushed and kicked and - knocked, -I said to him, and I said it plain And when I found the door was shut, -"Then you must wake them up again." I tried to turn the handle, But... - - "Is that all?" asked Alice. - "That is all." said Humpty Dumpty. "Goodbye." - -- Lewis Carroll, - "Through the Looking-Glass, - and What Alice Found There" (1871) -% -I sent a message to another time, -But as the days unwind -- this I just can't believe, -I sent a message to another plane, -Maybe it's all a game -- but this I just can't conceive. -... -I met someone who looks at lot like you, -She does the things you do, but she is an IBM. -She's only programmed to be very nice, -But she's as cold as ice, whenever I get too near, -She tells me that she likes me very much, -But when I try to touch, she makes it all too clear. -... -I realize that it must seem so strange, -That time has rearranged, but time has the final word, -She knows I think of you, she reads my mind, -She tries to be unkind, she knows nothing of our world. - -- ELO, "Yours Truly, 2095" -% -I shall come to you in the night and we shall see who is stronger -- -a little girl who won't eat her dinner or a great big man with cocaine -in his veins. - -- Sigmund Freud, in a letter to his fiancee -% -I shall give a propagandist reason for starting the war, no matter whether -it is plausible or not. The victor will not be asked afterwards whether -he told the truth or not. When starting and waging war it is not right -that matters, but victory. - -- Adolf Hitler -% -I shot an arrow in to the air, and it stuck. - -- graffito in Los Angeles - -On a clear day, -U.C.L.A. - -- graffito in San Francisco - -There's so much pollution in the air now that if it weren't for our -lungs there'd be no place to put it all. - -- Robert Orben -% -I should have been a country-western singer. After all, I'm older than -most western countries. - -- George Burns -% -I smell a wumpus. -% -I sold my memoirs of my love life to Parker -Brothers -- they're going to make a game out of it. - -- Woody Allen -% -I sometimes think that God, in creating man, somewhat overestimated his -ability. - -- Oscar Wilde -% -I steal. - -- Sam Giancana, explaining his livelihood to his draft board - -Easy. I own Chicago. I own Miami. I own Las Vegas. - -- Sam Giancana, when asked what he did for a living -% -I stick my neck out for nobody. - -- Humphrey Bogart, "Casablanca" (1942) -% -I stood on the leading edge, -The eastern seaboard at my feet. -"Jump!" said Yoko Ono -I'm too scared and good-looking, I cried. -Go on and give it a try, -Why prolong the agony, all men must die. - -- Roger Waters, "The Pros and Cons of Hitchhiking" -% -I stopped believing in Santa Claus when I was six. Mother took me to -see him in a department store and he asked for my autograph. - -- Shirley Temple -% -I suggest a new strategy, R2: let the Wookiee win. - -- C-3PO -% -I suggest you locate your hot tub outside your house, so it won't do -too much damage if it catches fire or explodes. First you decide which -direction your hot tub should face for maximum solar energy. After -much trial and error, I have found that the best direction for a hot -tub to face is up. - -- Dave Barry, "The Taming of the Screw" -% -I suppose I could collect my books and get on back to school, -Or steal my daddy's cue and make a living out of playing pool, -Or find myself a rock 'n' roll band, -That needs a helping hand, -Oh, Maggie I wish I'd never seen your face. - -- Rod Stewart, "Maggie May" -% -I suppose some of the variation between Boston drivers and the rest of the -country is due to the progressive Massachusetts Driver Education Manual which -I happen to have in my top desk drawer. Some of the Tips for Better Driving -are worth considering, to wit: - -[110.13]: - "When traveling on a one-way street, stay to the right, so as not - to interfere with oncoming traffic." - -[22.17b]: - "Learning to change lanes takes time and patience. The best - recommendation that can be made is to go to a Celtics [basketball] - game; study the fast break and then go out and practice it - on the highway." - -[41.16]: - "Never bump a baby carriage out of a crosswalk unless the kid's really - asking for it." -% -I suppose some of the variation between Boston drivers and the rest of the -country is due to the progressive Massachusetts Driver Education Manual which -I happen to have in my top desk drawer. Some of the Tips for Better Driving -are worth considering, to wit: - -[131.16d]: - "Directional signals are generally not used except during vehicle - inspection; however, a left-turn signal is appropriate when making - a U-turn on a divided highway." - -[96.7b]: - "When paying tolls, remember that it is necessary to release the - quarter a full 3 seconds before passing the basket if you are - traveling more than 60 MPH." -% -I suppose some of the variation between Boston drivers and the rest of the -country is due to the progressive Massachusetts Driver Education Manual which -I happen to have in my top desk drawer. Some of the Tips for Better Driving -are worth considering, to wit: - -[173.15b]: - "When competing for a section of road or a parking space, remember - that the vehicle in need of the most body work has the right-of-way." - -[141.2a]: - "Although it is altogether possible to fit a 6' car into a 6' - parking space, it is hardly ever possible to fit a 6' car into - a 5' parking space." - -[105.31]: - "Teenage drivers believe that they are immortal, and drive accordingly. - Nevertheless, you should avoid the temptation to prove them wrong." -% -I suppose that in a few hours I will sober up. That's such a sad -thought. I think I'll have a few more drinks to prepare myself. -% -I tell them to turn to the study of mathematics, for it -is only there that they might escape the lusts of the flesh. - -- Thomas Mann, "The Magic Mountain" -% -I tell ya, drugs never worked out for me. The first time I tried smoking -pot I didn't know what I was doing. I smoked half the joint, got the -munchies, and ate the other half. - -Well, the first time I tried coke I was so embarrassed. I kept getting the -bottle stuck up my nose. - -- Rodney Dangerfield -% -I tell ya, gambling never agreed with me. Last week I went to the track -and they shot my horse with the opening gun. - -Well, just last week I was at a Chinese restaurant and when I opened my -fortune cookie I found the guy's check sitting at the next table. I said, -"Hey, buddy, I got your check", he said, "Thanks." - -- Rodney Dangerfield -% -I tell ya, I knew my morning wasn't going right. When I put on my shirt -the button fell off, when I picked up my briefcase, the handle fell off, -I tell ya, I was afraid to go to the bathroom. - -- Rodney Dangerfield -% -I think... I think it's in my basement... Let me go upstairs and check. - -- M. C. Escher -% -I think a relationship is like a shark. It has to constantly move forward -or it dies. Well, what we have on our hands here is a dead shark. - -- Woody Allen -% -I think I'll snatch a kiss and flee. - -- William Shakespeare -% -I think I'm schizophrenic. One half of me's -paranoid and the other half's out to get him. -% -I think it is true for all _n. I was just playing it safe with _n >= 3 -because I couldn't remember the proof. - -- Baker, Pure Math 351a -% -I THINK MAN INVENTED THE CAR by instinct. - -- Jack Handey, "The New Mexican" (1988) -% -I think sex is better than logic, but I can't prove it. -% -I think she must have been very strictly brought up, she's so -desperately anxious to do the wrong thing correctly. - -- H. H. Munro, a.k.a. Saki, "Reginald on Worries" -% -I think that all good, right thinking people in this country are sick -and tired of being told that all good, right thinking people in this -country are fed up with being told that all good, right thinking people -in this country are fed up with being sick and tired. I'm certainly -not, and I'm sick and tired of being told that I am. - -- Monty Python -% -I think that I shall never hear -A poem lovelier than beer. -The stuff that Joe's Bar has on tap, -With golden base and snowy cap. -The stuff that I can drink all day -Until my mem'ry melts away. -Poems are made by fools, I fear -But only Schlitz can make a beer. -% -I think that I shall never see -A billboard lovely as a tree. -Indeed, unless the billboards fall -I'll never see a tree at all. - -- Ogden Nash -% -I think that I shall never see -A thing as lovely as a tree. -But as you see the trees have gone -They went this morning with the dawn. -A logging firm from out of town -Came and chopped the trees all down. -But I will trick those dirty skunks -And write a brand new poem called "Trunks." -% -I think the sky is blue because it's a shift from black through purple -to blue, and it has to do with where the light is. You know, the -farther we get into darkness, and there's a shifting of color of light -into the blueness, and I think as you go farther and farther away from -the reflected light we have from the sun or the light that's bouncing -off this earth, uh, the darker it gets ... I think if you look at the -color scale, you start at black, move it through purple, move it on -out, it's the shifting of color. We mentioned before about the stars -singing, and that's one of the effects of the shifting of colors. - -- Pat Robertson, The 700 Club -% -I think the world is ready for the story of an ugly duckling, who grew up to -remain an ugly duckling, and lived happily ever after. - -- Chick -% -I think the world is run by C students. - -- Al McGuire -% -I think the world would be a more peaceful place if people -could just keep their fingers out of the fortune files. - -- Jordan K. Hubbard -% -I THINK THERE SHOULD BE SOMETHING in science called the "reindeer effect." -I don't know what it would be, but I think it'd be good to hear someone -say, "Gentlemen, what we have here is a terrifying example of the reindeer -effect." - -- Jack Handey, "The New Mexican" (1988) -% -I think, therefore I am... I think. -% -I think there's a world market for about five computers. - -- attr. Thomas J. Watson, Chairman of the Board, IBM (1943) -% -I THINK THEY SHOULD CONTINUE the policy of not giving a Nobel Prize for -paneling. - -- Jack Handey, "The New Mexican" (1988) -% -I think we are in Rats Alley where the dead men lost their bones. - -- T. S. Eliot -% -I think we can all agree that there is not enough common courtesy shown -... HEY! PAY ATTENTION WHEN I'M TALKING TO YOU DAMMIT! I said I think -we can all agree that there is not enough common courtesy shown today. -When we take the time to be courteous to each other, we find that we -are happier and less likely to engage in nuclear war. This point was -driven home by the recent summit talks, where Nancy Reagan and Raisa -Gorbachev, each of whose husband thinks the other's husband is vermin, -were able to sit down at a high-level tea and engage in courteous -conversation ... - -- Dave Barry, "The Stuff of Etiquette" -% -I think we're all Bozos on this bus. - -- The Firesign Theatre -% -I think we're in trouble. - -- Han Solo -% -I think your opinions are reasonable, -except for the one about my mental instability. - -- Psychology Professor, Fairfield University -% -"I thought that you said you were 20 years old!" -"As a programmer, yes," she replied, -"And you claimed to be very near two meters tall!" -"You said you were blonde, but you lied!" -Oh, she was a hacker and he was one, too, -They had so much in common, you'd say. -They exchanged jokes and poems, and clever new hacks, -And prompts that were cute or risque'. -He sent her a picture of his brother Sam, -She sent one from some past high school day, -And it might have gone on for the rest of their lives, -If they hadn't met in L.A. -"Your beard is an armpit," she said in disgust. -He answered, "Your armpit's a beard!" -And they chorused: "I think I could stand all the rest -If you were not so totally weird!" -If she had not said what he wanted to hear, -And he had not done just the same, -They'd have been far more honest, and never have met, -And would not have had fun with the game. - -- Judith Schrier, - "Face to Face After Six Months of Electronic Mail" -% -I thought there was something fishy about the butler. Probably a Pisces, -working for scale. - -- The Firesign Theatre, - "The Further Adventures of Nick Danger" -% -I thought YOU silenced the guard! -% -I told my doctor I got all the exercise I needed being a -pallbearer for all my friends who run and do exercises! - -- Winston Churchill -% -I took a course in speed reading, learning to read straight down the middle -of the page, and I was able to go through "War and Peace" in twenty minutes. -It's about Russia. - -- Woody Allen -% -I treasure this strange combination found in very few persons: a fierce -desire for life as well as a lucid perception of the ultimate futility of -the quest. - -- Madeleine Gobeil -% -I truly wish I could be a great surgeon or philosopher or author or anything -constructive, but in all honesty I'd rather turn up my amplifier full blast -and drown myself in the noise. - -- Charles Schmid, the "Tucson Murderer" -% -I trust the first lion he meets will do his duty. - -- J. P. Morgan on Teddy Roosevelt's safari -% -I try not to break the rules but merely to test their elasticity. - -- Bill Veeck -% -I try to keep an open mind, but not so open that my brains fall out. - -- Judge Harold T. Stone -% -I turned my air conditioner the other way around, and it got cold out. -The weatherman said "I don't understand it. I was supposed to be 80 -degrees today," and I said "Oops." - -In my house on the ceilings I have paintings of the rooms above... so -I never have to go upstairs. - -I just bought a microwave fireplace... You can spend an evening in -front of it in only eight minutes. - -- Steven Wright -% -I understand why you're confused. You're thinking too much. - -- Carole Wallach -% -I use not only all the brains I have, but all those I can borrow as well. - -- Woodrow Wilson -% -I use technology in order to hate it more properly. - -- Nam June Paik -% -I used to be a rebel in my youth. -This cause... that cause... (chuckle) I backed 'em ALL! But I learned. -Rebellion is simply a device used by the immature to hide from his own -problems. So I lost interest in politics. Now when I feel aroused by -a civil rights case or a passport hearing... I realize it's just a device. -I go to my analyst and we work it out. You have no idea how much better -I feel these days. - -- J. Feiffer -% -I used to be an agnostic, but now I'm not so sure. -% -I used to be disgusted, now I find I'm just amused. - -- Elvis Costello -% -I used to be Snow White, but I drifted. - -- Mae West -% -I used to be such a sweet sweet thing, 'til they got a hold of me, -I opened doors for little old ladies, I helped the blind to see, -I got no friends 'cause they read the papers, they can't be seen, -With me, and I'm feelin' real shot down, -And I'm, uh, feelin' mean, - No more, Mr. Nice Guy, - No more, Mr. Clean, - No more, Mr. Nice Guy, -They say "He's sick, he's obscene". - -My dog bit me on the leg today, my cat clawed my eyes, -Ma's been thrown out of the social circle, and Dad has to hide, -I went to church, incognito, when everybody rose, -The reverend Smithy, he recognized me, -And punched me in the nose, he said, -(chorus) -He said "You're sick, you're obscene". - -- Alice Cooper, "No More Mr. Nice Guy" -% -I used to have a drinking problem. -Now I love the stuff. -% -I used to live in a house by the freeway. When I went anywhere, I had -to be going 65 MPH by the end of my driveway. - -I replaced the headlights in my car with strobe lights. Now it looks -like I'm the only one moving. - -I was pulled over for speeding today. The officer said, "Don't you know -the speed limit is 55 miles an hour?" And I said, "Yes, but I wasn't going -to be out that long." - -I put a new engine in my car, but didn't take the old one out. Now -my car goes 500 miles an hour. - -- Steven Wright -% -I used to think I was a child; now I think I am an adult -- not because -I no longer do childish things, but because those I call adults are no -more mature than I am. -% -I used to think I was indecisive, but now I'm not so sure. -% -I used to think romantic love was a neurosis shared by two, a supreme -foolishness. I no longer thought that. There's nothing foolish in -loving anyone. Thinking you'll be loved in return is what's foolish. - -- Rita Mae Brown -% -I used to think that the brain was the most wonderful organ in -my body. Then I realized who was telling me this. - -- Emo Phillips -% -I used to work in a fire hydrant factory. You couldn't park anywhere near -the place. - -- Steven Wright -% -I value kindness to human beings first of all, and kindness to animals. I -don't respect the law; I have a total irreverence for anything connected -with society except that which makes the roads safer, the beer stronger, -the food cheaper, and old men and women warmer in the winter, and happier -in the summer. - -- Brendan Behan -% -I waited and waited and when no message came I knew it must be from you. -% -I want to be the white man's brother, not his brother-in-law. - -- Martin Luther King, Jr. -% -I want to buy a husband who, every week when I sit down to watch "St. -Elsewhere", won't scream, "FORGET IT, BLANCHE ... IT'S TIME FOR 'HEE -HAW'!!" - -- Berke Breathed, "Bloom County" -% -I want to marry a girl just like the girl that married dear old dad. - -- Freud -% -I want to reach your mind -- where is it currently located? -% -I was appalled by this story of the destruction of a member of a valued -endangered species. It's all very well to celebrate the practicality of -pigs by ennobling the porcine sibling who constructed his home out of -bricks and mortar. But to wantonly destroy a wolf, even one with an -excessive taste for porkers, is unconscionable in these ecologically -critical times when both man and his domestic beasts continue to maraud -the earth. - Sylvia Kamerman, "Book Reviewing" -% -I was at this restaurant. The sign said "Breakfast Anytime." So I -ordered French Toast in the Renaissance. - -- Steven Wright -% -I was born because it was a habit in those days, people didn't know -anything else ... I was not a Child Prodigy, because a Child Prodigy is -a child who knows as much when it is a child as it does when it grows -up. - -- Will Rogers -% -I was born in a barrel of butcher knives -Trouble I love and peace I despise -Wild horses kicked me in my side -Then a rattlesnake bit me and he walked off and died. - -- Bo Diddley -% -I was drunk last night, crawled home across the lawn. By accident I -put the car key in the door lock. The house started up. So I figured -what the hell, and drove it around the block a few times. I thought I -should go park it in the middle of the freeway and yell at everyone to -get off my driveway. - -- Steven Wright -% -I was eatin' some chop suey, -With a lady in St. Louie, -When there sudden comes a knockin' at the door. -And that knocker, he says, "Honey, -Roll this rocker out some money, -Or your daddy shoots a baddie to the floor." - -- Mr. Miggle -% -I was gratified to be able to answer promptly, and I did. -I said I didn't know. - -- Mark Twain -% -I was in a bar and I walked up to a beautiful woman and said, "Do you live -around here often?" She said, "You're wearing two different-color socks." -I said, "Yes, but to me they're the same because I go by thickness." -She said, "How do you feel?" And I said, "You know when you're sitting on a -chair and you lean back so you're just on two legs and you lean too far so -you almost fall over but at the last second you catch yourself? I feel like -that all the time." - -- Steven Wright, "Gentlemen's Quarterly" -% -I was in a beauty contest once. I not only came in last, I was hit in -the mouth by Miss Congeniality. - -- Phyllis Diller -% -I was in accord with the system so long as it -permitted me to function effectively. - -- Albert Speer -% -I was in this prematurely air conditioned supermarket and there were all -these aisles and there were these bathing caps you could buy that had these -kind of Fourth of July plumes on them that were red and yellow and blue and -I wasn't tempted to buy one but I was reminded of the fact that I had been -avoiding the beach. - -- Lucinda Childs "Einstein On The Beach" -% -I was in Vegas last week. I was at the roulette table, having a -lengthy argument about what I considered an Odd number. - -- Steven Wright -% -I was offered a job as a hoodlum and I turned it down cold. A thief is -anybody who gets out and works for his living, like robbing a bank or -breaking into a place and stealing stuff, or kidnaping somebody. He really -gives some effort to it. A hoodlum is a pretty lousy sort of scum. He -works for gangsters and bumps guys off when they have been put on the spot. -Why, after I'd made my rep, some of the Chicago Syndicate wanted me to work -for them as a hood -- you know, handling a machine gun. They offered me -two hundred and fifty dollars a week and all the protection I needed. I -was on the lam at the time and not able to work at my regular line. But -I wouldn't consider it. "I'm a thief," I said. "I'm no lousy hoodlum." - -- Alvin Karpis, "Public Enemy Number One" -% -I was part of that strange race of people aptly described as spending -their lives doing things they detest to make money they don't want to -buy things they don't need to impress people they dislike. - -- Emile Henry Gauvreay -% -I was playing poker the other night... with Tarot cards. I got a -full house and four people died. - -- Steven Wright -% -I was the best I ever had. - -- Woody Allen -% -I was toilet-trained at gunpoint. - -- Billy Braver -% -I was working on a case. It had to be a case, because I couldn't afford a -desk. Then I saw her. This tall blond lady. She must have been tall -because I was on the third floor. She rolled her deep blue eyes towards -me. I picked them up and rolled them back. We kissed. She screamed. I -took the cigarette from my mouth and kissed her again. -% -I wasn't kissing her, I was whispering in her mouth. - -- Chico Marx -% -I watch television because you don't know what it will do if you leave it -in the room alone. -% -I went home with a waitress, -The way I always do. -How I was I to know? -She was with the Russians too. - -I was gambling in Havana, -I took a little risk. -Send lawyers, guns, and money, -Dad, get me out of this. - -- Warren Zevon, "Lawyers, Guns and Money" -% -I went into a general store ... they wouldn't sell me anything specific. - -- Steven Wright -% -I went into the business for the money, and the art grew out of it. -If people are disillusioned by that remark, I can't help it. -It's the truth. - -- Charlie Chaplin -% -I went on to test the program in every way I could devise. I strained it to -expose its weaknesses. I ran it for high-mass stars and low-mass stars, for -stars born exceedingly hot and those born relatively cold. I ran it assuming -the superfluid currents beneath the crust to be absent -- not because I wanted -to know the answer, but because I had developed an intuitive feel for the -answer in this particular case. Finally I got a run in which the computer -showed the pulsar's temperature to be less than absolute zero. I had found -an error. I chased down the error and fixed it. Now I had improved the -program to the point where it would not run at all. - -- George Greenstein, "Frozen Star: - Of Pulsars, Black Holes and the Fate of Stars" -% -I went over to my friend, he was eatin' a pickle. -I said "Hi, what's happenin'?" -He said "Nothin'." -Try to sing this song with that kind of enthusiasm; -As if you just squashed a cop. - -- Arlo Guthrie, "Motorcycle Song" -% -I went to a Grateful Dead Concert and they played for SEVEN hours. -Great song. - -- Fred Reuss -% -I went to a job interview the other day, the guy asked me if I had any -questions, I said yes, just one, if you're in a car traveling at the -speed of light and you turn your headlights on, does anything happen? - -He said he couldn't answer that, I told him sorry, but I couldn't work -for him then. - -- Steven Wright -% -I went to my first computer conference at the New York Hilton about 20 -years ago. When somebody there predicted the market for microprocessors -would eventually be in the millions, someone else said, "Where are they -all going to go? It's not like you need a computer in every doorknob!" - -Years later, I went back to the same hotel. I noticed the room keys had -been replaced by electronic cards you slide into slots in the doors. - -There was a computer in every doorknob. - -- Danny Hillis -% -I went to my mother and told her I intended to commence a different life. -I asked for and obtained her blessing and at once commenced the career -of a robber. - -- Tiburcio Vasquez -% -I went to the hardware store and bought some used paint. It was in -the shape of a house. I also bought some batteries, but they weren't -included. - -- Steven Wright -% -I went to the museum where they had all the heads and arms from the -statues that are in all the other museums. - -- Steven Wright -% -I went to the race track once and bet on a horse that was so good that -it took seven others to beat him! -% -I will always love the false image I had of you. -% -I will follow the good side right to the fire, -but not into it if I can help it. - -- Michel Eyquem de Montaigne -% -I will honour Christmas in my heart, and try to keep it all the -year. I will live in the Past, the Present, and the Future. The -Spirits of all Three shall strive within me. I will not shut out -the lessons that they teach. Oh, tell me that I may sponge away the -writing on this stone! - -- Charles Dickens -% -I will make you shorter by the head. - -- Elizabeth I -% -I will never lie to you. -% -I will not be briefed or debriefed, my underwear is my own. -% -I will not drink! -But if I do... -I will not get drunk! -But if I do... -I will not in public! -But if I do... -I will not fall down! -But if I do... -I will fall face down so that they cannot see my company badge. -% -I will not forget you. -% -I will not play at tug o' war. -I'd rather play at hug o' war, -Where everyone hugs -Instead of tugs, -Where everyone giggles -And rolls on the rug, -Where everyone kisses, -And everyone grins, -And everyone cuddles, -And everyone wins. - -- Shel Silverstein, "Hug O' War" -% -I will not say that women have no character; rather, they have a new -one every day. - -- Heine -% -I wish a robot would get elected president. That way, when he came to town, -we could all take a shot at him and not feel too bad. - -- Jack Handey -% -I WISH I HAD A KRYPTONITE CROSS, because then you could keep both Dracula -and Superman away. - -- Jack Handey, "The New Mexican" (1988) -% -I wish there was a knob on the TV where you could turn up the -intelligence. They've got one called brightness, but it doesn't -seem to work. - -- Gallagher -% -I wish you humans would leave me alone. -% -I wish you were a Scotch on the rocks. -% -I woke up a feelin' mean -went down to play the slot machine -the wheels turned round, -and the letters read -"Better head back to Tennessee Jed" - -- Grateful Dead -% -I woke up this morning and discovered that everything in my apartment -had been stolen and replaced with an exact replica. I told my roommate, -"Isn't this amazing? Everything in the apartment has been stolen and -replaced with an exact replica." He said, "Do I know you?" - -- Steven Wright -% -"I wonder", he said to himself, "what's in a book while it's closed. Oh, I -know it's full of letters printed on paper, but all the same, something must -be happening, because as soon as I open it, there's a whole story with people -I don't know yet and all kinds of adventures and battles." - -- Bastian B. Bux -% -I wonder what the leash and collar set does for excitement? - -- Tramp, "Lady and the Tramp" -% -I worked in a health food store once. A guy came in and asked me, -"If I melt dry ice, can I take a bath without getting wet?" - -- Steven Wright -% -I would be batting the big feller if they wasn't ready with the other one, -but a left-hander would be the thing if they wouldn't have knowed it already -because there is more things involved than could come up on the road, even -after we've been home a long while. - -- Casey Stengel -% -I would gladly raise my voice in praise of women, -only they won't let me raise my voice. - -- Winkle -% -I would have made a good pope. - -- Richard M. Nixon -% -I would have promised those terrorists a trip to Disneyland if it would have -gotten the hostages released. I thank God they were satisfied with the -missiles and we didn't have to go to that extreme. - -- Oliver North -% -I would have you imagine, then, that there exists in the mind of man a block -of wax... and that we remember and know what is imprinted as long as the -image lasts; but when the image is effaced, or cannot be taken, then we -forget or do not know. - -- Plato, Dialogs, Theateus 191 - - [Quoted in "VMS Internals and Data Structures", V4.4, when - referring to image activation and termination.] -% -I would like the government to do all it can to mitigate, then, in -understanding, in mutuality of interest, in concern for the common good, -our tasks will be solved. - -- Warren G. Harding -% -I would like to electrocute everyone who uses the word "fair" in connection -with income tax policies. - -- William F. Buckley -% -I would like to know -What I was fencing in -And what I was fencing out. - -- Robert Frost -% -I would much rather have men ask why -I have no statue, than why I have one. - -- Marcus Porcius Cato -% -I would not like to be a political leader in Russia. They never know when -they're being taped. - -- Richard M. Nixon - -I love America. You always hurt the one you love. - -- David Frye impersonating Nixon -% -I would rather be a serf in a poor man's house -and be above ground than reign among the dead. - -- Achilles, "The Odyssey", XI, 489-91 -% -I would rather say that a desire to drive fast -sports cars is what sets man apart from the animals. -% -I wouldn't be so paranoid if you weren't all out to get me!! -% -I wouldn't marry her with a ten foot pole. -% -I wouldn't recommend sex, drugs or insanity -for everyone, but they've always worked for me. - -- Hunter S. Thompson -% -I wrecked trains because I like to see people die. I like to hear -them scream. - -- Sylvestre Matuschka, "the Hungarian Train Wreck Freak", - escaped prison 1937, not heard from since -% -I -am -not -very -happy -acting -pleased -whenever -prominent -scientists -overmagnify -intellectual -enlightenment -% -IBM: - [International Business Machines Corp.] Also known as Itty Bitty - Machines or The Lawyer's Friend. The dominant force in computer - marketing, having supplied worldwide some 75% of all known hardware - and 10% of all software. To protect itself from the litigious envy - of less successful organizations, such as the US government, IBM - employs 68% of all known ex-Attorneys' General. -% -IBM: - I've Been Moved - Idiots Become Managers - Idiots Buy More - Impossible to Buy Machine - Incredibly Big Machine - Industry's Biggest Mistake - International Brotherhood of Mercenaries - It Boggles the Mind - It's Better Manually - Itty-Bitty Machines -% -IBM Advanced Systems Group -- a bunch of mindless jerks, -who'll be first against the wall when the revolution comes... - -- with regrets to Douglas Adams -% -IBM had a PL/I, -Its syntax worse than JOSS; -And everywhere this language went, -It was a total loss. -% -IBM: It may be slow, but it's hard to use. -% -IBM Pollyanna Principle: - Machines should work. People should think. -% -IBM's original motto: - Cogito ergo vendo; vendo ergo sum. -% -I'd be a poorer man if I'd never seen an eagle fly. - -- John Denver - -[I saw an eagle fly once. Fortunately, I had my eagle fly swatter handy. Ed.] -% -I'd give my right arm to be ambidextrous. -% -I'd horsewhip you if I had a horse. - -- Groucho Marx -% -I'd just as soon kiss a Wookiee. - -- Princess Leia Organa -% -I'D LIKE TO BE BURIED INDIAN-STYLE, where they put you up on a high rack, -above the ground. That way, you could get hit by meteorites and not even -feel it. - -- Jack Handey, "The New Mexican" (1988) -% -I'd like to meet the guy who invented beer and see what he's working on now. -% -I'd like to see the government get out of war altogether and leave the -whole field to private industry. - -- Joseph Heller -% -I'd love to go out with you, but I did my own thing and now I've got -to undo it. -% -I'd love to go out with you, but I have to stay home and see if I -snore. -% -I'd love to go out with you, but I never go out on days that end in -"Y". -% -I'd love to go out with you, but I'm taking punk totem pole carving. -% -I'd love to go out with you, but the last time I went out, I never -came back. -% -I'd love to go out with you, but the man on television told me to stay -tuned. -% -I'd love to kiss you, but I just washed my hair. - -- Bette Davis, "Cabin in the Cotton" -% -I'd never cry if I did find - A blue whale in my soup... -Nor would I mind a porcupine - Inside a chicken coop. -Yes life is fine when things combine, - Like ham in beef chow mein... -But lord, this time I think I mind, - They've put acid in my rain. - -- Milo Bloom -% -I'd never join any club that would have the likes of me as a member. - -- Groucho Marx -% -I'd probably settle for a vampire if he were romantic enough. -Couldn't be any worse than some of the relationships I've had. - -- Brenda Starr -% -I'd rather be led to hell than managed to heaven. -% -I'd rather have a bottle in front of me than a frontal lobotomy. -% -I'd rather have a free bottle in front of me than a prefrontal lobotomy. - -- Fred Allen - -[Also attributed to S. Clay Wilson. Ed.] -% -I'd rather have two girls at 21 each than one girl at 42. - -- W. C. Fields -% -I'd rather just believe that it's done by little elves running around. -% -I'd rather laugh with the sinners, -Than cry with the saints, -The sinners are much more fun! - -- Billy Joel, "Only The Good Die Young" -% -I'd rather push my Harley than ride a rice burner. -% -Ideas don't stay in some minds very long because they don't like -solitary confinement. -% -Identify your visitor. -% -Idiot Box, n.: - The part of the envelope that tells a person where to place the - stamp when they can't quite figure it out for themselves. - -- Rich Hall, "Sniglets" -% -Idiot, n.: - A member of a large and powerful tribe whose influence in human - affairs has always been dominant and controlling. - -- Ambrose Bierce, "The Devil's Dictionary" -% -IDLENESS: - Leisure gone to seed. -% -Idleness is the holiday of fools. -% -If 10 years from now, when you are doing something quick -and dirty, you suddenly visualize that I am looking over your -shoulders and say to yourself, "Dijkstra would not have liked this", -well that would be enough immortality for me. - -- Edsger W. Dijkstra -% -If A = B and B = C, then A = C, except where void or prohibited by law. - -- Roy Santoro -% -If a 6600 used paper tape instead of core memory, it would use up tape -at about 30 miles/second. - -- Grishman, Assembly Language Programming -% -If a camel flies, no one laughs if it doesn't get very far. - -- Paul White -% -If a camel is a horse designed by a committee, then a consensus forecast -is a camel's behind. - -- Edgar R. Fiedler -% -If a can of Alpo costs 38 cents, would it cost $2.50 in Dog Dollars? -% -If A equals success, then the formula is _A = _X + _Y + _Z. _X is work. _Y -is play. _Z is keep your mouth shut. - -- Albert Einstein -% -If A fool persists in his folly he shall become wise. - -- William Blake -% -If a group of N persons implements a COBOL compiler, -there will be N-1 passes. Someone in the group has to be the manager. - -- T. Cheatham -% -If a guru falls in the forest with no one to hear him, was he -really a guru at all? - -- Strange de Jim, "The Metasexuals" -% -If a jury in a criminal trial stays out for more than twenty-four hours, it -is certain to vote acquittal, save in those instances where it votes guilty. - -- Joseph C. Goulden -% -IF A KID ASKS YOU where rain comes from, I think a cute thing to tell him -is, "God is crying." And if he asks why God is crying, another cute thing -to tell him is, "Probably because of something you did." - -- Jack Handey, "The New Mexican" (1988) -% -If a listener nods his head when you're -explaining your program, wake him up. -% -If a man has a strong faith he can indulge in the luxury of skepticism. - -- Friedrich Nietzsche -% -If a man has talent and cannot use it, he has failed. - -- Thomas Wolfe -% -If a man is not a liberal at 25, he has no heart. -If he's not a conservative by 45, he has no brain. -% -If a man loses his reverence for any part of life, -he will lose his reverence for all of life. - -- Albert Schweitzer -% -If a man stay away from his wife for seven years, the law presumes the -separation to have killed him; yet according to our daily experience, -it might well prolong his life. - -- Charles Darling, "Scintillae Juris, 1877 -% -If a nation expects to be ignorant and free, -... it expects what never was and never will be. - -- Thomas Jefferson -% -If a nation values anything more than freedom, it will lose its freedom; -and the irony of it is that if it is comfort or money it values more, it -will lose that, too. - -- W. Somerset Maugham -% -If a person (a) is poorly, (b) receives treatment intended to make him better, -and (c) gets better, then no power of reasoning known to medical science can -convince him that it may not have been the treatment that restored his health. - -- Sir Peter Medawar, "The Art of the Soluble" -% -If a President doesn't do it to his wife, he'll do it to his country. -% -If a putt passes over the hole without dropping, it is deemed to have dropped. -The law of gravity holds that any object attempting to maintain a position -in the atmosphere without something to support it must drop. The law of -gravity supersedes the law of golf. - -- Donald A. Metz -% -If a shameless woman expects to be defiled and then dies of her fierce -love because you do not consent, will chastity also be homicide? - -- Saint Augustine -% -If a small child asks you where rain comes from, I think a reasonable response -is simply that "God is crying." And, if he asks you why God is crying, the -only possible answer is "Probably because of something you did." -% -If a system is administered wisely, -its users will be content. -They enjoy hacking their code -and don't waste time implementing -labor-saving shell scripts. -Since they dearly love their accounts, -they aren't interested in other machines. -There may be telnet, rlogin, and ftp, -but these don't access any hosts. -There may be an arsenal of cracks and malware, -but nobody ever uses them. -People enjoy reading their mail, -take pleasure in being with their newsgroups, -spend weekends working at their terminals, -delight in the doings at the site. -And even though the next system is so close -that users can hear its key clicks and biff beeps, -they are content to die of old age -without ever having gone to see it. -% -If a team is in a positive frame of mind, it will have a good attitude. -If it has a good attitude, it will make a commitment to playing the -game right. If it plays the game right, it will win -- unless, of -course, it doesn't have enough talent to win, and no manager can make -goose-liver pate out of goose feathers, so why worry? - -- Sparky Anderson -% -If a thing's worth doing, it is worth doing badly. - -- G. K. Chesterton -% -If a thing's worth having, it's worth cheating for. - -- W. C. Fields -% -If a train station is a place where a train stops, what's a workstation? -% -If addiction is judged by how long a dumb animal will sit pressing a lever -to get a "fix" of something, to its own detriment, then I would conclude -that netnews is far more addictive than cocaine. - -- Rob Stampfli -% -If all be true that I do think, -There be five reasons why one should drink; -Good friends, good wine, or being dry, -Or lest we should be by-and-by, -Or any other reason why. -% -If all else fails, immortality can always be assured by spectacular error. - -- John Kenneth Galbraith -% -If all else fails, lower your standards. -% -If all men were brothers, would you let one marry your sister? -% -If all the Chinese simultaneously jumped into the Pacific off a 10 foot -platform erected 10 feet off their coast, it would cause a tidal wave -that would destroy everything in this country west of Nebraska. -% -If all the seas were ink, -And all the reeds were pens, -And all the skies were parchment, -And all the men could write, -These would not suffice -To write down all the red tape -Of this Government. -% -If all the world's a stage, I want to operate the trap door. - -- Paul Beatty -% -If all the world's economists were laid end to end, -we wouldn't reach a conclusion. - -- William Baumol -% -If an average person on the subway turns to you, like an ancient mariner, -and starts telling you her tale, you turn away or nod and hope she stops, -not just because you fear she might be crazy. If she tells her tale on -camera, you might listen. Watching strangers on television, even -responding to them from a studio audience, we're disengaged - voyeurs -collaborating with exhibitionists in rituals of sham community. Never -have so many known so much about people for whom they cared so little. - -- Wendy Kaminer commenting on testimonial television - in "I'm Dysfunctional, You're Dysfunctional". -% -If an S and an I and an O and a U -With an X at the end spell Su; -And an E and a Y and an E spell I, -Pray what is a speller to do? -Then, if also an S and an I and a G -And an HED spell side, -There's nothing much left for a speller to do -But to go commit siouxeyesighed. - -- Charles Follen Adams, "An Orthographic Lament" -% -If any demonstrator ever lays down in front of my car, it'll be the last -car he ever lays down in front of. - -- George Wallace -% -If any man wishes to be humbled and mortified, -let him become president of Harvard. - -- Edward Holyoke -% -If anyone has seen my dog, please contact me at x2883 as soon as possible. -We're offering a substantial reward. He's a sable collie, with three legs, -blind in his left eye, is missing part of his right ear and the tip of his -tail. He's been recently fixed. Answers to "Lucky". -% -If at first you do succeed, try to hide your astonishment. -% -If at first you don't succeed, destroy all evidence that you tried. -% -If at first you don't succeed, quit; don't be a nut about success. -% -If at first you don't succeed, redefine success. -% -If at first you don't succeed, skydiving is not for you. -% -If at first you don't succeed, try, try again. - -- W. E. Hickson -% -If at first you don't succeed, try, try again. -Then quit. No use being a damn fool about it. - -- W. C. Fields - -[Also attributed to Roy Mengot. Ed.] -% -If at first you don't succeed, you must be a programmer. -% -If at first you don't succeed, you're doing about average. - -- Leonard Levinson -% -If at first you fricassee, fry, fry again. -% -If atheism is to be used to express the state of mind in which God is -identified with the unknowable, and theology is pronounced to be a -collection of meaningless words about unintelligible chimeras, then -I have no doubt, and I think few people doubt, that atheists are as -plentiful as blackberries. - -- Leslie Stephen -% -If bankers can count, how come they have -eight windows and only four tellers? -% -If Beethoven's Seventh Symphony is not by -some means abridged, it will soon fall into disuse. - -- Philip Hale, Boston music critic, 1837 -% -If built in great numbers, motels will be used for nothing -but illegal purposes. - -- J. Edgar Hoover -% -If Carter is the answer, it must have been a VERY silly question. -% -If Christianity was morality, Socrates would be the Saviour. - -- William Blake -% -If clear thinking created sparks, we could safely store dynamite in James -Watt's office. - -- Wayne Shannon -% -If coke is a joke, I'm waiting around for the next line. -% -If computers take over (which seems to be their natural tendency), it will -serve us right. - -- Alistair Cooke -% -If dolphins are so smart, why did Flipper work for television? -% -If entropy is increasing, where is it coming from? -% -If ever the pleasure of one has to be bought by the pain of the other, -there better be no trade. A trade by which one gains and the other loses -is a fraud. - -- Dagny Taggart, "Atlas Shrugged" -% -If ever you want to touch the hand and the heart of God Almighty, you can -do it through the body of someone you love. Anytime. Anywhere. Without -no middleman. - -- Theodore Sturgeon, "Godbody" -% -If every kid had a funny tooth to bite down on whenever the world disappointed -him, prussic acid could solve our population problems in one generation. - -- G. C. Edmonson's Albert, "The Man Who Corrupted Earth" -% -If everybody minded their own business, the world would go -around a deal faster. - -- The Duchess; Lewis Carroll, - "Through the Looking-Glass, - and What Alice Found There" (1871) -% -If everything is coming your way then you're in the wrong lane. -% -If everything on the road of life seems to -be coming your way, you're in the wrong lane. -% -If everything seems to be going well, -you have obviously overlooked something. -% -If fifty million people say a foolish thing, it's still a foolish thing. - -- Bertrand Russell -% -If food be the music of love, eat up, eat up. -% -If for every rule there is an exception, then we have established that there -is an exception to every rule. If we accept "For every rule there is an -exception" as a rule, then we must concede that there may not be an exception -after all, since the rule states that there is always the possibility of -exception, and if we follow it to its logical end we must agree that there -can be an exception to the rule that for every rule there is an exception. - -- Bill Boquist -% -If God did not exist, it would be necessary to invent him. - -- Voltaire, "Epitres, XCVI" -% -If God didn't mean for us to juggle, tennis balls wouldn't come three -to a can. -% -If God had a beard, he'd be a UNIX programmer. -% -If God had intended Man to program, we'd be born with serial I/O ports. -% -If God had intended Man to Smoke, He would have set him on Fire. -% -If God had intended Man to Walk, He would have given him Feet. -% -If God had intended Man to Watch TV, He would have given him Rabbit Ears. -% -If God had intended Men to Smoke, He would have put Chimneys in their Heads. -% -If God had meant for us to be in the Army, -we would have been born with green, baggy skin. -% -If God had meant for us to be naked, we would have been born that way. -% -If God had not given us sticky tape, -it would have been necessary to invent it. -% -If God had really intended men to fly, -he'd make it easier to get to the airport. - -- George Winters -% -If God had wanted us to be concerned for the plight of the toads, he would -have made them cute and furry. - -- Dave Barry -% -If God had wanted us to use the metric system, Jesus would have had -only ten apostles. -% -If God had wanted you to go around nude, -He would have given you bigger hands. -% -If God hadn't wanted you to be paranoid, -He wouldn't have given you such a vivid imagination. -% -If God is dead, who will save the Queen? -% -If God is One, what is bad? - -- Charles Manson -% -If God is perfect, why did He create discontinuous functions? -% -If God lived on Earth, people would knock out all His windows. - -- Yiddish saying -% -If God wanted us to be brave, why did he give us legs? - -- Marvin Kitman -% -If God wanted us to have a President, -He would have sent us a candidate. - -- Jerry Dreshfield -% -If graphics hackers are so smart, -why can't they get the bugs out of fresh paint? -% -If happiness is in your destiny, you need not be in a hurry. - -- Chinese proverb -% -If he had only learnt a little less, how -infinitely better he might have taught much more! -% -If he once again pushes up his sleeves in order to compute for 3 days -and 3 nights in a row, he will spend a quarter of an hour before to -think which principles of computation shall be most appropriate. - -- Voltaire, "Diatribe du docteur Akakia" -% -If he should ever change his faith, -it'll be because he no longer thinks he's God. -% -If I cannot bend Heaven, I shall move Hell. - -- Publius Vergilius Maro (Virgil) -% -If I could drop dead right now, I'd be the happiest man alive! - -- Samuel Goldwyn -% -If I could read your mind, love, -What a tale your thoughts could tell, -Just like a paperback novel, -The kind the drugstore sells, -When you reach the part where the heartaches come, -The hero would be me, -Heroes often fail, -You won't read that book again, because - the ending is just too hard to take. - -I walk away, like a movie star, -Who gets burned in a three way script, -Enter number two, -A movie queen to play the scene -Of bringing all the good things out in me, -But for now, love, let's be real -I never thought I could act this way, -And I've got to say that I just don't get it, -I don't know where we went wrong but the feeling is gone -And I just can't get it back... - -- Gordon Lightfoot, "If You Could Read My Mind" -% -If I could stick my pen in my heart, -I would spill it all over the stage. -Would it satisfy ya, would it slide on by ya, -Would you think the boy was strange? -Ain't he strange? -... -If I could stick a knife in my heart, -Suicide right on the stage, -Would it be enough for your teenage lust, -Would it help to ease the pain? -Ease your brain? - -- Rolling Stones, "It's Only Rock'N Roll" -% -If I 'cp /bin/csh /dev/audio' shouldn't I hear the ocean? - -- Danno Coppock -% -If I don't drive around the park, -I'm pretty sure to make my mark. -If I'm in bed each night by ten, -I may get back my looks again. -If I abstain from fun and such, -I'll probably amount to much; -But I shall stay the way I am, -Because I do not give a damn. - -- Dorothy Parker -% -If I don't see you in the future, I'll see you in the pasture. -% -If I had a formula for bypassing trouble, I would not pass it around. -Trouble creates a capacity to handle it. I don't say embrace trouble; that's -as bad as treating it as an enemy. But I do say meet it as a friend, for -you'll see a lot of it and you had better be on speaking terms with it. - -- Oliver Wendell Holmes, Jr. -% -If *I* had a hammer, there'd be no more folk singers. -% -IF I HAD A MINE SHAFT, I don't think I would just abandon it. There's -got to be a better way. - -- Jack Handey, "The New Mexican" (1988) -% -If I had a plantation in Georgia and a home in Hell, -I'd sell the plantation and go home. - -- Eugene P. Gallagher -% -If I had any humility I would be perfect. - -- Ted Turner -% -If I had done everything I'm credited with, I'd be speaking to you from -a laboratory jar at Harvard. - -- Frank Sinatra - -AS USUAL, YOUR INFORMATION STINKS. - -- Frank Sinatra, telegram to "Time" magazine -% -If I had my life to live over, I'd try to make more mistakes next time. I -would relax, I would limber up, I would be sillier than I have been this -trip. I know of very few things I would take seriously. I would be crazier. -I would climb more mountains, swim more rivers and watch more sunsets. I'd -travel and see. I would have more actual troubles and fewer imaginary ones. -You see, I am one of those people who lives prophylactically and sensibly -and sanely, hour after hour, day after day. Oh, I have had my moments and, -if I had it to do over again, I'd have more of them. In fact, I'd try to -have nothing else. Just moments, one after another, instead of living so many -years ahead each day. I have been one of those people who never go anywhere -without a thermometer, a hot water bottle, a gargle, a raincoat and a parachute. -If I had it to do over again, I would go places and do things and travel -lighter than I have. If I had my life to live over, I would start bare-footed -earlier in the spring and stay that way later in the fall. I would play hooky -more. I probably wouldn't make such good grades, but I'd learn more. I would -ride on more merry-go-rounds. I'd pick more daisies. -% -If I had only known, I would have been a locksmith. - -- Albert Einstein -% -If I had to live my life again, I'd make the same mistakes, only sooner. - -- Tallulah Bankhead -% -If I have not seen so far it is because I stood in giant's footsteps. -% -If I have seen farther than others, it is because I was standing on the -shoulders of giants. - -- Isaac Newton - -In the sciences, we are now uniquely privileged to sit side by side with -the giants on whose shoulders we stand. - -- Gerald Holton - -If I have not seen as far as others, it is because giants were standing on -my shoulders. - -- Hal Abelson - -Mathematicians stand on each other's shoulders. - -- Gauss - -Mathematicians stand on each other's shoulders while computer scientists -stand on each other's toes. - -- Richard Hamming - -It has been said that physicists stand on one another's shoulders. If -this is the case, then programmers stand on one another's toes, and -software engineers dig each other's graves. - -- Unknown -% -If I have to lay an egg for my country, I'll do it. - -- Bob Hope -% -If I knew what brand [of whiskey] he drinks, -I would send a barrel or so to my other generals. - -- Abraham Lincoln, on General Grant -% -If I love you, what business is it of yours? - -- Johann Wolfgang von Goethe -% -If I made peace with Russia today, I'd only attack her again tomorrow. I -just couldn't help myself. - -- Adolf Hitler -% -If I promised you the moon and the stars, would you believe it? - -- Alan Parsons Project -% -If I set here and stare at nothing long enough, people might think -I'm an engineer working on something. - -- S. R. McElroy -% -If I told you you had a beautiful body, would you hold it against me? -% -If I traveled to the end of the rainbow -As Dame Fortune did intend, -Murphy would be there to tell me -The pot's at the other end. - -- Bert Whitney -% -If I want your opinion, I'll ask you to fill out the necessary form. -% -If I were a grave-digger or even a hangman, there are some people I could -work for with a great deal of enjoyment. - -- Douglas Jerrold -% -If I were to walk on water, the press would say I'm only doing it -because I can't swim. - -- Bob Stanfield -% -If I'd known computer science was going to be like this, -I'd never have given up being a rock 'n' roll star. - -- G. Hirst -% -If ignorance is bliss, why aren't there more happy people? -% -If I'm over the hill, why is it I don't recall ever being on top? - -- Jerry Muscha -% -If in any problem you find yourself doing an immense amount of work, the -answer can be obtained by simple inspection. -% -If in doubt, mumble. -% -If it ain't baroque, don't fix it. -% -If it ain't broke, don't fix it. -% -If it doesn't smell yet, it's pretty fresh. - -- Dave Johnson, on dead seagulls -% -If it happens once, it's a bug. -If it happens twice, it's a feature. -If it happens more than twice, it's a design philosophy. -% -If it has syntax, it isn't user-friendly. -% -If it heals good, say it. -% -If it is a Miracle, any sort of evidence will -answer, but if it is a Fact, proof is necessary. - -- Samuel Clemens -% -If it pours before seven, it has rained by eleven. -% -If it smells it's chemistry, if it crawls it's biology, if it doesn't work -it's physics. -% -If it takes a bloodbath, lets get it over with. No more appeasement. - -- Ronald Reagan -% -If it wasn't for Newton, we wouldn't have to eat bruised apples. -% -If it wasn't for the last minute, nothing would get done. -% -If it wasn't so warm out today, it would be cooler. -% -If it were not for the presents, an elopement would be preferable. - -- George Ade, "Forty Modern Fables" -% -If it were thought that anything I wrote was influenced by Robert Frost, -I would take that particular work of mine, shred it, and flush it down -the toilet, hoping not to clog the pipes. A more sententious, holding- -forth old bore who expected every hero-worshiping adenoidal little twerp -of a student-poet to hang on to his every word I never saw. - -- James Dickey -% -If it weren't for the last minute, nothing would ever get done. -% -If it's Tuesday, this must be someone else's fortune. -% -If it's worth doing, do it for money. -% -If it's worth doing, it's worth doing for money. -% -If it's worth hacking on well, it's worth hacking on for money. -% -If Jesus Christ were to come today, people would not even crucify him. -They would ask him to dinner, and hear what he had to say, and make -fun of it. - -- Thomas Carlyle -% -If just one piece of mail gets lost, well, they'll just think they forgot to -send it. But if *two* pieces of mail get lost, hell, they'll just think the -other guy hasn't gotten around to answering his mail. And if *fifty* pieces -of mail get lost, can you imagine it, if *fifty* pieces of mail get lost, why -they'll think something *else* is broken! And if 1Gb of mail gets lost, -they'll just *know* that uunet is down and think it's a conspiracy to keep -them from their God given right to receive Net Mail ... - -- Leith (Casey) Leedom, apologies to Arlo Guthrie -% -If Karl, instead of writing a lot about Capital, -had made a lot of Capital, it would have been much better. - -- Karl Marx's Mother -% -If life gives you lemons, make lemonade. -% -If life is a stage, I want some better lighting. -% -If life is merely a joke, the question -still remains: for whose amusement? -% -If life isn't what you wanted, have you asked for anything else? -% -If little else, the brain is an educational toy. - -- Tom Robbins -% -If little green men land in your back yard, hide any little green women -you've got in the house. - -- Mike Harding, "The Armchair Anarchist's Almanac" -% -If love is the answer, could you rephrase the question? - -- Lily Tomlin -% -If Love Were Oil, I'd Be About A Quart Low - -- Book title by Lewis Grizzard -% -If Machiavelli were a hacker, he'd have worked for the CSSG. - -- Phil Lapsley -% -If Machiavelli were a programmer, he'd have worked for AT&T. -% -If man is only a little lower than the angels, the angels should reform. - -- Mary Wilson Little -% -If mathematically you end up with the wrong -answer, try multiplying by the page number. -% -If men acted after marriage as they do during courtship, there would -be fewer divorces -- and more bankruptcies. - -- Frances Rodman -% -If men are not afraid to die, -it is of no avail to threaten them with death. - -If men live in constant fear of dying, -And if breaking the law means a man will be killed, -Who will dare to break the law? - -There is always an official executioner. -If you try to take his place, -It is like trying to be a master carpenter and cutting wood. -If you try to cut wood like a master carpenter, - you will only hurt your hand. - -- Tao Te Ching, "Lao Tsu, #74" -% -If money can't buy happiness, I guess you'll just have to rent it. -% -If more of us valued food and cheer and song above hoarded gold, it would -be a merrier world. - -- J. R. R. Tolkien -% -If once a man indulges himself in murder, very soon he comes to think little -of robbing; and from robbing he next comes to drinking and Sabbath-breaking, -and from that to incivility and procrastination. - -- Thomas De Quincey (1785-1859) -% -If one cannot enjoy reading a book over and -over again, there is no use in reading it at all. - -- Oscar Wilde -% -If one inquires why the American tradition is so strong against any connection -of State and Church, why it dreads even the rudiments of religious teaching -in state-maintained schools, the immediate and superficial answer is not -far to seek. ... The cause lay largely in the diversity and vitality of the -various denominations, each fairly sure that, with a fair field and no favor, -it could make its own way; and each animated by a jealous fear that, if any -connection of State and Church were permitted, some rival denomination would -get an unfair advantage. - -- John Dewey, "Democracy in the Schools", 1908 -% -If one studies too zealously, one easily loses his pants. - -- Albert Einstein -% -If one tells the truth, one is sure, sooner or later, to be found out. - -- Oscar Wilde, - "Phrases and Philosophies for the Use of the Young" -% -If only Dionysus were alive! Where would he eat? - -- Woody Allen -% -If only God would give me some clear sign! -Like making a large deposit in my name at a Swiss bank. - -- Woody Allen, "Without Feathers" -% -If only I could be respected without having to be respectable. -% -If only you had a personality instead of an attitude. -% -If only you knew she loved you, you could -face the uncertainty of whether you love her. -% -If opportunity came disguised as temptation, one knock would be enough. -% -If parents would only realize how they bore their children. - -- George Bernard Shaw -% -If Patrick Henry thought that taxation without representation was bad, -he should see how bad it is with representation. -% -If people are good only because they fear punishment, and hope for reward, -then we are a sorry lot indeed. - -- Albert Einstein -% -If people concentrated on the really important things in life, -there'd be a shortage of fishing poles. - -- Doug Larson -% -If people drank ink instead of Schlitz, they'd be better off. - -- Edward E. Hippensteel - -[What brand of ink? Ed.] -% -If people have to choose between freedom and sandwiches, they -will take sandwiches. - -- Lord Boyd-orr - -Eats first, morals after. - -- Bertolt Brecht, "The Threepenny Opera" -% -If people say that here and there someone has been taken away and maltreated, -I can only reply: You can't make an omelette without breaking eggs. - -- Hermann Goering -% -If people see that you mean them no harm, -they'll never hurt you, nine times out of ten! -% -If practice makes perfect, and nobody's perfect, why practice? -% -If preceded by a '-', the timezone shall be east of the Prime -Meridian; otherwise, it shall be west (which may be indicated by -an optional preceding '+'). - -- POSIX 2001 - -The "+" or "-" indicates whether the time-of-day is ahead of -(i.e., east of) or behind (i.e., west of) Universal Time. - -- RFC 2822 -% -If pregnancy were a book they would cut the last two chapters. - -- Nora Ephron, "Heartburn" -% -If pro is the opposite of con, what is the opposite of progress? -% -If puns were deli meat, this would be the wurst. -% -If rabbits feet are so lucky, what happened to the rabbit? -% -If reporters don't know that truth is plural, they ought to be lawyers. - -- Tom Wicker -% -If researchers wrote nursery rhymes... - -Little Miss Muffet sat on her gluteal region, -Eating components of soured milk. -On at least one occasion, - along came an arachnid and sat down beside her, -Or at least in her vicinity, -And caused her to feel an overwhelming, but not paralyzing, fear, -Which motivated the patient to leave the area rather quickly. - -- Ann Melugin Williams -% -If Ricky Schroder and Gary Coleman had a fight on television with -pool cues, who would win? - 1) Ricky Schroder - 2) Gary Coleman - 3) The television viewing public - -- David Letterman -% -If sarcasm were posted on Usenet, would anybody notice? - -- James Nicoll -% -If scientific reasoning were limited to the logical processes of -arithmetic, we should not get very far in our understanding of the physical -world. One might as well attempt to grasp the game of poker entirely by -the use of the mathematics of probability. - -- Vannevar Bush -% -If sex is such a natural phenomenon, how come there are so many -books on how to? - -- Bette Midler -% -If she had not been cupric in her ions, -Her shape ovoidal, -Their romance might have flourished. -But he built tetrahedral in his shape, -His ions ferric, -Love could not help but die, -Uncatalyzed, inert, and undernourished. -% -If society fits you comfortably enough, you call it freedom. - -- Robert Frost -% -If some people didn't tell you, -you'd never know they'd been away on vacation. -% -If someone had told me I would be Pope -one day, I would have studied harder. - -- Pope John Paul I -% -If someone says he will do something "without fail", he won't. -% -If something has not yet gone wrong then it would -ultimately have been beneficial for it to go wrong. -% -If swimming is so good for your figure, how come whales look the -way they do? -% -If that makes any sense to you, you have a big problem. - -- C. Durance, Computer Science 234 -% -If the aborigine drafted an IQ test, all of Western civilization would -presumably flunk it. - -- Stanley Garn -% -If the automobile had followed the same development as the computer, a -Rolls-Royce would today cost $100, get a million miles per gallon, -and explode once a year killing everyone inside. - -- Robert Cringely, InfoWorld -% -If the church put in half the time on covetousness that it does on lust, -this would be a better world. - -- Garrison Keillor, "Lake Wobegon Days" -% -If the code and the comments disagree, then both are probably wrong. - -- Norm Schryer -% -If the colleges were better, if they really had it, you would need to get -the police at the gates to keep order in the inrushing multitude. See in -college how we thwart the natural love of learning by leaving the natural -method of teaching what each wishes to learn, and insisting that you shall -learn what you have no taste or capacity for. The college, which should -be a place of delightful labor, is made odious and unhealthy, and the -young men are tempted to frivolous amusements to rally their jaded spirits. -I would have the studies elective. Scholarship is to be created not -by compulsion, but by awakening a pure interest in knowledge. The wise -instructor accomplishes this by opening to his pupils precisely the -attractions the study has for himself. The marking is a system for schools, -not for the college; for boys, not for men; and it is an ungracious work to -put on a professor. - -- Ralph Waldo Emerson -% -If the designers of X-window built cars, there would be no fewer than five -steering wheels hidden about the cockpit, none of which followed the same -principles -- but you'd be able to shift gears with your car stereo. Useful -feature, that. - -- From the programming notebooks of a heretic, 1990 -% -If the ends don't justify the means, then what does? - -- Robert Moses -% -If the English language made any sense, lackadaisical -would have something to do with a shortage of flowers. - -- Doug Larson - -[Not to mention, butterfly would be flutterby. Ed.] -% -If the facts don't fit the theory, change the facts. - -- Albert Einstein -% -If the future isn't what it used to be, does that -mean that the past is subject to change in times to come? -% -If the girl you love moves in with another guy once, it's more than enough. -Twice, it's much too much. Three times, it's the story of your life. -% -If the government doesn't trust the people, why -doesn't it dissolve them and elect a new people? -% -If the grass is greener on other side of fence, -consider what may be fertilizing it. -% -If the human brain were so simple that we could understand it, -we would be so simple we couldn't. -% -If the King's English was good enough for Jesus, it's good enough for -me! - -- "Ma" Ferguson, Governor of Texas (circa 1920) -% -If the Lord God Almighty had consulted me before embarking upon the Creation, -I would have recommended something simpler. - -- Alfonso the Wise, 13th Century King of Castile, - Commenting on the Almagest, by Ptolemy. -% -If the master dies and the disciple grieves, -the lives of both have been wasted. -% -If the meanings of "true" and "false" were switched, -then this sentence would not be false. -% -If the Nazi's had television with satellite technology, we'd all be -goose-stepping. Americans are just as suggestible. - -- Frank Zappa -% -If the odds are a million to one against something -occurring, chances are 50-50 it will. -% -If the path be beautiful, let us not ask where it leads. - -- Anatole France -% -If the rich could pay the poor to die for them, -what a living the poor could make! -% -If the shoe fits, it's ugly. -% -If the standard says that [things] depend on the phase of the moon, -the programmer should be prepared to look out the window as necessary. - -- Chris Torek -% -If the thunder don't get you, then the lightning will. -% -If the vendors started doing everything right, we would be out of a job. -Let's hear it for OSI and X! With those babies in the wings, we can count -on being employed until we drop, or get smart and switch to gardening, -paper folding, or something. - -- C. Philip Wood -% -If the very old will remember, the very young will listen. - -- Chief Dan George -% -If the weather is extremely bad, church attendance will be down. -If the weather is extremely good, church attendance will be down. -If the bulletin covers are in short supply, however, -church attendance will exceed all expectations. - -- Reverend Chichester -% -If there are epigrams, there must be meta-epigrams. -% -If there is a possibility of several things going wrong, the one that -will cause the most damage will be the one to go wrong. -% -If there is a sin against life, it consists perhaps not so much in despairing -of life as in hoping for another life and in eluding the implacable grandeur -of this life. - -- Albert Camus -% -If there is a wrong way to do something, then someone will do it. - -- Edward A. Murphy, Jr. -% -If there is any realistic deterrent to marriage, it's the fact that you -can't afford divorce. - -- Jack Nicholson -% -If there is no God, who pops up the next Kleenex? - -- Art Hoppe -% -If there is no wind, row. - -- Polish proverb -% -If there really was a Jewish conspiracy to run the world, my rabbi would -have let me in on it by now. I contribute enough to the shule. - -- Saul Goodman -% -If there was any justice in the world, "trust" would be a four-letter word. -% -If there were a school for, say, sheet metal workers, that after three -years left its graduates as unprepared for their careers as does law -school, it would be closed down in a minute, and no doubt by lawyers. - -- Michael Levin, "The Socratic Method -% -If they can make penicillin out of moldy bread, they can sure make -something out of you. - -- Muhammad Ali -% -If they sent one man to the moon, why can't they send them all? -% -If they think you're crude, go technical; if they think you're technical, -go crude. I'm a very technical boy. So I get as crude as possible. These -days, though, you have to be pretty technical before you can even aspire -to crudeness... - -- Johnny Mnemonic -% -If they were so inclined, they could impeach -him because they don't like his necktie. - -- Attorney General William Saxbe -% -If things don't improve soon, you'd better ask them to stop helping you. -% -If this fortune didn't exist, somebody would have invented it. -% -If this is timesharing, give me my share right now. -It's not time yet. -% -If time heals all wounds, how come the belly button stays the same? -% -If today is the first day of the rest of your life, what the hell was -yesterday? -% -If truth is beauty, how come no one has their hair done in the library? - -- Lily Tomlin -% -If two men agree on everything, you may be sure that one of them is -doing the thinking. - -- Lyndon B. Johnson - -Jerry Ford is a nice guy, but he played too much football with his -helmet off. - -- Lyndon B. Johnson - -I do not believe that this generation of Americans is willing to resign -itself to going to bed each night by the light of a Communist moon. - -- Lyndon B. Johnson -% -If two people love each other, there can be no happy end to it. - -- Ernest Hemingway -% -If value corrupts then absolute value corrupts absolutely. -% -If voting could change the system, it would be illegal. -If not voting could change the system, it would be illegal. -% -If we all work together, we can totally disrupt the system. -% -If we can ever make red tape nutritional, we can feed the world. - -- R. Schaeberle, "Management Accounting" -% -If we could sell our experiences for what they cost us, we would -all be millionaires. - -- Abigail Van Buren -% -If we do not change our direction we are -likely to end up where we are headed. -% -If we don't survive, we don't do anything else. - -- John Sinclair -% -If we men married the women we deserved, we should have a very bad time -of it. - -- Oscar Wilde -% -If we relied conclusively on scientific data for every one of our -findings, I'm afraid all of our work would be inconclusive. - -- Henry Hudson, of the Meese Pornography Commission, on - criticism of its conclusion that pornography causes sex - crimes. -% -If we see the light at the end of the tunnel -It's the light of an oncoming train. - -- Robert Lowell -% -If we spoke a different language, we -would perceive a somewhat different world. - -- Wittgenstein -% -If we suffer tamely a lawless attack upon our liberty, -we encourage it, and involve others in our doom. - -- Samuel Adams -% -If we were meant to fly, we wouldn't keep losing our luggage. -% -If we were meant to get up early, God would have created us -with alarm clocks. -% -If we won't stand together, we don't stand a chance. -% -If what they've been doing hasn't solved the problem, tell them to -do something else. - -- Gerald Weinberg, "The Secrets of Consulting" -% -If while you are in school, there is a shortage of qualified personnel -in a particular field, then by the time you graduate with the necessary -qualifications, that field's employment market is glutted. - -- Marguerite Emmons -% -If wishes were horses, then beggars would be thieves. -% -If women are supposed to be less rational and more emotional at the -beginning of our menstrual cycle, when the female hormone is at its -lowest level, then why isn't it logical to say that in those few days -women behave the most like the way men behave all month long? - -- Gloria Steinem -% -If women didn't exist, all the money in the world would have no meaning. - -- Aristotle Onassis -% -If you already know what recursion is, just remember the answer. -Otherwise, find someone who is standing closer to Douglas Hofstadter -than you are; then ask him or her what recursion is. - -- Andrew Plotkin -% -If you always postpone pleasure you will never have it. -Quit work and play for once! -% -If you analyse anything, you destroy it. - -- Arthur Miller -% -If you are a fatalist, what can you do about it? - -- Ann Edwards-Duff -% -If you are a police dog, where's your badge? - -- Question James Thurber used to drive his German Shepherd - crazy. -% -If you are afraid of loneliness, don't marry. - -- Anton Chekov -% -If you are going to walk on thin ice, you may as well dance. -% -If you are good, you will be assigned all the work. If you are real -good, you will get out of it. -% -If you are honest because honesty is the best policy, -your honesty is corrupt. -% -If you are looking for a kindly, well-to-do older gentleman who is no -longer interested in sex, take out an ad in The Wall Street Journal. - -- Abigail Van Buren -% -If you are not for yourself, who will be for you? -If you are for yourself, then what are you? -If not now, when? -% -If you are of the opinion that the contemplation of suicide is sufficient -evidence of a poetic nature, do not forget that actions speak louder than -words. - -- Fran Lebowitz, "Metropolitan Life" -% -If you are over 80 years old and accompanied -by your parents, we will cash your check. -% -If you are shooting under 80 you are neglecting your business; -over 80 you are neglecting your golf. - -- Walter Hagen -% -If you are smart enough to know that you're not -smart enough to be an Engineer, then you're in Business. -% -If you are too busy to read, then you are too busy. -% -If you are what you eat, does that mean Euelle Gibbons really was a nut? -% -If you aren't rich you should always look useful. - -- Louis-Ferdinand Celine -% -If you can count your money, you don't have a billion dollars. - -- J. Paul Getty -% -If you can lead it to water and force it to drink, it isn't a horse. -% -If you can not say it, you can not whistle it, either. - -- Wittgenstein -% -If you can read this, you're too close. -% -If you can survive death, you can probably survive anything. -% -If you cannot convince them, confuse them. - -- Harry S. Truman -% -If you cannot in the long run tell everyone -what you have been doing, your doing was worthless. - -- Edwin Schrodinger -% -If you can't be good, be careful. -If you can't be careful, give me a call. -% -If you can't get your work done in the first 24 hours, work nights. -% -If you can't learn to do it well, learn to enjoy doing it badly. -% -If you can't read this, blame a teacher. -% -If you can't say anything good about someone, sit right here by me. - -- Alice Roosevelt Longworth -% -If you can't understand it, it is intuitively obvious. -% -If you catch a man, throw him back. - -- Woman's Liberation Slogan, c. 1975 -% -If you continually give you will continually have. -% -If you could only get that wonderful feeling of -accomplishment without having to accomplish anything. -% -If you didn't get caught, did you really do it? -% -If you didn't have most of your friends, -you wouldn't have most of your problems. -% -If you didn't have to work so hard, -you'd have more time to be depressed. -% -If you do not think about the future, you cannot have one. - -- John Galsworthy -% -If you do not wish a man to do a thing, you had better get him to talk about -it; for the more men talk, the more likely they are to do nothing else. - -- Carlyle -% -If you do something right once, someone will ask you to do it again. -% -If you don't care where you are, then you ain't lost. -% -If you don't count some of Jehovah's injunctions, there are no humorists -in the Bible. - -- Mordecai Richler -% -If you don't do it, you'll never know what -would have happened if you had done it. -% -If you don't do the things that are not worth doing, who will? -% -If you don't drink it, someone else will. -% -If you don't go to other men's funerals they won't go to yours. - -- Clarence Day -% -If you don't have a nasty obituary you probably didn't matter. - -- Freeman Dyson -% -If you don't have the time right now, -will you have redo right time later? -% -If you don't have time to do it right, where -are you going to find the time to do it over? -% -If you don't know what game you're playing, don't ask what the score is. -% -If you don't like the way I drive, stay off the sidewalk! -% -If you don't say anything, you won't be called on to repeat it. - -- Calvin Coolidge -% -If you don't strike oil in twenty minutes, stop boring. - -- Andrew Carnegie, on public speaking -% -If you don't want your dog to have bad breath, do what I do: Pour a little -Lavoris in the toilet. - -- Jay Leno -% -If you drink, don't park. Accidents make people. -% -If you eat a live frog in the morning, nothing worse will happen to -either of you for the rest of the day. -% -If you ever want to get anywhere in politics, my boy, you're going to -have to get a toehold in the public eye. -% -If you ever want to have a lot of fun, I recommend that you go off and program -an embedded system. The salient characteristic of an embedded system is that -it cannot be allowed to get into a state from which only direct intervention -will suffice to remove it. An embedded system can't permanently trust anything -it hears from the outside world. It must sniff around, adapt, consider, sniff -around, and adapt again. I'm not talking about ordinary modular programming -carefulness here. No. Programming an embedded system calls for undiluted -raging maniacal paranoia. For example, our ethernet front ends need to know -what network number they are on so that they can address and route PUPs -properly. How do you find out what your network number is? Easy, you ask a -gateway. Gateways are required by definition to know their correct network -numbers. Once you've got your network number, you start using it and before -you can blink you've got it wired into fifteen different sockets spread all -over creation. Now what happens when the panic-stricken operator realizes he -was running the wrong version of the gateway which was giving out the wrong -network number? Never supposed to happen. Tough. Supposing that your -software discovers that the gateway is now giving out a different network -number than before, what's it supposed to do about it? This is not discussed -in the protocol document. Never supposed to happen. Tough. I think you -get my drift. -% -If you explain so clearly that nobody can misunderstand, somebody -will. -% -If you explain something so clearly that no -one can possibly misunderstand, someone will. -% -If you fail to plan, plan to fail. -% -If you find a solution and become attached to it, -the solution may become your next problem. -% -If you flaunt it, expect to have it trashed. -% -If you float on instinct alone, how can you -calculate the buoyancy for the computed load? - -- Christopher Hodder-Williams -% -If you fool around with something long -enough, it will eventually break. -% -If you give a man enough rope, he'll claim he's tied up at the office. -% -If you give Congress a chance to vote on -both sides of an issue, it will always do it. - -- Les Aspin, D, Wisconsin -% -If you go on with this nuclear arms race, -all you are going to do is make the rubble bounce. - -- Winston Churchill -% -If you go out of your mind, do it quietly, -so as not to disturb those around you. -% -If you go parachuting, and your parachute doesn't open, and your friends are -all watching you fall, I think a funny gag would be to pretend you were -swimming. - -- Jack Handey -% -If you had any brains, you'd be dangerous. -% -If you had better tools, you could more -effectively demonstrate your total incompetence. -% -If you had just one moment to live -And they granted you one special wish -Would you ask for something -Like another chance. - -- Traffic, "The Low Spark of Hi Heeled Boys" -% -If you hands are clean and your cause is just -and your demands are reasonable, at least it's a start. -% -If you have a procedure with 10 parameters, you probably missed some. -% -If you have never been hated by your child, you have never been a parent. - -- Bette Davis -% -If you have nothing to do, don't do it here. -% -If you have received a letter inviting you to speak at the dedication of a -new cat hospital, and you hate cats, your reply, declining the invitation, -does not necessarily have to cover the full range of your emotions. You must -make it clear that you will not attend, but you do not have to let fly at cats. -The writer of the letter asked a civil question; attack cats, then, only if -you can do so with good humor, good taste, and in such a way that your answer -will be courteous as well as responsive. Since you are out of sympathy with -cats, you may quite properly give this as a reason for not appearing at the -dedication ceremonies of a cat hospital. But bear in mind that your opinion -of cats was not sought, only your services as a speaker. Try to keep things -straight. - -- Strunk and White, "The Elements of Style" -% -If you have seen one city slum you have seen them all. - -- Spiro Agnew -% -If you have to ask how much it is, you can't afford it. -% -If you have to ask what jazz is, you'll never know. - -- Louis Armstrong -% -If you have to hate, hate gently. -% -If you have to think twice about it, you're wrong. -% -If you haven't enjoyed the material in the last few lectures then a career -in chartered accountancy beckons. - -- Advice from the lecturer in the middle of the Stochastic - Systems course. -% -If you hype something and it succeeds, you're a genius -- it wasn't a -hype. If you hype it and it fails, then it was just a hype. - -- Neil Bogart -% -If you just try long enough and hard enough, you can always manage to boot -yourself in the posterior. - -- A. J. Liebling, "The Press" -% -If you keep anything long enough, you can throw it away. -% -If you keep your mind sufficiently open, people will throw a lot of -rubbish into it. - -- William Orton -% -If you knew what to say next, would you say it? -% -If you know the answer to a question, don't ask. - -- Petersen Nesbit -% -If you laid all of our laws end to end, there would be no end. - -- Mark Twain -% -If you laid all the Elvis impersonators in the world, end to end... -you'd wanna run and get a steam roller, real fast. - -- David Letterman -% -If you learn one useless thing every day, in a single year you'll learn -365 useless things. -% -If you lend someone $20 and never see that person again, it was -probably worth it. -% -If you liked the Earth you'll love Heaven. -% -If you live in a country run by committee, be on the committee. - -- Graham Summer -% -If you live long enough, you'll see that every victory turns into a defeat. - -- Simone De Beauvoir -% -If you live to the age of a hundred you have it made -because very few people die past the age of a hundred. - -- George Burns -% -If you lived today as if it were your last, you'd buy up a box of rockets -and fire them all off, wouldn't you? - -- Garrison Keillor -% -If you look good and dress well, you don't need a purpose in life. - -- Robert Pante, fashion consultant -% -If you look like your driver's license photo -- see a doctor. -If you look like your passport photo -- it's too late for a doctor. -% -If you lose a son you can always get another, -but there's only one Maltese Falcon. - -- Sidney Greenstreet, "The Maltese Falcon" -% -If you lose your temper at a newspaper columnist, -he'll get rich or famous or both. -% -If you love someone, set them free. -If they don't come back, then call them up when you're drunk. -% -If you love something set it free. If it doesn't -come back to you, hunt it down and kill it. -% -If you make a mistake you right it -immediately to the best of your ability. -% -If you make any money, the government shoves you in the creek once a year -with it in your pockets, and all that don't get wet you can keep. - -- The Best of Will Rogers -% -If you make people think they're thinking, they'll love you; -but if you really make them think they'll hate you. -% -If you marry a man who cheats on his wife, you'll -be married to a man who cheats on his wife. - -- Ann Landers -% -If you mess with a thing long enough, it'll break. - -- Schmidt -% -If you MUST get married, it is always advisable to marry beauty. -Otherwise, you'll never find anybody to take her off your hands. -% -If you need anything just whistle. -You know how to whistle, don't you, Steve? -Just put your lips together and blow. - -- Lauren Bacall, "To Have and Have Not" -% -If you notice that a person is deceiving you, -they must not be deceiving you very well. -% -If you only have a hammer, you tend to see every problem as a nail. - -- Maslow -% -If you perceive that there are four possible ways in which a procedure -can go wrong, and circumvent these, then a fifth way will promptly -develop. -% -If you pick up a starving dog and make him prosperous, he will not bite -you. This is the principal difference between a dog and a man. - -- Mark Twain -% -If you push the "extra ice" button on the soft drink vending machine, -you won't get any ice. If you push the "no ice" button, you'll get -ice, but no cup. -% -If you put garbage in a computer nothing comes out but garbage. But -this garbage, having passed through a very expensive machine, is -somehow ennobled and none dare criticize it. -% -If you put it off long enough, it might go away. -% -If you put tomfoolery into a computer, nothing comes out but tomfoolery. -But this tomfoolery, having passed through a very expensive machine, -is somehow ennobled and no-one dare criticise it. - -- Pierre Gallois -% -If you put your supper dish to your ear you can hear the sounds of a -restaurant. - -- Snoopy -% -If you really want to do something new, the good won't help you with it. -Let me have men about me that are arrant knaves. The wicked, who have -something on their conscience, are obliging, quick to hear threats, because -they know how it's done, and for booty. You can offer them things because -they will take them. Because they have no hesitations. You can hang them -if they get out of step. Let me have men about me that are utter villains --- provided that I have the power, the absolute power, over life and death. - -- Hermann Goering -% -If you refuse to accept anything but the best you very often get it. -% -If you remember the 60's, you weren't there. -% -If you resist reading what you disagree with, how will you ever acquire -deeper insights into what you believe? The things most worth reading -are precisely those that challenge our convictions. -% -If you see an onion ring -- answer it! -% -If you sell diamonds, you cannot expect to have many customers. -But a diamond is a diamond even if there are no customers. - -- Swami Prabhupada -% -If you sit down at a poker game and don't see a sucker, get up. You're -the sucker. -% -If you sow your wild oats, hope for a crop failure. -% -If you stand on your head, you will get footprints in your hair. -% -If you steal from one author it's plagiarism; if you steal from -many it's research. - -- Wilson Mizner -% -If you stew apples like cranberries, -they taste more like prunes than rhubarb does. - -- Groucho Marx -% -If you stick a stock of liquor in your locker, -It is slick to stick a lock upon your stock. - Or some joker who is slicker, - Will trick you of your liquor, -If you fail to lock your liquor with a lock. -% -If you stick your head in the sand, -one thing is for sure, you're gonna get your rear kicked. -% -If you suspect a man, don't employ him. -% -If you talk to God, you are praying; if God talks to you, you have -schizophrenia. - -- Thomas Szasz -% -If you teach your children to like computers and to know how to gamble -then they'll always be interested in something and won't come to no real -harm. -% -If you tell the truth you don't have to remember anything. - -- Mark Twain -% -If you think before you speak the other guy gets his joke in first. -% -If you think education is expensive, try ignorance. - -- Derek Bok, president of Harvard -% -If you think last Tuesday was a drag, -wait till you see what happens tomorrow! -% -If you think nobody cares if you're alive, -try missing a couple of car payments. - -- Earl Wilson -% -If you think technology can solve your security problems, then you -don't understand the problems and you don't understand the technology. - -- Bruce Schneier -% -If you think the pen is mightier than the sword, the next time -someone pulls out a sword I'd like to see you get up there with -your Bic. -% -If you think the problem is bad now, just wait until we've solved it. - -- Arthur Kasspe -% -If you think the system is working, -ask someone who's waiting for a prompt. -% -If you think the United States has stood still, who built the largest -shopping center in the world? - -- Richard M. Nixon -% -If you think things can't get worse it's probably only because you -lack sufficient imagination. -% -If you throw a New Year's Party, the worst thing that you can do would be -to throw the kind of party where your guests wake up today, and call you to -say they had a nice time. Now you'll be expected to throw another party -next year. - What you should do is throw the kind of party where your guest wake - up several days from now and call their lawyers to find out if -they've been indicted for anything. You want your guests to be so anxious -to avoid a recurrence of your party that they immediately start planning -parties of their own, a year in advance, just to prevent you from having -another one ... - If your party is successful, the police will knock on your door, -unless your party is very successful in which case they will lob tear gas -through your living room window. As host, your job is to make sure that -they don't arrest anybody. Or if they're dead set on arresting someone, -your job is to make sure it isn't you ... - -- Dave Barry -% -If you took all of the grains of sand in the world, and lined -them up end to end in a row, you'd be working for the government! - -- Mr. Interesting -% -If you took all the students that felt asleep in class and laid them -end to end, they'd be a lot more comfortable. - -- "Graffiti in the Big Ten" -% -If you treat people right they will treat you right -- 90% of the time. - -- Franklin D. Roosevelt -% -If you try to please everyone, somebody is not going to like it. -% -If you understand what you're doing, you're not learning anything. - -- Abraham Lincoln -% -If you wait long enough, it will go away... after having -done its damage. If it was bad, it will be back. -% -If you want divine justice, die. - -- Nick Seldon -% -If you want me to be a good little bunny -just dangle some carats in front of my nose. - -- Lauren Bacall -% -If you want to be ruined, marry a rich woman. - -- Michelet -% -If you want to get rich from writing, write the sort of thing that's -read by persons who move their lips when they're reading to themselves. - -- Don Marquis -% -If you want to know how old a man is, ask his brother-in-law. -% -If you want to know what god thinks of money, just look at the people -he gave it to. - -- Dorothy Parker -% -If you want to make God laugh, tell him about your plans. - -- Woody Allen -% -If you want to put yourself on the map, publish your own map. -% -If you want to read about love and marriage you've got to buy two separate -books. - -- Alan King -% -If you want to see card tricks, you have to expect to take cards. - -- Harry Blackstone -% -If you want to understand your government, don't begin by reading the -Constitution. It conveys precious little of the flavor of today's statecraft. -Instead, read selected portions of the Washington telephone directory -containing listings for all the organizations with titles beginning with -the word "National". - -- George Will -% -If you want your spouse to listen and pay strict attention to every word -you say, talk in your sleep. -% -If you wants to get elected president, you'se got to think up some -memoraboble homily so's school kids can be pestered into memorizin' it, -even if they don't know what it means. - -- Walt Kelly, "The Pogo Party" -% -If you waste your time cooking, you'll miss the next meal. -% -If you will practice being fictional for a while, you will understand that -fictional characters are sometimes more real than people with bodies and -heartbeats. -% -If you wish to be happy for one hour, get drunk. -If you wish to be happy for three days, get married. -If you wish to be happy for a month, kill your pig and eat it. -If you wish to be happy forever, learn to fish. - -- Chinese proverb -% -If you wish to live wisely, ignore sayings -- including this one. -% -If you wish to succeed, consult three old people. -% -If you wish women to love you, be original; I know a man who wore fur -boots summer and winter, and women fell in love with him. - -- Anton Chekov -% -If you work for a man, in heaven's name, work for him. -If he pays you wages which supply you bread and butter, work for him; speak - well of him; stand by him, and by the institution he represents. -If put to a pinch, an ounce of loyalty is worth a pound of cleverness. -If you must vilify, condemn and eternally find disparage -- resign your - position, and when you are outside, damn to your heart's content... - but, as long as you are part of the institution do not condemn it. -If you do that, you are loosening the tendrils that are holding you to the - institution, and at the first high wind that comes along, you will - be uprooted and blown away, and probably will never know the reason - why. -% -If you would keep a secret from an enemy, tell it not to a friend. -% -If you would know the value of money, go try to borrow some. - -- Benjamin Franklin -% -If you would understand your own age, read the works -of fiction produced in it. People in disguise speak freely. -% -If you'd like to cultivate insomnia, -Bed down with a pretty girl. -Amor vincit omnia. -% -If your aim in life is nothing; you can't miss. -% -If your bread is stale, make toast. -% -If your enemy is buried in quicksand up to his neck, pull him out. -If he is buried up to his eyes, step on his head. - -- Niccolo Machiavelli, "The Prince" -% -If your happiness depends on what somebody else does, -I guess you do have a problem. - -- Richard Bach, "Illusions" -% -If your life was a horse, you'd have to shoot it. -% -If your mind grows weak, -Don't yield to the weakness. -Even if tired of thought, -Never stop thinking. -My sons and descendants, -Don't get exhausted in reason-- -But become experienced. - -- Chinggis (Genghis) Khan -% -If your mother knew what you're doing, -she'd probably hang her head and cry. -% -If your parents don't have kids, neither will you. -% -If your sexual fantasies were truly of interest to others, they would no -longer be fantasies. - -- Fran Lebowitz -% -If you're a young Mafia gangster out on your first date, I bet it's real -embarrassing if someone tries to kill you. - -- Jack Handey -% -If you're careful enough, nothing -bad or good will ever happen to you. -% -If you're carrying a torch, put it down. -The Olympics are over. -% -If you're constantly being mistreated, -you're cooperating with the treatment. -% -If you're crossing the nation in a covered wagon, it's better to have four -strong oxen than 100 chickens. Chickens are OK but we can't make them work -together yet. - -- Ross Bott, Pyramid U.S., on multiprocessors at AUUGM '89 -% -If you're going to America, bring your own food. - -- Fran Lebowitz, "Social Studies" -% -If you're going to do something tonight -that you'll be sorry for tomorrow morning, sleep late. - -- Henny Youngman -% -If you're going to walk on thin ice, you might as well dance. -% -If you're happy, you're successful. -% -If you're not part of the solution, you're part of the precipitate. -% -If you're not very clever you should be conciliatory. - -- Benjamin Disraeli -% -If you're right 90% of the time, why quibble about the remaining 3%? -% -If you're worried by earthquakes and nuclear war, -As well as by traffic and crime, -Consider how worry-free gophers are, -Though living on burrowed time. - -- Richard Armour, WSJ, 11/7/83 -% -If you've done six impossible things before breakfast, why not round it -off with dinner at Milliway's, the restaurant at the end of the universe. - -- Douglas Adams, "The Restaurant at the End of the Universe" -% -If you've seen one redwood, you've seen them all. - -- Ronald Reagan -% -Ignisecond, n.: - The overlapping moment of time when the hand is locking the car - door even as the brain is saying, "my keys are in there!" - -- Rich Hall, "Sniglets" -% -Ignorance is bliss. - -- Thomas Gray - -Fortune updates the great quotes, #42: - BLISS is ignorance. -% -Ignorance is never out of style. It was in fashion yesterday, it is the -rage today, and it will set the pace tomorrow. - -- Franklin K. Dane -% -Ignorance is when you don't know anything and somebody finds it out. -% -Ignorance must certainly be bliss or there wouldn't be so many people -so resolutely pursuing it. -% -Ignore previous fortune. -% -Il brilgue: les t^oves libricilleux - Se gyrent et frillant dans le guave, -Enm^im'es sont les gougebosquex, - Et le m^omerade horgrave. - -- Lewis Carroll, - "Through the Looking-Glass, - and What Alice Found There" (1871) -% -Iles's Law: - There is always an easier way to do it. When looking directly - at the easy way, especially for long periods, you will not see - it. Neither will Iles. -% -I'll be comfortable on the couch. Famous last words. - -- Lenny Bruce -% -I'll be Grateful when they're Dead. -% -I'll burn my books. - -- Christopher Marlowe -% -I'll carry your books, I'll carry a tune, I'll carry on, carry over, -carry forward, Cary Grant, cash & carry, Carry Me Back To Old Virginia, -I'll even Hara Kari if you show me how, but I will *not* carry a gun. - -- Hawkeye, M*A*S*H -% -I'll defend to the death your right to say that, but I never said I'd -listen to it! - -- Tom Galloway with apologies to Voltaire -% -I'll give you my opinion of the human race in a nutshell ... their heart's -in the right place, but their head is a thoroughly inefficient organ. - -- W. Somerset Maugham, "The Summing Up" -% -I'll grant thee random access to my heart, -Thoul't tell me all the constants of thy love; -And so we two shall all love's lemmas prove -And in our bound partition never part. - -- Stanislaw Lem, "Cyberiad" -% -I'll learn to play the Saxophone, -I play just what I feel. -Drink Scotch whisky all night long, -And die behind the wheel. -They got a name for the winners in the world, -I want a name when I lose. -They call Alabama the Crimson Tide, -Call me Deacon Blues. - -- Becker and Fagan, "Deacon Blues" -% -I'll meet you... on the dark side of the moon... - -- Pink Floyd -% -I'll never get off this planet. - -- Luke Skywalker -% -I'll pretend to trust you if you'll pretend to trust me. -% -I'll rob that rich person and give it to some poor deserving slob. -That will *prove* I'm Robin Hood. - -- Daffy Duck, "Robin Hood Daffy", [1958, Chuck Jones] -% -I'll turn over a new leaf. - -- Miguel de Cervantes -% -Illegal aliens have always been a problem in the United States. Ask -any Indian. - -- Robert Orben - -Immigration is the sincerest form of flattery. - -- Jack Paar -% -Illegitimi non carborundum -(translation: no carbonated drinks allowed.) -% -Illinois isn't exactly the land that God forgot: -it's more like the land He's trying to ignore. -% -Illiterate? Write today, for free help! -% -Illusion is the first of all pleasures. - -- Voltaire -% -I'm a creationist; I refuse to believe -that I could have evolved from man. -% -"I'm a doctor, not a mechanic." - -- "The Doomsday Machine", when asked if he had heard of - the idea of a doomsday machine. -"I'm a doctor, not an escalator." - -- "Friday's Child", when asked to help the very pregnant - Ellen up a steep incline. -"I'm a doctor, not a bricklayer." - -- "Devil in the Dark", when asked to patch up the Horta. -"I'm a doctor, not an engineer." - -- "Mirror, Mirror", when asked by Scotty for help in - Engineering aboard the USS Enterprise. -"I'm a doctor, not a coal miner." - -- "The Empath", on being beneath the surface of Minara 2. -"I'm a surgeon, not a psychiatrist." - -- "City on the Edge of Forever", on Edith Keeler's remark - that Kirk talked strangely. -"I'm no magician, Spock, just an old country doctor." - -- "The Deadly Years", to Spock while trying to cure the - aging effects of the rogue comet near Gamma Hydra 4. -"What am I, a doctor or a moon shuttle conductor?" - -- "The Corbomite Maneuver", when Kirk rushed off from a - physical exam to answer the alert. -% -I'm a Hollywood writer; so I put on -a sports jacket and take off my brain. -% -I'm a Lisp variable -- bind me! -% -I'm a lucky guy, and I'm happy to be with the Yankees. And I want to -thank everyone for making this night necessary. - -- Yogi Berra at a dinner in his honor -% -I'm all for computer dating, but I -wouldn't want one to marry my sister. -% -I'm also inclined to believe that if you wait long enough, you will -eventually have more than 255 of almost *anything*.... - -- A. Lyman Chapin -% -I'm always looking for a new idea that -will be more productive than its cost. - -- David Rockefeller -% -I'm an artist. -But it's not what I really want to do. -What I really want to do is be a shoe salesman. -I know what you're going to say -- -"Dreamer! Get your head out of the clouds." -All right! But it's what I want to do. -Instead I have to go on painting all day long. - -The world should make a place for shoe salesmen. - -- J. Feiffer -% -I'm an evolutionist; I refuse to believe -that I could have been created by man. -% -I'm changing my name to Chrysler -I'm going down to Washington, D.C. -I'll tell some power broker - What they did for Iacocca -Will be perfectly acceptable to me! -I'm changing my name to Chrysler, -I'm heading for that great receiving line. -When they hand a million grand out, - I'll be standing with my hand out, -Yessir, I'll get mine! - -- Tom Paxton -% -I'm defending her honor, which is more than she ever did. -% -"I'm dying," he croaked. -"My experiment was a success," the chemist retorted. -"You can't really train a beagle," he dogmatized. -"That's no beagle, it's a mongrel," she muttered. -"The fire is going out," he bellowed. -"Bad marksmanship," the hunter groused. -"You ought to see a psychiatrist," he reminded me. -"You snake," she rattled. -"Someone's at the door," she chimed. -"Company's coming," she guessed. -"Dawn came too soon," she mourned. -"I think I'll end it all," Sue sighed. -"I ordered chocolate, not vanilla," I screamed. -"Your embroidery is sloppy," she needled cruelly. -"Where did you get this meat?" he bridled hoarsely. - -- Gyles Brandreth, "The Joy of Lex" -% -I'm fed up to the ears with old men dreaming up wars for young men to die in. - -- George McGovern -% -I'm for bringing back the birch, but only for consenting adults. - -- Gore Vidal -% -I'm free -- and freedom tastes of reality. -% -I'm glad I was not born before tea. - -- Sidney Smith (1771-1845) -% -I'm glad that I'm an American, -I'm glad that I am free, -But I wish I were a little doggy, -And McGovern were a tree. -% -I'm going through my "I want to go back to New York" phase today. Happens -every six months or so. So, I thought, perhaps unwisely, that I'd share -it with you. - -> In New York in the winter it is million degrees below zero and - the wind travels at a million miles an hour down 5th avenue. -> And in LA it's 72. - -> In New York in the summer it is a million degrees and the humidity - is a million percent. -> And in LA it's 72. - -> In New York there are a million interesting people. -> And in LA there are 72. -% -I'm going to Boston to see my doctor. He's a very sick man. - -- Fred Allen -% -I'm going to give my psychoanalyst one more year, then I'm going to Lourdes. - -- Woody Allen -% -I'm going to live forever, or die trying! - -- Spider Robinson -% -I'm going to raise an issue and stick it in your ear. - -- John Foreman -% -I'm going to Vietnam at the request of the White House. President Johnson -says a war isn't really a war without my jokes. - -- Bob Hope -% -I'm hungry, time to eat lunch. -% -I'm in Pittsburgh. Why am I here? - -- Harold Urey, Nobel Laureate -% -I'm just as sad as sad can be! - I've missed your special date. -Please say that you're not mad at me - My tax return is late. - -- Modern Lines for Modern Greeting Cards -% -I'm living so far beyond my income that we may almost be said to be -living apart. - -- e. e. cummings -% -I'm N-ary the tree, I am, -N-ary the tree, I am, I am. -I'm getting traversed by the parser next door, -She's traversed me seven times before. -And ev'ry time it was an N-ary (N-ary!) -Never wouldn't ever do a binary. (No sir!) -I'm 'er eighth tree that was N-ary. -N-ary the tree I am, I am, -N-ary the tree I am. - -- Stolen from Paul Revere and the Raiders -% -I'm not a lovable man. - -- Richard M. Nixon -% -I'm not a real movie star -- I've still got the same wife I started out -with twenty-eight years ago. - -- Will Rogers -% -I'm not denyin' the women are foolish: God Almighty made 'em to -match the men. - -- George Eliot -% -I'm not even going to *bother* comparing C to BASIC or FORTRAN. - -- L. Zolman, creator of BDS C -% -I'm not laughing with you, I'm laughing at you. -% -I'm not offering myself as an example; -every life evolves by its own laws. -% -I'm not prejudiced, I hate everyone equally. -% -I'm not proud. -% -I'm not stupid, I'm not expendable, and I'M NOT GOING! -% -I'm not sure I've even got the brains to be President. - -- Barry Goldwater, in 1964 -% -I'm not tense, just terribly, terribly alert! -% -I'm not the person your mother warned you about... her imagination isn't -that good. - -- Amy Gorin -% -I'm not under the alkafluence of inkahol -that some thinkle peep I am. -It's just the drunker I sit here the longer I get. -% -I'm often asked the question, "Do you think there is extraterrestrial intelli- -gence?" I give the standard arguments -- there are a lot of places out there, -and use the word *billions*, and so on. And then I say it would be astonishing -to me if there weren't extraterrestrial intelligence, but of course there is as -yet no compelling evidence for it. And then I'm asked, "Yeah, but what do you -really think?" I say, "I just told you what I really think." "Yeah, but -what's your gut feeling?" But I try not to think with my gut. Really, it's -okay to reserve judgment until the evidence is in. - -- Carl Sagan -% -I'm prepared for all emergencies but -totally unprepared for everyday life. -% -I'm proud to be paying taxes in the United States. The only thing is --- I could be just as proud for half the money. - -- Arthur Godfrey -% -I'm really enjoying not talking to you... -Let's not talk again REAL soon... -% -I'm returning this note to you, instead of your paper, because it -(your paper) presently occupies the bottom of my bird cage. - -- English Professor, Providence College -% -I'm so broke I can't even pay attention. -% -I'm so miserable without you, it's almost like you're here. -% -I'm sorry, but after reading this thread, I'm having a hard time -coming up with an explanation for this nonsense which doesn't involve -you being a dumbass. - -- Bill Paul -% -I'm sorry, but my kharma just ran over your dogma. -% -I'm sorry I missed. - -- Squeaky Fromme -% -I'm sorry if the correct way of doing things offends you. -% -I'm still waiting for the advent of the computer science groupie. -% -I'm successful because I'm lucky. -The harder I work, the luckier I get. -% -I'm very good at integral and differential calculus, -I know the scientific names of beings animalculous; -In short, in matters vegetable, animal, and mineral, -I am the very model of a modern Major-General. - -- Gilbert & Sullivan, "The Pirates of Penzance" -% -I'm very old-fashioned. I believe that people should marry for life, -like pigeons and Catholics. - -- Woody Allen -% -I'm willing to sacrifice anything for this cause, even other people's -lives. -% -Imagination is more important than knowledge. - -- Albert Einstein -% -Imagination is the one weapon in the war against reality. - -- Jules de Gaultier -% -Imagine if every Thursday your shoes exploded if you tied them the -usual way. This happens to us all the time with computers, and nobody -thinks of complaining. - -- Jeff Raskin, interviewed in Doctor Dobb's Journal -% -Imagine me going around with a pot belly. -It would mean political ruin. - -- Adolf Hitler -% -Imagine that Cray computer decides to make a personal computer. It has -a 150 MHz processor, 200 megabytes of RAM, 1500 megabytes of disk -storage, a screen resolution of 4096 x 4096 pixels, relies entirely on -voice recognition for input, fits in your shirt pocket and costs $300. -What's the first question that the computer community asks? - -"Is it PC compatible?" -% -Imagine there's no heaven... it's easy if you try. - -- John Lennon, "Imagine" -% -Imagine what we can imagine! - -- Arthur Rubinstein -% -Imbalance of power corrupts and monopoly of power corrupts absolutely. - -- Genji -% -Imbesi's Law with Freeman's Extension: - In order for something to become clean, something else must - become dirty; but you can get everything dirty without getting - anything clean. -% -Imitation is the sincerest form of television. - -- Fred Allen -% -Immanuel doesn't pun, he Kant. -% -Immanuel Kant but Kubla Khan. -% -Immature artists imitate, mature artists steal. - -- Lionel Trilling -% -Immature poets imitate, mature poets steal. - -- T. S. Eliot, "Philip Massinger" -% -Immortality -- a fate worse than death. - -- Edgar A. Shoaff -% -Immutability, Three Rules of: - (1) If a tarpaulin can flap, it will. - (2) If a small boy can get dirty, he will. - (3) If a teenager can go out, he will. -% -Impartial, adj.: - Unable to perceive any promise of personal advantage from - espousing either side of a controversy or adopting either of two - conflicting opinions. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Important letters which contain no errors will develop errors in the -mail. Corresponding errors will show up in the duplicate while the -Boss is reading it. -% -Impossible, adj.: - (1) I wouldn't like it and when it happens I won't approve; - (2) I can't be bothered; - (3) God can't be bothered. -Meaning (3) may perhaps be valid but the others are 101% whaledreck. - -- Chad C. Mulligan, "The Hipcrime Vocab" -% -In 1869 the waffle iron was invented for people who had wrinkled -waffles. -% -In 1880 the French captured Detroit but gave it back ... they couldn't -get parts. -% -In 1914, the first crossword puzzle was printed in a newspaper. The -creator received $4000 down ... and $3000 across. -% -In 1915 pancake make-up was invented but most people still preferred -syrup. -% -In 1967, the Soviet Government minted a beautiful silver ruble with Lenin -in a very familiar pose - arms raised above him, leading the country to -revolution. But, it was clear to everybody, that if you looked at it from -behind, it was clear that Lenin was pointing to 11:00, when the Vodka -shops opened, and was actually saying, "Comrades, forward to the Vodka shops. - -It became fashionable, when one wanted to have a drink, to take out the -ruble and say, "Oh my goodness, Comrades, Lenin tells me we should go. -% -In 1989, the United States, which was displeased with the policies of the -dictator of Panama, invaded that country and placed in power a government -more to its liking. - -In 1990, Iraq, which was displeased with the policies of the dictator of -Kuwait, invaded that country and placed in power a government more to its -liking. -% -In a bottle, the neck is always at the top. -% -In a circuit with a fast-acting fuse, -an IC will blow to protect the fuse. -% -In a consumer society there are inevitably two kinds of slaves: -the prisoners of addiction and the prisoners of envy. -% -In a country where the sole employer is the State, opposition means death -by slow starvation. The old principle: Who does not work shall not eat, -has been replaced by a new one: Who does not obey shall not eat. - -- Leon Trotsky, 1937 -% -In a display of perverse brilliance, Carl the repairman mistakes a room -humidifier for a mid-range computer but manages to tie it into the network -anyway. - -- The 5th Wave -% -In a five year period we can get one superb programming language. -Only we can't control when the five year period will begin. -% -In a gathering of two or more people, when a lighted cigarette is -placed in an ashtray, the smoke will waft into the face of the non-smoker. -% -In a great romance, each person basically plays a part that the -other really likes. - -- Elizabeth Ashley -% -In a hierarchy every employee tends to rise to his level of incompetence ... -in time every post tends to be occupied by an employee who is incompetent -to carry out its duties ... Work is accomplished by those employees who -have not yet reached their level of incompetence. - -- Dr. Laurence J. Peter, "The Peter Principle" -% -In a medium in which a News Piece takes a minute and an "In-Depth" -Piece takes two minutes, the Simple will drive out the Complex. - -- Frank Mankiewicz -% -In a museum in Havana, there are two skulls of Christopher Columbus, -"one when he was a boy and one when he was a man." - -- Mark Twain -% -In a surprise raid last night, federal agent's ransacked a house in search -of a rebel computer hacker. However, they were unable to complete the arrest -because the warrant was made out in the name of Don Provan, while the only -person in the house was named don provan. Proving, once again, that Unix is -superior to Tops10. -% -In a whiskey it's age, in a cigarette it's -taste and in a sports car it's impossible. -% -In Africa some of the native tribes have a custom of beating the ground -with clubs and uttering spine chilling cries. Anthropologists call -this a form of primitive self-expression. In America we call it golf. -% -In America, any boy may become president and I suppose that's just one -of the risks he takes. - -- Adlai E. Stevenson -% -In America today ... we have Woody Allen, whose humor has become so -sophisticated that nobody gets it any more except Mia Farrow. All -those who think Mia Farrow should go back to making movies where the -devil gets her pregnant and Woody Allen should go back to dressing up -as a human sperm, please raise your hands. Thank you. - -- Dave Barry, "Why Humor is Funny" -% -In an age when the fashion is to be in love with yourself, confessing to -be in love with somebody else is an admission of unfaithfulness to one's -beloved. - -- Russell Baker -% -In an orderly world, there's always a place for the disorderly. -% -In an organization, each person rises to the level of his own -incompetency - -- The Peter Principle -% -In any country there must be people who have to die. They are the -sacrifices any nation has to make to achieve law and order. - -- Idi Amin Dada -% -In any formula, constants (especially those obtained from handbooks) -are to be treated as variables. -% -In any problem, if you find yourself doing an infinite amount of work, -the answer may be obtained by inspection. -% -In any world menu, Canada must be considered the vichyssoise of nations -- -it's cold, half-French, and difficult to stir. - -- Stuart Keate -% -In Boston, it is illegal to hold frog-jumping contests in nightclubs. -% -IN BOX: - A catch basin for everything you don't want - to deal with, but are afraid to throw away. -% -In breeding cattle you need one bull for every twenty-five cows, unless -the cows are known sluts. - -- Johnny Carson -% -In Brooklyn, we had such great pennant races, it -made the World Series just something that came later. - -- Walter O'Malley, Dodgers owner -% -In buying horses and taking a wife -shut your eyes tight and commend yourself to God. -% -In California, Bill Honig, the Superintendent of Public Instruction, said he -thought the general public should have a voice in defining what an excellent -teacher should know. "I would not leave the definition of math," Dr. Honig -said, "up to the mathematicians." - -- The New York Times, October 22, 1985 -% -In California they don't throw their garbage away -- they make -it into television shows. - -- Woody Allen, "Annie Hall" -% -In case of atomic attack, all work rules will be temporarily suspended. -% -In case of atomic attack, the federal ruling -against prayer in schools will be temporarily canceled. -% -In case of fire, stand in the hall and shout "Fire!" - -- The Kidner Report -% -In case of fire, yell "FIRE!" -% -In case of injury notify your superior immediately. -He'll kiss it and make it better. -% -In charity there is no excess. - -- Francis Bacon -% -In childhood a woman must be subject to her father; in youth to her -husband; when her husband is dead, to her sons. A woman must never -be free of subjugation. - -- The Hindu Code of Manu -% -In Christianity, a man may have only one wife. -This is called Monotony. -% -In Columbia, Pennsylvania, it is against the law for a pilot to tickle -a female flying student under her chin with a feather duster in order -to get her attention. -% -In computing, the mean time to failure keeps getting shorter. -% -In Corning, Iowa, it's a misdemeanor for a man to ask his wife to ride -in any motor vehicle. -% -In defeat, unbeatable; in victory, unbearable. - -- Winston Churchill, on General Montgomery -% -In Denver it is unlawful to lend your vacuum cleaner to your next-door -neighbor. -% -In Devon, Connecticut, it is unlawful to walk backwards after sunset. -% -In dwelling, be close to the land. -In meditation, delve deep into the heart. -In dealing with others, be gentle and kind. -In speech, be true. -In work, be competent. -In action, be careful of your timing. - -- Lao Tsu -% -In English, every word can be verbed. Would that it were so in our -programming languages. -% -In every country and every age, the priest has been hostile to Liberty. - -- Thomas Jefferson -% -In every hierarchy the cream rises until it sours. - -- Dr. Laurence J. Peter -% -In every job that must be done, there is an element of fun. -Find the fun and snap! The job's a game. -And every task you undertake, becomes a piece of cake, - a lark, a spree; it's very clear to see. - -- Mary Poppins -% -In every non-trivial program there is at least one bug. -% -In fact, S. M. Simpson, eventually devised an efficient 24-point Fourier -transform, which was a precursor to the Cooley-Tukey fast Fourier transform -in 1965. The FFT made all of Simpson's efficient autocorrelation and -spectrum programs instantly obsolete, on which he had worked half a lifetime. - -- Proc. IEEE, Sept. 1982, p.900 -% -In fiction the recourse of the powerless is murder; -in life the recourse of the powerless is petty theft. -% -In Germany they first came for the Communists and I didn't speak up because -I wasn't a Communist. Then they came for the Jews, and I didn't speak up -because I wasn't a Jew. Then they came for the trade unionists, and I -didn't speak up because I wasn't a trade unionist. Then they came for the -Catholics, and I didn't speak up because I was a Protestant. Then they came -for me -- and by that time no one was left to speak up. - -- Pastor Martin Niemoller -% -In God we trust; all else we walk through. -% -In good speaking, should not the mind of the speaker -know the truth of the matter about which he is to speak? - -- Plato -% -In Greene, New York, it is illegal to eat peanuts and walk backwards on -the sidewalks when a concert is on. -% -In her first passion woman loves her lover, -In all the others all she loves is love. - -- George Gordon, Lord Byron, "Don Juan" -% -In high school in Brooklyn -I was the baseball manager, -proud as I could be -I chased baseballs, -gathered thrown bats -handed out the towels Eventually, I bought my own -It was very important work but it was dark blue while -for a small spastic kid, the official ones were green -but I was a team member Nobody ever said anything -When the team got to me about my blue jacket; -their warm-up jackets the guys were my friends -I didn't get one Yet it hurt me all year -Only the regular team to wear that blue jacket -got these jackets, and among all those green ones -surely not a manager Even now, forty years after, - I still recall that jacket - and the memory goes on hurting. - -- Bart Lanier Safford III, "An Obscured Radiance" -% -In Hollywood, all marriages are happy. It's trying to live together -afterwards that causes the problems. - -- Shelley Winters -% -In Hollywood, if you don't have happiness, you send out for it. - -- Rex Reed -% -In India, "cold weather" is merely a conventional phrase and has come into -use through the necessity of having some way to distinguish between weather -which will melt a brass door-knob and weather which will only make it mushy. - -- Mark Twain -% -In Italy, for thirty years under the Borgias, they had warfare, terror, -murder, and bloodshed, but they produced Michelangelo, Leonardo da Vinci -and the Renaissance. In Switzerland, they had brotherly love, they had -five hundred years of democracy and peace -- and what did they produce? -The cuckoo-clock. - -- Orson Welles, "The Third Man" -% -In just seven days, I can make you a man! - -- The Rocky Horror Picture Show - [ (and seven nights...) Ed.] -% -In less than a century, computers will be making substantial -progress on ... the overriding problem of war and peace. - -- James Slagle -% -In Lexington, Kentucky, it's illegal to carry an ice cream cone in your -pocket. -% -In like a dimwit, out like a light. - -- Pogo -% -In love, she who gives her portrait promises the original. - -- Bruton -% -In Lowes Crossroads, Delaware, it is a violation of local law for any -pilot or passenger to carry an ice cream cone in their pocket while -either flying or waiting to board a plane. -% -In marriage, as in war, it is permitted -to take every advantage of the enemy. -% -In Marseilles they make half the toilet soap we consume in America, but -the Marseillaise only have a vague theoretical idea of its use, which they -have obtained from books of travel. - -- Mark Twain -% -In matters of principle, stand like a rock; -in matters of taste, swim with the current. - -- Thomas Jefferson -% -In Mexico we have a word for sushi: bait. - -- Josi Simon -% -In Minnesota they ask why all football fields in Iowa have artificial turf. -It's so the cheerleaders won't graze during the game. -% -In most instances, all an argument -proves is that two people are present. -% -In my end is my beginning. - -- Mary Stuart, Queen of Scots -% -In my experience, if you have to keep the lavatory door shut by extending -your left leg, it's modern architecture. - -- Nancy Banks Smith -% -IN MY OPINION anyone interested in improving himself should not rule out -becoming pure energy. - -- Jack Handey, "The New Mexican" (1988) -% -In Nature there are neither rewards nor -punishments, there are consequences. - -- R. G. Ingersoll -% -In Ohio, if you ignore an orator on Decoration day to such an extent as -to publicly play croquet or pitch horseshoes within one mile of the -speaker's stand, you can be fined $25.00. -% -In olden times sacrifices were made at the altar -- -a practice which is still continued. - -- Helen Rowland -% -In order to dial out, it is necessary to broaden one's dimension. -% -In order to discover who you are, first learn who everybody else is; -you're what's left. -% -In order to get a loan you must first prove you don't need it. -% -In order to live free and happily, you must sacrifice boredom. -It is not always an easy sacrifice. -% -In order to make an apple pie from scratch, you must first create the -universe. - -- Carl Sagan, Cosmos -% -In our civilization, and under our republican form of government, intelligence -is so highly honored that it is rewarded by exemption from the cares of office. - -- Ambrose Bierce, "The Devil's Dictionary" -% -In our system there's no intermediate step between a definitive Supreme -Court decision and violent revolution. - -- Al Gore (New York Magazine, May 29 2006) -% -In Oz, never say "krizzle kroo" to a Woozy. -% -In Pierre Trudeau, Canada has finally produced -a Prime Minister worthy of assassination. - -- John Diefenbaker -% -In Pocataligo, Georgia, it is a violation for a woman over 200 pounds -and attired in shorts to pilot or ride in an airplane. -% -In Pocatello, Idaho, a law passed in 1912 provided that "The carrying -of concealed weapons is forbidden, unless same are exhibited to public -view." -% -In practice, failures in system development, like unemployment in Russia, -happens a lot despite official propaganda to the contrary. - -- Paul Licker -% -In real love you want the other person's good. In romantic love you -want the other person. - -- Margaret Anderson -% -In reply to a message by Scott Long: - -> Note: this amounts to life support for floppies. The end IS coming. - -Say it ain't so! If you establish a dangerous trend like this in -your support for floppy booting, the next thing you know, some -computer manufacturer will start shipping machines without ANY FLOPPY -DRIVE AT ALL, leading to the infocalypse, the four horsemen pouring -their vials upon the earth, the birth of the anti-christ (or PERL 6, -whichever comes first), dogs and cats living together, etc. - -It's the end of days, I tell you! The end! Can the FreeBSD/NetBSD -merger be that far off? - -- Jordan Hubbard (31 January 2006) -% -In Riemann, Hilbert or in Banach space -Let superscripts and subscripts go their ways. -Our asymptotes no longer out of phase, -We shall encounter, counting, face to face. - -- Stanislaw Lem, "Cyberiad" -% -In San Francisco, Halloween is redundant. - -- Will Durst -% -In science it often happens that scientists say, "You know that's a really -good argument; my position is mistaken," and then they actually change -their minds and you never hear that old view from them again. They really -do it. It doesn't happen as often as it should, because scientists are -human and change is sometimes painful. But it happens every day. I cannot -recall the last time something like that happened in politics or religion. - -- Carl Sagan, 1987 CSICOP keynote address -% -In Seattle, Washington, it is illegal to carry a concealed weapon that -is over six feet in length. -% -In seeking the unattainable, simplicity only gets in the way. - -- Epigrams in Programming, ACM SIGPLAN Sept. 1982 -% -In short, _N is Richardian if, and only if, _N is not Richardian. -% -In specifications, Murphy's Law supersedes Ohm's. -% -In spite of everything, I still believe that people are good at heart. - -- Anne Frank -% -In success there's a tendency to keep on doing what you were doing. - -- Alan Kay -% -In Tennessee, it is illegal to shoot any game other than whales from a -moving automobile. -% -[In the 60's] there was madness in any direction, at any hour ... You -could strike sparks anywhere. There was a fantastic universal sense -that whatever we were doing was `right', that we were winning ... - -And that, I think, was the handle -- the sense of inevitable victory -over the forces of Old and Evil. Not in any mean or military sense; we -didn't need that. Our energy would simply `prevail'. There was no -point in fighting -- on our side or theirs. We had all the momentum; -we were riding the crest of a high and beautiful wave ... - -So now, less than five years later, you can go up on a steep hill in -Las Vegas and look West, and with the right kind of eyes you can almost -_s_e_e the high-water mark -- the place where the wave finally broke and -rolled back. - -- Hunter S. Thompson, "Fear and Loathing in Las Vegas" -% -"In the age of the internet attaching a famous name to your personal -opinion to give more weight to it is a very valid strategy." - -- Benjamin Franklin -% -In the beginning there was nothing. And the Lord said "Let There Be Light!" -And still there was nothing, but at least now you could see it. -% -In the beginning was the word. -But by the time the second word was added to it, -there was trouble. -For with it came syntax ... - -- John Simon -% -In the course of reading Hadamard's "The Psychology of Invention in the -Mathematical Field", I have come across evidence supporting a fact -which we coffee achievers have long appreciated: no really creative, -intelligent thought is possible without a good cup of coffee. On page -14, Hadamard is discussing Poincare's theory of fuchsian groups and -fuchsian functions, which he describes as "... one of his greatest -discoveries, the first which consecrated his glory ..." Hadamard refers -to Poincare having had a "... sleepless night which initiated all that -memorable work ..." and gives the following, very revealing quote: - - "One evening, contrary to my custom, I drank black coffee and - could not sleep. Ideas rose in crowds; I felt them collide - until pairs interlocked, so to speak, making a stable - combination." - -Too bad drinking black coffee was contrary to his custom. Maybe he -could really have amounted to something as a coffee achiever. -% -In the days of old, -When Knights were bold, - And women were too cautious; -Oh, those gallant days, -When women were women, - And men were really obnoxious. -% -In the dimestores and bus stations -People talk of situations -Read books repeat quotations -Draw conclusions on the wall. - -- Bob Dylan -% -In the early morning queue, -With a listing in my hand. -With a worry in my heart, There on terminal number 9, -Waitin' here in CERAS-land. Pascal run all set to go. -I'm a long way from sleep, But I'm waitin' in the queue, -How I miss a good meal so. With this code that ever grows. -In the early mornin' queue, Now the lobby chairs are soft, -With no place to go. But that can't make the queue move fast. - Hey, there it goes my friend, - I've moved up one at last. - -- Ernest Adams, "Early Morning Queue", to "Early - Morning Rain" by G. Lightfoot -% -In the eyes of my dog, I'm a man. - -- Martin Mull -% -In the first place, God made idiots; -this was for practice; then he made school boards. - -- Mark Twain -% -In the force if Yoda's so strong, construct a sentence with words in -the proper order then why can't he? -% -In the future, there will be fewer but better Russians. - -- Joseph Stalin -% -In the future, you're going to get computers as prizes in breakfast cereals. -You'll throw them out because your house will be littered with them. -% -In the Halls of Justice the only justice is in the halls. - -- Lenny Bruce -% -In the highest society, as well as in the lowest, -woman is merely an instrument of pleasure. - -- Tolstoy -% -In the land of the dark the Ship of the -Sun is driven by the Grateful Dead. - -- Egyptian Book of the Dead -% -In the long run, every program becomes rococo, and then rubble. - -- Alan J. Perlis -% -In the long run we are all dead. - -- John Maynard Keynes -% -In the middle of a wide field is a pot of gold. 100 feet to the north stands -a smart manager. 100 feet to the south stands a dumb manager. 100 feet to -the east is the Easter Bunny, and 100 feet to the west is Santa Claus. - -Q: Who gets to the pot of gold first? -A: The dumb manager. All the rest are myths. -% -In the midst of one of the wildest parties he'd ever been to, the young man -noticed a very prim and pretty girl sitting quietly apart from the rest of -the revelers. Approaching her, he introduced himself and, after some quiet -conversation, said, "I'm afraid you and I don't really fit in with this -jaded group. Why don't I take you home?"" - "Fine," said the girl, smiling up at him demurely. "Where do you -live?" -% -In the misfortune of our friends we find something that is not -displeasing to us. - -- Francois de La Rochefoucauld, "Maxims" -% -In the next world, you're on your own. -% -In the Old West a wagon train is crossing the plains. As night falls the -wagon train forms a circle, and a campfire is lit in the middle. After -everyone has gone to sleep two lone cavalry officers stand watch over the -camp. - After several hours of quiet, they hear war drums starting from -a nearby Indian village they had passed during the day. The drums get -louder and louder. - Finally one soldier turns to the other and says, "I don't like -the sound of those drums." - Suddenly, they hear a cry come from the Indian camp: "IT'S -NOT OUR REGULAR DRUMMER." -% -In the olden days in England, you could be hung for stealing a sheep or a -loaf of bread. However, if a sheep stole a loaf of bread and gave it to -you, you would only be tried for receiving, a crime punishable by forty -lashes with the cat or the dog, whichever was handy. If you stole a dog -and were caught, you were punished with twelve rabbit punches, although it -was hard to find rabbits big enough or strong enough to punch you. - -- Mike Harding, "The Armchair Anarchist's Almanac" -% -In the plot, people came to the land; the land loved them; they worked and -struggled and had lots of children. There was a Frenchman who talked funny -and a greenhorn from England who was a fancy-pants but when it came to the -crunch he was all courage. Those novels would make you retch. - -- Canadian novelist Robertson Davies, on the generic Canadian - novel. -% -In the space of one hundred and seventy-six years the Mississippi has -shortened itself two hundred and forty-two miles. Therefore ... in the Old -Silurian Period the Mississippi River was upward of one million three hundred -thousand miles long ... seven hundred and forty-two years from now the -Mississippi will be only a mile and three-quarters long. ... There is -something fascinating about science. One gets such wholesome returns of -conjecture out of such a trifling investment of fact. - -- Mark Twain -% -In the Spring, I have counted 136 -different kinds of weather inside of 24 hours. - -- Mark Twain, on New England weather -% -In the stairway of life, you'd best take the elevator. -% -In the time of peace and harmony -Be a kind-hearted friend. -In the time of conflict with enemies -Be a falcon of advance and attack. - -- Chinggis (Genghis) Khan -% -In the Top 40, half the songs are secret messages to the teen world to drop -out, turn on, and groove with the chemicals and light shows at discotheques. - -- Art Linkletter -% -In the war of wits, he's unarmed. -% -In theory, there is no difference between theory and practice. -In practice, there is. -% -In these matters the only certainty is that there is nothing certain. - -- Pliny the Elder -% -In this vale -Of toil and sin -Your head grows bald -But not your chin. - -- Burma Shave -% -In this world, nothing is certain but death and taxes. - -- Benjamin Franklin -% -In this world of sin and sorrow there is always something to be -thankful for; as for me, I rejoice that I am not a Republican. - -- H. L. Mencken -% -In this world some people are going to like me and some are not. -So, I may as well be me. Then I know if someone likes me, they like me. -% -In this world there are only two tragedies. One is -not getting what one wants, and the other is getting it. - -- Oscar Wilde -% -In this world, truth can wait; she's used to it. -% -In those days he was wiser than he is now -- he used to frequently take -my advice. - -- Winston Churchill -% -In time, every post tends to be occupied by an -employee who is incompetent to carry out its duties. - -- Dr. Laurence J. Peter -% -In Tulsa, Oklahoma, it is against the law to open a soda bottle without -the supervision of a licensed engineer. -% -In /users3 did Kubla Kahn -A stately pleasure dome decree, -Where /bin, the sacred river ran -Through Test Suites measureless to Man -Down to a sunless C. -% -In war it is not men, but the man who counts. - -- Napoleon -% -In war, truth is the first casualty. - -- U Thant -% -In West Union, Ohio, No married man can go flying without his spouse -along at any time, unless he has been married for more than 12 months. -% -In which level of metalanguage are you now speaking? -% -In wine there is truth (In vino veritas). - -- Pliny -% -In Xanadu did Kubla Khan a stately pleasure dome decree -But only if the NFL to a franchise would agree. -% -In Xanadu did Kubla Khan -A stately pleasure dome decree: -Where Alph, the sacred river, ran -Through caverns measureless to man -Down to a sunless sea. -So twice five miles of fertile ground -With walls and towers were girdled round: -And there were gardens bright with sinuous rills, -Where blossomed many an incense-bearing tree; -And here were forest ancient as the hills, -Enfolding sunny spots of greenery. - -- Samuel T. Coleridge, "Kubla Kahn" -% -In youth, it was a way I had -To do my best to please, -And change, with every passing lad, -To suit his theories. - -But now I know the things I know, -And do the things I do; -And if you do not like me so, -To hell, my love, with you! - -- Dorothy Parker, "Indian Summer" -% -INCENTIVE PROGRAM: - The system of long and short-term rewards that a corporation uses - to motivate its people. Still, despite all the experimentation with - profit sharing, stock options, and the like, the most effective - incentive program to date seems to be "Do a good job and you get to - keep it." -% -Include me out. -% -Increased knowledge will help you now. -Have mate's phone bugged. -% -Incumbent, n.: - Person of liveliest interest to the outcumbents. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Indecision is the true basis for flexibility. -% -Indeed, the first noble truth of Buddhism, usually translated as -`all life is suffering,' is more accurately rendered `life is filled -with a sense of pervasive unsatisfactoriness.' - -- M. D. Epstein -% -INDEX: - Alphabetical list of words of no possible interest where an - alphabetical list of subjects with references ought to be. -% -Indiana is a state dedicated to basketball. Basketball, soybeans, hogs and -basketball. Berkeley, needless to say, is not nearly as athletic. Berkeley -is dedicated to coffee, angst, potholes and coffee. - -- Carolyn Jones -% -Indifference will certainly be the downfall of mankind, but who cares? -% -Individualists unite! -% -Indomitable in retreat; invincible in -advance; insufferable in victory. - -- Winston Churchill, on General Montgomery -% -Infancy, n.: - The period of our lives when, according to Wordsworth, "Heaven lies - about us." The world begins lying about us pretty soon afterward. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Infidel, n.: - In New York, one who does not believe in the Christian religion; - in Constantinople, one who does. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Inform all the troops that communications have completely broken down. -% -Information Center, n.: - A room staffed by professional computer people whose job it is -to tell you why you cannot have the information you require. -% -Information is the inverse of entropy. -% -Information Processing: - What you call data processing when people are so disgusted with - it they won't let it be discussed in their presence. -% -Inglish Spocken Hier: some mangled translations - - Sign on a cabin door of a Soviet Black Sea cruise liner: - Helpsavering apparata in emergings behold many whistles! - Associate the stringing apparata about the bosums and meet - behind, flee then to the indifferent lifesaveringshippen - obedicing the instructs of the vessel. - - On the door in a Belgrade hotel: - Let us know about any unficiency as well as leaking on - the service. Our utmost will improve it. - - -- Colin Bowles -% -Inglish Spocken Hier: some mangled translations - - Sign on a cathedral in Spain: - It is forbidden to enter a woman, even a foreigner if - dressed as a man. - - Above the entrance to a Cairo bar: - Unaccompanied ladies not admitted unless with husband - or similar. - - On a Bucharest elevator: - - The lift is being fixed for the next days. - During that time we regret that you will be unbearable. - - -- Colin Bowles -% -Inglish Spocken Hier: some mangled translations - - Various signs in Poland: - - Right turn toward immediate outside. - - Go soothingly in the snow, as there lurk the ski demons. - - Five o'clock tea at all hours. - - In a men's washroom in Sidney: - - Shake excess water from hands, push button to start, - rub hands rapidly under air outlet and wipe hands - on front of shirt. - - -- Colin Bowles, San Francisco Chronicle -% -Ingrate, n.: - A man who bites the hand that feeds him, - and then complains of indigestion. -% -Injustice anywhere is a threat to justice everywhere. - -- Martin Luther King, Jr. -% -Ink, n.: - A villainous compound of tannogallate of iron, gum-arabic, and - water, chiefly used to facilitate the infection of idiocy and - promote intellectual crime. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Innocence ends when one is stripped of the delusion that one -likes oneself. - -- Joan Didion, "On Self Respect" -% -INNOVATE: - Annoy people. -% -Innovation is hard to schedule. - -- Dan Fylstra -% -INNUENDO: - Italian enema. -% -Insanity is considered a ground for divorce, though by the very same -token it is the shortest detour to marriage. - -- Wilson Mizner -% -Insanity is hereditary. You get it from your kids. -% -Insanity is the final defense. It's hard to get a refund when -the salesman is sniffing your crotch and baying at the moon. -% -INSECURITY: - Finding out that you've mispronounced for years one of your - favorite words. - - Realizing halfway through a joke that you're telling it to - the person who told it to you. -% -Insomnia isn't anything to lose sleep over. -% -Inspector: "Mrs. Freem, was this your husband's first - hunting accident?" -Mrs. Freem: "His first fatal one, yes." - -- Woody Allen -% -Inspiration without perspiration is usually sterile. -% -Instead of giving money to found colleges to promote learning, why don't -they pass a constitutional amendment prohibiting anybody from learning -anything? If it works as good as the Prohibition one did, why, in five -years we would have the smartest race of people on earth. - -- The Best of Will Rogers -% -Instead of loving your enemies, treat your friends a little better. - -- Edgar W. Howe -% -Instead of thinking of spam as a disease that might be eliminated, -it is more useful to think of it like crime, war and cockroaches. -It is not realistic to expect to eliminate any of these, no matter -how much anyone might wish otherwise. Therefore the best we can -hope to accomplish is to bring spam under reasonable control... - -- Dave Crocker -% -Integrity has no need for rules. -% -Intel CPUs are not defective, they just act that way. - -- Henry Spencer -% -Intellect annuls Fate. -So far as a man thinks, he is free. - -- Ralph Waldo Emerson -% -Interchangeable parts won't. -% -INTEREST: - What borrowers pay, lenders receive, stockholders own, and - burned out employees must feign. -% -Interesting poll results reported in today's New York Post: people on the -street in midtown Manhattan were asked whether they approved of the US -invasion of Grenada. Fifty-three percent said yes; 39 percent said no; -and 8 percent said "Gimme a quarter?" - -- David Letterman -% -Interfere? Of course we should interfere! Always do what you're -best at, that's what I say. - -- "Doctor Who" -% -Interpreter, n.: - One who enables two persons of different languages to understand - each other by repeating to each what it would have been to the - interpreter's advantage for the other to have said. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Intolerance is the last defense of the insecure. -% -INTOXICATED: - When you feel sophisticated without being able to pronounce it. -% -Introducing, the 1010, a one-bit processor. - -INSTRUCTION SET - Code Mnemonic What - 0 NOP No Operation - 1 JMP Jump (address specified by next 2 bits) - -Now Available for only 12 1/2 cents! -% -Invest in physics -- own a piece of Dirac! -% -Involvement with people is always a very delicate thing -- -it requires real maturity to become involved and not get all messed up. - -- Bernard Cooke -% -I/O, I/O, -It's off to disk I go, -A bit or byte to read or write, -I/O, I/O, I/O... -% -IOT trap -- core dumped -% -IOT trap -- mos dumped -% -Iowa State -- the high school after high school! - -- Crow T. Robot -% -Iowans ask why Minnesotans don't drink more Kool-Aid. That's because -they can't figure out how to get two quarts of water into one of those -little paper envelopes. -% -Iron Law of Distribution: - Them that has, gets. -% -IRONY: - A windy day, when, just as a beautiful girl with - a short skirt approaches, dust blows in your eyes. -% -Irrationality is the square root of all evil. - -- Douglas Hofstadter -% -Is a computer language with goto's totally Wirth-less? -% -Is a person who blows up banks an econoclast? -% -Is a wedding successful if it comes off without a hitch? -% -Is death legally binding? -% -Is it possible that software is not like anything else, that it is -meant to be discarded: that the whole point is to always see it as -a soap bubble? -% -Is it weird in here, or is it just me? - -- Steven Wright -% -Is knowledge knowable? If not, how do we know that? -% -Is not marriage an open question, when it is alleged, from the beginning -of the world, that such as are in the institution wish to get out, -and such as are out wish to get in? - -- Ralph Waldo Emerson -% -Is sex dirty? Only if it's done right. - -- Woody Allen, "All You Ever Wanted To Know About Sex" -% -Is that a pistol in your pocket or are you just glad to see me? - -- Mae West -% -Is that really YOU that is reading this? -% -Is there life before breakfast? -% -Is this really happening? -% -Is your job running? You'd better go catch it! -% -Isn't air travel wonderful? -Breakfast in London, dinner in New York, luggage in Brazil. -% -Isn't it conceivable to you that an intelligent -person could harbor two opposing ideas in his mind? - -- Adlai E. Stevenson, to reporters -% -Isn't it interesting that the same people who laugh at science fiction -listen to weather forecasts and economists? - -- Kelvin Throop III -% -Isn't it ironic that many men spend a great part of their lives -avoiding marriage while single-mindedly pursuing those things that -would make them better prospects? -% -Isn't it nice that people who prefer Los Angeles to San Francisco live -there? - -- Herb Caen -% -Isn't it strange that the same people that -laugh at gypsy fortune tellers take economists seriously? -% -ISO applications: - A solution in search of a problem! -% -Issawi's Laws of Progress: - The Course of Progress: - Most things get steadily worse. - The Path of Progress: - A shortcut is the longest distance between two points. -% -It appears that after his death, Albert Einstein found himself working -as the doorkeeper at the Pearly Gates. One slow day, he found that he -had time to chat with the new entrants. To the first one he asked, -"What's your IQ?" The new arrival replied, "190". They discussed -Einstein's theory of relativity for hours. When the second new arrival -came, Einstein once again inquired as to the newcomer's IQ. The answer -this time came "120". To which Einstein replied, "Tell me, how did the -Cubs do this year?" and they proceeded to talk for half an hour or so. -To the final arrival, Einstein once again posed the question, "What's -your IQ?". Upon receiving the answer "70", Einstein smiled and asked, -"Got a minute to tell me about VMS 4.0?" -% -It appears that PL/I (and its dialects) is, or will be, the -most widely used higher level language for systems programming. - -- J. Sammet -% -It cannot be seen, cannot be felt, -Cannot be heard, cannot be smelt. -It lies behind starts and under hills, -And empty holes it fills. -It comes first and follows after, -Ends life, kills laughter. -% -"It could be that Walter's horse has wings" does not imply that there is -any such animal as Walter's horse, only that there could be; but "Walter's -horse is a thing which could have wings" does imply Walter's horse's -existence. But the conjunction "Walter's horse exists, and it could be -that Walter's horse has wings" still does not imply "Walter's horse is a -thing that could have wings", for perhaps it can only be that Walter's -horse has wings by Walter having a different horse. Nor does "Walter's -horse is a thing which could have wings" conversely imply "It could be that -Walter's horse has wings"; for it might be that Walter's horse could only -have wings by not being Walter's horse. - -I would deny, though, that the formula [Necessarily if some x has property P -then some x has property P] expresses a logical law, since P(x) could stand -for, let us say "x is a better logician than I am", and the statement "It is -necessary that if someone is a better logician than I am then someone is a -better logician than I am" is false because there need not have been any me. - -- A. N. Prior, "Time and Modality" -% -It destroys one's nerves to be amiable every day to the same human being. - -- Benjamin Disraeli -% -It did not occur to me that my being with two men continuously would -interest anyone or arouse anyone's misgivings. I asked for an invitation -for Heinrich too, as often as it seemed possible, when Paulus and I were -invited to a social gathering. I felt the set of rules others lived by -was irrelevant. My childhood attitude -- every attempt to adjust is -hopeless and you might just as well follow your own attitudes -- must have -carried me. - -- Hannah Tillich, "From Time to Time" -% -It does not do to leave a live dragon out of your calculations. -% -It does not matter if you fall down as long as you -pick up something from the floor while you get up. -% -It doesn't matter what you do, it only matters what you say you've -done and what you're going to do. -% -It doesn't matter whether you win or lose -- until you lose. -% -It doesn't much signify whom one marries, for one is sure to find out -next morning it was someone else. - -- Rogers -% -It follows that any commander in chief who undertakes to carry out a plan -which he considers defective is at fault; he must put forth his reasons, -insist of the plan being changed, and finally tender his resignation rather -than be the instrument of his army's downfall. - -- Napoleon, "Military Maxims and Thought" -% -It gets late early out there. - -- Yogi Berra -% -It got to the point where I had to get a haircut -or both feet firmly planted in the air. -% -It hangs down from the chandelier -Nobody knows quite what it does -Its color is odd and its shape is weird -It emits a high-sounding buzz - -It grows a couple of feet each day -and wriggles with sort of a twitch -Nobody bugs it 'cause it comes from -a visiting uncle who's rich! - -- To "It Came Upon A Midnight Clear" -% -It happened long ago -In the new magic land -The Indians and the buffalo -Existed hand in hand -The Indians needed food -They need skins for a roof -The only took what they needed -And the buffalo ran loose -But then came the white man -With his thick and empty head -He couldn't see past his billfold -He wanted all the buffalo dead -It was sad, oh so sad. - -- Ted Nugent, "The Great White Buffalo" -% -It happened that a fire broke out backstage in a theater. The clown -came out to inform the public. They thought it was just a jest and -applauded. He repeated his warning, they shouted even louder. So I -think the world will come to an end amid general applause from all the -wits, who believe that it is a joke. - -- S. A. Kierkegaard (1813-1855) -% -It has been justly observed by sages of all lands that although a man may be -most happily married and continue in that state with the utmost contentment, -it does not necessarily follow that he has therefore been struck stone-blind. - -- H. Warner Munn -% -It has been observed that one's nose is never so happy as when it is -thrust into the affairs of another, from which some physiologists have -drawn the inference that the nose is devoid of the sense of smell. - -- Ambrose Bierce, "The Devil's Dictionary" -% -It has been said [by Anatole France], "it is not by amusing oneself -that one learns," and, in reply: "it is *_o_n_l_y* by amusing oneself that -one can learn." - -- Edward Kasner and James R. Newman -% -It has been said that man is a rational animal. All my life I have -been searching for evidence which could support this. - -- Bertrand Russell -% -It has been said that Public Relations is the art of winning friends -and getting people under the influence. - -- Jeremy Tunstall -% -It has just been discovered that research causes cancer in rats. -% -It has long been an article of our folklore that too much knowledge or skill, -or especially consummate expertise, is a bad thing. It dehumanizes those who -achieve it, and makes difficult their commerce with just plain folks, in whom -good old common sense has not been obliterated by mere book learning or fancy -notions. This popular delusion flourishes now more than ever, for we are all -infected with it in the schools, where educationists have elevated it from -folklore to Article of Belief. It enhances their self-esteem and lightens -their labors by providing theoretical justification for deciding that -appreciation, or even simple awareness, is more to be prized than knowledge, -and relating (to self and others), more than skill, in which minimum -competence will be quite enough. - -- The Underground Grammarian -% -It has long been an axiom of mine that the -little things are infinitely the most important. - -- Sir Arthur Conan Doyle, "A Case of Identity" -% -It has long been known that birds will occasionally build nests in the -manes of horses. The only known solution to this problem is to sprinkle -baker's yeast in the mane, for, as we all know, yeast is yeast and nest -is nest, and never the mane shall tweet. -% -It has long been known that one horse can run faster -than another -- but which one? Differences are crucial. - -- Lazarus Long -% -It has long been noticed that juries are pitiless for robbery and full of -indulgence for infanticide. A question of interest, my dear Sir! The jury -is afraid of being robbed and has passed the age when it could be a victim -of infanticide. - -- Edmond About -% -It is a hard matter, my fellow citizens, -to argue with the belly, since it has no ears. - -- Marcus Porcius Cato -% -It is a lesson which all history teaches -wise men, to put trust in ideas, and not in circumstances. - -- Ralph Waldo Emerson -% -It is a poor judge who cannot award a prize. -% -It is a profitable thing, if one is wise, to seem foolish. - -- Aeschylus -% -It is a sobering thought that when Mozart was -my age, he had been dead for 2 years. - -- Tom Lehrer -% -It is a very humbling experience to make a multimillion-dollar mistake, but -it is also very memorable. I vividly recall the night we decided how to -organize the actual writing of external specifications for OS/360. The -manager of architecture, the manager of control program implementation, and -I were threshing out the plan, schedule, and division of responsibilities. - The architecture manager had 10 good men. He asserted that they -could write the specifications and do it right. It would take ten months, -three more than the schedule allowed. - The control program manager had 150 men. He asserted that they -could prepare the specifications, with the architecture team coordinating; -it would be well-done and practical, and he could do it on schedule. -Furthermore, if the architecture team did it, his 150 men would sit twiddling -their thumbs for ten months. - To this the architecture manager responded that if I gave the control -program team the responsibility, the result would not in fact be on time, -but would also be three months late, and of much lower quality. I did, and -it was. He was right on both counts. Moreover, the lack of conceptual -integrity made the system far more costly to build and change, and I would -estimate that it added a year to debugging time. - -- Frederick Brooks, Jr., "The Mythical Man-Month" -% -It is a wise father that knows his own child. - -- William Shakespeare, "The Merchant of Venice" -% -It is against the grain of modern education to teach children to program. -What fun is there in making plans, acquiring discipline in organizing -thoughts, devoting attention to detail, and learning to be self-critical? - -- Alan J. Perlis -% -It is against the law for a monster to enter the corporate limits of -Urbana, Illinois. -% -It is all right to hold a conversation, -but you should let go of it now and then. - -- Richard Armour -% -It is always the best policy to tell the truth, unless, of course, -you are an exceptionally good liar. - -- Jerome K. Jerome -% -It is amazing how complete is the delusion that beauty is goodness. -% -It is amusing that a virtue is made of the vice of chastity; and it's a -pretty odd sort of chastity at that, which leads men straight into the -sin of Onan, and girls to the waning of their color. - -- Voltaire -% -It is an important and popular fact that things are not always what -they seem. For instance, on the planet Earth, man had always assumed -that he was more intelligent than dolphins because he had achieved so -much -- the wheel, New York wars and so on -- whilst all the dolphins -had ever done was muck about in the water having a good time. But -conversely, the dolphins had always believed that they were far more -intelligent than man -- for precisely the same reasons. - -Curiously enough, the dolphins had long known of the impending -destruction of the of the planet Earth and had made many attempts to -alert mankind to the danger; but most of their communications were -misinterpreted ... - -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -It is annoying to be honest to no purpose. - -- Publius Ovidius Naso (Ovid) -% -It is bad luck to be superstitious. - -- Andrew W. Mathis -% -[It is] best to confuse only one issue at a time. - -- K&R -% -It is better for civilization to be going down the drain than to be -coming up it. - -- Henry Allen -% -It is better never to have been born. But who among us has such luck? -One in a million, perhaps. -% -It is better to be bow-legged than no-legged. -% -It is better to be on penicillin, than never to have loved at all. -% -It is better to burn out than it is to rust. -% -It is better to die on your feet than to live on your knees. -% -It is better to give than to lend, and it costs about the same. -% -It is better to have loved a short man than never to have loved a tall. -% -It is better to have loved and lost -- much better. -% -It is better to have loved and lost than just to have lost. -% -It is better to kiss an avocado than to get in a fight with an aardvark. -% -It is better to live rich than to die rich. - -- Samuel Johnson -% -It is better to remain childless than to father an orphan. -% -It is better to travel hopefully than to fly Continental. -% -It is better to wear chains than to believe you are free, -and weight yourself down with invisible chains. -% -It is better to wear out than to rust out. -% -It is by the fortune of God that, in this country, we have three benefits: -freedom of speech, freedom of thought, and the wisdom never to use either. - -- Mark Twain -% -It is common sense to take a method and try it. If it fails, -admit it frankly and try another. But above all, try something. - -- Franklin D. Roosevelt -% -It is contrary to reasoning to say that there -is a vacuum or space in which there is absolutely nothing. - -- Rene Descartes -% -It is convenient that there be gods, and, -as it is convenient, let us believe there are. - -- Publius Ovidius Naso (Ovid) -% -It is dangerous for a national candidate to say things that people might -remember. - -- Eugene McCarthy -% -It is difficult to get a man to understand something when his salary -depends upon his not understanding it. - -- Upton Sinclair -% -It is difficult to legislate morality in the absence of moral legislators. -% -It is difficult to produce a television documentary that is both -incisive and probing when every twelve minutes one is interrupted by -twelve dancing rabbits singing about toilet paper. - -- Rod Serling -% -It is difficult to soar with the eagles when you work with turkeys. -% -It is easier for a camel to pass through the eye of a needle if it is -lightly greased. - -- Kehlog Albran, "The Profit" -% -It is easier to be a "humanitarian" than to render your own country its -proper due; it is easier to be a "patriot" than to make your community a -better place to live in; it is easier to be a "civic leader" than to treat -your own family with loving understanding; for the smaller the focus of -attention, the harder the task. - -- Sydney J. Harris -% -It is easier to change the specification to fit the program than vice versa. -% -It is easier to fight for one's principles than to live up to them. - -- Alfred Adler -% -It is easier to make a saint out of a libertine than out of a prig. - -- George Santayana -% -It is easier to resist at the beginning than at the end. - -- Leonardo da Vinci -% -It is easier to run down a hill than up one. -% -It is easier to write an incorrect program than understand a correct one. -% -It is easy when we are in prosperity to give advice to the afflicted. - -- Aeschylus -% -It is enough to make one sympathize with a tyrant for the determination -of his courtiers to deceive him for their own personal ends... - -- Russell Baker and Charles Peters -% -It is equally bad when one speeds on the guest unwilling to go, and when he -holds back one who is hastening. Rather one should befriend the guest who -is there, but speed him when he wishes. - -- Homer, "The Odyssey" - - [Quoted in "VMS Internals and Data Structures", V4.4, when - referring to scheduling.] -% -It is exactly because a man cannot do a -thing that he is a proper judge of it. - -- Oscar Wilde -% -It is explained that all relationships require a little give and take. This -is untrue. Any partnership demands that we give and give and give and at the -last, as we flop into our graves exhausted, we are told that we didn't give -enough. - -- Quentin Crisp, "How to Become a Virgin" -% -It is far better to be deceived than to be undeceived by those we love. -% -It is far more impressive when others discover your good qualities -without your help. - -- Miss Manners -% -It is Fortune, not Wisdom, that rules man's life. -% -It is fruitless: - to become lachrymose over precipitately departed lactate fluid. - - to attempt to indoctrinate a superannuated canine with - innovative maneuvers. -% -It is generally agreed that "Hello" is an appropriate greeting because -if you entered a room and said "Goodbye," it could confuse a lot of people. - -- Dolph Sharp, "I'm O.K., You're Not So Hot" -% -It is hard to predict, in particular about the future. - -- Robert Storm Petersen -% -It is idle to attempt to talk a young woman out of her passion: -love does not lie in the ear. - -- Walpole -% -It is illegal to drive more than two thousand sheep down Hollywood -Boulevard at one time. -% -It is illegal to say "Oh, Boy" in Jonesboro, Georgia. -% -It is imperative when flying coach that you restrain any tendency toward -the vividly imaginative. For although it may momentarily appear to be the -case, it is not at all likely that the cabin is entirely inhabited by -crying babies smoking inexpensive domestic cigars. - -- Fran Lebowitz, "Social Studies" -% -It is impossible for an optimist to be pleasantly surprised. -% -It is impossible to defend perfectly -against the attack of those who want to die. -% -It is impossible to enjoy idling thoroughly -unless one has plenty of work to do. - -- Jerome Klapka Jerome -% -It is impossible to experience one's death objectively and still carry -a tune. - -- Woody Allen -% -It is impossible to make anything -foolproof because fools are so ingenious. -% -It is impossible to travel faster than light, and -certainly not desirable, as one's hat keeps blowing off. - -- Woody Allen -% -IT IS IN PROCESS: - So wrapped up in red tape that the situation is almost hopeless. -% -It is indeed desirable to be well descended, -but the glory belongs to our ancestors. - -- Plutarch -% -It is like saying that for the cause of peace, -God and the Devil will have a high-level meeting. - -- Rev. Carl McIntire, on Nixon's China trip -% -It is most dangerous nowadays for a husband to pay any attention to his -wife in public. It always makes people think that he beats her when -they're alone. The world has grown so suspicious of anything that looks -like a happy married life. - -- Oscar Wilde -% -It is Mr. Mellon's credo that $200,000,000 can do no wrong. Our -offense consists in doubting it. - -- Justice Robert H. Jackson -% -It is much easier to be critical than to be correct. - -- Benjamin Disraeli -% -It is much easier to suggest solutions -when you know nothing about the problem. -% -It is much harder to find a job than to keep one. -% -It is necessary for the welfare of society that genius should be -privileged to utter sedition, to blaspheme, to outrage good taste, to -corrupt the youthful mind, and generally to scandalize one's uncles. - -- George Bernard Shaw -% -It is no wonder that people are so horrible when they start life as children. - -- Kingsley Amis -% -It is not a good omen when goldfish commit suicide. -% -It is not doing the thing we like to do, but liking the thing we have to do, -that makes life blessed. - -- Johann Wolfgang von Goethe -% -It is not enough that I should succeed. Others must fail. - -- Ray Kroc, founder of McDonald's - [Also attributed to David Merrick. Ed.] - -It is not enough to succeed. Others must fail. - -- Gore Vidal - [Great minds think alike? Ed.] -% -It is not enough to have a good mind. -The main thing is to use it well. - -- Rene Descartes -% -It is not enough to have great qualities, -we should also have the management of them. - -- Francois de La Rochefoucauld -% -It is not every question that deserves an answer. - -- Publilius Syrus -% -It is not for me to attempt to fathom the -inscrutable workings of Providence. - -- The Earl of Birkenhead -% -It is not good for a man to be without knowledge, -and he who makes haste with his feet misses his way. - -- Proverbs 19:2 -% -It is not necessary to inquire whether a woman would like something for -dessert. The answer is yes, she would like something for dessert, but -she would like you to order it so she can pick at it with your fork. She -does not want you to call attention to this by saying, "If you wanted a -dessert, why didn't you order one?" You must understand, she has the -dessert she wants. The dessert she wants is contained within yours. - -- Merrill Marcoe, "An Insider's Guide to the American Woman" -% -It is not that polar co-ordinates are complicated, it is simply -that Cartesian co-ordinates are simpler than they have a right to be. - -- Kleppner & Kolenhow, "An Introduction to Mechanics" -% -It is not the critic who counts, or how the strong man stumbled, or whether -the doer of deeds could have done them better. The credit belongs to the -man who is actually in the arena, whose face is marred by dust and sweat and -blood, who strives valiantly, who errs and comes short again and again; who -knows the great enthusiasm, the great devotion, and who spends himself in a -worthy cause, and if he fails, at least fails while daring greatly, so that -he'll never be with those cold and timid souls who never know either victory -or defeat. - -- Teddy Roosevelt -% -It is November first 1940; in the famous sound stage of THE WIZARD OF OZ on -the MGM lot, a little man is lying face-up on the yellow brick road. His -wide eyes stare upward into the blinding stage lights. He is wearing a -kind of comic soldier's uniform with a yellow coat and puffy sleeves and -big fez-like blue and yellow hat with a feather on top. His yellow hair -and beard are the phony straw color of Hollywood. He could pass for some -kind of cute in the typical tinsel-town way if it wasn't for the knife -sticking out of his chest. *Someone had murdered a Munchkin.* - -- Stuart Kaminsky, "Murder on the Yellow Brick Road" -% -It is now 10 p.m. Do you know where Henry Kissinger is? - -- Elizabeth Carpenter -% -It is now pitch dark. If you proceed, you will likely fall into a pit. -% -It is now quite lawful for a Catholic woman to avoid pregnancy by a resort -to mathematics, though she is still forbidden to resort to physics and -chemistry. - -- H. L. Mencken -% -It is often easier to ask for forgiveness than to ask for permission. - -- Grace Murray Hopper -% -It is one thing to praise discipline, and another to submit to it. - -- Cervantes -% -It is only by risking our persons from one hour to another that we live -at all. And often enough our faith beforehand in an uncertified result -is the only thing that makes the result come true. - -- William James -% -It is only people of small moral stature who have to stand on their -dignity. -% -It is only the great men who are truly obscene. If they had not dared -to be obscene, they could never have dared to be great. - -- Havelock Ellis -% -It is only with the heart one can see clearly; -what is essential is invisible to the eye. - -- The Fox, "The Little Prince" -% -It is perfectly permissible for every system call to fail with [ENOTADUCK] -unless the first five bytes of the caller's address space contain the -word "quack". - -- Garrett Wollman -% -It is possible by ingenuity and at the expense of clarity... {to do almost -anything in any language}. However, the fact that it is possible to push -a pea up a mountain with your nose does not mean that this is a sensible -way of getting it there. Each of these techniques of language extension -should be used in its proper place. - -- Christopher Strachey -% -It is possible that blondes also prefer gentlemen. - -- Maimie Van Doren -% -It is practically impossible to teach good programming to students that -have had a prior exposure to BASIC: as potential programmers they are -mentally mutilated beyond hope of regeneration. - -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5 -% -It is ridiculous to call this an industry. This is not. This is rat eat -rat, dog eat dog. I'll kill 'em, and I'm going to kill 'em before they -kill me. You're talking about the American way of survival of the fittest. - -- Ray Kroc, founder of McDonald's -% -It is right that he too should have his little chronicle, his memories, -his reason, and be able to recognize the good in the bad, the bad in the -worst, and so grow gently old all down the unchanging days and die one -day like any other day, only shorter. - -- Samuel Beckett, "Malone Dies" -% -It is said an Eastern monarch once charged his wise men to invent him a -sentence to be ever in view, and which should be true and appropriate -in all times and situations. They presented him the words: "And this, -too, shall pass away." - -- Abraham Lincoln -% -It is said that the lonely eagle flies to the mountain peaks while the -lowly ant crawls the ground, but cannot the soul of the ant soar as -high as the eagle? -% -It is so soon that I am done for, I wonder what I was begun for. - -- Epitaph, Cheltenham Churchyard -% -It is so stupid of modern civilization to have given up believing in the -devil when he is the only explanation of it. - -- Ronald Knox, "Let Dons Delight" -% -It is so very hard to be an on-your-own-take-care-of- -yourself-because-there-is-no-one-else-to-do-it-for-you grown up. -% -It is something to be able to paint a particular picture, or to carve a -statue, and so to make a few objects beautiful; but it is far more glorious -to carve and paint the very atmosphere and medium through which we look, -which morally we can do. To affect the quality of the day, that is the -highest of arts. Every man is tasked to make his life, even in its details, -worthy of the contemplation of his most elevated and critical hour. - -- Henry David Thoreau, "Where I Live" -% -It is sweet to let the mind unbend on occasion. - -- Quintus Horatius Flaccus (Horace) -% -It is Texas law that when two trains meet each other at a railroad -crossing, each shall come to a full stop, and neither shall proceed -until the other has gone. -% -It is the business of little minds to shrink. - -- Carl Sandburg -% -It is the business of the future to be dangerous. - -- Hawkwind -% -It is the nature of extreme self-lovers, as they will -set a house on fire, and it were but to roast their eggs. - -- Francis Bacon -% -It is the quality rather than the quantity that matters. - -- Lucius Annaeus Seneca -% -It is the wisdom of crocodiles, that shed tears when they would devour. - -- Francis Bacon -% -It is the wise bird who builds his nest in a tree. -% -It is through symbols that man consciously or unconsciously -lives, works and has his being. - -- Thomas Carlyle -% -It is true that if your paperboy throws your paper into the bushes for five -straight days it can be explained by Newton's Law of Gravity. But it takes -Murphy's law to explain why it is happening to you. -% -It is up to us to produce better-quality movies. - -- Lloyd Kaufman, - producer of "Stuff Stephanie in the Incinerator" -% -It is very vulgar to talk like a dentist when one isn't a dentist. -It produces a false impression. - -- Oscar Wilde -% -It is when I struggle to be brief that I become obscure. - -- Quintus Horatius Flaccus (Horace) -% -It is wise to keep in mind that neither success nor failure is ever final. - -- Roger Babson -% -It is your concern when your neighbor's wall is on fire. - -- Quintus Horatius Flaccus (Horace) -% -It isn't easy being a Friday kind of person in a Monday kind of world. -% -It isn't easy being green. - -- Kermit the Frog -% -It isn't easy being the parent of a six-year-old. However, it's a pretty -small price to pay for having somebody around the house who understands -computers. -% -It isn't necessary to have relatives in Kansas City in order to be -unhappy. - -- Groucho Marx -% -It isn't whether you win or lose, it's how much money you end up with. - -- Jack T. Shakespeare -% -It just doesn't seem right to go over the river and through the woods -to Grandmother's condo. -% -It looked like something resembling white marble, which was -probably what it was: something resembling white marble. - -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -It looks like blind screaming hedonism won out. -% -It looks like it's up to me to save our skins. -Get into that garbage chute, flyboy! - -- Princess Leia Organa -% -IT MAKES ME MAD when I go to all the trouble of having Marta cook up about -a hundred drumsticks, then the guy at Marineland says, "You can't throw -that chicken to the dolphins. They eat fish." - -Sure they eat fish if that's all you give them! Man, wise up. - -- Jack Handey, "The New Mexican" (1988) -% -It [marriage] happens as with cages: the birds without despair -to get in, and those within despair of getting out. - -- Michel Eyquem de Montaigne -% -It matters not whether you win or lose; what matters is whether *I* win -or lose. - -- Darrin Weinberg -% -It may be bad manners to talk with your mouth full, but it isn't too -good either if you speak when your head is empty. -% -It may be better to be a live jackal than a dead lion, but it is -better still to be a live lion. And usually easier. - -- Lazarus Long -% -It may be that your whole purpose in life -is simply to serve as a warning to others. -% -It may or may not be worthwhile, but it still has to be done. -% -It must be remembered that there is nothing more difficult to plan, more -doubtful of success, nor more dangerous to manage, than the creation of -a new system. For the initiator has the enmity of all who would profit -by the preservation of the old institutions and merely lukewarm defenders -in those who would gain by the new ones. - -- Niccolo Machiavelli, 1513 -% -It must have been some unmarried fool that said "A child can ask questions -that a wise man cannot answer"; because, in any decent house, a brat that -starts asking questions is promptly packed off to bed. - -- Arthur Binstead -% -It now costs more to amuse a child than it once did to educate his father. -% -It occurred to me lately that nothing has occurred to me lately. -% -It pays in England to be a revolutionary and a bible-smacker most of -one's life and then come round. - -- Lord Alfred Douglas -% -It pays to be obvious, especially if you have a reputation for subtlety. -% -It proves what they say, give the public what they want to see and -they'll come out for it. - -- Red Skelton, surveying the funeral of Hollywood - mogul Harry Cohn -% -It runs like _x, where _x is something unsavory. - -- Prof. Romas Aleliunas, CS 435 -% -It seemed the world was divided into good and bad people. The good ones -slept better... while the bad ones seemed to enjoy the waking hours much -more. - -- Woody Allen, "Side Effects" -% -It seems a little silly now, but this country -was founded as a protest against taxation. -% -It seems appropriate to me that Mapplethorpe's perverse images should -be situated so close to Congress, which perpetuates a number of -unnatural acts upon the body politic every day, without benefit of -artificial lubrication or foreplay. - -- Pat Calafia's review of Camille Paglia's - "Sex, Art and American Culture" -% -It seems intuitively obvious to me, which means that it might be wrong. - -- Chris Torek -% -It seems like the less a statesman amounts to, the more he loves the -flag. -% -It seems that more and more mathematicians are using a new, high level -language named "research student". -% -It seems to make an auto driver mad if he misses you. -% -It seems to me that nearly every woman I know wants a man who knows how -to love with authority. Women are simple souls who like simple things, -and one of the simplest is one of the simplest to give. ... Our family -airedale will come clear across the yard for one pat on the head. The -average wife is like that. - -- Episcopal Bishop James Pike -% -It shall be unlawful for any suspicious person to be within the -municipality. - -- Local ordinance, Euclid Ohio -% -It so happens that everything that is stupid is not unconstitutional. - -- Supreme Court Justice Antonio Scalia -% -It takes a smart husband to have the last word and not use it. -% -It takes a special kind of courage to face what we all have to face. -% -It takes all kinds to fill the freeways. - -- Crazy Charlie -% -It takes both a weapon, and two people, to commit a murder. -% -It takes less time to do a thing right -than it does to explain why you did it wrong. - -- H. W. Longfellow -% -It takes two to tell the truth: one to speak and one to hear. -% -It took a while to surface, but it appears that a long-distance credit card -may have saved a U.S. Army unit from heavy casualties during the Grenada -military rescue/invasion. Major General David Nichols, Air Force ... said -the Army unit was in a house surrounded by Cuban forces. One soldier found -a telephone and, using his credit card, called Ft. Bragg, N.C., telling Army -officers there of the perilous situation. The officers in turn called the -Air Force, which sent in gunships to scatter the Cubans and relieve the unit. - -- Aviation Week and Space Technology -% -It took me fifteen years to discover that I had no talent for writing, -but I couldn't give it up because by that time I was too famous. - -- Robert Benchley -% -It turned out that the worm exploited three or four different holes in the -system. From this, and the fact that we were able to capture and examine -some of the source code, we realized that we were dealing with someone very -sharp, probably not someone here on campus. - -- Dr. Richard LeBlanc, associate professor of ICS, in - Georgia Tech's campus newspaper after the Internet worm. -% -It used to be the fun was in -The capture and kill. -In another place and time -I did it all for thrills. - -- Lust to Love -% -It usually takes more than three weeks to prepare a good impromptu speech. - -- Mark Twain -% -It was a book to kill time for those who liked it better dead. -% -It was a brave man that ate the first oyster. -% -It was a fine, sweet night, the nicest since my divorce, maybe the nicest -since the middle of my marriage. There was energy, softness, grace and -laughter. I even took my socks off. In my circle, that means class. - -- Andrew Bergman "The Big Kiss-off of 1944" -% -It was a Roman who said it was sweet to die for one's country. The Greeks -never said it was sweet to die for anything. They had no vital lies. - -- Edith Hamilton, "The Greek Way" -% -It was a virgin forest, a place where the Hand of Man had never set -foot. -% -It was all so different before everything changed. -% -It was kinda like stuffing the wrong card in a computer, -when you're stickin' those artificial stimulants in your arm. - -- Dion, noted computer scientist -% -It was one of those perfect summer days -- the sun was shining, a breeze -was blowing, the birds were singing, and the lawn mower was broken ... - -- James Dent -% -It was one time too many -One word too few -It was all too much for me and you -There was one way to go -Nothing more we could do -One time too many -One word too few - -- Meredith Tanner -% -It was Penguin lust... at its ugliest. -% -It was pity stayed his hand. "Pity I don't have any more bullets," -thought Frito. - -- Harvard Lampoon, "Bored of the Rings" -% -It was pleasant to me to get a letter from you the other day. Perhaps -I should have found it pleasanter if I had been able to decipher it. I -don't think that I mastered anything beyond the date (which I knew) and -the signature (which I guessed at). There's a singular and a perpetual -charm in a letter of yours; it never grows old, it never loses its -novelty. Other letters are read and thrown away and forgotten, but -yours are kept forever -- unread. One of them will last a reasonable -man a lifetime. - -- Thomas Aldrich -% -It was raining heavily, and the motorist had car trouble on a lonely country -road. Anxious to find shelter for the night, he walked over to a farmhouse -and knocked on the front door. No one responded. He could feel the water -from the roof running down the back of his neck as he stood on the stoop. -The next time he knocked louder, but still no answer. By now he was soaked -to the skin. Desperately he pounded on the door. At last the head of a -man appeared out of an upstairs window. - "What do you want?" he asked gruffly. - "My car broke down," said the traveler, "and I want to know if you -would let me stay here for the night." - "Sure," replied the man. "If you want to stay there all night, it's -okay with me." -% -It was the Law of the Sea, they said. Civilization ends at the waterline. -Beyond that, we all enter the food chain, and not always right at the top. - -- Hunter S. Thompson -% -It was wonderful to find America, but it -would have been more wonderful to miss it. - -- Mark Twain -% -It wasn't exactly a divorce -- I was traded. - -- Tim Conway -% -It wasn't that she had a rose in her teeth, exactly. -It was more like the rose and the teeth were in the same glass. -% -It will be advantageous to cross the great stream ... the Dragon is on -the wing in the Sky ... the Great Man rouses himself to his Work. -% -It will be generally found that those who sneer habitually at human -nature and affect to despise it, are among its worst and least pleasant -examples. - -- Charles Dickens -% -It would be nice if the Food and Drug Administration stopped issuing -warnings about toxic substances and just gave me the names of one or -two things still safe to eat. - -- Robert Fuoss -% -It would be nice to be sure of anything -the way some people are of everything. -% -It would save me a lot of time if you just gave up and went mad now. -% -Italic, adj.: - Slanted to the right to emphasize key phrases. Unique to - Western alphabets; in Eastern languages, the same phrases - are often slanted to the left. -% -It'll be a nice world if they ever get it finished. -% -It'll be just like Beggars Canyon back home. - -- Luke Skywalker -% -It's a .88 magnum -- it goes through schools. - -- Danny Vermin -% -It's a brave man who, when things are at their darkest, can kick back -and party! - -- Dennis Quaid, "Inner Space" -% -It's a damn poor mind that can only think of one way to spell a word. - -- Andrew Jackson -% -It's a dog-eat-dog world out there, and I'm wearing Milkbone underwear. - -- Cheers -% -It's a good thing we don't get all the government we pay for. -% -It's a naive, domestic operating system without any -breeding, but I think you'll be amused by its presumption. -% -It's a poor workman who blames his tools. -% -It's a recession when your neighbor loses his job; it's a depression -when you lose yours. - -- Harry S. Truman -% -It's a small world, but I wouldn't want to have to paint it. - -- Steven Wright -% -It's a very *_U_N*lucky week in which to be took dead. - -- Churchy La Femme -% -It's all in the mind, ya know. -% -It's all right letting yourself go as long as you can let yourself back. - -- Mick Jagger -% -It's all so painfully empty and lonesome... I don't think I can stand -any more of it... the whole dreadful way we are born, die, and are -never missed. The fact there is *nobody*... nobody really... We come -out of a yawning tomb of flesh and sink back finally into another tomb. -What is the point of it all? Who thought up this sickening circle of -flesh and blood? We come into the world bleeding and cut and our bones -half-crushed only to emerge and suffer more torment, mutilation, and -then at the last lie down in some hole in the ground forever. Who could -have thought it up, I wonder? - -- James Purdy -% -It's always a long day; 86400 doesn't fit into a short. -% -It's always darkest just before it gets pitch black. -% -It's amazing how many people you could be friends -with if only they'd make the first approach. -% -It's amazing how much better you feel once you've given up hope. -% -It's amazing how much "mature wisdom" resembles being too tired. -% -It's amazing how nice people are to you when they know you're going away. - -- Michael Arlen -% -It's bad enough that life is a rat-race, -but why do the rats always have to win? -% -It's better to be quotable than to be honest. - -- Tom Stoppard -% -It's better to be wanted for murder than not to be wanted at all. - -- Marty Winch -% -It's better to burn out than to fade away. -% -It's business doing pleasure with you. -% -It's clever, but is it art? -% -It's difficult to see the picture when you are inside the frame. -% -"It's easier said than done." - -... and if you don't believe it, try proving that it's easier done than -said, and you'll see that "it's easier said that `it's easier done than -said' than it is done", which really proves that "it's easier said than -done". -% -It's easier to be a liberal a long way from home. - -- Don Price -% -It's easier to get forgiveness for being -wrong than forgiveness for being right. -% -It's easier to take it apart than to put it back together. - -- Washlesky -% -It's easy to forgive someone for being wrong; -it's much harder to forgive them for being right. -% -It's easy to make a friend. What's hard is to make a stranger. -% -It's fabulous! We haven't seen anything like it in the last half an hour! - -- Macy's -% -Its failings notwithstanding, there is much to be said in favor of journalism -in that by giving us the opinion of the uneducated, it keeps us in touch with -the ignorance of the community. - -- Oscar Wilde -% -It's faster horses, -Younger women, -Older whiskey and -More money. - -- Tom T. Hall, "The Secret of Life" -% -It's from Casablanca. I've been waiting all my life to use that line. - -- Woody Allen, "Play It Again, Sam" -% -It's getting uncommonly easy to kill people in large numbers, and the -first thing a principle does -- if it really is a principle -- is to -kill somebody. - -- Dorothy Sayers -% -It's gonna be alright, -It's almost midnight, -And I've got two more bottles of wine. -% -It's hard not to like a man of many qualities, -even if most of them are bad. -% -It's hard to argue that God hated Oklahoma. -If He didn't, why is it so close to Texas? -% -It's hard to be humble when you're perfect. -% -It's hard to drive at the limit, but -it's harder to know where the limits are. - -- Stirling Moss -% -It's hard to get ivory in Africa, but in Alabama the Tuscaloosa. - -- Groucho Marx -% -It's hard to keep your shirt on when -you're getting something off your chest. -% -It's hard to outrun dead people because they don't have to breathe. - -- Hokey, describing "Night of the Living Dead" -% -It's hard to think of you as the end -result of millions of years of evolution. -% -It's illegal in Wilbur, Washington, to ride an ugly horse. -% -It's important that people know what you stand for. -It's more important that they know what you won't stand for. -% -It's interesting to think that many quite -distinguished people have bodies similar to yours. -% -It's is not, it isn't ain't, and it's it's, not its, if you mean it is. -If you don't, it's its. Then too, it's hers. It isn't her's. It isn't -our's either. It's ours, and likewise yours and theirs. - -- Oxford University Press, "Edpress News" -% -It's just a jump to the left - And then a step to the right. -Put your hands on your hips - You bring your knees in tight. -But it's the pelvic thrust - That really drives you insa-a-a-a-a-ane! - - LET'S DO THE TIME WARP AGAIN! - - -- Rocky Horror Picture Show -% -It's just apartment house rules, -So all you 'partment house fools -Remember: one man's ceiling is another man's floor. -One man's ceiling is another man's floor. - -- Paul Simon, "One Man's Ceiling Is Another Man's Floor" -% -It's kind of fun to do the impossible. - -- Walt Disney -% -It's later than you think. -% -It's later than you think, the joint -Russian-American space mission has already begun. -% -It's like deja vu all over again. - -- Yogi Berra -% -It's Like This - -Even the samurai -have teddy bears, -and even the teddy bears -get drunk. -% -It's lucky you're going so slowly, because -you're going in the wrong direction. -% -It's more than magnificent -- it's mediocre. - -- Sam Goldwyn -% -It's multiple choice time... - - What is FORTRAN? - - a: Between thre and fiv tran. - b: What two computers engage in before they interface. - c: Ridiculous. -% -Its name is Public Opinion. It is held in reverence. -It settles everything. Some think it is the voice of God. - -- Mark Twain -% -It's never too late to have a happy childhood. -% -It's no longer a question of staying healthy. It's a question of finding -a sickness you like. - -- Jackie Mason -% -It's no surprise that things are so screwed up: everyone that knows how -to run a government is either driving taxicabs or cutting hair. - -- George Burns -% -It's no use crying over spilt milk -- it only makes it salty for the cat. -% -It's not against any religion to want to dispose of a pigeon. - -- Tom Lehrer -% -It's not an optical illusion, it just looks like one. - -- Phil White -% -It's not Camelot, but it's not Cleveland, either. - -- Kevin White, Mayor of Boston -% -It's not easy being green. - -- Kermit -% -It's not enough to be Hungarian; you must have talent too. - -- Alexander Korda -% -It's not hard to admit errors that are [only] cosmetically wrong. - -- J. K. Galbraith -% -It's not just a computer -- it's your ass. - -- Cal Keegan -% -It's not reality or how you perceive things that's important -- it's -what you're taking for it... -% -It's not reality that's important, but how you perceive things. -% -It's not so hard to lift yourself by your bootstraps once you're off -the ground. - -- Daniel B. Luten -% -It's not that I'm afraid to die. -I just don't want to be there when it happens. - -- Woody Allen -% -It's not the fall that kills you, it's the landing. -% -It's not the men in my life, but the life in my men that counts. - -- Mae West -% -It's not the valleys in life I dread so much as the dips. - -- Garfield -% -It's not whether you win or lose but how you played the game. - -- Grantland Rice -% -It's not whether you win or lose, it's how you look playing the game. -% -It's not whether you win or lose, it's how you place the blame. -% -It's odd, and a little unsettling, to reflect upon the fact that English is -the only major language in which "I" is capitalized; in many other languages -"You" is capitalized and the "i" is lower case. - -- Sydney J. Harris -% -It's only by NOT taking the human race seriously that I retain -what fragments of my once considerable mental powers I still possess. - -- Roger Noe -% -It's our fault. We should have given him better parts. - -- Jack Warner, on hearing that Reagan had been - elected governor of California. - -[Warner is also reported to have said, when told of Reagan's candidacy -for governor, "No, Jimmy Stewart for Governor; Reagan for best friend."] -% -It's possible that the whole purpose of your life is to serve -as a warning to others. -% -It's pretty hard to tell what does bring happiness; -poverty and wealth have both failed. - -- Kin Hubbard -% -It's raisins that make Post Raisin Bran so raisiny ... -% -It's really quite a simple choice: Life, Death, or Los Angeles. -% -It's reassuring to know that if you behave strangely enough, -society will take full responsibility for you. -% -It's recently come to Fortune's attention that scientists have stopped -using laboratory rats in favor of attorneys. Seems that there are not -only more of them, but you don't get so emotionally attached. The only -difficulty is that it's sometimes difficult to apply the experimental -results to humans. - - [Also, there are some things even a rat won't do. Ed.] -% -It's so beautifully arranged on the plate -- you know someone's fingers -have been all over it. - -- Julia Child on nouvelle cuisine -% -It's so confusing choosing sides in the heat of the moment, - just to see if it's real, -Oooh, it's so erotic having you tell me how it should feel, -But I'm avoiding all the hard cold facts that I got to face, -So ask me just one question when this magic night is through, -Could it have been just anyone or did it have to be you? - -- Billy Joel, "Glass Houses" -% -It's sweet to be remembered, but it's often cheaper to be forgotten. -% -It's ten o'clock; do you know where your processes are? -% -It's the good girls who keep the diaries, the bad girls never have the time. - -- Tallulah Bankhead -% -It's the opinion of some that crops could be grown on the moon. Which raises -the fear that it may not be long before we're paying somebody not to. - -- Franklin P. Jones -% -It's the same old story; boy meets beer, boy drinks beer... -boy gets another beer. - -- Cheers -% -It's the thought, if any, that counts! -% -It's useless to try to hold some people to anything they say while they're -madly in love, drunk, or running for office. -% -It's very glamorous to raise millions of dollars, until it's time for the -venture capitalist to suck your eyeballs out. - -- Peter Kennedy, chairman of Kraft & Kennedy -% -It's very inconvenient to be mortal -- you never -know when everything may suddenly stop happening. -% -IV. The time required for an object to fall twenty stories is greater than or - equal to the time it takes for whoever knocked it off the ledge to - spiral down twenty flights to attempt to capture it unbroken. - Such an object is inevitably priceless, the attempt to capture it - inevitably unsuccessful. - V. All principles of gravity are negated by fear. - Psychic forces are sufficient in most bodies for a shock to propel - them directly away from the earth's surface. A spooky noise or an - adversary's signature sound will induce motion upward, usually to - the cradle of a chandelier, a treetop, or the crest of a flagpole. - The feet of a character who is running or the wheels of a speeding - auto need never touch the ground, especially when in flight. -VI. As speed increases, objects can be in several places at once. - This is particularly true of tooth-and-claw fights, in which a - character's head may be glimpsed emerging from the cloud of - altercation at several places simultaneously. This effect is common - as well among bodies that are spinning or being throttled. A "wacky" - character has the option of self-replication only at manic high - speeds and may ricochet off walls to achieve the velocity required. - -- Esquire, "O'Donnell's Laws of Cartoon Motion", June 1980 -% -I've already told you more than I know. -% -I've always considered statesmen to be more expendable than soldiers. -% -I've always felt sorry for people that don't drink -- remember, -when they wake up, that's as good as they're gonna feel all day! -% -I've always made it a solemn practice to never -drink anything stronger than tequila before breakfast. - -- R. Nesson -% -I've been in more laps than a napkin. - -- Mae West -% -I've Been Moved! -% -I've been on a diet for two weeks and all I've lost is two weeks. - -- Totie Fields -% -I've been on this lonely road so long, -Does anybody know where it goes, -I remember last time the signs pointed home, -A month ago. - -- Carpenters, "Road Ode" -% -I've been there. -% -I've built a better model than the one at Data General -For data bases vegetable, animal, and mineral -My OS handles CPUs with multiplexed duality; -My PL/1 compiler shows impressive functionality. -My storage system's better than magnetic core polarity, -You never have to bother checking out a bit for parity; -There isn't any reason to install non-static floor matting; -My disk drive has capacity for variable formatting. - -I feel compelled to mention what I know to be a gloating point: -There's lots of room in memory for variables floating-point, -Which shows for input vegetable, animal, and mineral -I've built a better model than the one at Data General. - - -- Steve Levine, "A Computer Song" (To the tune of - "Modern Major General", from "Pirates of Penzance", - by Gilbert & Sullivan) -% -I've enjoyed just about as much of this as I can stand. -% -I've finally learned what "upward compatible" means. -It means we get to keep all our old mistakes. - -- Dennie van Tassel -% -I've found my niche. If you're wondering why I'm not there, there was -this little hole in the bottom ... - -- John Croll -% -I've given up reading books; I find it takes my mind off myself. -% -I've got a very bad feeling about this. - -- Han Solo -% -I've got all the money I'll ever need if I die by 4 o'clock. - -- Henny Youngman -% -I've had a perfectly wonderful evening. But this wasn't it. - -- Groucho Marx -% -I've known him as a man, as an adolescent and as a child -- sometimes -on the same day. -% -I've looked at the listing, and it's right! - -- Joel Halpern -% -I've never been canoeing before, but I imagine there must -be just a few simple heuristics you have to remember... - -Yes, don't fall out, and don't hit rocks. -% -I've never been drunk, but often I've been overserved. - -- George Gobel -% -I've never been hurt by anything I didn't say. - -- Calvin Coolidge -% -I've never had a problem with drugs; I've had problems with the police. - -- Keith Richards - -I never turn blue in anyone's bathroom. I think that's the height of -bad taste. - -- Keith Richards -% -I've never struck a woman in my life, not even my own mother. - -- W. C. Fields -% -I've noticed several design suggestions in your code. -% -I've only got 12 cards. -% -I've seen, I SAY, I've seen better heads on a mug of beer. - -- Senator Claghorn -% -I've spent almost all of my life with highly intelligent men. They're not -like other men. Their spirit is great and stimulating. They hate strife; -indeed they reject it. Their inventive gifts are boundless. They demand -devotion and obedience. And a sense of humor. I happily gave all of this. -I was lucky to be chosen and clever enough to understand them. - -- Marlene Dietrich, on her friendship with Ernest Hemingway -% -I've touch'd the highest point of all my greatness; -And from that full meridian of my glory -I haste now to my setting. I shall fall, -Like a bright exhalation in the evening -And no man see me more. - -- William Shakespeare -% -I've tried several varieties of sex. The conventional position makes -me claustrophobic, and the others either give me a stiff neck or lockjaw. - -- Tallulah Bankhead -% -Jacquin's Postulate on Democratic Government: - No man's life, liberty, or property are safe while the - legislature is in session. -% -jake hates - all the girls(the -shy ones, the bold paul scorns all -ones; the meek the girls(the -proud sloppy sleek) bright ones, the dim -all except the cold ones; the slim - ones plump tiny tall) - all except the - dull ones -gus loves all the - girls(the -warped ones, the lamed mike likes all the girls -ones; the mad (the -moronic maimed) fat ones, the lean -all except ones; the mean - the dead ones kind dirty clean) - all - except the green ones - -- e. e. cummings -% -James Joyce -- an essentially private man who wished his total -indifference to public notice to be universally recognized. - -- Tom Stoppard -% -James McNeill Whistler's (painter of "Whistler's Mother") failure in his -West Point chemistry examination once provoked him to remark in later life, -"If silicon had been a gas, I should have been a major general." -% -Jane and I got mixed up with a television show -- or as we call it back -east here: TV -- a clever contraction derived from the words Terrible -Vaudeville. However, it is our latest medium -- we call it a medium -because nothing's well done. It was discovered, I suppose you've heard, -by a man named Fulton Berle, and it has already revolutionized social -grace by cutting down parlour conversation to two sentences: "What's on -television?" and "Good night". - -- Goodman Ace, letter to Groucho Marx, in The Groucho - Letters, 1967 -% -Japan, n.: - A fictional place where elves, gnomes and economic imperialists - create electronic equipment and computers using black magic. It - is said that in the capital city of Akihabara, the streets are - paved with gold and semiconductor chips grow on low bushes from - which they are harvested by the happy natives. -% -Jealousy is all the fun you think they have. -% -Jenkinson's Law: - It won't work. -% -Jim, it's Grace at the bank. I checked your Christmas Club account. -You don't have five-hundred dollars. You have fifty. Sorry, computer foul-up! -% -Jim, it's Jack. I'm at the airport. I'm going to Tokyo and wanna pay -you the five-hundred I owe you. Catch you next year when I get back! -% -Jim Nasium's Law: - In a large locker room with hundreds of lockers, the few people - using the facility at any one time will all have lockers next to - each other so that everybody is cramped. -% -Jim, this is Janelle. I'm flying tonight, so I can't make our date, and -I gotta find a safe place for Daffy. He loves you, Jim! It's only two -days, and you'll see. Great Danes are no problem! -% -Jim, this is Matty down at Ralph's and Mark's. Some guy named Angel -Martin just ran up a fifty buck bar tab. And now he wants to charge it -to you. You gonna pay it? -% -JOB INTERVIEW: - The excruciating process during which personnel officers - separate the wheat from the chaff -- then hire the chaff. -% -Job Placement, n.: - Telling your boss what he can do with your job. -% -Joe Cool always spends the first two weeks at college sailing his Frisbee. - -- Snoopy -% -Joe sat as his dying wife's bedside. -Her voice was little more than a whisper. - "Joe, darling," she breathed, "I've got a confession to make -before I go. I ... I'm the one who took the $10,000 from your safe... -I spent it on a fling with your best friend, Charles. And it was I who -forced your mistress to leave the city. And I am the one who reported -your income-tax evasion to the I.R.S..." - "That's all right, dearest, don't give it a second thought," -whispered Joe. "I'm the one who poisoned you." -% -Joe's sister puts spaghetti in her shoes! -% -Jogger, n.: - An odd sort of person with a thing for pain. -% -John Dame May Oscar -Was Gay Was Whitty Was Wilde -But Gerard Hopkins But John Greenleaf But Thornton -Was Manley Was Whittier Was Wilder - -- Willard Espy -% -JOHN PAUL ELECTED POPE!! - -(George and Ringo miffed.) -% -John the Baptist after poisoning a thief, -Looks up at his hero, the Commander-in-Chief, -Saying tell me great leader, but please make it brief -Is there a hole for me to get sick in? -The Commander-in-Chief answers him while chasing a fly, -Saying death to all those who would whimper and cry. -And dropping a barbell he points to the sky, -Saying the sun is not yellow, it's chicken. - -- Bob Dylan, "Tombstone Blues" -% -Johnny Carson's Definition: - The smallest interval of time known to man is that which occurs - in Manhattan between the traffic signal turning green and the - taxi driver behind you blowing his horn. -% -Johnson's First Law: - When any mechanical contrivance fails, it will do so at the - most inconvenient possible time. -% -Johnson's law: - Systems resemble the organizations that create them. -% -Join in the new game that's sweeping the country. It's called "Bureaucracy". -Everybody stands in a circle. The first person to do anything loses. -% -Join the army, see the world, meet interesting, -exciting people, and kill them. -% -Join the march to save individuality! -% -Join the Navy; sail to far-off exotic lands, -meet exciting interesting people, and kill them. -% -Jones' First Law: - Anyone who makes a significant contribution to any field of - endeavor, and stays in that field long enough, becomes an - obstruction to its progress -- in direct proportion to the - importance of their original contribution. -% -Jone's Motto: - Friends come and go, but enemies accumulate. -% -Jones' Second Law: - The man who smiles when things go wrong has thought of someone - to blame it on. -% -Joshu: What is the true Way? -Nansen: Every way is the true Way. -J: Can I study it? -N: The more you study, the further from the Way. -J: If I don't study it, how can I know it? -N: The Way does not belong to things seen: nor to things unseen. - It does not belong to things known: nor to things unknown. Do - not seek it, study it, or name it. To find yourself on it, open - yourself as wide as the sky. -% -Journalism is literature in a hurry. - -- Matthew Arnold -% -Journalism will kill you, but it will keep you alive while you're at it. -% -Juall's Law on Nice Guys: - Nice guys don't always finish last; sometimes they don't finish. - Sometimes they don't even get a chance to start! -% -Judges, as a class, display, in the matter of arranging alimony, that -reckless generosity which is found only in men who are giving away -someone else's cash. - -- P. G. Wodehouse, "Louder and Funnier" -% -Just a few of the perfect excuses for having some strawberry shortcake. -Pick one. - -1: It's less calories than two pieces of strawberry shortcake. -2: It's cheaper than going to France. -3: It neutralizes the brownies I had yesterday. -4: Life is short. -5: It's somebody's birthday. I don't want them to celebrate alone. -6: It matches my eyes. -7: Whoever said, "Let them eat cake." must have been talking to me. -8: To punish myself for eating dessert yesterday. -9: Compensation for all the time I spend in the shower not eating. -10: Strawberry shortcake is evil. I must help rid the world of it. -11: I'm getting weak from eating all that healthy stuff. -12: It's the second anniversary of the night I ate plain broccoli. -% -Just a song before I go, Going through security -To whom it may concern, I held her for so long. -Traveling twice the speed of sound She finally looked at me in love, -It's easy to get burned. And she was gone. -When the shows were over Just a song before I go, -We had to get back home, A lesson to be learned. -And when we opened up the door Traveling twice the speed of sound -I had to be alone. It's easy to get burned. -She helped me with my suitcase, -She stands before my eyes, -Driving me to the airport -And to the friendly skies. - -- Crosby, Stills, Nash, "Just a Song Before I Go" -% -Just about every computer on the market today runs Unix, except the Mac -(and nobody cares about it). - -- Bill Joy 6/21/85 -% -Just as I cannot remember any time when I could not read and write, I -cannot remember any time when I did not exercise my imagination in -daydreams about women. - -- George Bernard Shaw -% -Just as most issues are seldom black or white, so are most good solutions -seldom black or white. Beware of the solution that requires one side to be -totally the loser and the other side to be totally the winner. The reason -there are two sides to begin with usually is because neither side has all -the facts. Therefore, when the wise mediator effects a compromise, he is -not acting from political motivation. Rather, he is acting from a deep -sense of respect for the whole truth. - -- Stephen R. Schwambach -% -Just because everything is different doesn't mean anything has changed. - -- Irene Peter -% -Just because he's dead is no reason to lay off work. -% -Just because I turn down a contract on a guy doesn't mean he isn't -going to get hit. - -- Joey -% -Just because the message may never be -received does not mean it is not worth sending. -% -Just because they are called "forbidden" transitions does not mean that they -are forbidden. They are less allowed than allowed transitions, if you see -what I mean. - -- From a Part 2 Quantum Mechanics lecture -% -Just because you like my stuff doesn't mean I owe you anything. - -- Bob Dylan -% -Just because your doctor has a name for your -condition doesn't mean he knows what it is. -% -Just because you're paranoid doesn't mean they AREN'T after you. -% -Just close your eyes, tap your heels together three times, -and think to yourself, "There's no place like home." - -- Billie Burke as Glinda, "The Wizard of Oz" -% -Just give Alice some pencils and she will stay busy for hours. -% -Just go with the flow control, roll with the crunches, and, when you -get a prompt, type like hell. -% -Just how difficult it is to write biography can be reckoned by anybody -who sits down and considers just how many people know the real truth -about his or her love affairs. - -- Rebecca West -% -Just machines to make big decisions, -Programmed by men for compassion and vision, -We'll be clean when their work is done, -We'll be eternally free, yes, eternally young, -What a beautiful world this will be, -What a glorious time to be free. - -- Donald Fagon, "What A Beautiful World" -% -Just once, I wish we would encounter -an alien menace that wasn't immune to bullets. - -- The Brigadier, "Doctor Who" -% -Just out of curiosity does this actually mean something or have some -of the few remaining bits of your brain just evaporated? - -- Patricia O Tuama, rissa@killer.DALLAS.TX.US -% -Just remember, it all started with a mouse. - -- Walt Disney -% -Just remember: when you go to court, you are trusting your fate to -twelve people that weren't smart enough to get out of jury duty! -% -`Just the place for a Snark!' the Bellman cried, - As he landed his crew with care; -Supporting each man on the top of the tide - By a finger entwined in his hair. - -`Just the place for a Snark! I have said it twice: - That alone should encourage the crew. -Just the place for a Snark! I have said it thrice: - What I tell you three times is true.' - -- Lewis Carroll, "The Hunting of the Snark" -% -Just think -- blessed SCSI cables! Do a big enough sacrifice and create -a +5 blessed SCSI cable of connectivity. - -- Lionel Lauer -% -Just to have it is enough. -% -Just weigh your own hurt against the hurt -of all the others, and then do what's best. - -- Lovers and Other Strangers -% -Just what does "it" mean in the sentence, "What time is it?" -% -Just when you thought you were winning the rat race, along comes a -faster rat!!! -% -Just yesterday morning, they let me know you were gone, -Suzanne, the plans they made put an end to you, -I went out this morning and I wrote down this song, -Just can't remember who to send it to... - -Oh, I've seen fire and I've seen rain, -I've seen sunny days that I thought would never end, -I've seen lonely times when I could not find a friend, -But I always thought that I'd see you again. -Thought I'd see you one more time again. - -- James Taylor, "Fire and Rain" -% -Justice always prevails ... three times out of seven! - -- Michael J. Wagner -% -Justice is incidental to law and order. - -- J. Edgar Hoover -% -Justice, n.: - A decision in your favor. -% -K: Cobalt's metal, hard and shining; - Cobol's wordy and confining; - KOBOLDS topple when you strike them; - Don't feel bad, it's hard to like them. - -- The Roguelet's ABC -% -Kafka's Law: - In the fight between you and the world, back the world. - -- Franz Kafka, "RS's 1974 Expectation of Days" -% -Kamikazes do it once. -% -KANSAS: - Where the men are men and so are the women! -% -Kansas state law requires pedestrians crossing the highways at night to -wear tail lights. -% -Karlson's Theorem of Snack Food Packages: - -For all P, where P is a package of snack food, P is a SINGLE-SERVING -package of snack food. - -Gibson the Cat's Corollary: - -For all L, where L is a package of lunch meat, L is Gibson's package -of lunch meat. -% -Kath: Can he be present at the birth of his child? -Ed: It's all any reasonable child can expect if the dad is present - at the conception. - -- Joe Orton, "Entertaining Mr. Sloane" -% -Katz' Law: - Men and nations will act rationally when - all other possibilities have been exhausted. - -History teaches us that men and nations behave wisely once they have -exhausted all other alternatives. - -- Abba Eban -% -Kaufman's First Law of Party Physics: - Population density is inversely proportional - to the square of the distance from the keg. -% -Kaufman's Law: - A policy is a restrictive document to prevent a recurrence - of a single incident, in which that incident is never mentioned. -% -Keep a diary and one day it'll keep you. - -- Mae West -% -Keep America beautiful. Swallow your beer cans. -% -Keep ancient lands, your storied pomp! cries she -With silent lips. Give me your tired, your poor, -Your huddled masses yearning to breathe free, -The wretched refuse of your teeming shore. -Send these, the homeless, tempest-tossed to me... - -- Emma Lazarus, "The New Colossus" -% -Keep cool, but don't freeze. - -- Hellman's Mayonnaise -% -Keep emotionally active. Cater to your favorite neurosis. -% -Keep grandma off the streets -- legalize bingo. -% -Keep in mind always the four constant Laws of Frisbee: - 1) The most powerful force in the world is that of a disc - straining to land under a car, just out of reach (this - force is technically termed "car suck"). - 2) Never precede any maneuver by a comment more predictive - than "Watch this!" - 3) The probability of a Frisbee hitting something is directly - proportional to the cost of hitting it. For instance, a - Frisbee will always head directly towards a policeman or - a little old lady rather than the beat up Chevy. - 4) Your best throw happens when no one is watching; when the - cute girl you've been trying to impress is watching, the - Frisbee will invariably bounce out of your hand or hit you - in the head and knock you silly. -% -Keep it short for pithy sake. -% -Keep on keepin' on. -% -Keep patting your enemy on the back until a -small bullet hole appears between your fingers. - -- Joe Bonanno -% -Keep the number of passes in a compiler to a minimum. - -- D. Gries -% -Keep the phase, baby. -% -Keep up the good work! But please don't ask me to help. -% -Keep women you cannot. Marry them and they come to hate the way -you walk across the room; remain their lover, and they jilt you -at the end of six months. - -- Moore -% -Keep your boss's boss off your boss's back. -% -Keep your Eye on the Ball, -Your Shoulder to the Wheel, -Your Nose to the Grindstone, -Your Feet on the Ground, -Your Head on your Shoulders. -Now... try to get something DONE! -% -Keep your eyes wide open before marriage, half shut afterwards. - -- Benjamin Franklin -% -Keep your laws off my body! -% -Keep your mouth shut and people will think you stupid; -Open it and you remove all doubt. -% -Ken Thompson has an automobile which he helped design. Unlike most -automobiles, it has neither speedometer, nor gas gauge, nor any of the -numerous idiot lights which plague the modern driver. Rather, if the -driver makes any mistake, a giant "?" lights up in the center of the -dashboard. "The experienced driver", he says, "will usually know -what's wrong." -% -Kennedy's Market Theorem: - Given enough inside information and unlimited credit, - you've got to go broke. -% -Kent's Heuristic: - Look for it first where you'd most like to find it. -% -Kern, v.: - 1. To pack type together as tightly as the kernels on an ear - of corn. 2. In parts of Brooklyn and Queens, N.Y., a small, - metal object used as part of the monetary system. -% -KERNEL: - A part of an operating system that preserves the medieval - traditions of sorcery and black art. -% -Kettering's Observation: - Logic is an organized way of going wrong with confidence. -% -Kids always brighten up a house; mostly by leaving the lights on. -% -Kids have *_n_e_v_e_r* taken guidance from their parents. If you could -travel back in time and observe the original primate family in the -original tree, you would see the primate parents yelling at the primate -teenager for sitting around and sulking all day instead of hunting for -grubs and berries like dad primate. Then you'd see the primate -teenager stomp up to his branch and slam the leaves. - -- Dave Barry, "Kids Today: They Don't Know Dum Diddly Do" -% -Kill a commy for your mommy. -% -Kill 'em all, and let God sort 'em out. -% -Kill for the love of killing! Kill for the love of Kali! - -- Hindu saying -% -Kill Kill, -Hate Hate, -Murder, Maim, and Mutilate! -% -Kill your parents. - -- Jerry Rubin -% -Killing turkeys causes winter. -% -Kilroe hic erat! -% -Kime's Law for the Reward of Meekness: - Turning the other cheek merely ensures two bruised cheeks. -% -Kin, n.: - An affliction of the blood. -% -Kindness is a language which the deaf can hear and the blind can read. - -- Mark Twain -% -Kindness is the beginning of cruelty. - -- Muad'dib, "Dune" -% -Kington's Law of Perforation: - If a straight line of holes is made in a piece of paper, such - as a sheet of stamps or a check, that line becomes the strongest - part of the paper. -% -Kinkler's First Law: - Responsibility always exceeds authority. - -Kinkler's Second Law: - All the easy problems have been solved. -% -Kirk to Enterprise... -% -Kirk to Enterprise -- beam down yeoman Rand and a six-pack. -% -Kirkland, Illinois, law forbids bees to fly over the village or through -any of its streets. -% -Kiss a non-smoker; taste the difference. -% -Kiss me, Kate, we will be married o' Sunday. - -- William Shakespeare, "The Taming of the Shrew" -% -Kiss me twice. I'm schizophrenic. -% -Kiss your keyboard goodbye! -% -Kissing a fish is like smoking a bicycle. -% -Kissing a smoker is like licking an ashtray. -% -Kissing don't last, cookery do. - -- George Meredith -% -Kissing your hand may make you feel very good, but a diamond and -sapphire bracelet lasts for ever. - -- Anita Loos, "Gentlemen Prefer Blondes" -% -Kitchen activity is highlighted. -Butter up a friend. -% -Kites rise highest against the wind -- not with it. - -- Winston Churchill -% -Klatu barada nikto. -% -Kleeneness is next to Godelness. -% -Klein bottle for sale -- inquire within. -% -Kleptomaniac, n.: - A rich thief. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Kliban's First Law of Dining: - Never eat anything bigger than your head. -% -Klingon phaser attack from front!!!!! -100% Damage to life support!!!! -% -Kludge, n.: - An ill-assorted collection of poorly-matching parts, forming a - distressing whole. - -- Jackson Granholm, "Datamation" -% -Knebel's Law: - It is now proved beyond doubt that smoking is one of the leading - causes of statistics. -% -Knights are hardly worth it. -I mean, all that shell and so little meat... -% -Knock, knock! - Who's there? -Sam and Janet. - Sam and Janet who? -Sam and Janet Evening... -% -Knock Knock... (who's there?) Ether! (ether who?) Eather Bunny... Yea! -[chorus] - Yeay! - Stay on the Happy side, always on the happy side, - Stay on the Happy side of life! - Bum bum bum bum bum bum - You will feel no pain, as we drive you insane, - So Stay on the Happy Side of life! - -Knock Knock... (who's there?) Anna! (anna who?) - An another eather bunny... [chorus] -Knock Knock... (who's there?) Stilla! (stilla who?) - Still another ether bunny... [chorus] -Knock Knock... (who's there?) Yetta! (yetta who?) - Yet another ether bunny... [chorus] -Knock Knock... (who's there?) Cargo! (cargo who?) - Cargo beep beep and run over eather bunny... [chorus] -Knock Knock... (who's there?) Boo! (boo who?) - Don't Cry! Eather bunny be back next year! [chorus] -% -Knocked, you weren't in. - -- Opportunity -% -Know how to save 5 drowning lawyers? - --- No? - -GOOD! -% -Know Thy User. -% -Know thyself. If you need help, call the C.I.A. -% -Know what I hate most? Rhetorical questions. - -- Henry N. Camp -% -KNOWLEDGE: - Things you believe. -% -Knowledge is power. - -- Francis Bacon -% -Knowledge is power -- knowledge shared is power lost. - -- Aleister Crowley -% -Knowledge without common sense is folly. -% -Knucklehead: "Knock, knock" -Pee Wee: "Who's there?" -Knucklehead: "Little ol' lady." -Pee Wee: "Liddle ol' lady who?" -Knucklehead: "I didn't know you could yodel" -% -Kramer's Law: - You can never tell which way the train went by looking at the tracks. -% -Krogt, n. (chemical symbol: Kr): - The metallic silver coating found on fast-food game cards. - -- Rich Hall, "Sniglets" -% -LA: - Where the only way to determine that the seasons have changed - is to note that people have changed the main topic of conversation. - From mud slides to brush fires. -% -Labor, n.: - One of the processes by which A acquires property for B. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Lack of capability is usually disguised by lack of interest. -% -Lack of money is the root of all evil. - -- George Bernard Shaw -% -Lackland's Laws: - 1. Never be first. - 2. Never be last. - 3. Never volunteer for anything. -% -Lactomangulation, n.: - Manhandling the "open here" spout on a milk carton so badly - that one has to resort to using the "illegal" side. - -- Rich Hall, "Sniglets" -% -La-dee-dee, la-dee-dah. -% -Ladies and Gentlemen, Hobos and Tramps, -Cross-eyed mosquitos and bowlegged ants, -I come before you to stand behind you -To tell you of something I know nothing about. -Next Thursday (which is good Friday), -There will be a convention held in the -Women's Club which is strictly for Men. -Admission is free, pay at the door, -Pull up a chair, and sit on the floor. -It was a summer's day in winter, -And the snow was raining fast, -As a barefoot boy with shoes on, -Stood sitting in the grass. -Oh, that bright day in the dead of night, -Two dead men got up to fight. -Three blind men to see fair play, -Forty mutes to yell "Hooray"! -Back to back, they faced each other, -Drew their swords and shot each other. -A deaf policeman heard the noise, -Came and arrested those two dead boys. -% -Ladies, here's a hint: If you're playing against a friend who has big -boobs, bring her to the net and make her hit backhand volleys. That's -the hardest shot for the well endowed. "I've got to hit over them or -under them, but I can't hit through," Annie Jones used to always moan -to me. Not having much in my bra, I found it hard to sympathize with -her. - -- Billie Jean King -% -Lady, lady, should you meet -One whose ways are all discreet, -One who murmurs that his wife -Is the lodestar of his life, -One who keeps assuring you -That he never was untrue, -Never loved another one... -Lady, lady, better run! - -- Dorothy Parker, "Social Note" -% -Lady Luck brings added income today. -Lady friend takes it away tonight. -% -Lady Nancy Astor: - "Winston, if you were my husband, I'd put poison in your coffee." -Winston Churchill: - "Nancy, if you were my wife, I'd drink it." - -Lady Astor was giving a costume ball and Winston Churchill asked her what -disguise she would recommend for him. She replied, "Why don't you come -sober, Mr. Prime Minister?" - - During a visit to America, Winston Churchill was invited to a buffet -luncheon at which cold fried chicken was served. Returning for a second -helping, he asked politely, "May I have some breast?" - "Mr. Churchill," replied the hostess, "in this country we ask for -white meat or dark meat." Churchill apologized profusely. - The following morning, the lady received a magnificent orchid from -her guest of honor. The accompanying card read: "I would be most obliged if -you would pin this on your white meat." -% -Ladybug, ladybug, -Look to your stern! -Your house is on fire, -Your children will burn! -So jump ye and sing, for -The very first time -The four lines above -Have been put into rhyme. - -- Walt Kelly -% -Laetrile is the pits. -% -Laissez Faire Economics is the theory that if -each acts like a vulture, all will end as doves. -% -Lake Erie died for your sins. -% -((lambda (foo) (bar foo)) (baz)) -% -Lamonte Cranston once hired a new Chinese manservant. While describing his -duties to the new man, Lamonte pointed to a bowl of candy on the coffee -table and warned him that he was not to take any. Some days later, the new -manservant was cleaning up, with no one at home, and decided to sample some -of the candy. Just than, Cranston walked in, spied the manservant at the -candy, and said: - "Pardon me Choy, is that the Shadow's nugate you chew?" -% -Langsam's Laws: - (1) Everything depends. - (2) Nothing is always. - (3) Everything is sometimes. -% -Language is a virus from another planet. - -- William Burroughs -% -Lank: Here we go. We're about to set a new record. -Earl: (to the crowd) How about a date? -Lank: We've done it. Earl has set a new record. Turned down by - 20,000 women. - -- Lank and Earl -% -Lansdale seized on the idea of using Nixon to build support for the -[Vietnamese] elections ... really honest elections, this time. "Oh, sure, -honest, yes, that's right," Nixon said, "so long as you win!" With that -he winked, drove his elbow into Lansdale's arm and slapped his own knee. - -- Richard M. Nixon, quoted in "Sideshow" by W. Shawcross -% -Large increases in cost with questionable increases in -performance can be tolerated only in race horses and women. - -- Lord Kelvin -% -Largest Number of Driving Test Failures - By April 1970 Mrs. Miriam Hargrave had failed her test thirty-nine -times. In the eight preceding years she had received two hundred and -twelve driving lessons at a cost of L300. She set the new record while -driving triumphantly through a set of red traffic lights in Wakefield, -Yorkshire. Disappointingly, she passed at the fortieth attempt (3 August -1970) but eight years later she showed some of her old magic when she was -reported as saying that she still didn't like doing right-hand turns. - -- Stephen Pile, "The Book of Heroic Failures" -% -Larkinson's Law: - All laws are basically false. -% -LASER: - Failed death ray. -% -Last guys don't finish nice. - -- Stanley Kelley, on the cult of victory at all costs -% -Last night I dreamed I ate a ten-pound marshmallow, and when I woke up -the pillow was gone. - -- Tommy Cooper -% -Last night I met upon the stair -A little man who wasn't there. -He wasn't there again today. -Gee how I wish he'd go away! -% -Last night the power went out. Good thing my camera had a flash.... -The neighbors thought it was lightning in my house, so they called the cops. - -- Steven Wright -% -Last week a cop stopped me in my car. He asked me if I had a police record. -I said, no, but I have the new DEVO album. Cops have no sense of humor. -% -Last week's pet, this week's special. -% -Last year we drove across the country... We switched on the driving... -every half mile. We had one cassette tape to listen to on the entire trip. -I don't remember what it was. - -- Steven Wright -% -Last yeer I kudn't spel Engineer. Now I are won. -% -Latin is a language, -As dead as can be. -First it killed the Romans, -And now it's killing me. -% -Laugh, and the world ignores you. Crying doesn't help either. -% -Laugh and the world laughs with you, snore and you sleep alone. -% -Laugh and the world thinks you're an idiot. -% -Laugh at your problems: everybody else does. -% -Laugh when you can; cry when you must. -% -Laughing at you is like drop kicking a wounded humming bird. -% -Laughter is the closest distance between two people. - -- Victor Borge -% -Laura's Law: - No child throws up in the bathroom. -% -Lavish spending can be disastrous. -Don't buy any lavishes for a while. -% -Law enforcement officers should use only the minimum -force necessary in dealing with disorders when they arise. - -- Richard M. Nixon -% -Law of Communications: - The inevitable result of improved and enlarged communications - between different levels in a hierarchy is a vastly increased - area of misunderstanding. -% -Law of Continuity: - Experiments should be reproducible. - They should all fail the same way. -% -Law of Probable Dispersal: - Whatever it is that hits the fan will not be evenly distributed. -% -Law of Selective Gravity: - An object will fall so as to do the most damage. - -Jenning's Corollary: - The chance of the bread falling with the buttered side down is - directly proportional to the cost of the carpet. -% -Law of the Jungle: - He who hesitates is lunch. -% -Law of the Yukon: - Only the lead dog gets a change of scenery. -% -Law stands mute in the midst of arms. - -- Marcus Tullius Cicero -% -Lawful Dungeon Master -- and they're MY laws! -% -Lawrence Radiation Laboratory keeps all its data in an old gray trunk. -% -Laws are like sausages. It's better not to see them being made. - -- Otto von Bismarck -% -Laws of Computer Programming: - 1. Any given program, when running, is obsolete. - 2. Any given program costs more and takes longer. - 3. If a program is useful, it will have to be changed. - 4. If a program is useless, it will have to be documented. - 5. Any given program will expand to fill all available memory. - 6. The value of a program is proportional the weight of its output. - 7. Program complexity grows until it exceeds the capability of - the programmer who must maintain it. -% -Laws of Serendipity: - - (1) In order to discover anything, you must be looking for - something. - (2) If you wish to make an improved product, you must already - be engaged in making an inferior one. -% -Lawsuit, n.: - A machine which you go into as a pig and come out as a sausage. - -- Ambrose Bierce -% -Lawyer's Rule: - When the law is against you, argue the facts. - When the facts are against you, argue the law. - When both are against you, call the other lawyer names. -% -Lay off the muses, it's a very tough dollar. - -- S. J. Perelman -% -Lay on, MacDuff, and curs'd be him who first cries, "Hold, enough!". - -- William Shakespeare -% -Layers are for cakes, not for software. - -- Bart Smaalders -% -Lays eggs inside a paper bag; -The reason, you will see, no doubt, -Is to keep the lightning out. -But what these unobservant birds -Have failed to notice is that herds -Of bears may come with buns -And steal the bags to hold the crumbs. -% -Lazlo's Chinese Relativity Axiom: - No matter how great your triumphs or how tragic your defeats -- - approximately one billion Chinese couldn't care less. -% -LAZY: - Marrying a pregnant woman. -% -Leadership involves finding a parade and getting in front of it; what -is happening in America is that those parades are getting smaller and -smaller -- and there are many more of them. - -- John Naisbitt, "Megatrends" -% -Learn from other people's mistakes, you don't have time to make your own. -% -Learn to pause -- or nothing worthwhile can catch up to you. -% -Learned men are the cisterns of knowledge, not the fountainheads. -% -Learning at some schools is like drinking from a firehose. -% -LEARNING CURVE: - An astonishing new theory, discovered by management consultants - in the 1970's, asserting that the more you do something the - quicker you can do it. -% -Learning French is trivial: the word for horse is cheval, and -everything else follows in the same way. - -- Alan J. Perlis -% -Learning without thought is labor lost; -thought without learning is perilous. - -- Confucius -% -Leave no stone unturned. - -- Euripides -% -Lee's Law: - Mother said there would be days like this, - but she never said that there'd be so many! -% -Left to themselves, things tend to go from bad to worse. -% -Legalize free-enterprise murder: why should governments have all the -fun? -% -Legislation proposed in the Illinois State Legislature, May, 1907: - "Speed upon county roads will be limited to ten miles an hour -unless the motorist sees a bailiff who does not appear to have had a -drink in 30 days, when the driver will be permitted to make what he -can." -% -Leibowitz's Rule: - When hammering a nail, you will never hit your - finger if you hold the hammer with both hands. -% -Lemma: All horses are the same color. -Proof (by induction): - Case n = 1: In a set with only one horse, it is obvious that all - horses in that set are the same color. - Case n = k: Suppose you have a set of k+1 horses. Pull one of these - horses out of the set, so that you have k horses. Suppose that all - of these horses are the same color. Now put back the horse that you - took out, and pull out a different one. Suppose that all of the k - horses now in the set are the same color. Then the set of k+1 horses - are all the same color. We have k true => k+1 true; therefore all - horses are the same color. -Theorem: All horses have an infinite number of legs. -Proof (by intimidation): - Everyone would agree that all horses have an even number of legs. It - is also well-known that horses have forelegs in front and two legs in - back. 4 + 2 = 6 legs, which is certainly an odd number of legs for a - horse to have! Now the only number that is both even and odd is - infinity; therefore all horses have an infinite number of legs. - However, suppose that there is a horse somewhere that does not have an - infinite number of legs. Well, that would be a horse of a different - color; and by the Lemma, it doesn't exist. -% -Lemmings don't grow older, they just die. -% -Lend money to a bad debtor and he will hate you. -% -Lensmen eat Jedi for breakfast. -% -LEO (Jul. 23 to Aug. 22) - Your presence, poise, charm and good looks won't even help you today. - Look over your shoulder; an ugly person may be following you. Be on - your toes. Brush your teeth. Take Geritol. -% -LEO (July 23 - Aug 22) - You consider yourself a born leader. Others think you are pushy. - Most Leo people are bullies. You are vain and dislike honest - criticism. Your arrogance is disgusting. Leo people are thieves. -% -LEO (July 23 - Aug 22) - Your determination and sense of humor will come to the fore. Your - ability to laugh at adversity will be a blessing because you've got - a day coming you wouldn't believe. As a matter of fact, if you can - laugh at what happens to you today, you've got a sick sense of humor. -% -Lesbian QOTD: -I didn't give up sex, I just gave up premature ejaculation. -% -Let a fool hold his tongue and he will pass for a sage. - -- Publilius Syrus -% -Let he who takes the plunge remember to return it by Tuesday. -% -Let him choose out of my files, his projects to accomplish. - -- William Shakespeare, "Coriolanus" -% -Let me assure you that to us here at First National, you're not just a -number. You're two numbers, a dash, three more numbers, another dash and -another number. - -- James Estes -% -Let me not to the marriage of true minds -Admit impediments. Love is not love -Which alters when it alteration finds, -Or bends with the remover to remove. -O, no! it is an ever-fixed mark, -That looks on tempests and is never shaken; -It is the star to every wandering bark, -Whose worth's unknown, although his height be taken. -Love's not Time's fool, though rosy lips and cheeks -Within his bending sickle's compass come; -Love alters not with his brief hours and weeks, -But bears it out even to the edge of doom. - If this be error and upon me proved, - I never writ, nor no man ever loved. - -- William Shakespeare, Sonnet CXVI -% -Let me put it this way: today is going to be a learning experience. -% -Let me take you a button-hole lower. - -- William Shakespeare, "Love's Labour's Lost" -% -Let me tell you who the actual "front-runners" are. On one side, you have -George Bush, who is currently going through a sort of fraternity hazing -wherein he has to perform a series of humiliating stunts to win the approval -of the Republican Right. For example, they had him make a speech oozing -praise all over William Loeb, deceased publisher of the Manchester (N.H.) -Union Leader and Slime Journalist. Loeb had dumped viciously all over George -in the 1980 New Hampshire primary. But when the Right held a big tribute -for Loeb, George came back to the fold, like a man with a bungee cord wrapped -around his neck. - -- Dave Barry -% -Let my own body be exhausted, -But not the wealth of my state. -Let my mortal body vanish, -But not the power of my state. - -- Chinggis (Genghis) Khan -% -Let no guilty man escape. - -- U. S. Grant -% -Let not the sands of time get in your lunch. -% -Let others praise ancient times; I am glad I was born in these. - -- Ovid (43 B.C. - A.D. 18) -% -Let sleeping dogs lie. - -- Charles Dickens -% -Let the machine do the dirty work. - -- Kernighan and Plauger, "The Elements of Programming Style" -% -Let the meek inherit the earth -- they have it coming to them. - -- James Thurber -% -Let the people think they govern and they will be governed. - -- William Penn, founder of Pennsylvania -% -Let the worthy citizens of Chicago get their liquor the best way -they can. I'm sick of the job. It's a thankless one and full of grief. - -- Al Capone -% -Let thy maid servant be faithful, strong, and homely. - -- Benjamin Franklin -% -Let us go then you and I -while the night is laid out against the sky -like a smear of mustard on an old pork pie. - -Nice poem Tom. I have ideas for changes though, why not come over? - -- Ezra -% -Let us go, through certain half-deserted streets, -The muttering retreats -Of restless nights in one-night cheap hotels -And sawdust restaurants with oyster-shells: -Streets that follow like a tedious argument -Of insidious intent -To lead you to an overwhelming question... -Oh, do not ask, "What is it?" - -- T. S. Eliot, "Love song of J. Alfred Prufrock" -% -Let us live!!! -Let us love!!! -Let us share the deepest secrets of our souls!!! - -You first. -% -Let us never negotiate out of fear, -but let us never fear to negotiate. - -- John F. Kennedy -% -Let us not look back in anger or forward -in fear, but around us in awareness. - -- James Thurber -% -Let us remember that ours is a nation of lawyers and order. -% -Let us treat men and women well; -Treat them as if they were real; -Perhaps they are. - -- Ralph Waldo Emerson -% -Let your conscience be your guide. - -- Pope -% -L'etat c'est moi. -[The state, that's me.] - -- Louis XIV -% -Let's just be friends and make no special effort to ever see each other again. -% -Let's just say that where a change was required, I adjusted. In every -relationship that exists, people have to seek a way to survive. If you -really care about the person, you do what's necessary, or that's the end. -For the first time, I found that I really could change, and the qualities -I most admired in myself I gave up. I stopped being loud and bossy... -Oh, all right. I was still loud and bossy, but only behind his back." - -- Kate Hepburn, on Tracy and Hepburn -% -Let's love each other slowly, -reaching for a plane, -of exquisite pleasure, -and delicate pain. - -- Adam Beslove -% -Let's not complicate our relationship -by trying to communicate with each other. -% -Let's organize this thing and take all the fun out of it. -% -Let's remind ourselves that last year's fresh idea is today's cliche. - -- Austen Briggs -% -Let's say your wedding ring falls into your toaster, and when you stick your -hand in to retrieve it, you suffer Pain and Suffering as well as Mental -Anguish. You would sue: - -* The toaster manufacturer, for failure to include, in the instructions - section that says you should never never never ever stick you hand - into the toaster, the statement "Not even if your wedding ring falls - in there". - -* The store where you bought the toaster, for selling it to an obvious - cretin like yourself. - -* Union Carbide Corporation, which is not directly responsible in this - case, but which is feeling so guilty that it would probably send you - a large cash settlement anyway. - -- Dave Barry -% -Let's talk about how to fill out your 1984 tax return. Here's an often -overlooked accounting technique that can save you thousands of -dollars: For several days before you put it in the mail, carry your -tax return around under your armpit. No IRS agent is going to want to -spend hours poring over a sweat-stained document. So even if you owe -money, you can put in for an enormous refund and the agent will -probably give it to you, just to avoid an audit. What does he care? -It's not his money. - -- Dave Barry, "Sweating Out Taxes" -% -LETTERS TO THE EDITOR (The Times of London) - -Dear Sir, - -I am firmly opposed to the spread of microchips either to the home or -to the office. We have more than enough of them foisted upon us in -public places. They are a disgusting Americanism, and can only result -in the farmers being forced to grow smaller potatoes, which in turn -will cause massive unemployment in the already severely depressed -agricultural industry. - -Yours faithfully, - Capt. Quinton D'Arcy, J. P. - Sevenoaks -% -LEVERAGE: - Even if someone doesn't care what the world thinks - about them, they always hope their mother doesn't find out. -% -Leveraging always beats prototyping. -% -Lewis's Law of Travel: - The first piece of luggage out of the - chute doesn't belong to anyone, ever. -% -L'hazard ne favorise que l'esprit prepare. - -- L. Pasteur -% -Liar, n.: - A lawyer with a roving commission. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Liar: one who tells an unpleasant truth. - -- Oliver Herford -% -LIBERAL: - Someone too poor to be a capitalist and too rich to be a communist. -% -Liberals are the first to dump you if you con them or get into -trouble. Conservatives are better. They never run out on you. - -- Joseph "Crazy Joe" Gallo -% -Liberty don't work as good in practice as it does in speeches. - -- The Best of Will Rogers -% -Liberty is always dangerous, but it is the safest thing we have. - -- Harry Emerson Fosdick -% -LIBRA (Sep. 23 to Oct. 22) - Your desire for justice and truth will be overshadowed by your desire - for filthy lucre and a decent meal. Be gracious and polite. Someone - is watching you, so stop staring like that. -% -LIBRA (Sept 23 - Oct 23) - Major achievements, new friends, and a previously unexplored way - to make a lot of money will come to a lot of people today, but - unfortunately you won't be one of them. Consider not getting out - of bed today. -% -Lie, n.: - A very poor substitute for the truth, but the only one - discovered to date. -% -Lieberman's Law: - Everybody lies, but it doesn't matter since nobody listens. -% -Lies! All lies! You're all lying against my boys! - -- Ma Barker -% -LIFE: - A whim of several billion cells to be you for a while. -% -LIFE: - Learning about people the hard way -- by being one. -% -LIFE: - That brief interlude between nothingness and eternity. -% -Life -- Love It or Leave It. -% -Life begins at the centerfold and expands outward. - -- Miss November, 1966 -% -Life being what it is, one dreams of revenge. - -- Paul Gauguin -% -Life can be so tragic -- you're here today and here tomorrow. -% -Life does not begin at the moment of conception or the moment of birth. -It begins when the kids leave home and the dog dies. -% -Life exists for no known purpose. -% -Life in this society being, at best, an utter bore and no aspect of society -being at all relevant to women, there remains to civic-minded responsible -thrill-seeking females only to overthrow the government, eliminate the money -system, institute complete automation and destroy the male sex. - -- Valerie Solanas -% -Life is a biochemical reaction to the stimulus of the surrounding -environment in a stable ecosphere, while a bowl of cherries is a -round container filled with little red fruits on sticks. -% -Life is a concentration camp. You're stuck here and there's no way -out and you can only rage impotently against your persecutors. - -- Woody Allen -% -Life is a gamble at terrible odds, if it was a bet you wouldn't take it. - -- Tom Stoppard, "Rosencrantz and Guildenstern are Dead" -% -Life is a game. In order to have a game, something has to be more -important than something else. If what already is, is more important -than what isn't, the game is over. So, life is a game in which what -isn't, is more important than what is. Let the good times roll. - -- Werner Erhard -% -Life is a game of bridge -- and you've just been finessed. -% -Life is a glorious cycle of song, -A medley of extemporania; -And love is thing that can never go wrong; -And I am Marie of Roumania. - -- Dorothy Parker, "Comment" -% -Life is a grand adventure -- or it is nothing. - -- Helen Keller -% -Life is a healthy respect for mother nature laced with greed. -% -Life is a hospital in which every patient is possessed by the desire to -change his bed. - -- Charles Baudelaire -% -Life is a series of rude awakenings. - -- R. V. Winkle -% -Life is a serious burden, which no thinking, -humane person would wantonly inflict on someone else. - -- Clarence Darrow -% -Life is a sexually transferred disease with 100% mortality. -% -Life is a yo-yo, and mankind ties knots in the string. -% -Life is an exciting business, and most -exciting when it is lived for others. -% -Life is both difficult and time consuming. -% -Life is cheap, but the accessories can kill you. -% -Life is difficult because it is non-linear. -% -Life is divided into the horrible and the miserable. - -- Woody Allen, "Annie Hall" -% -Life is fraught with opportunities to keep your mouth shut. -% -Life is just a bowl of cherries, but why do I always get the pits? -% -Life is knowing how far to go without crossing the line. -% -Life is like a 10 speed bicycle. Most of us have gears we never use. - -- C. Schultz -% -Life is like a bowl of soup with hairs floating on it. You have to -eat it nevertheless. - -- Flaubert -% -Life is like a buffet; it's not good but there's plenty of it. -% -Life is like a diaper - short and loaded. -% -Life is like a sewer. -What you get out of it depends on what you put into it. - -- Tom Lehrer -% -Life is like a simile. -% -Life is like a tin of sardines. -We're, all of us, looking for the key. - -- Beyond the Fringe -% -Life is like an analogy. -% -Life is like an egg stain on your chin -- -you can lick it, but it still won't go away. -% -Life is like an onion: you peel it off -one layer at a time, and sometimes you weep. - -- Carl Sandburg -% -Life is like an onion: you peel off layer after -layer and then you find there is nothing in it. - -- James Huneker -% -Life is like arriving late for a movie, having to figure out what was -going on without bothering everybody with a lot of questions, and then -being unexpectedly called away before you find out how it ends. -% -Life is like bein' on a mule team. Unless you're -the lead mule, all the scenery looks about the same. -% -Life is not for everyone. -% -Life is one long struggle in the dark. - -- Titus Lucretius Carus -% -Life is the childhood of our immortality. - -- Johann Wolfgang von Goethe -% -Life is the living you do, -Death is the living you don't do. - -- Joseph Pintauro -% -Life is the urge to ecstasy. -% -Life is to you a dashing and bold adventure. -% -Life is too important to take seriously. - -- Corky Siegel -% -Life is too short to be taken seriously. - -- Oscar Wilde -% -Life is too short to stuff a mushroom. - -- Storm Jameson -% -Life is wasted on the living. - -- Douglas Adams, "The Restaurant at the Edge of the Universe" -% -Life is what happens to you while you're busy making other plans. - -- John Lennon, "Beautiful Boy" -% -Life, like beer, is merely borrowed. - -- Don Reed -% -Life, loathe it or ignore it, you can't like it. - -- Marvin, from - Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -Life may have no meaning, or, even worse, -it may have a meaning of which you disapprove. -% -Life only demands from you the strength you possess. -Only one feat is possible -- not to have run away. - -- Dag Hammarskjold -% -Life should not be a journey to the grave with the intention -of arriving safely in a pretty and well preserved body, but -rather to skid in broadside, thoroughly used up, totally worn out, -and loudly proclaiming --WOW---What A RIDE!! -% -Life Sucks. Cynical, misanthropic male, 34, looking for soul mate but -certain not to find her. Drop me a note. I'll call you, we'll talk and -I'll ask you out to dinner where I'll probably spend more than I can -afford in a feeble attempt to impress you. Then we'll realize we have -absolutely nothing in common and we'll go our separate ways, more -embittered and depressed than before (if such a thing is possible). -% -Life sucks, but death doesn't put out at all. - -- Thomas J. Kopp -% -Life to you is a bold and dashing responsibility. - -- a Mary Chung's fortune cookie -% -Life without caffeine is stimulating enough. - -- Sanka Ad -% -Life would be much simpler and things would get done much faster if it -weren't for other people. - -- Blore -% -Life would be so much easier if we could just look at the source code. - -- Dave Olson -% -Life would be tolerable but for its amusements. - -- George Bernard Shaw -% -Life's too short to dance with ugly women. -% -Lift every voice and sing -Till earth and heaven ring, -Ring with the harmonies of Liberty; -Let our rejoicing rise -High as the listening skies, -Let it resound loud as the rolling sea. - -Sing a song full of the faith that the dark past has taught us. -Sing a song full of the hope that the present has bought us. -Facing the rising sun of our new day begun, -Let us march on till victory is won. - -- James Weldon Johnson -% -Lighten up, while you still can, -Don't even try to understand, -Just find a place to make your stand, -And take it easy. - -- The Eagles, "Take It Easy" -% -LIGHTHOUSE: - A tall building on the seashore in which the government - maintains a lamp and the friend of a politician. -% -LIKE: - When being alive at the same time is a wonderful coincidence. -% -Like all young men, you greatly exaggerate -the difference between one young woman and another. - -- George Bernard Shaw, "Major Barbara" -% -Like an expensive sports car, fine-tuned and well-built, Portia was sleek, -shapely, and gorgeous, her red jumpsuit moulding her body, which was as warm -as seatcovers in July, her hair as dark as new tires, her eyes flashing like -bright hubcaps, and her lips as dewy as the beads of fresh rain on the hood; -she was a woman driven -- fueled by a single accelerant -- and she needed a -man, a man who wouldn't shift from his views, a man to steer her along the -right road: a man like Alf Romeo. - -- Rachel Sheeley, winner - -The hair ball blocking the drain of the shower reminded Laura she would never -see her little dog Pritzi again. - -- Claudia Fields, runner-up - -It could have been an organically based disturbance of the brain -- perhaps a -tumor or a metabolic deficiency -- but after a thorough neurological exam it -was determined that Byron was simply a jerk. - -- Jeff Jahnke, runner-up - -Winners in the 7th Annual Bulwer-Lytton Bad Writing Contest. The contest is -named after the author of the immortal lines: "It was a dark and stormy -night." The object of the contest is to write the opening sentence of the -worst possible novel. -% -Like corn in a field I cut you down, -I threw the last punch way too hard, -After years of going steady, well, I thought it was time, -To throw in my hand for a new set of cards. -And I can't take you dancing out on the weekend, -I figured we'd painted too much of this town, -And I tried not to look as I walked to my wagon, -And I knew then I had lost what should have been found, -I knew then I had lost what should have been found. - And I feel like a bullet in the gun of Robert Ford - I'm as low as a paid assassin is - You know I'm cold as a hired sword. - I'm so ashamed we can't patch it up, - You know I can't think straight no more - You make me feel like a bullet, honey, - a bullet in the gun of Robert Ford. - -- Elton John "I Feel Like a Bullet" -% -Like I said, love wouldn't be so blind if the braille -weren't so damned great! - -- Armistead Maupin -% -Like, if I'm not for me, then fer shure, like who will be? And if, y'know, -if I'm not like fer anyone else, then hey, I mean, what am I? And if not -now, like I dunno, maybe like when? And if not Who, then I dunno, maybe -like the Rolling Stones? - -- Rich Rosen (Rabbi Valiel's paraphrase of famous quote - attributed to Rabbi Hillel.) -% -Like my parents, I have never been a regular church member or churchgoer. -It doesn't seem plausible to me that there is the kind of God who watches -over human affairs, listens to prayers, and tries to guide people to follow -His precepts -- there is just too much misery and cruelty for that. On the -other hand, I respect and envy the people who get inspiration from their -religions. - -- Benjamin Spock -% -Like punning, programming is a play on words. -% -Like so many Americans, she was trying to construct -a life that made sense from things she found in gift shops. - -- Kurt Vonnegut, Jr. -% -Like the ski resort of girls looking for husbands and husbands looking -for girls, the situation is not as symmetrical as it might seem. - -- Alan McKay -% -Like the time I ran away... -And turned around and you were standing close to me. - -- YES, "Going For The One/Awaken" -% -Like winter snow on summer lawn, time past is time gone. -% -Like ya know? Rock 'N Roll is an esoteric language that unlocks the -creativity chambers in people's brains, and like totally activates their -essential hipness, which of course is like totally necessary for saving -the earth, like because the first thing in saving this world, is getting -rid of stupid and square attitudes and having fun. - -- Senior Year Quote -% -Like you, I am frequently haunted by profound questions related to man's -place in the Scheme of Things. Here are just a few: - - Q -- Is there life after death? - A -- Definitely. I speak from personal experience here. On New -Year's Eve, 1970, I drank a full pitcher of a drink called "Black Russian", -then crawled out on the lawn and died within a matter of minutes, which was -fine with me because I had come to realize that if I had lived I would have -spent the rest of my life in the grip of the most excruciatingly painful -headache. Thanks to the miracle of modern orange juice, I was brought back -to life several days later, but in the interim I was definitely dead. I -guess my main impression of the afterlife is that it isn't so bad as long -as you keep the television turned down and don't try to eat any solid foods. - -- Dave Barry -% -Likewise, the national appetizer, brine-cured herring with raw onions, -wins few friends, Germans excepted. - -- Darwin Porter, "Scandinavia On $50 A Day" -% -Lincoln was elected to Congress in 1846. -Kennedy exactly one hundred years later in 1946. - -Lincoln was elected president in November 1860. -Kennedy in November 1960. - -Lincoln had a secretary named Kennedy who urged him not to go to -the theatre. -Kennedy had a secretary named Lincoln who advised against his going -to Dallas. - -Booth shot Lincoln in a theatre and ran off into a warehouse. -Oswald shot Kennedy from a warehouse and ran off into a theatre. - -Lincoln was succeeded by a Southerner named Johnson. -Kennedy was succeeded by a Southerner named Johnson. - -The first Johnson was born in 1808. -The second Johnson was born in 1908. - - -- Alistair Cooke, "Letter From America", Nov. 26, 2001 -% -Line Printer paper is strongest at the perforations. -% -"Lines that are parallel meet at Infinity!" -Euclid repeatedly, heatedly, urged. - -Until he died, and so reached that vicinity: -in it he found that the damned things diverged. - -- Piet Hein -% -Linus: Hi! I thought it was you. - I've been watching you from way off... You're looking great! -Snoopy: That's nice to know. - The secret of life is to look good at a distance. -% -Linus: I guess it's wrong always to be worrying about tomorrow. - Maybe we should think only about today. -Charlie Brown: - No, that's giving up. I'm still hoping that yesterday - will get better. -% -Linus' Law: - There is no heavier burden than a great potential. -% -Lions in the street and roaming, -Dogs in heat, rabid, foaming, -A beast caged in the heart of the city. -The body of his mother lying in the summer ground, -He fled the town. -Went down south across the border, -Left the chaos and disorder -Back there, over his shoulder. -One morning he awoke in a green hotel, -A strange creature groaning beside him. -Sweat oozed from its shiny skin. -Is everybody in? The ceremony is about to begin. - -- Jim Morrison, "Celebration of the Lizard" -% -LISP: - To call a spade a thpade. -% -Lisp, Lisp, Lisp Machine, -Lisp Machine is Fun. -Lisp, Lisp, Lisp Machine, -Fun for everyone. -% -Lisp Users: -Due to the holiday next Monday, there will be no garbage collection. -% -Listen, there is no courage or any extra courage that I know of to find out -the right thing to do. Now, it is not only necessary to do the right thing, -but to do it in the right way and the only problem you have is what is the -right thing to do and what is the right way to do it. That is the problem. -But this economy of ours is not so simple that it obeys to the opinion of -bias or the pronouncements of any particular individual, even to the President. -This is an economy that is made up of 173 million people, and it reflects -their desires, they're ready to buy, they're ready to spend, it is a thing -that is too complex and too big to be affected adversely or advantageously -just by a few words or any particular -- say, a little this and that, or even -a panacea so alleged. - -- Dwight D. Eisenhower, in response to: "Has the - government been lacking in courage and boldness in - facing up to the recession?" -% -Literature is mostly about sex and not much about having children and life -is the other way round. - -- David Lodge, "The British Museum is Falling Down" -% -Littering is dumb. - -- Ronald Macdonald -% -Little Fly, -Thy summer's play If thought is life -My thoughtless hand And strength & breath, -Has brush'd away. And the want - Of thought is death, -Am not I -A fly like thee? Then am I -Or art not thou A happy fly -A man like me? If I live - Or if I die. - -For I dance -And drink & sing, -Till some blind hand -Shall brush my wing. - -- William Blake, "The Fly" -% -Little girls, like butterflies, need no excuse. - -- Lazarus Long -% -Little known fact about Middle Earth: The Hobbits had a very -sophisticated computer network! It was a Tolkien Ring... -% -Little Known Facts, #23: - Did you know... that if you dial 911 in Los Angeles you get - the BMW repair garage? -% -Little Mary on the ice, -Went out to have a frisk, -Now wasn't little Mary nice, -Her pretty *? -% -Live fast, die young, and leave a flat patch of fur on the highway! - -- The Squirrels' Motto (The "Hell's Angels of Nature") -% -Live fast, die young, and leave a good looking corpse. - -- James Dean -% -Live from New York ... It's Saturday Night! -% -Live in a world of your own, but always welcome visitors. -% -Live never to be ashamed if anything you do or say is -published around the world -- even if what is published is not true. - -- Messiah's Handbook: Reminders for the Advanced Soul -% -Live within your income, even if you have to borrow to do so. - -- Josh Billings -% -Living here in Rio, I have lots of coffees to choose from. And when -you're on the lam like me, you appreciate a good cup of coffee. - -- "Great Train Robber" Ronald Biggs' coffee commercial -% -Living in California is like living in a bowl of granola. -What ain't flakes and nuts is fruits. -% -Living in Hollywood is like living in a bowl of granola. -What ain't fruits and nuts is flakes. -% -Living in LA is like not having a date on Saturday night. - -- Candice Bergen -% -Living in New York City gives people real incentives -to want things that nobody else wants. - -- Andy Warhol -% -Living in the complex world of the future is somewhat -like having bees live in your head. But, there they are. -% -Living on Earth may be expensive, but it -includes an annual free trip around the Sun. -% -LIVING YOUR LIFE: - A task so difficult, it has never been attempted before. -% -Lizzie Borden took an axe, -And plunged it deep into the VAX; -Don't you envy people who -Do all the things _Y_O_U want to do? -% -Lo! Men have become the tool of their tools. - -- Henry David Thoreau -% -Loan-department manager: "There isn't any fine print. At these -interest rates, we don't need it." -% -Lobster: - Everyone loves these delectable crustaceans, but many cooks are squeamish - about placing them into boiling water alive, which is the only proper - method of preparing them. Frankly, the easiest way to eliminate your - guilt is to establish theirs by putting them on trial before they're - cooked. The fact is, lobsters are among the most ferocious predators on - the sea floor, and you're helping reduce crime in the reefs. Grasp the - lobster behind the head, look it right in its unmistakably guilty - eyestalks and say, "Where were you on the night of the 21st?", then - flourish a picture of a scallop or a sole and shout, "Perhaps this will - refresh that crude neural apparatus you call a memory!" The lobster will - squirm noticeably. It may even take a swipe at you with one of its claws. - Incorrigible. Pop it into the pot. Justice has been served, and shortly - you and your friends will be, too. - -- Dave Barry, Cooking: The Art of Turning Appliances - and Utensils into Excuses and Apologies -% -Lockwood's Long Shot: - The chances of getting eaten up by a lion on Main Street - aren't one in a million, but once would be enough. -% -Logic doesn't apply to the real world. - -- Marvin Minsky -% -Logic is a little bird, sitting in a tree; that smells *_a_w_f_u_l*. -% -Logic is a pretty flower that smells bad. -% -Logic is the chastity belt of the mind! -% -Logicians have but ill defined -As rational the human kind. -Logic, they say, belongs to man, -But let them prove it if they can. - -- Oliver Goldsmith -% -LOGO for the Dead - -LOGO for the Dead lets you continue your computing activities from -"The Other Side." - -The package includes a unique telecommunications feature which lets you -turn your TRS-80 into an electronic Ouija board. Then, using Logo's -graphics capabilities, you can work with a friend or relative on this -side of the Great Beyond to write programs. The software requires that -your body be hardwired to an analog-to-digital converter, which is then -interfaced to your computer. A special terminal (very terminal) program -lets you talk with the users through Deadnet, an EBBS (Ectoplasmic -Bulletin Board System). - -LOGO for the Dead is available for 10 percent of your estate -from NecroSoft inc., 6502 Charnelhouse Blvd., Cleveland, OH 44101. - -- '80 Microcomputing -% -Loneliness is a terrible price to pay for independence. -% -Lonely is a man without love. - -- Engelbert Humperdinck -% -Lonely men seek companionship. -Lonely women sit at home and wait. They never meet. -% -Lonesome? - -Like a change? -Like a new job? -Like excitement? -Like to meet new and interesting people? - -JUST SCREW-UP ONE MORE TIME!!!!!!! -% -Long ago I proposed that unsuccessful candidates for the Presidency -be quietly hanged, as a matter of public sanitation and decorum. -The sight of their grief must have a very evil effect upon the young. - -- H. L. Mencken, "A Carnival of Buncombe" -% -Long computations which yield zero are probably all for naught. -% -Long life is in store for you. -% -Long were the days of pain I have spent within its walls, and -long were the nights of aloneness; and who can depart from his -pain and his aloneness without regret? - -- Kahlil Gibran, "The Prophet" -% -Look! Before our very eyes, the future is becoming the past. -% -Look afar and see the end from the beginning. -% -Look at it this way: -Your daughter just named the fresh turkey you brought -home "Cuddles", so you're going out to buy a canned ham. -And you're still drinking ordinary scotch? -% -Look at it this way: -Your wife's spending $280 a month on meditation lessons to -forget $26,000 of college education. -And you're still drinking ordinary scotch? -% -Look before you leap. - -- Samuel Butler -% -Look ere ye leap. - -- John Heywood -% -Look out! Behind you! -% -Look up and not down, look forward and not back, look out and not in, -and lend a hand. - -- Edward Everett Hale, "Lowell Institute Lectures" (1869) -% -Look, we play the Star Spangled Banner before every game. You want us -to pay income taxes, too? - -- Bill Veeck, Chicago White Sox -% -Look, we trade every day out there with hustlers, deal-makers, shysters, -con-men. That's the way businesses get started. That's the way this -country was built. - -- Hubert Allen -% -Lookie, lookie, here comes cookie... - -- Stephen Sondheim -% -Loose bits sink chips. -% -Lord, defend me from my friends; I can account for my enemies. - -- Charles D'Hericault -% -Lord, what fools these mortals be! - -- William Shakespeare, "A Midsummer-Night's Dream" -% -Losing your drivers' license is just -God's way of saying "BOOGA, BOOGA!" -% -Lost: gray and white female cat. -Answers to electric can opener. -% -Lost interest? It's so bad I've lost apathy. -% -Lots of folks are forced to skimp to support a government that won't. -% -Lots of folks confuse bad management with destiny. - -- Frank Hubbard -% -Lots of girls can be had for a song. -Unfortunately, it often turns out to be the wedding march. -% -Loud burping while walking around the airport is prohibited in -Halstead, Kansas. -% -Louie Louie, me gotta go -Louie Louie, me gotta go - -Fine little girl she waits for me -Me catch the ship for cross the sea -Me sail the ship all alone Three nights and days me sail the sea -Me never thinks me make it home Me think of girl constantly -(chorus) On the ship I dream she there - I smell the rose in her hair -Me see Jamaica moon above (chorus, guitar solo) -It won't be long, me see my love -I take her in my arms and then -Me tell her I never leave again - -- The real words to The Kingsmen's classic "Louie Louie" -% -LOVE: - I'll let you play with my life if you'll let me play with yours. -% -LOVE: - Love ties in a knot in the end of the rope. -% -LOVE: - When, if asked to choose between your lover - and happiness, you'd skip happiness in a heartbeat. -% -LOVE: - When it's growing, you don't mind watering it with a few tears. -% -LOVE: - When you don't want someone too close-- - because you're very sensitive to pleasure. -% -LOVE: - When you like to think of someone on days that begin with a morning. -% -Love -- the last of the serious diseases of childhood. -% -Love ain't nothin' but sex misspelled. -% -Love America - or give it back. -% -Love and scandal are the best sweeteners of tea. -% -Love at first sight is one of the greatest -labor-saving devices the world has ever seen. -% -Love cannot be much younger than the lust for murder. - -- Sigmund Freud -% -Love conquers all things; let us too surrender to love. - -- Publius Vergilius Maro (Virgil) -% -Love in your heart wasn't put there to stay. -Love isn't love 'til you give it away. - -- Oscar Hammerstein II -% -Love is a grave mental disease. - -- Plato -% -Love is a slippery eel that bites like hell. - -- Matt Groening -% -Love is a snowmobile racing across the tundra, which suddenly flips -over, pinning you underneath. At night the ice weasels come. - -- Matt Groening, "Love is Hell" -% -Love is a word that is constantly heard, -Hate is a word that is not. -Love, I am told, is more precious than gold. -Love, I have read, is hot. -But hate is the verb that to me is superb, -And Love but a drug on the mart. -Any kiddie in school can love like a fool, -But Hating, my boy, is an Art. - -- Ogden Nash -% -Love is always open arms. With arms open you allow love to come and -go as it wills, freely, for it will do so anyway. If you close your -arms about love you'll find you are left only holding yourself. -% -Love is an ideal thing, marriage a real thing; a confusion of the real -with the ideal never goes unpunished. - -- Johann Wolfgang von Goethe -% -Love is an obsessive delusion that is cured by marriage. - -- Dr. Karl Bowman -% -Love is being stupid together. - -- Paul Valery -% -Love is dope, not chicken soup. I mean, love is something to be passed -around freely, not spooned down someone's throat for their own good by a -Jewish mother who cooked it all by herself. -% -Love is in the offing. - -- The Homicidal Maniac -% -Love is in the offing. Be affectionate to one who adores you. -% -Love is like a friendship caught on fire. In the beginning a flame, very -pretty, often hot and fierce, but still only light and flickering. As love -grows older, our hearts mature and our love becomes as coals, deep-burning -and unquenchable. - -- Bruce Lee -% -Love is like the measles; we all have to go through it. - -- Jerome K. Jerome -% -Love is never asking why? -% -Love is not enough, but it sure helps. -% -Love is sentimental measles. -% -Love is staying up all night with a sick child, or a healthy adult. -% -Love is the answer; but while you are waiting for the answer, sex -raises some pretty good questions. - -- Woody Allen -% -Love is the delusion that one woman differs from another. - -- H. L. Mencken -% -Love is the desire to prostitute oneself. There is, indeed, no exalted -pleasure that cannot be related to prostitution. - -- Charles Baudelaire -% -Love is the only game that is not called on account of darkness. - -- M. Hirschfield -% -Love is the process of my leading you gently back to yourself. - -- Antoine de Saint-Exupery -% -Love is the triumph of imagination over intelligence. - -- H. L. Mencken -% -Love IS what it's cracked up to be. -% -Love is what you've been through with somebody. - -- James Thurber -% -Love isn't only blind, it's also deaf, dumb, and stupid. -% -Love makes fools, marriage cuckolds, and patriotism malevolent imbeciles. - -- Paul Leautaud, "Passe-temps" -% -Love makes the world go 'round, with a little help from intrinsic angular -momentum. -% -Love may laugh at locksmiths, but he has a profound respect for money bags. - -- Sidney Paternoster, "The Folly of the Wise" -% -Love means having to say you're sorry every five minutes. -% -Love means never having to say you're sorry. - -- Eric Segal, "Love Story" - -That's the most ridiculous thing I've ever heard. - -- Ryan O'Neill, "What's Up Doc?" -% -Love means nothing to a tennis player. -% -Love tells us many things that are not so. - -- Krainian proverb -% -Love the sea? I dote upon it -- from the beach. -% -Love thy neighbor as thyself, but choose your neighborhood. - -- Louise Beal -% -Love thy neighbor, tune thy piano. -% -Love to eat them mousies, -Mousies I love to eat. -Bite they little heads off, -Nibble at they tiny feet. - -- Kliban -% -Love, which is quickly kindled in a gentle heart, - seized this one for the fair form - that was taken from me-and the way of it afflicts me still. -Love, which absolves no loved one from loving, - seized me so strongly with delight in him, - that, as you see, it does not leave me even now. -Love brought us to one death. - -- La Divina Commedia: Inferno V, vv. 100-06 -% -Love your enemies: they'll go crazy -trying to figure out what you're up to. -% -Love your neighbour, yet don't pull down your hedge. - -- Benjamin Franklin -% -Lowery's Law: - If it jams -- force it. If it - breaks, it needed replacing anyway. -% -LSD melts in your mind, not in your hand. -% -Lubarsky's Law of Cybernetic Entomology: - There's always one more bug. -% -Lucas is the source of many of the components of the legendarily reliable -British automotive electrical systems. Professionals call the company "The -Prince of Darkness". Of course, if Lucas were to design and manufacture -nuclear weapons, World War III would never get off the ground. The British -don't like warm beer any more than the Americans do. The British drink warm -beer because they have Lucas refrigerators. -% -Luck can't last a lifetime, unless you die young. - -- Russell Banks -% -Luck, that's when preparation and opportunity meet. - -- P. E. Trudeau -% -Lucky, adj.: - When you have a wife and a cigarette - lighter -- both of which work. -% -Lucky is he for whom the belle toils. -% -Lucy: Dance, dance, dance. That is all you ever do. - Can't you be serious for once? -Snoopy: She is right! I think I had better think - of the more important things in life! - (pause) - Tomorrow!! -% -Luke, I'm yer father, eh. Come over to the dark side, you hoser. - -- Dave Thomas, "Strange Brew" -% -Lunatic Asylum, n.: - The place where optimism most flourishes. -% -Lying is an indispensable part of making life tolerable. - -- Bergan Evans -% -Lysistrata had a good idea. -% -Ma Bell is a mean mother! -% -MAC user's dynamic debugging list evaluator? Never heard of that. -% -Machine-Independent, adj.: - Does not run on any existing machine. -% -Machine-independent program: - A program that will not run on any machine. -% -Machines certainly can solve problems, store information, correlate, -and play games -- but not with pleasure. - -- Leo Rosten -% -Machines have less problems. I'd like to be a machine. - -- Andy Warhol -% -Machines that have broken down will work perfectly when the -repairman arrives. -% -Macho does not prove mucho. - -- Zsa Zsa Gabor -% -Mad, adj.: - Affected with a high degree of intellectual independence. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Madam, there's no such thing as a tough child -- -if you parboil them first for seven hours, they always come out tender. - -- W. C. Fields -% -Madison's Inquiry: - If you have to travel on the Titanic, why not go first class? -% -Madness takes its toll. -% -MAFIA, n.: - [Acronym for Mechanized Applications in Forced Insurance -Accounting.] An extensive network with many on-line and offshore -subsystems running under OS, DOS, and IOS. MAFIA documentation is -rather scanty, and the MAFIA sales office exhibits that testy -reluctance to bona fide inquiries which is the hallmark of so many DP -operations. From the little that has seeped out, it would appear that -MAFIA operates under a non-standard protocol, OMERTA, a tight-lipped -variant of SNA, in which extended handshakes also perform complex -security functions. The known timesharing aspects of MAFIA point to a -more than usually autocratic operating system. Screen prompts carry an -imperative, nonrefusable weighting (most menus offer simple YES/YES -options, defaulting to YES) that precludes indifference or delay. -Uniquely, all editing under MAFIA is performed centrally, using a -powerful rubout feature capable of erasing files, filors, filees, and -entire nodal aggravations. - -- Stan Kelly-Bootle, "The Devil's DP Dictionary" -% -Magary's Principle: - When there is a public outcry to cut deadwood and fat from any - government bureaucracy, it is the deadwood and the fat that do - the cutting, and the public's services are cut. -% -Magic is always the best solution -- especially reliable magic. -% -Magnet, n.: Something acted upon by magnetism - -Magnetism, n.: Something acting upon a magnet. - -The two definitions immediately foregoing are condensed from the works -of one thousand eminent scientists, who have illuminated the subject -with a great white light, to the inexpressible advancement of human -knowledge. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Magnocartic, adj.: - Any automobile that, when left unattended, attracts shopping - carts. - -- Rich Hall, "Sniglets" -% -Magpie, n.: - A bird whose thievish disposition suggested - to someone that it might be taught to talk. - -- Ambrose Bierce, "The Devil's Dictionary" -% -MAIDEN AUNT: - A girl who never had the sense to say "uncle." -% -Maiden, n.: - A young person of the unfair sex addicted to clewless conduct and - views that madden to crime. The genus has a wide geographical - distribution, being found wherever sought and deplored wherever found. - The maiden is not altogether unpleasing to the eye, nor (without her - piano and her views) insupportable to the ear, though in respect to - comeliness distinctly inferior to the rainbow, and, with regard to - the part of her that is audible, beaten out of the field by the - canary -- which, also, is more portable. - -Male, n.: - A member of the unconsidered, or negligible sex. The male of the - human race is commonly known to the female as Mere Man. The genus - has two varieties: good providers and bad providers. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Maier's Law: - If the facts do not conform to the theory, they must be disposed of. - -- N. R. Maier, "American Psychologist", March 1960 - -Corollaries: - 1. The bigger the theory, the better. - 2. The experiment may be considered a success if no more than - 50% of the observed measurements must be discarded to - obtain a correspondence with the theory. -% -Main's Law: - For every action there is an equal and opposite government program. -% -Maintainer's Motto: - If we can't fix it, it ain't broke. -% -Maj. Bloodnok: Seagoon, you're a coward! -Seagoon: Only in the holiday season. -Maj. Bloodnok: Ah, another Noel Coward! -% -Major premise: - Sixty men can do sixty times as much work as one man. -Minor premise: - A man can dig a posthole in sixty seconds. -Conclusion: - Sixty men can dig a posthole in one second. - -Secondary Conclusion: - Do you realize how many holes there would be if people - would just take the time to take the dirt out of them? -% -Major Premise: Sixty men can do a piece of work sixty times as quickly - as one man. - -Minor Premise: One man can dig a posthole in sixty seconds. - -Conclusion: Sixty men can dig a posthole in one second. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Majorities, of course, start with minorities. - -- Robert Moses -% -Majority, n.: - That quality that distinguishes a crime from a law. -% -Make a wish, it might come true. -% -Make headway at work. Continue to let things deteriorate at home. -% -Make it myself? But I'm a physical organic chemist! -% -Make it right before you make it faster. -% -Make no little plans; they have no magic to stir men's blood. - -- Daniel Hudson Burnham -% -Make sure your code does nothing gracefully. -% -Make war not sex. (It's safer.) -% -Making files is easy under the UNIX operating system. Therefore, users -tend to create numerous files using large amounts of file space. It has -been said that the only standard thing about all UNIX systems is the -message-of-the-day telling users to clean up their files. - -- System V.2 administrator's guide -% -Malek's Law: - Any simple idea will be worded in the most complicated way. -% -MALPRACTICE: - The reason surgeons wear masks. -% -Man 1: Ask me. "What is the most important thing about telling a good - joke?" - -Man 2: OK, what is the most impo -- - -Man 1: _T_I_M_I_N_G! -% -Man and wife make one fool. -% -Man belongs wherever he wants to go. - -- Wernher von Braun -% -Man has always assumed that he is more intelligent than dolphins because -he has achieved so much -- the wheel, New York, wars and so on -- while -all the dolphins had ever done was muck about in the water having a good -time. But, conversely, the dolphins had always believed that they were -far more intelligent than man -- for precisely the same reasons. - -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -Man has made his bedlam; let him lie in it. - -- Fred Allen -% -Man has never reconciled himself to the ten commandments. -% -Man invented language to satisfy his deep need to complain. - -- Lily Tomlin -% -Man is a military animal, -Glories in gunpowder, and loves parade. - -- P. J. Bailey -% -Man is a rational animal who always loses his temper when he is called upon -to act in accordance with the dictates of reason. - -- Oscar Wilde -% -Man is an animal that makes bargains: no other animal does this-- -no dog exchanges bones with another. - -- Adam Smith -% -Man is by nature a political animal. - -- Aristotle -% -Man is the best computer we can put aboard a spacecraft... -and the only one that can be mass produced with unskilled labor. - -- Wernher von Braun -% -Man is the measure of all things. - -- Protagoras -% -Man is the only animal that blushes -- or needs to. - -- Mark Twain -% -Man is the only animal that can remain on friendly terms -with the victims he intends to eat until he eats them. - -- Samuel Butler (1835-1902) -% -Man is the only animal that laughs and weeps; -for he is the only animal that is struck with the -difference between what things are and what they ought to be. - -- William Hazlitt -% -Man must shape his tools lest they shape him. - -- Arthur R. Miller -% -Man, n.: - An animal so lost in rapturous contemplation of what he thinks - he is as to overlook what he indubitably ought to be. His chief - occupation is extermination of other animals and his own - species, which, however, multiplies with such insistent rapidity - as to infest the whole habitable earth and Canada. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Man proposes, God disposes. - -- Thomas a Kempis -% -Man usually avoids attributing cleverness to somebody else -- unless it -is an enemy. - -- Albert Einstein -% -Man who arrives at party two hours late -will find he has been beaten to the punch. -% -Man who falls in blast furnace is certain to feel overwrought. -% -Man who falls in vat of molten optical glass makes spectacle of self. -% -Man who sleep in beer keg wake up stickey. -% -Man will never fly. -Space travel is merely a dream. -All aspirin is alike. -% -Management: How many feet do mice have? -Reply: Mice have four feet. -M: Elaborate! -R: Mice have five appendages, and four of them are feet. -M: No discussion of fifth appendage! -R: Mice have five appendages; four of them are feet; one is a tail. -M: What? Feet with no legs? -R: Mice have four legs, four feet, and one tail per unit-mouse. -M: Confusing -- is that a total of 9 appendages? -R: Mice have four leg-foot assemblies and one tail assembly per body. -M: Does not fully discuss the issue! -R: Each mouse comes equipped with four legs and a tail. Each leg - is equipped with a foot at the end opposite the body; the tail - is not equipped with a foot. -M: Descriptive? Yes. Forceful NO! -R: Allotment of appendages for mice will be: Four foot-leg assemblies, - one tail. Deviation from this policy is not permitted as it would - constitute misapportionment of scarce appendage assets. -M: Too authoritarian; stifles creativity! -R: Mice have four feet; each foot is attached to a small leg joined - integrally with the overall mouse structural sub-system. Also - attached to the mouse sub-system is a thin tail, non-functional and - ornamental in nature. -M: Too verbose/scientific. Answer the question! -R: Mice have four feet. -% -MANAGEMENT: - The art of getting other people to do all the work. -% -MANAGER: - A man known for giving great meeting. -% -Mandrell: "You know what I think?" -Doctor: "Ah, ah that's a catch question. With a brain your size you - don't think, right?" - -- "Doctor Who" -% -Man-hour, n.: - A sexist, obsolete measure of macho effort, equal to 60 Kiplings. -% -Manic-depressive, n.: - Easy glum, easy glow. -% -Mankind is poised midway between the gods and the beasts. - -- Plotinus -% -Mankind's yearning to engage in sports is older than recorded history, -dating back to the time millions of years ago, when the first primitive -man picked up a crude club and a round rock, tossed the rock into the -air, and whomped the club into the sloping forehead of the first -primitive umpire. - -What inner force drove this first athlete? Your guess is as good as -mine. Better, probably, because you haven't had four beers. - -- Dave Barry, "Sports is a Drag" -% -Manly's Maxim: - Logic is a systematic method of coming to the wrong conclusion - with confidence. -% -Man's horizons are bounded by his vision. -% -Man's reach must exceed his grasp, for why else the heavens? -% -Man's unique agony as a species consists in his perpetual -conflict between the desire to stand out and the need to blend in. - -- Sydney J. Harris -% -Manual, n.: - A unit of documentation. There are always three or more on a given - item. One is on the shelf; someone has the others. The information - you need is in the others. - -- Ray Simard -% -Many a bum show has been saved by the flag. - -- George M. Cohan -% -Many a family tree needs trimming. -% -Many a long dispute between divines may thus be abridged: It is so. It -is not so. It is so. It is not so. - -- Benjamin Franklin, "Poor Richard's Almanack" -% -Many a man that can't direct you to a corner drugstore will -get a respectful hearing when age has further impaired his mind. - -- Finley Peter Dunne -% -Many a town that didn't have enough work to support a single lawyer -can easily support two or more. -% -Many a writer seems to think he is never profound -except when he can't understand his own meaning. - -- George D. Prentice -% -Many are called, few are chosen. -Fewer still get to do the choosing. -% -Many are called, few volunteer. -% -Many are cold, but few are frozen. -% -Many changes of mind and mood; do not hesitate too long. -% -Many companies that have made themselves dependent on [the equipment of a -certain major manufacturer] (and in doing so have sold their soul to the -devil) will collapse under the sheer weight of the unmastered complexity of -their data processing systems. - -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5 -% -Many enraged psychiatrists are inciting a weary butcher. The butcher is -weary and tired because he has cut meat and steak and lamb for hours and -weeks. He does not desire to chant about anything with raving psychiatrists, -but he sings about his gingivectomist, he dreams about a single cosmologist, -he thinks about his dog. The dog is named Herbert. - -- Racter, "The Policeman's Beard is Half-Constructed" -% -Many hands make light work. - -- John Heywood -% -Many husbands go broke on the money their wives save on sales. -% -Many mental processes admit of being roughly measured. For instance, -the degree to which people are bored, by counting the number of their -fidgets. I not infrequently tried this method at the meetings of the -Royal Geographical Society, for even there dull memoirs are occasionally -read. [...] The use of a watch attracts attention, so I reckon time -by the number of my breathings, of which there are 15 in a minute. They -are not counted mentally, but are punctuated by pressing with 15 fingers -successively. The counting is reserved for the fidgets. These observations -should be confined to persons of middle age. Children are rarely still, -while elderly philosophers will sometimes remain rigid for minutes altogether. - -- Francis Galton, 1909 -% -Many of the characters are fools and they are always playing -tricks on me and treating me badly. - -- Jorge Luis Borges, from "Writers on Writing" by Jon Winokur -% -Many of the convicted thieves Parker has met began their -life of crime after taking college Computer Science courses. - -- Roger Rapoport, "Programs for Plunder", Omni, March 1981 -% -Many pages make a thick book. -% -Many pages make a thick book, except for pocket Bibles which are on very -thin paper. -% -Many people are desperately looking for some wise advice -which will recommend that they do what they want to do. -% -Many people are secretly interested in life. -% -Many people are unenthusiastic about their work. -% -Many people are unenthusiastic about your work. -% -Many people feel that if you won't let -them make you happy, they'll make you suffer. -% -Many people feel that they deserve some kind of -recognition for all the bad things they haven't done. -% -Many people resent being treated like the person they really are. -% -Many people would rather die than think; in fact, most do. - -- Bertrand Russell -% -Many people write memos to tell you they have nothing to say. -% -Many receive advice, few profit by it. - -- Publilius Syrus -% -Many years ago in a period commonly known as Next Friday Afternoon, -there lived a King who was very Gloomy on Tuesday mornings because he -was so Sad thinking about how Unhappy he had been on Monday and how -completely Mournful he would be on Wednesday ... - -- Walt Kelly -% -Margaret, are you grieving -Over Goldengrove unleaving? -Leaves, like the things of man, -You, with your fresh thoughts -Care for, can you? -Ah! as the heart grows older -It will come to such sights colder -By and by, nor spare a sigh -Though worlds of wanwood leafmeal lie -And yet you will weep and know why. -Now no matter, child, the name -Sorrow's springs are the same: -It is the blight man was born for, -It is Margaret you mourn for. - -- Gerard Manley Hopkins -% -Marigold: Jealousy -Mint: Virute -Orange blossom: Your purity equals your loveliness -Orchid: Beauty, magnificence -Pansy: Thoughts -Peach blossom: I am your captive -Petunia: Your presence soothes me -Poppy: Sleep -Rose, any color: Love -Rose, deep red: Bashful shame -Rose, single, pink: Simplicity -Rose, thornless, any: Early attachment -Rose, white: I am worthy of you -Rose, yellow: Decrease of love, rise of jealousy -Rosebud, white: Girlhood, and a heart ignorant of love -Rosemary: Remembrance -Sunflower: Haughtiness -Tulip, red: Declaration of love -Tulip, yellow: Hopeless love -Violet, blue: Faithfulness -Violet, white: Modesty -Zinnia: Thoughts of absent friends - * An upside-down blossom reverses the meaning. -% -Marijuana is nature's way of saying, "Hi!". -% -Marijuana will be legal some day, because the many law students -who now smoke pot will someday become congressmen and legalize -it in order to protect themselves. - -- Lenny Bruce -% -Mark's Dental-Chair Discovery: - Dentists are incapable of asking questions - that require a simple yes or no answer. -% -MARRIAGE: - An old, established institution, entered into by two people deeply - in love and desiring to make a commitment to each other expressing - that love. In short, commitment to an institution. -% -MARRIAGE: - Convertible bonds. -% -Marriage always demands the greatest understanding of the art of -insincerity possible between two human beings. - -- Vicki Baum -% -Marriage causes dating problems. -% -Marriage, in life, is like a duel in the midst of a battle. - -- Edmond About -% -Marriage is a ghastly public confession of a strictly private intention. -% -Marriage is a great institution -- but I'm -not ready for an institution yet. - -- Mae West -% -Marriage is a lot like the army, everyone complains, but you'd be -surprised at the large number that re-enlist. - -- James Garner -% -Marriage is a romance in which the hero dies in the first chapter. -% -Marriage is a three ring circus: -engagement ring, wedding ring, and suffering. - -- Roger Price -% -Marriage is an institution in which two undertake -to become one, and one undertakes to become nothing. -% -Marriage is based on the theory that when a man discovers a brand of beer -exactly to his taste he should at once throw up his job and go to work -in the brewery. - -- George Jean Nathan -% -Marriage is learning about women the hard way. -% -Marriage is like twirling a baton, turning handsprings, or eating with -chopsticks. It looks easy until you try it. -% -Marriage is low down, but you spend the rest of your life paying for it. - -- Baskins -% -Marriage is not merely sharing the fettuccine, but sharing the -burden of finding the fettuccine restaurant in the first place. - -- Calvin Trillin -% -Marriage is the only adventure open to the cowardly. - -- Voltaire -% -Marriage is the process of finding out what -kind of man your wife would have preferred. -% -Marriage is the waste-paper basket of the emotions. -% -Marriage, n.: - The evil aye. -% -Marriages are made in heaven and consummated on earth. - -- John Lyly -% -Marry in haste and everyone starts counting the months. -% -MARTA SAYS THE INTERESTING thing about fly-fishing is that its two lives -connected by a thin strand. - -Come on, Marta, grow up. - -- Jack Handey, "The New Mexican" (1988) -% -MARTA WAS WATCHING THE FOOTBALL GAME with me when she said, "You know most -of these sports are based on the idea of one group protecting its -territory from invasion by another group." - -"Yeah," I said, trying not to laugh. Girls are funny. - -- Jack Handey, "The New Mexican" (1988) -% -Martin was probably ripping them off. That's some family, isn't it? -Incest, prostitution, fanaticism, software. - -- Charles Willeford, "Miami Blues" -% -'Martyrdom' is the only way a person can become famous without ability. - -- George Bernard Shaw -% -Marvelous! The super-user's going to boot me! -What a finely tuned response to the situation! -% -Marvin the Nature Lover spied a grasshopper hopping along in the grass, -and in a mood for communing with nature, rare even among full-fledged -Nature Lovers, he spoke to the grasshopper, saying: "Hello, friend -grasshopper. Did you know they've named a drink after you?" - "Really?" replied the grasshopper, obviously pleased. "They've -named a drink Fred?" -% -Marxist Law of Distribution of Wealth: - Shortages will be divided equally among the peasants. -% -Mary had a little lamb, its fleece was white as snow, -And everywhere that Mary went, the lamb was sure to go. -It followed her through rain or snow, lightning, sleet or hail. -It fetched the evening paper, her slippers, and the mail. -She never had a moments peace; the lamb was always on her heels, -And on her feet its head would rest, while she ate her meals. -It followed her to school one day, the devotion never ended. -The lamb waltzed into her history class and Mary got suspended. -The night she went to Senior Prom, she thought she had him beat, -Until she heard a mournful "Baaa" coming from her car's seat. -Oh, Mary had a little lamb, it surely didn't please her. -So for dinner she had lambchops; the rest is in the freezer. - -- Alma Garcia -% -Maryann's Law: - You can always find what you're not looking for. -% -Maryel brought her bat into Exit once and started whacking people on -the dance floor. Now everyone's doing it. It's called grand slam -dancing. - -- Ransford, Chicago Reader 10/7/83 -% -Maslow's Maxim: - If the only tool you have is a hammer, - you treat everything like a nail. -% -Mason's First Law of Synergism: -The one day you'd sell your soul for something, souls are a glut. -% -Massachusetts has the best politicians money can buy. -% -Mastery of UNIX, like mastery of language, offers real freedom. The -price of freedom is always dear, but there's no substitute. - -- Thomas Scoville -% -Masturbation is the thinking man's television. - -- Christopher Hampton -% -Mate, this parrot wouldn't VOOM if you put four million volts through it! - -- Monty Python -% -Mater artium necessitas. - [Necessity is the mother of invention]. -% -Maternity pay? Now every Tom, Dick and Harry will get pregnant. - -- Malcolm Smith -% -MATH AND ALCOHOL DON'T MIX! - Please, don't drink and derive. - - Mathematicians - Against - Drunk - Deriving -% -Math is like love -- a simple idea but it can get complicated. - -- R. Drabek -% -Mathematician, n.: - Some one who believes imaginary things appear right before your i's. -% -Mathematicians are like Frenchmen: whatever you say to them they translate -into their own language, and forthwith it is something entirely different. - -- Johann Wolfgang von Goethe -% -Mathematicians often resort to something called Hilbert space, which is -described as being n-dimensional. Like modern sex, any number can -play. - -- Dr. Thor Wald, in "Beep/The Quincunx of Time", by - James Blish -% -Mathematicians practice absolute freedom. - -- Henry Adams -% -Mathematics deals exclusively with the relations of concepts -to each other without consideration of their relation to experience. - -- Albert Einstein -% -Mathematics is the only science where one never knows what -one is talking about nor whether what is said is true. - -- Russell -% -Mathematics, rightly viewed, possesses not only truth but supreme beauty -- -a beauty cold and austere, like that of a sculpture, without appeal to any -part of our weaker nature, without the gorgeous trapping of painting or music, -yet sublimely pure, and capable of a stern perfection such as only the -greatest art can show. The true spirit of delight, the exaltation, the sense -of being more than man, which is the touchstone of the highest excellence, is -to be found in mathematics as surely as in poetry. - -- Bertrand Russell -% -Matrimony is the root of all evil. -% -Matrimony isn't a word, it's a sentence. -% -Matter cannot be created or destroyed, -nor can it be returned without a receipt. -% -Matter will be damaged in direct proportion to its value. -% -[Maturity consists in the discovery that] there comes a critical moment -where everything is reversed, after which the point becomes to understand -more and more that there is something which cannot be understood. - -- S. A. Kierkegaard (1813-1855) -% -Maturity is only a short break in adolescence. - -- Jules Feiffer -% -Matz's Law: - A conclusion is the place where you got tired of thinking. -% -May a hundred thousand midgets invade your home singing cheezy lounge-lizard -versions of songs from The Wizard of Oz. -% -May a Misguided Platypus lay its Eggs in your Jockey Shorts -% -May all your Emus lay soft boiled eggs, and may all your -Kangaroos be born with iPods already fitted. - -- Aussie New Years wish, found on hasselbladinfo.com -% -May all your PUSHes be POPped. -% -May Euell Gibbons eat your only copy of the manual! -% -May the bluebird of happiness twiddle your bits. -% -May the Fleas of a Thousand Camels infest one of your Erogenous Zones. -% -May the fleas of a thousand camels infest your armpits. -% -May those that love us love us; and those that don't love us, may -God turn their hearts; and if he doesn't turn their hearts, may -he turn their ankles so we'll know them by their limping. -% -May you die in bed at 95, shot by a jealous spouse. -% -May you have many beautiful and obedient daughters. -% -May you have many handsome and obedient sons. -% -May you have warm words on a cold evening, -a full moon on a dark night, -and a smooth road all the way to your door. -% -May you live in uninteresting times. - -- Chinese proverb -% -May your camel be as swift as the wind. -% -May your SO always know when you need a hug. -% -May your Tongue stick to the Roof of your -Mouth with the Force of a Thousand Caramels. -% -Maybe ain't ain't so correct, but I notice that -lots of folks who ain't using ain't ain't eatin' well. - -- Will Rogers -% -Maybe Computer Science should be in the College of Theology. - -- R. S. Barton -% -Maybe Jesus was right when he said that the meek shall inherit the -earth -- but they inherit very small plots, about six feet by three. - -- Lazarus Long -% -Maybe we can get together and show off to each other sometimes. -% -Maybe we should think of this as one perfect week... where we found each -other, and loved each other... and then let each other go before anyone -had to seek professional help. -% -Maybe you can't buy happiness, but -these days you can certainly charge it. -% -May's Law: - The quality of correlation is inversely proportional to the density - of control. (The fewer the data points, the smoother the curves.) -% -McDonald's -- Because you're worth it. -% -McEwan's Rule of Relative Importance: - When traveling with a herd of elephants, - don't be the first to lie down and rest. -% -Meader's Law: - Whatever happens to you, it will previously - have happened to everyone you know, only more so. -% -Meade's Maxim: -Always remember that you are absolutely unique, -just like everyone else. -% -Meanehwael, baccat meaddehaele, monstaer lurccen; -Fulle few too many drincce, hie luccen for fyht. -[D]en Hreorfneorht[d]hwr, son of Hrwaerow[p]heororthwl, -AEsccen aewful jeork to steop outsyd. -[P]hud! Bashe! Crasch! Beoom! [D]e bigge gye -Eallum his bon brak, byt his nose offe; -Wicced Godsylla waeld on his asse. -Monstaer moppe fleor wy[p] eallum men in haelle. -Beowulf in bacceroome fonecall bemaccen waes; -Hearen sond of ruccus saed, "Hwaet [d]e helle?" -Graben sheold strang ond swich-blaed scharp -Sond feorth to fyht [d]e grimlic foe. -"Me," Godsylla saed, "mac [d]e minsemete." -Heoro cwyc geten heold wi[p] faemed half-nelson -Ond flyng him lic frisbe bac to fen. -Beowulf belly up to meaddehaele bar, -Saed, "Ne foe beaten mie faersom cung-fu." -Eorderen cocca-colha yce-coeld, [d]e reol [p]yng. -% -Meantime, in the slums below Ronnie's Ranch, Cynthia feels as if some one -has made voodoo boxen of her and her favorite backplanes. On this fine -moonlit night, some horrible persona has been jabbing away at, dragging -magnets over, and surging these voodoo boxen. Fortunately, they seem to -have gotten a bit bored and fallen asleep, for it looks like Cynthia may -get to go home. However, she has made note to quickly put together a totem -of sweaty, sordid static straps, random bits of wire, flecks of once meaningful -oxide, bus grant cards, gummy worms, and some bits of old pdp backplane to -hang above the machine room. This totem must be blessed by the old and wise -venerable god of unibus at once, before the idolatization of vme, q and pc -bus drive him to bitter revenge. Alas, if this fails, and the voodoo boxen -aren't destroyed, there may be more than worms in the apple. Next, the -arrival of voodoo optico transmitigational magneto killer paramecium, capable -of teleporting from cable to cable, screen to screen, ear to ear and hoof -to mouth... -% -Measure twice, cut once. -% -Mediocrity finds safety in standardization. - -- Frederick Crane -% -Meekness is uncommon patience in planning a worthwhile revenge. -% -Meester, do you vant to buy a duck? -% -Meeting, n.: - An assembly of people coming together to decide what person or - department not represented in the room must solve a problem. -% -MEETINGS: - A place where minutes are kept and hours are lost. -% -Meetings are an addictive, highly self indulgent activity that -corporations and other large organizations habitually engage -in only because they cannot actually masturbate. - -- Dave Barry -% -MEMO: - An interoffice communication too often written more for - the benefit of the person who sends it than the person - who receives it. -% -MEMORIES OF MY FAMILY MEETINGS still are a source of strength to me. I -remember we'd all get into the car -- I forget what kind it was -- and -drive and drive. - -I'm not sure where we'd go, but I think there were some bees there. The -smell of something was strong in the air as we played whatever sport we -played. I remember a bigger, older guy whom we called "Dad." We'd eat -some stuff or not and then I think we went home. - -I guess some things never leave you. - -- Jack Handey, "The New Mexican" (1988) -% -Memory fault -- brain fried -% -Memory fault -- core...uh...um...core... Oh dammit, I forget! -% -Memory fault - where am I? -% -Memory should be the starting point of the present. -% -Men are always ready to respect anything that bores them. - -- Marilyn Monroe -% -Men are superior to women. - -- The Koran -% -Men are those creatures with two legs and eight hands. - -- Jayne Mansfield -% -Men aren't attracted to me by my mind. -They're attracted by what I don't mind... - -- Gypsy Rose Lee -% -Men freely believe that what they wish to desire. - -- Julius Caesar -% -Men have a much better time of it than women; for one -thing they marry later; for another thing they die earlier. - -- H. L. Mencken -% -Men have as exaggerated an idea of their -rights as women have of their wrongs. - -- Edgar W. Howe -% -Men live for three things, fast cars, fast women and fast food. -% -Men love to wonder, and that is the seed of science. -% -Men never do evil so completely and cheerfully as when they do it -from religious conviction. - -- Blaise Pascal, "Pens'ees", 1670 -% -Men never make passes at girls wearing glasses. - -- Dorothy Parker -% -Men occasionally stumble over the truth, but most of them -pick themselves up and hurry off as if nothing had happened. - -- Winston Churchill -% -Men of lofty genius when they are doing the least work are most active. - -- Leonardo da Vinci -% -Men of quality are not afraid of women for equality. -% -Men often believe -- or pretend -- that the "Law" is something sacred, or -at least a science -- an unfounded assumption very convenient to governments. -% -Men ought to know that from the brain and from the brain only arise our -pleasures, joys, laughter, and jests as well as our sorrows, pains, griefs -and tears. ... It is the same thing which makes us mad or delirious, -inspires us with dread and fear, whether by night or by day, brings us -sleeplessness, inopportune mistakes, aimless anxieties, absent-mindedness -and acts that are contrary to habit... - -- Hippocrates, "The Sacred Disease" -% -Men say of women what pleases them; women do with men what pleases them. - -- DeSegur -% -Men seldom show dimples to girls who have pimples. -% -Men still remember the first kiss after women have forgotten the last. -% -Men take only their needs into consideration -- never their abilities. - -- Napoleon Bonaparte -% -Men use thought only to justify their wrong doings, -and speech only to conceal their thoughts. - -- Voltaire -% -Men were real men, women were real women, and small, furry creatures -from Alpha Centauri were REAL small, furry creatures from Alpha Centauri. -Spirits were brave, men boldly split infinitives that no man had split -before. Thus was the Empire forged. - -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -Men who cherish for women the highest -respect are seldom popular with them. - -- Joseph Addison -% -Mencken and Nathan's Fifteenth Law of The Average American: - The worst actress in the company is always the manager's wife. -% -Mencken and Nathan's Ninth Law of The Average American: - The quality of a champagne is judged by the amount of noise the - cork makes when it is popped. -% -Mencken and Nathan's Second Law of The Average American: - All the postmasters in small towns read all the postcards. -% -Mencken and Nathan's Sixteenth Law of The Average American: - Milking a cow is an operation demanding a special talent that - is possessed only by yokels, and no person born in a large city - can never hope to acquire it. -% -Mene, mene, tekel, upharsin. -% -Mental power tended to corrupt, and absolute intelligence tended to -corrupt absolutely, until the victim eschewed violence entirely in -favor of smart solutions to stupid problems. - -- Piers Anthony -% -Mental things which have not gone in through the -senses are vain and bring forth no truth except detrimental. - -- Leonardo -% -Menu, n.: - A list of dishes which the restaurant has just run out of. -% -Meskimen's Law: - There's never time to do it right, but there's always time to - do it over. -% -MESSAGE ACKNOWLEDGED -- The Pershing II missiles have been launched. -% -Message from Our Sponsor on ttyTV at 13:58 ... -% -Message will arrive in the mail. -Destroy, before the FBI sees it. -% -METEOROLOGIST: - One who doubts the established fact that it is - bound to rain if you forget your umbrella. -% -Metermaids eat their young. -% -methionylglutaminylarginyltyrosylglutamylserylleucylphenylalanylalanylglutamin- -ylleucyllysylglutamylarginyllysylglutamylglycylalanylphenylalanylvalylprolyl- -phenylalanylvalylthreonylleucylglycylaspartylprolylglycylisoleucylglutamylglu- -taminylserylleucyllysylisoleucylaspartylthreonylleucylisoleucylglutamylalanyl- -glycylalanylaspartylalanylleucylglutamylleucylglycylisoleucylprolylphenylala- -nylserylaspartylprolylleucylalanylaspartylglycylprolylthreonylisoleucylgluta- -minylasparaginylalanylthreonylleucylarginylalanylphenylalanylalanylalanylgly- -cylvalylthreonylprolylalanylglutaminylcysteinylphenylalanylglutamylmethionyl- -leucylalanylleucylisoleucylarginylglutaminyllysylhistidylprolylthreonylisoleu- -cylprolylisoleucylglycylleucylleucylmethionyltyrosylalanylasparaginylleucylva- -lylphenylalanylasparaginyllysylglycylisoleucylaspartylglutamylphenylalanyltyro- -sylalanylglutaminylcysteinylglutamyllysylvalylglycylvalylaspartylserylvalylleu- -cylvalylalanylaspartylvalylprolylvalylglutaminylglutamylserylalanylprolylphe- -nylalanylarginylglutaminylalanylalanylleucylarginylhistidylasparaginylvalylala- -nylprolylisoleucylphenylalanylisoleucylcysteinylprolylprolylaspartylalanylas- -partylaspartylaspartylleucylleucylarginylglutaminylisoleucylalanylseryltyrosyl- -glycylarginylglycyltyrosylthreonyltyrosylleucylleucylserylarginylalanylglycyl- -valylthreonylglycylalanylglutamylasparaginylarginylalanylalanylleucylprolylleu- -cylasparaginylhistidylleucylvalylalanyllysylleucyllysylglutamyltyrosylasparagi- -nylalanylalanylprolylprolylleucylglutaminylglycylphenylalanylglycylisoleucylse- -rylalanylprolylaspartylglutaminylvalyllysylalanylalanylisoleucylaspartylalanyl- -glycylalanylalanylglycylalanylisoleucylserylglycylserylalanylisoleucylvalylly- -sylisoleucylisoleucylglutamylglutaminylhistidylasparaginylisoleucylglutamylpro- -lylglutamyllysylmethionylleucylalanylalanylleucyllysylvalylphenylalanylvalyl- -glutaminylprolylmethionyllysylalanylalanylthreonylarginylserine, n.: - The chemical name for tryptophan synthetase A protein, a - 1,913-letter enzyme with 267 amino acids. - -- Mrs. Byrne's Dictionary of Unusual, Obscure, and - Preposterous Words -% -Mickey Mouse wears a Spiro Agnew watch. -% -MICRO: - Thinker toys. -% -Micro Credo: - Never trust a computer bigger than you can lift. -% -Microbiology Lab: Staph Only! -% -Microwave oven? Whaddya mean, it's a microwave oven? I've been -watching Channel 4 on the thing for two weeks. -% -Microwaves frizz your heir. -% -Mieux vaut tard que jamais! -% -Might as well be frank, monsieur. It would take a miracle to -get you out of Casablanca and the Germans have outlawed miracles. - -- Signor Ferrari, "Casablanca" (1942) -% -Mike: "The Fourth Dimension is a shambles?" -Bernie: "Nobody ever empties the ashtrays. People are SO - inconsiderate." - -- Gary Trudeau, "Doonesbury" -% -Miksch's Law: - If a string has one end, then it has another end. -% -Militant agnostic: I don't know, and you don't either. -% -Military intelligence is a contradiction in terms. - -- Groucho Marx -% -Military justice is to justice what military music is to music. - -- Groucho Marx -% -Miller's Slogan: - Lose a few, lose a few. -% -Millihelen, adj.: - The amount of beauty required to launch one ship. -% -Millions long for immortality who do not know what -to do with themselves on a rainy Sunday afternoon. - -- Susan Ertz -% -Millions of sensible people are too high-minded to concede that politics is -almost always the choice of the lesser evil. "Tweedledum and Tweedledee," -they say. "I will not vote." Having abstained, they are presented with a -President who appoints the people who are going to rummage around in their -lives for the next four years. Consider all the people who sat home in a -stew in 1968 rather than vote for Hubert Humphrey. They showed Humphrey. -Those people who taught Hubert Humphrey a lesson will still be enjoying the -Nixon Supreme Court when Tricia and Julie begin to find silver threads among -the gold and the black. - -- Russel Baker, "Ford without Flummery" -% -Mind! I don't mean to say that I know, of my own knowledge, what there is -particularly dead about a door-nail. I might have been inclined, myself, -to regard a coffin-nail as the deadest piece of ironmongery in the trade. -But the wisdom of our ancestors is in the simile; and my unhallowed hands -shall not disturb it, or the Country's done for. You will therefore permit -me to repeat, emphatically, that Marley was as dead as a door-nail. -% -Mind your own business, Spock. I'm sick of your halfbreed interference. -% -Mind your own business, then you don't mind mine. -% -Minicomputer: - A computer that can be afforded on the budget of a middle-level - manager. -% -Minnesota -- - home of the blonde hair and blue ears. - mosquito supplier to the free world. - come fall in love with a loon. - where visitors turn blue with envy. - one day it's warm, the rest of the year it's cold. - land of many cultures -- mostly throat. - where the elite meet sleet. - glove it or leave it. - many are cold, but few are frozen. - land of the ski and home of the crazed. - land of 10,000 Petersons. -% -Minnie Mouse is a slow maze learner. -% -Minors in Kansas City, Missouri, are not allowed to purchase cap -pistols; they may buy shotguns freely, however. -% -MIPS: - Meaningless Indicator of Processor Speed -% -Mirrors should reflect a little before throwing back images. - -- Jean Cocteau -% -Misery loves company, but company does not reciprocate. -% -Misery no longer loves company. -Nowadays it insists on it. - -- Russell Baker -% -Misfortune, n.: - The kind of fortune that never misses. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Misfortunes arrive on wings and leave on foot. -% -Miss, n.: - A title with which we brand unmarried - women to indicate that they are in the market. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Mistakeholder, n.: - A person who depends on accidental features or - implementation errors and so now has a vested - interest in keeping things from being fixed. - -- Chip Morningstar -% -Mistakes are often the stepping stones to utter failure. -% -Mistrust first impulses; they are always right. -% -MIT: - The Georgia Tech of the North -% -Mitchell's Law of Committees: - Any simple problem can be made insoluble - if enough meetings are held to discuss it. -% -Mittsquinter, adj.: - A ballplayer who looks into his glove after missing the ball, - as if, somehow, the cause of the error lies there. - -- Rich Hall & Friends, "Sniglets" -% -Mix a little foolishness with your serious plans; -it's lovely to be silly at the right moment. - -- Horace -% -Mixed emotions: - Watching a bus-load of lawyers plunge off a cliff. - With five empty seats. -% -Mix's Law: - There is nothing more permanent than a temporary building. - There is nothing more permanent than a temporary tax. -% -MOCK APPLE PIE (No Apples Needed) - - Pastry to two crust 9-inch pie 36 RITZ Crackers -2 cups water 2 cups sugar -2 teaspoons cream of tartar 2 tablespoons lemon juice - Grated rind of one lemon Butter or margarine - Cinnamon - -Roll out bottom crust of pastry and fit into 9-inch pie plate. Break -RITZ Crackers coarsely into pastry-lined plate. Combine water, sugar -and cream of tartar in saucepan, boil gently for 15 minutes. Add lemon -juice and rind. Cool. Pour this syrup over Crackers, dot generously -with butter or margarine and sprinkle with cinnamon. Cover with top -crust. Trim and flute edges together. Cut slits in top crust to let -steam escape. Bake in a hot oven (425 F) 30 to 35 minutes, until crust -is crisp and golden. Serve warm. Cut into 6 to 8 slices. - -- Found lurking on a Ritz Crackers box -% -Modeling paged and segmented memories is tricky business. - -- P. J. Denning -% -Modem, adj.: - Up-to-date, new-fangled, as in "Thoroughly Modem Millie." An - unfortunate byproduct of kerning. -% -Moderation in all things. - -- Publius Terentius Afer [Terence] -% -Moderation is a fatal thing. Nothing succeeds like excess. - -- Oscar Wilde -% -Modern art is what happens when painters stop looking at girls and persuade -themselves that they have a better idea. - -- John Ciardi -% -Modern man is the missing link between apes and human beings. -% -Modern psychology takes completely for granted that behavior and neural -function are perfectly correlated, that one is completely caused by the -other. There is no separate soul or lifeforce to stick a finger into the -brain now and then and make neural cells do what they would not otherwise. -Actually, of course, this is a working assumption only. ... It is quite -conceivable that someday the assumption will have to be rejected. But it -is important also to see that we have not reached that day yet: the working -assumption is a necessary one and there is no real evidence opposed to it. -Our failure to solve a problem so far does not make it insoluble. One cannot -logically be a determinist in physics and biology, and a mystic in psychology. - -- D. O. Hebb, "Organization of Behavior: - A Neuropsychological Theory", 1949 -% -MODESTY: - Being comfortable that others will discover your greatness. -% -Modesty is a vastly overrated virtue. - -- J. K. Galbraith -% -Modesty: the gentle art of enhancing your charm by pretending - not to be aware of it. - -- Oliver Herford -% -Moe: Wanna play poker tonight? -Joe: I can't. It's the kids' night out. -Moe: So? -Joe: I gotta stay home with the nurse. -% -Moe: What did you give your wife for Valentine's Day? -Joe: The usual gift -- she ate my heart out. -% -Moebius always does it on the same side. -% -Moebius strippers never show you their back side. -% -Mohandas K. Gandhi often changed his mind publicly. An aide once asked him -how he could so freely contradict this week what he had said just last week. -The great man replied that it was because this week he knew better. -% -Moishe Margolies, who weighed all of 105 pounds and stood an even five feet -in his socks, was taking his first airplane trip. He took a seat next to a -hulking bruiser of a man who happened to be the heavyweight champion of -the world. Little Moishe was uneasy enough before he even entered the plane, -but now the roar of the engines and the great height absolutely terrified him. -So frightened did he become that his stomach turned over and he threw up all -over the muscular giant siting beside him. Fortunately, at least for Moishe, -the man was sound asleep. But now the little man had another problem. How in -the world would he ever explain the situation to the burly brute when he -awakened? The sudden voice of the stewardess on the plane's intercom, finally -woke the bruiser, and Moishe, his heart in his mouth, rose to the occasion. - "Feeling better now?" he asked solicitously. -% -Molecule, n.: - The ultimate, indivisible unit of matter. It is distinguished from - the corpuscle, also the ultimate, indivisible unit of matter, by a - closer resemblance to the atom, also the ultimate, indivisible unit - of matter... The ion differs from the molecule, the corpuscle and - the atom in that it is an ion... - -- Ambrose Bierce, "The Devil's Dictionary" -% -Mollison's Bureaucracy Hypothesis: - If an idea can survive a bureaucratic review - and be implemented it wasn't worth doing. -% -MOMENTUM: - What you give a person when they are going away. -% -Mommy, what happens to your files when you die? -% -Mom's Law: - When they finally do have to take you to the - hospital, your underwear won't be clean or new. -% -Monday is an awful way to spend one seventh of your life. -% -Monday, n.: - In Christian countries, the day after the baseball game. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Monday, n.: - In Christian countries, the day after the football game. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Money and women are the most sought after and the least known of any two -things we have. - -- The Best of Will Rogers -% -Money cannot buy love, nor even friendship. -% -Money cannot buy -The fuel of love -but is excellent kindling. - -To the man-in-the-street, who, I'm sorry to say, -Is a keen observer of life, -The word intellectual suggests right away -A man who's untrue to his wife. - -- W. H. Auden, "Collected Shorter Poems" -% -Money can't buy happiness, but it can make you -awfully comfortable while you're being miserable. - -- C. B. Luce -% -Money can't buy love, but it improves your bargaining position. - -- Christopher Marlowe -% -Money doesn't talk, it swears. - -- Bob Dylan -% -Money is a powerful aphrodisiac. But flowers work almost as well. - -- Lazarus Long -% -Money is better than poverty, if only for financial reasons. -% -Money is its own reward. -% -Money is the root of all evil, and man needs roots. -% -Money is the root of all wealth. -% -Money is truthful. If a man speaks of his honor, make him pay cash. - -- Lazarus Long -% -Money isn't everything -- but it's a long way ahead of what comes next. - -- Sir Edmond Stockdale -% -Money may buy friendship but money cannot buy love. -% -Money may not buy happiness, but it sure -puts you in a great bargaining position. -% -Money will say more in one moment than -the most eloquent lover can in years. -% -Moneyliness is next to Godliness. - -- Andries van Dam -% -Monogamy is the Western custom of one wife and hardly any mistresses. - -- H. H. Munro -% -MONOTONY: - Marriage to one woman at a time. -% -MONTANA: - A grizzly bear praying for the early arrival of cable television. -% -MONTANA: - Where forty-three below keeps out the riff-raff. -% -Monterey... is decidedly the pleasantest and most civilized-looking place -in California ... [it] is also a great place for cock-fighting, gambling -of all sorts, fandangos, and various kinds of amusements and knavery. - -- Richard Henry Dama, "Two Years Before the Mast", 1840 -% -Moon, n.: - 1. A celestial object whose phase is very important to -hackers. See PHASE OF THE MOON. 2. Dave Moon (MOON@MC). -% -Moore's Constant: - Everybody sets out to do something, and everybody - does something, but no one does what he sets out to do. -% -Mophobia, n.: - Fear of being verbally abused by a Mississippian. -% -More are taken in by hope than by cunning. - -- Vauvenargues -% -More computing sins are committed in the name of efficiency (without -necessarily achieving it) than for any other single reason -- including -blind stupidity. - -- W. A. Wulf -% -More people are flattered into virtue than bullied out of vice. - -- R. S. Surtees -% -More people died at Chappaquidick than at 3-mile island. -% -More people have died in Ted Kennedy's car than in nuclear power plants. -% -MORE SPORTS RESULTS: -The Beverly Hills Freudians tied the Chicago Rogerians 0-0 last Saturday -night. The match started with a long period of silence while the Freudians -waited for the Rogerians to free associate and the Rogerians waited for -the Freudians to say something they could paraphrase. The stalemate was -broken when the Freudians' best player took the offensive and interpreted -the Rogerians' silence as reflecting their anal-retentive personalities. -At this the Rogerians' star player said "I hear you saying you think we're -full of ka-ka." This started a fight and the match was called by officials. -% -More than any time in history, mankind now faces a crossroads. One path -leads to despair and utter hopelessness, the other to total extinction. -Let us pray that we have the wisdom to choose correctly. - -- Woody Allen, "Side Effects" -% -Morris had been down on his luck for months, and, though not a devoutly -religious man, had begun to visit the local synagogue to ask God's help. -One week, out of desperation, he prayed, "God, I've been a good and decent -man all my life. Would it be so terrible if You let me win the lottery -just once?" - The despondent fellow returned week after week. One day, Morris, -nearly hopeless now, prayed, "God, I've never asked You for anything before. -I just want to win one little lottery." - "As he dejectedly rose to leave, God's voice boomed, "Morris, at -least meet Me halfway on this. Buy a ticket!" -% -Morton's Law: - If rats are experimented upon, they will develop cancer. -% -Mos Eisley Spaceport; you'll not find a more -wretched collection of villainy and disreputable types... - -- Obi-wan Kenobi, "Star Wars" -% -Mosher's Law of Software Engineering: - Don't worry if it doesn't work right. - If everything did, you'd be out of a job. -% -MOSQUITO: - The state bird of New Jersey. -% -Most burning issues generate far more heat than light. -% -Most fish live underwater, which is a terrible place to have sex -because virtually anywhere you lie down there will be stinging crabs -and large quantities of little fish staring at you with buggy little -eyes. So generally when two fish want to have sex, they swim around -and around for hours, looking for someplace to go, until finally the -female gets really tired and has a terrible headache, and she just -dumps her eggs right on the sand and swims away. Then the male, driven -by some timeless, noble instinct for survival, eats the eggs. So the -truth is that fish don't reproduce at all, but there are so many of -them that it doesn't make any difference. - -- Dave Barry, "Sex and the Single Amoeba: What Every - Teen Should Know" -% -Most folks they like the daytime, - 'cause they like to see the shining sun. -They're up in the morning, - off and a-running till they're too tired for having fun. -But when the sun goes down, - and the bright lights shine, my daytime has just begun. - -Now there are two sides to this great big world, - and one of them is always night. -If you can take care of business in the sunshine, baby, - I guess you're gonna be all right. -Don't come looking for me to lend you a hand. - My eyes just can't stand the light. - -'Cause I'm a night owl honey, sleep all day long. - -- Carly Simon -% -Most general statements are false, including this one. - -- Alexander Dumas -% -Most of our lives are about proving something, -either to ourselves or to someone else. -% -Most of the fear that spoils our life comes from attacking -difficulties before we get to them. - -- Dr. Frank Crane -% -...most of us learned about love the hard way. Even warnings are probably -useless, for somehow, despite the severest warnings of parents and friends, -hundreds, thousands of women have forgotten themselves at the last minute -and succumbed to the lies, promises, flatteries, or mere attentions of -lusting, lovely men, landing themselves in complicated predicaments from -which some of them never recovered during their entire lives. And I am not -speaking only of your teenaged Midwesterners in 1958; I'm speaking of women -of every age in every city in every year. The notorious sexual revolution -has saved no one from the pain and confusion of love. - -- Alix Kates Shulman -% -Most of your faults are not your fault. -% -Most people are too busy to have time for anything important. -% -Most people are unable to write because they are unable to think, and -they are unable to think because they congenitally lack the equipment -to do so, just as they congenitally lack the equipment to fly over the -moon. - -- H. L. Mencken -% -Most people can do without the essentials, but not without the luxuries. -% -Most people can't understand how others can blow their noses differently -than they do. - -- Turgenev -% -Most people deserve each other. - -- Shirley -% -Most people don't need a great deal of love -nearly so much as they need a steady supply. -% -Most people eat as though they were fattening themselves for market. - -- Edgar W. Howe -% -Most people feel that everyone is entitled to their opinion. -% -Most people have a furious itch to talk about themselves and are restrained -only by the disinclination of others to listen. Reserve is an artificial -quality that is developed in most of us as the result of innumerable rebuffs. - -- W. Somerset Maugham -% -Most people have a mind that's open by appointment only. -% -Most people have two reasons for doing anything -- -a good reason, and the real reason. -% -Most people in this society who aren't actively mad are, -at best, reformed or potential lunatics. - -- Susan Sontag -% -Most people need some of their problems -to help take their mind off some of the others. -% -Most people prefer certainty to truth. -% -Most people want either less corruption -or more of a chance to participate in it. -% -Most people will listen to your unreasonable demands, -if you'll consider their unacceptable offer. -% -Most people's favorite way to end a game is by winning. -% -Most public domain software is free, at least at first glance. -% -Most rock journalism is people who can't write interviewing people who -can't talk for people who can't read. - -- Frank Zappa -% -Most seminars have a happy ending. Everyone's glad when they're over. -% -Most Texans think Hanukkah is some sort of duck call. - -- Richard Lewis -% -MOTHER: - Half a word. -% -Mother Earth is not flat! -% -Mother is far too clever to understand anything she does not like. - -- Arnold Bennett -% -Mother is the invention of necessity. -% -Mother said there would be days like this, but she never said there -would be so many. -% -Mother told me to be good, but she's been wrong before. -% -Mothers all want their sons to grow up to be President, but they -don't want them to become politicians in the process. - -- John F. Kennedy -% -Mothers of large families (who claim to common sense) -Will find a Tiger will repay the trouble and expense. - -- Hilaire Belloc, "The Tiger" -% -Mount St. Helens should have used earth control. -% -MOUNT TAPE U1439 ON B3, NO RING -% -Mountain Dew and doughnuts... because breakfast is the most important meal -of the day. -% -Mr. Cole's Axiom: - The sum of the intelligence on the planet is a constant; the - population is growing. -% -Mr. Rockford? This is Betty Joe Withers. I got four shirts of yours from -the Bo Peep Cleaners by mistake. I don't know why they gave me men's -shirts but they're going back. -% -Mr. Rockford? You don't know me, but I'd like to hire you. Could -you call me at... My name is... uh... Never mind, forget it! -% -Mr. Rockford; Miss Collins from the Bureau of Licenses. We got your -renewal before the extended deadline but not your check. I'm sorry but -at midnight you're no longer licensed as an investigator. -% -Mr. Rockford, this is the Thomas Crown School of Dance and Contemporary -Etiquette. We aren't going to call again! Now you want these free -lessons or what? -% -Mr. Salter's side of the conversation was limited to expressions of assent. -When Lord Copper was right he said "Definitely, Lord Copper"; when he was -wrong, "Up to a point." - "Let me see, what's the name of the place I mean? Capital of Japan? -Yokohama isn't it?" - "Up to a point, Lord Copper." - "And Hong Kong definitely belongs to us, doesn't it?" - "Definitely, Lord Copper." - -- Evelyn Waugh, "Scoop" -% -MSDOS is not dead, it just smells that way. - -- Henry Spencer -% -Much as they like to persuade us differently, lawyers are simply hired -consultants, and at some point you time them out. - -- Craig Partridge -% -Much of the excitement we get out of our work -is that we don't really know what we are doing. - -- Edsger W. Dijkstra -% -Much to his Mum and Dad's dismay, Horace ate himself one day. -He didn't stop to say his grace, he just sat down and ate his face. -"We can't have this!" his Dad declared, "If that lad's ate, he should - be shared." -But even as he spoke they saw Horace eating more and more: -First his legs and then his thighs, his arms, his nose, his hair, his eyes... -"Stop him someone!" Mother cried, "Those eyeballs would be better fried!" -But all too late, for they were gone, and he had started on his dong... -"Oh! foolish child!" the father mourns "You could have deep-fried that - with prawns, -Some parsley and some tartar sauce..." -But H. was on his second course: his liver and his lights and lung, -His ears, his neck, his chin, his tongue; "To think I raised him from the cot, -And now he's going to scoff the lot!" -His Mother cried: "What shall we do? What's left won't even make a stew..." -And as she wept, her son was seen, to eat his head, his heart his spleen. -and there he lay: a boy no more, just a stomach on the floor... -None the less, since it *was* his, they ate it -- that's what haggis is. -% -Multics is security spelled sideways. -% -"Multiply in your head" (ordered the compassionate Dr. Adams) "365,365,365, -365,365,365 by 365,365,365,365,365,365". He [ten-year-old Truman Henry -Safford] flew around the room like a top, pulled his pantaloons over the -tops of his boots, bit his hands, rolled his eyes in their sockets, sometimes -smiling and talking, and then seeming to be in an agony, until, in not more -than one minute, said he, 133,491,850,208,566,925,016,658,299,941,583,225!" -An electronic computer might do the job a little faster but it wouldn't be -as much fun to watch. - -- James R. Newman, "The World of Mathematics" -% -MUMMY: - An Egyptian who was pressed for time. -% -Mummy dust to make me old; -To shroud my clothes, the black of night; -To age my voice, an old hag's cackle; -To whiten my hair, a scream of fright; -A blast of wind to fan my hate; -A thunderbolt to mix it well -- -Now begin thy magic spell! - -- The Evil Queen, "Snow White" -% -Mum's the word. - -- Miguel de Cervantes -% -Mundus vult decipi decipiatur ergo. - -- Xaviera Hollander - -[The world wants to be cheated, so cheat.] -% -Murder is always a mistake -- one should never do anything one cannot -talk about after dinner. - -- Oscar Wilde, "The Picture of Dorian Gray" -% -Murphy was an optimist. -% -Murphy's Law is recursive. Washing your car to make it rain doesn't work. -% -Murphy's Law of Research: - Enough research will tend to support your theory. -% -Murphy's Law, that brash proletarian restatement of Godel's Theorem. - -- Thomas Pynchon, "Gravity's Rainbow" -% -Murphy's Laws: - (1) If anything can go wrong, it will. - (2) Nothing is as easy as it looks. - (3) Everything takes longer than you think it will. -% -Murray's Rule: - Any country with "democratic" in the title isn't. -% -Music in the soul can be heard by the universe. - -- Lao Tsu -% -Must be getting close to town -- we're hitting more people. -% -Must I hold a candle to my shames? - -- William Shakespeare, "The Merchant of Venice" -% -Mustgo, n.: - Any item of food that has been sitting in the refrigerator so - long it has become a science project. - -- Rich Hall & Friends, "Sniglets" -% -My advice to you, my violent friend, is to seek out gold and sit on it. - -- The Dragon to Grendel, in John Gardner's "Grendel" -% -My analyst told me that I was right out of my head, - But I said, "Dear Doctor, I think that it is you instead. -Because I have got a thing that is unique and new, - To prove it I'll have the last laugh on you. -'Cause instead of one head -- I've got two. - -And you know two heads are better than one. -% -My band career ended late in my senior year when John Cooper and I -threw my amplifier out the dormitory window. We did not act in haste. -First we checked to make sure the amplifier would fit through the -frame, using the belt from my bathrobe to measure, then we picked up -the amplifier and backed up to my bedroom door. Then we rushed -forward, shouting "The WHO! The WHO!" and we launched my amplifier -perfectly, as though we had been doing it all our lives, clean through -the window and down onto the sidewalk, where a small but appreciative -crowd had gathered. I would like to be able to say that this was a -symbolic act, an effort on my part to break cleanly away from one state -in my life and move on to another, but the truth is, Cooper and I -really just wanted to find out what it would sound like. It sounded -OK. - -- Dave Barry, "The Snake" -% -My best argument against discrimination is quite simple: - -Does it really matter if the ABC people are inferior to the DEF people if -they can tell one end of a gun from the other? -% -My Bonnie looked into a gas tank, -The height of its contents to see! -She lit a small match to assist her, -Oh, bring back my Bonnie to me. -% -My boy is mean kid. I came home the other day and saw him taping worms -to the sidewalk, he sits there and watches the birds get hernias. Well, -only last Christmas I gave him a B-B gun and he gave me a sweatshirt with -a bulls-eye on the back. - -I told my kids, "Someday, you'll have kids of your own." One of them -said, "So will you." - -- Rodney Dangerfield -% -My brain is my second favorite organ. - -- Woody Allen -% -My brother sent me a postcard the other day with this big satellite photo -of the entire earth on it. On the back it said: "Wish you were here". - -- Steven Wright -% -My calculator is my shepherd, I shall not want -It maketh me accurate to ten significant figures, - and it leadeth me in scientific notation to 99 digits. -It restoreth my square roots and guideth me along paths of floating - decimal points for the sake of precision. -Yea, tho I walk through the valley of surprise quizzes, - I will fear no prof, for my calculator is there to hearten me. -It prepareth a log table to comfort me, it prepareth an - arc sin for me in the presence of my teachers. -It anoints my homework with correct solutions, my interpolations are - over. -Surely, both precision and accuracy shall follow me all the days of my - life, and I shall dwell in the house of Texas instruments forever. -% -My central memory of that time seems to hang on one or five or maybe forty -nights -- or very early mornings -- when I left the Fillmore half-crazy and, -instead of going home, aimed the big 650 Lightning across the Bay Bridge at -a hundred miles an hour ... booming through the Treasure Island tunnel at -the lights of Oakland and Berkeley and Richmond, not quite sure which -turnoff to take when I got to the other end ... but being absolutely certain -that no matter which way I went I would come to a place where people were -just as high and wild as I was: no doubt at all about that. - -- Hunter S. Thompson -% -"My code is elegant", "Your code is sneaky", "His code is an ugly hack" - -- Colin Percival on irregular verbs -% -My cup hath runneth'd over with love. -% -My darling wife was always glum. -I drowned her in a cask of rum, -And so made sure that she would stay -In better spirits night and day. -% -My doctor told me to stop having intimate dinners for four. -Unless there are three other people. - -- Orson Welles -% -My doctorate's in Literature, but it seems like a pretty good pulse to me. -% -My experience with government is when things are non-controversial, -beautifully co-ordinated and all the rest, it must be that not much -is going on. - -- John F. Kennedy -% -My family history begins with me, but yours ends with you. - -- Iphicrates -% -My father, a good man, told me, "Never lose -your ignorance; you cannot replace it." - -- Erich Maria Remarque -% -My father taught me three things: - 1: Never mix whiskey with anything but water. - 2: Never try to draw to an inside straight. - 3: Never discuss business with anyone who refuses to give his name. -% -My father was a God-fearing man, but he never -missed a copy of the New York Times, either. - -- E. B. White -% -My father was a saint, I'm not. - -- Indira Gandhi -% -My favorite sandwich is peanut butter, baloney, cheddar cheese, lettuce -and mayonnaise on toasted bread with catsup on the side. - -- Hubert H. Humphrey -% -My first basename is George "Catfish" Metkovich from our 1952 Pittsburgh -Pirates team, which lost 112 games. After a terrible series against the -New York Giants, in which our center fielder made three throwing errors -and let two balls get through his legs, manager Billy Meyer pleaded, "Can -somebody think of something to help us win a game?" - "I'd like to make a suggestion," Metkovich said. "On any ball hit -to center field, let's just let it roll to see if it might go foul." - -- Joe Garagiola, "It's Anybody's Ball Game" -% -My folks didn't come over on the Mayflower, -but they were there to meet the boat. -% -My friend has a baby. I'm writing down all the noises he makes so -later I can ask him what he meant. - -- Steven Wright -% -My geometry teacher was sometimes acute, and sometimes obtuse, -but always, always, he was right. -% -My girlfriend and I sure had a good time at the beach last summer. First -she'd bury me in the sand, then I'd bury her. This summer I'm going to go -back and dig her up. -% -My God, I'm depressed! Here I am, a computer with a mind a thousand times -as powerful as yours, doing nothing but cranking out fortunes and sending -mail about softball games. And I've got this pain right through my ALU. -I've asked for it to be replaced, but nobody ever listens. I think it -would be better for us both if you were to just log out again. -% -My, how you've changed since I've changed. -% -My idea of roughing it is when room service is late. -% -My idea of roughing it turning the air conditioner too low. -% -My interest is in the future because I am -going to spend the rest of my life there. -% -My life is a soap opera, but who has the rights? - -- MadameX -% -My love, he's mad, and my love, he's fleet, - And a wild young wood-thing bore him! -The ways are fair to his roaming feet, - And the skies are sunlit for him. -As sharply sweet to my heart he seems - As the fragrance of acacia. -My own dear love, he is all my dreams -- - And I wish he were in Asia. - -- Dorothy Parker, part 2 -% -My love runs by like a day in June, - And he makes no friends of sorrows. -He'll tread his galloping rigadoon - In the pathway or the morrows. -He'll live his days where the sunbeams start - Nor could storm or wind uproot him. -My own dear love, he is all my heart -- - And I wish somebody'd shoot him. - -- Dorothy Parker, part 3 -% -My method is to take the utmost trouble to find the right -thing to say. And then say it with the utmost levity. - -- George Bernard Shaw -% -My mind can never know my body, although -it has become quite friendly with my legs. - -- Woody Allen, on Epistemology -% -My mother drinks to forget she drinks. - -- Crazy Jimmy -% -My mother loved children -- she would -have given anything if I had been one. - -- Groucho Marx -% -My mother once said to me, "Elwood," (she always called me Elwood) -"Elwood, in this world you must be oh so smart or oh so pleasant." -For years I tried smart. I recommend pleasant. - -- Elwood P. Dowde, "Harvey" -% -My mother wants grandchildren, so I said, "Mom, go for it!" - -- Sue Murphy -% -My My, hey hey -Rock and roll is here to stay The king is gone but he's not forgotten -It's better to burn out This is the story of a Johnny Rotten -Than to fade away It's better to burn out than it is to rust -My my, hey hey The king is gone but he's not forgotten - -It's out of the blue and into the black Hey hey, my my -They give you this, but you pay for that Rock and roll can never die -And once you're gone you can never come back There's more to the picture -When you're out of the blue Than meets the eye -And into the black - -- Neil Young - "My My, Hey Hey (Out of the Blue), Rust Never Sleeps" -% -My notion of a husband at forty is that a woman should -be able to change him, like a bank note, for two twenties. -% -My only love sprung from my only hate! -Too early seen unknown, and known too late! - -- William Shakespeare, "Romeo and Juliet" -% -My opinions may have changed, but not the fact that I am right. -% -My own business always bores me to death; I prefer other people's. - -- Oscar Wilde -% -My own dear love, he is strong and bold - And he cares not what comes after. -His words ring sweet as a chime of gold, - And his eyes are lit with laughter. -He is jubilant as a flag unfurled -- - Oh, a girl, she'd not forget him. -My own dear love, he is all my world -- - And I wish I'd never met him. - -- Dorothy Parker, part 1 -% -My own feelings are perhaps best described by saying that I am -perfectly aware that there is no Royal Road to Mathematics, in other -words, that I have only a very small head and must live with it. - -- Edsger W. Dijkstra -% -My own life has been spent chronicling the rise and fall of human systems, -and I am convinced that we are terribly vulnerable. ... We should be -reluctant to turn back upon the frontier of this epoch. Space is indifferent -to what we do; it has no feeling, no design, no interest in whether or not -we grapple with it. But we cannot be indifferent to space, because the grand, -slow march of intelligence has brought us, in our generation, to a point -from which we can explore and understand and utilize it. To turn back now -would be to deny our history, our capabilities. - -- James A. Michener -% -My parents went to Niagra Falls and all I got was this crummy life. -% -My pen is at the bottom of a page, -Which, being finished, here the story ends; -'Tis to be wished it had been sooner done, -But stories somehow lengthen when begun. - -- Byron -% -My philosophy is: Don't think. - -- Charles Manson -% -My problem lies in reconciling my gross habits with my net income. - -- Errol Flynn - -Any man who has $10,000 left when he dies is a failure. - -- Errol Flynn -% -My rackets are run on strictly American -lines, and they're going to stay that way. - -- Al Capone -% -My religion consists of a humble admiration of the illimitable superior -spirit who reveals himself in the slight details we are able to perceive -with our frail and feeble mind. - -- Albert Einstein -% -My ritual differs slightly. What I do, first thing [in the morning], is I -hop into the shower stall. Then I hop right back out, because when I hopped -in I landed barefoot right on top of See Threepio, a little plastic robot -character from "Star Wars" whom my son, Robert, likes to pull the legs off -of while he showers. Then I hop right back into the stall because our dog, -Earnest, who has been alone in the basement all night building up powerful -dog emotions, has come bounding and quivering into the bathroom and wants -to greet me with 60 or 70 thousand playful nips, any one of which -- bear -in mind that I am naked and, without my contact lenses, essentially blind --- could result in the kind of injury where you have to learn a whole new -part if you want to sing the "Messiah," if you get my drift. Then I hop -right back out, because Robert, with that uncanny sixth sense some children -have -- you cannot teach it; they either have it or they don't -- has chosen -exactly that moment to flush one of the toilets. Perhaps several of them. - -- Dave Barry -% -My schoolmates would make love to anything that moved, but I never saw any -reason to limit myself. - -- Emo Philips -% -My sister opened a computer store in Hawaii. -She sells C shells by the seashore. -% -My soul is crushed, my spirit sore -I do not like me anymore, -I cavil, quarrel, grumble, grouse, -I ponder on the narrow house -I shudder at the thought of men -I'm due to fall in love again. - -- Dorothy Parker, "Enough Rope" -% -My theology, briefly, is that the universe was dictated but not signed. - -- Christopher Morley -% -My uncle was the town drunk -- and we lived in Chicago. - -- George Gobel -% -My way of joking is to tell the truth. -That's the funniest joke in the world. - -- Muhammad Ali -% -My weight is perfect for my height -- which varies. -% -Mystics always hope that science will some day overtake them. - -- Booth Tarkington -% -Mythology, n.: - The body of a primitive people's beliefs, concerning its origin, - early history, heroes, deities and so forth, as distinguished - from the true accounts which it invents later. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Naches (rhymes with Bach' us, with "Bach" pronounced like the composer) -is what every Jewish parent wants from their children, lots of good -returns, good grades, good spouse, good grandchildren. - -So, now that you all understand naches, the joke: - -Two Jewish women are sitting having coffee. - "So, how's your daughter?" - "Oh, Rachel! She's fine, she just married a dentist!" - "Really? Isn't she the one that married the lawyer?" - "Yes, that's my Rachel." - "That's... that's nice. But isn't she the same one that married - the doctor?" - "Yes, that's her!" - "But didn't she marry a bank executive before that?" - "Yes, yes!" - "Ahhh. So much naches from one child!" -% -Nachman's Rule: - When it comes to foreign food, the less authentic the better. - -- Gerald Nachman -% -Nadia Comaneci, simple perfection. - -- '76 Olympics -% -'Naomi, sex at noon taxes.' I moan. -Never odd or even. -A man, a plan, a canal, Panama. -Madam, I'm Adam. -Sit on a potato pan, Otis. - -- The Mad Palindromist -% -NAPOLEON: What shall we do with this soldier, Giuseppe? Everything he - says is wrong. -GIUSEPPE: Make him a general, Excellency, and then everything he says - will be right. - -- George Bernard Shaw, "The Man of Destiny" -% -Narcolepulacyi, n.: - The contagious action of yawning, causing everyone in sight - to also yawn. - -- Rich Hall & Friends, "Sniglets" -% -Nasrudin called at a large house to collect for charity. The servant said -"My master is out." Nasrudin replied, "Tell your master that next time he -goes out, he should not leave his face at the window. Someone might steal -it." -% -Nasrudin returned to his village from the imperial capital, and the villagers -gathered around to hear what had passed. "At this time," said Nasrudin, "I -only want to say that the King spoke to me." All the villagers but the -stupidest ran off to spread the wonderful news. The remaining villager -asked, "What did the King say to you?" "What he said -- and quite distinctly, -for everyone to hear -- was 'Get out of my way!'" The simpleton was overjoyed; -he had heard words actually spoken by the King, and seen the very man they -were spoken to. -% -Nasrudin walked into a shop one day, and the owner came forward to serve -him. Nasrudin said, "First things first. Did you see me walk into your -shop?" - "Of course." - "Have you ever seen me before?" - "Never." - "Then how do you know it was me?" -% -Nasrudin walked into a teahouse and declaimed, "The moon is more useful -than the sun." - "Why?", he was asked. - "Because at night we need the light more." -% -Nasrudin was carrying home a piece of liver and the recipe for liver pie. -Suddenly a bird of prey swooped down and snatched the piece of meat from -his hand. As the bird flew off, Nasrudin called after it, "Foolish bird! -You have the liver, but what can you do with it without the recipe?" -% -National security is in your hands - guard it well. -% -Natives who beat drums to drive off evil spirits are objects of -scorn to smart Americans who blow horns to break up traffic jams. - -- Mary Ellen Kelly -% -Natural laws have no pity. -% -Naturally the common people don't want war... but after all it is the leaders -of a country who determine the policy, and it is always a simple matter to -drag the people along, whether it is a democracy, or a fascist dictatorship, -or a parliament, or a communist dictatorship. Voice or no voice, the people -can always be brought to the bidding of the leaders. That is easy. All you -have to do is tell them they are being attacked, and denounce the pacifists -for lack of patriotism and exposing the country to danger. It works the same -in every country. - -- Hermann Goering -% -Nature abhors a hero. For one thing, he violates the law of conservation -of energy. For another, how can it be the survival of the fittest when the -fittest keeps putting himself in situations where he is most likely to be -creamed? - -- Solomon Short -% -Nature abhors a virgin -- a frozen asset. - -- Clare Booth Luce -% -Nature and nature's laws lay hid in night, -God said, "Let Newton be," and all was light. - -It did not last; the devil howling "Ho! -Let Einstein be!" restored the status quo. -% -Nature has given women so much power that the law has very wisely -given them little. - -- Dr. Samuel Johnson -% -Nature is by and large to be found out of doors, a location where, it -cannot be argued, there are never enough comfortable chairs. - -- Fran Lebowitz -% -Nature makes boys and girls lovely to look upon so they can be -tolerated until they acquire some sense. - -- William Phelps -% -Nature to all things fixed the limits fit, -And wisely curbed proud man's pretending wit. -As on the land while here the ocean gains, -In other parts it leaves wide sandy plains; -Thus in the soul while memory prevails, -The solid power of understanding fails; -Where beams of warm imagination play, -The memory's soft figures melt away. - -- Alexander Pope (on runtime bounds checking?) -% -Nature, to be commanded, must be obeyed. - -- Francis Bacon -% -Near the Studio Jean Cocteau -On the Rue des Ecoles -lived an old man -with a blind dog -Every evening I would see him -guiding the dog along -the sidewalk, keeping -a firm grip on the leash -so that the dog wouldn't -run into a passerby -Sometimes the dog would stop -and look up at the sky -Once the old man -noticed me watching the dog -and he said, "Oh, yes, -this one knows -when the moon is out, -he can feel it on his face" - -- Barry Gifford -% -Nearly all men can stand adversity, but if you -want to test a man's character, give him power. - -- Abraham Lincoln -% -Nearly every complex solution to a programming problem that I -have looked at carefully has turned out to be wrong. - -- Brent Welch -% -Necessity has no law. - -- St. Augustine -% -Necessity hath no law. - -- Oliver Cromwell -% -Necessity is a mother. -% -"Necessity is the mother of invention" is a silly proverb. "Necessity -is the mother of futile dodges" is much nearer the truth. - -- Alfred North Whitehead -% -Necessity is the plea for every infringement of human freedom. -It is the argument of tyrants; it is the creed of slaves. - -- William Pitt, 1783 -% -Neckties strangle clear thinking. - -- Lin Yutang -% -Needs are a function of what other people have. -% -Neglect of duty does not cease, by repetition, to be neglect of duty. - -- Napoleon -% -Neil Armstrong tripped. -% -Neither spread the germs of gossip nor encourage others to do so. -% -Nemo me impune lacessit - [No one provokes me with impunity] - -- Motto of the Crown of Scotland -% -Nerd pack, n.: - Plastic pouch worn in breast pocket to keep pens from soiling - clothes. Nerd's position in engineering hierarchy can be - measured by number of pens, grease pencils, and rulers bristling - in his pack. -% -Network packets are like buses. You wait all day, and then 3Com -along at once. -% -Neuroses are red, - Melancholia's blue. -I'm schizophrenic, - What are you? -% -Neurotics build castles in the sky, -Psychotics live in them, -And psychiatrists collect the rent. -% -Neutrinos are into physicists. -% -Neutrinos have bad breadth. -% -Neutron bomb, n.: - An explosive device of limited military value because, as - it only destroys people without destroying property, it - must be used in conjunction with bombs that destroy property. -% -Never accept an invitation from a stranger unless he gives you candy. - -- Linda Festa -% -Never appeal to a man's "better nature." He may not have one. -Invoking his self-interest gives you more leverage. - -- Lazarus Long -% -Never argue with a fool -- people might not be able to tell the difference. -% -Never argue with a woman when she's tired -- or rested. -% -Never ask the barber if you need a haircut. -% -Never be afraid to tell the world who you are. - -- Anonymous -% -Never be afraid to try something new. Remember, amateurs built the ark. -Professionals built the Titanic. -% -Never be led astray onto the path of virtue. -% -Never buy from a rich salesman. - -- Goldenstern -% -Never buy what you do not want -because it is cheap; it will be dear to you. - -- Thomas Jefferson -% -Never call a man a fool. Borrow from him. -% -Never commit yourself! Let someone else commit you. -% -Never count your chickens before they rip your lips off. -% -Never delay the ending of a meeting or the beginning of a cocktail hour. -% -Never do programs contain so few bugs as when no debugging tools -are available. - -- Niklaus Wirth -% -Never do today what you can put off until tomorrow. -% -Never drink Coca-Cola in a moving elevator. The elevator's motion coupled -with the chemicals in Coke produce hallucinations. People tend to change -into lizards and attack without warning, and large bats usually fly in the -window. (Additionally, you begin to believe that elevators have windows.) -% -Never drink from your finger bowl -- it contains only water. -% -Never eat at a place called Mom's. Never play cards with a man named Doc. -And never lie down with a woman who's got more troubles than you. - -- Nelson Algren, "What Every Young Man Should Know" -% -Never eat more than you can lift. - -- Miss Piggy -% -Never, ever lie to someone you love unless you're -absolutely sure they'll never find out the truth. -% -Never explain. Your friends do not need it -and your enemies will never believe you anyway. - -- Elbert Hubbard -% -Never face facts; if you do you'll never get up in the morning. - -- Marlo Thomas -% -Never forget what a man says to you when he is angry. -% -Never frighten a small man -- he'll kill you. -% -Never get into fights with ugly people because they have nothing to lose. -% -Never give an inch! -% -Never go to bed mad. Stay up and fight. - -- Phyllis Diller, "Phyllis Diller's Housekeeping Hints" -% -Never have children, only grandchildren. - -- Gore Vidal -% -Never have so many understood so little about so much. - -- James Burke -% -Never hit a man with glasses; hit him with a baseball bat. -% -Never insult an alligator until you've crossed the river. -% -Never invest your money in anything that eats or needs repainting. - -- Billy Rose -% -Never keep up with the Joneses. Drag them down to your level. - -- Quentin Crisp -% -Never kick a man, unless he's down. -% -Never laugh at live dragons. - -- Bilbo Baggins, "The Hobbit" -% -Never leave anything to chance; -make sure all your crimes are premeditated. -% -Never lend your car to anyone to whom you have given birth. - -- Erma Bombeck -% -Never let someone who says it cannot be done -interrupt the person who is doing it. -% -Never let your schooling interfere with your education. -% -Never let your sense of morals prevent you from doing what is right. - -- Salvor Hardin, "Foundation" -% -Never look a gift horse in the mouth. - -- Saint Jerome -% -Never look up when dragons fly overhead. -% -Never make anything simple and efficient when a -way can be found to make it complex and wonderful. -% -Never miss a good chance to shut up. -% -Never negotiate with the United States unless you have a nuclear -weapon. - -- Former deputy defense minister of India -% -Never offend people with style when you can offend them with substance. - -- Sam Brown, "The Washington Post", January 26, 1977 -% -Never offend with style when you can offend with substance. -% -Never pay a compliment as if expecting a receipt. -% -Never play pool with anyone named "Fats". -% -Never promise more than you can perform. - -- Publilius Syrus -% -Never put off till run-time what you can do at compile-time. - -- D. Gries -% -Never put off till tomorrow what you can avoid all together. -% -Never put off until tomorrow what you can do the day after. -% -Never put off until tomorrow what you can do today. There might be a -law against it by that time. -% -Never raise your hand to your children -- it leaves your midsection -unprotected. - -- Robert Orben -% -Never reveal your best argument. -% -Never say "Oops" in an operating room. -% -Never say you know a man until you have divided an inheritance with him. -% -Never settle with words what you can accomplish with a flame thrower. -% -Never sleep with a woman whose troubles are worse than your own. - -- Nelson Algren -% -Never speak ill of yourself, your friends will always say enough on -that subject. - -- Charles-Maurice De Talleyrand -% -NEVER swerve to hit a lawyer riding a bicycle -- it might be your bicycle. -% -Never tell. Not if you love your wife ... In fact, if your old lady walks -in on you, deny it. Yeah. Just flat out and she'll believe it: "I'm -tellin' ya. This chick came downstairs with a sign around her neck `Lay -On Top Of Me Or I'll Die'. I didn't know what I was gonna do..." - -- Lenny Bruce -% -Never tell a lie unless it is absolutely convenient. -% -Never tell people how to do things. Tell them WHAT to -do and they will surprise you with their ingenuity. - -- Gen. George S. Patton, Jr. -% -Never test for an error condition you don't know how to handle. - -- Steinbach -% -Never test the depth of the water with both feet. -% -Never trust a child farther than you can throw it. -% -Never trust a computer you can't repair yourself. -% -Never trust an automatic pistol or a D.A.'s deal. - -- John Dillinger -% -Never trust an operating system. -% -Never trust anybody whose arm is bigger than your leg. -% -Never trust anyone who says money is no object. -% -Never try to explain computers to a layman. It's easier to explain -sex to a virgin. - -- Robert A. Heinlein - -(Note, however, that virgins tend to know a lot about computers.) -% -Never try to outstubborn a cat. - -- Lazarus Long, "Time Enough for Love" -% -Never try to teach a pig to sing. -It wastes your time and annoys the pig. -% -Never underestimate the bandwidth of a station wagon full of tapes. - -- Dr. Warren Jackson, Director, UTCS -% -Never underestimate the power of a small tactical nuclear weapon. -% -Never underestimate the power of human stupidity. - -- Robert A. Heinlein -% -Never use "etc." -- it makes people think there is more where -there is not or that there is not space to list it all, etc. -% -Never volunteer for anything. - -- Lackland -% -Never worry about theory as long as the -machinery does what it's supposed to do. - -- Robert A. Heinlein -% -New, adj.: - Different color from previous model. -% -New crypt. See /usr/news/crypt. -% -New England Life, of course. Why do you ask? -% -New Hampshire law forbids you to tap your feet, nod your head, or in -any way keep time to the music in a tavern, restaurant, or cafe. -% -New members are urgently needed in the Society -for Prevention of Cruelty to Yourself. Apply within. -% -New members urgently required for SUICIDE CLUB, Watford area. - -- Monty Python's Big Red Book -% -New release: - Abortions are becoming so popular in some countries that the waiting - time to get one is lengthening rapidly. Experts predict that at this - rate there will soon be an up to a one year wait. -% -New Year's Eve is the time of year when a man most feels his -age, and his wife most often reminds him to act it. - -- Webster's Unafraid Dictionary -% -New York is real. The rest is done with mirrors. -% -New York now leads the world's great cities in the number of people around -whom you shouldn't make a sudden move. - -- David Letterman -% -New York-- to that tall skyline I come -Flyin' in from London to your door -New York-- lookin' down on Central Park -Where they say you should not wander after dark. -New York. - -- Simon and Garfunkel -% -New York's got the ways and means; -Just won't let you be. - -- The Grateful Dead -% -Newlan's Truism: - An "acceptable" level of unemployment means that the - government economist to whom it is acceptable still has a job. -% -Newman's Discovery: - Your best dreams may not come true; - fortunately, neither will your worst dreams. -% -NEWS FLASH!! - Today the East German pole-vault champion - became the West German pole-vault champion. -% -news: gotcha -% -NEWSFLASH!! - Rodney Fenster looked up the shaft of elevator number four at -1700 N. 17th St. this morning to see if the elevator was on its way down. -It was. Age 31. -% -Newspaper editors are men who separate the wheat from the chaff, and then -print the chaff. - -- Adlai E. Stevenson -% -Newton's Fourth Law: Every action has an equal and opposite satisfaction. -% -Newton's Little-Known Seventh Law: - A bird in the hand is safer than one overhead. -% -Next Friday will not be your lucky day. -As a matter of fact, you don't have a lucky day this year. -% -Nice boy, but about as sharp as a sack of wet mice. - -- Foghorn Leghorn -% -Nice guys don't finish nice. -% -Nice guys finish last. - -- Leo Durocher -% -Nice guys finish last, but we get to sleep in. - -- Evan Davis -% -Nice guys get sick. -% -Nick the Greek's Law of Life: - All things considered, life is 9 to 5 against. -% -Nietzsche is pietzsche, Goethe is murder. -% -Nietzsche says that we will live the same life, over and over again. -God -- I'll have to sit through the Ice Capades again. - -- Woody Allen, "Hannah and Her Sisters" -% -Nihilism should commence with oneself. -% -Niklaus Wirth has lamented that, whereas Europeans pronounce his -name correctly (Ni-klows Virt), Americans invariably mangle it into -(Nick-les Worth). Which is to say that Europeans call him by name, -but Americans call him by value. -% -Nine megs for the secretaries fair, -Seven megs for the hackers scarce, -Five megs for the grads in smoky lairs, -Three megs for system source; - -One disk to rule them all, -One disk to bind them, -One disk to hold the files -And in the darkness grind 'em. -% -Nine-track tapes and seven-track tapes -And tapes without any tracks; -Stretchy tapes and snarley tapes -And tapes mixed up on the racks -- - Take hold of the tape - And pull off the strip, - And then you'll be sure - Your tape drive will skip. - - -- Uncle Colonel's Cursory Rhymes -% -Ninety percent of the politicians give the other ten percent a bad reputation. - -- Henry Kissinger -% -Ninety percent of the time things turn out worse than you thought they would. -The other ten percent of the time you had no right to expect that much. - -- Augustine -% -Ninety-Ninety Rule of Project Schedules: - The first ninety percent of the task takes ninety percent of - the time, and the last ten percent takes the other ninety percent. -% -Nirvana? That's the place where the powers -that be and their friends hang out. - -- Zonker Harris -% -Nitwit ideas are for emergencies. You use them when you've got nothing -else to try. If they work, they go in the Book. Otherwise you follow -the Book, which is largely a collection of nitwit ideas that worked. - -- Larry Niven, "The Mote in God's Eye" -% -No act of kindness, no matter how small, is ever wasted. - -- Aesop -% -No amount of careful planning will ever replace dumb luck. -% -No amount of genius can overcome a preoccupation with detail. -% -No animal should ever jump on the dining room furniture unless -absolutely certain he can hold his own in conversation. - -- Fran Lebowitz -% -No bird soars too high if he soars with his own wings. - -- William Blake -% -No brainer, n.: - A decision which, viewed through the retrospectoscope, - is "obvious" to those who failed to make it originally. -% -No character, however upright, is a match for -constantly reiterated attacks, however false. - -- Alexander Hamilton -% -No Civil War picture ever made a nickel. - -- MGM executive Irving Thalberg to Louis B. Mayer about - film rights to "Gone With the Wind". - Cerf/Navasky, "The Experts Speak" -% -No committee could ever come up with anything as revolutionary as a -camel -- anything as practical and as perfectly designed to perform -effectively under such difficult conditions. - -- Dr. Laurence J. Peter -% -No directory. -% -No discipline is ever requisite to force attendance upon -lectures which are really worth the attending. - -- Adam Smith, "The Wealth of Nations" -% -No doubt Jack the Ripper excused himself -on the grounds that it was human nature. -% -No, "Eureka" is Greek for "This bath is too hot." - -- The Doctor, "Doctor Who" -% -No evil can happen to a good man. - -- Plato -% -No excellent soul is exempt from a mixture of madness. - -- Aristotle -% -No extensible language will be universal. - -- T. Cheatham -% -No friendship is so cordial or so delicious as that of girl for girl; -no hatred so intense or immovable as that of woman for woman. - -- Landor -% -No group of professionals meets except to -conspire against the public at large. - -- Mark Twain -% -No guest is so welcome in a friend's house that -he will not become a nuisance after three days. - -- Titus Maccius Plautus -% -No guts, no glory. -% -No hardware designer should be allowed to produce any piece of hardware -until three software guys have signed off for it. - -- Andrew S. Tanenbaum -% -No, his mind is not for rent -To any god or government. -Always hopeful, yet discontent, -He knows changes aren't permanent - -But change is. -% -No house is childproofed unless the little darlings are in straitjackets. -% -No house should ever be on any hill or on anything. -It should be of the hill, belonging to it. - -- Frank Lloyd Wright -% -No, I don't have a drinking problem. -I drink, I get drunk, I fall down. No problem! -% -No, I'm not interested in developing a powerful brain. All I'm after is -just a mediocre brain, something like the president of American Telephone -and Telegraph Company. - -- Alan Turing on the possibilities of a thinking - machine, 1943. -% -No is no negative in a woman's mouth. - -- Sidney -% -No job too big; no fee too big! - -- Dr. Peter Venkman, "Ghostbusters" -% -No line available at 300 baud. -% -No live organism can continue for long to exist sanely under conditions of -absolute reality; even larks and katydids are supposed, by some, to dream. -Hill House, not sane, stood by itself against its hills, holding darkness -within; it had stood so for eighty years and might stand for eighty more. -Within, walls continued upright, bricks met neatly, floors were firm, and -doors were sensibly shut; silence lay steadily against the wood and stone -of Hill House, and whatever walked there, walked alone. - -- Shirley Jackson, "The Haunting of Hill House" -% -No maintenance: - Impossible to fix. -% -No man can have a reasonable opinion of women until he has long lost -interest in hair restorers. - -- Austin O'Malley -% -No man in the world has more courage than the man who can stop after eating -one peanut. - -- Channing Pollock -% -No man is an Iland, intire of it selfe; every man is a peece of the -Continent, a part of the maine; if a Clod bee washed away by the Sea, -Europe is the lesse, as well as if a Promontorie were, as well as if -a Mannor of thy friends or of thine owne were; any mans death diminishes -me, because I am involved in Mankinde; And therefore never send to know -for whom the bell tolls; It tolls for thee. - -- John Donne, "No Man is an Iland" -% -No man is an island, but some of us are long peninsulas. -% -No man is an island if he's on at least one mailing list. -% -No man is useless who has a friend, -and if we are loved we are indispensable. - -- Robert Louis Stevenson -% -No man would listen to you talk if he didn't know it was his turn next. - -- Edgar W. Howe -% -No man's ambition has a right to stand in -the way of performing a simple act of justice. - -- John Altgeld -% -No Marxist can deny that the interests of socialism are higher -than the interests of the right of nations to self-determination. - -- Lenin, 1918 -% -No matter how celebrated the beauty of a woman, I would never spend a night -with her. The only celebrity with whom I would share a night is Max Planck. -But he is dead. So I live like a monk, aside from a little self gratification -in the afternoons. - -- Salvador Dali -% -No matter how cynical you get, it's impossible to keep up. -% -No matter how much you do you never do enough. -% -No matter how old a mother is, she watches her middle-aged children for -signs of improvement. - -- Florida Scott-Maxwell -% -No matter how subtle the wizard, a knife in the shoulder blades will seriously -cramp his style. -% -No matter what happens, there is always someone who knew it would. -% -No matter what other nations may say about the United States, -immigration is still the sincerest form of flattery. -% -No matter where I go, the place is always called "here". -% -No matter who you are, some scholar can show you -the great idea you had was had by someone before you. -% -No matther whether th' constitution follows th' flag or not, -th' supreme court follows th' iliction returns. - -- Mr. Dooley -% -No modern woman with a grain of sense ever sends little notes to an -unmarried man -- not until she is married, anyway. - -- Arthur Binstead -% -No, my friend, the way to have good and safe government, is not to trust it -all to one, but to divide it among the many, distributing to every one exactly -the functions he is competent to. It is by dividing and subdividing these -republics from the national one down through all its subordinations, until it -ends in the administration of every man's farm by himself; by placing under -every one what his own eye may superintend, that all will be done for the best. - -- Thomas Jefferson, to Joseph Cabell, 1816 -% -No one becomes depraved in a moment. - -- Decimus Junius Juvenalis -% -No one can feel as helpless as the owner of a sick goldfish. -% -No one can have a higher opinion of him than I have, and I think he's a -dirty little beast. - -- W. S. Gilbert -% -No one can make you feel inferior without your consent. - -- Eleanor Roosevelt -% -No one can put you down without your full cooperation. -% -No one gets sick on Wednesdays. -% -No one gets too old to learn a new way of being stupid. -% -No one has a higher opinion of him than he has. - -- Greg Lehey, FreeBSDcon 1999 -% -No one knows like a woman how to say -things that are at once gentle and deep. - -- Hugo -% -No one knows what he can do till he tries. - -- Publilius Syrus -% -No one regards what is before his feet; we all gaze at the stars. - -- Quintus Ennius -% -No one should have to wait until after ten o'clock for his english muffin! - -- Snoopy -% -No one so thoroughly appreciates the value of constructive criticism as the -one who's giving it. - -- Hal Chadwick -% -NO OPIUM-SMOKING IN THE ELEVATORS - -- sign in the Rand Hotel, New York, 1907 -% -No part of this message may reproduce, store itself in a retrieval -system, or transmit disease, in any form, without the permissiveness of -the author. - -- Chris Shaw -% -No pig should go sky diving during monsoon -For this isn't really the norm. -But should a fat swine try to soar like a loon, -So what? Any pork in a storm. - -No pig should go sky diving during monsoon, -It's risky enough when the weather is fine. -But to have a pig soar when the monsoon doth roar -Cast even more perils before swine. -% -No plain fanfold paper could hold that fractal Puff -- -He grew so fast no plotting pack could shrink him far enough. -Compiles and simulations grew so quickly tame -And swapped out all their data space when Puff pushed his stack frame. - (refrain) -Puff, he grew so quickly, while others moved like snails -And mini-Puffs would perch themselves on his gigantic tail. -All the student hackers loved that fractal Puff -But DCS did not like Puff, and finally said, "Enough!" - (refrain) -Puff used more resources than DCS could spare. -The operator killed Puff's job -- he didn't seem to care. -A gloom fell on the hackers; it seemed to be the end, -But Puff trapped the exception, and grew from naught again! - (refrain) -Refrain: - Puff the fractal dragon was written in C, - And frolicked while processes switched in mainframe memory. - Puff the fractal dragon was written in C, - And frolicked while processes switched in mainframe memory. -% -No poet or novelist wishes he was the only one who ever lived, but most of -them wish they were the only one alive, and quite a number fondly believe -their wish has been granted. - -- W. H. Auden, "The Dyer's Hand" -% -No problem is insoluble in all conceivable circumstances. -% -No problem is so formidable that you can't just walk away from it. - -- C. Schulz -% -No problem is so large it can't be fit in somewhere. -% -"No program is perfect," -They said with a shrug. -"The customer's happy-- -What's one little bug?" - -But he was determined, Then change two, then three more, -The others went home. As year followed year. -He dug out the flow chart And strangers would comment, -Deserted, alone. "Is that guy still here?" - -Night passed into morning. He died at the console -The room was cluttered Of hunger and thirst -With core dumps, source listings. Next day he was buried -"I'm close," he muttered. Face down, nine edge first. - -Chain smoking, cold coffee, And his wife through her tears -Logic, deduction. Accepted his fate. -"I've got it!" he cried, Said "He's not really gone, -"Just change one instruction." He's just working late." - -- The Perfect Programmer -% -No proper program contains an indication which as an operator-applied -occurrence identifies an operator-defining occurrence which as an -indication-applied occurrence identifies an indication-defining occurrence -different from the one identified by the given indication as an -indication-applied occurrence. - -- ALGOL 68 Report -% -No question is so difficult as one to which the answer is obvious. -% -No rock so hard but that a little wave -May beat admission in a thousand years. - -- Tennyson -% -No self-made man ever did such a good job -that some woman didn't want to make some alterations. - -- Kin Hubbard -% -No self-respecting fish would want to be wrapped in that kind of -paper. - -- Mike Royko on the Chicago Sun-Times after it was - taken over by Rupert Murdoch -% -No skis take rocks like rental skis! -% -No small art is it to sleep: it is necessary -for that purpose to keep awake all day. - -- Friedrich Nietzsche -% -No snowflake in an avalanche ever feels responsible. -% -No sooner had Edger Allen Poe -Finished his old Raven, -then he started his Old Crow. -% -No sooner said than done -- so acts your man of worth. - -- Quintus Ennius -% -No spitting on the Bus! -Thank you, The Management. -% -No television performance takes as much preparation as an off-the-cuff talk. - -- Richard M. Nixon -% -No two persons ever read the same book. - -- Edmund Wilson -% -No use getting too involved in life -- -you're only here for a limited time. -% -No violence, gentlemen -- no violence, I beg of you! Consider the furniture! - -- Sherlock Holmes -% -No woman can endure a gambling husband, unless he is a steady winner. - -- Lord Thomas Robert Dewar -% -No woman ever falls in love with a man unless she has a better opinion of -him than he deserves. - -- Edgar W. Howe -% -No wonder Clairol makes so much money selling shampoo. -Lather, Rinse, Repeat is an infinite loop! -% -No wonder you're tired! You understood so much today. -% -No yak too dirty; no dumpster too hollow. -% -Nobody can be as agreeable as an uninvited guest. -% -Nobody can be exactly like me. Sometimes even I have trouble doing -it. - -- Tallulah Bankhead -% -Nobody ever died from oven crude poisoning. -% -Nobody ever forgets where he buried the hatchet. - -- Kin Hubbard -% -Nobody ever ruined their eyesight by looking at the bright side of something. -% -NOBODY EXPECTS THE SPANISH INQUISITION. -% -Nobody is one block of harmony. We are all afraid of something, or feel -limited in something. We all need somebody to talk to. It would be good -if we talked to each other--not just pitter-patter, but real talk. We -shouldn't be so afraid, because most people really like this contact; -that you show you are vulnerable makes them free to be vulnerable too. -It's so much easier to be together when we drop our masks. - -- Liv Ullman -% -Nobody knows the trouble I've been. -% -Nobody knows what goes between his cold toes and his warm ears. - -- Roy Harper -% -Nobody loves me, -Everybody hates me, -I think I'll go out and eat worms. -I'm gonna cut their heads off, -Eat their insides out, -And throw way the skins. -Big, fat, juicy ones, -Little, skinny, cute ones, -Watch how they wiggle and they squirm. -% -Nobody really knows what happiness is, until they're married. -And then it's too late. -% -Nobody said computers were going to be polite. -% -Nobody shot me. - -- Frank Gusenberg, his last words, when asked by police - who had shot him 14 times with a machine gun in the - Saint Valentine's Day Massacre. - -Only Capone kills like that. - -- George "Bugs" Moran, on the Saint Valentine's Day Massacre - -The only man who kills like that is Bugs Moran. - -- Al Capone, on the Saint Valentine's Day Massacre -% -Nobody suffers the pain of birth or the anguish of loving a child in order -for presidents to make wars, for governments to feed on the substance of -their people, for insurance companies to cheat the young and rob the old. - -- Lewis Lapham -% -Nobody takes a bribe. Of course at Christmas if you happen to hold out -your hat and somebody happens to put a little something in it, well, that's -different. - -- New York City Police Commissioner (Ret.) William P. - O'Brien, instructions to the force. -% -Nobody wants constructive criticism. -It's all we can do to put up with constructive praise. -% -Nobody's gonna believe that computers are intelligent until they start -coming in late and lying about it. -% -nohup rm -fr /& -% -Noise proves nothing. Often a hen who has -merely laid an egg cackles as if she laid an asteroid. - -- Mark Twain -% -Nolo contendere: - A legal term meaning: "I didn't do it, judge, and I'll never do - it again." -% -Nominal egg: - New Yorkerese for expensive. -% -Noncombatant, n.: - A dead Quaker. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Non-Determinism is not meant to be reasonable. - -- M. J. 0'Donnell -% -Nondeterminism means never having to say you are wrong. -% -None love the bearer of bad news. - -- Sophocles -% -None of our men are "experts." We have most unfortunately found it necessary -to get rid of a man as soon as he thinks himself an expert -- because no one -ever considers himself expert if he really knows his job. A man who knows a -job sees so much more to be done than he has done, that he is always pressing -forward and never gives up an instant of thought to how good and how efficient -he is. Thinking always ahead, thinking always of trying to do more, brings a -state of mind in which nothing is impossible. The moment one gets into the -"expert" state of mind a great number of things become impossible. - -- From Henry Ford Sr., "My Life and Work" -% -Non-Reciprocal Laws of Expectations: - Negative expectations yield negative results. - Positive expectations yield negative results. -% -Nonsense. Space is blue and birds fly through it. - -- Heisenberg -% -Nonsense and beauty have close connections. - -- E. M. Forster -% -Non-sequiturs make me eat lampshades. -% -Noone ever built a statue to a critic. -% -No-one would remember the Good Samaritan if he had only had good -intentions. He had money as well. - -- Margaret Thatcher -% -Norbert Wiener was the subject of many dotty professor stories. Wiener was, in -fact, very absent minded. The following story is told about him: when they -moved from Cambridge to Newton his wife, knowing that he would be absolutely -useless on the move, packed him off to MIT while she directed the move. Since -she was certain that he would forget that they had moved and where they had -moved to, she wrote down the new address on a piece of paper, and gave it to -him. Naturally, in the course of the day, an insight occurred to him. He -reached in his pocket, found a piece of paper on which he furiously scribbled -some notes, thought it over, decided there was a fallacy in his idea, and -threw the piece of paper away. At the end of the day he went home (to the -old address in Cambridge, of course). When he got there he realized that they -had moved, that he had no idea where they had moved to, and that the piece of -paper with the address was long gone. Fortunately inspiration struck. There -was a young girl on the street and he conceived the idea of asking her where -he had moved to, saying, "Excuse me, perhaps you know me. I'm Norbert Wiener -and we've just moved. Would you know where we've moved to?" To which the -young girl replied, "Yes, Daddy, Mommy thought you would forget." - The capper to the story is that I asked his daughter (the girl in the -story) about the truth of the story, many years later. She said that it wasn't -quite true -- that he never forgot who his children were! The rest of it, -however, was pretty close to what actually happened... - -- Richard Harter -% -Norm: Hey, everybody. -All: [silence; everybody is mad at Norm for being rich.] -Norm: [Carries on both sides of the conversation himself.] - Norm! (Norman.) - How are you feeling today, Norm? - Rich and thirsty. Pour me a beer. - -- Cheers, Tan 'n Wash - -Woody: What's the latest, Mr. Peterson? -Norm: Zsa-Zsa marries a millionaire, Peterson drinks a beer. - Film at eleven. - -- Cheers, Knights of the Scimitar - -Woody: How are you today, Mr. Peterson? -Norm: Never been better, Woody. ... Just once I'd like to be better. - -- Cheers, Chambers vs. Malone -% -Norm: Gentlemen, start your taps. - -- Cheers, The Coach's Daughter - -Coach: How's life treating you, Norm? -Norm: Like it caught me in bed with his wife. - -- Cheers, Any Friend of Diane's - -Coach: How's life, Norm? -Norm: Not for the squeamish, Coach. - -- Cheers, Friends, Romans, and Accountants -% -[Norm comes in with an attractive woman.] - -Coach: Normie, Normie, could this be Vera? -Norm: With a lot of expensive surgery, maybe. - -- Cheers, Norman's Conquest - -Coach: What's up, Normie? -Norm: The temperature under my collar, Coach. - -- Cheers, I'll Be Seeing You (Part 2) - -Coach: What would you say to a nice beer, Normie? -Norm: Going down? - -- Cheers, Diane Meets Mom -% -[Norm goes into the bar at Vic's Bowl-A-Rama.] - -Off-screen crowd: Norm! -Sam: How the hell do they know him here? -Cliff: He's got a life, you know. - -- Cheers, From Beer to Eternity - -Woody: What can I do for you, Mr. Peterson? -Norm: Elope with my wife. - -- Cheers, The Triangle - -Woody: How's life, Mr. Peterson? -Norm: Oh, I'm waiting for the movie. - -- Cheers, Take My Shirt... Please? -% -[Norm is angry.] - -Woody: What can I get you, Mr. Peterson? -Norm: Clifford Clavin's head. - -- Cheers, The Triangle - -Sam: Hey, what's happening, Norm? -Norm: Well, it's a dog-eat-dog world, Sammy, - and I'm wearing Milk-Bone underwear. - -- Cheers, The Peterson Principle - -Sam: How's life in the fast lane, Normie? -Norm: Beats me, I can't find the on-ramp. - -- Cheers, Diane Chambers Day -% -[Norm returns from the hospital.] - -Coach: What's up, Norm? -Norm: Everything that's supposed to be. - -- Cheers, Diane Meets Mom - -Sam: What's new, Normie? -Norm: Terrorists, Sam. They've taken over my stomach. - They're demanding beer. - -- Cheers, The Heart is a Lonely Snipehunter - -Coach: What'll it be, Normie? -Norm: Just the usual, Coach. I'll have a froth of beer and a snorkel. - -- Cheers, King of the Hill -% -[Norm tries to prove that he is not Anton Kreitzer.] -Norm: Afternoon, everybody! -All: Anton! - -- Cheers, The Two Faces of Norm - -Woody: What's going on, Mr. Peterson? -Norm: A flashing sign in my gut that says, "Insert beer here." - -- Cheers, Call Me, Irresponsible - -Sam: What can I get you, Norm? -Norm: [scratching his beard] Got any flea powder? Ah, just kidding. - Gimme a beer; I think I'll just drown the little suckers. - -- Cheers, Two Girls for Every Boyd -% -Normal times may possibly be over forever. -% -Normally our rules are rigid; we tend to discretion, if for no other -reason than self-protection. We never recommend any of our graduates, -although we cheerfully provide information as to those who have failed -their courses. - -- Jack Vance, "Freitzke's Turn" -% -Nostalgia is living life in the past lane. -% -Nostalgia just isn't what it used to be. -% -Not all men who drink are poets. -Some of us drink because we aren't poets. -% -Not all who own a harp are harpers. - -- Marcus Terentius Varro -% -Not drinking, chasing women, or doing drugs won't -make you live longer -- it just seems that way. -% -Not every problem someone has with his girlfriend is necessarily due to -the capitalist mode of production. - -- Herbert Marcuse -% -Not every question deserves an answer. -% -Not everything worth doing is worth doing well. -% -Not far from here, by a white sun, behind a green star, lived the -Steelypips, illustrious, industrious, and they hadn't a care: no spats -in their vats, no rules, no schools, no gloom, no evil influence of the -moon, no trouble from matter or antimatter -- for they had a machine, a -dream of a machine, with springs and gears and perfect in every -respect. And they lived with it, and on it, and under it, and inside -it, for it was all they had -- first they saved up all their atoms, -then they put them all together, and if one didn't fit, why they -chipped at it a bit, and everything was just fine ... - -- Stanislaw Lem, "Cyberiad" -% -Not Hercules could have knock'd out his brains, for he had none. - -- William Shakespeare -% -Not only is this incomprehensible, but the ink is -ugly and the paper is from the wrong kind of tree. - -- Professor W., EECS, George Washington University - -I'm looking forward to working with you on this next year. - -- Professor, Harvard, on a senior thesis -% -Not only is UNIX dead, it's starting to smell really bad. - -- Rob Pike -% -Not that we needed all that stuff, but when you get locked into a -serious drug collection the tendency is to push it as far as you can. - -- Hunter S. Thompson, "Fear and Loathing in Las Vegas" -% -Not to laugh, not to lament, not to curse, but to understand. - -- Spinoza -% -Not to mention the fact that most of the good code for PC minix seems -to have been written by Bruce Evans. - -- Linus Torvalds, comp.os.minix, Jan. 1992 -% -NOTE: No warranties, either express or implied, are hereby given. -All software is supplied as is, without guarantee. The user assumes -all responsibility for damages resulting from the use of these -features, including, but not limited to, frustration, disgust, system -abends, disk head-crashes, general malfeasance, floods, fires, shark -attack, nerve gas, locust infestation, cyclones, hurricanes, tsunamis, -local electromagnetic disruptions, hydraulic brake system failure, -invasion, hashing collisions, normal wear and tear of friction -surfaces, comic radiation, inadvertent destruction of sensitive -electronic components, windstorms, the Riders of Nazgul, infuriated -chickens, malfunctioning mechanical or electrical sexual devices, -premature activation of the distant early warning system, peasant -uprisings, halitosis, artillery bombardment, explosions, cave-ins, -and/or frogs falling from the sky. -% -Note: The system panics with a "NULL pointer dereference" message - -Failed due to: SunOS 5.8 is installed. - -- Output of a SunCheckup run on a Solaris 8 machine -% -Note to myself: use real bullets next time. -% -Notes for a ballet, "The Spell": ... Suddenly Sigmund hears the flutter of -wings, and a group of wild swans flies across the moon ... Sigmund is -astounded to see that their leader is part swan and part woman -- -unfortunately, divided lengthwise. She enchants Sigmund, who is careful -not to make any poultry jokes. - -- Woody Allen -% -Nothing astonishes men so much as common sense and plain dealing. - -- Ralph Waldo Emerson -% -Nothing can be done in one trip. - -- Snider -% -Nothing cures insomnia like the realization that it's time to get up. -% -Nothing endures but change. - -- Heraclitus - [Yeah, yeah, "Everything changes but change itself." --JFK Ed.] -% -Nothing ever becomes real till it is experienced -- even a -proverb is no proverb to you till your life has illustrated it. - -- John Keats -% -Nothing in life is so exhilarating as to be shot at without result. - -- Winston Churchill - -Next to being shot at and missed, nothing is really quite as -satisfying as an income tax refund. - -- F. J. Raymond -% -Nothing in life is to be feared. It is only to be understood. -% -Nothing increases your golf score like witnesses. -% -Nothing is as simple as it seems at first - Or as hopeless as it seems in the middle - Or as finished as it seems in the end. -% -Nothing is but what is not. -% -Nothing is ever a total loss; it can always serve as a bad example. -% -Nothing is faster than the speed of light. - -To prove this to yourself, try opening the -refrigerator door before the light comes on. -% -Nothing is finished until the paperwork is done. -% -Nothing is illegal if one hundred businessmen decide to do it. - -- Andrew Young -% -Nothing is impossible for the man who doesn't have to do it himself. - -- A. H. Weiler -% -Nothing is more admirable than the fortitude with which -millionaires tolerate the disadvantages of their wealth. - -- Nero Wolfe -% -Nothing is more quiet than the sound of hair going grey. -% -Nothing is rich but the inexhaustible wealth of nature. -She shows us only surfaces, but she is a million fathoms deep. - -- Ralph Waldo Emerson -% -Nothing is so firmly believed as that which we least know. - -- Michel de Montaigne -% -Nothing is so often irretrievably missed as a daily opportunity. - -- Ebner-Eschenbach -% -Nothing lasts forever. -Where do I find nothing? -% -Nothing makes a person more productive than the last minute. -% -Nothing makes one so vain as being told that one is a sinner. -Conscience makes egotists of us all. - -- Oscar Wilde -% -Nothing matters very much, and few things matter at all. - -- Arthur Balfour -% -Nothing motivates a man more than to -see his boss put in an honest day's work. -% -Nothing, nothing, nothing, no error, no crime is so absolutely -repugnant to God as everything which is official; and why? because -the official is so impersonal and therefore the deepest insult -which can be offered to a personality. - -- S. A. Kierkegaard (1813-1855) -% -Nothing recedes like success. - -- Walter Winchell -% -Nothing shortens a journey so pleasantly as an account of misfortunes at -which the hearer is permitted to laugh. - -- Quentin Crisp -% -Nothing so needs reforming as other people's habits. - -- Mark Twain -% -Nothing succeeds like success. - -- Alexandre Dumas -% -Nothing succeeds like the appearance of success. - -- Christopher Lascl -% -Nothing takes the taste out of peanut butter quite like unrequited love. - -- Charlie Brown -% -Nothing that's forced can ever be right, -If it doesn't come naturally, leave it. -That's what she said as she turned out the light, -And we bent our backs as slaves of the night, -Then she lowered her guard and showed me the scars -She got from trying to fight -Saying, oh, you'd better believe it. -[...] -Well nothing that's real is ever for free -And you just have to pay for it sometime. -She said it before, she said it to me, -I suppose she believed there was nothing to see, -But the same old four imaginary walls -She'd built for livin' inside -I said oh, you just can't mean it. -[...] -Well nothing that's forced can ever be right, -If it doesn't come naturally, leave it. -That's what she said as she turned out the light, -And she may have been wrong, and she may have been right, -But I woke with the frost, and noticed she'd lost -The veil that covered her eyes, -I said oh, you can leave it. - -- Al Stewart, "If It Doesn't Come Naturally, Leave It" -% -Nothing will dispel enthusiasm like a small admission fee. - -- Kin Hubbard -% -Nothing will ever be attempted -if all possible objections must be first overcome. - -- Dr. Johnson -% -NOTICE: - Anyone seen smoking will be assumed to be on fire and will - be summarily put out. -% -NOTICE: - --- THE ELEVATORS WILL BE OUT OF ORDER TODAY -- - -(The nearest working elevator is in the building across the street.) -% -Nouvelle cuisine, n.: - French for "not enough food". - -Continental breakfast, n.: - English for "not enough food". - -Tapas, n.: - Spanish for "not enough food". - -Dim Sum, n.: - Chinese for more food than you've ever seen in your entire life. -% -November, n.: - The eleventh twelfth of a weariness. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Novinson's Revolutionary Discovery: - - When comes the revolution, things will be different -- - not better, just different. -% -Now and then an innocent person is sent to the legislature. -% -Now hatred is by far the longest pleasure; -Men love in haste, but they detest at leisure. - -- George Gordon, Lord Byron, "Don Juan" -% -Now I lay me back to sleep. -The speaker's dull; the subject's deep. -If he should stop before I wake, -Give me a nudge for goodness' sake. - -- Anonymous -% -Now I lay me down to sleep -I pray the double lock will keep; -May no brick through the window break, -And, no one rob me till I awake. -% -Now I lay me down to sleep, -I pray the Lord my soul to keep, -If I should die before I wake, -I'll cry in anguish, "Mistake!! Mistake!!" -% -Now I lay me down to study, -I pray the Lord I won't go nutty. -And if I fail to learn this junk, -I pray the Lord that I won't flunk. -But if I do, don't pity me at all, -Just lay my bones in the study hall. -Tell my teacher I've done my best, -Then pile my books upon my chest. -% -Now is the time for all good men to come to. - -- Walt Kelly -% -Now is the time for drinking; -now the time to beat the earth with unfettered foot. - -- Quintus Horatius Flaccus (Horace) -% -Now it's time to say goodbye -To all our company... -M-I-C (see you next week!) -K-E-Y (Why? Because we LIKE you!) -M-O-U-S-E. -% -Now of my threescore years and ten, -Twenty will not come again, -And take from seventy springs a score, -It leaves me only fifty more. - -And since to look at things in bloom -Fifty springs are little room, -About the woodlands I will go -To see the cherry hung with snow. - -- A. E. Housman -% -Now that day wearies me, -My yearning desire -Will receive more kindly, -Like a tired child, the starry night. - -Hands, leave off your deeds, -Mind, forget all thoughts; -All of my forces -Yearn only to sink into sleep. - -And my soul, unguarded, -Would soar on widespread wings, -To live in night's magical sphere -More profoundly, more variously. - -- Hermann Hesse, "Going to Sleep" -% -Now that you've read Fortune's diet truths, you'll be prepared the next time -some housewife or boutique owner turned diet expert appears on TV to plug -her latest book. And, if you still feel a twinge of guilt for eating coffee -cake while listening to her exhortations, ask yourself the following questions: - -1: Do I dare trust a person who actually considers alfalfa sprouts a food? -2: Was the author's sole motive in writing this book to get rich - exploiting the forlorn hopes of chubby people like me? -3: Would a longer life be worthwhile if it had to be lived as prescribed... - without French-fried onion rings, pizza with double cheese, or the - occasional Mai-Tai? (Remember, living right doesn't really make - you live longer, it just *seems* like longer.) - -That, and another piece of coffee cake, should do the trick. -% -Now the Lord God planted a garden East of Whittier in a place called -Yorba Linda, and out of the ground he made to grow orange trees that -were good for food and the fruits thereof he labeled SUNKIST ... - -- "The Begatting of a President" -% -Now there's a violent movie titled, "The Croquet Homicide," -or "Murder With Mallets Aforethought." - -- Shelby Friedman, WSJ -% -Now there's three things you can do in a baseball game: -you can win or you can lose or it can rain. - -- Casey Stengel -% -Now this is a totally brain damaged algorithm. Gag me with a -smurfette. - -- P. Buhr, Computer Science 354 -% -Nowlan's Theory: - He who hesitates is not only lost, but several miles from - the next freeway exit. -% -Now's the time to have some big ideas -Now's the time to make some firm decisions -We saw the Buddha in a bar down south -Talking politics and nuclear fission -We see him and he's all washed up -- -Moving on into the body of a beetle -Getting ready for a long long crawl -He ain't nothing -- he ain't nothing at all... - -Death and Money make their point once more -In the shape of Philosophical assassins -Mark and Danny take the bus uptown -Deadly angels for reality and passion -Have the courage of the here and now -Don't taking nothing from the half-baked buddhas -When you think you got it paid in full -You got nothing -- you got nothing at all... - We're on the road and we're gunning for the Buddha. - We know his name and he mustn't get away. - We're on the road and we're gunning for the Buddha. - It would take one shot -- to blow him away... - -- Shriekback, "Gunning for the Buddha" -% -Nuclear powered vacuum cleaners will probably be a reality within 10 years. - -- Alex Lewyt (President of the Lewyt Corporation, - manufacturers of vacuum cleaners), quoted in The New York - Times, June 10, 1955. -% -[Nuclear war] ... may not be desirable. - -- Edwin Meese III -% -Nuclear war can ruin your whole compile. - -- Karl Lehenbauer -% -Nuclear war would mean abolition of most comforts, and disruption of -normal routines, for children and adults alike. - -- Willard F. Libby, "You Can Survive Atomic Attack" -% -Nuclear war would really set back cable. - -- Ted Turner -% -Nudists are people who wear one-button suits. -% -Nuke the unborn gay female whales for Jesus. -% -Nuke them till they glow, then shoot them in the dark. -% -(null cookie; hope that's ok) -% -Nullum magnum ingenium sine mixtura dementiae fuit. - -- Seneca -% -Numeric stability is probably not all that important when you're guessing. -% -Nurse Donna: Oh, Groucho, I'm afraid I'm gonna wind up an old maid. -Groucho: Well, bring her in and we'll wind her up together. -Nurse Donna: Do you believe in computer dating? -Groucho: Only if the computers really love each other. -% -Nusbaum's Rule: - The more pretentious the corporate name, the smaller the - organization. (For instance, the Murphy Center for the - Codification of Human and Organizational Law, contrasted - to IBM, GM, and AT&T.) -% -O! If I were a fish -I'd lay hap'ly on my dish. -Yes, that's my one and only wish -- -To be a fish! - -For fish don't ever mish; -They needn't flush after they pish! -Yes, and life's just swish, swish, swish, -For all the fish!!! -% -O give me a home, -Where the buffalo roam, -Where the deer and the antelope play, -Where seldom is heard -A discouraging word, -'Cause what can an antelope say? -% -O imitators, you slavish herd! - -- Quintus Horatius Flaccus (Horace) -% -O, it is excellent -To have a giant's strength; but it is tyrannous -To use it like a giant. - -- William Shakespeare, "Measure for Measure", II, 2 -% -O Lord, grant that we may always be right, -for Thou knowest we will never change our minds. -% -O love, could thou and I with fate conspire -To grasp this sorry scheme of things entire, -Might we not smash it to bits -And mould it closer to our hearts' desire? - -- Omar Khayyam, tr. Fitzgerald -% -Oatmeal raisin. -% -Objects are lost only because people -look where they are not rather than where they are. -% -O'Brian's Law: - Everything is always done for the wrong reasons. -% -O'Brien held up his left hand, its back toward Winston, with the -thumb hidden and the four fingers extended. - "How many fingers am I holding up, Winston?" - "Four." - "And if the Party says that it is not four but five -- - then how many?" - "Four." - The word ended in a gasp of pain. - -- George Orwell -% -Observe yon plumed biped fine. -To activate its captivation, -Deposit on its termination, -A quantity of particles saline. -% -Obstacles are what you see when you take your eyes off your goal. -% -Obviously, a major malfunction has occurred. - -- Steve Nesbitt, voice of Mission Control, January 28, - 1986, as the shuttle Challenger exploded within view - of the grandstands. -% -Obviously the only rational solution to your problem is suicide. -% -OCCAM'S ERASER: - The philosophical principle that even the simplest - solution is bound to have something wrong with it. -% -Occident, n.: - The part of the world lying west (or east) of the Orient. It is - largely inhabited by Christians, powerful sub-tribe of the - Hypocrites, whose principal industries are murder and cheating, - which they are pleased to call "war" and "commerce." These, also, - are the principal industries of the Orient. - -- Ambrose Bierce, "The Devil's Dictionary" -% -OCEAN: - A body of water occupying about two-thirds - of a world made for man -- who has no gills. -% -Odets, where is thy sting? - -- George S. Kaufman -% -Of all forms of caution, caution in love is the most fatal. -% -Of all men's miseries, the bitterest is this: -to know so much and have control over nothing. - -- Herodotus -% -Of all possible committee reactions to any given agenda item, the -reaction that will occur is the one which will liberate the greatest -amount of hot air. - -- Thomas L. Martin -% -Of all the animals, the boy is the most unmanageable. - -- Plato -% -Of all the words of witch's doom -There's none so bad as which and whom. -The man who kills both which and whom -Will be enshrined in our Who's Whom. - -- Fletcher Knebel -% -Of all things man is the measure. - -- Protagoras -% -Of course a platonic relationship is possible -- but only between -husband and wife. -% -Of course it's possible to love a human being -if you don't know them too well. - -- Charles Bukowski -% -Of course power tools and alcohol don't mix. Everyone knows power -tools aren't soluble in alcohol... - -- Crazy Nigel -% -Of course you can't flap your arms and fly to the moon. -After awhile you'd run out of air to push against. -% -Of course you have a purpose -- to find a purpose. -% -Of what you see in books, believe 75%. Of newspapers, believe 50%. And of -TV news, believe 25% -- make that 5% if the anchorman wears a blazer. -% -Office Automation, n.: - The use of computers to improve efficiency in the office - by removing anyone you would want to talk with over coffee. -% -Official Project Stages: - 1. Uncritical Acceptance - 2. Wild Enthusiasm - 3. Dejected Disillusionment - 4. Total Confusion - 5. Search for the Guilty - 6. Punishment of the Innocent - 7. Promotion of the Non-participants -% -Often statistics are used as a drunken man uses -lampposts -- for support rather than illumination. -% -Often things ARE as bad as they seem! -% -Ogden's Law: - The sooner you fall behind, the more time you have to catch up. -% -Oh, Aunty Em, it's so good to be home! -% -Oh, by the way, which one's Pink? - -- Pink Floyd -% -Oh Dad! We're ALL Devo! -% -Oh don't the days seem lank and long -When all goes right and none goes wrong, -And isn't your life extremely flat -With nothing whatever to grumble at! -% -Oh Father, my Father, Oh what must I do? -They're burning our streets and beating me blue. -"Listen my son, I'll tell you the truth: -Get a close haircut and spit-shine your shoes." - -Oh Mother, my Mother, my confusions remove, -I long to embrace her whose hair is so smooth. -"Now listen my son, although you're confused, -Cut your hair close and shine all your shoes." - -Oh Teacher, my Teacher, your life with me share. -What books ought I read? What thoughts do I dare? -"Oh Student, my Student, of dissent you beware. -Shine those dull shoes and cut short your hair." - -Oh Preacher, my Preacher, does God really care? -Are all races equal? Are laws just and fair? -"Boy -- here's the answer, no need to despair: -Shine those new shoes and cut short that hair." -% -Oh freddled gruntbuggly, thy micturations are to me -As plurdled gabbleblotchits on a lurgid bee. -Groop I implore thee, my foonting turlingdromes, -And hooptiously drangle me with crinkly bindlewurdles, -Or I will rend thee in the goblerwarts with my blurglecruncheon, - see if I don't. - -- Prostetnic Vogon Jeltz -% -Oh, give me a home, -Where the buffalo roam, -And I'll show you a house with a really messy kitchen. -% -Oh, give me a locus where the gravitons focus - Where the three-body problem is solved, - Where the microwaves play down at three degrees K, - And the cold virus never evolved. (chorus) -We eat algae pie, our vacuum is high, - Our ball bearings are perfectly round. - Our horizon is curved, our warheads are MIRVed, - And a kilogram weighs half a pound. (chorus) -If we run out of space for our burgeoning race - No more Lebensraum left for the Mensch - When we're ready to start, we can take Mars apart, - If we just find a big enough wrench. (chorus) -I'm sick of this place, it's just McDonald's in space, - And living up here is a bore. - Tell the shiggies, "Don't cry," they can kiss me goodbye - 'Cause I'm moving next week to L4! (chorus) - -CHORUS: Home, home on LaGrange, - Where the space debris always collects, - We possess, so it seems, two of Man's greatest dreams: - Solar power and zero-gee sex. - -- to Home on the Range -% -Oh give me your pity! -I'm on a committee, We attend and amend -Which means that from morning And contend and defend - to night, Without a conclusion in sight. - -We confer and concur, -We defer and demur, We revise the agenda -And reiterate all of our thoughts. With frequent addenda - And consider a load of reports. - -We compose and propose, -We suppose and oppose, But though various notions -And the points of procedure are fun; Are brought up as motions, - There's terribly little gets done. - -We resolve and absolve; -But we never dissolve, -Since it's out of the question for us -To bring our committee -To end like this ditty, -Which stops with a period, thus. - -- Leslie Lipson, "The Committee" -% -"Oh, he [a big dog] hunts with papa," she said. "He says Don Carlos [the -dog] is good for almost every kind of game. He went duck hunting one time -and did real well at it. Then Papa bought some ducks, not wild ducks but, -you know, farm ducks. And it got Don Carlos all mixed up. Since the -ducks were always around the yard with nobody shooting at them he knew he -wasn't supposed to kill them, but he had to do something. So one morning -last spring, when the ground was still soft, he took all the ducks and -buried them." "What do you mean, buried them?" "Oh, he didn't hurt them. -He dug little holes all over the yard and picked up the ducks in his mouth -and put them in the holes. Then he covered them up with mud except for -their heads. He did thirteen ducks that way and was digging a hole for -another one when Tony found him. We talked about it for a long time. Papa -said Don Carlos was afraid the ducks might run away, and since he didn't -know how to build a cage he put them in holes. He's a smart dog." - -- R. Bradford, "Red Sky At Morning" -% -Oh, I am a C programmer and I'm okay - I muck with indices and structs all day -And when it works, I shout hoo-ray - Oh, I am a C programmer and I'm okay -% -Oh, I could while away the hours, -Smoking herbs and flowers, -Shooting up my veins, - De-dum, De-dum, De-dum -Tell you, I've been a-thinkin' -I could drive a shiny Lincoln, -If I dealt in good cocaine. - -- To "If I Only Had A Brain" from "The Wizard of Oz" -% -Oh, I don't blame Congress. If I had $600 billion at my disposal, I'd -be irresponsible, too. - -- Lichty & Wagner -% -Oh, I have slipped the surly bonds of earth, -And danced the skies on laughter silvered wings; -Sunward I've climbed and joined the tumbling mirth -Of sun-split clouds and done a hundred things -You have not dreamed of -- -Wheeled and soared and swung -High in the sunlit silence. -Hovering there -I've chased the shouting wind along and flung -My eager craft through footless halls of air. -Up, up along delirious, burning blue -I've topped the wind-swept heights with easy grace, -Where never lark, or even eagle flew; -And, while with silent, lifting mind I've trod -The high untrespassed sanctity of space, -Put out my hand, and touched the face of God. - -- John Gillespie Magee, Jr., "High Flight" -% -Oh I'm just a typical American boy -From a typical American town. -I believe in God and Senator Dodd -And keeping old Castro down. -And when it came my time to serve -I knew "Better Dead Than Red", -But when I got to my old draft board, -Buddy, this is what I said: - -Chorus: - Sarge, I'm only eighteen, I've got a ruptured spleen, - And I always carry a purse! - I've got eyes like a bat and my feet are flat, - And my asthma's getting worse! - Yes, think of my career and my sweetheart dear, - And my poor old invalid aunt! - Besides I ain't no fool, I'm a-going to school - And I'm a-working in a defense plant! - -- Phil Ochs, "Draft Dodger Rag" -% -Oh Lord, won't you buy me a 4BSD? -My friends all got sources, so why can't I see? -Come all you moby hackers, come sing it out with me: -To hell with the lawyers from AT&T! -% -Oh, love is real enough, you will find it some day, but it has one -arch-enemy -- and that is life. - -- Jean Anouilh, "Ardele" -% -Oh, my friend, it is not what they take away from you that counts -- -it's what you do with what you have left. - -- Hubert H. Humphrey -% -Oh no my dear, I'm a very good man. I'm just a very bad wizard. - -- Frank Morgan as The Wizard, "The Wizard of Oz" -% -Oh, so there you are! -% -Oh, the Slithery Dee, he crawled out of the sea. -He may catch all the others, but he won't catch me. -No, he won't catch me, stupid ol' Slithery Dee. -He may catch all the others, but AAAARRRRGGGGHHHH!!!! - -- The Smothers Brothers -% -Oh this age! How tasteless and ill-bred it is. - -- Gaius Valerius Catullus -% -Oh wad some power the giftie gie us -To see oursel's as others see us! -It wad frae monie a blunder free us, -And foolish notion. - -- Robert Burns, National Poet of Scotland, 1759-1796 -% -Oh wearisome condition of humanity! -Born under one law, to another bound. - -- Fulke Greville, Lord Brooke -% -Oh, well, I guess this is just going to be one of those lifetimes. -% -Oh what a tangled web we weave, when first we practice to deceive. - -- William Shakespeare -% -Oh, when I was in love with you, - Then I was clean and brave, -And miles around the wonder grew - How well did I behave. - -And now the fancy passes by, - And nothing will remain, -And miles around they'll say that I - Am quite myself again. - -- A. E. Housman -% -Oh, wow! Look at the moon! -% -Oh, ya doesn't have ta call me "Johnson"! Well, you can call me "Ray", or -you can call me "Jay", or you can call me "R. J.", or you can call me "Ray -J.", or you can call me "R. J. J.", or you can call me "Ray J. Johnson", or -you can call me "R. J. Johnson", but ya DOESN'T have to call me "Johnson" ... -% -Oh, yeah, life goes on, long after the thrill of livin' is gone. - -- John Cougar, "Jack and Diane" -% -O.K., fine. -% -Ok, note to all reading this: if I ask for information and you don't -have the information available, don't bother sending me an e-mail -just to tell me that you don't have the information available. Wait -until you do have the information available, and then e-mail me. You'll -save precious time and electrons. - -- Bill Paul -% -OK, now let's look at four dimensions on the blackboard. - -- Dr. Joy -% -OK, so you're a Ph.D. Just don't touch anything. -% -Okay, Okay -- I admit it. You didn't change that program that worked -just a little while ago; I inserted some random characters into the -executable. Please forgive me. You can recover the file by typing in -the code over again, since I also removed the source. -% -Old age and treachery will overcome youth and skill. -% -Old age is always fifteen years older than I am. - -- Bernard Baruch -% -Old age is the harbor of all ills. - -- Bion -% -Old age is the most unexpected of things that can happen to a man. - -- Trotsky -% -Old age is too high a price to pay for maturity. -% -Old Grandad is dead but his spirits live on. -% -Old Japanese proverb: - There are two kinds of fools -- those who never climb Mt. Fuji, -and those who climb it twice. -% -Old MacDonald had an agricultural real estate tax abatement. -% -Old mail has arrived. -% -Old men are fond of giving good advice to console themselves for being -no longer in a position to give bad examples. - -- Francois de La Rochefoucauld, "Maxims" -% -Old Mother Hubbard went to the cupboard -To fetch her poor daughter a dress. -When she got there, the cupboard was bare -And so was her daughter, I guess... -% -Old musicians never die, they just decompose. -% -Old programmers never die, they just become managers. -% -Old programmers never die, they just branch to a new address. -% -Old programmers never die, they just hit account block limit. -% -Old soldiers never die. Young ones do. -% -Old timer, n.: - One who remembers when charity was a virtue and not an organization. -% -Olivier's Law: - Experience is something you don't get until just after you need it. -% -Omnibiblious, adj.: - Indifferent to type of drink. Ex: "Oh, you can get me anything. - I'm omnibiblious." -% -On a clear day, U.C.L.A. -% -On a clear disk you can seek forever. - -- P. Denning -% -On a paper submitted by a physicist colleague: - -This isn't right. This isn't even wrong. - -- Wolfgang Pauli -% -On a tous un peu peur de l'amour, mais on -a surtout peur de souffrir ou de faire souffrir. - -[One is always a little afraid of love, but -above all, one is afraid of pain or causing pain.] -% -On ability: - A dwarf is small, even if he stands on a mountain top; - a colossus keeps his height, even if he stands in a well. - -- Lucius Annaeus Seneca, 4BC - 65AD -% -On account of being a democracy and run by the people, we are the only -nation in the world that has to keep a government four years, no matter -what it does. - -- Will Rogers -% -On his way back from work, a driver came upon a horrible wreck in which one -car looked exactly like his neighbor's. Stopping hurriedly on the side of -the road, he ran toward the smoldering debris. - "Listen, mister," a policeman said, holding him back, "I can't let -you come any closer." - "But that may be my friend, Henry, in there," the anguished man -explained. - "OK, but it's pretty grisly," the cop cautioned. "There was a -decapitation." - The policeman reached into the back seat of the demolished car and -pulled forth the head, holding it at arm's length. "Is this your friend?" - "That's not him -- thank heavens," the man said. "Henry's much -taller." -% -On Monday mornings I am dedicated to the -proposition that all men are created jerks. - -- H. Allen Smith, "Let the Crabgrass Grow" -% -On Thanksgiving Day all over America, families sit down to dinner at the -same moment -- halftime. -% -On the eighth day, God created FORTRAN. -% -On the night before her family moved from Kansas to California, the little -girl knelt by her bed to say her prayers. "God bless Mommy and Daddy and -Keith and Kim," she said. As she began to get up, she quickly added, "Oh, -and God, this is goodbye. We're moving to Hollywood." -% -On the subject of C program indentation: - - "In My Egotistical Opinion, most people's C programs should be - indented six feet downward and covered with dirt." - -- Blair P. Houghton -% -On the whole, I'd rather be in Philadelphia. - -- W. C. Fields' epitaph -% -On two occasions I have been asked [by members of Parliament!], "Pray, Mr. -Babbage, if you put into the machine wrong figures, will the right answers -come out?" I am not able rightly to apprehend the kind of confusion of -ideas that could provoke such a question. - -- Charles Babbage -% -Once ... in the wilds of Afghanistan, I lost my corkscrew, -and we were forced to live on nothing but food and water for days. - -- W. C. Fields, "My Little Chickadee" -% -Once a word has been allowed to escape, it cannot be recalled. - -- Quintus Horatius Flaccus (Horace) -% -Once, adv.: - Enough. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Once again dread deed is done. -Canon sleeps, -his all-knowing eye shaded -to human chance and circumstance. -Peace reigns anew o'er Pine Valley, -but Canon's sleep is troubled. - -Beware, scant days past the Ides of July. -Impatient hands wait eagerly -to grasp, to hold -scant moments of time -wrested from life in the full -glory of Canon's power; -held captive by his unblinking eye. - -Three golden orbs stand watch; -one each to toll the day, hour, minute -until predestiny decrees his reawakening. -When that feared moment arrives, -"Ask not for whom the bell tolls, -It tolls for thee." - -- "I extended the loan on your Camera, at the Pine - Valley Pawn Shop today" -% -Once Again From the Top - -Correction notice in the Miami Herald: "Last Sunday, The Herald erroneously -reported that original Dolphin Johnny Holmes had been an insurance salesman -in Raleigh, North Carolina, that he had won the New York lottery in 1982 and -lost the money in a land swindle, that he had been charged with vehicular -homicide, but acquitted because his mother said she drove the car, and that -he stated that the funniest thing he ever saw was Flipper spouting water on -George Wilson. Each of these items was erroneous material published -inadvertently. He was not an insurance salesman in Raleigh, did not win the -lottery, neither he nor his mother was charged or involved in any way with -vehicular homicide, and he made no comment about Flipper or George Wilson. -The Herald regrets the errors." - -- "The Progressive", March, 1987 -% -Once again, we come to the Holiday Season, a deeply religious time that -each of us observes, in his own way, by going to the mall of his -choice. - -In the old days, it was not called the Holiday Season; the Christians -called it "Christmas" and went to church; the Jews called it "Hanukkah" -and went to synagogue; the atheists went to parties and drank. People -passing each other on the street would say "Merry Christmas!" or "Happy -Hanukkah!" or (to the atheists) "Look out for the wall!" - -- Dave Barry, "Christmas Shopping: A Survivor's Guide" -% -Once at a social gathering, Gladstone said to Disraeli, "I predict, -Sir, that you will die either by hanging or of some vile disease". -Disraeli replied, "That all depends upon whether I embrace your -principals or your mistress." -% -Once harm has been done, even a fool understands it. - -- Homer -% -Once he had one leg in the White House and the nation trembled under his -roars. Now he is a tinpot pope in the Coca-Cola belt and a brother to the -forlorn pastors who belabor halfwits in galvanized iron tabernacles behind -the railroad yards." - -- H. L. Mencken, writing of William Jennings Bryan, - counsel for the supporters of Tennessee's anti-evolution - law at the Scopes "Monkey Trial" in 1925. -% -Once I finally figured out all of life's -answers, they changed the questions. -% -Once, I read that a man be never stronger -than when he truly realizes how weak he is. - -- Jim Starlin, "Captain Marvel #31" -% -Once is happenstance, -Twice is coincidence, -Three times is enemy action. - -- Auric Goldfinger -% -Once it hits the fan, the only rational choice is to -sweep it up, package it, and sell it as fertilizer. -% -Once Law was sitting on the bench - And Mercy knelt a-weeping. -"Clear out!" he cried, "disordered wench! - Nor come before me creeping. -Upon your knees if you appear, -'Tis plain you have no standing here." - -Then Justice came. His Honor cried: - "YOUR states? -- Devil seize you!" -"Amica curiae," she replied -- - "Friend of the court, so please you." -"Begone!" he shouted -- "There's the door -- -I never saw your face before!" - -- Ambrose Bierce, "The Devil's Dictionary" -% -Once the realization is accepted that even between the closest human beings -infinite distances continue to exist, a wonderful living side by side can -grow up, if they succeed in loving the distance between them which makes it -possible for each to see each other whole against the sky. - -- Rainer Rilke -% -Once the toothpaste is out of the tube, it's hard to get it back in. - -- H. R. Haldeman -% -Once there was a little nerd who loved to read your mail, -And then yank back the i-access times to get hackers off his tail, -And once as he finished reading from the secretary's spool, -He wrote a rude rejection to her boyfriend (how uncool!) -And this as delivermail did work and he ran his backfstat, -He heard an awful crackling like rat fritters in hot fat, -And hard errors brought the system down 'fore he could even shout! - And the bio bug'll bring yours down too, ef you don't watch out! -And once they was a little flake who'd prowl through the uulog, -And when he went to his blit that night to play at being god, -The ops all heard him holler, and they to the console dashed, -But when they did a ps -ut they found the system crashed! -Oh, the wizards adb'd the dumps and did the system trace, -And worked on the file system 'til the disk head was hot paste, -But all they ever found was this: "panic: never doubt", - And the bio bug'll crash your box too, ef you don't watch out! -When the day is done and the moon comes out, -And you hear the printer whining and the rk's seems to count, -When the other desks are empty and their terminals glassy grey, -And the load is only 1.6 and you wonder if it'll stay, -You must mind the file protections and not snoop around, - Or the bio bug'll getcha and bring the system down! -% -Once there was this conductor see, who had a bass problem. You see, during -a portion of Beethoven's Ninth Symphony in which there are no bass violin -parts, one of the bassists always passed a bottle of scotch around. So, -to remind himself that the basses usually required an extra cue towards the -end of the symphony, the conductor would fasten a piece of string around the -page of the score before the bass cue. As the basses grew more and more -inebriated, two of them fell asleep. The conductor grew quite nervous (he -was very concerned about the pitch) because it was the bottom of the ninth; -the score was tied and the basses were loaded with two out. -% -Once upon a time there... -% -Once upon a time there was a kingdom ruled by a great bear. The peasants -were not very rich, and one of the few ways to become at all wealthy was -to become a Royal Knight. This required an interview with the bear. If -the bear liked you, you were knighted on the spot. If not, the bear would -just as likely remove your head with one swat of a paw. However, the family -of these unfortunate would-be knights was compensated with a beautiful -sheepdog from the royal kennels, which was itself a fairly valuable -possession. And the moral of the story is: - -The mourning after a terrible knight, nothing beats the dog of the bear that -hit you. -% -Once upon this midnight incoherent, -While you pondered sentient and crystalline, -Over many a broken and subordinate -Volume of gnarly lore, -While I pestered, nearly singing, -Suddenly there came a hewing, -As of someone profusely skulking, -Skulking at my chamber door. -% -Once you've seen one nuclear war, you've seen them all. -% -Once you've tried to change the world you find -it's a whole bunch easier to change your mind. -% -One advantage of talking to yourself is that you know at least -somebody's listening. - -- Franklin P. Jones -% -"One Architecture, One OS" also translates as "One Egg, One Basket". -% -"One basic notion underlying Usenet is that it is a cooperative." - -Having been on USENET for going on ten years, I disagree with this. -The basic notion underlying USENET is the flame. - -- Chuq Von Rospach -% -One Bell System - it sometimes works. -% -One Bell System - it used to work before they installed the Dimension! -% -One Bell System - it works. -% -One big pile is better than two little piles. - -- Arlo Guthrie -% -One can never consent to creep when one feels an impulse to soar. - -- Helen Keller -% -One can search the brain with a microscope and not find the -mind, and can search the stars with a telescope and not find God. - -- J. Gustav White -% -One cannot make an omelette without breaking eggs -- but it is amazing -how many eggs one can break without making a decent omelette. - -- Professor Charles P. Issawi -% -One can't proceed from the informal to the formal by formal means. -% -One could not be a successful scientist without realizing that, in contrast -to the popular conception supported by newspapers and mothers of scientists, -a goodly number of scientists are not only narrow-minded and dull, but also -just stupid. - -- J. D. Watson, "The Double Helix" -% -One day an elderly Jewish Pole, living in Warsaw, finds an old lamp in his -attic. He starts to polish it and (poof!) a genie appears in a cloud of -smoke. - "Greetings, Mortal!" exclaims the genie, stretching and yawning, "For -releasing me I will grant you three wishes." - The old man thinks for a moment, then replies, "I want Genghis Khan -resurrected. I want him to re-unite the Mongol hordes, march to the Polish -border, decide he doesn't want to invade, and march back home." - "No sooner said than done!" thunders the genie. "Your second wish?" - "Hmmmm. I want Genghis Khan resurrected. I want him to re-unite the -Mongol hordes, march to the Polish border, decide he doesn't want to invade, -and march back home." - "But... well, all right! Your third wish?" - "I want Genghis Khan resurrected. I want him to re-unite his ---" - "OKOKOKOK! Right. Got it. Why do you want Genghis Khan to march -to Poland three times and never invade?" - The old man smiles. "He has to pass through Russia six times." -% -One day the King decided that he would force all his subjects to tell the -truth. A gallows was erected in front of the city gates. A herald announced, -"Whoever would enter the city must first answer the truth to a question -which will be put to him." Nasrudin was first in line. The captain of the -guard asked him, "Where are you going? Tell the truth -- the alternative -is death by hanging." - "I am going," said Nasrudin, "to be hanged on that gallows." - "I don't believe you." - "Very well, if I have told a lie, then hang me!" - "But that would make it the truth!" - "Exactly," said Nasrudin, "your truth." -% -One day this guy is finally fed up with his middle-class existence and -decides to do something about it. He calls up his best friend, who is a -mathematical genius. "Look," he says, "do you suppose you could find some -way mathematically of guaranteeing winning at the race track? We could -make a lot of money and retire and enjoy life." The mathematician thinks -this over a bit and walks away mumbling to himself. - A week later his friend drops by to ask the genius if he's had any -success. The genius, looking a little bleary-eyed, replies, "Well, yes, -actually I do have an idea, and I'm reasonably sure that it will work, but -there a number of details to be figured out. - After the second week the mathematician appears at his friend's house, -looking quite a bit rumpled, and announces, "I think I've got it! I still have -some of the theory to work out, but now I'm certain that I'm on the right -track." - At the end of the third week the mathematician wakes his friend by -pounding on his door at three in the morning. He has dark circles under his -eyes. His hair hasn't been combed for many days. He appears to be wearing -the same clothes as the last time. He has several pencils sticking out from -behind his ears and an almost maniacal expression on his face. "WE CAN DO -IT! WE CAN DO IT!!" he shrieks. "I have discovered the perfect solution!! -And it's so EASY! First, we assume that horses are perfect spheres in simple -harmonic motion..." -% -One day, -A mad meta-poet, -With nothing to say, -Wrote a mad meta-poem -That started: "One day, -A mad meta-poet, -With nothing to say, -Wrote a mad meta-poem -That started: "One day, -[...] -sort of close". -Were the words that the poet, -Finally chose, -To bring his mad poem, -To some sort of close". -Were the words that the poet, -Finally chose, -To bring his mad poem, -To some sort of close". -% -One difference between a man and a machine -is that a machine is quiet when well oiled. -% -One doesn't have a sense of humor. It has you. - -- Larry Gelbart -% -One dusty July afternoon, somewhere around the turn of the century, Patrick -Malone was in Mulcahey's Bar, bending an elbow with the other street car -conductors from the Brooklyn Traction Company. While they were discussing the -merits of a local ring hero, the bar goes silent. Malone turns around to see -his wife, with a face grim as death, stalking to the bar. - Slapping a four-bit piece down on the bar, she draws herself up to her -full five feet five inches and says to Mulcahey, "Give me what himself has -been havin' all these years." - Mulcahey looks at Malone, who shrugs, and then back at Margaret Mary -Malone. He sets out a glass and pours her a triple shot of Rye. The bar is -totally silent as they watch the woman pick up the glass and knock back the -drink. She slams the glass down on the bar, gasps, shudders slightly, and -passes out; falling straight back, stiff as a board, saved from sudden contact -with the barroom floor by the ample belly of Seamus Fogerty. - Sometime later, she comes to on the pool table, a jacket under her -head. Her bloodshot eyes fell upon her husband, who says, "And all these -years you've been thinkin' I've been enjoying meself." -% -One expresses well the love he does not feel. - -- J. A. Karr -% -One family builds a wall, two families enjoy it. -% -One father is more than a hundred schoolmasters. - -- George Herbert -% -One friend in a lifetime is much; two are many; three are hardly possible. -Friendship needs a certain parallelism of life, a community of thought, -a rivalry of aim. - -- Henry Brook Adams -% -One girl can be pretty -- but a dozen are only a chorus. - -- F. Scott Fitzgerald, "The Last Tycoon" -% -One good reason why computers can do more work than -people is that they never have to stop and answer the phone. -% -One good suit is worth a thousand resumes. -% -One good thing about music, -Well, it helps you feel no pain. -So hit me with music; -Hit me with music now. - -- Bob Marley, "Trenchtown Rock" -% -One good turn asketh another. - -- John Heywood -% -One good turn deserves another. - -- Gaius Petronius -% -One good turn usually gets most of the blanket. -% -One has to look out for engineers -- they begin with sewing machines -and end up with the atomic bomb. - -- Marcel Pagnol -% -One hundred women are not worth a single testicle. - -- Confucius -% -One is not superior merely because one sees the world as odious. - -- Chateaubriand (1768-1848) -% -One is often kept in the right road by a rut. - -- Gustave Droz -% -One learns to itch where one can scratch. - -- Ernest Bramah -% -ONE LIFE TO LIVE for ALL MY CHILDREN in -ANOTHER WORLD all THE DAYS OF OUR LIVES. -% -One man tells a falsehood, a hundred repeat it as true. -% -One man's brain plus one other will produce one half as many ideas as -one man would have produced alone. These two plus two more will -produce half again as many ideas. These four plus four more begin to -represent a creative meeting, and the ratio changes to one quarter as -many ... - -- Anthony Chevins -% -One man's constant is another man's variable. - -- Alan J. Perlis -% -One man's folly is another man's wife. - -- Helen Rowland -% -One man's "magic" is another man's engineering. -"Supernatural" is a null word. -% -One man's Mede is another man's Persian. - -- George M. Cohan -% -One man's theology is another man's belly laugh. -% -One measure of friendship consists not in the number of things friends -can discuss, but in the number of things they need no longer mention. - -- Clifton Fadiman -% -One meets his destiny often on the road he takes to avoid it. -% -One monk said to the other, "The fish has flopped out of the net! How -will it live?" The other said, "When you have gotten out of the net, -I'll tell you." -% -One must have a heart of stone to read the death of Little Nell by Dickens -without laughing. - -- Oscar Wilde -% -One nice thing about egotists: they don't talk about other people. -% -One nuclear bomb can ruin your whole day. -% -One of my less pleasant chores when I was young was to read the Bible from -one end to the other. Reading the Bible straight through is at least 70 -percent discipline, like learning Latin. But the good parts are, of course, -simply amazing. God is an extremely uneven writer, but when He's good, -nobody can touch him. - -- John Gardner, NYT Book Review, Jan. 1983 -% -One of the chief duties of the mathematician in acting as an -advisor... is to discourage... from expecting too much from -mathematics. - -- N. Wiener -% -One of the disadvantages of having children is that they eventually get old -enough to give you presents they make at school. - -- Robert Byrne -% -One of the large consolations for experiencing anything -unpleasant is the knowledge that one can communicate it. - -- Joyce Carol Oates -% -One of the lessons of history is that nothing is often a good thing to -do and always a clever thing to say. - -- Will Durant -% -One of the major difficulties Trillian experienced in her relationship with -Zaphod was learning to distinguish between him pretending to be stupid just -to get people off their guard, pretending to be stupid because he couldn't -be bothered to think and wanted someone else to do it for him, pretending -to be so outrageously stupid to hide the fact that he actually didn't -understand what was going on, and really being genuinely stupid. He was -renowned for being quite clever and quite clearly was so -- but not all the -time, which obviously worried him, hence the act. He preferred people to be -puzzled rather than contemptuous. This above all appeared to Trillian to be -genuinely stupid, but she could no longer be bothered to argue about. - -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -One of the most overlooked advantages to computers is... If they do -foul up, there's no law against whacking them around a little. - -- Joe Martin -% -One of the most striking differences between a -cat and a lie is that a cat has only nine lives. - -- Mark Twain -% -One of the oldest problems puzzled over in the Talmud is: "Why did God -create goyim?" The generally accepted answer is "_s_o_m_e_b_o_d_y has to buy -retail." - -- Arthur Naiman, "Every Goy's Guide to Yiddish" -% -One of the pleasures of reading old letters is the knowledge that they -need no answer. - -- George Gordon, Lord Byron -% -One of the rules of Busmanship, New York style, is never surrender your -seat to another passenger. This may seem callous, but it is the best -way, really. If one passenger were to give a seat to someone who fainted -in the aisle, say, the others on the bus would become disoriented and -imagine they were in Topeka Kansas. -% -One of the signs of Napoleon's greatness is the fact that he -once had a publisher shot. - -- Siegfried Unseld -% -One of the worst of my many faults is that I'm too critical of myself. -% -One of your most ancient writers, a historian named Herodotus, tells of a -thief who was to be executed. As he was taken away he made a bargain with -the king: in one year he would teach the king's favorite horse to sing -hymns. The other prisoners watched the thief singing to the horse and -laughed. "You will not succeed," they told him. "No one can." - To which the thief replied, "I have a year, and who knows what might -happen in that time. The king might die. The horse might die. I might die. -And perhaps the horse will learn to sing. - -- "The Mote in God's Eye", Niven and Pournelle -% -One organism, one vote. -% -One person's error is another person's data. -% -One picture is worth 128K words. -% -One picture is worth more than ten thousand words. - -- Chinese proverb -% -One pill makes you larger And if you go chasing rabbits -And, one pill makes you small. And you know you're going to fall. -And the ones that mother gives you, Tell 'em a hookah smoking caterpillar -Don't do anything at all. Has given you the call. -Go ask Alice Call Alice -When she's ten feet tall. When she was just small. - -When men on the chessboard When logic and proportion -Get up and tell you where to go. Have fallen sloppy dead, -And you've just had some kind of And the White Knight is talking - mushroom backwards -And your mind is moving low. And the Red Queen's lost her head -Go ask Alice Remember what the dormouse said: -I think she'll know. Feed your head. - Feed your head. - Feed your head. - -- Jefferson Airplane, "White Rabbit" -% -One planet is all you get. -% -One possible reason that things aren't going according to plan -is that there never was a plan in the first place. -% -One promising concept that I came up with right away was that you could -manufacture personal air bags, then get a law passed requiring that -they be installed on congressmen to keep them from taking trips. Let's -say your congressman was trying to travel to Paris to do a fact-finding -study on how the French government handles diseases transmitted by -sherbet. Just when he got to the plane, his mandatory air bag, -strapped around his waist, would inflate -- FWWAAAAAAPPPP -- thus -rendering him too large to fit through the plane door. It could also -be rigged to inflate whenever the congressman proposed a law. ("Mr. -Speaker, people ask me, why should October be designated as Cuticle -Inspection Month? And I answer that FWWAAAAAAPPPP.") This would save -millions of dollars, so I have no doubt that the public would violently -support a law requiring airbags on congressmen. The problem is that -your potential market is very small: there are only around 500 members -of Congress, and some of them, such as House Speaker "Tip" O'Neil, are -already too large to fit on normal aircraft. - -- Dave Barry, "'Mister Mediocre' Restaurants" -% -One reason why George Washington -Is held in such veneration: -He never blamed his problems -On the former Administration. - -- George O. Ludcke -% -One Saturday afternoon, during the campaign to decide whether or not there -should be a Coastal Commission, I took a helicopter ride from Los Angeles -to San Diego. We passed several state beaches, some crowded and some -virtually empty. They had the same facilities, and in some cases the crowded -and the empty beach were within a quarter mile of each other. Obviously -many beach-goers prefer to be crowded together. Buying more beaches that -people won't go to because they prefer to be crowded together on one beach -is a ridiculous waste of our natural resources and our taxes. - -- Ronald Reagan -% -One seldom sees a monument to a committee. -% -One should always be in love. That is the reason one should never marry. - -- Oscar Wilde -% -ONE SIZE FITS ALL: - Doesn't fit anyone. -% -One small step for man, one giant stumble for mankind. -% -One thing about the past. -It's likely to last. - -- Ogden Nash -% -ONE THING KIDS LIKE is to be tricked. For instance, I was going to take -my little nephew to Disneyland, but instead I drove him to a burned-out -warehouse. "Oh, oh," I said. "Disneyland burned down." He cried and -cried, but I think that deep down he thought it was a pretty good joke. - -I started to drive over to the real Disneyland, but it was getting pretty -late. - -- Jack Handey, "The New Mexican" (1988) -% -One thing the inventors can't seem to -get the bugs out of is fresh paint. -% -One thing they don't tell you about doing experimental physics is that -sometimes you must work under adverse conditions... like a state of sheer -terror. - -- W. K. Hartmann -% -One thought driven home is better than three left on base. -% -One toke over the line, sweet Mary, -One toke over the line, -Sittin' downtown in a railway station, -One toke over the line. -Waitin' for the train that goes home, -Hopin' that the train is on time, -Sittin' downtown in a railway station, -One toke over the line. -% -One way to make your old car run better is to look up the price of a -new model. -% -One way to stop a run away horse is to bet on him. -% -One, with God, is always a majority, but many a martyr has been burned at -the stake while the votes were being counted. - -- Thomas B. Reed -% -One would like to stroke and caress human beings, but one dares not do so, -because they bite. - -- Vladimir Lenin -% -One-Shot Case Study, n.: - The scientific equivalent of the four-leaf clover, from which - it is concluded all clovers possess four leaves and are sometimes green. -% -On-line, adj.: - The idea that a human being should always be accessible to a - computer. -% -Only a fool has no doubts. -% -Only a mediocre person is always at his best. - -- Dr. Laurence J. Peter -% -Only adults have difficulty with childproof caps. -% -Only fools are quoted. - -- Anonymous -% -Only God can make random selections. -% -Only great masters of style can succeed in being obtuse. - -- Oscar Wilde - -Most UNIX programmers are great masters of style. - -- The Unnamed Usenetter -% -Only Irish coffee provides in a single glass all four -essential food groups -- alcohol, caffeine, sugar, and fat. - -- Alex Levine - -[Oh come on, everybody knows that the four basic food groups are -hot sugar, cold sugar, carbohydrates and grease. Ed.] -% -Only kings, presidents, editors, and people with tapeworms have the right -to use the editorial "we". -% -Only someone with nothing to be sorry for -smiles back at the rear of an elephant. -% -Only that in you which is me can hear what I'm saying. - -- Baba Ram Dass -% -Only the fittest survive. The vanquished acknowledge their unworthiness by -placing a classified ad with the ritual phrase "must sell -- best offer," -and thereafter dwell in infamy, relegated to discussing gas mileage and lawn -food. But if successful, you join the elite sodality that spends hours -unpurifying the dialect of the tribe with arcane talk of bits and bytes, RAMS -and ROMS, hard disks and baud rates. Are you obnoxious, obsessed? It's a -modest price to pay. For you have tapped into the same awesome primal power -that produces credit-card billing errors and lost plane reservations. Hail, -postindustrial warrior, subduer of Bounceoids, pride of the cosmos, keeper of -the silicone creed: Computo, ergo sum. The force is with you -- at 110 volts. -May your RAMS be fruitful and multiply. - -- Curt Suplee, "Smithsonian", 4/83 -% -Only the hypocrite is really rotten to the core. - -- Hannah Arendt -% -Only those who leisurely approach that which the masses are -busy about can be busy about that which the masses take leisurely. - -- Lao Tsu -% -Only through hard work and perseverance can one truly suffer. -% -Only two groups of people fall for flattery -- men and women. -% -Only two kinds of witnesses exist. The first live in a neighborhood where -a crime has been committed and in no circumstances have ever seen anything -or even heard a shot. The second category are the neighbors of anyone who -happens to be accused of the crime. These have always looked out of their -windows when the shot was fired, and have noticed the accused person standing -peacefully on his balcony a few yards away. - -- Sicilian police officer -% -Only two of my personalities are schizophrenic, but one -of them is paranoid and the other one is out to get him. -% -Only way to open lips of pigeon, sledgehammer. -% -Ontogeny recapitulates phylogeny. -% -Onward through the fog. -% -Operator, please trace this call and tell me where I am. -% -Opiates are the religion of the upper-middle classes. - -- Debbie VanDam -% -Opium is very cheap considering you don't -feel like eating for the next six days. - -- Taylor Mead, famous transvestite -% -Oppernockity tunes but once. -% -Opportunities are usually disguised as hard -work, so most people don't recognize them. -% -Oprah Winfrey has an incredible talent for getting the weirdest people to -talk to. And you just HAVE to watch it. "Blind, masochistic minority, -crippled, depressed, government latrine diggers, and the women who love -them too much on the next Oprah Winfrey." -% -Optimism is the content of small men in high places. - -- F. Scott Fitzgerald, "The Crack Up" -% -Optimism, n.: -The belief that everything is beautiful, including what is ugly, good, bad, -and everything right that is wrong. It is held with greatest tenacity by -those accustomed to falling into adversity, and most acceptably expounded -with the grin that apes a smile. Being a blind faith, it is inaccessible -to the light of disproof -- an intellectual disorder, yielding to no treatment -but death. It is hereditary, but not contagious. -% -Optimist, n.: - A bagpiper with a beeper. -% -Optimist, n.: - A proponent of the belief that black is white. - - A pessimist asked God for relief. - "Ah, you wish me to restore your hope and cheerfulness," said God. - "No," replied the petitioner, "I wish you to create something that -would justify them." - "The world is all created," said God, "but you have overlooked -something -- the mortality of the optimist." - -- Ambrose Bierce, "The Devil's Dictionary" -% -Optimist, n.: - Someone who goes down to the marriage - bureau to see if his license has expired. -% -Optimization hinders evolution. -% -Oral sex is like being attacked by a giant snail. - -- Germaine Greer -% -Orcs really aren't so bad (if you use lots of catsup). -% -Order and simplification are the first steps toward -mastery of a subject -- the actual enemy is the unknown. - -- Thomas Mann -% -Oregano, n.: - The ancient Italian art of pizza folding. -% -Oregon, n.: - Eighty billion gallons of water with no place to go on Saturday -night. -% -O'Reilly's Law of the Kitchen: -Cleanliness is next to impossible -% -Oreo -% -Organic chemistry is the chemistry of carbon compounds. -Biochemistry is the study of carbon compounds that crawl. - -- Mike Adams -% -Original thought is like original sin: both happened before you were born -to people you could not have possibly met. - -- Fran Lebowitz, "Social Studies" -% -Osborn's Law: - Variables won't; constants aren't. -% -Other than that, Mrs. Lincoln, how did you like the play? -% -Other women cloy -The appetites they feed, but she makes hungry -Where most she satisfies. - -- Antony and Cleopatra -% -Others can stop you temporarily, only you can do it permanently. -% -Others will look to you for stability, -so hide when you bite your nails. -% -O'Toole's commentary on Murphy's Law: - Murphy was an optimist. -% -Ouch! That felt good! - -- Karen Gordon -% -"Our attitude with TCP/IP is, `Hey, we'll do it, but don't make a big -system, because we can't fix it if it breaks -- nobody can.'" - -"TCP/IP is OK if you've got a little informal club, and it doesn't make -any difference if it takes a while to fix it." - -- Ken Olsen, in Digital News, 1988 -% -Our business in life is not to succeed -but to continue to fail in high spirits. - -- Robert Louis Stevenson -% -Our congratulations go to a Burlington Vermont civilian employee of the -local Army National Guard base. He recently received a substantial cash -award from our government for inventing a device for optical scanning. -His device reportedly will save the government more than $6 million a year -by replacing a more expensive helicopter maintenance tool with his own, -home-made, hand-held model. - -Not surprisingly, we also have a couple of money-saving ideas that we submit -to the Pentagon free of charge: - - a. Don't kill anybody. - b. Don't build things that do. - c. And don't pay other people to kill anybody. - -We expect annual savings to be in the billions. - -- Sojourners -% -Our country has plenty of good five-cent cigars, -but the trouble is they charge fifteen cents for them. -% -Our documentation manager was showing her two year old son around the -office. He was introduced to me, at which time he pointed out that we -were both holding bags of popcorn. We were both holding bottles of -juice. But only *_h_e* had a lollipop. - -He asked his mother, "Why doesn't HE have a lollipop?" - -Her reply: - - "He can have a lollipop any time he wants to. That's what it - means to be a programmer." -% -Our government has kept us in a perpetual state of fear -- kept us in a -continuous stampede of patriotic fervor -- with the cry of grave national -emergency... Always there has been some terrible evil to gobble us up if we -did not blindly rally behind it by furnishing the exorbitant sums demanded. -Yet, in retrospect, these disasters seem never to have happened, seem never -to have been quite real. - -- General Douglas MacArthur, 1957 -% -Our houseplants have a good sense of humous. -% -Our informal mission is to improve the love life of operators worldwide. - -- Peter Behrendt, president of Exabyte -% -Our little systems have their day; -They have their day and cease to be; -They are but broken lights of thee. - -- Tennyson -% -Our OS who art in CPU, UNIX be thy name. -Thy programs run, thy syscalls done, -In kernel as it is in user. -% -Our parents were of Midwestern stock and very strict. They didn't want us -to grow up to be spoiled and rich. If we left our tennis racquets in the -rain, we were punished. - -- Nancy Ellis (George Bush's sister), in the New Republic -% -Our policy is, when in doubt, do the right thing. - -- Roy L. Ash, ex-president, Litton Industries -% -Our problems are so serious that the best -way to talk about them is lightheartedly. -% -Our sires' age was worse that our grandsires'. -We their sons are more worthless than they: -so in our turn we shall give the world a progeny yet more corrupt. - -- Quintus Horatius Flaccus (Horace) -% -Our swords shall play the orators for us. - -- Christopher Marlowe -% -Our universe itself keeps on expanding and expanding, -In all of the directions it can whiz; -As fast as it can go, that's the speed of light, you know, -Twelve million miles a minute and that's the fastest speed there is. -So remember, when you're feeling very small and insecure, -How amazingly unlikely is your birth; -And pray that there's intelligent life somewhere out in space, -'Cause there's bugger all down here on Earth! - -- Monty Python -% -Our vision is to speed up time, eventually eliminating it. - -- Alex Schure -% -Ours is a world of nuclear giants and ethical infants. - -- General Omar N. Bradley -% -Ours is a world where people don't know what they -want and are willing to go through hell to get it. -% -Out of sight is out of mind. - -- Arthur Clough -% -Out of the crooked timber of humanity no straight thing can ever be made. - -- Immanuel Kant -% -Out of the mouths of babes does often come cereal. -% -Outside of a dog, a book is a man's best friend: and inside a dog, -it's too dark to read. - -- Groucho Marx -% -Over the shoulder supervision is more a -need of the manager than the programming task. -% -Over the years, I've developed my sense of deja vu so acutely that now -I can remember things that *have* happened before ... -% -Overall, the philosophy is to attack the availability problem from two -complementary directions: to reduce the number of software errors through -rigorous testing of running systems, and to reduce the effect of the remaining -errors by providing for recovery from them. An interesting footnote to this -design is that now a system failure can usually be considered to be the -result of two program errors: the first, in the program that started the -problem; the second, in the recovery routine that could not protect the -system. - -- A. L. Scherr, "Functional Structure of IBM Virtual - Storage Operating Systems, Part II: OS/VS-2 - Concepts and Philosophies," - IBM Systems Journal, Vol. 12, No. 4. -% -Overconfidence breeds error when we take for granted that the game will -continue on its normal course; when we fail to provide for an unusually -powerful resource -- a check, a sacrifice, a stalemate. Afterwards the -victim may wail, `But who could have dreamt of such an idiotic-looking -move?' - -- Fred Reinfeld, "The Complete Chess Course" -% -Overdrawn? But I still have checks left! -% -Overflow on /dev/null: please empty the bit bucket. -% -Overheard: - "How do I feel? Great! And I kiss pretty good, too!" -% -Overload -- core meltdown sequence initiated. -% -Owe no man any thing... - -- Romans 13:8 -% -Oxygen is a very toxic gas and an extreme fire hazard. It is fatal in -concentrations of as little as 0.000001 p.p.m. Humans exposed to the -oxygen concentrations die within a few minutes. Symptoms resemble very -much those of cyanide poisoning (blue face, etc.). In higher -concentrations, e.g. 20%, the toxic effect is somewhat delayed and it -takes about 2.5 billion inhalations before death takes place. The reason -for the delay is the difference in the mechanism of the toxic effect of -oxygen in 20% concentration. It apparently contributes to a complex -process called aging, of which very little is known, except that it is -always fatal. - -However, the main disadvantage of the 20% oxygen concentration is in the -fact it is habit forming. The first inhalation (occurring at birth) is -sufficient to make oxygen addiction permanent. After that, any -considerable decrease in the daily oxygen doses results in death with -symptoms resembling those of cyanide poisoning. - -Oxygen is an extreme fire hazard. All of the fires that were reported in -the continental U.S. for the period of the past 25 years were found to be -due to the presence of this gas in the atmosphere surrounding the buildings -in question. - -Oxygen is especially dangerous because it is odorless, colorless and -tasteless, so that its presence can not be readily detected until it is -too late. - -- Chemical & Engineering News February 6, 1956 -% -Ozman's Laws: - (1) If someone says he will do something "without fail," he won't. - (2) The more people talk on the phone, the less money they make. - (3) People who go to conferences are the ones who shouldn't. - (4) Pizza always burns the roof of your mouth. -% -paak, n: A stadium or inclosed playing field. To put or leave (a - vehicle) for a time in a certain location. -patato, n: The starchy, edible tuber of a widely cultivated plant. -Septemba, n: The 9th month of the year. -shua, n: Having no doubt; certain. -sista, n: A female having the same mother and father as the speaker. -tamato, n: A fleshy, smooth-skinned reddish fruit eaten in salads - or as a vegetable. -troopa, n: A state policeman. -Wista, n: A city in central Masschewsetts. -yaad, n: A tract of ground adjacent to a building. - -- Massachewsetts Unabridged Dictionary -% -PAIN: - Falling out of a twenty story building, - and snagging your eyelid on a nail. -% -PAIN: - One thing, at least it proves that you're alive! -% -PAIN: - Sliding down a 50-foot razor blade into a bucket of alcohol. -% -Pain is just God's way of hurting you. -% -Painting, n.: - The art of protecting flat surfaces from the weather, and - exposing them to the critic. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Pandora's Rule: - Never open a box you didn't close. -% -panic: can't find / -% -panic: kernel segmentation violation. core dumped (only kidding) -% -panic: kernel trap (ignored) -% -Paprika Measure: - - 2 dashes == 1 smidgen - 2 smidgens == 1 pinch - 3 pinches == 1 soupcon - 2 soupcons == too much paprika -% -Paradise is exactly like where you are right now ... only much, much -better. - -- Laurie Anderson -% -Parallel lines never meet, unless you bend one or both of them. -% -Paralysis through analysis. -% -PARANOIA: - A healthy understanding of the way the universe works. -% -Paranoia doesn't mean the whole world isn't out to get you. -% -Paranoia is heightened awareness. -% -Paranoia is simply an optimistic outlook on life. -% -Paranoid Club meeting this Friday. -Now ... just try to find out where! -% -Paranoid schizophrenics outnumber their enemies at least two to one. -% -Paranoids are people, too; they have their own problems. It's easy -to criticize, but if everybody hated you, you'd be paranoid too. - -- D. J. Hicks -% -Pardon me while I laugh. -% -Pardon this fortune. Database under reconstruction. -% -Pardo's First Postulate: - Anything good in life is either illegal, immoral, or -fattening. - -Arnold's Addendum: - Anything not fitting into these categories causes cancer in rats. -% -Parents often talk about the younger generation as if they -didn't have much of anything to do with it. -% -Parker's Law: - Beauty is only skin deep, but ugly goes clean to the bone. -% -Parkinson's Fifth Law: - If there is a way to delay an important decision, the good - bureaucracy, public or private, will find it. -% -Parkinson's Fourth Law: - The number of people in any working group tends to increase - regardless of the amount of work to be done. -% -Parsley is gharsley. - -- Ogden Nash -% -Parts that positively cannot be assembled in improper order will be. -% -PARTY: - A gathering where you meet people who drink - so much you can't even remember their names. -% -Pascal is a language for children wanting to be naughty. - -- Dr. Kasi Ananthanarayanan -% -Pascal is not a high-level language. - -- Steven Feiner -% -Pascal is Pascal is Pascal is dog meat. - -- M. Devine and P. Larson, Computer Science 340 -% -Pascal, n.: - A programming language named after a man who would turn over - in his grave if he knew about it. - -- Datamation, January 15, 1984 -% -Pascal Users: - The Pascal system will be replaced next Tuesday by Cobol. - Please modify your programs accordingly. -% -Pascal Users: - To show respect for the 313th anniversary (tomorrow) of the - death of Blaise Pascal, your programs will be run at half speed. -% -Passionate hatred can give meaning and purpose to an empty life. - -- Eric Hoffer -% -Password: -% -Passwords are implemented as a result of insecurity. -% -Paster Crosstalk: What items are specifically mentioned by GOD as being - unclean? Now did you know... preying birds... praying mantises... - All birds of prey, all carrion eaters, fish eaters -- no good, can't - eat those. Nothing that does not have both fins and scales. Most - CREEPING things... -Alvarado: How 'bout caterpillars? -P: A caterpillar doesn't have a backbone. Nothing without a backbone - can get in. -A: How do you know? You char a caterpillar, it gets real stiff! -P: Well, I don't think that the Lord meant us to eat CHARRED - CATERPILLARS! -[...] -P: The hog, the squirrel... little squirrels. Who would want to eat - a LITTLE SQUIRREL? -A: If you're starving. If you're starving in the park one day. -P: You'd probably just CHAR 'em to get 'em stiff, wouldn't ya? -A: No, you SINGE 'em. You SINGE 'em and eat 'em. *I* read about the - Donner Pass, I know what man does when he's hungry. -P: Squirrels eating squirrels -- my GOD, that's sick! -A: That's sick, SURE. But a MAN eating a squirrel -- that's (heh, heh) - par for the course, Charlie. - -- The Firesign Theatre -% -Patageometry, n.: - The study of those mathematical properties that are invariant -under brain transplants. -% -Patch griefs with proverbs. - -- William Shakespeare, "Much Ado About Nothing" -% -Patent, v.: - A method of publicizing inventions so others can copy them. -% -"Pathetic," he said. "That's what it is. Pathetic." -(crosses stream) -"As I thought," he said, "no better from *this* side." - -- Eeyore -% -Patience is a minor form of despair, disguised as virtue. - -- Ambrose Bierce, on qualifiers -% -Patience is long forgotten by convenience in this life. - -- Carmen Caicedo Giraudy -% -Patience is the best remedy for every trouble. - -- Titus Maccius Plautus -% -Patriotism is the last refuge of a scoundrel. - -- S. Johnson, "The Life of Samuel Johnson" by J. Boswell - -In Dr. Johnson's famous dictionary patriotism is defined as the last -resort of the scoundrel. With all due respect to an enlightened but -inferior lexicographer I beg to submit that it is the first. - -- Ambrose Bierce - -When Dr. Johnson defined patriotism as the last refuge of a scoundrel, -he ignored the enormous possibilities of the word reform. - -- Sen. Roscoe Conkling - -Public office is the last refuge of a scoundrel. - -- Boies Penrose -% -Patriotism is the virtue of the vicious. - -- Oscar Wilde -% -Pauca sed matura. (Few but excellent.) - -- Gauss -% -Paul Revere was a tattle-tale. -% -Paul's Law: - In America, it's not how much an item costs, it's how much you - save. -% -Paul's Law: - You can't fall off the floor. -% -Pause for storage relocation. -% -Pay no attention to that man behind the curtain. - -- Frank Morgan as The Wizard, "The Wizard of Oz" -% -Paycheck, n.: - The weekly $5.27 that remains after deductions for federal - withholding, state withholding, city withholding, FICA, - medical/dental, long-term disability, unemployment insurance, - Christmas Club, and payroll savings plan contributions. -% -Payeen to a Twang -Derrida -Ore-Ida -potato. - -If you dared, -I'd ask you -to go dig -up your ides under brown- -tubered skies. - -where pitchforked -you will ask -Derrida? -% -Peace be to this house, and all that dwell in it. -% -Peace cannot be kept by force; it -can only be achieved by understanding. - -- Albert Einstein -% -Peace is much more precious than a piece -of land... let there be no more wars. - -- Mohammed Anwar Sadat (1918-1981) -% -Peace, n.: - In international affairs, a period of cheating between two - periods of fighting. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Peanut Blossoms - -4 cups sugar 16 tbsp. milk -4 cups brown sugar 4 tsp. vanilla -4 cups shortening 14 cups flour -8 eggs 4 tsp. soda -4 cups peanut butter 4 tsp. salt - -Shape dough into balls. Roll in sugar and bake on ungreased -cookie sheet at 375 F. for 10-12 minutes. Immediately top -each cookie with a Hershey's kiss or star pressing down firmly -to crack cookie. Makes a hell of a lot. -% -Pecor's Health-Food Principle: - Never eat rutabaga on any day of - the week that has a "y" in it. -% -Pedaeration, n.: - The perfect body heat achieved by having one leg under the - sheet and one hanging off the edge of the bed. - -- Rich Hall, "Sniglets" -% -Pediddel, n.: - A car with only one working headlight. - -- Rich Hall & Friends, "Sniglets" -% -Pedro Guerrero was playing third base for the Los Angeles Dodgers in 1984 -when he made the comment that earns him a place in my Hall of Fame. Second -baseman Steve Sax was having trouble making his throws. Other players were -diving, screaming, signaling for a fair catch. At the same time, Guerrero, -at third, was making a few plays that weren't exactly soothing to manager -Tom Lasorda's stomach. Lasorda decided it was time for one of his famous -motivational meetings and zeroed in on Guerrero: "How can you play third -base like that? You've gotta be thinking about something besides baseball. -What is it?" - "I'm only thinking about two things," Guerrero said. "First, `I -hope they don't hit the ball to me.'" The players snickered, and even -Lasorda had to fight off a laugh. "Second, `I hope they don't hit the ball -to Sax.'" - -- Joe Garagiola, "It's Anybody's Ball Game" -% -Peeping Tom: - A window fan. -% -Peers's Law: -The solution to a problem changes the nature of the problem. -% -Pelorat sighed. - "I will never understand people." - "There's nothing to it. All you have to do is take a close look -at yourself and you will understand everyone else. How would Seldon have -worked out his Plan -- and I don't care how subtle his mathematics was -- -if he didn't understand people; and how could he have done that if people -weren't easy to understand? You show me someone who can't understand -people and I'll show you someone who has built up a false image of himself --- no offense intended." - -- Isaac Asimov, "Foundation's Edge" -% -Penguin Trivia #46: - Animals who are not penguins can only wish they were. - -- Chicago Reader 10/15/82 -% -PENGUINICITY!! -% -Pension, n.: - A federally insured chain letter. -% -People (a group that in my opinion has always attracted an undue amount of -attention) have often been likened to snowflakes. This analogy is meant to -suggest that each is unique -- no two alike. This is quite patently not the -case. People ... are simply a dime a dozen. And, I hasten to add, their -only similarity to snowflakes resides in their invariable and lamentable -tendency to turn, after a few warm days, to slush. - -- Fran Lebowitz, "Social Studies" -% -People are beginning to notice you. -Try dressing before you leave the house. -% -People are like onions -- you cut them up, and they make you cry. -% -People are unconditionally guaranteed to be full of defects. -% -People don't usually make the same mistake twice -- they make it three -times, four time, five times... -% -People in general do not willingly read -if they have anything else to amuse them. - -- S. Johnson -% -People love high ideals, but they got to be about 33-percent plausible. - -- The Best of Will Rogers -% -People need good lies. There are too many bad ones. - -- Bokonon, "Cat's Cradle" by Kurt Vonnegut, Jr. -% -People never lie so much as after a hunt, during a war, or before an -election. - -- Otto von Bismarck -% -People of privilege will always risk their complete destruction -rather than surrender any material part of their advantage. - -- John Kenneth Galbraith -% -People often find it easier to be a -result of the past than a cause of the future. -% -People respond to people who respond. -% -People say I live in my own little fantasy world... well, at least they -*know* me there! - -- D. L. Roth -% -People seem to enjoy things more when they know a lot of other people -have been left out on the pleasure. - -- Russell Baker -% -People seem to think that the blanket phrase, "I only work here," -absolves them utterly from any moral obligation in terms of the -public -- but this was precisely Eichmann's excuse for his job in -the concentration camps. -% -People tend to make rules for others and exceptions for themselves. -% -People that can't find something to live for always seem to find something -to die for. The problem is, they usually want the rest of us to die for -it too. -% -People think love is an emotion. Love is good sense. - -- Ken Kesey -% -People usually get what's coming to them -- unless it's been mailed. -% -People who are funny and smart and return phone calls get -much better press than people who are just funny and smart. - -- Howard Simons, "The Washington Post" -% -People who claim they don't let little things bother -them have never slept in a room with a single mosquito. -% -People who fight fire with fire usually end up with ashes. - -- Abigail Van Buren -% -People who go to conferences are the ones who shouldn't. -% -People who have no faults are terrible; -there is no way of taking advantage of them. -% -People who have what they want are very fond of telling people who haven't -what they want that they don't want it. - -- Ogden Nash -% -People who make no mistakes do not usually make anything. -% -People who push both buttons should get their wish. -% -People who take cat naps don't usually sleep in a cat's cradle. -% -People who take cold baths never have rheumatism, but they have -cold baths. -% -People who think they know everything -greatly annoy those of us who do. -% -People will accept your ideas much more readily if you tell them that Benjamin -Franklin said it first. -% -People will buy anything that's one to a customer. -% -People will do tomorrow what they did today because that is what they -did yesterday. -% -People with narrow minds usually have broad tongues. -% -People's Action Rules: - (1) Some people who can, shouldn't. - (2) Some people who should, won't. - (3) Some people who shouldn't, will. - (4) Some people who can't, will try, regardless. - (5) Some people who shouldn't, but try, will then blame others. -% -Per buck you get more computing action with the small computer. - -- R. W. Hamming -% -Pereant, inquit, qui ante nos nostra dixerunt. -[Confound those who have said our remarks before us.] -or -[May they perish who have expressed our bright ideas before us.] - -- Aelius Donatus -% -Perfect day for scrubbing the floor and other exciting things. -% -Perfect guest, n.: - One who makes his host feel at home. -% -Perfection is finally attained, not when there is no longer -anything to add, but when there is no longer anything to take away. - -- Antoine de Saint-Exupery -% -Performance: - A statement of the speed at which a computer system works. Or - rather, might work under certain circumstances. Or was rumored - to be working over in Jersey about a month ago. -% -Perhaps, after all, America never has been discovered. -I myself would say that it had merely been detected. - -- Oscar Wilde -% -Perhaps no person can be a poet, or even enjoy -poetry without a certain unsoundness of mind. - -- Thomas Macaulay -% -Perhaps the biggest disappointments were the ones you expected anyway. -% -Perhaps the most widespread illusion is that if we were in power we would -behave very differently from those who now hold it -- when, in truth, in -order to get power we would have to become very much like them. (Lenin's -fatal mistake, both in theory and in practice.) -% -Perhaps the world's second-worst crime is boredom. The first is -being a bore. - -- Cecil Beaton -% -Perilous to all of us are the devices of -an art deeper than we ourselves possess. - -- Gandalf the Grey -% -Periphrasis is the putting of things in a round-about way. "The cost may be -upwards of a figure rather below 10m#." is a periphrasis for The cost may be -nearly 10m#. "In Paris there reigns a complete absence of really reliable -news" is a periphrasis for There is no reliable news in Paris. "Rarely does -the `Little Summer' linger until November, but at times its stay has been -prolonged until quite late in the year's penultimate month" contains a -periphrasis for November, and another for lingers. "The answer is in the -negative" is a periphrasis for No. "Was made the recipient of" is a -periphrasis for Was presented with. The periphrasis style is hardly possible -on any considerable scale without much use of abstract nouns such as "basis, -case, character, connexion, dearth, description, duration, framework, lack, -nature, reference, regard, respect". The existence of abstract nouns is a -proof that abstract thought has occurred; abstract thought is a mark of -civilized man; and so it has come about that periphrasis and civilization are -by many held to be inseparable. These good people feel that there is an almost -indecent nakedness, a reversion to barbarism, in saying No news is good news -instead of "The absence of intelligence is an indication of satisfactory -developments." - -- Fowler's English Usage -% -Persistence in one opinion has never been considered -a merit in political leaders. - -- Marcus Tullius Cicero, "Ad familiares", 1st century BC -% -Personifiers of the world, unite! -You have nothing to lose but Mr. Dignity! - -- Bernadette Bosky -% -Personifiers Unite! You have nothing to lose but Mr. Dignity! -% -Persons attempting to find a motive in this narrative will be prosecuted; -persons attempting to find a moral in it will be banished; persons attempting -to find a plot in it will be shot. By Order of the Author - -- Mark Twain, "Tom Sawyer" -% -Pessimist, n.: - A man who spends all his time worrying about how he can keep the - wolf from the door. - -Optimist, n.: - A man who refuses to see the wolf until he seizes the seat of - his pants. - -Opportunist, n.: - A man who invites the wolf in and appears the next day in a fur coat. -% -Pete: Waiter, this meat is bad. -Waiter: Who told you? -Pete: A little swallow. -% -Peter Fellgett's wildcard recipe: - Into a clean dish, place the dry ingredients and add the - liquids until the right consistency is obtained. Turn out - into suitable containers and cook until done. -% -Peter Wemm Murphy Field, n.: - A field of abnormally frequent and severe Murphy's Law events -emanating from Mr. Peter Wemm. The field was first discovered and -identified in Denmark during the initial FreeBSD SMP development. -Mr. Wemm was residing in Australia at the time. -% -Peter's hungry, time to eat lunch. -% -Peter's Law of Substitution: - Look after the molehills, and the - mountains will look after themselves. - -Peter's Principle of Success: - Get up one time more than you're knocked down. - -Peter's Principle: - In every hierarchy, each employee tends to rise to the level of - his incompetence. -% -Peterson's Admonition: - When you think you're going down for the third time -- - just remember that you may have counted wrong. -% -Peterson's Rules: - (1) Trucks that overturn on freeways - are filled with something sticky. - (2) No cute baby in a carriage is ever a girl when called one. - (3) Things that tick are not always clocks. - (4) Suicide only works when you're bluffing. -% -Petribar, n.: - Any sun-bleached prehistoric candy that has been sitting in - the window of a vending machine too long. - -- Rich Hall, "Sniglets" -% -Phasers locked on target, Captain. -% -Philadelphia is not dull -- it just seems so because it is next to -exciting Camden, New Jersey. -% -Philogyny recapitulates erogeny; erogeny recapitulates philogyny. -% -Philosophy, n.: - The ability to bear with calmness the misfortunes of our friends. -% -Philosophy, n.: - Unintelligible answers to insoluble problems. -% -Philosophy will clip an angel's wings. - -- John Keats -% -Phone call for chucky-pooh. -% -Phosflink, v.: - To flick a bulb on and off when it burns out (as if, somehow, - that will bring it back to life). - -- Rich Hall & Friends, "Sniglets" -% -Photographing a volcano is just about -the most miserable thing you can do. - -- Robert B. Goodman - [Who has clearly never tried to use a PDP-10. Ed.] -% -Physically there is nothing to distinguish human society from the -farm-yard except that children are more troublesome and costly than -chickens and women are not so completely enslaved as farm stock. - -- George Bernard Shaw, "Getting Married" -% -Pick another fortune cookie. -% -Picking up the pieces of my sweet shattered dream, -I wonder how the old folks are tonight, -Her name was Ann, and I'll be damned if I recall her face, -She left me not knowing what to do. - -Carefree Highway, let me slip away on you, -Carefree Highway, you seen better days, -The morning after blues, from my head down to my shoes, -Carefree Highway, let me slip away, slip away, on you... - -Turning back the pages to the times I love best, -I wonder if she'll ever do the same, -Now the thing that I call livin' is just bein' satisfied, -With knowing I got noone left to blame. -Carefree Highway, I got to see you, my old flame... - -Searching through the fragments of my dream shattered sleep, -I wonder if the years have closed her mind, -I guess it must be wanderlust or tryin' to get free, -From the good old faithful feelin' we once knew. - -- Gordon Lightfoot, "Carefree Highway" -% -Pickle's Law: - If Congress must do a painful thing, - the thing must be done in an odd-number year. -% -Picture the sun as the origin of two intersecting 6-dimensional -hyperplanes from which we can deduce a certain transformational -sequence which gives us the terminal velocity of a rubber duck ... -% -Piddle, twiddle, and resolve, -Not one damn thing do we solve. - -- 1776 -% -Pie are not square. Pie are round. Cornbread are square. -% -Piece of cake! - -- G. S. Koblas -% -Pig, n.: - An animal (Porcus omnivorous) closely allied to the human race - by the splendor and vivacity of its appetite, which, however, - is inferior in scope, for it balks at pig. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Pilfering Treasure property is particularly dangerous: big thieves are -ruthless in punishing little thieves. - -- Diogenes -% -Pilots should avoid using illegal drugs. - -- AOPA's Pilot's Handbook, 1988 -% -Piping down the valleys wild, -Piping songs of pleasant glee, -On a cloud I saw a child, -And he laughing said to me: -"Pipe a song about a Lamb!" -So I piped with merry cheer. -"Piper, pipe that song again;" -So I piped: he wept to hear. - -- William Blake, "Songs of Innocence" -% -Pipo was born with few complications, but then the doctor accidentally dropped -the infant on her head provoking her drunken father to drag the physician -outside where he would beat him to death with a live ocelot. - -- Love and Rockets -% -PISCES (Feb. 19 - Mar. 20) - You have a vivid imagination and often think you are being followed - by the CIA or FBI. You have minor influence over your associates - and people resent your flaunting of your power. You lack confidence - and you are generally a coward. Pisces people do terrible things to - small animals. -% -PISCES (Feb. 19 to Mar. 20) - Take the high road, look for the good things, carry the American - Express card and a weapon. The world is yours today, as nobody - else wants it. Your mortgage will be foreclosed. You will probably - get run over by a bus. -% -PISCES (Feb.19 - Mar.20) - You will get some very interesting news of a promotion today. - It will go to someone in the office you dislike and will be the - job you wanted. Don't lend anyone a car today. You don't have - a car. -% -Pity the meek, for they shall inherit the earth. - -- Don Marquis -% -Pixel, n.: - A mischievous, magical spirit associated with screen displays. - The computer industry has frequently borrowed from mythology: - Witness the sprites in computer graphics, the demons in artificial - intelligence, and the trolls in the marketing department. -% -P-K4 -% -Plaese porrf raed. - -- Prof. Michael O'Longhlin, S.U.N.Y. Purchase -% -Plagiarize, plagiarize, -Let no man's work evade your eyes, -Remember why the good Lord made your eyes, -Don't shade your eyes, -But plagiarize, plagiarize, plagiarize. -Only be sure to call it research. - -- Tom Lehrer -% -Planet Claire has pink hair. -All the trees are red. -No one ever dies there. -No one has a head.... -% -Plastic... Aluminum... These are the inheritors of the Universe! -Flesh and Blood have had their day... and that day is past! - -- Green Lantern Comics -% -Plato, by the way, wanted to banish all poets from his proposed Utopia -because they were liars. The truth was that Plato knew philosophers -couldn't compete successfully with poets. - -- Kilgore Trout (Philip J. Farmer) "Venus on the Half - Shell" -% -Play Rogue, visit exotic locations, meet strange creatures and kill -them. -% -Playing an unamplified electric guitar is like strumming on a picnic -table. - -- Dave Barry, "The Snake" -% -Please don't put a strain on our friendship -by asking me to do something for you. -% -Please don't recommend me to your friends-- -it's difficult enough to cope with you alone. -% -PLEASE DON'T SMOKE HERE! - -Penalty: An early, lingering death from cancer, - emphysema, or other smoking-caused ailment. -% -Please forgive me if, in the heat of battle, -I sometimes forget which side I'm on. -% -Please go away. -% -Please help keep the world clean: others may wish to use it. -% -Please ignore previous fortune. -% -Please keep your hands off the secretary's reproducing equipment. -% -Please, Mother! I'd rather do it myself! -% -Please remain calm, it's no use both of -us being hysterical at the same time. -% -Please stand for the National Anthem: - - Australian's all, let us rejoice, - For we are young and free. - We've golden soil and wealth for toil - Our home is girt by sea. - Our land abounds in nature's gifts - Of beauty rich and rare. - In history's page, let every stage - Advance Australia Fair. - In joyful strains then let us sing, - Advance Australia Fair. - -Thank you. You may resume your seat. -% -Please stand for the National Anthem: - - God save our Gracious Queen! - Long live our Noble Queen! - God save the Queen! - Send her victorious, - Happy and glorious, - Long to reign o'er us! - God save the Queen! - -Thank you. You may resume your seat. -% -Please stand for the National Anthem: - - O Canada - Our home and native land - True patriot love - In all thy sons' command - With glowing hearts we see thee rise - The true north strong and free - From far and wide, O Canada - We stand on guard for thee - God keep our land glorious and free - O Canada we stand on guard for thee - O Canada we stand on guard for thee - -Thank you. You may resume your seat. -% -Please stand for the National Anthem: - - Oh, say can you see by dawn's early light - What so proudly we hailed at the twilight's last gleaming? - Whose broad stripes and bright stars through the perilous fight - O'er the ramparts we watched were so gallantly streaming? - And the rockets' red glare, the bombs bursting in air, - Gave proof through the night that our flag was still there. - Oh, say does that star-spangled banner yet wave - O'er the land of the free and the home of the brave? - -Thank you. You may resume your seat. -% -Please take note: -% -Please try to limit the amount of "this room doesn't have any bazingas" -until you are told that those rooms are "punched out." Once punched out, -we have a right to complain about atrocities, missing bazingas, and such. - -- N. Meyrowitz -% -Please, won't somebody tell me what diddie-wa-diddie means? -% -PL/I -- "the fatal disease" -- belongs more to the problem set than to the -solution set. - -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5 -% -Plots are like girdles. Hidden, they hold your interest; revealed, they're -of no interest except to fetishists. Like girdles, they attempt to contain -an uncontainable experience. - -- R. S. Knapp -% -PLUG IT IN!!! -% -Plus ca change, plus c'est le meme chose. -% -Pohl's law: - Nothing is so good that somebody, somewhere, will not hate it. -% -Poisoned coffee, n.: - Grounds for divorce. -% -Poland has gun control. -% -Police: Good evening, are you the host? -Host: No. -Police: We've been getting complaints about this party. -Host: About the drugs? -Police: No. -Host: About the guns, then? Is somebody complaining about the guns? -Police: No, the noise. -Host: Oh, the noise. Well that makes sense because there are no guns - or drugs here. (An enormous explosion is heard in the - background.) Or fireworks. Who's complaining about the noise? - The neighbors? -Police: No, the neighbors fled inland hours ago. Most of the recent - complaints have come from Pittsburgh. Do you think you could - ask the host to quiet things down? -Host: No Problem. (At this point, a Volkswagen bug with primitive - religious symbols drawn on the doors emerges from the living - room and roars down the hall, past the police and onto the - lawn, where it smashes into a tree. Eight guests tumble out - onto the grass, moaning.) See? Things are starting to wind - down. -% -Political history is far too criminal a subject to be a fit thing to -teach children. - -- W. H. Auden -% -Political speeches are like steer horns. A point -here, a point there, and a lot of bull in between. - -- Alfred E. Neuman -% -Political T.V. commercials prove one thing: some candidates can tell -all their good points and qualifications in just 30 seconds. -% -Politician, n.: - An eel in the fundamental mud upon which the superstructure of - organized society is reared. When he wriggles, he mistakes the - agitation of his tail for the trembling of the edifice. As - compared with the statesman, he suffers the disadvantage of - being alive. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Politician, n.: - From the Greek "poly" ("many") and the French "tete" ("head" or - "face," as in "tete-a-tete": head to head or face to face). - Hence "polytetien", a person of two or more faces. - -- Martin Pitt -% -Politicians are the same everywhere. They promise -to build a bridge even where there is no river. - -- Nikita Khrushchev -% -Politicians should read science fiction, not westerns and detective stories. - -- Arthur C. Clarke -% -Politicians speak for their parties, and parties never are, never have -been, and never will be wrong. - -- Walter Dwight -% -Politics -- the gentle art of getting votes from the poor and campaign -funds from the rich by promising to protect each from the other. - -- Oscar Ameringer -% -Politics and the fate of mankind are formed by men without ideals and -without greatness. Those who have greatness within them do not go in -for politics. - -- Albert Camus -% -Politics are almost as exciting as war, and quite as -dangerous. In war, you can only be killed once. - -- Winston Churchill -% -Politics, as a practice, whatever its professions, has always been the -systematic organisation of hatreds. - -- Henry Adams, "The Education of Henry Adams" -% -Politics is like coaching a football team. You have to be smart -enough to understand the game but not smart enough to lose interest. -% -Politics is not the art of the possible. It consists in choosing -between the disastrous and the unpalatable. - -- John Kenneth Galbraith -% -Politics is supposed to be the second oldest profession. I have come to -realize that it bears a very close resemblance to the first. - -- Ronald Reagan -% -Politics is the ability to foretell what is going to happen tomorrow, next -week, next month and next year. And to have the ability afterwards to -explain why it didn't happen. - -- Winston Churchill -% -Politics, like religion, hold up the -torches of martyrdom to the reformers of error. - -- Thomas Jefferson -% -Politics makes strange bedfellows, and journalism makes strange politics. - -- Amy Gorin -% -Politics, n.: - A strife of interests masquerading as a contest of principles. - The conduct of public affairs for private advantage. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Pollyanna's Educational Constant: - The hyperactive child is never absent. -% -POLYGON: - Dead parrot. -% -Polymer physicists are into chains. -% -Poorman's Rule: - When you pull a plastic garbage bag from its handy dispenser - package, you always get hold of the closed end and try to - pull it open. -% -Pope Goestheveezl was the shortest reigning pope in the history of the -Church, reigning for two hours and six minutes on 1 April 1866. The white -smoke had hardly faded into the blue of the Vatican skies before it dawned -on the assembled multitudes in St. Peter's Square that his name had hilarious -possibilities. The crowds fell about, helpless with laughter, singing - - Half a pound of tuppenny rice - Half a pound of treacle - That's the way the chimney smokes - Pope Goestheveezl - -The square was finally cleared by armed carabineri with tears of laughter -streaming down their faces. The event set a record for hilarious civic -functions, smashing the previous record set when Baron Hans Neizant -Bompzidaize was elected Landburgher of Koln in 1653. - -- Mike Harding, "The Armchair Anarchist's Almanac" -% -Populus vult decipi. -[The people like to be deceived.] -% -Porsche; there simply is no substitute. - -- Risky Business -% -Portable, adj.: - Survives system reboot. -% -POSITIVE: - Being mistaken at the top of your voice. -% -Positive, adj.: - Mistaken at the top of one's voice. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Possessions increase to fill the space available for their storage. - -- Ryan -% -Post proelium, praemium. -[After the battle, the reward.] -% -Postmen never die, they just lose their zip. -% -Potahto' Pictures Productions Presents: - - SPUD ROGERS OF THE 25TH CENTURY: Story of an Air Force potato that's -left in a rarely used chow hall for over two centuries and wakes up in a world -populated by soybean created imitations under the evil Dick Tater. Thanks to -him, the soy-potatoes learn that being a 'tater is where it's at. Memorable -line, "'Cause I'm just a stud spud!" - - FRIDAY THE 13TH DINER SERIES: Crazed potato who was left in a -fryer too long and was charbroiled carelessly returns to wreak havoc on -unsuspecting, would-be teen camp cooks. Scenes include a girl being stuffed -with chives and Fleischman's Margarine and a boy served up on a side dish -with beets and dressing. Definitely not for the squeamish, or those on -diets that are driving them crazy. - - FRIDAY THE 13TH DINER II,III,IV,V,VI: Much, much more of the same. -Except with sour cream. -% -Potahto' Pictures Productions Presents: - - THE TATERNATOR: Cyborg spud returns from the future to present-day -McDonald's restaurant to kill the potatoes (girl 'tater) who will give birth -to the world's largest french fry (The Dark Powers of Burger King are clearly -behind this). Most quotable line: "Ah'll be baked..." - - A FISTFUL OF FRIES: Western in which our hero, The Spud with No Name, -rides into a town that's deprived of carbohydrates thanks to the evil takeover -of the low-cal Scallopinni Brothers. Plenty of smokeouts, fry-em-ups, and -general butter-melting by all. - - FOR A FEW FRIES MORE: Takes up where AFOF left off! Cameo by Walter -Cronkite, as every man's common 'tater! -% -Pound for pound, the amoeba is the most vicious animal on earth. -% -POVERTY: - An unfortunate state that persists as long - as anyone lacks anything he would like to have. -% -Poverty begins at home. -% -Poverty must have its satisfactions, else there would not be so many -poor people. - -- Don Herold -% -Power and ignorance is a detestable cocktail. - -- Poul Henningsen (1894-1967) -% -Power corrupts. Absolute power is kind of neat. - -- John Lehman, Secretary of the Navy, 1981-1987 -% -Power corrupts. And atomic power corrupts atomically. -% -Power corrupts. Powerpoint corrupts absolutely. - -- Vint Cerf -% -Power is poison. -% -Power is the finest token of affection. -% -Power, like a desolating pestilence, -Pollutes whate'er it touches... - -- Percy Bysshe Shelley -% -Power, n.: - The only narcotic regulated by the SEC instead of the FDA. -% -Power tends to corrupt, absolute power corrupts absolutely. - -- Lord Acton -% -PPRB -- Pillage, plunder, rape and burn. -% -Practical people would be more practical if -they would take a little more time for dreaming. - -- J. P. McEvoy -% -Practical politics consists in ignoring facts. - -- Henry Adams -% -Practically perfect people never permit -sentiment to muddle their thinking. - -- Mary Poppins -% -Practice is the best of all instructors. - -- Publilius -% -Practice yourself what you preach. - -- Titus Maccius Plautus -% -PRAIRIES: - Vast plains covered by treeless forests. -% -Praise the Lord and pass the ammunition. - -- Stephen Coonts, "The Minotaur" -% -Praise the sea; on shore remain. - -- John Florio -% -Pray to God, but keep rowing to shore. - -- Russian Proverb -% -Pray, v.: - To ask that the laws of the universe be annulled on behalf - of a single petitioner confessedly unworthy. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Predestination was doomed from the start. -% -Prediction is very difficult, especially of the future. - -- Niels Bohr -% -Prejudice, n.: - A vagrant opinion without visible means of support. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Premature optimization is the root of all evil. - -- Donald E. Knuth -% -Preserve the old, but know the new. -% -Preserve wildlife -- pickle a squirrel today! -% -Preserve Wildlife! Throw a party today! -% -President Reagan has noted that there are too many economic -pundits and forecasters and has decided on an excess prophets tax. -% -President Thieu says he'll quit if he doesn't get more than 50% -of the vote. In a democracy, that's not called quitting. - -- The Washington Post -% -Pretend to spank me -- I'm a pseudo-masochist! -% -Preudhomme's Law of Window Cleaning: - It's on the other side. -% -Price's Advice: - It's all a game -- play it to have fun. -% -[Prime Minister Joseph] Chamberlain loves -the working man, he loves to see him work. - -- Winston Churchill -% -[Prime Minister MacDonald] has the gift of compressing the -largest amount of words into the smallest amount of thought. - -- Winston Churchill -% -Prince Hamlet thought Uncle a traitor -For having it off with his Mater; - Revenge Dad or not? - That's the gist of the plot, -And he did -- nine soliloquies later. - -- Stanley J. Sharpless -% -Princeton's taste is sweet like a strawberry tart. Harvard's is a subtle -taste, like whiskey, coffee, or tobacco. It may even be a bad habit, for -all I know. - -- Prof. J. H. Finley '25 -% -Priority: - A statement of the importance of a user or a program. Often - expressed as a relative priority, indicating that the user doesn't - care when the work is completed so long as he is treated less - badly than someone else. -% -Prisons are built with stones of Law, brothels with bricks of Religion. - -- Blake -% -Prizes are for children. - -- Charles Ives, - upon being given, but refusing, the Pulitzer prize -% -Pro is to con as progress is to Congress. -% -Probable-Possible, my black hen, -She lays eggs in the Relative When. -She doesn't lay eggs in the Positive Now -Because she's unable to postulate How. - -- Frederick Winsor -% -Probably the question asked most often is: Do one-celled animals have -orgasms? The answer is yes, they have orgasms almost constantly, which -is why they don't mind living in pools of warm slime. - -- Dave Barry, "Sex and the Single Amoeba: What Every - Teen Should Know" -% -PROBLEM DRINKER: - A man who never buys. -% -Producers seem to be so prejudiced against actors who've had no training. -And there's no reason for it. So what if I didn't attend the Royal Academy -for twelve years? I'm still a professional trying to be the best actress -I can. Why doesn't anyone send me the scripts that Faye Dunaway gets? - -- Farrah Fawcett-Majors -% -Prof: So the American government went to IBM to come up with a data - encryption standard and they came up with ... -Student: EBCDIC! -% -Profanity is the one language all programmers know best. -% -Professor Gorden Newell threw another shutout in last week's Chem Eng. 130 -midterm. Once again a student did not receive a single point on his exam. -Newell has now tossed 5 shutouts this quarter. Newell's earned exam average -has now dropped to a phenomenal 30%. -% -PROGRAM: - Any task that can't be completed in one telephone call or one - day. Once a task is defined as a program ("training program," - "sales program," or "marketing program"), its implementation - always justifies hiring at least three more people. -% -Program, n.: - A magic spell cast over a computer allowing it to turn one's input - into error messages. tr.v. To engage in a pastime similar to banging - one's head against a wall, but with fewer opportunities for reward. -% -Programmers used to batch environments may find it hard to live -without giant listings; we would find it hard to use them. - -- Dennis M. Ritchie -% -Programming Department: - Mistakes made while you wait. -% -Programming is an unnatural act. -% -Programming today is a race between software engineers striving to -build bigger and better idiot-proof programs, and the Universe trying -to produce bigger and better idiots. So far, the Universe is winning. - -- Rich Cook -% -PROGRESS: - Medieval man thought disease was caused by invisible demons - invading the body and taking possession of it. - - Modern man knows disease is caused by microscopic bacteria - and viruses invading the body and causing it to malfunction. -% -Progress is impossible without change, and those who -cannot change their minds cannot change anything. - -- George Bernard Shaw -% -Progress means replacing a theory that -is wrong with one more subtly wrong. -% -Progress might have been all right once, but it's gone on too long. - -- Ogden Nash -% -Progress was all right. Only it went on too long. - -- James Thurber -% -Promise her anything, but give her Exxon unleaded. -% -Promising costs nothing, it's the delivering that kills you. -% -PROMOTION FROM WITHIN: - A system of moving incompetents up to the policy-making - level where they can't foul up operations. -% -Promptness is its own reward, if one lives by the clock instead of the sword. -% -Proof techniques #1: Proof by Induction. - -This technique is used on equations with 'n' in them. Induction -techniques are very popular, even the military use them. - -SAMPLE: Proof of induction without proof of induction. - - We know it's true for n equal to 1. Now assume that it's true -for every natural number less than n. N is arbitrary, so we can take n -as large as we want. If n is sufficiently large, the case of n+1 is -trivially equivalent, so the only important n are n less than n. We can -take n = n (from above), so it's true for n+1 because it's just about n. - QED. (QED translates from the Latin as "So what?") -% -Proof techniques #2: Proof by Oddity. - SAMPLE: To prove that horses have an infinite number of legs. -(1) Horses have an even number of legs. -(2) They have two legs in back and fore legs in front. -(3) This makes a total of six legs, which certainly is an odd number of - legs for a horse. -(4) But the only number that is both odd and even is infinity. -(5) Therefore, horses must have an infinite number of legs. - -Topics to be covered in future issues include proof by: - Intimidation - Gesticulation (handwaving) - "Try it; it works" - Constipation (I was just sitting there and ...) - Blatant assertion - Changing all the 2's to _n's - Mutual consent - Lack of a counterexample, and - "It stands to reason" -% -Proper treatment will cure a cold in seven days, -but left to itself, a cold will hang on for a week. - -- Darrell Huff -% -Proposed Additions to the PDP-11 Instruction Set: - -BBW Branch Both Ways -BEW Branch Either Way -BBBF Branch on Bit Bucket Full -BH Branch and Hang -BMR Branch Multiple Registers -BOB Branch On Bug -BPO Branch on Power Off -BST Backspace and Stretch Tape -CDS Condense and Destroy System -CLBR Clobber Register -CLBRI Clobber Register Immediately -CM Circulate Memory -CMFRM Come From -- essential for truly structured programming -CPPR Crumple Printer Paper and Rip -CRN Convert to Roman Numerals -% -Proposed Additions to the PDP-11 Instruction Set: - -DC Divide and Conquer -DMPK Destroy Memory Protect Key -DO Divide and Overflow -EMPC Emulate Pocket Calculator -EPI Execute Programmer Immediately -EROS Erase Read Only Storage -EXCE Execute Customer Engineer -HCF Halt and Catch Fire -IBP Insert Bug and Proceed -INSQSW Insert into queue somewhere (for FINO queues [First in never out]) -PBC Print and Break Chain -PDSK Punch Disk -% -Proposed Additions to the PDP-11 Instruction Set: - -PI Punch Invalid -POPI Punch Operator Immediately -PVLC Punch Variable Length Card -RASC Read And Shred Card -RPM Read Programmers Mind -RSSC Reduce Speed, Step Carefully (for improved accuracy) -RTAB Rewind Tape and Break -RWDSK Rewind Disk -RWOC Read Writing On Card -SCRBL Scribble to disk - faster than a write -SLC Search for Lost Chord -SPSW Scramble Program Status Word -SRSD Seek Record and Scar Disk -STROM Store in Read Only Memory -TDB Transfer and Drop Bit -WBT Water Binary Tree -% -Prosperity makes friends, adversity tries them. - -- Publilius Syrus -% -Prototype designs always work. - -- Don Vonada -% -prototype, n. - First stage in the life cycle of a computer product, followed by - pre-alpha, alpha, beta, release version, corrected release version, - upgrade, corrected upgrade, etc. Unlike its successors, the - prototype is not expected to work. -% -Protozoa are small, and bacteria are small, but viruses are smaller -than the both put together. -% -Providence New Jersey is one of the few cities -where Velveeta cheese appears on the gourmet shelf. -% -Prunes give you a run for your money. -% -Pryor's Observation: - How long you live has nothing to do - with how long you are going to be dead. -% -PS: This message is not intended to supply the minimum -daily requirement of serious thought. Consult your doctor -or pharmacist, but not the one that just sent you electronic -junk mail or promises to make explicit drugs fast. - -- taken from Norman Wilson's .sig -% -Psychiatrists say that one out of four people are mentally ill. Check -three friends. If they're OK, you're it. -% -Psychiatry enables us to correct our faults by confessing our parents' -shortcomings. - -- Dr. Laurence J. Peter, "Peter's Principles" -% -Psychics will soon lead dogs to your body. -% -Psychoanalysis is that mental illness for which it regards itself -a therapy. - -- Karl Kraus - -Psychiatry is the care of the id by the odd. - -Show me a sane man and I will cure him for you. - -- Carl G. Jung -% -Psychologist, n.: - Someone who watches everyone else when an attractive woman walks - into a room. -% -Psychologists think they're experimental psychologists. -Experimental psychologists think they're biologists. -Biologists think they're biochemists. -Biochemists think they're chemists. -Chemists think they're physical chemists. -Physical chemists think they're physicists. -Physicists think they're theoretical physicists. -Theoretical physicists think they're mathematicians. -Mathematicians think they're metamathematicians. -Metamathematicians think they're philosophers. -Philosophers think they're gods. -% -Psychology. Mind over matter. -Mind under matter? It doesn't matter. -Never mind. -% -Psychotherapy is the theory that the patient will probably get well -anyhow and is certainly a damn fool. - -- H. L. Mencken -% -Public use of any portable music system is a -virtually guaranteed indicator of sociopathic tendencies. - -- Zoso -% -Publishing a volume of verse is like dropping -a rose petal down the Grand Canyon and waiting for the echo. -% -Pudder's Law: - Anything that begins well will end badly. - (Note: The converse of Pudder's law is not true.) -% -Punning is the worst vice, and there's no vice versa. -% -Puns are little "plays on words" that a certain breed of person loves -to spring on you and then look at you in a certain self-satisfied way -to indicate that he thinks that you must think that he is by far the -cleverest person on Earth now that Benjamin Franklin is dead, when in -fact what you are thinking is that if this person ever ends up in a -lifeboat, the other passengers will hurl him overboard by the end of -the first day even if they have plenty of food and water. - -- Dave Barry, "Why Humor is Funny" -% -Pure drivel tends to drive ordinary drivel off of the TV screen. -% -PURGE COMPLETE. -% -PURITAN: - Someone who is deathly afraid that - someone, somewhere, is having fun. -% -Puritanism -- the haunting fear that someone, somewhere, may be happy. - -- H. L. Mencken, "A Book of Burlesques" -% -Purpitation, v.: - To take something off the grocery shelf, decide you - don't want it, and then put it in another section. - -- Rich Hall & Friends, "Sniglets" -% -Pushing 30 is exercise enough. -% -Pushing 40 is exercise enough. -% -Put a pot of chili on the stove to simmer. -Let it simmer. Meanwhile, broil a good steak. -Eat the steak. Let the chili simmer. Ignore it. - -- Recipe for chili from Allan Shrivers, former governor - of Texas. -% -Put a rogue in the limelight and he will act like an honest man. - -- Napoleon Bonaparte, "Maxims" -% -Put another password in, -Bomb it out, then try again. -Try to get past logging in, -We're hacking, hacking, hacking. - -Try his first wife's maiden name, -This is more than just a game. -It's real fun, but just the same, -It's hacking, hacking, hacking. -% -Put cats in the coffee and mice in the tea! -% -Put no trust in cryptic comments. -% -Put not your trust in money, but put your money in trust. -% -Put your best foot forward. -Or just call in and say you're sick. -% -Put your brain in gear before starting your mouth in motion. -% -Put your Nose to the Grindstone! - -- Amalgamated Plastic Surgeons and Toolmakers, Ltd. -% -Put your trust in those who are worthy. -% -Putt's Law: - Technology is dominated by two types of people: - Those who understand what they do not manage. - Those who manage what they do not understand. -% -Pyro's of the world... IGNITE !!! -% -Q: Are we not men? -A: We are Vaxen. -% -Q: Do you know what the death rate around here is? -A: One per person. -% -Q: Do you think the idea of "one tool doing one job" has been - abandoned? ... -A: Those days are dead and gone and the eulogy was delivered by - Perl. - -- Rob Pike -% -Q: Have you heard about the man who didn't pay for his exorcism? -A: He got re-possessed! -% -Q: How can we get the Beatles to reunite for one more concert? -A: With three more bullets. -% -Q: How can you tell if an elephant is having an affair with - your wife? -A: You have to wait 22 months. -% -Q: How can you tell if an elephant is sitting on your back - in a hurricane? -A: You can hear his ears flapping in the wind. -% -Q: How can you tell when a Burroughs salesman is lying? -A: When his lips move. -% -Q: How did the elephant get to the top of the oak tree? -A: He sat on an acorn and waited for spring. - -Q: But how did he get back down? -A: He crawled out on a leaf and waited for autumn. -% -Q: How did the regular expression cross the road? -A: ^.*$ -% -Q: How did you get into artificial intelligence? -A: Seemed logical -- I didn't have any real intelligence. -% -Q: How do you catch a unique rabbit? -A: Unique up on it! - -Q: How do you catch a tame rabbit? -A: The tame way! -% -Q: How do you keep a moron in suspense? -% -Q: How do you keep an Aggie busy at a terminal? -A: While he's not looking, switch it to "local". -% -Q: How do you know when you're in the section of Vermont? -A: The maple sap buckets are hanging on utility poles. -% -Q: How do you make an elephant float? -A: You get two scoops of elephant and some root beer... -% -Q: How do you save a drowning lawyer? -A: Throw him a rock. -% -Q: How do you shoot a blue elephant? -A: With a blue-elephant gun. - -Q: How do you shoot a pink elephant? -A: Twist its trunk until it turns blue, then shoot it with - a blue-elephant gun. -% -Q: How do you stop an elephant from charging? -A: Take away his credit cards. -% -Q: How does a hacker fix a function which - doesn't work for all of the elements in its domain? -A: He changes the domain. -% -Q: How does a single woman in New York get rid of cockroaches? -A: She asks them for a commitment. -% -Q: How does a WASP propose marriage? -A: "How would you like to be buried with my people?" -% -Q: How many Bell Labs Vice Presidents does it take to change a light bulb? -A: That's proprietary information. Answer available from AT&T on payment - of license fee (binary only). -% -Q: How many bureaucrats does it take to screw in a light bulb? -A: Two. One to assure everyone that everything possible is being - done while the other screws the bulb into the water faucet. -% -Q: How many Californians does it take to screw in a lightbulb? -A: Five. One to screw in the lightbulb and four to share the - experience. (Actually, Californians don't screw in - lightbulbs, they screw in hot tubs.) - -Q: How many Oregonians does it take to screw in a light bulb? -A: Three. One to screw in the lightbulb and two to fend off all - those Californians trying to share the experience. -% -Q: How many college football players does it take to screw in a lightbulb? -A: Only one, but he gets three credits for it. -% -Q: How many DEC repairmen does it take to fix a flat? -A: Five; four to hold the car up and one to swap tires. - -Q: How long does it take? -A: It's indeterminate. - It will depend upon how many flats they've brought with them. - -Q: What happens if you've got TWO flats? -A: They replace your generator. -% -Q: How many Democrats does it take to enjoy a good joke? -A: One more than you can find. -% -Q: How many elephants can you fit in a VW Bug? -A: Four. Two in the front, two in the back. - -Q: How can you tell if an elephant is in your refrigerator? -A: There's a footprint in the mayo. - -Q: How can you tell if two elephants are in your refrigerator? -A: There's two footprints in the mayo. - -Q: How can you tell if three elephants are in your refrigerator? -A: The door won't shut. - -Q: How can you tell if four elephants are in your refrigerator? -A: There's a VW Bug in your driveway. -% -Q: How many existentialists does it take to screw in a lightbulb? -A: Two. One to screw it in and one to observe how the lightbulb - itself symbolizes a single incandescent beacon of subjective - reality in a netherworld of endless absurdity reaching out toward a - maudlin cosmos of nothingness. -% -Q: How many hardware engineers does it take to change a lightbulb? -A: None. We'll fix it in software. - -Q: How many system programmers does it take to change a light bulb? -A: None. The application can work around it. - -Q: How many software engineers does it take to change a lightbulb? -A: None. We'll document it in the manual. - -Q: How many tech writers does it take to change a lightbulb? -A: None. The user can figure it out. -% -Q: How many Harvard MBAs does it take to screw in a lightbulb? -A: Just one. He grasps it firmly and the universe revolves around him. -% -Q: How many IBM 370s does it take to execute a job? -A: Four, three to hold it down, and one to rip its head off. -% -Q: How many IBM CPUs does it take to do a logical right shift? -A: 33. 1 to hold the bits and 32 to push the register. -% -Q: How many IBM types does it take to change a light bulb? -A: Fifteen. One to do it, and fourteen to write document number - GC7500439-0001, Multitasking Incandescent Source System Facility, - of which 10% of the pages state only "This page intentionally - left blank", and 20% of the definitions are of the form "A:..... - consists of sequences of non-blank characters separated by blanks". -% -Q: How many journalists does it take to screw in a lightbulb? -A: Three. One to report it as an inspired government program to bring - light to the people, one to report it as a diabolical government plot - to deprive the poor of darkness, and one to win a Pulitzer prize for - reporting that Electric Company hired a lightbulb-assassin to break - the bulb in the first place. -% -Q: How many lawyers does it take to change a light bulb? -A: One. Only it's his light bulb when he's done. -% -Q: How many lawyers does it take to change a light bulb? -A: Whereas the party of the first part, also known as "Lawyer", - and the party of the second part, also known as "Light Bulb", - do hereby and forthwith agree to a transaction wherein the - party of the second part shall be removed from the current - position as a result of failure to perform previously agreed - upon duties, i.e., the lighting, elucidation, and otherwise - illumination of the area ranging from the front (north) door, - through the entryway, terminating at an area just inside the - primary living area, demarcated by the beginning of the carpet, - any spillover illumination being at the option of the party of - the second part and not required by the aforementioned agreement - between the parties. - - The aforementioned removal transaction shall include, but not - be limited to, the following. The party of the first part - shall, with or without elevation at his option, by means of a - chair, stepstool, ladder or any other means of elevation, grasp - the party of the second part and rotate the party of the second - part in a counter-clockwise direction, this point being tendered - non-negotiable. Upon reaching a point where the party of the - second part becomes fully detached from the receptacle, the - party of the first part shall have the option of disposing of - the party of the second part in a manner consistent with all - relevant and applicable local, state and federal statutes. - - Once separation and disposal have been achieved, the party of - the first part shall have the option of beginning installation. - Aforesaid installation shall occur in a manner consistent with - the reverse of the procedures described in step one of this - self-same document, being careful to note that the rotation - should occur in a clockwise direction, this point also being - non-negotiable. - - The above described steps may be performed, at the option of - the party of the first part, by any or all agents authorized - by him, the objective being to produce the most possible - revenue for the Partnership. -% -Q: How many lawyers does it take to change a light bulb? -A: You won't find a lawyer who can change a light bulb. Now, if - you're looking for a lawyer to screw a light bulb... -% -Q: How many marketing people does it take to change a lightbulb? -A: I'll have to get back to you on that. -% -Q: How many Martians does it take to screw in a lightbulb? -A: One and a half. -% -Q: How many Marxists does it take to screw in a lightbulb? -A: None: The lightbulb contains the seeds of its own revolution. -% -Q: How many mathematicians does it take to screw in a lightbulb? -A: One. He gives it to six Californians, thereby reducing the problem - to the earlier joke. -% -Q: How many members of the U.S.S. Enterprise does it take to change a - light bulb? -A: Seven. Scotty has to report to Captain Kirk that the light bulb in - the Engineering Section is getting dim, at which point Kirk will send - Bones to pronounce the bulb dead (although he'll immediately claim - that he's a doctor, not an electrician). Scotty, after checking - around, realizes that they have no more new light bulbs, and complains - that he "canna" see in the dark. Kirk will make an emergency stop at - the next uncharted planet, Alpha Regula IV, to procure a light bulb - from the natives, who, are friendly, but seem to be hiding something. - Kirk, Spock, Bones, Yeoman Rand and two red shirt security officers - beam down to the planet, where the two security officers are promptly - killed by the natives, and the rest of the landing party is captured. - As something begins to develop between the Captain and Yeoman Rand, - Scotty, back in orbit, is attacked by a Klingon destroyer and must - warp out of orbit. Although badly outgunned, he cripples the Klingon - and races back to the planet in order to rescue Kirk et. al. who have - just saved the natives' from an awful fate and, as a reward, been - given all lightbulbs they can carry. The new bulb is then inserted - and the Enterprise continues on its five year mission. -% -Q: How many people from New Jersey does it take to change a light - bulb? -A: Three. One to do it, one to watch, and the third to shoot the - witness. -% -Q: How many pre-med's does it take to change a lightbulb? -A: Five: One to change the bulb and four to pull the ladder - out from under him. -% -Q: How many psychiatrists does it take to change a light bulb? -A: Only one, but it takes a long time, and the light bulb has - to really want to change. -% -Q: How many Romulans does it take to screw in a light bulb? -A: Twelve. One to screw the light-bulb in, and eleven - to self-destruct the ship out of disgrace. - - [Warning: do not tell this joke to Romulans or else be ready for - a fight. They consider it to be a disgrace, though it's - pretty good for a LBJ. Ed.] -% -Q: How many surrealists does it take to change a light bulb? -A: Two, one to hold the giraffe, and the other to fill the bathtub - with brightly colored machine tools. - - [Surrealist jokes just aren't my cup of fur. Ed.] -% -Q: How many WASPs does it take to change a lightbulb? -A: One. -% -Q: How many Zen masters does it take to screw in a light bulb? -A: None. The Universe spins the bulb, and the Zen master stays out - of the way. -% -Q: How much does it cost to ride the Unibus? -A: 2 bits. -% -Q: How was Thomas J. Watson buried? -A: 9 edge down. -% -Q: Know what the difference between your latest project - and putting wings on an elephant is? -A: Who knows? The elephant *might* fly, heh, heh... -% -Q: Minnesotans ask, "Why aren't there more pharmacists from Alabama?" -A: Easy. It's because they can't figure out how to get the little - bottles into the typewriter. -% -Q: Somebody just posted that Roman Polanski directed Star Wars. - What should I do? -A: Post the correct answer at once! We can't have people go on - believing that! Very good of you to spot this. You'll probably - be the only one to make the correction, so post as soon as you can. - No time to lose, so certainly don't wait a day, or check to see if - somebody else has made the correction. - - And it's not good enough to send the message by mail. Since you're - the only one who really knows that it was Francis Coppola, you have - to inform the whole net right away! - -- Brad Templeton, "Emily Postnews Answers Your Questions - on Netiquette" -% -Q: What did one regular expression say to the other? -A: .+ -% -Q: What did Tarzan say when he saw the elephants coming over the hill? -A: "The elephants are coming over the hill." - -Q: What did he say when saw them coming over the hill wearing - sunglasses? -A: Nothing, for he didn't recognize them. -% -Q: What did the regular expression match? -A: Identified the patterns "matc" and "match" -% -Q: What do a blonde and your computer have in common? -A: You don't know how much either of them mean to you until - they go down on you. - -Q: What's the advantage to being married to a blonde? -A: You can park in the handicapped zone. - -Q: Why did the blonde get so excited after she finished her jigsaw - puzzle in only 6 months? -A: Because on the box it said "From 2-4 years". -% -Q: What do little WASPs want to be when they grow up? -A: The very best person they can possibly be. -% -Q: What do monsters eat? -A: Things. - -Q: What do monsters drink? -A: Coke. (Because Things go better with Coke.) -% -Q: What do they call the alphabet in Arkansas? -A: The impossible dream. -% -Q: What do WASPs do instead of making love? -A: Rule the country. -% -Q: What do Winnie the Pooh and John the Baptist have in common? -A: The same middle name. -% -Q: What do you call 15 blondes in a circle? -A: A dope ring. - -Q: Why do blondes put their hair in ponytails? -A: To cover up the valve stem. -% -Q: What do you call a blind pre-historic animal? -A: Diyathinkhesaurus. - -Q: What do you call a blind pre-historic animal with a dog? -A: Diyathinkhesaurus Rex. -% -Q: What do you call a boomerang that doesn't come back? -A: A stick. -% -Q: What do you call a brunette between two blondes? -A: An interpreter. - -Q: Why do blondes have square breasts? -A: They forgot to take the tissues out of the box. - -Q: What do you call ten blonds in a row? -A: A wind tunnel. -% -Q: What do you call a dog with no legs? -A: What does it matter? He can't come anyway. - - [I got a dog with no legs -- I call him Cigarette. - Every night, I take him out for a drag. Ed.] -% -Q: What do you call a group of kids with low IQs, drinking diet cola, - eating fruit, and singing? -A: The Moron Tab and Apple Choir. -% -Q: What do you call a half-dozen Indians with Asian flu? -A: Six sick Sikhs (sic). -% -Q: What do you call a million cats at the bottom of Lake Michigan? -A: A good start. -% -Q: What do you call a principal female opera singer whose high C - is lower than those of other principal female opera singers? -A: A deep C diva. -% -Q: What do you call a TV set that fixes itself? -A: A Christian Science Monitor. -% -Q: What do you call a WASP who doesn't work for his father, isn't a - lawyer, and believes in social causes? -A: A failure. -% -Q: What do you call the money you pay to the government when - you ride into the country on the back of an elephant? -A: A howdah duty. -% -Q: What do you call the scratches that you get when a female - sheep bites you? -A: Ewe nicks. -% -Q: What do you get when you cross a mobster with an international - standard? -A: You get someone who makes you an offer that you can't understand! -% -Q: What do you get when you cross the Godfather with an attorney? -A: An offer you can't understand. -% -Q: What do you get when you stuff a flaming stick down a rabbit-hole? -A: Hot cross bunnies! -% -Q: What do you have when you have a lawyer buried up to his neck in sand? -A: Not enough sand. -% -Q: What does a blonde do first thing in the morning? -A: She goes home. - -Q: Why does a blonde have fur on the hem of her dress? -A: To keep her neck warm. - -Q: How do you make a blonde laugh on Monday? -A: Tell her a joke on Friday. -% -Q: What does a WASP Mom make for dinner? -A: A crisp salad, a hearty soup, a lovely entree, followed by - a delicious dessert. -% -Q: What does it say on the bottom of Coke cans in North Dakota? -A: Open other end. -% -Q: What goes: Sis! Boom! Baaaaah! -A: Exploding sheep. -% -Q: What happens when four WASPs find themselves in the same room? -A: A dinner party. -% -Q: What is green and lives in the ocean? -A: Moby Pickle. -% -Q: What is it that a cow has four of and a woman has two of? -A: Feet. -% -Q: What is orange and goes "click, click?" -A: A ball point carrot. -% -Q: What is printed on the bottom of beer bottles in Minnesota? -A: Open other end. -% -Q: What is purple and commutes? -A: A boolean grape. -% -Q: What is purple and commutes? -A: An Abelian grape. -% -Q: What is purple and concord the world? -A: Alexander the Grape. -% -Q: What is the difference between a duck? -A: One leg is both the same. -% -Q: What is the difference between Texas and yogurt? -A: Yogurt has culture. -% -Q: What is the last thing a Kansas stripper takes off? -A: Her bowling shoes. -% -Q: What is the mating call of a blonde? -A: I think I'm drunk. - -Q: What's the call of a disappointed blonde? -A: I *said*, I *think* I'm drunk! - -Q: What is the mating call of the ugly blonde? -A: (Screaming) "I said: I'm drunk!" -% -Q: What is the sound of one cat napping? -A: Mu. -% -Q: What lies on the bottom of the ocean and twitches? -A: A nervous wreck. -% -Q: What looks like a cat, flies like a bat, brays like a donkey, and - plays like a monkey? -A: Nothing. -% -Q: What regular expression do you often see around Christmas? -A: [^L] -% -Q: What's a light-year? -A: One-third less calories than a regular year. -% -Q: What's black and white and red all over? -A: Two nuns in a chainsaw fight. -% -Q: What's bruised, bleeding, and lies in a ditch? -A: Somebody who tells Aggie jokes. -% -Q: What's tan and black and looks great on a lawyer? -A: A Doberman. -% -Q: What's the Blonde's cheer? -A: I'm blonde, I'm blonde, I'm B.L.O.N... ah, oh well.. - I'm blonde, I'm blonde, yea yea yea... - -Q: What do you call it when a blonde dies their hair brunette? -A: Artificial intelligence. - -Q: How do you make a blonde's eyes light up? -A: Shine a flashlight in their ear. -% -Q: What's the capital of Canada? -A: American. -% -Q: What's the difference between a dead dog in the road and a dead - lawyer in the road? -A: There are skid marks in front of the dog. -% -Q: What's the difference between a duck and an elephant? -A: You can't get down off an elephant. -% -Q: What's the difference between a Mac and an Etch-a-Sketch? -A: You don't have to shake the Mac to clear the screen. -% -Q: What's the difference between a RHU cheerleader and a whale? -A: The moustache. -% -Q: What's the difference between an Irish wedding and an Irish wake? -A: One more drunk. -% -Q: What's the difference between Bell Labs and the Boy Scouts of America? -A: The Boy Scouts have adult supervision. -% -Q: What's the difference between Los Angeles and yogurt? -A: Yogurt has a living, active culture. -% -Q: What's the difference between USL and the Graf Zeppelin? -A: The Graf Zeppelin represented cutting edge technology for its time. -% -Q: What's the difference between USL and the Titanic? -A: The Titanic had a band. -% -Q: What's tiny and yellow and very, very, dangerous? -A: A canary with the super-user password. -% -Q: What's yellow, and equivalent to the Axiom of Choice? -A: Zorn's Lemon. -% -Q: Where's the Lone Ranger take his garbage? -A: To the dump, to the dump, to the dump dump dump! - -Q: What's the Pink Panther say when he steps on an ant hill? -A: Dead ant, dead ant, dead ant dead ant dead ant... -% -Q: Who cuts the grass on Walton's Mountain? -A: Lawn Boy. -% -Q: Why are Jewish divorces so expensive? -A: Because they're worth it! -% -Q: Why did the astrophysicist order three hamburgers? -A: Because he was hungry. -% -Q: Why did the blonde climb over the glass wall? -A: To see what was on the other side. - -Q: Why do blondes like tilt steering wheels? -A: More head room. - -Q: How does a blonde turn on the light after having sex? -A: She opens the car door. -% -Q: Why did the chicken cross the road? -A: He was giving it last rites. -% -Q: Why did the chicken cross the road? -A: To see his friend Gregory peck. - -Q: Why did the chicken cross the playground? -A: To get to the other slide. -% -Q: Why did the germ cross the microscope? -A: To get to the other slide. -% -Q: Why did the lone ranger kill Tonto? -A: He found out what "kemosabe" really means. -% -Q: Why did the mathematician name his dog "Cauchy"? -A: Because he left a residue at every pole. -% -Q: Why did the programmer call his mother long distance? -A: Because that was her name. -% -Q: Why did the tachyon cross the road? -A: Because it was on the other side. -% -Q: Why did the WASP cross the road? -A: To get to the middle. -% -Q: Why do firemen wear red suspenders? -A: To conform with departmental regulations concerning uniform dress. -% -Q: Why do mountain climbers rope themselves together? -A: To prevent the sensible ones from going home. -% -Q: Why do people who live near Niagara Falls have flat foreheads? -A: Because every morning they wake up thinking "What *is* that noise? - Oh, right, *of course*! -% -Q: Why do the police always travel in threes? -A: One to do the reading, one to do the writing, and the other keeps - an eye on the two intellectuals. -% -Q: Why does Washington have the most lawyers per capita and - New Jersey the most toxic waste dumps? -A: God gave New Jersey first choice. -% -Q: Why don't blondes eat pickles? -A: Because they get their head stuck in the jars. - -Q: Why do blondes wear underwear? -A: To keep their ankles warm. - -Q: How do you kill a blonde? -A: Put spikes in her shoulder pads. -% -Q: Why don't lawyers go to the beach? -A: The cats keep trying to bury them. -% -Q: Why don't Scotsmen ever have coffee the way they like it? -A: Well, they like it with two lumps of sugar. If they drink - it at home, they only take one, and if they drink it while - visiting, they always take three. -% -Q: Why is Christmas just like a day at the office? -A: You do all of the work and the fat guy in the suit - gets all the credit. -% -Q: Why is it that the more accuracy you demand from an interpolation - function, the more expensive it becomes to compute? -A: That's the Law of Spline Demand. -% -Q: Why should blondes not be given coffee breaks? -A: It takes too long to retrain them. - -Q: What's the mating call of the brunette? -A: All the blondes have gone home! - -Q: How do you tell if a blonde's been using the computer? -A: There's white-out on the screen. -% -Q: Why should you always serve a Southern Carolina football man - soup in a plate? -A: 'Cause if you give him a bowl, he'll throw it away. -% -Q: Why was Stonehenge abandoned? -A: It wasn't IBM compatible. -% -QED. -% -QOTD: - "A child of 5 could understand this! Fetch me a child of 5." -% -QOTD: - "A lack of advanced planning on your part does not constitute - an emergency on my part." -% -QOTD: - "A university faculty is 500 egotists with a common parking problem." -% -QOTD: - "All I want is a little more than I'll ever get." -% -QOTD: - "All I want is more than my fair share." -% -QOTD: - "Dead people are good at running because they don't - have to stop and breathe." - -- Hokey, watching "Night of the Living Dead" -% -QOTD: - "Don't let your mind wander -- it's too little to be let out alone." -% -QOTD: - "East is east... and let's keep it that way." -% -QOTD: - "Every morning I read the obituaries; if my name's not there, - I go to work." -% -QOTD: - "Everything I am today I owe to people, whom it is now - too late to punish." -% -QOTD: - "Flash! Flash! I love you! ...but we only have fourteen hours to - save the earth!" -% -QOTD: - "He eats like a bird... five times his own weight each day." -% -QOTD: - "Her other car is a broom." -% -QOTD: - "He's a perfectionist. If he married Raquel Welch, he'd expect - her to cook." -% -QOTD: - "He's such a hick he doesn't even have a trapeze in his bedroom." -% -QOTD: - "How can I miss you if you won't go away?" -% -QOTD: - "I ain't broke, but I'm badly bent." -% -QOTD: - "I am not sure what this is, but an `F' would only dignify it." -% -QOTD: - "I don't think they could put him in a mental hospital. On the -other hand, if he were already in, I don't think they'd let him out." -% -QOTD: - "I drive my car quietly, for it goes without saying." -% -QOTD: - "I haven't come far enough, and don't call me baby." -% -QOTD: - "I looked out my window, and saw Kyle Pettys' car upside down, - then I thought `One of us is in real trouble.'" - -- Davey Allison, on a 150 m.p.h. crash -% -QOTD: - "I love your outfit, does it come in your size?" -% -QOTD: - "I may not be able to walk, but I drive from the sitting position." -% -QOTD: - "I only touch base with reality on an as-needed basis!" -% -QOTD: - "I opened Pandora's box, let the cat out of the bag and put the - ball in their court." - -- Hon. J. Hacker (The Ministry of Administrative Affairs) -% -QOTD: - "I sprinkled some baking powder over a couple of potatoes, but it - didn't work." -% -QOTD: - "I thought I saw a unicorn on the way over, but it was just a - horse with one of the horns broken off." -% -QOTD: - "I treat her like a thoroughbred, and she's STILL a nag!" -% -QOTD: - "I tried buying a goat instead of a lawn tractor; had to return - it though. Couldn't figure out a way to connect the snow blower." -% -QOTD: - "I used to be an idealist, but I got mugged by reality." -% -QOTD: - "I used to be lost in the shuffle, now I just shuffle along with - the lost." -% -QOTD: - "I used to get high on life but lately I've built up a resistance." -% -QOTD: - "I used to go to UCLA, but then my Dad got a job." -% -QOTD: - "I used to jog, but the ice kept bouncing out of my glass." -% -QOTD: - "I want a home, a family, an occasional spanking ..." - -- Kathy Ireland -% -QOTD: - "I won't say he's untruthful, but his wife has to call the - dog for dinner." -% -QOTD: - "I'd never marry a woman who didn't like pizza. I might play - golf with her, but I wouldn't marry her." -% -QOTD: - "If he learns from his mistakes, pretty soon he'll know everything." -% -QOTD: - "If I could walk that way, I wouldn't need the aftershave." -% -QOTD: - "If I'm what I eat, I'm a chocolate chip cookie." -% -QOTD: - "If it's too loud, you're too old." -% -QOTD: - "If you keep an open mind people will throw a lot of garbage in it." -% -QOTD: - "If you're looking for trouble, I can offer you a wide selection." -% -QOTD: - "I'll listen to reason when it comes out on CD." -% -QOTD: - "I'm just a boy named 'su'..." -% -QOTD: - "I'm not a nerd -- I'm 'socially challenged.'" -% -QOTD: - I'm not bald -- I'm "hair challenged". - - [I thought that was "differently haired". Ed.] -% -QOTD: - "I'm not really for apathy, but I'm not against it either..." -% -QOTD: - "I'm on a seafood diet -- I see food and I eat it." -% -QOTD: - "In the shopping mall of the mind, he's in the toy department." -% -QOTD: - "It seems to me that your antenna doesn't bring in too many - stations anymore." -% -QOTD: - "It was so cold last winter that I saw a lawyer with his - hands in his own pockets." -% -QOTD: - "It wouldn't have been anything, even if it were gonna be a thing." -% -QOTD: - "It's a cold bowl of chili, when love don't work out." -% -QOTD: - "It's a dog-eat-dog world, and I'm wearing Milk Bone underwear." -% -QOTD: - "It's been Monday all week today." -% -QOTD: - "It's been real and it's been fun, but it hasn't been real fun." -% -QOTD: - "It's hard to tell whether he has an ace up his sleeve or if - the ace is missing from his deck altogether." -% -QOTD: - "It's men like him that give the Y chromosome a bad name." -% -QOTD: - "It's not the despair... I can stand the despair. It's the hope." -% -QOTD: - "It's sort of a threat, you see. I've never been very good at - them myself, but I'm told they can be very effective." -% -QOTD: - "I've always wanted to work in the Federal Mint. And then go on - strike. To make less money." -% -QOTD: - "I've got one last thing to say before I go; give me back - all of my stuff." -% -QOTD: - "I've heard about civil Engineers, but I've never met one." -% -QOTD: - "I've just learned about his illness. Let's hope it's nothing - trivial." -% -QOTD: - "Just how much can I get away with and still go to heaven?" -% -QOTD: - "Let's do it." - -- Gary Gilmore, to his firing squad -% -QOTD: - "Like this rose, our love will wilt and die." -% -QOTD: - "Ludwig Boltzmann, who spend much of his life studying statistical - mechanics died in 1906 by his own hand. Paul Ehrenfest, carrying - on the work, died similarly in 1933. Now it is our turn." - -- Goodstein, States of Matter -% -QOTD: - "Money isn't everything, but at least it keeps the kids in touch." -% -QOTD: - "My ambition is to marry a rich woman who's too proud to let - her husband work." -% -QOTD: - "My life is a soap opera, but who gets the movie rights?" -% -QOTD: - "My mother was the travel agent for guilt trips." -% -QOTD: - "My shampoo lasts longer than my relationships." -% -QOTD: - "Of course it's the murder weapon. Who would frame someone with - a fake?" -% -QOTD: - "Of course there's no reason for it, it's just our policy." -% -QOTD: - "Oh, no, no... I'm not beautiful. Just very, very pretty." -% -QOTD: - "On a scale of 1 to 10 I'd say... oh, somewhere in there." -% -QOTD: - "Our parents were never our age." -% -QOTD: - "Overweight is when you step on your dog's tail and it dies." -% -QOTD: - "Sacred cows make great hamburgers." -% -QOTD: - "Say, you look pretty athletic. What say we put a pair of tennis - shoes on you and run you into the wall?" -% -QOTD: - "Sex is the most fun you can have without laughing." -% -QOTD: - "She's about as smart as bait." -% -QOTD: - "Silence is the only virtue he has left." -% -QOTD: - "Some people have one of those days. I've had one of those lives." -% -QOTD: - "Sure, I turned down a drink once. Didn't understand the question." -% -QOTD: - "Talent does what it can, genius what it must. - I do what I get paid to do." -% -QOTD: - "The baby was so ugly they had to hang a pork chop around its - neck to get the dog to play with it." -% -QOTD: - "The elder gods went to Suggoth and all I got was this lousy T-shirt." -% -QOTD: - "The forest may be quiet, but that doesn't mean - the snakes have gone away." -% -QOTD: - "The only easy way to tell a hamster from a gerbil is that the - gerbil has more dark meat." -% -QOTD: - "There may be no excuse for laziness, but I'm sure looking." -% -QOTD: - "This is a one line proof... if we start sufficiently far to the - left." -% -QOTD: - "To hell with patience, I'm gonna kill me something!" -% -QOTD: - "Unlucky? If I bought a pumpkin farm, they'd cancel Halloween." -% -QOTD: - "What do you mean, you had the dog fixed? Just what made you - think he was broken!" -% -QOTD: - "What I like most about myself is that I'm so understanding - when I mess things up." -% -QOTD: - "What women and psychologists call `dropping your armor', we call - "baring your neck." -% -QOTD: - "Who? Me? No, no, NO!! But I do sell rugs." -% -QOTD: - "Wouldn't it be wonderful if real life supported control-Z?" -% -QOTD: - "Y'know how s'm people treat th'r body like a TEMPLE? - Well, I treat mine like 'n AMUSEMENT PARK... S'great..." -% -QOTD: - "You want me to put *holes* in my ears and hang things from them? - How... tribal." -% -QOTD: - "You're so dumb you don't even have wisdom teeth." -% -Quack! - Quack!! Quack!! -% -Quality control: - Assuring that the quality of a product does not get out of hand - and add to the cost of its manufacture or design. -% -Quality Control, n.: - The process of testing one out of every 1,000 units coming off -a production line to make sure that at least one out of 100 works. -% -Quantity is no substitute for quality, -but its the only one we've got. -% -Quantum Mechanics is a lovely introduction to Hilbert Spaces! - -- Overheard at last year's Archimedeans' Garden Party -% -Quantum Mechanics is God's version of "Trust me." -% -QUARK: - The sound made by a well bred duck. -% -Quark! Quark! Beware the quantum duck! -% -question = ( to ) ? be : ! be; - -- William Shakespeare -% -QUESTION AUTHORITY. - -(Sez who?) -% -Question: Is it better to abide by the rules until -they're changed or help speed the change by breaking them? -% -Questionable day. -Ask somebody something. -% -Question: -Man Invented Alcohol, -God Invented Grass. -Who do you trust? -% -Questions are never indiscreet, answers sometimes are. - -- Oscar Wilde -% -Quick!! Act as if nothing has happened! -% -Quick, sing me the BUDAPEST NATIONAL ANTHEM!! -% -Quidquid latine dictum sit, altum viditur. - -(Whatever is said in Latin sounds profound.) -% -Quigley's Law: - Whoever has any authority over you, - no matter how small, will attempt to use it. -% -Quit worrying about your health. It'll go away. - -- Robert Orben -% -Quite frankly, I don't like you humans. -After what you all have done, I find being "inhuman" a compliment. -% -QUOTE OF THE DAY: - - ` - -% -Qvid me anxivs svm? -% -Radicalism: - The conservatism of tomorrow injected into the affairs of today. - -- Ambrose Bierce -% -RADIO SHACK LEVEL II BASIC -READY ->_ -% -Radioactive cats have 18 half-lives. -% -Raffiniert ist der Herrgott aber boshaft ist er nicht. - -- Albert Einstein -% -rain falls where clouds come -sun shines where clouds go -clouds just come and go - -- Florian Gutzwiller -% -Rainy days and automatic weapons always get me down. -% -Rainy days and Mondays always get me down. -% -Raising pet electric eels is gaining a lot of current popularity. -% -Ralph's Observation: -It is a mistake to let any mechanical object -realise that you are in a hurry. -% -RAM wasn't built in a day. -% -Random, n.: - as in number, predictable. - as in memory access, unpredictable. -% -Rarely do people communicate; they just take turns talking. -% -Rascal, am I? Take THAT! - -- Errol Flynn -% -Rate yourself on the nerd-o-matic scale. (1 point for each YES answer) - -Are your glasses mended with a strip of masking tape right over your nose? -Do you put pennies in the slots in your penny loafers? -Does your bow-tie flash "hey you kid" in red neon at parties? -Do you think pizza before noon is unhealthy? -Do you use the "greasy kid's stuff" to stick down your cowlick? -Do you wear a "nerd-pack" in your shirt pocket to keep the dozen - or so pencils from marking the cloth? -Do you think Mary Jane is somebody's name? -Is illegal fishing something only a daring criminal would do? -Is Batman your hero? Superman? Green Lantern? The Shadow? -Do you think girls who kiss on the first date are loose? - -0-2 -- You are really hip, a real cool cat, a hoopy frood. -3-5 -- There is hope for you yet. -6-7 -- Uh-oh, trouble in River City. -8-10 -- Your immortal soul is in peril. -11+ -- Does suicide seem attractive? -% -Rattling around the back of my head is a disturbing image of something I -saw at the airport... Now I'm remembering, those giant piles of computer -magazines right next to "People" and "Time" in the airport store. Does it -bother anyone else that half the world is being told all of our hard-won -secrets of computer technology? Remember how all the lawyers cried foul -when "How to Avoid Probate" was published? Are they taking no-fault -insurance lying down? No way! But at the current rate it won't be long -before there are stacks of the "Transactions on Information Theory" at the -A&P checkout counters. Who's going to be impressed with us electrical -engineers then? Are we, as the saying goes, giving away the store? - -- Robert W. Lucky, IEEE president -% -Ray's Rule of Precision: - Measure with a micrometer. Mark with chalk. Cut with an axe. -% -Razors pain you; -Rivers are damp; -Acids stain you; -And drugs cause cramp. -Guns aren't lawful; -Nooses give; -Gas smells awful; -You might as well live. - -- Dorothy Parker, "Resume", 1926 -% -Re: Graphics: - A picture is worth 10K words -- but only those to describe - the picture. Hardly any sets of 10K words can be adequately - described with pictures. -% -Reach into the thoughts of friends, -And find they do not know your name. -Squeeze the teddy bear too tight, -And watch the feathers burst the seams. -Touch the stained glass with your cheek, -And feel its chill upon your blood. -Hold a candle to the night, -And see the darkness bend the flame. -Tear the mask of peace from God, -And hear the roar of souls in hell. -Pluck a rose in name of love, -And watch the petals curl and wilt. -Lean upon the western wind, -And know you are alone. - -- Dru Mims -% -Reactor error - core dumped! -% -Reader, suppose you were an idiot. And suppose you were a member of -Congress. But I repeat myself. - -- Mark Twain -% -Reading is thinking with someone else's head instead of one's own. -% -Reading is to the mind what exercise is to the body. -% -Real computer scientists admire ADA for its overwhelming aesthetic -value but they find it difficult to actually program in it, as it is -much too large to implement. Most computer scientists don't notice -this because they are still arguing over what else to add to ADA. -% -Real computer scientists despise the idea of actual hardware. Hardware has -limitations, software doesn't. It's a real shame that Turing machines are -so poor at I/O. -% -Real computer scientists don't comment their code. The identifiers are -so long they can't afford the disk space. -% -Real computer scientists don't program in assembler. They don't write -in anything less portable than a number two pencil. -% -Real computer scientists don't write code. They occasionally tinker with -`programming systems', but those are so high level that they hardly count -(and rarely count accurately; precision is for applications). -% -Real computer scientists like having a computer on their desk, else how -could they read their mail? -% -Real computer scientists only write specs for languages that might run on -future hardware. Nobody trusts them to write specs for anything homo sapiens -will ever be able to fit on a single planet. -% -Real programmers disdain structured programming. Structured -programming is for compulsive neurotics who were prematurely toilet- -trained. They wear neckties and carefully line up pencils on otherwise -clear desks. -% -Real programmers don't bring brown-bag lunches. If the vending machine -doesn't sell it, they don't eat it. Vending machines don't sell -quiche. -% -Real programmers don't document; if it was -hard to write, it should be hard to understand. -% -Real programmers don't draw flowcharts. Flowcharts are, after all, the -illiterate's form of documentation. Cavemen drew flowcharts; look how much -good it did them. -% -Real Programmers don't play tennis, or any other sport that requires -you to change clothes. Mountain climbing is OK, and real programmers -wear their climbing boots to work in case a mountain should suddenly -spring up in the middle of the machine room. -% -Real programmers don't write in BASIC. Actually, no programmers write -in BASIC after reaching puberty. -% -Real programmers don't write in FORTRAN. FORTRAN is for pipe stress -freaks and crystallography weenies. FORTRAN is for wimp engineers who -wear white socks. -% -Real Programmers don't write in PL/I. PL/I is for -programmers who can't decide whether to write in COBOL or FORTRAN. -% -Real Programmers think better when playing Adventure or Rogue. -% -Real programs don't eat cache. -% -Real Programs don't use shared text. Otherwise, how can they -use functions for scratch space after they are finished calling them? -% -Real software engineers don't debug programs, they verify correctness. -This process doesn't necessarily involve execution of anything on a -computer, except perhaps a Correctness Verification Aid package. -% -Real software engineers don't like the idea of some inexplicable and -greasy hardware several aisles away that may stop working at any -moment. They have a great distrust of hardware people, and wish that -systems could be virtual at *_a_l_l* levels. They would like personal -computers (you know no one's going to trip over something and kill your -DFA in mid-transit), except that they need 8 megabytes to run their -Correctness Verification Aid packages. -% -Real software engineers work from 9 to 5, because that is the way the -job is described in the formal spec. Working late would feel like -using an undocumented external procedure. -% -Real Time, adj.: - Here and now, as opposed to fake time, which only occurs there - and then. -% -Real Users are afraid they'll break the machine -- but they're never -afraid to break your face. -% -Real Users find the one combination of bizarre input values that shuts -down the system for days. -% -Real Users hate Real Programmers. -% -Real Users know your home telephone number. -% -Real Users never know what they want, but they always know when your -program doesn't deliver it. -% -Real Users never use the Help key. -% -Real wealth can only increase. - -- R. Buckminster Fuller -% -Real World, The n.: - 1. In programming, those institutions at which programming may -be used in the same sentence as FORTRAN, COBOL, RPG, IBM, etc. 2. To -programmers, the location of non-programmers and activities not related -to programming. 3. A universe in which the standard dress is shirt and -tie and in which a person's working hours are defined as 9 to 5. -4. The location of the status quo. 5. Anywhere outside a university. -"Poor fellow, he's left MIT and gone into the real world." Used -pejoratively by those not in residence there. In conversation, talking -of someone who has entered the real world is not unlike talking about a -deceased person. -% -Reality -- what a concept! - -- Robin Williams -% -Reality always seems harsher in the early morning. -% -Reality does not exist - yet. -% -Reality is an obstacle to hallucination. -% -Reality is bad enough, why should I tell the truth? - -- Patrick Sky -% -Reality is for people who can't deal with drugs. - -- Lily Tomlin -% -Reality is for people who lack imagination. -% -Reality is just a convenient measure of complexity. - -- Alvy Ray Smith -% -Reality is just a crutch for people who can't handle science fiction. -% -Reality is nothing but a collective hunch. - -- Lily Tomlin -% -Reality is that which, when you stop believing in it, doesn't go -away. - -- Philip K. Dick -% -Reality must take precedence over public relations, for Mother Nature -cannot be fooled. - -- R. P. Feynman -% -Really?? What a coincidence, I'm shallow too!! -% -Reappraisal, n.: - An abrupt change of mind after being found out. -% -Rebellion lay in his way, and he found it. - -- William Shakespeare, "Henry IV" -% -Receiving a million dollars tax free will make you feel better than -being flat broke and having a stomach ache. - -- Dolph Sharp, "I'm O.K., You're Not So Hot" -% -Recent investments will yield a slight profit. -% -Recent research has tended to show that the Abominable No-Man -is being replaced by the Prohibitive Procrastinator. - -- C. N. Parkinson -% -Recently deceased blues guitarist Stevie Ray Vaughan "comes to" after -his death. He sees Jimi Hendrix sitting next to him, tuning his guitar. -"Holy cow," he thinks to himself, "this guy is my idol." Over at the -microphone, about to sing, are Jim Morrison and Janis Joplin, and the -bassist is the late Barry Oakley of the Allman Brothers. So Stevie -Ray's thinking, "Oh, wow! I've died and gone to rock and roll heaven." -Just then, Karen Carpenter walks in, sits down at the drums, and says: -"'Close to You'. Hit it, boys!" - -- Told by Penn Jillette, of magic/comedy duo Penn and Teller -% -Reception area, n.: - The purgatory where office visitors are condemned to spend - innumerable hours reading dog-eared back issues of trade - magazines like Modern Plastics, Chain Saw Age, and Chicken World, - while the receptionist blithely reads her own trade magazine -- - Cosmopolitan. -% -Recession is when your neighbor loses his job. Depression is when you -lose your job. These economic downturns are very difficult to predict, -but sophisticated econometric modeling houses like Data Resources and -Chase Econometrics have successfully predicted 14 of the last 3 recessions. -% -Recipe for a Pan Galactic Gargle Blaster: - (1) Take the juice from one bottle of Ol' Janx Spirit - (2) Pour into it one measure of water from the seas of - Santraginus V (Oh, those Santraginean fish!) - (3) Allow 3 cubes of Arcturan Mega-gin to melt into the - mixture (properly iced or the benzine is lost.) - (4) Allow four liters of Fallian marsh gas to bubble through it. - (5) Over the back of a silver spoon, float a measure of - Qualactin Hypermint extract. - (6) Drop in the tooth of an Algolian Suntiger. Watch it dissolve. - (7) Sprinkle Zamphuor. - (8) Add an olive. - (9) Drink... but... very carefully... - -- Douglas Adams -% -Reclaimer, spare that tree! -Take not a single bit! -It used to point to me, -Now I'm protecting it. -It was the reader's CONS -That made it, paired by dot; -Now, GC, for the nonce, -Thou shalt reclaim it not. -% -Recursion is the root of computation -since it trades description for time. -% -Recursion: n. See Recursion. - -- Random Shack Data Processing Dictionary -% -Regardless of whether a mission expands or contracts, -administrative overhead continues to grow at a steady rate. -% -Regnant populi. -% -Regression analysis: - Mathematical techniques for trying to understand why things are - getting worse. -% -Reichel's Law: - A body on vacation tends to remain on vacation unless acted upon by - an outside force. -% -Reinhart was never his mother's favorite -- and he was an only child. - -- Thomas Berger -% -Reisner's Rule of Conceptual Inertia: - If you think big enough, you'll never have to do it. -% -Relations are simply a tedious pack of people, who haven't the remotest -knowledge of how to live, nor the smallest instinct about when to die. - -- Oscar Wilde, "The Importance of Being Earnest" -% -...relaxed in the manner of a man who -has no need to put up a front of any kind. - -- John Ball, "Mark One: the Dummy" -% -Reliable source, n.: - The guy you just met. -% -Religion has done love a great service by making it a sin. - -- Anatole France -% -Religion is a crutch, but that's okay... humanity is a cripple. -% -Religion is what keeps the poor from murdering the rich. - -- Napoleon -% -Religions revolve madly around sexual questions. -% -Rembrandt is not to be compared in the painting of character with our -extraordinarily gifted English artist, Mr. Rippingille. - -- John Hunt, British editor, scholar and art critic - Cerf/Navasky, "The Experts Speak" -% -Rembrandt's first name was Beauregard, which is why he never used -it. - -- Dave Barry -% -Remember -- only 10% of anything can be in the top 10%. -% -Remember Darwin; building a better -mousetrap merely results in smarter mice. -% -Remember, DESSERT is spelled with two `s's while DESERT is spelled -with one, because EVERYONE wants two desserts, but NO ONE wants two -deserts. - -- Miss Oglethorp, Gr. 5, PS. 59 -% -Remember, drive defensively! And of course, the best defense is a good -offense! -% -Remember, even if you win the rat race -- you're still a rat. -% -Remember folks. Street lights timed for 35 MPH are also timed for 70 MPH. - -- Jim Samuels -% -Remember, God could only create the world in 6 days because he didn't -have an established user base. -% -Remember, Grasshopper, falling down 1000 stairs begins by tripping over -the first one. - -- Confusion -% -Remember, if it's being done correctly, here or abroad, it's -*not* the U.S. Army doing it! - -- "Good Morning, Vietnam" -% -Remember kids, if there's a loaded gun in the room, be sure -that you're the one holding it. - -- Mr. Greenfatigues -% -Remember, no matter where you go, there you are. - -- Buckaroo Banzai (Peter Weller) - "The Adventures of Buckaroo Banzai - Across The Eighth Dimension" -% -Remember: Silly is a state of Mind, Stupid is a way of Life. - -- Dave Butler -% -Remember that as a teenager you are in the last stage of your life when -you will be happy to hear that the phone is for you. - -- Fran Lebowitz, "Social Studies" -% -Remember that there is an outside world to see and enjoy. - -- Hans Liepmann -% -Remember that whatever misfortune may be your lot, it could only be -worse in Cleveland. - -- National Lampoon, "Deteriorata" -% -Remember the good old days, when CPU was singular? -% -Remember the... the... uhh..... -% -Remember thee -Ay, thou poor ghost while memory holds a seat -In this distracted globe. Remember thee! -Yea, from the table of my memory -I'll wipe away all trivial fond records, -All saws of books, all forms, all pressures past, -That youth and observation copied there. - -- William Shakespeare, "Hamlet" -% -Remember to say hello to your bank teller. -% -Remember, UNIX spelled backwards is XINU. - -- Mt. -% -Remember: use logout to logout. -% -Remembering is for those who have forgotten. - -- Chinese proverb -% -Remove me from this land of slaves, -Where all are fools, and all are knaves, -Where every knave and fool is bought, -Yet kindly sells himself for nought; - -- Jonathan Swift -% -Removing the straw that broke the camel's back -does not necessarily allow the camel to walk again. -% -Renning's Maxim: - Man is the highest animal. Man does the classifying. -% -Repartee is something we think of twenty-four hours too late. - -- Mark Twain -% -Repel them. Repel them. Induce them to relinquish the spheroid. - -- Indiana University football cheer -% -Reply hazy, ask again later. -% -Reporter: "How did you like school when you were growing up, Yogi?" -Yogi Berra: "Closed." -% -Reporter: "What would you do if you found a million dollars?" -Yogi Berra: "If the guy was poor, I would give it back." -% -Reporter, n.: - A writer who guesses his way to the truth and dispels it with a - tempest of words. - -- Ambrose Bierce, "The Devil's Dictionary" -% -REPORTER: Senator, are you for or against the MX missile system? - -SENATOR: Bob, the MX missile system reminds me of an old saying that -the country folk in my state like to say. It goes like this: "You can -carry a pig for six miles, but if you set it down it might run away." -I have no idea why the country folk say this. Maybe there's some kind -of chemical pollutant in their drinking water. That is why I pledge to -do all that I can to protect the environment of this great nation of -ours, and put prayer back in the schools, where it belongs. What we -need is jobs, not empty promises. I realize I'm risking my political -career by being so outspoken on a sensitive issue such as the MX, but -that's just the kind of straight-talking honest person I am, and I -can't help it. - -- Dave Barry, "On Presidential Politics" -% -Reporter (to Mahatma Gandhi): - Mr. Gandhi, what do you think of Western Civilization? -Gandhi: I think it would be a good idea. -% -Reputation, adj.: - What others are not thinking about you. -% -Research is the best place to be: you work your buns off, and if it works -you're a hero; if it doesn't, well -- nobody else has done it yet either, -so you're still a valiant nerd. -% -Research is to see what everybody else has seen, -and think what nobody else has thought. -% -Research is what I'm doing when I don't know what I'm doing. - -- Wernher von Braun -% -Research, n.: - Consider Columbus: - He didn't know where he was going. - When he got there he didn't know where he was. - When he got back he didn't know where he had been. - And he did it all on someone else's money. -% -Resisting temptation is easier when you -think you'll probably get another chance later on. -% -Responsibility: - Everyone says that having power is a great responsibility. This is -a lot of bunk. Responsibility is when someone can blame you if something -goes wrong. When you have power you are surrounded by people whose job it -is to take the blame for your mistakes. If they're smart, that is. - -- Cerebus, "On Governing" -% -Retirement means that when someone says "Have a nice day", you -actually have a shot at it. -% -Reunite Gondwanaland! -% -Rev. Jim: What does an amber light mean? -Bobby: Slow down. -Rev. Jim: What... does... an... amber... light... mean? -Bobby: Slow down. -Rev. Jim: What.... does.... an.... amber.... light.... -% -Revenge is a form of nostalgia. -% -Revenge is a meal best served cold. -% -Review Questions - -1: If Nerd on the planet Nutley starts out in his spaceship at 20 KPH, - and his speed doubles every 3.2 seconds, how long will it be before - he exceeds the speed of light? How long will it be before the - Galactic Patrol picks up the pieces of his spaceship? - -2: If Roger Rowdy wrecks his car every week, and each week he breaks - twice as many bones as before, how long will it be before he breaks - every bone in his body? How long will it be before they cut off - his insurance? Where does he get a new car every week? - -3: If Johnson drinks one beer the first hour (slow start), four beers - the next hour, nine beers the next, etc., and stacks the cans in - a pyramid, how soon will Johnson's pyramid be larger than King - Tut's? When will it fall on him? Will he notice? -% -Revolution, n.: - A form of government abroad. -% -Revolution, n.: - In politics, an abrupt change in the form of misgovernment. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Revolutionary, adj.: - Repackaged. -% -Rhode's Law: - When any principle, law, tenet, probability, happening, circumstance, - or result can in no way be directly, indirectly, empirically, or - circuitously proven, derived, implied, inferred, induced, deducted, - estimated, or scientifically guessed, it will always for the purpose - of convenience, expediency, political advantage, material gain, or - personal comfort, or any combination of the above, or none of the - above, be unilaterally and unequivocally assumed, proclaimed, and - adhered to as absolute truth to be undeniably, universally, immutably, - and infinitely so, until such time as it becomes advantageous to - assume otherwise, maybe. -% -Rich bachelors should be heavily taxed. It is not fair that some men -should be happier than others. - -- Oscar Wilde -% -Richard Nixon was the most dishonest individual I have ever met in my life. -He lied to his wife, his family, his friends, his colleagues in the Congress, -lifetime members of his own political party, the American people, and the -world. - -- Barry Goldwater -% -Riches cover a multitude of woes. - -- Menander -% -Rick: "How can you close me up? On what grounds?" -Renault: "I'm shocked! Shocked! To find that gambling is - going on here." -Croupier (handing money to Renault): - "Your winnings, sir." -Renault: "Oh. Thank you very much." - -- "Casablanca" (1942) -% -Riffle West Virginia is so small that the -Boy Scout had to double as the town drunk. -% -Right now I'm having amnesia and deja vu at the same time. - -- Steven Wright -% -"Rights" is a fictional abstraction. No one has "Rights", neither -machines nor flesh-and-blood. Persons... have opportunities, not -rights, which they use or do not use. - -- Lazarus Long -% -Ring around the collar. -% -Ritchie's Rule: - (1) Everything has some value -- if you use the right currency. - (2) Paint splashes last longer than the paint job. - (3) Search and ye shall find -- but make sure it was lost. -% -Robot, n.: - Someone who's been made by a scientist. -% -Robot, n.: - University administrator. -% -Robustness, adj.: - Never having to say you're sorry. -% -Rocky's Lemma of Innovation Prevention - Unless the results are known in advance, - funding agencies will reject the proposal. -% -Romance, like alcohol, should be enjoyed, but should not be allowed to -become necessary. - -- Edgar Friedenberg -% -Rome was not built in one day. - -- John Heywood -% -Rome wasn't burnt in a day. -% -ROMEO: Courage, man; the hurt cannot be much. -MERCUTIO: No, 'tis not so deep as a well, nor so wide as a church- - door; but 'tis enough, 'twill serve. -% -Romeo was restless, he was ready to kill, -He jumped out the window 'cause he couldn't sit still, -Juliet was waiting with a safety net, -Said "don't bury me 'cause I ain't dead yet". - -- Elvis Costello -% -Romeo wasn't bilked in a day. - -- Walt Kelly, "Ten Ever-Lovin' Blue-Eyed Years With - Pogo" -% -Roses are red; - Violets are blue. -I'm schizophrenic, - And so am I. -% -Rotten wood cannot be carved. - -- Confucius, "Analects", Book 5, Ch. 9 -% -Round Numbers are always false. - -- Samuel Johnson -% -Row, row, row your bits, gently down the stream... -% -Rubber bands have snappy endings! -% -Rube Walker: "Hey, Yogi, what time is it?" -Yogi Berra: "You mean now?" -% -Rudd's Discovery: - You know that any senator or congressman could go home and make - $300,000 to $400,000, but they don't. Why? Because they can - stay in Washington and make it there. -% -Rudeness is a weak man's imitation of strength. -% -Rudin's Law: - If there is a wrong way to do something, most people will - do it every time. - -Rudin's Second Law: - In a crisis that forces a choice to be made among alternative - courses of action, people tend to choose the worst possible - course. -% -Rugby, n.: - Elegant violence. - - (Rugby players eat their dead.) - (Blood makes the grass grow!) - (Support your local hooker! Play rugby!) - - [A "hooker" is part of the scrum. Thought you'd want to know. Ed.] -% -RUGGED: - Too heavy to lift. -% -Rule #1: - The Boss is always right. - -Rule #2: - If the Boss is wrong, see Rule #1. -% -Rule 46, Oxford Union Society, London: - Any member introducing a dog into the Society's premises shall -be liable to a fine of one pound. Any animal leading a blind person -shall be deemed to be a cat. -% -Rule #7: Silence is not acquiescence. - Contrary to what you may have heard, silence of those present is -not necessarily consent, even the reluctant variety. They simply may -sit in stunned silence and figure ways of sabotaging the plan after they -regain their composure. -% -Rule of Creative Research: - 1) Never draw what you can copy. - 2) Never copy what you can trace. - 3) Never trace what you can cut out and paste down. -% -Rule of Defactualization: - Information deteriorates upward through bureaucracies. -% -Rule of Feline Frustration: - When your cat has fallen asleep on your lap and looks utterly - content and adorable, you will suddenly have to go to the - bathroom. -% -Rule of Life #1 -- Never get separated from your luggage. -% -Rule of the Great: - When people you greatly admire appear to be thinking deep - thoughts, they probably are thinking about lunch. -% -Rule the Empire through force. - -- Shogun Tokugawa -% -Rules: - (1) The boss is always right. - (2) When the boss is wrong, refer to rule 1. -% -Rules for Academic Deans: - (1) HIDE!!!! - (2) If they find you, LIE!!!! - -- Father Damian C. Fandal -% -Rules for driving in New York: - 1) Anything done while honking your horn is legal. - 2) You may park anywhere if you turn your four-way flashers on. - 3) A red light means the next six cars may go through the - intersection. -% -Rules for Good Grammar #4. - 1: Don't use no double negatives. - 2: Make each pronoun agree with their antecedents. - 3: Join clauses good, like a conjunction should. - 4: About them sentence fragments. - 5: When dangling, watch your participles. - 6: Verbs has got to agree with their subjects. - 7: Just between you and i, case is important. - 8: Don't write run-on sentences when they are hard to read. - 9: Don't use commas, which aren't necessary. -10: Try to not ever split infinitives. -11: It is important to use your apostrophe's correctly. -12: Proofread your writing to see if you any words out. -13: Correct speling is essential. -14: A preposition is something you never end a sentence with. -15: While a transcendent vocabulary is laudable, one must be eternally - careful so that the calculated objective of communication does not - become ensconced in obscurity. In other words, eschew obfuscation. -% -Rules for Writers: - Avoid run-on sentences they are hard to read. Don't use no double -negatives. Use the semicolon properly, always use it where it is appropriate; -and never where it isn't. Reserve the apostrophe for it's proper use and -omit it when its not needed. No sentence fragments. Avoid commas, that are -unnecessary. Eschew dialect, irregardless. And don't start a sentence with -a conjunction. Hyphenate between sy-llables and avoid un-necessary hyphens. -Write all adverbial forms correct. Don't use contractions in formal writing. -Writing carefully, dangling participles must be avoided. It is incumbent on -us to avoid archaisms. Steer clear of incorrect forms of verbs that have -snuck in the language. Never, ever use repetitive redundancies. If I've -told you once, I've told you a thousand times, resist hyperbole. Also, -avoid awkward or affected alliteration. Don't string too many prepositional -phrases together unless you are walking through the valley of the shadow of -death. "Avoid overuse of 'quotation "marks."'" -% -RULES OF EATING -- THE BRONX DIETER'S CREED - (1) Never eat on an empty stomach. - (2) Never leave the table hungry. - (3) When traveling, never leave a country hungry. - (4) Enjoy your food. - (5) Enjoy your companion's food. - (6) Really taste your food. It may take several portions to - accomplish this, especially if subtly seasoned. - (7) Really feel your food. Texture is important. Compare, - for example, the texture of a turnip to that of a - brownie. Which feels better against your cheeks? - (8) Never eat between snacks, unless it's a meal. - (9) Don't feel you must finish everything on your plate. You - can always eat it later. - (10) Avoid any wine with a childproof cap. - (11) Avoid blue food. - -- Richard Smith, "The Bronx Diet" -% -Ruling a big country is like cooking a small fish. - -- Lao Tsu -% -Rune's Rule: - If you don't care where you are, you ain't lost. -% -Russia has abolished God, but so far God has been more tolerant. - -- John Cameron Swayze -% -Ruth made a great mistake when he gave up pitching. Working once a week, -he might have lasted a long time and become a great star. - -- Tris Speaker, commenting on Babe Ruth's plan to change - from being a pitcher to an outfielder. - Cerf/Navasky, "The Experts Speak" -% -Ryan's Law: - Make three correct guesses consecutively - and you will establish yourself as an expert. -% -RYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRY -RY RY -RY WELCOME TO THE BABBAGE ANALYTICAL TIMESHARING SERVICE RY -RY * * * * * * * * * * * * * * * * * * * * * * * * * * * RY -RY RY -RY PLEASE NOTE THAT THE INTEGRATOR IS CURRENTLY UNAVAILABLE RY -RY DUE TO THE WEEKLY GREASING SCHEDULE. WOULD ALL USERS KINDLY RY -RY RETURN ANY UNUSED PLUGBOARDS, AS THE PROGRAMMING TEAM ARE RY -RY RUNNING LOW. DIVISION UNIT 3 WILL BE OUT OF ACTION UNTIL RY -RY THURSDAY DUE TO EMERGENCY COG REPLACEMENT - PLEASE ENSURE RY -RY THAT YOUR PROGRAM DOES NOT ATTEMPT TO DIVIDE BY ZERO AS RY -RY THIS CAN CAUSE SEVERE DAMAGE (INCLUDING SHAFT BREAKAGES). RY -RY RY -RYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRY -. -. -SYSTEM READY. -? - -- Chris Suslowicz -% -Sacher's Observation: - Some people grow with responsibility -- others merely swell. -% -Sacred cows make great hamburgers. -% -SADISM: - A sadist refusing to whip a masochist. -% -Sadoequinecrophilia, n.: - Beating a dead horse. -% -Safety Third. -% -Safety Tips for the Post-Nuclear Existence - Tip #1: How to tell when you are dead. - - 1. Little things start bothering you: little things like worms, - bugs, ants. - 2. Something is missing in your personal relationships. - 3. Your dog becomes overly affectionate. - 4. You have a hard time getting a waiter. - 5. Exotic birds flock around you. - 6. People ignore you at parties. - 7. You have a hard time getting up in the morning. - 8. You no longer get off on cocaine. -% -SAGDEEV CALLED ON THE U.S. TO MAKE A RECIPROCAL GESTURE: - - In a recent speech in London, the irrepressible former head of the -Soviet Space Research Institute noted that the Soviet Government has offered -to convert its gigantic Krasnoyarsk radar in Siberia into an international -space research facility in response to U.S. complaints that the radar would -violate the ABM treaty. Sagdeev suggested that the U.S. reciprocate by -turning the unfinished U.S. embassy in Moscow into a nuclear crisis reduction -center. The communication system, he pointed out, is already in place. -% -SAGITTARIUS (Nov 22 - Dec 21) - You are optimistic and enthusiastic. You have a reckless - tendency to rely on luck since you lack talent. The majority - of Sagittarians are drunks or dope fiends or both. People - laugh at you a great deal. -% -SAGITTARIUS (Nov. 22 to Dec. 21) - Move slowly today, be deliberate. Indications are for bleeding - ulcers. Drink milk. Try not to be your usual offensive and - obnoxious self. Call your mother. -% -SAGITTARIUS (Nov.22 - Dec.21) - Your efforts to help a little old lady cross a street will - backfire when you learn that she was waiting for a bus. Subdue - impulse you have to push her out into traffic. -% -Said the attractive, cigar-smoking housewife to her girl-friend: "I -got started one night when George came home and found one burning in -the ashtray." -% -Sailing is fun, but scrubbing the decks is aardvark. - -- Heard on Noah's ark -% -Sailors in ships, sail on! -Even while we died, others rode out the storm. -% -Saints should always be judged guilty until they are proved innocent. - -- George Orwell, "Reflections on Gandhi" -% -Saliva causes cancer, but only if swallowed -in small amounts over a long period of time. - -- George Carlin -% -Sally: C'mon, Ted, all I'm asking you to do is share your feelings - with me. -Ted: ALL? Do you realize what you're asking? Men aren't trained - to share. We're trained to protect ourselves by not - letting anyone too close. Good grief, if I go around - sharing everything with you, you could hang me out to dry. -Sally: It's called "trust," Ted. -Ted: "Sharing"? "Trust"? You're really asking me to sail into - uncharted waters here. - -- Sally Forth -% -Sam: What's going on, Normie? -Norm: My birthday, Sammy. Give me a beer, stick a candle in - it, and I'll blow out my liver. - -- Cheers, Where Have All the Floorboards Gone - -Woody: Hey, Mr. P. How goes the search for Mr. Clavin? -Norm: Not as well as the search for Mr. Donut. - Found him every couple of blocks. - -- Cheers, Head Over Hill -% -Sam: What do you know there, Norm? -Norm: How to sit. How to drink. Want to quiz me? - -- Cheers, Loverboyd - -Sam: Hey, how's life treating you there, Norm? -Norm: Beats me. ... Then it kicks me and leaves me for dead. - -- Cheers, Loverboyd - -Woody: How would a beer feel, Mr. Peterson? -Norm: Pretty nervous if I was in the room. - -- Cheers, Loverboyd -% -Sam: What's the good word, Norm? -Norm: Plop, plop, fizz, fizz. -Sam: Oh no, not the Hungry Heifer... -Norm: Yeah, yeah, yeah... -Sam: One heartburn cocktail coming up. - -- Cheers, I'll Gladly Pay You Tuesday - -Sam: Whaddya say, Norm? -Norm: Well, I never met a beer I didn't drink. And down it goes. - -- Cheers, Love Thy Neighbor - -Woody: What's your pleasure, Mr. Peterson? -Norm: Boxer shorts and loose shoes. But I'll settle for a beer. - -- Cheers, The Bar Stoolie -% -Sam: What do you say, Norm? -Norm: Any cheap, tawdry thing that'll get me a beer. - -- Cheers, Birth, Death, Love and Rice - -Sam: What do you say to a beer, Normie? -Norm: Hiya, sailor. New in town? - -- Cheers, Woody Goes Belly Up - -Norm: [coming in from the rain] Evening, everybody. -All: Norm! (Norman.) -Sam: Still pouring, Norm? -Norm: That's funny, I was about to ask you the same thing. - -- Cheers, Diane's Nightmare -% -Sam: What's new, Norm? -Norm: Most of my wife. - -- Cheers, The Spy Who Came in for a Cold One - -Coach: Beer, Norm? -Norm: Naah, I'd probably just drink it. - -- Cheers, Now Pitching, Sam Malone - -Coach: What's doing, Norm? -Norm: Well, science is seeking a cure for thirst. I happen - to be the guinea pig. - -- Cheers, Let Me Count the Ways -% -SAN DIEGO: - Four million people, where you can't get a - good cheeseburger, no matter how hard you try. -% -San Francisco has always been my favorite booing city. I don't mean the -people boo louder or longer, but there is a very special intimacy. When -they boo you, you know they mean *you*. Music, that's what it is to me. -One time in Kezar Stadium they gave me a standing boo. - -- George Halas, professional football coach -% -San Francisco isn't what it used to be, and it never was. - -- Herb Caen -% -San Francisco, n.: - Marcel Proust editing an issue of Penthouse. -% -Sanity and insanity overlap a fine grey line. -% -Sanity is the trademark of a weak mind. - -- Mark Harrold -% -Sank heaven for leetle curls. -% -Santa Claus is watching! -% -Santa Claus wears a red suit -He's a Communist. - -He has long hair and a beard -Must be a pacifist. - -And what's in the pipe that he's smoking? - -Santa Claus comes in your house at night. -He must be a dope fiend to get you up tight. - -Why do police guys beat on peace guys? - -- Arlo Guthrie, "The Pause of Mr. Claus" -% -Santa's elves are just a bunch of subordinate Clauses. -% -Satellite Safety Tip #14: - If you see a bright streak in the sky coming at you, duck. -% -Satire does not look pretty upon a tombstone. -% -Satire is tragedy plus time. - -- Lenny Bruce -% -Satire is what closes in New Haven. -% -Satire is what closes Saturday night. - -- George Kaufman -% -Sattinger's Law: - It works better if you plug it in. -% -Saturday night in Toledo Ohio, -Is like being nowhere at all, -All through the day how the hours rush by, -You sit in the park and you watch the grass die. - -- John Denver, "Saturday Night in Toledo Ohio" -% -Satyrs have more faun. -% -Sauron is alive in Argentina! -% -Savage's Law of Expediency: - You want it bad, you'll get it bad. -% -Save a little money each month and at the end of the year you'll be -surprised at how little you have. - -- Ernest Haskins -% -Save a tree -- kill an ISO working group today. - -- Jason Zions -% -Save energy: Drive a smaller shell. -% -Save energy: be apathetic. -% -Save gas, don't eat beans. -% -Save gas, don't use the shell. -% -Save the bales! -% -Save the whales. Collect the whole set. -% -Save the Whales -- Harpoon a Honda. -% -Save yourself! Reboot in 5 seconds! -% -Say! You've struck a heap of trouble-- -Bust in business, lost your wife; -No one cares a cent about you, -You don't care a cent for life; -Hard luck has of hope bereft you, -Health is failing, wish you'd die-- -Why, you've still the sunshine left you -And the big blue sky. - -- R. W. Service -% -Say it with flowers, -Or say it with mink, -But whatever you do, -Don't say it with ink! - -- Jimmie Durante -% -Say many of cameras focused t'us, -Our middle-aged shots do us justice. -No justice, please, curse ye! -We really want mercy: -You see, 'tis the justice, disgusts us. - -- Thomas H. Hildebrandt -% -Say my love is easy had, -Say I'm bitten raw with pride, -Say I am too often sad -- -Still behold me at your side. - -Say I'm neither brave nor young, -Say I woo and coddle care, -Say the devil touched my tongue, -Still you have my heart to wear. - -But say my verses do not scan, -And I get me another man! - -- Dorothy Parker, "Fighting Words" -% -Say no, then negotiate. - -- Helga -% -Say something you'll be sorry for, I love receiving apologies. -% -Say "twenty-three-skiddoo" to logout. -% -SCCS, the source motel! Programs check in and never check out! - -- Ken Thompson -% -SCENARIO: - An imagined sequence of events that provides the context in - which a business decision is made. Scenarios always come in - sets of three: best case, worst case, and just in case. -% -Scenary is here, wish you were beautiful. -% -Scene: - A small boy stands agasp on the stairway overlooking the living -room. A rather largish man in a big red suit with white fur and red and -white belled cap hunches over the fireplace, obviously interrupted in -filling stockings with packages taken from a huge bag slung over his -shoulder. His eyebrows are raised, matter-of-factly, as he spies the boy -intently watching him. - -Caption: - I'm sorry you've seen me, Billy. Now I'll have to kill you. -% -Schapiro's Explanation: - The grass is always greener on the other side -- - but that's because they use more manure. -% -Schizophrenia beats being alone. -% -Schlattwhapper, n.: - The window shade that allows itself to be pulled down, - hesitates for a second, then snaps up in your face. - -- Rich Hall, "Sniglets" -% -Schmidt's Observation: - All things being equal, a fat person uses more soap - than a thin person. -% -Schwiggle, n.: - The amusing rotation of one's bottom while sharpening a - pencil. - -- Rich Hall, "Sniglets" -% -Science and religion are in full accord but -science and faith are in complete discord. -% -Science Fiction, Double Feature. -Frank has built and lost his creature. -Darkness has conquered Brad and Janet. -The servants gone to a distant planet. -Wo, oh, oh, oh. -At the late night, double feature, Picture show. -I want to go, oh, oh, oh. -To the late night, double feature, Picture show. - -- Rocky Horror Picture Show -% -Science is built up of facts, as a house is with stones. But a -collection of facts is no more a science than a heap of stones -is a house. - -- Jules Henri Poincar'e -% -Science is facts; just as houses are made of stones, so is science made -of facts; but a pile of stones is not a house and a collection of facts -is not necessarily science. - -- Jules Henri Poincar'e -% -Science is like sex: sometimes something useful comes -out, but that is not the reason we are doing it - -- Richard Feynman -% -Science is to computer science as hydrodynamics is to plumbing. -% -Science is what happens when preconception meets verification. -% -Science may someday discover what faith has always known. -% -Science! true daughter of Old Time thou art! -Who alterest all things with thy peering eyes. -Why preyest thou thus upon the poet's heart, -Vulture, whose wings are dull realities? -How should he love thee? or how deem thee wise? -Who wouldst not leave him in his wandering -To seek for treasure in the jewelled skies, -Albeit he soared with an undaunted wing? -Hast thou not dragged Diana from her car? -And driven the Hamadryad from the wood -To seek a shelter in some happier star? -Hast thou not torn the Naiad from her flood, -The Elfin from the green grass, and from me -The summer dream beneath the tamarind tree? - -- Edgar Allan Poe, "Science, a Sonnet" -% -Scientists are people who build the Brooklyn Bridge and then buy it. - -- William F. Buckley - -% -Scientists still know less about what attracts men -than they do about what attracts mosquitoes. - -- Dr. Joyce Brothers, - "What Every Woman Should Know About Men" -% -Scientists were preparing an experiment to ask the ultimate question. -They had worked for months gathering one each of every computer that -was built. Finally the big day was at hand. All the computers were -linked together. They asked the question, "Is there a God?". Lights -started blinking, flashing and blinking some more. Suddenly, there -was a loud crash, and a bolt of lightning came down from the sky, -struck the computers, and welded all the connections permanently -together. "There is now", came the reply. -% -Scintillate, scintillate, globule vivific, -Fain how I pause at your nature specific, -Loftily poised in the ether capacious, -Highly resembling a gem carbonaceous. -Scintillate, scintillate, globule vivific, -Fain how I pause at your nature specific. -% -Scintillation is not always identification for an auric substance. -% -SCORPIO (Oct 23 - Nov 21) - You are shrewd in business and cannot be trusted. You will achieve - the pinnacle of success because of your total lack of ethics. Most - Scorpio people are murdered. -% -SCORPIO (Oct. 23 to Nov. 21) - Friends abound today, seeking repayment of past loans. Smile. Check - for concealed weapons. Your natural cheerfulness makes others want - to throw up. Knock it off. -% -SCORPIO (Oct.24 - Nov.21) - You will receive word today that you are eligible to win a million - dollars in prizes. It will be from a magazine trying to get you to - subscribe, and you're just dumb enough to think you've got a chance - to win. You never learn. -% -Scott's first Law: - No matter what goes wrong, it will probably look right. -% -Scott's second Law: - When an error has been detected and corrected, it will be found -to have been wrong in the first place. - -Corollary: - After the correction has been found in error, it will be -impossible to fit the original quantity back into the equation. -% -Scotty: Captain, we din' can reference it! -Kirk: Analysis, Mr. Spock? -Spock: Captain, it doesn't appear in the symbol table. -Kirk: Then it's of external origin? -Spock: Affirmative. -Kirk: Mr. Sulu, go to pass two. -Sulu: Aye aye, sir, going to pass two. -% -Screw up your courage! You've screwed up everything else. -% -Scribline, n.: - The blank area on the back of credit cards where one's - signature goes. - -- Rich Hall & Friends, "Sniglets" -% -Scrubbing floors and emptying bedpans has as much dignity as the -Presidency. - -- Richard M. Nixon -% -'Scuse me, while I kiss the sky! - -- Robert James Marshall (Jimi) Hendrix -% -Sears has everything. -% -Seattle is so wet that people protect their property with watch-ducks. -% -Second Law of Business Meetings: - If there are two possible ways to spell a person's name, you - will pick the wrong one. - -Corollary: - If there is only one way to spell a name, - you will spell it wrong, anyway. -% -Second Law of Final Exams: - In your toughest final -- for the first time all year -- the most - distractingly attractive student in the class will sit next to you. -% -Secrecy is the beginning of tyranny. -% -Secretary's Revenge: - Filing almost everything under "the". -% -Section 2.4.3.5 AWNS (Acceptor Wait for New Cycle State). - In AWNS the AH function indicates that it has received a -multiline message byte. - In AWNS the RFD message must be sent false and the DAC message -must be sent passive true. - The AH function must exit the AWNS and enter: - (1) The ANRS if DAV is false - (2) The AIDS if the ATN message is false and neither: - (a) The LADS is active - (b) Nor LACS is active - - -- from the IEEE Standard Digital Interface for - Programmable Instrumentation -% -Security check: INTRUDER ALERT! -% -Sed quis custodiet ipsos Custodes? -[Who guards the Guardians?] -% -Seduced, shaggy Samson snored. -She scissored short. Sorely shorn, -Soon shackled slave, Samson sighed, -Silently scheming, -Sightlessly seeking -Some savage, spectacular suicide. - -- Stanislaw Lem, "Cyberiad" -% -See - the thing is - I'm an absolutist. I mean, kind of ... in a way ... -% -See, these two penguins walked into a bar, which was really stupid, 'cause -the second one should have seen it. -% -Seeing a commotion in Harvard Square, a man strolled over and asked what -was going on. One of the onlookers explained to him that there was a Mooney -who had immersed himself in gasoline and was threatening to set fire to -himself to demonstrate his commitment to the Rev. Moon. The man gasped and -asked what was being done to defuse the obviously dangerous situation. - "Well", replied the onlooker, "we're taking up a collection -- so -far I've got two Bics, four Zippos and eighteen books of matches." -% -Seeing is believing. -You wouldn't have seen it if you hadn't believed it. -% -Seeing is deceiving. It's eating that's believing. - -- James Thurber -% -Seeing that death, a necessary end, -Will come when it will come. - -- William Shakespeare, "Julius Caesar" -% -Seek simplicity -- and distrust it. - -- Alfred North Whitehead -% -Seems a computer engineer, a systems analyst, and a programmer were -driving down a mountain when the brakes gave out. They screamed down the -mountain, gaining speed, but finally managed to grind to a halt, more by -luck than anything else, just inches from a thousand foot drop to jagged -rocks. They all got out of the car: - The computer engineer said, "I think I can fix it." - The systems analyst said, "No, no, I think we should take it -into town and have a specialist look at it." - The programmer said, "OK, but first I think we should get back -in and see if it does it again." -% -Seems like this duck waddles into a pharmacy, waddles up to the prescription -counter and rings the bell. The pharmacist walks up and asks, "Can I help -you?". - The duck replies, "Yes, I'd like a box of condoms, please." - "Certainly", says the pharmacist, "will that be cash or would -you like me to put it on your bill?" - Snarls the duck, "Just what kind of duck do you think I am?" -% -Seems like this farmer purchased an old, run-down, abandoned farm with plans -to turn it into a thriving enterprise. The fields are grown over with weeds, -the farmhouse is falling apart, and the fences are collapsing all around. -During his first day of work, the town preacher stops by to bless the man's -work, praying, "May you and God work together to make this the farm of your -dreams!" - A few months later, the preacher stops by again to call on the farmer. -Lo and behold, it's like a completely different place -- the farm house is -completely rebuilt and in excellent condition, there is plenty of cattle and -other livestock happily munching on feed in well-fenced pens, and the fields -are filled with crops planted in neat rows. "Amazing!" the preacher says. -"Look what God and you have accomplished together!" - "Yes, reverend," replies the farmer, "but remember what the farm was -like when God was working it alone!" -% -Seems like this guy wanders into a rural outfitting store in Alaska, -and starts talking to a rather grizzled old man sitting by the cash -register. - "Hear ya got a lotta' bears 'round here?" - "Yeah, you could say that," answers the old man. - "GRIZZLIES?!?!" - "A few." - "Got any bear bells?" - "What's that?" - "You know, them little dingle-bells ya put on yer backpack so -bears know yer there so's they can run away ... I'll take one fer black -bears, and one fer them grizzlies. Say, how do you know yer in grizzly -country, anyhow?" - "Look fer scat. Grizzly scat's different from black bear scat." - "Well now, what's IN grizzly scat that's different?" - "Bear bells." -% -Seems that a pollster was taking a worldwide opinion poll. -Her question was, "Excuse me; what's your opinion on the meat shortage?" - -In Texas, the answer was "What's a shortage?" -In Poland, the answer was "What's meat?" -In the Soviet Union, the answer was "What's an opinion?" -In New York City, the answer was "What's excuse me?" -% -Seems this fellow was suffering from terrific headaches, and went to his -doctor about it. The physician made a number of tests, and informed the man -that the only thing for his headaches was castration. After a few more -months, the headaches became so intense that the man agreed to the operation. -Naturally enough, the ruination of his sex life depressed him tremendously, -and he decided to purchase a new wardrobe to make himself feel better. -He enters a men's clothing store and a salesman wanders over, looks him -up and down, and says, "Well, let's start with shirts... 15 neck, 34 sleeve." - The guy is amazed. "How'd you know?" - "Well, I've been here nearly 30 years, and I can tell sizes within -a quarter inch on every piece of clothing." The salesman's claim is borne -out. Slacks, 34 waist, 32 inseam; jacket: 42 long. And so on and so forth. -When the man has been completely outfitted he decides that he'd better buy -some new underwear. - The salesman looks at him and says, "Okay, that'll be a 34." - "No, that's wrong," says the man. "I've always worn a 32." The -salesman insists, pointing out his accuracy so far. The man argues, agreeing -that while he's been right so far, he has always worn a 32 in shorts. - Finally in exasperation, the salesman says, "Listen, I tell you, -you *have* to wear a 34. Otherwise, you'll get these *awful* headaches." -% -Seems this guy showed up at a party, and all of his friends jumped for -Joy. But she sidestepped, and they missed. -% -Seize the day, put no trust in the morrow! - -- Quintus Horatius Flaccus (Horace) -% -Seleznick's Theory of Holistic Medicine: - Ice Cream cures all ills. Temporarily. -% -Self Test for Paranoia: - You know you have it when you can't think of anything that's - your own fault. -% -Seminars, n.: - From "semi" and "arse", hence, any half-assed discussion. -% -semper en excretus -% -SEMPER UBI SUB UBI!!!! -% -Senate, n.: - A body of elderly gentlemen charged with high duties and - misdemeanors. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Send some filthy mail. -% -Sendmail may be safely run set-user-id to root. - -- Eric Allman, "Sendmail Installation Guide" -% -SENILITY: - The state of mind of elderly persons - with whom one happens to disagree. -% -Senor Castro has been accused of communist sympathies, but this means very -little since all opponents of the regime are automatically called communists. -In fact he is further to the right than General Batista. - -- "Cuba's Rightist Rebel", The Economist, April 26, 1958 -% -Sentient plasmoids are a gas. -% -Sentimentality -- that's what we call the sentiment we don't share. - -- Graham Greene -% -SERENDIPITY: - The process by which human knowledge is advanced. -% -Serenity through viciousness. -% -Serfs up! - -- Spartacus -% -Serocki's Stricture: - Marriage is always a bachelor's last option. -% -Serving coffee on an aircraft causes turbulence. -% -Set the cart before the horse. - -- John Heywood -% -Several years ago, an international chess tournament was being held in a -swank hotel in New York. Most of the major stars of the chess world were -there, and after a grueling day of chess, the players and their entourages -retired to the lobby of the hotel for a little refreshment. In the lobby, -some players got into a heated argument about who was the brightest, the -fastest, and the best chess player in the world. The argument got quite -loud, as various players claimed that honor. At that point, a security -guard in the lobby turned to another guard and commented, "If there's -anything I just can't stand, it's chess nuts boasting in an open foyer." -% -Several years ago, some smart businessmen had an idea: Why not build a -big store where a do-it-yourselfer could get everything he needed at -reasonable prices? Then they decided, nah, the hell with that, let's -build a home center. And before long home centers were springing up -like crabgrass all over the United States. - -- Dave Barry, "The Taming of the Screw" -% -Sex and drugs and rock and roll, -Is all my brain and body need. -Sex and drugs and rock and roll, -Are very good indeed. - -Take your silly ways, -Throw them out the window, -The wisdom of your ways, -I've been there and I know, -Lots of other ways... - -- Ian Drury, "New Boots and Panties" -% -Sex discriminates against the shy and ugly. -% -Sex hasn't been the same since women started enjoying it. - -- Lewis Grizzard -% -Sex is a natural bodily process, like a stroke. -% -Sex is about as important as a cheese sandwich. But a cheese sandwich, -if you ain't got one to put in your belly, is extremely important. - -- Ian Dury -% -Sex is an emotion in motion. - -- Mae West -% -Sex is as honest a product benefit for fragrance [perfume] as taste is -for diet Coke. - -- Malcolm MacDougall -% -Sex is good, but not as good as fresh sweet corn. - -- Garrison Keillor -% -Sex is like pizza -- when it's good, it's great; and when it's bad, -it's still darn tasty! -% -Sex is one of the nine reasons for reincarnation... The other eight are -unimportant. - -- Henry Miller -% -Sex is the mathematics urge sublimated. - -- M. C. Reed -% -Sex: the thing that takes up the least amount of time and causes the -most amount of trouble. - -- John Barrymore -% -Sex without class consciousness cannot give satisfaction, even if it is -repeated until infinity. - -- Aldo Brandirali (Secretary of the Italian Marxist-Leninist - Party), in a manual of the party's official sex guidelines, - 1973. -% -Sex without love is an empty experience, but, -as empty experiences go, it's one of the best. - -- Woody Allen -% -Sexual enlightenment is justified insofar as girls cannot learn too soon -how children do not come into the world. - -- Karl Kraus -% -Shah, shah! Ayatulla you so! -% -Shall we make a new rule of life from tonight: -always to try to be a little kinder than is necessary? - -- J. M. Barrie -% -Shame is an improper emotion invented by -pietists to oppress the human race. - -- Robert Preston, Toddy, "Victor/Victoria" -% -Shannon's Observation - Nothing is so frustrating as a bad situation - that is beginning to improve. -% -Share, n.: - To give in, endure humiliation. -% -Sharks are as tough as those football fans who take their shirts off -during games in Chicago in January, only more intelligent. - -- Dave Barry, "Sex and the Single Amoeba: What Every - Teen Should Know" -% -Shaw's Principle: - Build a system that even a fool can use, and only a fool will - want to use it. -% -She always believed in the old adage -- leave them while you're looking -good. - -- Anita Loos, "Gentlemen Prefer Blondes" -% -She applies her lipstick in spite of its contents: "greasy rouge, -containing crushed and dried insect corpses for coloring, beeswax -for stiffness, and olive oil to help it flow - the latter having -the unfortunate tendency to go rancid several hours after use. - -In 1924 the New York Board of Health considered banning lipstick, -not because it was hazardous to the wearers but because of "the -worry that it might poison the men who kissed the women who wore it." - -- David Bodanis, "The Secret House" -% -She asked me, "What's your sign?" -I blinked and answered "Neon," -I thought I'd blow her mind... -% -She been married so many times -she got rice marks all over her face. - -- Tom Waits -% -She blinded me with science! -% -She can kill all your files; -She can freeze with a frown. -And a wave of her hand brings the whole system down. -And she works on her code until ten after three. -She lives like a bat but she's always a hacker to me. - -- Apologies to Billy Joel -% -She cried, and the judge wiped her tears with my checkbook. - -- Tommy Manville -% -She has an alarm clock and a phone that don't ring - they applaud. -% -She is descended from a long line that her mother listened to. - -- Gypsy Rose Lee -% -She is not refined. She is not unrefined. She keeps a parrot. - -- Mark Twain -% -She just came in, pounced around this thing with me for a few -years, enjoyed herself, gave it a sort of beautiful quality and -left. Excited a few men in the meantime. - -- Patrick Macnee, reminiscing on Diana Rigg's - involvement in "The Avengers". -% -She liked him; he was a man of many qualities, even if most of them -were bad. -% -She missed an invaluable opportunity to give him -a look that you could have poured on a waffle. -% -She often gave herself very good advice -(though she very seldom followed it). - -- Lewis Carroll, "Alice's Adventures in Wonderland" (1865) -% -She ran the gamut of emotions from "A" to "B". - -- Dorothy Parker, on a Kate Hepburn performance -% -She say, Miss Colie, You better hush. God might hear you. -Let 'im hear me, I say. If he ever listened to poor colored -women the world would be a different place, I can tell you. - -- Alice Walker, "The Color Purple" -% -She sells cshs by the cshore. -% -She stood on the tracks -Waving her arms -Leading me to that third rail shock -Quick as a wink -She changed her mind - -She gave me a night -That's all it was -What will it take until I stop -Kidding myself -Wasting my time - -There's nothing else I can do -'Cause I'm doing it all for Leyna -I don't want anyone new -'Cause I'm living it all for Leyna -There's nothing in it for you -'Cause I'm giving it all to Leyna - -- Billy Joel, "All for Leyna" (Glass Houses) -% -She was bred in ol' Kentucky -But she's just a crumb up here -She was knock-knee'd and double-jointed -With a cauliflower ear -Someday we will be married -And if vegetables become too dear -I'll just cut me a slice of -Her cauliflower ear! - -- Curly Howard, "The Three Stooges" -% -She was good at playing abstract confusion in the same way a midget is -good at being short. - -- Clive James, on Marilyn Monroe -% -She was only a moonshiner's daughter, but I love her still. -% -She was only a mortician's daughter but anyone cadaver. -% -She won' go Warp 7, Cap'n! The batteries are dead! -% -Shedenhelm's Law: - All trails have more uphill sections - than they have downhill sections. -% -"Shelter", what a nice name for a place where you polish your cat. -% -Sheriff Chameleotoptor sighed with an air of weary sadness, and then -turned to Doppelgutt and said 'The Senator must really have been on a -bender this time -- he left a party in Cleveland, Ohio, at 11:30 last -night, and they found his car this morning in the smokestack of a British -aircraft carrier in the Formosa Straits.' - -- Grand Panjandrum's Special Award, 1985 Bulwer-Lytton - bad fiction contest. -% -Sherry [Thomas Sheridan] is dull, naturally dull; but it must have taken -him a great deal of pains to become what we now see him. Such an excess -of stupidity, sir, is not in Nature. - -- Samuel Johnson -% -She's genuinely bogus. -% -She's learned to say things with her eyes -that others waste time putting into words. -% -She's so tough she won't take 'yes' for an answer. -% -She's such a kinky girl, -The kind you don't take home to mother. -She will never let your spirits down -Once you get her off the street. -% -She's the kind of girl who climbed the ladder of success wrong by wrong. - -- Mae West -% -Shhh... be vewy, vewy, quiet! I'm hunting wabbits... -% -Shick's Law: - There is no problem a good miracle can't solve. -% -Shift to the left, -Shift to the right, -Mask in, mask out, -BYTE, BYTE, BYTE !!! -% -SHIFT TO THE LEFT! -SHIFT TO THE RIGHT! -POP UP, PUSH DOWN, -BYTE, BYTE, BYTE! -% -Ships are safe in harbor, but they were never meant to stay there. -% -Shirley MacLaine died today in a freak psychic collision today. Two freaks -in a van [Oh no!! It's the Copyright Police!!] Her aura-charred body was -laid to rest after a eulogy by Jackie Collins, fellow member of SAFE [Society -of Asinine Flake Entertainers]. Excerpted from some of his more quotable -comments: - - "Truly a woman of the times. These times, those times..." - "A Renaissance woman. Why in 1432..." - "A man for all seasons. Really..." - -After the ceremony, Shirley thanked her mourners and explained how delightful -it was to "get it together" again, presumably referring to having her now dead -body join her long dead brain. -% -Sho' they got to have it against the law. Shoot, ever'body git high, -they wouldn't be nobody git up and feed the chickens. Hee-hee. - -- Terry Southern -% -Short people get rained on last. -% -Show business is just like high school, except you get paid. - -- Martin Mull -% -Show me a good loser in professional sports and I'll show you an idiot. -Show me a good sportsman and I'll show you a player I'm looking to trade. - -- Leo Durocher -% -Show me a man who is a good loser and I'll show you a man who is -playing golf with his boss. -% -Show respect for age. Drink good Scotch for a change. -% -Show your affection, which will probably meet with pleasant response. -% -Showing up is 80% of life. - -- Woody Allen -% -Si Dieu n'existait pas, il faudrait l'inventer. - -- Voltaire -% -Si jeunesse savait, si vieillesse pouvait. -[If youth but knew, if old age but could.] - -- Henri Estienne -% -Sic transit gloria Monday! -% -Sic transit gloria mundi. -[So passes away the glory of this world.] - -- Thomas a Kempis -% -Sic Transit Gloria Thursdi. -% -Sight is a faculty; seeing is an art. -% -Sigmund's wife wore Freudian slips. -% -Signals don't kill programs. Programs kill programs. -% -Signs of crime: screaming or cries for help. - -- The Brown University Security Crime Prevention Pamphlet -% -Silence can be the biggest lie of all. We have a responsibility to speak -up; and whenever the occasion calls for it, we have a responsibility to -raise bloody hell. - -- Herbert Block -% -Silence is the element in which great things fashion themselves. - -- Thomas Carlyle -% -Silence is the only virtue you have left. -% -sillema sillema nika su -[translation: look it up...hint-fin] -% -Silly is a state of Mind, Stupid is a way of Life. -% -Silly Sally was baby sitting. But Silly Sally was getting bored. Thinking -a walk would help, she put the baby in his carriage. Silly Sally pushed the -carriage and pushed the carriage up this hill and down that one. She pushed -the carriage up the highest hill in town, and ALL OF A SUDDEN! It slipped out -of her hands (OH! NO!) and it was headed at high speed for the busiest -intersection in town. BUT! - -Silly Sally just laughed and la.....ug.......h....e....d........... -BECAUSE! SHE KNEW THERE WAS A STOP SIGN AT THE BOTTOM OF THE HILL! - -Silly Sally was playing in the garage. And she was being disobedient. -She was playing with matches... AND... She burned down the garage. -(OHHHHHH) Silly Sally's mother said, "Silly Sally! You have been naughty! -And when your father gets home, you are going to get a good licking!" BUT! - -Silly Sally just laughed and la.....ug.......h....e....d........... -BECAUSE! SHE KNEW HER FATHER WAS IN THE GARAGE WHEN SHE BURNED IT DOWN! -% -Silverman's Law: - If Murphy's Law can go wrong, it will. -% -Simon's Law: - Everything put together falls apart sooner or later. -% -Simplicity does not precede complexity, but follows it. -% -Simulated fortune: - - The head and in frontal attack on an english writer that the - character of this point is therefore another method for the - letters that the time of who ever told the problem for an - unexpected. - - -- by Claude E. Shannon -% -Simulations are like miniskirts, they show a lot and hide the essentials. - -- Hubert Kirrman -% -Sin boldly. - -- Martin Luther -% -Sin has many tools, but a lie is the handle which fits them all. -% -Sin lies only in hurting other people unnecessarily. -All other "sins" are invented nonsense. -(Hurting yourself is not sinful -- just stupid). - -- Lazarus Long -% -Since a politician never believes what he says, he is surprised -when others believe him. - -- Charles DeGaulle -% -Since aerosols are forbidden, the police are using roll-on Mace! -% -Since before the Earth was formed and before the sun burned hot in space, -cosmic forces of inexorable power have been working relentlessly toward -this moment in space-time -- your receiving this fortune. -% -Since everything in life is but an experience perfect in being what it is, -having nothing to do with good or bad, acceptance or rejection, one may well -burst out in laughter. - -- Long Chen Pa -% -Since I hurt my pendulum -My life is all erratic. -My parrot who was cordial -Is now transmitting static. -The carpet died, a palm collapsed, -The cat keeps doing poo. -The only thing that keeps me sane -Is talking to my shoe. - -- My Shoe -% -Since we cannot hope for order, let us withdraw with style from the chaos. - -- Tom Stoppard -% -Since we have to speak well of the dead, let's knock them while they're -alive. - -- John Sloan -% -Since we're all here, we must not be all there. - -- Bob "Mountain" Beck -% -Sink or Swim with Teddy! -% -Sinners can repent, but stupid is forever. -% -Sir, it's very possible this asteroid is not stable. - -- C-3PO -% -[Sir Stafford Cripps] has all the virtues -I dislike and none of the vices I admire. - -- Winston Churchill -% -Six days after the Creation, Adam was still alone in the Garden of -Eden, and getting pretty desperate. "God!" he cried, "rescue me from -loneliness and despair! Send some company for Your sake!" - -God replied "OK, I have just the thing. Keep you warm and relaxed all -the days of your life. Never complains. Looks up to you in every way. -It'll cost you though". - -"Sounds ideal" said Adam. "The society of the beasts of the field and -the birds of the air palls after a while. What's the price?" - -"An arm and a leg", said God. - -Adam thought about it for a bit and finally sighed. "So, what can I get -for a rib?" -% -Skill without imagination is craftsmanship and gives us many useful -objects such as wickerwork picnic baskets. Imagination without skill -gives us modern art. - -- Tom Stoppard -% -Skinner's Constant (or Flannagan's Finagling Factor): - That quantity which, when multiplied by, divided by, added to, - or subtracted from the answer you got, gives you the answer you - should have gotten. -% -skldfjkljklsR%^&(IXDRTYju187pkasdjbasdfbuil -h;asvgy8p 23r1vyui135 2 -kmxsij90TYDFS$$b jkzxdjkl bjnk ;j nk;<[][;-==-<<<<<';[, - [hjioasdvbnuio;buip^&(FTSD$%*VYUI:buio;sdf}[asdf'] - sdoihjfh(_YU*G&F^*CTY98y - - -Now look what you've gone and done! You've broken it! -% -Slang is language that takes off its coat, -spits on its hands, and goes to work. -% -Slaves are generally expected to sing as well as to work ... I did not, when -a slave, understand the deep meanings of those rude, and apparently incoherent -songs. I was myself within the circle, so that I neither saw nor heard as -those without might see and hear. They told a tale which was then altogether -beyond my feeble comprehension: they were tones, loud, long and deep, -breathing the prayer and complaint of souls boiling over with the bitterest -anguish. Every tone was a testimony against slavery, and a prayer to God -for deliverance from chains. - -- Frederick Douglass -% -Sleep -- the most beautiful experience in life -- except drink. - -- W. C. Fields -% -Sleep is for the weak and sickly. -% -Slick's Three Laws of the Universe: - 1) Nothing in the known universe travels faster than a bad check. - 2) A quarter-ounce of chocolate = four pounds of fat. - 3) There are two types of dirt: the dark kind, which is - attracted to light objects, and the light kind, which is - attracted to dark objects. -% -Slous' Contention: - If you do a job too well, you'll get stuck with it. -% -Slow day. -Practice crawling. -% -Slowly and surely the Unix crept up on the Nintendo user ... -% -Slurm, n.: - The slime that accumulates on the underside of a soap bar when - it sits in the dish too long. - -- Rich Hall, "Sniglets" -% -Small change can often be found under seat cushions. -% -Small is beautiful. - -- Schumacher's Dictum -% -Small things make base men proud. - -- William Shakespeare, "Henry VI" -% -Smartness runs in my family. When I went to school I was so smart my -teacher was in my class for five years. - -- George Burns -% -Smear the road with a runner!! -% -Smile! You're on Candid Camera. -% -Smile, Cthulhu Loathes You. -% -Smoking is, as far as I'm concerned, the entire point of being an adult. - -- Fran Lebowitz -% -SMOKING IS NOW ALLOWED !!! - Anyone wishing to smoke, however, must file, in triplicate, the - U.S. government Environmental Impact Narrative Statement (EINS), - describing in detail the type of combustion proposed, impact on - the environment, and anticipated opposition. Statements must be - filed 30 days in advance. -% -Smoking is one of the leading causes of statistics. - -- Fletcher Knebel -% -Smoking Prohibited. Absolutely no ifs, ands, or butts. -% -Smuggling... It's not just a job, it's an adventure! - -- paid for by your local Colombian recruiting office -% -Snacktrek, n.: - The peculiar habit, when searching for a snack, of constantly - returning to the refrigerator in hopes that something new will - have materialized. - -- Rich Hall & Friends, "Sniglets" -% -Snakes. Why did it have to be snakes? -% -SNAPPY REPARTEE: - What you'd say if you had another chance. -% -Snoopy: No problem is so big that it can't be run away from. -% -Snow and adolescence are the only problems -that disappear if you ignore them long enough. -% -Snow Day -- stay home. -% -Snow White has become a camera buff. She spends hours and hours -shooting pictures of the seven dwarfs and their antics. Then she -mails the exposed film to a cut rate photo service. It takes weeks -for the developed film to arrive in the mail, but that is all right -with Snow White. She clears the table, washes the dishes and sweeps -the floor, all the while singing "Someday my prints will come." -% -So as your consumer electronics adviser, I am advising you to donate -your current VCR to a grate resident, who will laugh sardonically and -hurl it into a dumpster. Then I want you to go out and purchase a vast -array of 8-millimeter video equipment. - -... OK! Got everything? Well, *too bad, sucker*, because while you -were gone the electronics industry came up with an even newer format -that makes your 8-millimeter VCR look as technologically advanced as -toenail dirt. This format is called "3.5 hectare" and it will not be -made available until it is outmoded, sometime early next week, by a -format called "Elroy", so *order yours now*. - -- Dave Barry, "No Surrender in the Electronics - Revolution" -% -So... did you ever wonder, do garbage men take showers before they -go to work? -% -So do the noble fall. For they are ever caught in a trap of their own making. -A trap -- walled by duty, and locked by reality. Against the greater force -they must fall -- for, against that force they fight because of duty, because -of obligations. And when the noble fall, the base remain. The base -- whose -only purpose is the corruption of what the noble did protect. Whose only -purpose is to destroy. The noble: who, even when fallen, retain a vestige of -strength. For theirs is a strength born of things other than mere force. -Theirs is a strength supreme... theirs is the strength -- to restore. - -- Gerry Conway, "Thor", #193 -% -So far as I can remember, there is not one word in the Gospels in -praise of intelligence. - -- Bertrand Russell -% -So far as we are human, what we do must be either evil or good: so far -as we do evil or good, we are human: and it is better, in a paradoxical -way, to do evil than to do nothing: at least we exist. - -- T. S. Eliot, essay on Baudelaire -% -So from the depths of its enchantment, Terra was able to calculate a course -of action. Here at last was an opportunity to consort with Dirbanu on a -friendly basis -- great Dirbanu which, since it had force fields which Earth -could not duplicate, must of necessity have many other things Earth could -use; mighty Dirbanu before whom we would kneel in supplication (with purely- -for-defense bombs hidden in our pockets) with lowered heads (making invisible -the knife in our teeth) and ask for crumbs from their table (in order to -extrapolate the location of their kitchens). - -- T. Sturgeon, "The World Well Lost" -% -So... how come the Corinthians never wrote back? -% -So, if there's no God, who changes the water? - -- New Yorker cartoon of two goldfish in a bowl -% -So I'm ugly. So what? I never saw anyone hit with his face. - -- Yogi Berra -% -So, is the glass half empty, half full, or just twice as -large as it needs to be? -% -So little time, so little to do. - -- Oscar Levant -% -So live that you wouldn't be ashamed -to sell the family parrot to the town gossip. -% -So many beautiful women and so little time. - -- John Barrymore -% -So many men and so little time. -% -So many men, so many opinions; every one his own way. - -- Publius Terentius Afer (Terence) -% -So many women, and so little time! -% -So many women, so little nerve. -% -So much food, and so little time! -% -So much -depends -upon -a red - -wheel -barrow -glazed with - -rain -water -beside -the white -chickens. - -- William Carlos Williams, "The Red Wheel Barrow" -% -So now -that you have- - -you know, whoever - -you're trying -to do - -a favor -for - --you've done it- - -and I'm sure -you had - -a smirk -on your mouth - -as you got me -into this. - -- "To Linda", from The Poetry Of H. Ross Perot, - composed for Linda Wertheimer of National Public - Radio. From SPY Magazine, November 1992 -% -So she went into the garden to cut a cabbage leaf to make an apple pie; and -at the same time a great she-bear, coming up the street pops its head into -the shop. "What! no soap?" So he died, and she very imprudently married -the barber; and there were present the Picninnies, and the Grand Panjandrum -himself, with the little round button at top, and they all fell to playing -the game of catch as catch can, till the gunpowder ran out at the heels of -their boots. - -- Samuel Foote -% -So so is good, very good, very excellent good: -and yet it is not; it is but so so. - -- William Shakespeare, "As You Like It" -% -So... so you think you can tell -Heaven from Hell? -Blue skies from pain? Did they get you to trade -Can you tell a green field Your heroes for ghosts? -From a cold steel rail? Hot ashes for trees? -A smile from a veil? Hot air for a cool breeze? -Do you think you can tell? Cold comfort for change? - Did you exchange - A walk on part in a war - For the lead role in a cage? - -- Pink Floyd, "Wish You Were Here" -% -So, what's with this guy Gideon, anyway? -And why can't he ever remember his Bible? -% -So, you better watch out! -You better not cry! -You better not pout! -I'm telling you why, -Santa Claus is coming, to town. - -He knows when you've been sleeping, -He know when you're awake. -He knows if you've been bad or good, -He has ties with the CIA. -So... -% -So you see Antonio, why worry about one little core dump, eh? In reality -all core dumps happen at the same instant, so the core dump you will have -tomorrow, why, it already happened. You see, it's just a little universal -recursive joke which threads our lives through the infinite potential of -the instant. So go to sleep, Antonio, your thread could break any moment -and cast you out of the safe security of the instant into the dark void of -eternity, the anti-time. So go to sleep... -% -So you think that money is the root of all evil. -Have you ever asked what is the root of money? - -- Ayn Rand -% -So you're back... about time... -% -Soap and education are not as sudden as a -massacre, but they are more deadly in the long run. - -- Mark Twain -% -SOCIALISM: - You have two cows. Give one to your neighbour. -COMMUNISM: - You have two cows. - Give both to the government. The government gives you milk. -CAPITALISM: - You sell one cow and buy a bull. -FASCISM: - You have two cows. Give milk to the government. - The government sells it. -NAZISM: - The government shoots you and takes the cows. -NEW DEALISM: - The government shoots one cow, - milks the other, and pours the milk down the sink. -ANARCHISM: - Keep the cows. Steal another one. Shoot the government. -CONSERVATISM: - Freeze the milk. Embalm the cows. -% -Sodd's Second Law: - Sooner or later, the worst possible set of circumstances is -bound to occur. -% -Software, n.: - Formal evening attire for female computer analysts. -% -Software production is assumed to be a line function, but it is run -like a staff function." - -- Paul Licker -% -Software suppliers are trying to make their software packages more -"user-friendly". ... Their best approach, so far, has been to take all -the old brochures, and stamp the words, "user-friendly" on the cover. - -- Bill Gates, Microsoft, Inc. -% -Soldiers who wish to be a hero -Are practically zero, -But those who wish to be civilians, -They run into the millions. -% -Solipsists of the World... you are already united. - -- Kayvan Sylvan -% -Solutions are obvious if one only has the -optical power to observe them over the horizon. - -- K. A. Arsdall -% -Some books are to be tasted, others to be swallowed, -and some few to be chewed and digested. - -- Francis Bacon - [As anyone who has ever owned a puppy already knows. Ed.] -% -Some changes are so slow, you don't notice them. -Others are so fast, they don't notice you. -% -Some circumstantial evidence is very strong, -as when you find a trout in the milk. - -- Thoreau -% -Some days you are the bug; some days you are the windshield. -% -Some don't prefer the pursuit of happiness to the happiness of pursuit. -% -Some husbands are living proof that a woman can take a joke. -% -Some marriages are made in heaven -- but so are thunder and lightning. -% -Some men are alive simply because it is against the law to kill them. - -- Edgar W. Howe -% -Some men are all right in their place -- if they only the knew the right -places! - -- Mae West -% -Some men are born mediocre, some men achieve mediocrity, -and some men have mediocrity thrust upon them. - -- Joseph Heller, "Catch-22" -% -Some men are discovered; others are found out. -% -Some men are heterosexual, and some are bisexual, and some men don't think -about sex at all... they become lawyers. - -- Woody Allen -% -Some men are so interested in their wives continued happiness -that they hire detectives to find out the reason for it. -% -Some men are so macho they'll get you pregnant just to kill a rabbit. - -- Maureen Murphy -% -Some men feel that the only thing they owe -the woman who marries them is a grudge. - -- Helen Rowland -% -Some men love truth so much that they seem to be in continual fear -lest she should catch a cold on overexposure. - -- Samuel Butler -% -Some men rob you with a six-gun -- others with a fountain pen. - -- Woodie Guthrie -% -Some men who fear that they are playing -second fiddle aren't in the band at all. -% -Some of my readers ask me what a "Serial Port" is. -The answer is: I don't know. -Is it some kind of wine you have with breakfast? -% -Some of the most interesting documents from Sweden's middle ages are the -old county laws (well, we never had counties but it's the nearest equivalent -I can find for "landskap"). These laws were written down sometime in the -13th century, but date back even down into Viking times. The oldest one is -the Vastgota law which clearly has pagan influences, thinly covered with some -Christian stuff. In this law, we find a page about "lekare", which is the -Old Norse word for a performing artist, actor/jester/musician etc. Here is -an approximate translation, where I have written "artist" as equivalent of -"lekare". - "If an artist is beaten, none shall pay fines for it. If an artist - is wounded, one such who goes with hurdie-gurdie or travels with - fiddle or drum, then the people shall take a wild heifer and bring - it out on the hillside. Then they shall shave off all hair from the - heifer's tail, and grease the tail. Then the artist shall be given - newly greased shoes. Then he shall take hold of the heifer's tail, - and a man shall strike it with a sharp whip. If he can hold her, he - shall have the animal. If he cannot hold her, he shall endure what - he received, shame and wounds." -% -Some of the things that live the longest -in peoples' memories never really happened. -% -Some of them want to use you, -Some of them want to be used by you, -...Everybody's looking for something. - -- Eurythmics, "Sweet Dreams (Are Made Of This)" -% -Some of us are becoming the men we wanted to marry. - -- Gloria Steinem -% -Some of you ... may have decided that, this year, you're going to -celebrate it the old-fashioned way, with your family sitting around -stringing cranberries and exchanging humble, handmade gifts, like on -"The Waltons". Well, you can forget it. If everybody pulled that kind -of subversive stunt, the economy would collapse overnight. The -government would have to intervene: it would form a cabinet-level -Department of Holiday Gift-Giving, which would spend billions and -billions of tax dollars to buy Barbie dolls and electronic games, which -it would drop on the populace from Air Force jets, killing and maiming -thousands. So, for the good of the nation, you should go along with -the Holiday Program. This means you should get a large sum of money -and go to a mall. - -- Dave Barry, "Christmas Shopping: A Survivor's Guide" -% -Some parts of the past must be preserved, -and some of the future prevented at all costs. -% -Some people call them "cars" or "trucks"; I call them "dimensional -transmogrifiers" because they change three-dimensional cats into -two-dimensional ones. - -- F. Frederick Skitty -% -Some people carve careers, others chisel them. -% -Some people cause happiness wherever -they go; others, whenever they go. -% -Some people claim that the UNIX learning curve is steep, -but at least you only have to climb it once. -% -Some people have a way about them that seems to say: "If I have -only one life to live, let me live it as a jerk." -% -Some people have no respect for age unless it's bottled. -% -Some people have parts that are so private -they themselves have no knowledge of them. -% -Some people in this department wouldn't recognize subtlety if it hit -them on the head. -% -Some people live life in the fast lane. -You're in oncoming traffic. -% -Some people manage by the book, even though they -don't know who wrote the book or even what book. -% -Some people need a good imaginary cure -for their painful imaginary ailment. -% -Some people only open up to tell you that they're closed. -% -Some people pray for more than they are willing to work for. -% -Some people say a front-engine car handles best. Some people say a -rear-engine car handles best. I say a rented car handles best. - -- P. J. O'Rourke -% -Some peoples mouths work faster than their brains. -They say things they haven't even thought of yet. -% -Some performers on television appear to be horrible people, but when -you finally get to know them in person, they turn out to be even -worse. - -- Avery -% -Some points to remember [about animals]: - -(1) Don't go to sleep under big animals, e.g., elephants, rhinoceri, - hippopotamuses; -(2) Don't put animals with sharp teeth or poisonous fangs down the - front of your clothes; -(3) Don't pat certain animals, e.g., crocodiles and scorpions or dogs - you have just kicked. - -- Mike Harding, "The Armchair Anarchist's Almanac" -% -Some primal termite knocked on wood. -And tasted it, and found it good. -And that is why your Cousin May -Fell through the parlor floor today. - -- Ogden Nash -% -Some programming languages manage to absorb change, but withstand -progress. - -- Epigrams in Programming, ACM SIGPLAN Sept. 1982 -% -Some rise by sin and some by virtue fall. -% -Some say the world will end in fire, -Some say in ice. -From what I've tasted of desire -I hold with those who favor fire. -But if it had to perish twice -I think I know enough of hate -To say that for destruction, ice -Is also great -And would suffice - -- Robert Frost, "Fire and Ice" -% -Some scholars are like donkeys, they merely carry a lot of books. - -- Folk saying -% -Some things have to be believed to be seen. -% -Somebody left the cork out of my lunch. - -- W. C. Fields -% -Somebody ought to cross ball point pens with coat hangers -so that the pens will multiply instead of disappear. -% -Somebody's moggy, by the side of the road, -Somebody's pussy, who forgot his highway code, -Somebody's favourite feline, who ran clean out of luck, -When he ran onto the road, and tried to argue with a truck. - -Yesterday he purred and played, in his pussy paradise, -Decapitating tweety birds, and masticating mice. -Now he's just six pounds of raw mince meat, -That don't smell very nice -- -He's nobody's moggy now. - -Oh you who love your pussy, -Be sure to keep him in. -Don't let him argue with a truck, If he tries to play -The truck is bound to win. On the road way -And upon the busy road, I'm afraid that will be that, -Don't let him play or frolic. There will be one last despairing -If you do, I'm warning you, "Meow!" -It could be cat-astrophic! And a sort of squelchy Splat! - And your pussy will be slightly dead, -He's nobody's moggy -- And very, very flat! -Just red and squashed and soggy -- -He's nobody's moggy now. - -- Eric Bogle, "Scraps of Paper" -% -Somebody's terminal is dropping bits. -I found a pile of them over in the corner. -% -Someday somebody has got to decide whether the -typewriter is the machine, or the person who operates it. -% -Someday, Weederman, we'll look back on all this and laugh... It will -probably be one of those deep, eerie ones that slowly builds to a -blood-curdling maniacal scream... but still it will be a laugh. - -- Mister Boffo -% -Someday we'll look back on this moment and plow into a parked car. - -- Evan Davis -% -Someday you'll get your big chance -- or have you already had it? -% -Someday your prints will come. - -- Kodak -% -Somehow I reached excess without ever noticing -when I was passing through satisfaction. - -- Ashleigh Brilliant -% -Somehow, the world always affects you more than you affect it. -% -Someone did a study of the three most-often-heard phrases in New York -City. One is "Hey, taxi." Two is, "What train do I take to get to -Bloomingdale's?" And three is, "Don't worry. It's just a flesh wound." - -- David Letterman -% -Someone is speaking well of you. -How unusual! -% -Someone is unenthusiastic about your work. -% -Someone whom you reject today, will reject you tomorrow. -% -Someone will try to honk your nose today. -% -Something better... - - 1 (obvious): Excuse me. Is that your nose or did a bus park on your face? - 2 (meteorological): Everybody take cover. She's going to blow. - 3 (fashionable): You know, you could de-emphasize your nose if you wore - something larger. Like ... Wyoming. - 4 (personal): Well, here we are. Just the three of us. - 5 (punctual): Alright gentlemen. Your nose was on time but you were fifteen - minutes late. - 6 (envious): Oooo, I wish I were you. Gosh. To be able to smell your - own ear. - 7 (naughty): Pardon me, Sir. Some of the ladies have asked if you wouldn't - mind putting that thing away. - 8 (philosophical): You know. It's not the size of a nose that's important. - It's what's in it that matters. - 9 (humorous): Laugh and the world laughs with you. Sneeze and its goodbye - Seattle. -10 (commercial): Hi, I'm Earl Schibe and I can paint that nose for $39.95. -11 (polite): Ah. Would you mind not bobbing your head. The orchestra keeps - changing tempo. -12 (melodic): Everybody! "He's got the whole world in his nose." - -- Steve Martin, "Roxanne" -% -Something unpleasant is coming when men are anxious to tell the truth. - -- Benjamin Disraeli -% -Something's rotten in the state of Denmark. - -- William Shakespeare -% -Sometime when you least expect it, Love will tap you on the shoulder... -and ask you to move out of the way because it still isn't your turn. - -- N. V. Plyter -% -Sometimes a cigar is just a cigar. - -- Sigmund Freud -% -Sometimes a man who deserves to be looked down upon because he is a -fool is despised only because he is a lawyer. - -- Montesquieu -% -Sometimes, at the end of the day, when I'm -smiling and shaking their hands, I want to kick them. - -- Richard M. Nixon -% -Sometimes even to live is an act of courage. - -- Seneca -% -Sometimes I feel like I'm fading away, -Looking at me, I got nothin' to say. -Don't make me angry with the things games that you play, -Either light up or leave me alone. -% -Sometimes I get the feeling that I went to a party on Perry Lane in 1962, and -the party spilled out of the house, and came down the street, and covered the -world. - -- Robert Stone -% -Sometimes I live in the country, -And sometimes I live in town. -And sometimes I have a great notion, -To jump in the river and drown. -% -Sometimes I simply feel that the whole -world is a cigarette and I'm the only ashtray. -% -Sometimes I wonder if I'm in my right mind. -Then it passes off and I'm as intelligent as ever. - -- Samuel Beckett, "Endgame" -% -Sometimes I worry about being a success in a mediocre world. - -- Lily Tomlin -% -Sometimes it happens. People just explode. Natural causes. - -- Repo Man -% -Sometimes love ain't nothing but a misunderstanding between two fools. -% -SOMETIMES THE BEAUTY OF THE WORLD is so overwhelming, I just want to throw -back my head and gargle. Just gargle and gargle and I don't care who hears -me because I am beautiful. - -- Jack Handey, "The New Mexican" (1988) -% -Sometimes the best medicine is to stop taking something. -% -Sometimes the light is all shining on me, -Other times I can hardly see. -Lately it occurs to me -What a long strange trip it's been. - -- The Grateful Dead, "American Beauty" -% -Sometimes, too long is too long. - -- Joe Crowe -% -Sometimes when I get up in the morning, I feel very peculiar. I feel -like I've just got to bite a cat! I feel like if I don't bite a cat -before sundown, I'll go crazy! But then I just take a deep breath and -forget about it. That's what is known as real maturity. - -- Snoopy -% -Sometimes, when I think of what that girl means -to me, it's all I can do to keep from telling her. - -- Andy Capp -% -Sometimes when you look into his eyes you get the feeling that someone -else is driving. - -- David Letterman -% -Sometimes you get an almost irresistible urge to go on living. -% -Somewhere, just out of sight, the unicorns are gathering. -% -Somewhere on this globe, every ten seconds, there is a -woman giving birth to a child. She must be found and stopped. - -- Sam Levenson -% -Somewhere, something incredible is waiting to be known. - -- Carl Sagan -% -Son, someday a man is going to walk up to you with a deck of cards on which -the seal is not yet broken. And he is going to offer to bet you that he can -make the Ace of Spades jump out of the deck and squirt cider in your ears. -But son, do not bet this man, for you will end up with an ear full of cider. - -- Sky Masterson's Father -% -Song Title of the Week: - "They're putting dimes in the hole in my head to see the change -in me." -% -Sooner or later you must pay for your sins. (Those who have already -paid may disregard this fortune). -% -Sorry. I forget what I was going to say. -% -Sorry. Nice try. -% -Sorry never means having you're say to love. -% -Sorry, no fortune this time. -% -Space is big. You just won't believe how vastly, hugely, mind-bogglingly -big it is. I mean, you may think it's a long way down the road to the -drug store, but that's just peanuts to space. - -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -Space is to place as eternity is to time. - -- Joseph Joubert -% -Space tells matter how to move and matter tells space how to curve. - -- Wheeler -% -Space: the final frontier. These are the voyages of the starship Enterprise. -Its five-year mission: to explore strange new worlds; to seek out new life -and new civilizations; to boldly go where no man has gone before. - -- Captain James T. Kirk -% -Spagmumps, n.: - Any of the millions of Styrofoam wads that accompany mail-order - items. - -- Rich Hall & Friends, "Sniglets" -% -Spare no expense to save money on this one. - -- Samuel Goldwyn -% -Spark's Sixth Rule for Managers: - If a subordinate asks you a pertinent question, look at him as -if he had lost his senses. When he looks down, paraphrase the question -back at him. -% -Speak roughly to your little boy, - And beat him when he sneezes: -He only does it to annoy - Because he knows it teases. - - Wow! wow! wow! - -I speak severely to my boy, - And beat him when he sneezes: -For he can thoroughly enjoy - The pepper when he pleases! - - Wow! wow! wow! - -- Lewis Carroll, "Alice's Adventures in Wonderland" (1865) -% -Speak roughly to your little VAX, - And boot it when it crashes; -It knows that one cannot relax - Because the paging thrashes! - - Wow! Wow! Wow! - -I speak severely to my VAX, - And boot it when it crashes; -In spite of all my favorite hacks - My jobs it always thrashes! - - Wow! Wow! Wow! -% -Speak softly and carry a +6 two-handed sword. -% -Speak softly and own a big, mean Doberman. - -- Dave Millman -% -"Speak, thou vast and venerable head," muttered Ahab, "which, though -ungarnished with a beard, yet here and there lookest hoary with mosses; speak, -mighty head, and tell us the secret thing that is in thee. Of all divers, -thou has dived the deepest. That head upon which the upper sun now gleams has -moved amid the world's foundations. Where unrecorded names and navies rust, -and untold hopes and anchors rot; where in her murderous hold this frigate -earth is ballasted with bones of millions of the drowned; there, in that awful -water-land, there was thy most familiar home. Thou hast been where bell or -diver never went; has slept by many a sailer's side, where sleepless mothers -would give their lives to lay them down. Thou saw'st the locked lovers when -leaping from their flaming ship; heart to heart they sank beneath the exulting -wave; true to each other, when heaven seemed false to them. Thou saw'st the -murdered mate when tossed by pirates from the midnight deck; for hours he fell -into the deeper midnight of the insatiate maw; and his murderers still sailed -on unharmed -- while swift lightnings shivered the neighboring ship that would -have borne a righteous husband to outstretched, longing arms. O head! thou has -seen enough to split the planets and make an infidel of Abraham, and not one -syllable is thine!" - -- H. Melville, "Moby Dick" -% -Speaking as someone who has delved into the intricacies of PL/I, I am sure -that only Real Men could have written such a machine-hogging, cycle-grabbing, -all-encompassing monster. Allocate an array and free the middle third? -Sure! Why not? Multiply a character string times a bit string and assign the -result to a float decimal? Go ahead! Free a controlled variable procedure -parameter and reallocate it before passing it back? Overlay three different -types of variable on the same memory location? Anything you say! Write a -recursive macro? Well, no, but Real Men use rescan. How could a language -so obviously designed and written by Real Men not be intended for Real Man use? -% -Speaking of Godzilla and other things that convey horror: - - With a purposeful grimace and a Mongo-like flair - He throws the spinning disk drives in the air! - And he picks up a Vax and he throws it back down - As he wades through the lab making terrible sounds! - Helpless users with projects due - Scream "My God!" as he stomps on the tape drives, too! - - Oh, no! He says Unix runs too slow! Go, go, DECzilla! - Oh, yes! He's gonna bring up VMS! Go, go, DECzilla!" - -* VMS is a trademark of Digital Equipment Corporation -* DECzilla is a trademark of Hollow Chocolate Bunnies of Death, Inc. - -- Curtis Jackson -% -Speaking of love, one problem that recurs more and more frequently these -days, in books and plays and movies, is the inability of people to communicate -with the people they love; Husbands and wives who can't communicate, children -who can't communicate with their parents, and so on. And the characters in -these books and plays and so on (and in real life, I might add) spend hours -bemoaning the fact that they can't communicate. I feel that if a person can't -communicate, the very least he can do is to shut up! - -- Tom Lehrer, "That Was the Year that Was" -% -Speaking of purchasing a dog, never buy a watchdog that's -on sale. After all, everyone knows a bargain dog never bites! -% -Special tonight, the best toot in town at prices you won't believe!! -Also, the finest dope, brought all the way from Columbia by spirited -young adventurers. All available tonight, as usual, in the graduate -students bullpen from 11: pm on, usual terms and conditions. -Faculty members especially welcome. -% -Speed is subsittute fo accurancy. -% -Speed upon county roads will be limited to ten miles an hour unless the -motorist sees a bailiff who does not appear to have had a drink in 30 days, -when the driver will be permitted to make what he can. - -- Proposed legislation, Illinois State Legislature, May, 1907 -% -Speer's 1st Law of Proofreading: - The visibility of an error is inversely proportional to the -number of times you have looked at it. -% -Spelling is a lossed art. -% -Spence's Admonition: - Never stow away on a kamikaze plane. -% -Spend extra time on hobby. Get plenty of rolling papers. -% -SPINSTER: - A bachelor's wife. -% -Spirtle, n.: - The fine stream from a grapefruit that always lands right in - your eye. - -- Rich Hall & Friends, "Sniglets" -% -Spock: The odds of surviving another -attack are 13562190123 to 1, Captain. -% -Spock: We suffered 23 casualties in that attack, Captain. -% -Spouse, n.: - Someone who'll stand by you through all the trouble you - wouldn't have had if you'd stayed single. -% -Spring is here, spring is here, -Life is skittles and life is beer. -% -Squatcho, n.: - The button at the top of a baseball cap. - -- Rich Hall & Friends, "Sniglets" -% -Squirrels eating squirrels, my God, that's sick. -% -St. Patrick was a gentleman -who through strategy and stealth -drove all the snakes from Ireland. -Here's a toasting to his health -- -but not too many toastings -lest you lose yourself and then -forget the good St. Patrick -and see all those snakes again. -% -Stability itself is nothing else than a more sluggish motion. -% -Staff meeting in the conference room in 3 minutes. -% -Stalin was dying, and summoned Khruschev to his bedside. Wheezing his last -words with difficulty, Stalin tells Khruschev, "The reins of the country are -now in your hands. But before I go, I want to give you some advice." - "Yes, yes, what is it?" says Khruschev, impatiently. Reaching under -his pillow, Stalin produced two envelopes labeled #1 and #2. - "Take these letters," he tells Khruschev. "Keep them safely -- don't -open them. Only if the country is in turmoil and things aren't going well, -open the first one. That'll give you some advice on what to do. And, if -after that, if things start getting REALLY bad, open the second one." And -with a gasp Stalin breathed his last. - Well, within a few years Khruschev started having problems -- -unemployment increased, crops failed, people became restless. He decided it -was time to open the first letter. All it said was: "Blame everything on me!" -So Khruschev launched a massive deStalinization campaign, and blamed Stalin -for all the excesses and purges and ills of the present system. - But things continued on the downslide, and, finally, after much -deliberation, Khruschev opened the second letter. - All it said was: "Write two letters." -% -Stamp out organized crime!! Abolish the IRS. -% -Stamp out philately. -% -STANDARDS: - The principles we use to reject other people's code. -% -Standards are different for all things, so the standard set by man is by -no means the only "certain" standard. If you mistake what is relative for -something certain, you have strayed far from the ultimate truth. - -- Chuang Tzu -% -Standing on head makes smile of frown, but rest of face also upside down. -% -Stanford women are responsible for the success of many Stanford men: -they give them "just one more reason" to stay in and study every night. -% -Star Wars is adolescent nonsense; Close Encounters is obscurantist drivel; -Star Trek can turn your brains to puree of bat guano; and the greatest -science fiction series of all time is Doctor Who! And I'll take you all -on, one-by-one or all in a bunch to back it up! - -- Harlan Ellison -% -Start every day off with a smile and get it over with. - -- W. C. Fields -% -Start the day with a smile. -After that you can be your nasty old self again. -% -State license plates we'd like to see: - - NEVADA MASSACHUSETTS - LVME 10DR OW-A CAH -LAND OF 10,00 ELVIS IMPERSONATORS THE GOOFY ACCENT STATE - - HAWAII WISCONSIN - L-O HA CHEDDAR -FRUITY UMBRELLA COCKTAIL WONDERLAND EAT CHEESE OR DIE -% -State license plates we'd like to see: - - ALABAMA ARIZONA - IC1 NOW 120 F -THE UFO SIGHTING STATE THE HEAT PROSTRATION STATE - - CONNECTICUT MISSISSIPPI - 5:36 EXP 4I4S2PS -WHERE THE SMART NY WORK FORCE LIVES THE MOST OFTEN MISSPELLED STATE - - TEXAS FLORIDA - 1-2-3 HIKE ZON KED -PLAY FOOTBALL OR DIE AMERICA'S DRUG DEALER -% -State license plates we'd like to see: - - MICHIGAN CALIFORNIA - 4-GET 74-77 EGO-MN-E-X -EMBARRASSED HOME STATE OF GERALD FORD THE SERIAL KILLER STATE - - NORTH CAROLINA NEW JERSEY - WL-GOLLY ARG GGH -HOME OF GOMER, GOOBER AND JESSE HELMS FIRST IN TOXIC WASTE - - KANSAS WASHINGTON DC - TOTO -2 $10000000 ETC -THE NOT MUCH SINCE THE WIZARD OF OZ WASTING YOUR MONEY SINCE 1810 - MOVIE STATE -% -STATISTICS: - A system for expressing your political - prejudices in convincing scientific guise. -% -Statistics are no substitute for judgment. - -- Henry Clay -% -Statistics means never having to say you're certain. -% -Stay away from flying saucers today. -% -Stay away from hurricanes for a while. -% -Stay the curse. -% -Stay together, drag each other down. -% -Stayed in bed all morning just to pass the time, -There's something wrong here, there can be no more denying, -One of us is changing, or maybe we just stopped trying, - -And it's too late, baby, now, it's too late, -Though we really did try to make it, -Something inside has died and I can't hide and I just can't fake it... - -It used to be so easy living here with you, -You were light and breezy and I knew just what to do -Now you look so unhappy and I feel like a fool. - -There'll be good times again for me and you, -But we just can't stay together, don't you feel it too? -But I'm glad for what we had and that I once loved you... - -But it's too late baby... -It's too late, now darling, it's too late... - -- Carol King, "Tapestry" -% -Steady movement is more important than speed, much of the time. So -long as there is a regular progression of stimuli to get your mental -hooks into, there is room for lateral movement. Once this begins, -its rate is a matter of discretion. - -- Corwin, "Prince of Amber" -% -Stealing a rhinoceros should not be attempted lightly. -% -Steckel's Rule to Success: - Good enough is never good enough. -% -Steele's Plagiarism of Somebody's Philosophy: - Everybody should believe in something -- - I believe I'll have another drink. -% -Steinbach's Guideline for Systems Programming: - Never test for an error condition you don't know how to -handle. -% -Stellar rays prove fibbing never pays. -Embezzlement is another matter. -% -Stenderup's Law: - The sooner you fall behind, the more time you will have to catch up. -% -Step back, unbelievers! -Or the rain will never come. -Somebody keep the fire burning, someone come and beat the drum. -You may think I'm crazy, you may think that I'm insane, -But I swear to you, before this day is out, - you folks are gonna see some rain! -% -Still a few bugs in the system... Someday I have to tell you about Uncle -Nahum from Maine, who spent years trying to cross a jellyfish with a shad -so he could breed boneless shad. His experiment backfired too, and he -wound up with bony jellyfish... which was hardly worth the trouble. There's -very little call for those up there. - -- Allucquere R. "Sandy" Stone -% -Still looking for the glorious results of my misspent youth. -Say, do you have a map to the next joint? -% -Stinginess with privileges is kindness in disguise. - -- Guide to VAX/VMS Security, Sep. 1984 -% -Stock's Observation: - You no sooner get your head above water - but what someone pulls your flippers off. -% -Stone's Law: - One man's "simple" is another man's "huh?" -% -Stop! There was first a game of blindman's buff. Of course there was. -And I no more believe Topper was really blind than I believe he had eyes -in his boots. My opinion is, that it was a done thing between him and -Scrooge's nephew; and that the Ghost of Christmas Present knew it. The -way he went after that plump sister in the lace tucker, was an outrage -on the credulity of human nature. -% -Stop me, before I kill again! -% -Stop searching. Happiness is right next to you. -Now, if they'd only take a bath... -% -Stop searching forever. Happiness is unattainable. -% -Strange things are done to be number one -In selling the computer The Druids were entrepreneurs, -IBM has their strategem And they built a granite box -Which steadily grows acuter, It tracked the moon, warned of monsoons, -And Honeywell competes like Hell, And forecast the equinox -But the story's missing link Their price was right, their future -Is the system old at Stonemenge sold bright, -By the firm of Druids, Inc. The prototype was sold; - From Stonehenge site their bits and byte - Would ship for Celtic gold. -The movers came to crate the frame; -It weighed a million ton! -The traffic folk thought it a joke The man spoke true, and thus to you -(the wagon wheels just spun); A warning from the ages; -"They'll nay sell that," the foreman Your stock will slip if you can't ship - spat, What's in your brochure's pages. -"Just leave the wild weeds grow; See if it sells without the bells -"It's Druid-kind, over-designed, And strings that ring and quiver; -"And belly up they'll go." Druid repute went down the chute - Because they couldn't deliver. - -- Edward C. McManus, "The Computer at Stonehenge" -% -STRATEGY: - A comprehensive plan of inaction. -% -Strategy: - A long-range plan whose merit cannot be evaluated until sometime - after those creating it have left the organization. -% -Straw? No, too stupid a fad. I put soot on warts. -% -Stress has been pinpointed as a major cause of illness. To avoid overload -and burnout, keep stress out of your life. Give it to others instead. Learn -the "Gaslight" treatment, the "Are you talking to me?" technique, and the -"Do you feel okay? You look pale." approach. Start with negotiation and -implication. Advance to manipulation and humiliation. Above all, relax -and have a nice day. -% -Stuckness shouldn't be avoided. It's the psychic predecessor of all -real understanding. An egoless acceptance of stuckness is a key to an -understanding of all Quality, in mechanical work as in other endeavors. - -- Robert Pirsig, "Zen and the Art of Motorcycle Maintenance" -% -Stult's Report: - Our problems are mostly behind us. - What we have to do now is fight the solutions. -% -Stupid, n.: - Losing $25 on the game and $25 on the instant replay. -% -Stupidity got us into this mess -- why can't it get us out? -% -Stupidity is its own reward. -% -Sturgeon's Law: - 90% of everything is crud. -% -Style may not be the answer, but at least it's a workable alternative. -% -Suaviter in modo, fortiter in re. -Se non e vero, e ben trovato. -% -Substitute "damn" every time you're inclined to write "very"; your -editor will delete it and the writing will be just as it should be. - -- Mark Twain -% -Subtlety is the art of saying what you think and getting out of the -way before it is understood. -% -Suburbia is where the developer bulldozes out the trees, then names -the streets after them. - -- Bill Vaughn -% -Success is a journey, not a destination. -% -Success is getting what you want; happiness is wanting what you get. -% -Success is in the minds of Fools. - -- William Wrenshaw, 1578 -% -Success is relative: It is what we can make of the mess we have -made of things. - -- T. S. Eliot, "The Family Reunion" -% -Success is something I will dress for when I get there, and not until. -% -Success is the sole earthly judge of right and wrong. - -- Adolf Hitler, "Mein Kampf" -% -Succumb to natural tendencies. Be hateful and boring. -% -Such a fine first dream! -But they laughed at me; they said -I had made it up. -% -Such a foolish notion, that war is called devotion, -when the greatest warriors are the ones who stand for peace. -% -Such efforts are almost always slow, laborious, political, -petty, boring, ponderous, thankless, and of the utmost criticality. - -- Leonard Kleinrock, on standards efforts -% -Such evil deeds could religion prompt. - -- Titus Lucretius Carus -% -Sudden Death Dating: - -Quote, female: - Am I worried about taking his last name? Forget it, - at this point I'll take his first name, too. -% -Suddenly, Professor Liebowitz realizes he has come to the seminar -without his duck ... -% -Suffering alone exists, none who suffer; -The deed there is, but no doer thereof; -Nirvana is, but no one is seeking it; -The Path there is, but none who travel it. - -- "Buddhist Symbolism", Symbols and Values -% -Suggest you just sit there and wait till life gets easier. -% -Suicide is simply a case of mistaken identity. -% -Suicide is the sincerest form of self-criticism. - -- Donald Kaul -% -Sum quod eris. -% -Sun in the night, everyone is together, -Ascending into the heavens, life is forever. - -- Brand X, "Moroccan Roll/Sun in the Night" -% -SUN Microsystems: - The Network IS the Load Average. -% -(Sung to the tune of "The Impossible Dream" from MAN OF LA MANCHA) - - To code the impossible code, - To bring up a virgin machine, - To pop out of endless recursion, - To grok what appears on the screen, - - To right the unrightable bug, - To endlessly twiddle and thrash, - To mount the unmountable magtape, - To stop the unstoppable crash! -% -SUNSET: - Pronounced atmospheric scattering of shorter wavelengths, - resulting in selective transmission below 650 nanometers with - progressively reducing solar elevation. -% -Superstition, idolatry, and hypocrisy -have ample wages, but truth goes a-begging. - -- Martin Luther -% -Superstitions typically involve seeing order where in fact there is -none, and denial amounts to rejecting evidence of regularities, -sometimes even ones that are staring us in the face. - -- Murray Gell-Mann, "Quark and the Jaguar" -% -Supervisor: Do you think you understand the basic ideas of Quantum Mechanics? -Supervisee: Ah! Well, what do we mean by "to understand" in the context of - Quantum Mechanics? -Supervisor: You mean "No", don't you? -Supervisee: Yes. - -- Overheard at a supervision -% -Support bacteria -- it's the only culture some people have! -% -Support Bingo, keep Grandma off the streets. -% -Support mental health or I'LL KILL YOU!!!! -% -Support the American Kidney Foundation. -Don't wear your motorcycle helmet. -% -Support the Girl Scouts! - (Today's Brownie is tomorrow's Cookie!) -% -Support wildlife -- vote for an orgy. -% -Support your local church or synagogue. -Worship at Bank of America. -% -Support your local police force -- steal!! -% -Support your local Search and Rescue unit -- get lost. -% -Support your right to arm bears!! -% -Support your right to bare arms! - -- A message from the National Short-Sleeved Shirt Association -% -Suppose for a moment that the automobile industry had developed at the same -rate as computers and over the same period: how much cheaper and more -efficient would the current models be? If you have not already heard the -analogy, the answer is shattering. Today you would be able to buy a -Rolls-Royce for $2.75, it would do three million miles to the gallon, and -it would deliver enough power to drive the Queen Elizabeth II. And if you -were interested in miniaturization, you could place half a dozen of them on -a pinhead. - -- Christopher Evans -% -Sure he's sharp as a razor ... he's a two-dimensional pinhead! -% -Sure, Reagan has promised to take senility tests. -But what if he forgets? -% -Sure there are dishonest men in local government. But there are dishonest -men in national government too. - -- Richard M. Nixon -% -Surly to bed, surly to rise, makes you about average. -% -Surprise! You are the lucky winner of random I.R.S Audit! -Just type in your name and social security number. -Please remember that leaving the room is punishable under law: - -Name # - - -% -Surprise due today. Also the rent. -% -Surprise your boss. Get to work on time. -% -Sushi, n.: - When that-which-may-still-be-alive is put on top of rice and - strapped on with electrical tape. -% -Sushido, n.: - The way of the tuna. -% -Suspicion always haunts the guilty mind. - -- William Shakespeare -% -Swahili, n.: - The language used by the National Enquirer to print their -retractions. - -- Johnny Hart -% -Swap read error. You lose your mind. -% -SWEATER: - A garment worn by a child when their mother feels chilly. -% -Sweater, n.: - A garment worn by a child when its mother feels chilly. -% -Sweet April showers do spring May flowers. - -- Thomas Tusser -% -Sweet sixteen is beautiful Bess, -And her voice is changing -- from "No" to "Yes". -% -Swerve me? The path to my fixed purpose is laid with iron rails, -whereon my soul is grooved to run. Over unsounded gorges, through -the rifled hearts of mountains, under torrents' beds, unerringly -I rush! - -- Captain Ahab, "Moby Dick" -% -Swipple's Rule of Order: - He who shouts the loudest has the floor. -% -Symbolic representation of quantitative entities is doomed to its rightful -place of minor importance in a world where flowers and beautiful women abound. - -- Albert Einstein -% -Symptom: Drinking fails to give taste and satisfaction, beer is - unusually pale and clear. -Problem: Glass empty. -Action Required: Find someone who will buy you another beer. - -Symptom: Drinking fails to give taste and satisfaction, - and the front of your shirt is wet. -Fault: Mouth not open when drinking or glass applied to - wrong part of face. -Action Required: Buy another beer and practice in front of mirror. - Drink as many as needed to perfect drinking technique. - - -- Bar Troubleshooting -% -Symptom: Everything has gone dark. -Fault: The Bar is closing. -Action Required: Panic. - -Symptom: You awaken to find your bed hard, cold and wet. - You cannot see the bathroom light. -Fault: You have spent the night in the gutter. -Action Required: Check your watch to see if bars are open yet. If not, - treat yourself to a lie-in. - - -- Bar Troubleshooting -% -Symptom: Feet cold and wet, glass empty. -Fault: Glass being held at incorrect angle. -Action Required: Turn glass other way up so that open end points - toward ceiling. - -Symptom: Feet warm and wet. -Fault: Improper bladder control. -Action Required: Go stand next to nearest dog. After a while complain - to the owner about its lack of house training and - demand a beer as compensation. - - -- Bar Troubleshooting -% -Symptom: Floor blurred. -Fault: You are looking through bottom of empty glass. -Action Required: Find someone who will buy you another beer. - -Symptom: Floor moving. -Fault: You are being carried out. -Action Required: Find out if you are taken to another bar. If not, - complain loudly that you are being kidnaped. - - -- Bar Troubleshooting -% -Symptom: Floor swaying. -Fault: Excessive air turbulence, perhaps due to air-hockey - game in progress. -Action Required: Insert broom handle down back of jacket. - -Symptom: Everything has gone dim, strange taste of peanuts - and pretzels or cigarette butts in mouth. -Fault: You have fallen forward. -Action Required: See above. - -Symptom: Opposite wall covered with acoustic tile and several - fluorescent light strips. -Fault: You have fallen over backward. -Action Required: If your glass is full and no one is standing on your - drinking arm, stay put. If not, get someone to help - you get up, lash yourself to bar. - - -- Bar Troubleshooting -% -Syntactic sugar causes cancer of the semicolon. - -- Epigrams in Programming, ACM SIGPLAN Sept. 1982 -% -System checkpoint complete. -% -System going down at 1:45 this afternoon for disk crashing. -% -System going down at 5 this afternoon to install scheduler bug. -% -System going down in 5 minutes. -% -System restarting, wait... -% -System/3! System/3! -See how it runs! See how it runs! - Its monitor loses so totally! - It runs all its programs in RPG! - It's made by our favorite monopoly! -System/3! -% -SYSTEM-INDEPENDENT: - Works equally poorly on all systems. -% -Systems have sub-systems and sub-systems have sub-systems and so on ad -infinitum -- which is why we're always starting over. - -- Epigrams in Programming, ACM SIGPLAN Sept. 1982 -% -Systems programmer: - A person in sandals who has been in the elevator with the senior - vice president and is ultimately responsible for a phone call you - are to receive from your boss. -% -Systems programmers are the high priests of a low cult. - -- R. S. Barton -% -T: One big monster, he called TROLL. - He don't rock, and he don't roll; - Drink no wine, and smoke no stogies. - He just Love To Eat Them Roguies. - -- The Roguelet's ABC -% -TACKY: - Serving grape Kool-Aid at religious functions. -% -Tact consists in knowing how far to go in going too far. - -- Jean Cocteau -% -Tact in audacity is knowing how far you can go without going too far. - -- Jean Cocteau -% -Tact is the ability to tell a man he has -an open mind when he has a hole in his head. -% -Tact is the art of making a point without making an enemy. -% -Tact, n.: - The unsaid part of what you're thinking. -% -Take a lesson from the whale; the only time -he gets speared is when he raises to spout. -% -Take an astronaut to launch. -% -Take care of the luxuries and the -necessities will take care of themselves. - -- L. Long -% -Take Care of the Molehills, and the Mountains Will Take Care of Themselves. - -- Motto of the Federal Civil Service -% -Take everything in stride. -Trample anyone who gets in your way. -% -TAKE FORCEFUL ACTION: - Do something that should have been done a long time ago. -% -Take heart amid the deepening gloom that your dog is finally getting -enough cheese. - -- National Lampoon, "Deteriorata" -% -Take it easy, we're in a hurry. -% -Take me drunk, -I'm home again! -% -Take my word for it, the silliest woman can manage a clever man, -but it needs a very clever woman to manage a fool. - -- Kipling -% -Take time to reflect on all the things you have, not as a result of your -merit or hard work or because God or chance or the efforts of other people -have given them to you. -% -Take what you can use and let the rest go by. - -- Ken Kesey -% -Take your dying with some seriousness, however. -Laughing on the way to your execution is not generally understood -by less-advanced life-forms, and they'll call you crazy. - -- "Messiah's Handbook: Reminders for the Advanced Soul" -% -Take your Senator to lunch this week. -% -Take your work seriously but never take yourself seriously; and do not -take what happens either to yourself or your work seriously. - -- Booth Tarkington -% -Taking drugs in the 60's, I tried to reach Nirvana, but all I ever -got were re-runs of The Mickey Mouse Club. - -- Rev. Jim -% -Talk is cheap because supply always exceeds demand. -% -Talk sense to a fool and he calls you foolish. - -- Euripides -% -Talkers are no good doers. - -- William Shakespeare, "Henry VI" -% -Talking about music is like dancing about architecture. - -- Laurie Anderson -% -Talking much about oneself can also be a means to conceal oneself. - -- Friedrich Nietzsche -% -Tallulah Bankhead barged down the -Nile last night as Cleopatra and sank. - -- John Mason Brown, drama critic -% -Tan me hide when I'm dead, Fred, -Tan me hide when I'm dead. -So we tanned his hide when he died, Clyde, -It's hanging there on the shed. - -All together now... - Tie me kangaroo down, sport, - Tie me kangaroo down. - Tie me kangaroo down, sport, - Tie me kangaroo down. -% -Tart words make no friends; a spoonful of honey -will catch more flies than a gallon of vinegar. - -- Benjamin Franklin -% -TAURUS (Apr 20 - May 20) - You are practical and persistent. You have a dogged determination - and work like hell. Most people think you are stubborn and bull - headed. You are a Communist. -% -TAURUS (Apr. 20 to May 20) - Let your self-confidence and determination shine, and people will - find you boorish and headstrong. Travel, promotion, and romance - highlighted, if you live long enough. Don't take any wooden nickels. -% -TAURUS (Apr.20 - May 20) - Take advantage of this opportunity to get a little extra sleep, - because you're going to miss the bus again today anyway. You will - decide to lose weight today, just like yesterday. -% -TAX OFFICE: - Den of inequity. -% -Tax reform means "Don't tax you, don't -tax me, tax that fellow behind the tree." - -- Russell Long -% -Taxes are going up so fast, the government is likely to price itself -out of the market. -% -Taxes are not levied for the benefit of the taxed. -% -Taxes, n.: - Of life's two certainties, the only one for which you can get - an extension. -% -TCP/IP Slang Glossary, #1: - -Gong, n: Medieval term for privvy, or what passed for them in that era. -Today used whimsically to describe the aftermath of a bogon attack. Think -of our community as the Galapagos of the English language. - -Vogons may read you bad poetry, but bogons make you study obsolete RFCs. - -- Dave Mills -% -Teach children to be polite and courteous in the home, and, -when they grow up, they won't be able to edge a car onto a freeway. -% -Teachers have class. -% -TEAMWORK: - Having someone to blame. -% -Teamwork is essential -- it allows you to blame someone else. -% -Technicality, n.: - In an English court a man named Home was tried for slander in - having accused a neighbor of murder. His exact words were: "Sir - Thomas Holt hath taken a cleaver and stricken his cook upon the - head, so that one side of his head fell on one shoulder and the - other side upon the other shoulder." The defendant was - acquitted by instruction of the court, the learned judges - holding that the words did not charge murder, for they did not - affirm the death of the cook, that being only an inference. - -- Ambrose Bierce, "The Devil's Dictionary" -% -"Technique?" said the programmer turning from his terminal, "What I follow -is Tao -- beyond all technique! When I first began to program I would see -before me the whole problem in one mass. After three years I no longer saw -this mass. Instead, I used subroutines. But now I see nothing. My whole -being exists in a formless void. My senses are idle. My spirit, free to -work without plan, follows its own instinct. In short, my program writes -itself. True, sometimes there are difficult problems. I see them coming, I -slow down, I watch silently. Then I change a single line of code and the -difficulties vanish like puffs of idle smoke. I then compile the program. -I sit still and let the joy of the work fill my being. I close my eyes for -a moment and then log off." -% -Technological progress has merely provided us -with more efficient means for going backwards. - -- Aldous Huxley -% -Teeth for meat are in the mouth -- -Teeth for humans are in the soul. -A strong body defeats one, -A strong soul conquers many. - -- Chinggis (Genghis) Khan -% -Tehee quod she, and clapte the wyndow to. - -- Geoffrey Chaucer -% -Telephone books are like dictionaries -- if you know the answer before -you look it up, you can eventually reaffirm what you thought you knew -but weren't sure. But if you're searching for something you don't -already know, your fingers could walk themselves to death. - -- Erma Bombeck -% -Telephone, n.: - An invention of the devil which abrogates some of the advantages of - making a disagreeable person keep his distance. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Telepression, n.: - The deep-seated guilt which stems from knowing that you did not - try hard enough to look up the number on your own and instead - put the burden on the directory assistant. - -- Rich Hall & Friends, "Sniglets" -% -Television -- a medium. So called because it is neither rare nor well done. - -- Ernie Kovacs -% -Television -- the longest amateur night in history. - -- Robert Carson -% -Television has brought back murder into the home -- where it belongs. - -- Alfred Hitchcock -% -Television has proved that people will look at anything rather than -each other. - -- Ann Landers -% -Television is a medium because anything well done is rare. - -- attributed to both Fred Allen and Ernie Kovacs -% -Television is now so desperately hungry for material -that it is scraping the top of the barrel. - -- Gore Vidal -% -Television only proves that people will look at anything -- -rather than each other. -% -Tell a man there are 300 billion stars in the universe and he'll -believe you. Tell him a bench has wet paint on it and he'll have -to touch to be sure. -% -Tell me, O Octopus, I begs, -Is those things arms, or is they legs? -I marvel at thee, Octopus; -If I were thou, I'd call me us. - -- Ogden Nash -% -Tell me what to think!!! -% -Tell me why the stars do shine, -Tell me why the ivy twines, -Tell me why the sky's so blue, -And I will tell you just why I love you. - - Nuclear fusion makes stars to shine, - Phototropism makes ivy twine, - Rayleigh scattering makes sky so blue, - Sexual hormones are why I love you. -% -Telling the truth to people who misunderstand you is generally -promoting a falsehood, isn't it? - -- A. Hope -% -Tempt me with a spoon! -% -Tempt not a desperate man. - -- William Shakespeare, "Romeo and Juliet" -% -Ten of the meanest cons in the state pen met in the corner of the yard to -shoot some craps. The stakes were enormous, the tension palpable. - When his turn came to shoot, Dutsky nervously plunked down his -entire wad, shook the dice and rolled. A smile crossed his face as a -seven showed up, but it quickly changed to horror as third die slipped out -of his sleeve and fell to the ground with the two others. No one said a -word. Finally, Killer Lucci picked up the third die, put it in his pocket -and handed the others to Dutsky. - "Roll 'em," Lucci said. "Your point is thirteen." -% -Ten persons who speak make more noise than ten thousand who are silent. - -- Napoleon I -% -Ten years of rejection slips is nature's -way of telling you to stop writing. - -- R. Geis -% -Terence, this is stupid stuff: -You eat your victuals fast enough; -There can't be much amiss, 'tis clear, -To see the rate you drink your beer. -But oh, good Lord, the verse you make, -It gives a chap the belly-ache. -The cow, the old cow, she is dead; -It sleeps well the horned head: -We poor lads, 'tis our turn now -To hear such tunes as killed the cow. -Pretty friendship 'tis to rhyme -Your friends to death before their time. -Moping, melancholy mad: -Come, pipe a tune to dance to, lad. - -- A. E. Housman -% -Term, holidays, term, holidays, till we leave -school, and then work, work, work till we die. - -- C. S. Lewis -% -Termiter's argument that God is His own grandmother generated a surprising -amount of controversy among Church leaders, who on the one hand considered -the argument unsupported by scripture but on the other hand were unwilling -to risk offending God's grandmother. - -- Len Cool, "American Pie" -% -Tertullian was born in Carthage somewhere about 160 A.D. He was a -pagan, and he abandoned himself to the lascivious life of his city until -about his 35th year, when he became a Christian. [...] To him is -ascribed the sublime confession: Credo quia absurdum est (I believe -because it is absurd). This does not altogether accord with historical -fact, for he merely said: "And the Son of God died, which is immediately -credible because it is absurd. And buried he rose again, which is -certain because it is impossible." Thanks to the acuteness of his mind, -he saw through the poverty of philosophical and Gnostic knowledge, and -contemptuously rejected it. - -- Carl G. Jung, "Psychological Types" - [Tertullian was one of the founders of the Catholic - Church. Ed.] -% -Test for paraquat: - Take amount of grass used in one joint, and wash in 5 cc's - of water, agitating gently for 15 minutes. Strain out leaves, - leaving a brownish-yellow solution. Add 100 mg each of sodium - bicarbonate and sodium dithionite. If paraquat is present, - the solution will turn blue-green. -% -Testing can show the presence of bugs, but not their absence. - -- Edsger W. Dijkstra -% -Test-tube babies shouldn't throw stones. -% -TEUTONIC: - Not enough gin. -% -TEX is potentially the most significant invention in typesetting in this -century. It introduces a standard language for computer typography, and in -terms of importance could rank near the introduction of the Gutenberg press. - -- Gordon Bell -% -Texas A&M football coach Jackie Sherrill went to the office of the Dean -of Academics because he was concerned about his players' mental abilities. -"My players are just too stupid for me to deal with them", he told the -unbelieving dean. At this point, one of his players happened to enter -the dean's office. "Let me show you what I mean", said Sherrill, and he -told the player to run over to his office to see if he was in. "OK, Coach", -the player replied, and was off. "See what I mean?" Sherrill asked. -"Yeah", replied the dean. "He could have just picked up this phone and -called you from here." -% -Texas is Hell on woman and horses. - -- Wayne Oakes -% -Texas law forbids anyone to have a pair of pliers in his possession. -% -Text processing has made it possible to right-justify any idea, even -one which cannot be justified on any other grounds. - -- J. Finnegan, USC -% -Thank God I've always avoided persecuting my enemies. - -- Adolf Hitler -% -Thank goodness modern convenience is a thing of the remote future. - -- Pogo, by Walt Kelly -% -Thank you for observing all safety precautions. -% -That all men should be brothers is the dream of people who have no brothers. - -- Charles Chincholles, "Pensees de tout le monde" -% -That boy's about as sharp as a pound of wet liver. - -- Foghorn Leghorn -% -That does not compute. -% -...that FC loop thing sucks. -So I decided to stick to my good old philosophy: "if it has tits, -wheels or FC loops it will give you problem!" - -- storage engineer on the virtues of FC-AL -% -That feeling just came over me. - -- Albert DeSalvo, the "Boston Strangler" -% -That government is best which governs least. - -- Henry David Thoreau, "Civil Disobedience" -% -That is the true season of love, when we believe that we alone can love, -that no one could have loved so before us, and that no one will love -in the same way as us. - -- Johann Wolfgang von Goethe -% -That money talks, -I'll not deny, -I heard it once, -It said "Good-bye. - -- Richard Armour -% -That must be wonderful: I don't understand it at all. - -- Moliere -% -That secret you've been guarding, isn't. -% -That segment of the community with which one has the greatest -sympathy as a liberal, inevitably turns out to be one of the most -narrow-minded and bigoted segments of the community. -% -That, that is, is. -That, that is not, is not. -That, that is, is not that, that is not. -That, that is not, is not that, that is. -% -...that the notions of "hardware", and "software" should be extended by -the notion of LIVEWARE - being that which produces software for use on -hardware. This produces an obvious extension to the concept of MONITORS. -A liveware monitor is a person dedicated to the task of ensuring that the -liveware does not interfere with the real-time processes, invoking the -REAL-TIME EXECUTIONER to delete liveware that adversely affects ... - -- Linden and Wihelminalaan -% -That which is not good for the swarm, neither is it good for the bee. -% -That woman speaks eight languages and can't say "no" in any of them. - -- Dorothy Parker -% -That Xanthippe's husband should have become so great a philosopher is -remarkable. Amid all the scolding, to be able to think! But he could not -write: that was impossible. Socrates has not left us a single book. - -- Heine -% -That's always the way when you discover -something new; everyone thinks you're crazy. - -- Evelyn E. Smith -% -That's life. - What's life? -A magazine. - How much does it cost? -Two-fifty. - I only have a dollar. -That's life. -% -That's life for you, said McDunn. Someone always waiting for someone -who never comes home. Always someone loving something more than that -thing loves them. And after awhile you want to destroy whatever that -thing is, so it can't hurt you no more. - -- Ray Bradbury, "The Fog Horn" -% -"That's no answer," Job said, "And for someone who's supposed to be -omnipotent, let me tell you `tabernacle' has only one l." - -- Woody Allen, "Without Feathers" -% -That's no moon... - -- Obi-wan Kenobi -% -That's odd. That's very odd. -Wouldn't you say that's very odd? -% -That's one small step for a man; one giant leap for mankind. - -- Neil Armstrong -% -That's the most fun I've had without laughing. - -- Woody Allen, on sex -% -That's the thing about people who think they hate computers. What they -really hate is lousy programmers. - -- Larry Niven and Jerry Pournelle in "Oath of Fealty" -% -That's the true harbinger of spring, not crocuses or swallows -returning to Capistrano, but the sound of a bat on a ball. - -- Bill Veeck -% -That's what she said. -% -That's where the money was. - -- Willie Sutton, on being asked why he robbed a bank - -It's a rather pleasant experience to be alone in a bank at night. - -- Willie Sutton -% -The 11 is for people with the pride of a 10 and the pocketbook of an 8. - -- R. B. Greenberg -% -The 357.73 Theory -- - Auditors always reject expense accounts - with a bottom line divisible by 5. -% -The 80's -- when you can't tell hairstyles from chemotherapy. -% -The 'A' is for content, the 'minus' is for not typing it. -Don't ever do this to my eyes again. - -- Professor Ronald Brady, Philosophy, Ramapo State College -% -The Abrams' Principle: - The shortest distance between two points is off the wall. -% -The absence of labels [in ECL] is probably a good thing. - -- T. Cheatham -% -The absent ones are always at fault. -% -The absurd is the essential concept and the first truth. - -- A. Camus -% -The abuse of greatness is when it disjoins remorse from power. - -- William Shakespeare, "Julius Caesar" -% -The adjective is the banana peel of the parts of speech. - -- Clifton Fadiman -% -The adjuration to be "normal" seems shockingly repellent to me; I see neither -hope nor comfort in sinking to that low level. I think it is ignorance that -makes people think of abnormality only with horror and allows them to remain -undismayed at the proximity of "normal" to average and mediocre. For surely -anyone who achieves anything is, essentially, abnormal. - -- Dr. Karl Menninger, "The Human Mind", 1930 -% -The advantage of being celibate is that when one sees a pretty girl one -does not need to grieve over having an ugly one back home. - -- Paul Leautaud, "Propos dun jour" -% -The advertisement is the most truthful part of a newspaper - -- Thomas Jefferson -% -The Advertising Agency Song: - - When your client's hopping mad, - Put his picture in the ad. - If he still should prove refractory, - Add a picture of his factory. -% -The aim of a joke is not to degrade the human being but to remind him that -he is already degraded. - -- George Orwell -% -The aim of science is to seek the simplest explanations of complex -facts. Seek simplicity and distrust it. - -- Whitehead -% -The alarm clock that is louder than God's own -belongs to the roommate with the earliest class. -% -The algorithm for finding the longest path in a graph is NP-complete. -For you systems people, that means it's *real slow*. - -- Bart Miller -% -The algorithm to do that is extremely nasty. You might want to mug -someone with it. - -- M. Devine, Computer Science 340 -% -The all-softening overpowering knell, -The tocsin of the soul, -- the dinner bell. - -- Lord Byron -% -The Almighty in His infinite wisdom did not see -fit to create Frenchmen in the image of Englishmen. - -- Winston Churchill, 1942 -% -The American Dental Association announced today that most plaque tends -to form on teeth around 4:00 PM in the afternoon. - -Film at 11:00. -% -The American nation in the sixth ward is a fine people; they love the -eagle -- on the back of a dollar. - -- Finley Peter Dunne -% -The American system of ours, call it Americanism, call it Capitalism, -call it what you like, gives each and every one of us a great -opportunity if we only seize it with both hands and make the most of it. - -- Al Capone -% -The amount of time between slipping on the peel and landing on the -pavement is precisely 1 bananosecond. -% -The amount of weight an evangelist carries with the almighty is measured -in billigrahams. -% -The Analytical Engine weaves Algebraical patterns -just as the Jacquard loom weaves flowers and leaves. - -- Ada Augusta, Countess of Lovelace, the first programmer -% -The Anarchists' [national] anthem is an international anthem that consists -of 365 raspberries blown in very quick succession to the tune of "Camptown -Races". Nobody has to stand up for it, nobody has to listen to it, and, -even better, nobody has to play it. - -- Mike Harding, "The Armchair Anarchist's Almanac" -% -The Ancient Doctrine of Mind Over Matter: - I don't mind... and you don't matter. - - -- As revealed to reporter G. Rivera by Swami Havabanana -% -The Angels want to wear my red shoes. - -- E. Costello -% -The anger of a woman is the greatest evil -with which you can threaten your enemies. - -- Bonnard -% -The Anglo-Saxon conscience does not prevent the Anglo-Saxon from -sinning, it merely prevents him from enjoying his sin. - -- Salvador De Madariaga -% -The angry man always thinks he can do more than he can. - -- Albertano of Brescia -% -The animals are not as stupid as one thinks -- they have neither -doctors nor lawyers. - -- L. Docquier -% -The annual meeting of the "You Have To Listen To Experience" Club is now in -session. Our Achievement Awards this year are in the fields of publishing, -advertising and industry. For best consistent contribution in the field of -publishing our award goes to editor, R. L. K., [...] for his unrivaled alle- -giance without variation to the statement: "Personally I'd love to do it, -we'd ALL love to do it. But we're not going to do it. It's not the kind of -book our house knows how to handle." Our superior performance award in the -field of advertising goes to media executive, E. L. M., [...] for the continu- -ally creative use of the old favorite: "I think what you've got here could be -very exciting. Why not give it one more try based on the approach I've out- -lined and see if you can come up with something fresh." Our final award for -courageous holding action in the field of industry goes to supervisor, R. S., -[...] for her unyielding grip on "I don't care if they fire me, I've been -arguing for a new approach for YEARS but are we SURE that this is the right -time--" I would like to conclude this meeting with a verse written specially -for our prospectus by our founding president fifty years ago -- and now, as -then, fully expressive of the emotion most close to all our hearts -- - Treat freshness as a youthful quirk, - And dare not stray to ideas new, - For if t'were tried they might e'en work - And for a living what woulds't we do? -% -The answer is that libdialog, the library on which sysinstall depends -for these menus, is genuinely evil. It is the unloved, satanic -bastard child of multiple parents and torturing users like yourself -constitutes the only joy in life it has left. Its source files are -all chmod'd 0666 and dire README files warn against trespass by -neophyte programmers. It is the 7th gate of Hell. It makes the baby -Jesus cry. Were libdialog given anthropomorphic representation, it -would be promptly burnt at the stake and its ashes scattered in the -desert, to be then doused with holy water from altitude by -fire-fighting aircraft. - - -- Jordan K. Hubbard on the evils of libdialog -% -The answer to the question of Life, the Universe, and Everything is... - - Four day work week, - Two ply toilet paper! -% -The answer to the Ultimate Question of Life, the Universe, and Everything was -released with the kind permission of the Amalgamated Union of Philosophers, -Sages, Luminaries, and Other Professional Thinking Persons. -% -The ark lands after The Flood. Noah lets all the animals out. Says he, "Go -and multiply." Several months pass. Noah decides to check up on the animals. -All are doing fine except a pair of snakes. "What's the problem?" says Noah. -"Cut down some trees and let us live there", say the snakes. Noah follows -their advice. Several more weeks pass. Noah checks on the snakes again. -Lots of little snakes, everybody is happy. Noah asks, "Want to tell me how -the trees helped?" "Certainly", say the snakes. "We're adders, and we need -logs to multiply." -% -The arms business is founded on human folly, that is why its depths will -never be plumbed and why it will go on forever. All weapons are defensive -and all spare parts are non-lethal. The plainest print cannot be read -through a solid gold sovereign, or a ruble or a golden eagle. - -- Sam Cummings, American arms dealer -% -The Army has carried the American ... ideal to its logical conclusion. -Not only do they prohibit discrimination on the grounds of race, creed -and color, but also on ability. - -- T. Lehrer -% -The Army needs leaders the way a foot needs a big toe. - -- Bill Murray -% -The assertion that "all men are created equal" was of no practical use -in effecting our separation from Great Britain and it was placed in the -Declaration not for that, but for future use. - -- Abraham Lincoln -% -The astronomer Francesco Sizi, a contemporary of Galileo, argues that -Jupiter can have no satellites: - - There are seven windows in the head, two nostrils, two ears, two -eyes, and a mouth; so in the heavens there are two favorable stars, two -unpropitious, two luminaries, and Mercury alone undecided and indifferent. -From which and many other similar phenomena of nature such as the seven -metals, etc., which it were tedious to enumerate, we gather that the number -of planets is necessarily seven. [...] - Moreover, the satellites are invisible to the naked eye and -therefore can have no influence on the earth and therefore would be useless -and therefore do not exist. -% -The attacker must vanquish; the defender need only survive. -% -The average girl would rather have beauty than brains because she -knows that the average man can see much better than he can think. - -- Ladies' Home Journal -% -The average, healthy, well-adjusted adult gets up at seven-thirty in -the morning feeling just terrible. - -- Jean Kerr -% -The average income of the modern teenager is about 2AM. -% -The average individual's position in any hierarchy is a lot like pulling -a dogsled -- there's no real change of scenery except for the lead dog. -% -The average nutritional value of promises is roughly zero. -% -The average Ph.D thesis is nothing but the transference of bones from -one graveyard to another. - -- J. Frank Dobie, "A Texan in England" -% -The average woman must inevitably view her actual husband with a certain -disdain; he is anything but her ideal. In consequence, she cannot help -feeling that her children are cruelly handicapped by the fact that he is -their father. - -- H. L. Mencken -% -The average woman would rather have beauty than brains, because the -average man can see better than he can think. -% -The avocation of assessing the failures of better men can be turned -into a comfortable livelihood, providing you back it up with a Ph.D. - -- Nelson Algren, "Writers at Work" -% -The avoidance of taxes is the only intellectual pursuit that -carries any reward. - -- John Maynard Keynes -% -The bad reputation UNIX has gotten is totally undeserved, laid on by -people who don't understand, who have not gotten in there and tried -anything. - -- Jim Joyce, owner of Jim Joyce's UNIX Bookstore -% -The bank called to tell me that I'm overdrawn, -Some freaks are burning crosses out on my front lawn, -And I *can't*believe* it, all the Cheetos are gone, - It's just ONE OF THOSE DAYS! - -- Weird Al Yankovic, "One of Those Days" -% -The bank sent our statement this morning, -The red ink was a sight of great awe! -Their figures and mine might have balanced, -But my wife was too quick on the draw. -% -The basic idea behind malls is that they are more convenient than -cities. Cities contain streets, which are dangerous and crowded and -difficult to park in. Malls, on the other hand, have parking lots, -which are also dangerous and crowded and difficult to park in, but -- -here is the big difference -- in mall parking lots, THERE ARE NO -RULES. You're allowed to do anything. You can drive as fast as you -want in any direction you want. I was once driving in a mall parking -lot when my car was struck by a pickup truck being driven backward by a -squat man with a tattoo that said "Charlie" on his forearm, who got out -and explained to me, in great detail, why the accident was my fault, -his reasoning being that he was violent and muscular, whereas I was -neither. This kind of reasoning is legally valid in mall parking -lots. - -- Dave Barry, "Christmas Shopping: A Survivor's Guide" -% -The basic menu item, in fact the ONLY menu item, would be a food unit -called the "patty," consisting of -- this would be guaranteed in -writing -- "100 percent animal matter of some kind." All patties would -be heated up and then cooled back down in electronic devices -immediately before serving. The Breakfast Patty would be a patty on a -bun with lettuce, tomato, onion, egg, Ba-Ko-Bits, Cheez Whiz, a Special -Sauce made by pouring ketchup out of a bottle and a little slip of -paper stating: "Inspected by Number 12". The Lunch or Dinner Patty -would be any Breakfast Patties that didn't get sold in the morning. -The Seafood Lover's Patty would be any patties that were starting to -emit a serious aroma. Patties that were too rank even to be Seafood -Lover's Patties would be compressed into wads and sold as "Nuggets." - -- Dave Barry, "'Mister Mediocre' Restaurants" -% -The bay-trees in our country are all wither'd -And meteors fright the fixed stars of heaven; -The pale-faced moon looks bloody on the earth -And lean-look'd prophets whisper fearful change. -These signs forerun the death or fall of kings. - -- William Shakespeare, "Richard II" -% -THE BEATLES: - Paul McCartney's old back-up band. -% -The beer-cooled computer does not harm the ozone layer. - -- John M. Ford, a.k.a. Dr. Mike - - [If I can read my notes from the Ask Dr. Mike session at Baycon, I - believe he added that the beer-cooled computer uses "Forget Only - Memory". Ed.] -% -The best audience is intelligent, well-educated and a little drunk. - -- Maurice Baring -% -The best book on programming for the layman is "Alice in Wonderland"; -but that's because it's the best book on anything for the layman. -% -The best case: Get salary from America, build a house in England, - live with a Japanese wife, and eat Chinese food. -Pretty good case: Get salary from England, build a house in America, - live with a Chinese wife, and eat Japanese food. -The worst case: Get salary from China, build a house in Japan, - live with a British wife, and eat American food. - -- Bungei Shunju, a popular Japanese magazine -% -The best cure for insomnia is to get a lot of sleep. - -- W. C. Fields -% -The best defense against logic is ignorance. -% -The best definition of a gentleman is a man who can play the accordion -- -but doesn't. - -- Tom Crichton -% -The best diplomat I know is a fully activated phaser bank. - -- Scotty -% -The best equipment for your work is, of course, the most expensive. -However, your neighbor is always wasting money that should be yours -by judging things by their price. -% -The best executive is one who has sense enough to pick good people to do -what he wants done, and self-restraint enough to keep from meddling with -them while they do it. - -- Theodore Roosevelt -% -The best laid plans of mice and men are held up in the legal department. -% -The best laid plans of mice and men are usually about equal. - -- Blair -% -The best man for the job is often a woman. -% -The best number for a dinner party is two -- myself and a damn good -head waiter. - -- Nubar Gulbenkian -% -The best portion of a good man's life, his little, -nameless, unremembered acts of kindness and love. - -- Wordsworth -% -The best prophet of the future is the past. -% -The best rebuttal to this kind of statistical argument came from the -redoubtable John W. Campbell: - - The laws of population growth tell us that approximately half the - people who were ever born in the history of the world are now - dead. There is therefore a 0.5 probability that this message is - being read by a corpse. -% -The best that we can do is to be kindly and helpful toward our friends and -fellow passengers who are clinging to the same speck of dirt while we are -drifting side by side to our common doom. - -- Clarence Darrow -% -The best thing about being bald is, that, when unexpected -company arrives, all you have to do is straighten your tie. -% -The best thing about growing older is that it takes such a long time. -% -The best thing that comes out of Iowa is I-80. -% -The best things in life are for a fee. -% -The best things in life go on sale sooner or later. -% -The best way to accelerate a Macintoy is at 9.8 meters per second, squared. -% -The best way to avoid responsibility is to say, "I've got responsibilities." -% -The best way to get rid of worries is to let them die of neglect. -% -The best way to keep your friends is not to give them away. -% -The best way to make a fire with two sticks is to make sure one of them -is a match. - -- Will Rogers -% -The best way to preserve a right is to exercise it, and the right to -smoke is a right worth dying for. -% -The best ways are the most straightforward ways. When you're sitting around -scamming these things out, all kinds of James Bondian ideas come forth, but -when it gets down to the reality of it, the simplest and most straightforward -way is usually the best, and the way that attracts the least attention. -Also, pouring gasoline on the water and lighting it like James Bond doesn't -work either.... They tried it during Prohibition. - -- Thomas King Forcade, marijuana smuggler -% -The best you get is an even break. - -- Franklin Adams -% -The better part of valor is discretion. - -- William Shakespeare, "Henry IV" -% -The better the state is established, the fainter is humanity. -To make the individual uncomfortable, that is my task. - -- Friedrich Nietzsche -% -The Bible contains six admonishments to homosexuals and 362 admonishments -to heterosexuals. That doesn't mean that God doesn't love heterosexuals. -It's just that they need more supervision. -% -The Bible is not my Book and Christianity is not my religion. I could -never give assent to the long complicated statements of Christian dogma. - -- Abraham Lincoln -% -The Bible on letters of reference: - - Are we beginning all over again to produce our credentials? Do -we, like some people, need letters of introduction to you, or from you? -No, you are all the letter we need, a letter written on your heart; any -man can see it for what it is and read it for himself. - -- 2 Corinthians 3:1-2, New English translation -% -The big cities of America are becoming Third World countries. - -- Nora Ephron -% -The big question is why in the course of evolution the males permitted -themselves to be so totally eclipsed by the females. Why do they tolerate -this total subservience, this wretched existence as outcasts who are -hungry all the time? -% -The bigger the theory the better. -% -The biggest difference between time and space is that you can't reuse time. - -- Merrick Furst -% -The biggest mistake you can make is to believe that you are -working for someone else. -% -The biggest problem with communication is the illusion that it has -occurred. -% -The Bird of Time has but a little way to fly ... -and the bird is on the wing. - -- Omar Khayyam -% -The black bear used to be one of the most commonly seen large animals -because in Yosemite and Sequoia national parks they lived off of garbage -and tourist handouts. This bear has learned to open car doors in -Yosemite, where damage to automobiles caused by bears runs into the tens -of thousands of dollars a year. Campaigns to bearproof all garbage -containers in wild areas have been difficult, because as one biologist -put it, "There is a considerable overlap between the intelligence levels -of the smartest bears and the dumbest tourists." -% -The bland leadeth the bland and they both shall fall into the kitsch. -% -The bogosity meter just pegged. -% -The bold youth of today is very lonely. - -- Poul Henningsen (1894-1967) -% -The bomb will never go off. I speak as an expert in explosives. - -- Admiral William Leahy, U.S. Atomic Bomb Project -% -The bone-chilling scream split the warm summer night in two, the first -half being before the scream when it was fairly balmy and calm and -pleasant, the second half still balmy and quite pleasant for those who -hadn't heard the scream at all, but not calm or balmy or even very nice -for those who did hear the scream, discounting the little period of time -during the actual scream itself when your ears might have been hearing it -but your brain wasn't reacting yet to let you know. - -- Winning sentence, 1986 Bulwer-Lytton bad fiction contest -% -The boy stood on the burning deck, -Eating peanuts by the peck. -His father called him, but he could not go, -For he loved those peanuts so. -% -The brain is a wonderful organ; it starts working the moment -you get up in the morning, and does not stop until you get to work. -% -The Briggs - Chase Law of Program Development: - To determine how long it will take to write and debug a - program, take your best estimate, multiply that by two, add - one, and convert to the next higher units. -% -The British are coming! The British are coming! -% -The broad mass of a nation... will more easily -fall victim to a big lie than to a small one. - -- Adolf Hitler, "Mein Kampf" -% -The brotherhood of man is not a mere poet's dream; it is a most depressing -and humiliating reality. - -- Oscar Wilde -% -The Buddha, the Godhead, resides quite as comfortably in the circuits of a -digital computer or the gears of a cycle transmission as he does at the top -of a mountain or in the petals of a flower. To think otherwise is to demean -the Buddha -- which is to demean oneself. - -- Robert Pirsig, "Zen and the Art of Motorcycle Maintenance" -% -The buffalo isn't as dangerous as everyone makes him out to be. -Statistics prove that in the United States more Americans are killed in -automobile accidents than are killed by buffalo. - -- Art Buchwald -% -The bugs you have to avoid are the ones that give the user not only -the inclination to get on a plane, but also the time. - -- Kay Bostic -% -The Bulwer-Lytton fiction contest is held ever year at San Jose State -Univ. by Professor Scott Rice. It is held in memory of Edward George -Earle Bulwer-Lytton (1803-1873), a rather prolific and popular (in his -time) novelist. He is best known today for having written "The Last -Days of Pompeii." - -Whenever Snoopy starts typing his novel from the top of his doghouse, -beginning "It was a dark and stormy night..." he is borrowing from Lord -Bulwer-Lytton. This was the line that opened his novel, "Paul Clifford," -written in 1830. The full line reveals why it is so bad: - - It was a dark and stormy night; the rain fell in torrents -- except - at occasional intervals, when it was checked by a violent gust of - wind which swept up the streets (for it is in London that our scene - lies), rattling along the housetops, and fiercely agitating the scanty - flame of the lamps that struggled against the darkness. -% -The bureaucracy is expanding to meet the needs of an expanding -bureaucracy. -% -The C Programming Language -- A language which combines the -flexibility of assembly language with the power of assembly language. -% -The cable TV sex channels don't expand our horizons, don't make us better -people, and don't come in clearly enough. - -- Bill Maher -% -The camel died quite suddenly on the second day, and Selena fretted -sullenly and, buffing her already impeccable nails -- not for the first -time since the journey began -- pondered snidely if this would dissolve -into a vignette of minor inconveniences like all the other holidays spent -with Basil. - -- Winning sentence, 1983 Bulwer-Lytton bad fiction contest -% -The camel has a single hump; -The dromedary two; -Or else the other way around. -I'm never sure. Are you? - -- Ogden Nash -% -The capacity of human beings to bore one another seems to be vastly -greater than that of any other animals. Some of their most esteemed -inventions have no other apparent purpose, for example, the dinner -party of more than two, the epic poem, and the science of metaphysics. - -- H. L. Mencken -% -The carbonyl is polarized, -The delta end is plus. -The nucleophile will thus attack, -The carbon nucleus. -Addition makes an alcohol, -Of types there are but three. -It makes a bond, to correspond, -From C to shining C. - -- Prof. Frank Westheimer, to "America the Beautiful" -% -The cart has no place where a fifth wheel could be used. - -- Herbert von Fritzlar -% -The Celts invented two things, Whiskey and self-destruction. -% -The chain which can be yanked is not the eternal chain. - -- G. Fitch -% -The chains of marriage are so heavy that it takes two to carry them, and -sometimes three. - -- Alexandre Dumas -% -The chicken that clucks the loudest is the one most likely to show up -at the steam fitters' picnic. -% -The chief danger in life is that you may take too many precautions. - -- Alfred Adler -% -The chief enemy of creativity is "good" sense. - -- Picasso -% -The church is near but the road is icy, -the bar is far away but I will walk carefully. - -- Russian Proverb -% -The church saves sinners, but science seeks to stop their manufacture. - -- Elbert Hubbard -% -The City of Palo Alto, in its official description of parking lot standards, -specifies the grade of wheelchair access ramps in terms of centimeters of -rise per foot of run. A compromise, I imagine... -% -The clash of ideas is the sound of freedom. -% -The clearest way into the Universe is through a forest wilderness. - -- John Muir -% -The clergy successfully preached the doctrines of patience and pusillanimity; -the active virtues of society were discouraged; and the last remains of a -military spirit were buried in the cloister: a large portion of public and -private wealth was consecrated to the specious demands of charity and devotion; -and the soldiers' pay was lavished on the useless multitudes of both sexes -who could only plead the merits of abstinence and chastity. - -- Edward Gibbons, "The Decline and Fall of the Roman Empire" -% -The climate of Bombay is such that its inhabitants have to live elsewhere. -% -The closest to perfection a person ever comes -is when he fills out a job application form. - -- Stanley J. Randall -% -The clothes have no emperor. - -- C. A. R. Hoare, commenting on ADA -% -The coast was clear. - -- Lope de Vega -% -The college graduate is presented with a sheepskin to cover his -intellectual nakedness. - -- Robert M. Hutchins -% -The Commandments of the EE: - -1: Beware of lightning that lurketh in an uncharged condenser - lest it cause thee to bounce upon thy buttocks in a most - embarrassing manner. -2: Cause thou the switch that supplieth large quantities of juice to - be opened and thusly tagged, that thy days may be long in this - earthly vale of tears. -3: Prove to thyself that all circuits that radiateth, and upon - which the worketh, are grounded and thusly tagged lest they lift - thee to a radio frequency potential and causeth thee to make like - a radiator too. -4: Tarry thou not amongst these fools that engage in intentional - shocks for they are not long for this world and are surely - unbelievers. -% -The Commandments of the EE: - -5: Take care that thou useth the proper method when thou takest the - measures of high-voltage circuits too, that thou dost not incinerate - both thee and thy test meter, for verily, though thou has no company - property number and can be easily surveyed, the test meter has - one and, as a consequence, bringeth much woe unto a purchasing agent. -6: Take care that thou tamperest not with interlocks and safety devices, - for this incurreth the wrath of the chief electrician and bring - the fury of the engineers on his head. -7: Work thou not on energized equipment for if thou doest so, thy - friends will surely be buying beers for thy widow and consoling - her in certain ways not generally acceptable to thee. -8: Verily, verily I say unto thee, never service equipment alone, - for electrical cooking is a slow process and thou might sizzle in - thy own fat upon a hot circuit for hours on end before thy maker - sees fit to end thy misery and drag thee into his fold. -% -The Commandments of the EE: - -9: Trifle thee not with radioactive tubes and substances lest thou - commence to glow in the dark like a lightning bug, and thy wife be - frustrated and have not further use for thee except for thy wages. -10: Commit thou to memory all the words of the prophets which are - written down in thy Bible which is the National Electrical Code, - and giveth out with the straight dope and consoleth thee when - thou hast suffered a ream job by the chief electrician. -11: When thou muckest about with a device in an unthinking and/or - unknowing manner, thou shalt keep one hand in thy pocket. Better - that thou shouldest keep both hands in thy pockets than - experimentally determine the electrical potential of an - innocent-seeming device. -% -The common cormorant, or shag, lays eggs inside a paper bag. -% -The computer gets faster! --Moore-- -% -The computer industry is journalists in their 20's standing in awe of -entrepreneurs in their 30's who are hiring salesmen in their 40's and -50's and paying them in the 60's and 70's to bring their marketing into -the 80's. - -- Marty Winston -% -The computer is to the information industry roughly what the -central power station is to the electrical industry. - -- Peter Drucker -% -The Computer made me do it. -% -The computing field is always in need of new cliches. - -- Alan J. Perlis -% -The concept seems to be clear by now. It has been -defined several times by examples of what it is not. -% -The confusion of a staff member is measured by the length of his -memos. - -- New York Times, Jan. 20, 1981 -% -The connection between the language in which we think/program and the problems -and solutions we can imagine is very close. For this reason restricting -language features with the intent of eliminating programmer errors is at best -dangerous. - -- Bjarne Stroustrup -% -The conservation movement is a breeding ground of Communists and other -subversives. We intend to clean them out, even if it means rounding up -every bird watcher in the country. - -- John Mitchell, Atty. General 1969-1972 -% -The Constitution may not be perfect, but it's a lot better -than what we've got! -% -The Consultant's Curse: - When the customer has beaten upon you long enough, give him -what he asks for, instead of what he needs. This is very strong -medicine, and is normally only required once. -% -The control of the production of wealth -is the control of human life itself. - -- Hilaire Belloc -% -The correct way to punctuate a sentence that starts: "Of course it is -none of my business, but --" is to place a period after the word "but." -Don't use excessive force in supplying such a moron with a period. -Cutting his throat is only a momentary pleasure and is bound to get you -talked about. - -- Lazarus Long, "Time Enough for Love" -% -The cost of feathers has risen, even down is up! -% -The cost of living has just gone up another dollar a quart. - -- W. C. Fields -% -The cost of living hasn't affected its popularity. -% -The cost of living is going up, and the chance of living is going down. -% -The countdown had stalled at "T" minus 69 seconds when Desiree, the first -female ape to go up in space, winked at me slyly and pouted her thick, -rubbery lips unmistakably -- the first of many such advances during what -would prove to be the longest, and most memorable, space voyage of my -career. - -- Winning sentence, 1985 Bulwer-Lytton bad fiction contest -% -The course of true anything never does run smooth. - -- Samuel Butler -% -The courtroom was pregnant (pun intended) with anxious silence as the -judge solemnly considered his verdict in the paternity suit before him. -Suddenly, he reached into the folds of his robes, drew out a cigar and -ceremoniously handed it to the defendant. - "Congratulations!" declaimed the jurist. "You have just become a -father!" -% -The covers of this book are too far apart. - -- Ambrose Bierce, reviewing a book -% -The cow is nothing but a machine which makes grass fit for us people to eat. - -- John McNulty -% -The Creation of the Universe was made possible by a grant from Texas -Instruments. - -- Credits from the PBS program "The Creation of the Universe" -% -The Crown is full of it! - -- Nate Harris, 1775 -% -The cry has been that when war is declared, all opposition should therefore -be hushed. A sentiment more unworthy of a free country could hardly be -propagated. If the doctrine be admitted, rulers have only to declare war -and they are screened at once from scrutiny. ... In war, then, as in peace, -assert the freedom of speech and of the press. Cling to this as the bulwark -of all our rights and privileges. - -- William Ellery Channing -% -The curse of the Irish is not that they don't know the -words to a song -- it's that they know them *all*. - -- Susan Dooley -% -The "cutting edge" is getting rather dull. - -- Andy Purshottam -% -The Czechs announced after Sputnik that they, too, would launch -a satellite. Of course, it would orbit Sputnik, not Earth! -% -The danger is not that a particular class is unfit to govern. -Every class is unfit to govern. - -- Lord Acton -% -The dangerous Lego Bomb, which targets shag rugs and scatters pieces of -plastic that hurt like hell when you step on them is banned entirely.... -Hiring David Copperfield to pretend to saw the missiles in half will not -be permitted... In order to reduce risk of accidental war, both sides -agree to ban the popular but dangerous "Simon Says" training drill at -nuclear launch sites... Under no circumstances will either side reveal -that it hammered out the treaty in one afternoon, but spent the last nine -years arguing the Monty Hall and the three doors problem. - -- Little known provisions of the START treaty by James Lileks -% -The day advanced as if to light some work of mine; it was morning, -and lo! now it is evening, and nothing memorable is accomplished. - -- Henry David Thoreau -% -The day after tomorrow is the third day of the rest of your life. -% -The day will come when the mystical generation of Jesus, by the Supreme Being -as his Father, in the womb of a virgin will be classified with the fable of -the generation of Minerva in the brain of Jupiter. But we may hope that the -dawn of reason and freedom of thought in these United States will do away with -this artificial scaffolding and restore to us the primitive and genuine -doctrines of this most venerated Reformer of human errors. - -- Thomas Jefferson -% -The days are all empty and the nights are unreal. -% -The days just prior to marriage are like a snappy introduction -to a tedious book. -% -The day-to-day travails of the IBM programmer are so amusing to most of us -who are fortunate enough never to have been one -- like watching Charlie -Chaplin trying to cook a shoe. -% -The debate rages on: Is PL/I Bachtrian or Dromedary? -% -The deceased was killed by 1207.3557298 Volts AC RMS applied by -accident when he brushed against the output terminal of a John B. -Fluke Company High Voltage Calibrator. - -- fictitious coroner's report by Mike Andrews -% -The decision doesn't have to be logical; it was unanimous. -% -The default Magic Word, "Abracadabra", actually is a corruption of the -Hebrew phrase "ha-Bracha dab'ra" which means "pronounce the blessing". -% -The degree of civilization in a society -can be judged by entering its prisons. - -- F. Dostoyevski -% -The degree of technical confidence is inversely -proportional to the level of management. -% -The denunciation of the young is a necessary part of the hygiene of older -people, and greatly assists in the circulation of the blood. - -- Logan Pearsall Smith -% -The departing division general manager met a last time with his young -successor and gave him three envelopes. "My predecessor did this for me, -and I'll pass the tradition along to you," he said. "At the first sign -of trouble, open the first envelope. Any further difficulties, open the -second envelope. Then, if problems continue, open the third envelope. -Good luck." The new manager returned to his office and tossed the envelopes -into a drawer. - Six months later, costs soared and earnings plummeted. Shaken, the -young man opened the first envelope, which said, "Blame it all on me." - The next day, he held a press conference and did just that. The -crisis passed. - Six months later, sales dropped precipitously. The beleaguered -manager opened the second envelope. It said, "Reorganize." - He held another press conference, announcing that the division -would be restructured. The crisis passed. - A year later, everything went wrong at once and the manager was -blamed for all of it. The harried executive closed his office door, sank -into his chair, and opened the third envelope. - "Prepare three envelopes..." it said. -% -The descent to Hades is the same from every place. - -- Anaxagoras -% -The devil can cite Scripture for his purpose. - -- William Shakespeare, "The Merchant of Venice" -% -The devil finds work for idle circuits to do. -% -The devil finds work for idle glands. -% -The die is cast. - -- Gaius Julius Caesar -% -The difference between a career and a job is about 20 hours a week. -% -The difference between a good haircut and a bad one is seven days. -% -The difference between a Miracle and a Fact is -exactly the difference between a mermaid and a seal. - -- Mark Twain -% -The difference between a misfortune and a calamity? If Gladstone fell into -the Thames, it would be a misfortune. But if someone dragged him out again, -it would be a calamity. - -- Benjamin Disraeli -% -The difference between America and England is, the English think 100 -miles is a long distance and the Americans think 100 years is a long time. -% -The difference between art and science is that science is what we -understand well enough to explain to a computer. Art is everything else. - -- Donald E. Knuth, "Discover" -% -The difference between common-sense and paranoia is that common-sense is -thinking everyone is out to get you. That's normal -- they are. Paranoia -is thinking that they're conspiring. - -- J. Kegler -% -The difference between dogs and cats is that dogs come when they're -called. Cats take a message and get back to you. -% -The difference between genius and stupidity is that genius has its limits. -% -The difference between legal separation and divorce is -that legal separation gives the man time to hide his money. -% -The difference between reality and unreality -is that reality has so little to recommend it. - -- Allan Sherman -% -The difference between science and the fuzzy subjects is that science -requires reasoning while those other subjects merely require scholarship. - -- Robert A. Heinlein -% -The difference between sentiment and being sentimental is the following: -Sentiment is when a driver swerves out of the way to avoid hitting a -rabbit on the road. Being sentimental is when the same driver, when -swerving away from the rabbit hits a pedestrian. - -- Frank Herbert, "The White Plague" -% -The difference between sentiment and sentimentality is easy to see. When -you avoid killing somebody's pet on the glazeway, that's sentiment. If you -swerve to avoid the pet and that causes you to kill pedestrians, THAT is -sentimentality. - -- Frank Herbert, "Chapterhouse: Dune" -% -The difference between the right word and the almost right word -is the difference between lightning and the lightning bug. - -- Mark Twain -% -The difference between this place and yogurt -is that yogurt has a live culture. -% -The difference between us is not very far, -cruising for burgers in daddy's new car. -% -The difference between waltzes and disco is mostly one of volume. - -- T. K. -% -The difficult we do today; the impossible takes a little longer. -% -The dirty work at political conventions is almost always done in -the grim hours between midnight and dawn. Hangmen and politicians -work best when the human spirit is at its lowest ebb. - -- Russell Baker -% -The discerning person is always at a disadvantage. -% -The disks are getting full; purge a file today. -% -The distinction between Freedom and Liberty is not accurately known; -naturalists have been unable to find a living specimen of either. - -- Ambrose Bierce -% -The distinction between Jewish and goyish can be quite subtle, as the -following quote from Lenny Bruce illustrates: - - "I'm Jewish. Count Basie's Jewish. Ray Charles is Jewish. -Eddie Cantor's goyish. The B'nai Brith is goyish. The Hadassah is -Jewish. Marine Corps -- heavy goyish, dangerous. - "Kool-Aid is goyish. All Drake's Cakes are goyish. -Pumpernickel is Jewish and, as you know, white bread is very goyish. -Instant potatoes -- goyish. Black cherry soda's very Jewish. -Macaroons are _v_e_r_y Jewish. Fruit salad is Jewish. Lime Jell-O is -goyish. Lime soda is _v_e_r_y goyish. Trailer parks are so goyish that -Jews won't go near them." - -- Arthur Naiman, "Every Goy's Guide to Yiddish" -% -The distinction between true and false appears to become -increasingly blurred by... the pollution of the language. - -- Arne Tiselius -% -The District of Columbia has a law forbidding you to exert pressure on -a balloon and thereby cause a whistling sound on the streets. -% -The divinity of Jesus is made a convenient cover for absurdity. Nowhere in -the Gospels do we find a precept for Creeds, Confessions, Oaths, Doctrines, -and whole carloads of other foolish trumpery that we find in Christianity. - -- John Adams -% -The doctrine of human equality reposes on this: that there is no man -really clever who has not found that he is stupid. - -- Gilbert K. Chesterson -% -The door is the key. -% -The duck hunter trained his retriever to walk on water. Eager to show off -this amazing accomplishment, he asked a friend to go along on his next -hunting trip. Saying nothing, he fired his first shot and, as the duck fell, -the dog walked on the surface of the water, retrieved the duck and returned -it to his master. - "Notice anything?" the owner asked eagerly. - "Yes," said his friend, "I see that fool dog of yours can't swim." -% -The duration of passion is proportionate with the original resistance -of the woman. - -- Honore de Balzac -% -The eagle may soar, but the weasel never gets sucked into a jet engine. -% -The early bird gets the coffee left over from the night before. -% -The early bird who catches the worm works for someone who comes in late -and owns the worm farm. - -- Travis McGee -% -The early worm gets the late bird. -% -The earth is like a tiny grain of sand, only much, much heavier. -% -The easiest way to figure the cost of living is to take your income and -add ten percent. -% -The easy confidence with which I know another man's religion is folly -teaches me to suspect that my own is also. - -I would not interfere with any one's religion, either to strengthen it -or to weaken it. I am not able to believe one's religion can affect his -hereafter one way or the other, no matter what that religion may be. -But it may easily be a great comfort to him in this life -- hence it is a -valuable possession to him. - -I do not see how eternal punishment hereafter could accomplish any good -end, therefore I am not able to believe in it. To chasten a man in order -to perfect him might be reasonable enough; to annihilate him when he shall -have proved himself incapable of reaching perfection might be reasonable -enough; but to roast him forever for the mere satisfaction of seeing him -roast would not be reasonable -- even the atrocious God imagined by the Jews -would tire of the spectacle eventually. - -- Mark Twain -% -The economy depends about as much on economists as the weather does on -weather forecasters. - -- Jean-Paul Kauffmann -% -The egg cream is psychologically the opposite of circumcision -- it -*pleasurably* reaffirms your Jewishness. - -- Mel Brooks -% -The elder gods went to Yuggoth, and all you got was this lousy fortune. -% -"The eleventh commandment was `Thou Shalt Compute' or `Thou Shalt Not -Compute' -- I forget which." - -- Epigrams in Programming, ACM SIGPLAN Sept. 1982 -% -The Encyclopaedia Galactica defines a robot as a mechanical apparatus designed -to do the work of a man. The marketing division of Sirius Cybernetics -Corporation defines a robot as "Your Plastic Pal Who's Fun To Be With". -The Hitchhiker's Guide to the Galaxy defines the marketing division of the -Sirius Cybernetics Corporation as "a bunch of mindless jerks who'll be the -first against the wall when the revolution comes", with a footnote to effect -that the editors would welcome applications from anyone interested in taking -over the post of robotics correspondent. - Curiously enough, an edition of the Encyclopaedia Galactica that -had the good fortune to fall through a time warp from a thousand years in -the future defined the marketing division of the Sirius Cybernetics -Corporation as "a bunch of mindless jerks who were the first against the -wall when the revolution came". -% -The end move in politics is always to pick up a gun. - -- Buckminster Fuller -% -The end of labor is to gain leisure. -% -The end of the human race will be that it will eventually die of -civilization. - -- Ralph Waldo Emerson -% -The end of the world will occur at 3:00 p.m., this Friday, with -symposium to follow. -% -The ends justify the means. - -- after Matthew Prior -% -The energy produced by the breaking down of the atom is a very poor kind -of thing. Anyone who expects a source of power from the transformation -of these atoms is talking moonshine. - -- Ernest Rutherford, after he had split the atom for - the first time -% -The English country gentleman galloping after a fox -- the unspeakable -in full pursuit of the uneatable. - -- Oscar Wilde, "A Woman of No Importance" -% -The English have no respect for their language, and will not teach -their children to speak it. - -- George Bernard Shaw -% -The English instinctively admire any man -who has no talent and is modest about it. - -- James Agate, British film and drama critic -% -The entire work force of the Communist countries is subjected to periodic -purges (called verifications in Newspeak). One of the most severe took -place in 1957 when Novotny, rattled by the Hungarian Revolution the year -before, tried hard to weed out "radishes" (red outside, white inside) from -all but insignificant positions. Any one of the following would often -result in the loss of one's job: Bourgeois or Jewish family background, -relatives abroad, contacts with former capitalists, having lived in a -Western country, insufficient knowledge of Communist literature, and others. - - A man is interviewed by a "Verification Committee." - "What kind of family do you come from?" - "A rich, Jewish family." - "And your wife?" - "A German aristocrat." - "Have you ever been to the West?" - "I spent most of my life in England." - "How did you make a living there?" - "A friend supported me." - "Where did you get the money from?" - "He owned a textile factory." - "Who was Lenin?" - "Never heard of him." - "What is your name?" - "Karl Marx." -% -The error of youth is to believe that intelligence is a substitute -for experience, while the error of age is to believe experience is -a substitute for intelligence. - -- Lyman Bryson -% -The eternal feminine draws us upward. - -- Johann Wolfgang von Goethe -% -The executioner is, I hear, very expert, and my neck is very slender. - -- Anne Boleyn -% -The explanation requiring the fewest assumptions -is the most likely to be correct. - -- William of Occam -% -The eye is a menace to clear sight, the ear is a menace to subtle hearing, -the mind is a menace to wisdom, every organ of the senses is a menace to its -own capacity. ... Fuss, the god of the Southern Ocean, and Fret, the god -of the Northern Ocean, happened once to meet in the realm of Chaos, the god -of the center. Chaos treated them very handsomely and they discussed together -what they could do to repay his kindness. They had noticed that, whereas -everyone else had seven apertures, for sight, hearing, eating, breathing and -so on, Chaos had none. So they decided to make the experiment of boring holes -in him. Every day they bored a hole, and on the seventh day, Chaos died. - -- Chuang Tzu -% -The eyes of taxes are upon you. -% -The eyes of Texas are upon you, -All the livelong day; -The eyes of Texas are upon you, -You cannot get away; -Do not think you can escape them -From night 'til early in the morn; -The eyes of Texas are upon you -'Til Gabriel blows his horn. - -- University of Texas' school song -% -The fact that an opinion has been widely held is no evidence that it is not -utterly absurd; indeed, in view of the silliness of the majority of mankind, -a widespread belief is more often likely to be foolish than sensible. - -- Bertrand Russell, in "Marriage and Morals", 1929 -% -The fact that boys are allowed to exist at all is evidence of a -remarkable Christian forbearance among men. - -- Ambrose Bierce -% -The fact that Hitler was a political genius unmasks the nature of politics -in general as no other can. - -- Wilhelm Reich -% -The fact that it works is immaterial. - -- L. Ogborn -% -The fact that people are poor or discriminated against doesn't necessarily -endow them with any special qualities of justice, nobility, charity or -compassion. - -- Saul Alinsky -% -The fall of the USSR proves you wrong. - -- Aryeh M. Friedman -% -The famous politician was trying to save both his faces. -% -The farther you go, the less you know. - -- Lao Tsu, "Tao Te Ching" -% -The fashion wears out more apparel than the man. - -- William Shakespeare, "Much Ado About Nothing" -% -The fashionable drawing rooms of London have always been happy to accept -outsiders -- if only on their own, albeit undemanding terms. That is to -say, artists, so long as they are not too talented, men of humble birth, -so long as they have since amassed several million pounds, and socialists -so long as they are Tories. - -- Christopher Booker -% -The faster I go, the behinder I get. - -- Lewis Carroll, - "Through the Looking-Glass, - and What Alice Found There" (1871) -% -The faster we go, the rounder we get. - -- The Grateful Dead -% -The Fastest Defeat In Chess - The big name for us in the world of chess is Gibaud, a French chess -master. - In Paris during 1924 he was beaten after only four moves by a -Monsieur Lazard. Happily for posterity, the moves are recorded and so -chess enthusiasts may reconstruct this magnificent collapse in the comfort -of their own homes. - Lazard was black and Gibaud white: - 1: P-Q4, Kt-KB3 - 2: Kt-Q2, P-K4 - 3: PxP, Kt-Kt5 - 4: P-KR3, Kt-K6/ - White then resigns on realizing that a fifth move would involve -either a Q-KR5 check or the loss of his queen. - -- Stephen Pile, "The Book of Heroic Failures" -% -The father, passing through his son's college town late one evening on a -business trip, thought he would pay his boy a surprise visit. Arriving at the -lad's fraternity house, dad rapped loudly on the door. After several minutes -of knocking, a sleepy voice drifted down from a second-floor window, - "Whaddaya want?" - "Does Ramsey Duncan live here?" asked the father. - "Yeah," replied the voice. "Dump him on the front porch." -% -The feeling persists that no one can simultaneously be a respectable writer -and understand how a refrigerator works, just as no gentleman wears a brown -suit in the city. Colleges may be to blame. English majors are encouraged, -I know, to hate chemistry and physics, and to be proud because they are not -dull and creepy and humorless and war-oriented like the engineers across the -quad. And our most impressive critics have commonly been such English majors, -and they are squeamish about technology to this very day. So it is natural -for them to despise science fiction. - -- Kurt Vonnegut, Jr., "Science Fiction" -% -The fellow sat down at a bar, ordered a drink and asked the bartender if he -wanted to hear a dumb-jock joke. - "Hey, buddy," the bartender replied, "you see those two guys next to -you? They used to be with the Chicago Bears. The two dudes behind you made -the U.S. Olympic wrestling team. And for you information, I used to play -center at Notre Dame." - "Forget it," the customer said. "I don't want to explain it five -times." -% -"The feminist agenda," Pat Robertson observed in a recent letter to his -supporters, "is not about equal rights for women. It is about a socialist, -anti-family political movement that encourages women to leave their -husbands, kill their children, practice witchcraft, destroy capitalism -and become lesbians." -% -The Feynman Problem-Solving Algorithm: - (1) write down the problem. - (2) think very hard. - (3) write down the answer. - -- Murray Gell-Mann -% -The Fifth Rule: - You have taken yourself too seriously. -% -The final delusion is the belief that one has lost all delusions. - -- Maurice Chapelain, "Main courante" -% -The final screw holding up a rackmount server is always possessed by demons. -% -The finest eloquence is that which gets things done. -% -The first 90% of a project takes 90% of the time, -the last 10% takes the other 90% of the time. -% -The first and almost the only Book deserving of universal attention is -the Bible. - -- John Quincy Adams - -All the good from the Saviour of the world is communicated through this Book; -but for the Book we could not know right from wrong. All the things desirable -to man are contained in it. - -- Abraham Lincoln - -... the Bible ... is the one supreme source of revelation of the meaning of -life, the nature of God and spiritual nature and need of men. It is the only -guide of life which really leads the spirit in the way of peace and salvation. - -- Woodrow Wilson -% -The First Commandment for Technicians: - Beware the lightening that lurketh in the undischarged -capacitor, lest it cause thee to bounce upon thy buttocks in a most -untechnician-like manner. -% -The first duty of a revolutionary is to get away with it. - -- Abbie Hoffman -% -The first Great Steward, Parrafin the Climber, was employed in King -Chloroplast's kitchen as second scullery boy when the old King met a -tragic death. He apparently fell backward by accident on a dozen salad -forks. Simultaneously the true heir, his son Carotene, mysteriously -fled the city, complaining of some sort of plot and a lot of -threatening notes left on his breakfast tray. At the time, this looked -suspicious what with his father's death, and Carotene was suspected of -foul play. Then the rest of the King's relatives began to drop dead -one after the other in an odd fashion. Some were found strangled with -dishrags and some succumbed to food poisoning. A few were found -drowned in the soup vats, and one was attacked by assailants unknown -and beaten to death with a pot roast. At least three appear to have -thrown themselves backward on salad forks, perhaps in a noble gesture -of grief over the King's untimely end. Finally there was no one left -in Minas Troney who was either eligible or willing to wear the accursed -crown, and the rule of Twodor was up for grabs. The scullery slave -Parrafin bravely accepted the Stewardship of Twodor until that day when -a lineal descendant of Carotene's returns to reclaim his rightful -throne, conquer Twodor's enemies, and revamp the postal system. - -- Harvard Lampoon, "Bored of the Rings" -% -The first guy that rats gets a bellyful of slugs in the head. Understand? - -- Joey Glimco, trade unionist -% -The first half of our lives is ruined by our parents, -and the second half by our children. - -- Clarence Darrow -% -The first marriage is the triumph of imagination over intelligence, -and the second the triumph of hope over experience. -% -The first myth of management is that it exists. The second myth of -management is that success equals skill. - -- Robert Heller -% -The first requisite for immortality is death. - -- Stanislaw Lem -% -The first riddle I ever heard, one familiar to almost every Jewish -child, was propounded to me by my father: - "What is it that hangs on the wall, is green, wet -- and -whistles?" - I knit my brow and thought and thought, and in final perplexity -gave up. - "A herring," said my father. - "A herring," I echoed. "A herring doesn't hang on the wall!" - "So hang it there." - "But a herring isn't green!" I protested. - "Paint it." - "But a herring isn't wet." - "If it's just painted it's still wet." - "But -- " I sputtered, summoning all my outrage, "-- a herring -doesn't whistle!!" - "Right, " smiled my father. "I just put that in to make it -hard." - -- Leo Rosten, "The Joys of Yiddish" -% -The first Rotarian was the first man to call John the Baptist "Jack." - -- H. L. Mencken -% -The first rule of intelligent tinkering is to save all the parts. - -- Paul Erlich -% -The first rule of magic is simple. Don't waste your time waving your -hands and hoping when a rock or a club will do. - -- McCloctnik the Lucid -% -The First Rule of Program Optimization: - Don't do it. - -The Second Rule of Program Optimization (for experts only!): - Don't do it yet. - -- Michael Jackson -% -The first thing I do in the morning -is brush my teeth and sharpen my tongue. - -- Dorothy Parker -% -The first thing we do, let's kill all the lawyers. - -- William Shakespeare, "Henry VI", Part IV -% -The first time, it's a KLUDGE! -The second, a trick. -Later, it's a well-established technique! - -- Mike Broido, Intermetrics -% -The first version always gets thrown away. -% -The five rules of Socialism: - - 1. Don't think. - 2. If you do think, don't speak. - 3. If you think and speak, don't write. - 4. If you think, speak and write, don't sign. - 5. If you think, speak, write and sign, don't be surprised. - - -- being told in Poland, 1987 -% -...the flaw that makes perfection perfect. -% -The flow chart is a most thoroughly oversold piece of program documentation. - -- Frederick Brooks, Jr., "The Mythical Man-Month" -% -The flush toilet is the basis of Western civilization. - -- Alan Coult -% -The following quote is from page 4-27 of the MSCP Basic Disk Functions -Manual which is part of the UDA50 Programmers Doc Kit manuals: - -As stated above, the host area of a disk is structured as a vector of -logical blocks. From a performance viewpoint, however, it is more -appropriate to view the host area as a four dimensional hyper-cube, the -four dimensions being cylinder, group, track, and sector. - . . . -Referring to our hyper-cube analogy, the set of potentially accessible -blocks form a line parallel to the track axis. This line moves -parallel to the sector axis, wrapping around when it reaches the edge -of the hyper-cube. -% -The following statement is not true. -The previous statement is true. -% -The Following Subsume All Physical and Human Laws: - - 1. You can't push on a string. - 2. Ain't no free lunches. - 3. Them as has, gets. - 4. You can't win them all, but you sure as hell can lose them all. -% -The Force is what holds everything together. -It has its dark side, and it has its light side. -It's sort of like cosmic duct tape. -% -The [Ford Foundation] is a large body of money -completely surrounded by people who want some. - -- Dwight MacDonald -% -The forest is safe because a lion lives therein and the lion is safe -because it lives in a forest. Likewise the friendship of persons -rests on mutual help. - -- Laukikanyay -% -The fortune program is supported, in part, by user contributions -and by a major grant from the National Endowment for the Inanities. -% -The founding fathers tried to set up a judicial system where the accused -received a fair trial, not a system to insure an acquittal on technicalities. -% -The fountain code has been tightened slightly so you can no longer dip -objects into a fountain or drink from one while you are floating in mid-air -due to levitation. - Teleporting to hell via a teleportation trap will no longer occur -if the character does not have fire resistance. - -- README file from the NetHack game -% -The four building blocks of the universe are fire, water, gravel and -vinyl. - -- Dave Barry -% -[The French Riviera is] a sunny place for shady people. - -- W. Somerset Maugham -% -The full impact of parenthood doesn't hit you until you multiply the -number of your kids by thirty-two teeth. -% -The full potentialities of human fury cannot be reached until a friend -of both parties tactfully interferes. - -- G. K. Chesterton -% -The function of the expert is not to be more right than other people, -but to be wrong for more sophisticated reasons. - -- Dr. David Butler, British psephologist -% -The future is a myth created by insurance -salesmen and high school counselors. -% -The future is a race between education and catastrophe. - -- H. G. Wells -% -The future is going to be boring. - -- J. G. Ballard -% -The future isn't what it used to be. (It never was.) -% -The future lies ahead. -% -The future not being born, my friend, -we will abstain from baptizing it. - -- George Meredith -% -The garden is in mourning; -The rain falls cool among the flowers. -Summer shivers quietly -On its way towards its end. - -Golden leaf after leaf -Falls from the tall acacia. -Summer smiles, astonished, feeble, -In this dying dream of a garden. - -For a long while, yet, in the roses, -She will linger on, yearning for peace, -And slowly -Close her weary eyes. - -- Hermann Hesse, "September" -% -The generation of random numbers is too important to be left to chance. -% -The genius of our ruling class is that it has kept a majority of the -people from ever questioning the inequity of a system where most people -drudge along paying heavy taxes for which they get nothing in return. - -- Gore Vidal -% -The gent who wakes up and finds himself a success hasn't been asleep. -% -The gentlemen looked one another over with microscopic carelessness. -% -The giraffe you thought you offended last week is willing to be nuzzled -today. -% -The girl who remembers her first kiss now has a daughter who can't even -remember her first husband. -% -The girl who stoops to conquer usually wears a low-cut dress. -% -The girl who swears no one has ever made love to her has a right to swear. - -- Sophia Loren -% -The glances over cocktails -That seemed to be so sweet -Don't seem quite so amorous -Over Shredded Wheat -% -The goal of Computer Science is to build something that will last at -least until we've finished building it. -% -The goal of science is to build better mousetraps. -The goal of nature is to build better mice. -% -The gods gave man fire and he invented fire engines. -They gave him love and he invented marriage. -% -The Golden Rule is of no use to you whatever unless you realize it -is your move. - -- Frank Crane -% -The Golden Rule of Arts and Sciences: - He who has the gold makes the rules. -% -The good Christian should beware of mathematicians and all those who -make empty prophecies. The danger already exists that mathematicians -have made a covenant with the devil to darken the spirit and confine -man in the bonds of Hell. - -- St. Augustine -% -The good die young -- because they see it's no use living if you've got -to be good. - -- John Barrymore -% -The good (I am convinced, for one) -Is but the bad one leaves undone. -Once your reputation's done -You can live a life of fun. - -- Wilhelm Busch -% -The good life was so elusive -It really got me down -I had to regain some confidence -So I got into camouflage -% -The good time is approaching, -The season is at hand. -When the merry click of the two-base lick -Will be heard throughout the land. -The frost still lingers on the earth, and -Budless are the trees. -But the merry ring of the voice of spring -Is borne upon the breeze. - -- Ode to Opening Day, "The Sporting News", 1886 -% -The Gordian Maxim: -If a string has one end, it has another. -% -The government has just completed work on a missile that turned out -to be a bit of a boondoggle; nicknamed "Civil Servant", it won't work -and they can't fire it. -% -The government [is] extremely fond of amassing great quantities of -statistics. These are raised to the _nth degree, the cube roots are -extracted, and the results are arranged into elaborate and impressive -displays. What must be kept ever in mind, however, is that in every -case, the figures are first put down by a village watchman, and he puts -down anything he damn well pleases. - -- Sir Josiah Stamp -% -The Government just announced today the creation of the Neutron Bomb II. -Similar to the Neutron Bomb, the Neutron Bomb II not only kills people -and leaves buildings standing, but also does a little light housekeeping. -% -The government of the United States is not in any sense founded on the -Christian Religion - -- George Washington -% -The government was contemplating the dispatch of an expedition to Burma, -with a view to taking Rangoon, and a question arose as to who would be the -fittest general to be sent in command of the expedition. The Cabinet sent -for the Duke of Wellington, and asked his advice. He instantly replied, -"Send Lord Combermere." - "But we have always understood that your Grace thought Lord -Combermere a fool." - "So he is a fool, and a damned fool; but he can take Rangoon." - -- G. W. E. Russell -% -The goys have proven the following theorem... - -- Physicist John von Neumann, at the start of a classroom - lecture. -% -The grand leap of the whale up the Fall of Niagara is esteemed, by all -who have seen it, as one of the finest spectacles in nature. - -- Benjamin Franklin -% -The grass is always greener on the other side of your sunglasses. -% -The grave's a fine and private place, -but none, I think, do there embrace. - -- Andrew Marvell -% -The graveyards are full of indispensable men. - -- Charles de Gaulle -% -The Great Bald Swamp Hedgehog: - The Great Bald Swamp Hedgehog of Billericay displays, in -courtship, his single prickle and does impressions of Holiday Inn desk -clerks. Since this means him standing motionless for enormous periods -of time he is often eaten in full display by The Great Bald Swamp -Hedgehog Eater. - -- Mike Harding, "The Armchair Anarchist's Almanac" -% -The great merit of society is to make one appreciate solitude. - -- Charles Chincholles, "Reflections on the Art of Life" -% -The Great Movie Posters: - -*A Giggle Gurgling Gulp of Glee* -With Pretty Girls, Peppy Scenes, and Gorgeous Revues -- plus a good story. - -- Tea with a Kick (1924) - -Whoopie! Let's go!... Hand-picked Beauties doing cute tricks! -GET IN THE KNOW FOR THE HEY-HEY WHOOPIE! - -- The Wild Party (1929) - -YOU HEAR HIM MAKE LOVE! -DIX -- the dashing soldier! - DIX -- the bold adventurer! - DIX -- the throbbing lover! - -- The Wheel of Life (1929) - -SEE CHARLES BUTTERWORTH DRIVE A STREETCAR AND SING LOVE -SONGS TO HIS MARE "MITZIE"! - -- The Night is Young (1934) -% -The Great Movie Posters: - -A mis-spawned murderous abomination from the nether reaches of an -unimaginable hell. - -- The Killer of Castle Brood (1967) - -NEW -- SICKENING HORROR to make your STOMACH TURN and FLESH CRAWL! - -- Frankenstein's Bloody Terror (1968) - -LUST-MAD MEN AND LAWLESS WOMEN IN A VICIOUS AND SENSUOUS ORGY OF -SLAUGHTER! - -- Five Bloody Graves (1969) - -The family that slays together stays together. - -- Bloody Mama (1970) -% -The Great Movie Posters: - -An AVALANCHE of KILLER WORMS! - -- Squirm (1976) - -Most Movies Live Less Than Two Hours. -This Is One of Everlasting Torment! - -- The New House on the Left (1977) - -WE ARE GOING TO EAT YOU! - -- Zombie (1980) - -It's not human and it's got an axe. - -- The Prey (1981) -% -The Great Movie Posters: - -Different! Daring! Dynamic! Defying! Dumbfounding! -SEE Uncle Tom lead the Negroes to FREEDOM! -... Now, all the SENSUAL and VIOLENT passions Roots couldn't show on TV! - -- Uncle Tom's Cabin (1972) - -An appalling amalgam of carnage and carnality! - -- Flesh and Blood Show (1973) - -WHEN THE CATS ARE HUNGRY... -RUN FOR YOUR LIVES! -Alone, only a harmless pet... - One Thousand Strong, They Become a Man-Eating Machine! - -- The Night of a Thousand Cats (1972) - -They're Over-Exposed -But Not Under-Developed! - -- Cover Girl Models (1976) -% -The Great Movie Posters: - -HOODLUMS FROM ANOTHER WORLD ON A RAY-GUN RAMPAGE! - -- Teenagers from Outher Space (1959) - -Which will be Her Mate... MAN OR BEAST? -Meet Velda -- the Kind of Woman -- Man or Gorilla would kill... to Keep. - -- Untamed Mistress (1960) - -NOW AN ALL-MIGHTY ALL-NEW MOTION PICTURE BRINGS THEM TOGETHER FOR THE -FIRST TIME... HISTORY'S MOST GIGANTIC MONSTERS IN COMBAT ATOP MOUNT FUJI! - -- King Kong vs. Godzilla (1963) -% -The Great Movie Posters: - -HOT STEEL BETWEEN THEIR LEGS! - -- The Cycle Savages (1969) - -The Hand that Rocks the Cradle... Has no Flesh on It! - -- Who Slew Auntie Roo? (1971) - -TWO GREAT BLOOD HORRORS TO RIP OUT YOUR GUTS! - -- I Eat Your Skin & I Drink Your Blood (1971 double-bill) - -They Went In People and Came Out Hamburger! - -- The Corpse Grinders (1971) -% -The Great Movie Posters: - -KATHERINE HEPBURN as the lying, stealing, singing, preying witch girl -of the Ozarks... "Low down white trash"? Maybe so -- but let her hear -you say it and she'll break your head to prove herself a lady! - -- Spitfire (1934) - -Do Native Women Live With Apes? - -- Love Life of a Gorilla (1937) - -JUNGLE KISS!! - When she looked into his eyes, felt his arms around her -- she -was no longer Tura, mysterious white goddess of the jungle tribes -- -she was no longer the frozen-hearted high priestess under whose hypnotic -spell the worshipers of the great crocodile god meekly bowed -- she -was a girl in love! - SEE the ravening charge of the hundred scared CROCODILES! - -- Her Jungle Love (1938) - -LOVE! HATE! JOY! FEAR! TORMENT! PANIC! SHAME! RAGE! - -- Intermezzo (1939) -% -The Great Movie Posters: - -POWERFUL! SHOCKING! RAW! ROUGH! CHALLENGING! SEE A LITTLE GIRL MOLESTED! - -- Never Take Candy from a Stranger (1963) - -She Sins in Mobile -- -Marries in Houston -- -Loses Her Baby in Dallas -- -Leaves Her Husband in Tucson -- -MEETS HARRU IN SAN DIEGO!... -FIRST -- HARLOW! -THEN -- MONROE! -NOW -- McCLANAHAN!!! - -- The Rotten Apple (1963), Rue McClanahan - -*NOT FOR SISSIES! DON'T COME IF YOU'RE CHICKEN! -A Horrifying Movie of Weird Beauties and Shocking Monsters... -1001 WEIRDEST SCENES EVER!! MOST SHOCKING THRILLER OF THE CENTURY! - -- Teenage Psycho meets Bloody Mary (1964) (Alternate Title: - The Incredibly Strange Creatures Who Stopped Living and - Became Mixed Up Zombies) -% -The Great Movie Posters: - -SCENES THAT WILL STAGGER YOUR SIGHT! --- DANCING CALLED GO-GO --- MUSIC CALLED JU-JU --- NARCOTICS CALLED BANGI! --- FIRES OF PUBERTY! - SEE the burning of a virgin! - SEE power of witch doctor over women! - SEE pygmies with fantastic Physical Endowments!!! - -- Kwaheri (1965) - -The Big Comedy of Nineteen-Sexty-Sex! - -- Boeing-Boeing (1965) - -AN ASTRONAUT WENT UP- -A "GUESS WHAT" CAME DOWN! - The picture that comes complete with a 10-foot tall monster to -give you the wim-wams! - -- Monster a Go-Go (1965) -% -The Great Movie Posters: - -SEE rebel guerrillas torn apart by trucks! -SEE corpses cut to pieces and fed to dogs and vultures! -SEE the monkey trained to perform nursing duties for her paralyzed owner! - -- Sweet and Savage (1983) - -What a Guy! What a Gal! What a Pair! - -- Stroker Ace (1983) - -It's always better when you come again! - -- Porky's II: The Next Day (1983) - -You Don't Have to Go to Texas for a Chainsaw Massacre! - -- Pieces (1983) -% -The Great Movie Posters: - -SHE TOOK ON A WHOLE GANG! A howling hellcat humping a hot steel hog -on a roaring rampage of revenge! - -- Bury Me an Angel (1972) - -WHAT'S THE SECRET INGREDIENT USED BY THE MAD BUTCHER FOR HIS SUPERB -SAUSAGES? - -- Meat is Meat (1972) - -TODAY the Pond! -TOMORROW the World! - -- Frogs (1972) -% -The Great Movie Posters: - -She's got the biggest six-shooters in the West! - -- The Beautiful Blonde from Bashful Bend (1949) - -CAST OF 3,000! -4 WRITERS, -2 DIRECTORS, -3 CAMERAMEN, -3 PRODUCERS! -1 YEAR TO MAKE THIS FILM -- -24 YEARS TO REHEARSE -- -20 YEARS TO DISTRIBUTE! - BEAUTIFUL BEYOND WORDS! - AWE-INSPIRING! VITAL! -THE PRINCE OF PEACE PROVIDES THE ANSWER TO EVERY PROBLEM! -Be Brave-bring your troubles and your family to: - HISTORY'S MOST SUBLIME EVENT! YOU'LL FIND GOD RIGHT IN THERE! - -- The Prince of Peace (1948). Starring members of the - Wichita Mountain Pageant featuring Millard Coody as Jesus. -% -The Great Movie Posters: - -The Miracle of the Age!!! A LION in your lap! A LOVER in your arms! - -- Bwana Devil (1952) - -OVERWHELMING! ELECTRIFYING! BAFFLING! -Fire Can't Burn Them! Bullets Can't Kill Them! See the Unfolding of -the Mysteries of the Moon as Murderous Robot Monsters Descend Upon the -Earth! You've Never Seen Anything Like It! Neither Has the World! - SEE... Robots from Space in All Their Glory!!! - -- Robot Monster (1953) - -1,965 pyramids, 5,337 dancing girls, one million swaying bullrushes, -802 scared bulls! - -- The Egyptian (1954) -% -The Great Movie Posters: - -The nightmare terror of the slithering eye that unleashed agonizing -horror on a screaming world! - -- The Crawling Eye (1958) - -SEE a female colossus... her mountainous torso, skyscraper limbs, -giant desires! - -- Attack of the Fifty-Foot Woman (1958) - -Here Is Your Chance To Know More About Sex. -What Should a Movie Do? Hide It's Head in the Sand Like an Ostrich? -Or Face the JOLTING TRUTH as does... - -- The Desperate Women (1958) -% -The Great Movie Posters: - -They hungered for her treasure! And died for her pleasure! -SEE Man-Fish Battle Shark-Man-Killer! - -- The Golden Mistress (1954) - -See Jane Russell in 3-D; She'll Knock Both Your Eyes Out! - -- The French Line (1954) - -See Jane Russell Shake Her Tambourines... and Drive Cornel WILDE! - -- Hot Blood (1956) -% -The Great Movie Posters: - -When You're Six Tons -- And They Call You Killer -- It's Hard To Make -Friends... - -- Namu, the Killer Whale (1966) - -Meet the Girls with the Thermo-Nuclear Navels! - -- Dr. Goldfoot and the Girl Bombs (1966) - -A GHASTLY TALE DRENCHED WITH GOUTS OF BLOOD SPURTING FROM THE VICTIMS -OF A CRAZED MADMAN'S LUST. - -- A Taste of Blood (1967) -% -The great nations have always acted like gangsters and the small nations -like prostitutes. - -- Stanley Kubrick -% -The great question that has never been answered and which I have not -yet been able to answer despite my thirty years of research into the -feminine soul is: WHAT DOES A WOMAN WANT? - -- Sigmund Freud -% -The great secret in life ... [is] not to open your letters for a fortnight. -At the expiration of that period you will find that nearly all of them have -answered themselves. - -- Arthur Binstead -% -The greatest dangers to liberty lurk in insidious encroachment by men -of zeal, well-meaning but without understanding. - -- Justice Louis D. Brandeis -% -The greatest disloyalty one can offer to great pioneers -is to refuse to move an inch from where they stood. -% -The greatest griefs are those we cause ourselves. - -- Sophocles -% -The greatest joy a man can know is to conquer his enemies and drive them -before him. To ride their horses and take away their possessions. To see -the faces of those who were dear to them bedewed with tears, and to clasp -their wives and daughters to his arms. - -- Chinggis (Genghis) Khan -% -The greatest love is a mother's, then a dog's, then a sweetheart's. - -- Polish proverb -% -The Greatest Mathematical Error - The Mariner I space probe was launched from Cape Canaveral on 28 -July 1962 towards Venus. After 13 minutes' flight a booster engine would -give acceleration up to 25,820 mph; after 44 minutes 9,800 solar cells -would unfold; after 80 days a computer would calculate the final course -corrections and after 100 days the craft would circle the unknown planet, -scanning the mysterious cloud in which it is bathed. - However, with an efficiency that is truly heartening, Mariner I -plunged into the Atlantic Ocean only four minutes after takeoff. - Inquiries later revealed that a minus sign had been omitted from -the instructions fed into the computer. "It was human error", a launch -spokesman said. - This minus sign cost L4,280,000. - -- Stephen Pile, "The Book of Heroic Failures" -% -The greatest of faults is to be conscious of none. -% -The greatest productive force is human selfishness. - -- Robert A. Heinlein -% -The greatest remedy for anger is delay. -% -The groundhog is like most other prophets; -it delivers its message and then disappears. -% -The hand that feeds the chicken every day finally wrings its neck instead, -thus proving that more sophisticated views about the uniformity of nature -would have been useful to the chicken. - - -- Bertrand Russell, "On Induction" -% -The happiest time in any man's life is just after the first divorce. - -- J. K. Galbraith -% -The hardest part of climbing the ladder of -success is getting through the crowd at the bottom. -% -The hardest thing in the world to understand is the income tax. - -- Albert Einstein -% -The hardest thing is to disguise your feelings when -you put a lot of relatives on the train for home. -% -The hater of property and of government takes care to have his warranty -deed recorded, and the book written against fame and learning has the -author's name on the title page. - -- Ralph Waldo Emerson, "Journals" (1831) -% -The hatred of relatives is the most violent. - -- Tacitus (c.55 - c.117) -% -The health of a democratic society may be measured by the quality -of functions performed by private citizens. - -- Alexis de Tocqueville -% -The hearing ear is always found close to the speaking tongue, a custom -whereof the memory of man runneth not howsomever to the contrary, nohow. -% -The heart has its reasons which reason knows nothing of. - -- Blaise Pascal -% -The heart is wiser than the intellect. -% -...the heat come 'round and busted me for smiling on a cloudy day. -% -The heaviest object in the world is the -body of the woman you have ceased to love. - -- Marquis de Lac de Clapiers Vauvenargues -% -The Heineken Uncertainty Principle: - You can never be sure how many beers you had last night. -% -The help people need most urgently is -help in admitting that they need help. -% -The herd instinct among economists -makes sheep look like independent thinkers. -% -The heroic hours of life do not announce their presence by drum and trumpet, -challenging us to be true to ourselves by appeals to the martial spirit that -keeps the blood at heat. Some little, unassuming, unobtrusive choice presents -itself before us slyly and craftily, glib and insinuating, in the modest garb -of innocence. To yield to its blandishments is so easy. The wrong, it seems, -is venial... Then it is that you will be summoned to show the courage of -adventurous youth. - -- Benjamin Cardozo -% -The hieroglyphics are all unreadable except for a notation on the back, -which reads "Genuine authentic Egyptian papyrus. Guaranteed to be at -least 5000 years old." -% -The higher you climb, the more you show your ass. - -- Alexander Pope, "The Dunciad" -% -The History of every major Galactic Civilization tends to pass through -three distinct and recognizable phases, those of Survival, Inquiry, and -Sophistication, otherwise known as the How, Why, and Where phases. For -instance, the first phase is characterized by the question "How can we -eat?" the second by "Why do we eat?" and the third by "Where shall we -have lunch?". - -- Douglas Adams, "The Restaurant at the End of the Universe" -% -The history of warfare is similarly subdivided, although here the phases -are Retribution, Anticipation, and Diplomacy. Thus: - -Retribution: - I'm going to kill you because you killed my brother. -Anticipation: - I'm going to kill you because I killed your brother. -Diplomacy: - I'm going to kill my brother and then kill you on the - pretext that your brother did it. -% -The Hollywood tradition I like best is called "sucking up to the stars." - -- Johnny Carson -% -The honeymoon is not actually over until we cease -to stifle our sighs and begin to stifle our yawns. - -- Helen Rowland -% -The honeymoon is over when he phones to say he'll be late for supper and -she's already left a note that it's in the refrigerator. - -- Bill Lawrence -% -The horror... the horror! -% -The human animal differs from the lesser -primates in his passion for lists of "Ten Best". - -- H. Allen Smith -% -The human brain is a wonderful thing. It starts working the moment -you are born, and never stops until you stand up to speak in public. - -- Sir George Jessel -% -The human brain is like an enormous fish -- it is flat and slimy and -has gills through which it can see. - -- Monty Python -% -The human mind ordinarily operates at only ten percent of -its capacity -- the rest is overhead for the operating system. -% -The human mind treats a new idea the way the -body treats a strange protein: it rejects it. - -- P. Medawar -% -The human race has been fascinated by sharks for as long as I can remember. -Just like the bluebird feeding its young, or the spider struggling to weave -its perfect web, or the buttercup blooming in spring, the shark reveals to -us yet another of the infinite and wonderful facets of nature, namely the -facet that it can bite your head off. This causes us humans to feel a -certain degree of awe. - -- Dave Barry, "The Wonders of Sharks on TV" -% -The human race has one really effective weapon, and that is laughter. - -- Mark Twain -% -The human race is a race of cowards; and I am not only marching in that -procession but carrying a banner. - -- Mark Twain -% -The human race never solves any of its problems. It merely outlives them. - -- David Gerrold -% -The husband who doesn't tell his wife everything probably reasons -that what she doesn't know won't hurt him. - -- Leo J. Burke -% -The IBM 2250 is impressive ... -if you compare it with a system selling for a tenth its price. - -- D. Cohen -% -The IBM purchase of ROLM gives new meaning to the term "twisted pair". - -- Howard Anderson, "Yankee Group" -% -The idea is to die young as late as possible. - -- Ashley Montague -% -The idea that an arbitrary naive human should be able to properly use a given -tool without training or understanding is even more wrong for computing than -it is for other tools (e.g. automobiles, airplanes, guns, power saws). - -- Doug Gwyn -% -The idea there was that consumers would bring their broken electronic -devices, such as television sets and VCR's, to the destruction centers, -where trained personnel would whack them (the devices) with -sledgehammers. With their devices thus permanently destroyed, -consumers would then be free to go out and buy new devices, rather than -have to fritter away years of their lives trying to have the old ones -repaired at so-called "factory service centers," which in fact consist -of two men named Lester poking at the insides of broken electronic -devices with cheap cigars and going, "Lookit all them WIRES in there!" - -- Dave Barry, "'Mister Mediocre' Restaurants" -% -The ideal voice for radio may be defined as showing no substance, -no sex, no owner, and a message of importance for every housewife. - -- Harry V. Wade -% -The ideas of economists and political philosophers, both when they -are right and when they are wrong, are more powerful than is generally -understood. Indeed, the world is ruled by little else. - -- John Maynard Keynes -% -The identical is equal to itself, since it is different. - -- Franco Spisani -% -The idle man does not know what it is to enjoy rest. -% -The idle mind knows not what it is it wants. - -- Quintus Ennius -% -The illegal we do immediately. The unconstitutional takes a bit -longer. - -- Henry Kissinger -% -The Illiterati Programus Canto 1: - A program is a lot like a nose: - Sometimes it runs, and sometimes it blows. -% -The important thing is not to stop questioning. -% -The important thing to remember about walking on eggs is not to hop. -% -The income tax has made more liars out of the American people than golf -has. Even when you make a tax form out on the level, you don't know -when it's through if you are a crook or a martyr. - -- Will Rogers -% -The individual choice of garnishment of a burger can be an important -point to the consumer in this day when individualism is an increasingly -important thing to people. - -- Donald N. Smith, president of Burger King -% -The infliction of cruelty with a good conscience is -a delight to moralists. That is why they invented hell. - -- Bertrand Russell -% -The inherent vice of capitalism is the unequal sharing of blessings; -the inherent virtue of socialism is the equal sharing of misery. - -- Winston Churchill -% -The instruments of science do not in themselves discover truth. And -there are searchings that are not concluded by the coincidence of a -pointer and a mark. - -- Fred Saberhagen, "The Berserker Wars" -% -The intelligence of any discussion diminishes with the square of the -number of participants. - -- Adam Walinsky -% -The introduction of a new kind of music must be shunned as imperiling -the whole state, for styles of music are never disturbed without -affecting the most important political institutions. ... The new -style, gradually gaining a lodgement, quietly insinuates itself into -manners and customs, and from it ... goes on to attack laws and -constitutions, displaying the utmost impudence, until it ends by -overturning everything. - -- Plato, "Republic", 370 B.C. -% -The IQ of the group is the lowest IQ of a member of -the group divided by the number of people in the group. -% -The IRS spends God knows how much of your tax money on these toll-free -information hot lines staffed by IRS employees, whose idea of a -dynamite tax tip is that you should print neatly. If you ask them a -real tax question, such as how you can cheat, they're useless. - -So, for guidance, you want to look to big business. Big business never -pays a nickel in taxes, according to Ralph Nader, who represents a big -consumer organization that never pays a nickel in taxes... - -- Dave Barry, "Sweating Out Taxes" -% -The Israelis are the Doberman pinschers of the Middle East. They -treat the Arabs like postmen. - -- Franklyn Ajaye -% -The Israelites were all waiting anxiously at the foot of the mountain, -knowing that Moses had had a tough day negotiating with God over the -Commandments. Finally a tired Moses came into sight. - "I've got some good news and some bad news, folks," he said. "The -good news is that I got Him down to ten. The bad news is that adultery's -still in." -% -The Junior God now heads the roll -In the list of heaven's peers; -He sits in the House of High Control, -And he regulates the spheres. -Yet does he wonder, do you suppose, -If, even in gods divine, -The best and wisest may not be those -Who have wallowed awhile with the swine? - -- R. W. Service -% -The justifications for drug testing are part of the presently fashionable -debate concerning restoring America's "competitiveness." Drugs, it has been -revealed, are responsible for rampant absenteeism, reduced output, and poor -quality work. But is drug testing in fact rationally related to the -resurrection of competitiveness? Will charging the atmosphere of the -workplace with the fear of excretory betrayal honestly spur productivity? -Much noise has been made about rehabilitating the worker using drugs, but -to date the vast majority of programs end with the simple firing or the not -hiring of the abuser. This practice may exacerbate, not alleviate, the -nation's productivity problem. If economic rehabilitation is the ultimate -goal of drug testing, then criteria abandoning the rehabilitation of the -drug-using worker is the purest of hypocrisy and the worst of rationalization. - -- The concluding paragraph of "Constitutional Law: The - Fourth Amendment and Drug Testing in the Workplace," - Tim Moore, Harvard Journal of Law & Public Policy, vol. - 10, No. 3 (Summer 1987), pp. 762-768. -% -The Ken Thompson school of thought on expert systems: -there's table lookup, fraud, and grand fraud. - -- Andrew Hume -% -The Kennedy Constant: - Don't get mad -- get even. -% -The key elements in human thinking are not numbers but labels of fuzzy sets. - -- L. Zadeh -% -The key to building a superstar is to keep their mouth shut. To reveal -an artist to the people can be to destroy him. It isn't to anyone's -advantage to see the truth. - -- Bob Ezrin, rock music producer -% -The Killer Ducks are coming!!! -% -The kind of danger people most enjoy is -the kind they can watch from a safe place. -% -The King and his advisor are overlooking the battle field: - -King: "How goes the battle plan?" -Advisor: "See those little black specks running to the right?" -K: "Yes." -A: "Those are their guys. And all those little red specks running - to the left are our guys. Then when they collide we wait till - the dust clears." -K: "And?" -A: "If there are more red specks left than black specks, we win." -K: "But what about the ^#!!$% battle plan?" -A: "So far, it seems to be going according to specks." -% -The knowledge that makes us cherish -innocence makes innocence unattainable. - -- Irving Howe -% -The Kosher Dill was invented in 1723 by Joe Kosher and Sam Dill. It is -the single most popular pickle variety today, enjoyed throughout the free -world by man, woman and child alike. An astounding 350 billion kosher -dills are eaten each year, averaging out to almost 1/4 pickle per person -per day. New York Times food critic Mimi Sheraton says "The kosher dill -really changed my life. I used to enjoy eating McDonald's hamburgers and -drinking Iron City Lite, and then I encountered the kosher dill pickle. -I realized that there was far more to haute cuisine then I'd ever imagined. -And now, just look at me." -% -The ladies men admire, I've heard, -Would shudder at a wicked word. -Their candle gives a single light; -They'd rather stay at home at night. -They do not keep awake till three, -Nor read erotic poetry. -They never sanction the impure, -Nor recognize an overture. -They shrink from powders and from paints... -So far, I've had no complaints. - -- Dorothy Parker -% -The language of politics is poetry, not prose. Jackson is poetry. -Cuomo is poetry. Dukakis is a word processor. - -- Richard M. Nixon, on Meet the Press, April, 1988 -% -The last good thing written in C was Franz Schubert's Symphony No. 9. - -- Werner Trobin -% -The last person that quit or was fired will be held responsible for -everything that goes wrong -- until the next person quits or is fired. -% -The last person who said that (God rest his soul) lived to regret it. -% -The last thing one knows in constructing a work is what to put first. - -- Blaise Pascal -% -The last time I saw him he was walking down Lover's Lane holding his own -hand. - -- Fred Allen -% -The last time somebody said, "I find I can write much better with a word -processor.", I replied, "They used to say the same thing about drugs." - -- Roy Blount, Jr. -% -The last vestiges of the old Republic have been swept away. - -- Governor Tarkin -% -The Law, in its majestic equality, forbids the rich, as well as the poor, -to sleep under the bridges, to beg in the streets, and to steal bread. - -- Anatole France -% -The Law of the Letter: - The best way to inspire fresh thoughts is to seal the envelope. -% -The Law of the Perversity of Nature: - You cannot determine beforehand which side of the bread to butter. -% -The law will never make men free; it is men who have got to make the -law free. - -- Henry David Thoreau -% -The lawgiver, of all beings, most owes the law allegiance. He of all men -should behave as though the law compelled him. But it is the universal -weakness of mankind that what we are given to administer we presently imagine -we own. - -- H. G. Wells -% -The Least Perceptive Literary Critic - The most important critic in our field of study is Lord Halifax. A -most individual judge of poetry, he once invited Alexander Pope round to -give a public reading of his latest poem. - Pope, the leading poet of his day, was greatly surprised when Lord -Halifax stopped him four or five times and said, "I beg your pardon, Mr. -Pope, but there is something in that passage that does not quite please me." - Pope was rendered speechless, as this fine critic suggested sizeable -and unwise emendations to his latest masterpiece. "Be so good as to mark -the place and consider at your leisure. I'm sure you can give it a better -turn." - After the reading, a good friend of Lord Halifax, a certain Dr. -Garth, took the stunned Pope to one side. "There is no need to touch the -lines," he said. "All you need do is leave them just as they are, call on -Lord Halifax two or three months hence, thank him for his kind observation -on those passages, and then read them to him as altered. I have known him -much longer than you have, and will be answerable for the event." - Pope took his advice, called on Lord Hallifax and read the poem -exactly as it was before. His unique critical faculties had lost none of -their edge. "Ay", he commented, "now they are perfectly right. Nothing can -be better." - -- Stephen Pile, "The Book of Heroic Failures" -% -The Least Successful Animal Rescue - The firemen's strike of 1978 made possible one of the great animal -rescue attempts of all time. Valiantly, the British Army had taken over -emergency firefighting and on 14 January they were called out by an elderly -lady in South London to retrieve her cat which had become trapped up a -tree. They arrived with impressive haste and soon discharged their duty. -So grateful was the lady that she invited them all in for tea. Driving off -later, with fond farewells completed, they ran over the cat and killed it. - -- Stephen Pile, "The Book of Heroic Failures" -% -The Least Successful Collector - Betsy Baker played a central role in the history of collecting. She -was employed as a servant in the house of John Warburton (1682-1759) who had -amassed a fine collection of 58 first edition plays, including most of the -works of Shakespeare. - One day Warburton returned home to find 55 of them charred beyond -legibility. Betsy had either burned them or used them as pie bottoms. The -remaining three folios are now in the British Museum. - The only comparable literary figure was the maid who in 1835 burned -the manuscript of the first volume of Thomas Carlyle's "The History of the -French Revolution", thinking it was wastepaper. - -- Stephen Pile, "The Book of Heroic Failures" -% -The Least Successful Defrosting Device - The all-time record here is held by Mr. Peter Rowlands of Lancaster -whose lips became frozen to his lock in 1979 while blowing warm air on it. - "I got down on my knees to breathe into the lock. Somehow my lips -got stuck fast." - While he was in the posture, an old lady passed an inquired if he -was all right. "Alra? Igmmlptk", he replied at which point she ran away. - "I tried to tell her what had happened, but it came out sort of... -muffled," explained Mr. Rowlands, a pottery designer. - He was trapped for twenty minutes ("I felt a bit foolish") until -constant hot breathing brought freedom. He was subsequently nicknamed "Hot -Lips". - -- Stephen Pile, "The Book of Heroic Failures" -% -The Least Successful Equal Pay Advertisement - In 1976 the European Economic Community pointed out to the Irish -Government that it had not yet implemented the agreed sex equality -legislation. The Dublin Government immediately advertised for an equal pay -enforcement officer. The advertisement offered different salary scales for -men and women. - -- Stephen Pile, "The Book of Heroic Failures" -% -The Least Successful Executions - History has furnished us with two executioners worthy of attention. -The first performed in Sydney in Australia. In 1803 three attempts were -made to hang a Mr. Joseph Samuels. On the first two of these the rope -snapped, while on the third Mr. Samuels just hung there peacefully until he -and everyone else got bored. Since he had proved unsusceptible to capital -punishment, he was reprieved. - The most important British executioner was Mr. James Berry who -tried three times in 1885 to hang Mr. John Lee at Exeter Jail, but on each -occasion failed to get the trap door open. - In recognition of this achievement, the Home Secretary commuted -Lee's sentence to "life" imprisonment. He was released in 1917, emigrated -to America and lived until 1933. - -- Stephen Pile, "The Book of Heroic Failures" -% -The Least Successful Police Dogs - America has a very strong candidate in "La Dur", a fearsome looking -schnauzer hound, who was retired from the Orlando police force in Florida -in 1978. He consistently refused to do anything which might ruffle or -offend the criminal classes. - His handling officer, Rick Grim, had to admit: "He just won't go up -and bite them. I got sick and tired of doing that dog's work for him." - The British contenders in this category, however, took things a -stage further. "Laddie" and "Boy" were trained as detector dogs for drug -raids. Their employment was terminated following a raid in the Midlands in -1967. - While the investigating officer questioned two suspects, they -patted and stroked the dogs who eventually fell asleep in front of the -fire. When the officer moved to arrest the suspects, one dog growled at -him while the other leapt up and bit his thigh. - -- Stephen Pile, "The Book of Heroic Failures" -% -The less a statesman amounts to, the more he loves the flag. - -- Kin Hubbard -% -The less time planning, the more time programming. -% -THE LESSER-KNOWN PROGRAMMING LANGUAGES #10 -- SIMPLE - - SIMPLE is an acronym for Sheer Idiot's Monopurpose Programming -Language Environment. This language, developed at the Hanover College -for Technological Misfits, was designed to make it impossible to write -code with errors in it. The statements are, therefore, confined to BEGIN, -END and STOP. No matter how you arrange the statements, you can't make a -syntax error. Programs written in SIMPLE do nothing useful, thus achieving -the results of programs written in other languages without the tedious, -frustrating process of testing and debugging. -% -THE LESSER-KNOWN PROGRAMMING LANGUAGES #12 -- LITHP - - This otherwise unremarkable language, originally developed in San -Francisco, is distinguished by the absence of an "S" in its character set; -users must substitute "TH". LITHP is thaid to be utheful in protheththing -lithtth. -% -THE LESSER-KNOWN PROGRAMMING LANGUAGES #13 -- SLOBOL - - SLOBOL is best known for the speed, or lack of it, of its compiler. -Although many compilers allow you to take a coffee break while they compile, -SLOBOL compilers allow you to travel to Bolivia to pick the beans. Forty- -three programmers are known to have died of boredom sitting at their terminals -while waiting for a SLOBOL program to compile. Weary SLOBOL programmers -often turn to a related (but infinitely faster) language, COCAINE. -% -THE LESSER-KNOWN PROGRAMMING LANGUAGES #14 -- VALGOL - - From its modest beginnings in Southern California's San Fernando -Valley VALGOL is enjoying a dramatic surge of popularity across the -industry. VALGOL commands include REALLY, LIKE, WELL, and Y*KNOW. -Variables are assigned with the =LIKE and =TOTALLY operators. Other -operators include the "California booleans", AX and NOWAY. Loops are -accomplished with the FOR SURE construct. A simple example: - - LIKE, Y*KNOW(I MEAN)START - IF PIZZA =LIKE BITCHEN AND - GUY =LIKE TUBULAR AND - VALLEY GIRL =LIKE GRODY**MAX(FERSURE)**2 - THEN - FOR I =LIKE 1 TO OH*MAYBE 100 - DO*WAH - (DITTY**2); BARF(I)=TOTALLY GROSS(OUT) - SURE - LIKE, BAG THIS PROGRAM; REALLY; LIKE TOTALLY(Y*KNOW); IM*SURE - GOTO THE MALL - - VALGOL is also characterized by its unfriendly error messages. For -example, when the user makes a syntax error, the interpreter displays the -message GAG ME WITH A SPOON! A successful compile may be termed MAXIMALLY -AWESOME! -% -THE LESSER-KNOWN PROGRAMMING LANGUAGES #17 -- DOGO - - Developed at the Massachusetts Institute of Obedience Training, DOGO -DOGO heralds a new era of computer-literate pets. DOGO commands include -SIT, STAY, HEEL, and ROLL OVER. An innovative feature of DOGO is "puppy -graphics", a small cocker spaniel that occasionally leaves a deposit as -it travels across the screen. -% -THE LESSER-KNOWN PROGRAMMING LANGUAGES #17 -- SARTRE - - Named after the late existential philosopher, SARTRE is an extremely -unstructured language. Statements in SARTRE have no purpose; they just are. -Thus SARTRE programs are left to define their own functions. SARTRE -programmers tend to be boring and depressed, and are no fun at parties. -% -THE LESSER-KNOWN PROGRAMMING LANGUAGES #18 -- C- - - This language was named for the grade received by its creator when -he submitted it as a class project in a graduate programming class. C- is -best described as a "low-level" programming language. In fact, the language -generally requires more C- statements than machine-code statements to execute -a given task. In this respect, it is very similar to COBOL. -% -THE LESSER-KNOWN PROGRAMMING LANGUAGES #18 -- FIFTH - - FIFTH is a precision mathematical language in which the data types -refer to quantity. The data types range from CC, OUNCE, SHOT, and JIGGER to -FIFTH (hence the name of the language), LITER, MAGNUM and BLOTTO. Commands -refer to ingredients such as CHABLIS, CHARDONNAY, CABERNET, GIN, VERMOUTH, -VODKA, SCOTCH, BOURBON, and WHATEVERSAROUND. - The many versions of the FIFTH language reflect the sophistication and -financial status of its users. Commands in the ELITE dialect include VSOP and -LAFITE, while commands in the GUTTER dialect include HOOTCH, THUNDERBIRD, -RIPPLE and HOUSERED. The latter is a favorite of frustrated FORTH programmers -who end up using this language. -% -THE LESSER-KNOWN PROGRAMMING LANGUAGES #5 -- LAIDBACK - - LAIDBACK was developed at the (now defunct) Marin County Center for -T'ai Chi, Mellowness and Computer Programming, as an alternative to the more -intense languages of nearby Silicon Valley. - The Center was ideal for programmers who liked to soak in hot tubs -while they worked. Unfortunately, few programmers could survive there long, -since the Center outlawed pizza and RC Cola in favor of bean curd and Perrier. - Many mourn the demise of LAIDBACK because of its reputation as a -gentle and nonthreatening language. For example, LAIDBACK responded to -syntax errors with the message SORRY MAN, I JUST CAN'T DEAL BEHIND THAT. -% -The liberals can understand everything but people who don't understand them. - -- Lenny Bruce -% -The life which is unexamined is not worth living. - -- Plato -% -The light at the end of the tunnel is the headlight of an approaching -train. -% -The light at the end of the tunnel may be an oncoming dragon. -% -The light of a hundred stars does not equal the light of the moon. -% -The Linimon's Rule About PRs: The More You Close, The More Will Come -% -The lion and the calf shall lie down -together but the calf won't get much sleep. - -- Woody Allen -% -The little girl expects no declaration of tenderness from her doll. -She loves it -- and that's all. It is thus that we should love. - -- DeGourmont -% -The little pieces of my life I give to you, -with love, to make a quilt to keep away the cold. -% -The little town that time forgot, -Where all the women are strong, -The men are good-looking, -And the children above-average. - -- Prairie Home Companion -% -The local minister noticed a little girl standing outside of his -door with a basket of kittens. - "Hello, little girl, what do you have there?" - "These are my Democratic kittens," she replied. -Amused, the pastor said nothing. Two weeks later he saw the same little -girl with (apparently) the same basket of kittens. - "My, I see you still have your Democratic kittens.", he said. - "No, you see, these are Republican kittens," she answered. - "Two weeks ago they were Democratic kittens," he replied, puzzled. - "Two weeks ago they had their eyes closed." -% -The `loner' may be respected, but he is always resented by his colleagues, -for he seems to be passing a critical judgment on them, when he may be -simply making a limiting statement about himself. - -- Sidney Harris -% -The longer I am out of office, the more infallible I appear to myself. - -- Henry Kissinger -% -The longer the title, the less important the job. -% -The longest part of the journey is said to be the passing of the gate. - -- Marcus Terentius Varro -% -The Lord gave us farmers two strong hands so we could grab as much as -we could with both of them. - -- Joseph Heller, "Catch-22" -% -The Lord giveth and the Lord taketh away. -Indian Giver be the name of the Lord. -% -The Lord prefers common-looking people. That is the reason that He makes -so many of them. - -- Abraham Lincoln -% -The louder he talked of his honour, the faster we counted our spoons. - -- Ralph Waldo Emerson -% -The lovely woman-child Kaa was mercilessly chained to the cruel post of -the warrior-chief Beast, with his barbarian tribe now stacking wood at -her nubile feet, when the strong clear voice of the poetic and heroic -Handsomas roared, "Flick your Bic, crisp that chick, and you'll feel my -steel through your last meal!" - -- Winning sentence, 1984 Bulwer-Lytton bad fiction contest -% -The luck that is ordained for you will be coveted by others. -% -The lunatic, the lover, and the poet, -Are of imagination all compact... - -- William Shakespeare, "A Midsummer Night's Dream" -% -The Macintosh is Xerox technology at its best. -% -The magic of our first love is our ignorance that it can ever end. - -- Benjamin Disraeli -% -The main problem I have with cats is, they're not dogs. - -- Kevin Cowherd -% -The major advances in civilization are processes -that all but wreck the societies in which they occur. - -- A. N. Whitehead -% -The major difference between bonds and bond traders is that the -bonds will eventually mature. -% -The major sin is the sin of being born. - -- Samuel Beckett -% -The majority of husbands remind me of an orangutan trying to play -the violin. - -- Honore de Balzac -% -The majority of the stupid is invincible and guaranteed for all time. -The terror of their tyranny, however, is alleviated by their lack of -consistency. - -- Albert Einstein -% -The makers may make, -And the users may use, -But the fixers must fix -With but minimal clues. -% -The man she had was kind and clean -And well enough for every day, -But oh, dear friends, you should have seen -The one that got away. - -- Dorothy Parker, "The Fisherwoman" -% -The Man Who Almost Invented The Vacuum Cleaner - The man officially credited with inventing the vacuum cleaner is -Hubert Cecil Booth. However, he got the idea from a man who almost -invented it. - In 1901 Booth visited a London music-hall. On the bill was an -American inventor with his wonder machine for removing dust from carpets. - The machine comprised a box about one foot square with a bag on top. -After watching the act -- which made everyone in the front six rows sneeze --- Booth went round to the inventor's dressing room. - "It should suck not blow," said Booth, coming straight to the -point. "Suck?", exclaimed the enraged inventor. "Your machine just moves -the dust around the room," Booth informed him. "Suck? Suck? Sucking is -not possible," was the inventor's reply and he stormed out. Booth proved -that it was by the simple expedient of kneeling down, pursing his lips and -sucking the back of an armchair. "I almost choked," he said afterwards. - -- Stephen Pile, "The Book of Heroic Failures" -% -The man who follows the crowd will usually get no further than the crowd. -The man who walks alone is likely to find himself in places no one has ever -been. - -- Alan Ashley-Pitt -% -The man who has never been flogged has never been taught. - -- Menander -% -The man who laughs has not yet been told the terrible news. - -- Bertolt Brecht -% -The man who raises a fist has run out of ideas. - -- H. G. Wells, "Time After Time" -% -The man who runs may fight again. - -- Menander -% -The man who sees, on New Year's day, Mount -Fuji, a hawk, and an eggplant is forever blessed. - -- Old Japanese proverb -% -The man who sets out to carry a cat by its tail learns something that -will always be useful and which never will grow dim or doubtful. - -- Mark Twain -% -The man who understands one woman is -qualified to understand pretty well everything. - -- Yeats -% -The man with the best job in the country is the Vice President. All he has -to do is get up every morning and say, "How's the President?" - -- Will Rogers - -The vice-presidency ain't worth a pitcher of warm spit. - -- Vice President John Nance Garner -% -The Marines: - The few, the proud, the dead on the beach. -% -The Marines: - The few, the proud, the not very bright. -% -The mark of a good party is that you wake up the next morning -wanting to change your name and start a new life in different city. - -- Vance Bourjaily, "Esquire" -% -The mark of the immature man is that he wants to die nobly for a cause, -while the mark of a mature man is that he wants to live humbly for one. - -- Wilhelm Stekel -% -The mark of your ignorance is the depth of your belief in injustice -and tragedy. What the caterpillar calls the end of the world, the -master calls a butterfly. - -- Messiah's Handbook: Reminders for the Advanced Soul -% -The marriage of Marxism and feminism has been like the marriage of -husband and wife depicted in English common law: Marxism and feminism -are one, and that one is Marxism. - -- Heidi Hartmann, - "The Unhappy Marriage of Marxism and Feminism" -% -The Martian Canals were clearly the Martian's last ditch effort! -% -The marvels of today's modern technology include the development of a -soda can, which, when discarded will last forever -- and a $7,000 car -which, when properly cared for, will rust out in two or three years. -% -The mate for beauty should be a man and not a money chest. - -- Bulwer -% -The mature Bohemian is one whose woman works full time. -% -The means-and-ends moralists, or non-doers, -always end up on their ends without any means. - -- Saul Alinsky -% -The meat is rotten, but the booze is holding out. -Computer translation of "The spirit is willing, but the flesh is weak." -% -The meek don't want it. -% -The meek inherit the earth -- usually in small sections... about 6 by 3. -% -The meek shall inherit the earth -- they are too weak to refuse. -% -The meek shall inherit the earth; but by that -time there won't be anything left worth inheriting. -% -The meek shall inherit the earth, but *not* its mineral rights. - -- J. P. Getty -% -The meek shall inherit the earth; the rest of us, the Universe. -% -The meek shall inherit the earth; the rest of us will go to the stars. -% -The meek shall inherit the Earth. -(But they're gonna have to fight for it.) -% -The meek will inherit the earth -- if that's OK with you. -% -The meeting of two personalities is like the contact of two -chemical substances: if there is any reaction, both are transformed. - -- Carl G. Jung -% -[The members of the Chamberlain government] are decided only to be -undecided, resolved to be irresolute, adamant for drift, all-powerful -for impotency. - -- Winston Churchill -% -The men sat sipping their tea in silence. After a while the klutz said, - "Life is like a bowl of sour cream." - "Like a bowl of sour cream?" asked the other. "Why?" - "How should I know? What am I, a philosopher?" -% -The meta-Turing test counts a thing as intelligent if it seeks to -devise and apply Turing tests to objects of its own creation. - -- Lew Mammel, Jr. -% -The Microsoft Exchange MTA Stacks service depends on the Microsoft Exchange -System Attendant service which failed to start because of the following -error: - -The operation completed successfully. - -For more information, see Help and Support Center at -https://go.microsoft.com/fwlink/events.asp. -% -The minute a man is convinced that he is interesting, he isn't. -% -The mirror sees the man as beautiful, the mirror loves the man; another -mirror sees the man as frightful and hates him; and it is always the same -being who produces the impressions. - -- Marquis D. A. F. de Sade -% -The misnaming of fields of study is so common as to lead to what might be -general systems laws. For example, Frank Harary once suggested the law that -any field that had the word "science" in its name was guaranteed thereby -not to be a science. He would cite as examples Military Science, Library -Science, Political Science, Homemaking Science, Social Science, and Computer -Science. Discuss the generality of this law, and possible reasons for its -predictive power. - -- Gerald Weinberg, "An Introduction to General Systems - Thinking" -% -The Modelski Chain Rule: -1: Look intently at the problem for several minutes. Scratch your - head at 20-30 second intervals. Try solving the problem on your - Hewlett-Packard. -2: Failing this, look around at the class. Select a particularly - bright-looking individual. -3: Procure a large chain. -4: Walk over to the selected student and threaten to beat him severely - with the chain unless he gives you the answer to the problem. - Generally, he will. It may also be a good idea to give him a sound - thrashing anyway, just to show you mean business. -% -The modern child will answer you back before you've said anything. - -- Dr. Laurence J. Peter -% -"The molars, I'm sure, will be all right, the molars can take care of -themselves," the old man said, no longer to me. "But what will become -of the bicuspids?" - -- The Old Man and his Bridge -% -The mome rath isn't born that could outgrabe me. - -- Nicol Williamson -% -The moon is a planet just like the Earth, only it is even deader. -% -The moon is made of green cheese. - -- John Heywood -% -The moon may be smaller than Earth, but it's further away. -% -The Moral Majority is neither. -% -The more control, the more that requires control. -% -The more cordial the buyers secretary, the greater -the odds that the competition already has the order. -% -The more crap you put up with, the more crap you are going to get. -% -The more data I punch in this card, the lighter it becomes, and the -lower the mailing cost. - -- Stan Kelly-Bootle, "The Devil's DP Dictionary" -% -The more I know men the more I like my horse. -% -The more I see of men the more I admire dogs. - -- Mme De Sevigne (1626-1696) -% -The more I want to get something done, the less I call it work. - -- Richard Bach, "Illusions" -% -The more laws and order are made prominent, -the more thieves and robbers there will be. - -- Lao Tsu -% -The more the merrier. - -- John Heywood -% -The more they over-think the plumbing -the easier it is to stop up the drain. -% -The more things change, the more they remain the same. - -- Alphonse Karr -% -The more things change, the more they stay insane. -% -The more things change, the more they'll never be the same again. -% -The more we disagree, the more chance -there is that at least one of us is right. -% -The more you complain, the longer God lets you live. -% -The more you sweat in peace, the less you bleed in war. -% -The Moscow Evening News advertised a contest for the best political joke. -First prize was ten years in prison; second prize, five years; third prize, -three years; and there were six honorable mentions of one year each. -% -The mosquito exists to keep the mighty humble. -% -The mosquito is the state bird of New Jersey. - -- Andy Warhol -% -The moss on the tree does not fear the talons of the hawk. -% -The most advantageous, pre-eminent thing thou canst do is not to -exhibit nor display thyself within the limits of our galaxy, but -rather depart instantaneously whence thou even now standest and -flee to yet another rotten planet in the universe, if thou canst -have the good fortune to find one. - -- Carlyle -% -The most common given name in the world is Mohammad; the most common -family name in the world is Chang. Can you imagine the enormous number -of people in the world named Mohammad Chang? - -- Derek Wills -% -The most costly of all follies is to believe passionately -in the palpably not true. It is the chief occupation of mankind. - -- H. L. Mencken -% -The most dangerous food is wedding cake. - -- American proverb -% -The most dangerous organization in America today is: - - a) The KKK - b) The American Nazi Party - c) The Delta Frequent Flyer Club -% -The most delightful day after the one on which you buy a cottage in -the country is the one on which you resell it. - -- J. Brecheux -% -The most difficult thing about surviving AIDS -is trying to convince your parents that you're Haitian. -% -The most difficult thing in the world is to know how to do a thing and -to watch someone else do it wrong without comment. - -- Theodore H. White -% -The most difficult years of marriage are those following the wedding. -% -The most disagreeable thing that your worst enemy says to your face does -not approach what your best friends say behind your back. - -- Alfred De Musset -% -The most exciting phrase to hear in science, the one that heralds new -discoveries, is not "Eureka!" (I found it!) but "That's funny ..." - -- Isaac Asimov -% -The most exquisite peak in culinary art is conquered when you do right by a -ham, for a ham, in the very nature of the process it has undergone since last -it walked on its own feet, combines in its flavor the tang of smoky autumnal -woods, the maternal softness of earthy fields delivered of their crop children, -the wineyness of a late sun, the intimate kiss of fertilizing rain, and the -bite of fire. You must slice it thin, almost as thin as this page you hold -in your hands. The making of a ham dinner, like the making of a gentleman, -starts a long, long time before the event. - -- W. B. Courtney, "Reflections of Maryland Country Ham", - from "Congress Eate It Up" -% -...the most exquisitely squalid hells known to middle-class man: -freshman English at a Midwestern university. - -- Tom Wolfe -% -The most happy marriage I can imagine to myself would be the union -of a deaf man to a blind woman. - -- Samuel T. Coleridge -% -The most hopelessly stupid man is he who is not aware that he is wise. -% -The most important early product on the way -to developing a good product is an imperfect version. -% -The most important service rendered by the press is that of educating -people to approach printed matter with distrust. -% -The most important thing in a relationship between a man and a woman -is that one of them be good at taking orders. - -- Linda Festa -% -The most important things, each person must do for himself. -% -The most popular labor-saving device today is still a husband with money. - -- Joey Adams, "Cindy and I" -% -The most recent attempt to revive the moribund campus left, a national -conference held at Rutgers University February 5-7, ended when the -participants decided that they were too racist to found a new national -organization. - The stated goal of the conference was the formation of a national -organization that would "give expression to a shared consciousness." The -orientation materials declared that this was "a historic moment" -- you -know, like Port Huron and the Sixties -- and the Rutgers host committee had -every reason to expect their goal would be accomplished. - But it was not to be. Given that this was a conference of *New* -New Leftists, reason had nothing to do with it. - A revealing article by Vania del Borgo and Maria Margaronis in "The -Nation", ["Beyond the Fragments," 3/26/88] says "The defining moment of the -weekend came when the conference was almost at its end. On Sunday morning, -a twenty-five-member students of color caucus confronted the assembled body -with its overwhelming whiteness..." Joined by the Gay & Bisexual Caucus, the -Students of Color Caucus declared that the founding of such an overwhelmingly -white organization would itself constitute a racist act. The four hundred or -so leftist activists were told that they had no right to ratify a constitution -or elect any officers. While recognizing "the need to examine the real -possibilities of a broad-based, racially diverse student movement" and paying -lip service to the need for "dialogue," they threatened to walk out if their -demands were not met. As *The Nation* article describes the scene: "To their -astonishment, their intervention was greeted with a standing ovation." Handed -an ultimatum which demanded that they disband, this would-be successor to the -radical student movements of the Sixties promptly voted itself out of -existence. As del Borgo and Margaronis put it, "After much chaotic discussion -and a confused voice vote, the convention suspended all its other work and -broke into regional groups to discuss `outreach.'" - -- Libertarian Agenda, May 1988 -% -The most remarkable thing about my mother is that for thirty years she -served the family nothing but leftovers. The original meal has never -been found. - -- Calvin Trillin -% -The most serious doubt that has been thrown on the authenticity of the -biblical miracles is the fact that most of the witnesses in regard to -them were fishermen. - -- Arthur Binstead -% -The Most Unsuccessful Version Of The Bible - The most exciting version of the Bible was printed in 1631 by Robert -Barker and Martin Lucas, the King's printers at London. It contained -several mistakes, but one was inspired -- the word "not" was omitted from -the Seventh Commandment and enjoined its readers, on the highest authority, -to commit adultery. - Fearing the popularity with which this might be received in remote -country districts, King Charles I called all 1,000 copies back in and fined -the printers L3,000. - -- Stephen Pile, "The Book of Heroic Failures" -% -The most winning woman I ever knew was hanged for poisoning three little -children for their insurance money. - -- Sherlock Holmes -% -The moving cursor writes, and having written, blinks on. -% -The Moving Finger writes; and, having writ, - Moves on: nor all they Piety nor Wit -Shall lure it back to cancel half a Line, - Nor all thy Tears wash out a Word of it. -% -The myth of romantic love holds that once you've fallen in love with the -perfect partner, you're home free. Unfortunately, falling out of love -seems to be just as involuntary as falling into it. -% -The naked truth of it is, I have no shirt. - -- William Shakespeare, "Love's Labour's Lost" -% -The nation that controls magnetism controls the universe. - -- Chester Gould/Dick Tracy -% -The National Association of Theater Concessionaires reported that in -1986, 60% of all candy sold in movie theaters was sold to Roger Ebert. - -- David Letterman -% -The National Short-Sleeved Shirt Association says: - Support your right to bare arms! -% -The nearer to the church, the further from God. - -- John Heywood -% -The Net interprets censorship as damage and routes around it. - -- John Gilmore -% -The net is like a vast sea of lutefisk with tiny dinosaur brains embedded -in it here and there. Any given spoonful will likely have an IQ of 1, but -occasional spoonfuls may have an IQ more than six times that! - -- James "Kibo" Parry -% -The net of law is spread so wide, -No sinner from its sweep may hide. -Its meshes are so fine and strong, -They take in every child of wrong. -O wondrous web of mystery! -Big fish alone escape from thee! - -- James Jeffrey Roche -% -The new Congressmen say they're going to turn the government around. -I hope I don't get run over again. -% -The New England Journal of Medicine reports that 9 out of 10 -doctors agree that 1 out of 10 doctors is an idiot. -% -THE NEW RIGHT: - A javelin team that elects to receive. -% -The New Testament offers the basis for modern computer coding theory, -in the form of an affirmation of the binary number system. - - But let your communication be Yea, yea; nay, nay: - for whatsoever is more than these cometh of evil. - - -- Matthew 5:37 -% -The New York Times is read by the people who run the country. The -Washington Post is read by the people who think they run the country. -The National Enquirer is read by the people who think Elvis is alive -and running the country ... - -- Robert J. Woodhead -% -The next person to mention spaghetti stacks -to me is going to have his head knocked off. - -- Bill Conrad -% -The next thing I say to you will be true. -The last thing I said was false. -% -The nice thing about egotists is that they don't talk about other people. - -- Lucille S. Harper -% -The nice thing about standards -is that there are so many of them to choose from. - -- Andrew S. Tanenbaum -% -The nicest thing about the Alto is that it doesn't run faster at night. -% -The night passes quickly when you're asleep -But I'm out shufflin' for something to eat -... -Breakfast at the Egg House, -Like the waffle on the griddle, -I'm burnt around the edges, -But I'm tender in the middle. - -- Adrian Belew -% -The notes blatted skyward as the rose over the Canada geese, feathered -rumps mooning the day, webbed appendages frantically pedaling unseen -bicycles in their search for sustenance, driven by cruel Nature's maxim, -'Ya wanna eat, ya gotta work,' and at last I knew Pittsburgh. - -- Winning sentence, 1987 Bulwer-Lytton bad fiction contest -% -The notion of a "record" is an obsolete -remnant of the days of the 80-column card. - -- Dennis M. Ritchie -% -The notion that the church, the press, and the universities should -serve the state is essentially a Communist notion ... In a free society -these institutions must be wholly free -- which is to say that their -function is to serve as checks upon the state. - -- Alan Barth -% -The number of arguments is unimportant unless some of them are -correct. - -- Ralph Hartley -% -The number of computer scientists in a room is inversely -proportional to the number of bugs in their code. -% -The number of feet in a yard is directly proportional to the success -of the barbecue. -% -The number of licorice gumballs you get out of a gumball machine -increases in direct proportion to how much you hate licorice. -% -The number of UNIX installations has grown to 10, with more expected. - -- The Unix Programmer's Manual, 2nd Edition, June 1972 -% -The NY Times is read by the people who run the country. The Washington Post -is read by the people who think they run the country. The National Enquirer -is read by the people who think Elvis is alive and running the country. - -- Robert Woodhead -% -The objective of all dedicated employees should be to thoroughly analyze -all situations, anticipate all problems prior to their occurrence, have -answers for these problems, and move swiftly to solve these problems -when called upon. - However... -When you are up to your ass in alligators it is difficult to remind -yourself your initial objective was to drain the swamp. -% -The odds are a million to one against your being one in a million. -% -The Official Colorado State Vegetable is now the "state legislator". -% -The Official MBA Handbook on business cards: - - Avoid overly pretentious job titles such as "Lord of the - Realm, Defender of the Faith, Emperor of India" or "Director - of Corporate Planning." -% -The Official MBA Handbook on doing company business on an airplane: - - Do not work openly on top-secret company cost documents unless - you have previously ascertained that the passenger next to you - is blind, a rock musician on mood-ameliorating drugs, or the - unfortunate possessor of a forty-seventh chromosome. -% -The Official MBA Handbook on the use of sunlamps: - - Use a sunlamp only on weekends. That way, if the office wise guy - remarks on the sudden appearance of your tan, you can fabricate - some story about a sun-stroked weekend at some island Shangri-La - like Caneel Bay. Nothing is more transparent than leaving the - office at 11:45 on a Tuesday night, only to return an Aztec sun - god at 8:15 the next morning. -% -The old complaint that mass culture is designed for eleven-year-olds -is of course a shameful canard. The key age has traditionally been -more like fourteen. - -- Robert Christgau, "Esquire" -% -The old man had lived all his life in a little house on the Vermont side of the -New Hampshire-Vermont border. One day, the surveyors came to inform him that -they had just discovered that he lived in New Hampshire, not Vermont. - "Thank heavens!" was his heartfelt reply. "I don't think I could have -taken another one of those damned Vermont winters!" -% -THE OLD POOL SHOOTER had won many a game in his life. But now it was time -to hang up the cue. When he did, all the other cues came crashing to the -floor. - -"Sorry," he said with a smile. - -- Jack Handey, "The New Mexican" (1988) -% -The older a man gets, the farther he had to walk to school as a boy. -% -The older I grow, the less important the comma becomes. -Let the reader catch his own breath. - -- Elizabeth Clarkson Zwart -% -The older I grow, the more I distrust the -familiar doctrine that age brings wisdom. - -- H. L. Mencken -% -The one charm of marriage is that it makes a life of deception a necessity. - -- Oscar Wilde -% -The one good thing about repeating your -mistakes is that you know when to cringe. -% -The one L lama, he's a priest -The two L llama, he's a beast -And I will bet my silk pyjama -There isn't any three L lllama. - -- Ogden Nash, to which a fire chief replied that occasionally - his department responded to something like a "three L lllama." -% -The One Page Principle: - A specification that will not fit on one page of 8.5x11 inch paper - cannot be understood. - -- Mark Ardis -% -The one sure way to make a lazy man look -respectable is to put a fishing rod in his hand. -% -The only alliance I would make with the Women's Liberation Movement is in bed. - -- Abbey Hoffman -% -The only certainty is that nothing is certain. - -- Pliny the Elder -% -The only constant is change. -% -The only cultural advantage LA has over NY is that you can make a -right turn on a red light. - -- Woody Allen -% -The only difference between a car salesman and a computer salesman is -that the car salesman knows he's lying. -% -The only difference between a rut and a grave is their dimensions. -% -The only difference between the saint and the sinner is that -every saint has a past and every sinner has a future. - -- Oscar Wilde -% -The only difference in the game of love over the last few -thousand years is that they've changed trumps from clubs to diamonds. - -- The Indianapolis Star -% -The only function of economic forecasting is to make astrology look -respectable. - -- John Kenneth Galbraith -% -The only happiness lies in reason; all the rest of the world is dismal. -The highest reason, however, I see in the work of the artist, and he may -experience it as such. Happiness lies in the swiftness of feeling and -thinking: all the rest of the world is slow, gradual and stupid. Whoever -could feel the course of a light ray would be very happy, for it is very -swift. Thinking of oneself gives little happiness. If, however, one feels -much happiness in this, it is because at bottom one is not thinking of -oneself but of one's ideal. This is far, and only the swift shall reach -it and are delighted. - -- Friedrich Nietzsche -% -The only "ism" Hollywood believes in is plagiarism. - -- Dorothy Parker -% -The only justification for our concepts and systems of concepts is -that they serve to represent the complex of our experiences; -beyond this they have no legitimacy. - -- Albert Einstein -% -The only one of your children who does not grow up and move away -is your husband. -% -The only people for me are the mad ones -- the ones who are mad to live, -mad to talk, mad to be saved, desirous of everything at the same time, -the ones who never yawn or say a commonplace thing, but burn, burn, burn -like fabulous yellow Roman candles. - -- Jack Kerouac, "On the Road" -% -The only people who make love all the time are liars. - -- Louis Jordan -% -The only perfect science is hind-sight. -% -The only person who always got his work done by Friday was Robinson Crusoe. -% -The only possible interpretation of any research -whatever in the "social sciences" is: some do, some don't. - -- Ernest Rutherford -% -The only problem with being a man of leisure -is that you can never stop and take a rest. -% -The only problem with seeing too much is that it makes you insane. - -- Phaedrus -% -The only promotion rules I can think of are that a sense of shame is to -be avoided at all costs and there is never any reason for a hustler to -be less cunning than more virtuous men. Oh yes ... whenever you think -you've got something really great, add ten per cent more. - -- Bill Veeck -% -The only qualities for real success in journalism are ratlike cunning, a -plausible manner and a little literary ability. The capacity to steal -other people's ideas and phrases ... is also invaluable. - -- Nicolas Tomalin, "Stop the Press, I Want to Get On" -% -The only real advantage to punk music is that nobody can whistle it. -% -The only real argument for marriage is that it remains the best method -for getting acquainted. - -- Heywood Broun -% -The only real way to look younger is not to be born so soon. - -- Charles Schulz, "Things I've Had to Learn Over and - Over and Over" -% -The only really decent thing to do behind a person's back is pat it. -% -The only really good place to buy lumber is at a store where the lumber -has already been cut and attached together in the form of furniture, -finished, and put inside boxes. - -- Dave Barry, "The Taming of the Screw" -% -The only really masterful noise a man makes in a house is the noise -of his key, when he is still on the landing, fumbling for the lock. - -- Colette -% -The only reward of virtue is virtue. - -- Ralph Waldo Emerson -% -The only rose without thorns is friendship. -% -The only thing better than love is milk. -% -The only thing cheaper than hardware is talk. -% -The only thing that experience teaches us is that experience teaches -us nothing. - -- Andre Maurois (Emile Herzog) -% -The only thing that stops God from sending a second Flood is that -the first one was useless. - -- Nicolas Chamfort -% -The only thing we learn from history is that we do not learn. - -- Earl Warren - -That men do not learn very much from history is the most important of all -the lessons that history has to teach. - -- Aldous Huxley - -We learn from history that we do not learn from history. - -- Georg Wilhelm Friedrich Hegel - -HISTORY: Papa Hegel he say that all we learn from history is that we learn -nothing from history. I know people who can't even learn from what happened -this morning. Hegel must have been taking the long view. - -- Chad C. Mulligan, "The Hipcrime Vocab" -% -The only thing we learn from history is that we learn nothing from -history. - -- Georg Wilhelm Friedrich Hegel - -I know guys can't learn from yesterday ... Hegel must be taking the -long view. - -- John Brunner, "Stand on Zanzibar" -% -The only thing which separates man from child is all the values -he has lost over the years. - -- Poul Henningsen (1894-1967) -% -The only time a dog gets complimented is when he doesn't do anything. - -- C. Schultz -% -The only two things that motivate me and that matter to me are revenge -and guilt. - -- Elvis Costello -% -The only way to amuse some people -is to slip and fall on an icy pavement. -% -The only way to get rid of a temptation is to yield to it. - -- Oscar Wilde -% -The only way to keep your health is to eat what you don't want, -drink what you don't like, and do what you'd rather not. - -- Mark Twain -% -The only winner in the War of 1812 was Tchaikovsky. - -- David Gerrold -% -The onset and the waning of love make themselves felt -in the uneasiness experienced at being alone together. - -- Jean de la Bruyere -% -The opossum is a very sophisticated animal. It doesn't even get up -until 5 or 6 PM. -% -The opposite of a correct statement is a false statement. But the opposite -of a profound truth may well be another profound truth. - -- Niels Bohr -% -The opposite of a profound truth may well be another profound truth. - -- Niels Bohr -% -The opposite of talking isn't listening. The opposite of talking is -waiting. - -- Fran Lebowitz, "Social Studies" -% -The optimist thinks that this is the best of all possible worlds, -and the pessimist knows it. - -- J. Robert Oppenheimer, "Bulletin of Atomic Scientists" - -Yet creeds mean very little, Coth answered the dark god, still speaking -almost gently. The optimist proclaims that we live in the best of all -possible worlds; and the pessimist fears this is true. - -- James Cabell, "The Silver Stallion" -% -The optimum committee has no members. - -- Norman Augustine -% -The opulence of the front office door varies -inversely with the fundamental solvency of the firm. -% -The orders come down and they march us away. -There's a battle outside and we join in the fray. -God, it's hell when you know this could be your last day, -But it's better than working for Xerox. - -- Frank Hayes, "Don't Ask" -% -The other day I put instant coffee in my microwave oven ... I almost -went back in time. - -- Steven Wright -% -The other day I... uh, no, that wasn't me. - -- Steven Wright -% -The other line moves faster. -% -The owner of a large furniture store in the mid-west arrived in France on -a buying trip. As he was checking into a hotel he struck up an acquaintance -with a beautiful young lady. However, she only spoke French and he only spoke -English, so each couldn't understand a word the other spoke. He took out a -pencil and a notebook and drew a picture of a coach. She smiled, nodded her -head and they went for a ride in the park. Later, he drew a picture of a -table in a restaurant with a question mark and she nodded, so they went to -dinner. After dinner he sketched two dancers and she was delighted. They -went to several nightclubs, drank champagne, danced and had a glorious -evening. It had gotten quite late when she motioned for the pencil and drew -a picture of a four-poster bed. He was dumbfounded, and to this day has -never been able to understand how she knew he was in the furniture business. -% -The part of the world that people find most puzzling is the part called "Me". -% -The party adjourned to a hot tub, yes. Fully clothed, I might add. - -- IBM employee, testifying in California State Supreme Court -% -The passionate young thing was having a difficult time getting across what -she wanted from her rather dense boyfriend. Finally she asked, - "Would you like to see where I was operated on for appendicitis?" - "Gosh, no!" he replied. "I hate hospitals." -% -The past always looks better than it was. -It's only pleasant because it isn't here. - -- Finley Peter Dunne (Mr. Dooley) -% -The penalty for laughing in a courtroom is six months in jail; if it -were not for this penalty, the jury would never hear the evidence. - -- H. L. Mencken -% -The people sensible enough to give -good advice are usually sensible enough to give none. -% -The perfect friend sees the best in you -- sees it constantly -- -not just when you occasionally are that way, but also when you -waver, when you forget yourself, act like less than you are. -In time, you become more like his vision of you -- which is the -person you have always wanted to be. - -- Nancy Friday -% -The perfect lover is one who turns into a pizza at 4:00 A.M. - -- Charles Pierce -% -The perfect man is the true partner. Not a bed partner nor a fun partner, -but a man who will shoulder burdens equally with [you] and possess that -quality of joy. - -- Erica Jong -% -The person who makes no mistakes does not usually make anything. -% -The person who marries for money usually earns every penny of it. -% -The person who's taking you to lunch has no intention of paying. -% -The person you rejected yesterday could make you happy, if you say yes. -% -The personal computer market is about the same size as the total potato chip -market. Next year it will be about half the size of the pet food market and -is fast approaching the total worldwide sales of pantyhose" - -- James Finke, Commodore Int'l Ltd., 1982 -% -The philosopher's treatment of a question -is like the treatment of an illness. - -- Wittgenstein -% -The Phone Booth Rule: - A lone dime always gets the number nearly right. -% -The Pig, if I am not mistaken, -Gives us ham and pork and Bacon. -Let others think his heart is big, -I think it stupid of the Pig. - -- Ogden Nash -% -The pitcher wound up and he flang the ball at the batter. The batter swang -and missed. The pitcher flang the ball again and this time the batter -connected. He hit a high fly right to the center fielder. The center -fielder was all set to catch the ball, but at the last minute his eyes were -blound by the sun and he dropped it. - -- Dizzy Dean -% -The plot was designed in a light vein that somehow became varicose. - -- David Lardner -% -The Poems, all three hundred of them, -may be summed up in one of their phrases: -"Let our thoughts be correct". - -- Confucius -% -The Poet Whose Badness Saved His Life - The most important poet in the seventeenth century was George -Wither. Alexander Pope called him "wretched Wither" and Dryden said of his -verse that "if they rhymed and rattled all was well". - In our own time, "The Dictionary of National Biography" notes that his -work "is mainly remarkable for its mass, fluidity and flatness. It usually -lacks any genuine literary quality and often sinks into imbecile doggerel". - High praise, indeed, and it may tempt you to savour a typically -rewarding stanza: It is taken from "I loved a lass" and is concerned with -the higher emotions. - She would me "Honey" call, - She'd -- O she'd kiss me too. - But now alas! She's left me - Falero, lero, loo. - Among other details of his mistress which he chose to immortalize -was her prudent choice of footwear. - The fives did fit her shoe. - In 1639 the great poet's life was endangered after his capture by -the Royalists during the English Civil War. When Sir John Denham, the -Royalist poet, heard of Wither's imminent execution, he went to the King and -begged that his life be spared. When asked his reason, Sir John replied, -"Because that so long as Wither lived, Denham would not be accounted the -worst poet in England." - -- Stephen Pile, "The Book of Heroic Failures" -% -The poetry of heroism appeals irresistibly to those who don't go to a war, -and even more so to those whom the war is making enormously wealthy." - -- Celine -% -The point is, you see, that there is no point in driving yourself mad -trying to stop yourself going mad. You might just as well give in and -save your sanity for later. -% -The polite thing to do has always been to address people as they wish to be -addressed, to treat them in a way they think dignified. But it is equally -important to accept and tolerate different standards of courtesy, not -expecting everyone else to adapt to one's own preferences. Only then can -we hope to restore the insult to its proper social function of expressing -true distaste. - -- Judith Martin, "Miss Manners' Guide to Excruciatingly - Correct Behavior" -% -The politician is someone who deals in man's problems of adjustment. -To ask a politician to lead us is to ask the tail of a dog to lead the dog. - -- Buckminster Fuller -% -The pollution's at that awkward stage. -Too thick to navigate and too thin to cultivate. - -- Doug Sneyd -% -The porcupine with the sharpest quills gets stuck on a tree more -often. -% -The possession of a book becomes a substitute for reading it. - -- Anthony Burgess -% -The powers not delegated to the United States by the Constitution, nor -prohibited by it to the States, are reserved to the States respectively, -or to the people. - -- U.S. Constitution, Amendment 10. (Bill of Rights) -% -The Preacher, the Politician, the Teacher, - Were each of them once a kiddie. -A child, indeed, is a wonderful creature. - Do I want one? God Forbiddie! - -- Ogden Nash -% -The President publicly apologized today to all those offended by his -brother's remark, "There's more Arabs in this country than there is -Jews!". Those offended include Arabs, Jews, and English teachers. - -- Baltimore, Channel 11 News, on Jimmy Carter -% -The prettiest women are almost always the most -boring, and that is why some people feel there is no God. - -- Woody Allen, "Without Feathers" -% -The price of greatness is responsibility. -% -The price of seeking to force our beliefs on others is that someday -they might force their beliefs on us. - -- Mario Cuomo -% -The price of success in philosophy is triviality. - -- C. Glymour -% -The price one pays for pursuing any profession, or calling, is an intimate -knowledge of its ugly side. - -- James Baldwin -% -The primary cause of failure in electrical appliances is an expired -warranty. Often, you can get an appliance running again simply by -changing the warranty expiration date with a 15/64-inch felt-tipped -marker. - -- Dave Barry, "The Taming of the Screw" -% -The primary function of the design engineer is to make things -difficult for the fabricator and impossible for the serviceman. -% -The primary purpose of the DATA statement is to give names to constants; -instead of referring to pi as 3.141592653589793 at every appearance, the -variable PI can be given that value with a DATA statement and used instead -of the longer form of the constant. This also simplifies modifying the -program, should the value of pi change. - -- FORTRAN manual for Xerox Computers -% -The primary requisite for any new tax law is for it to exempt enough -voters to win the next election. -% -The primary theme of SoupCon is communication. The acronym "LEO" -represents the secondary theme: - - Law Enforcement Officials - -The overall theme of SoupCon shall be: - - Avoiding Communication with Law Enforcement Officials - -- M. Gallaher -% -The probability of someone watching you is directly -proportional to the stupidity of your action. -% -The problem ... is that we have run out of dinosaurs to form oil with. -Scientists working for the Department of Energy have tried to form oil -using other animals; they've piled thousands of tons of sand and Middle -Eastern countries on top of cows, raccoons, haddock, laboratory rats, -etc., but so far all they have managed to do is run up an enormous -bulldozer-rental bill and anger a lot of Middle Eastern persons. None -of the animals turned into oil, although most of the laboratory rats -developed cancer. - -- Dave Barry, "Postpetroleum Guzzler" -% -The problem that we thought was a problem was, indeed, -a problem, but not the problem we thought was the problem. - -- Mike Smith -% -The problem with any unwritten law is that -you don't know where to go to erase it. - -- Glaser and Way -% -The problem with graduate students, in general, is that they have -to sleep every few days. -% -The problem with me is that I am fifty or one hundred years ahead of my -time. My speed is very fast. Some ministers have had to drop out of my -government because they could not keep up. - -- Idi Amin Dada -% -The problem with most conspiracy theories is that they seem to believe that -for a group of people to behave in a way detrimental to the common good -requires intent. -% -The problem with people who have no vices is that generally you can -be pretty sure they're going to have some pretty annoying virtues. - -- Elizabeth Taylor -% -The problem with the gene pool is that there is no lifeguard. -% -The problem with this country is that there is no death penalty -for incompetence. -% -The problems of business administration in general, and database management in -particular are much too difficult for people that think in IBMese, compounded -with sloppy English. - -- Edsger W. Dijkstra -% -The profession of book writing makes horse racing seem like a solid, -stable business. - -- John Steinbeck -% -The program isn't debugged until the last user is dead. -% -The proof of the pudding is in the eating. - -- Miguel de Cervantes -% -The proof that IBM didn't invent the car is that it has a steering wheel -and an accelerator instead of spurs and ropes, to be compatible with a -horse. - -- Jac Goudsmit -% -The propriety of some persons seems to consist in having improper -thoughts about their neighbours. - -- F. H. Bradley -% -The Psblurtex is an 18-inch long anaconda that hides in the gentlemen's -outfitting departments of Amazonian stores and is often bought by mistake -since its colors are those of the London Reform Club. Once tied around its -victim's neck, it strangles him gently and then claims the insurance before -running off to Germany where it lives in hiding. - -- Mike Harding, "The Armchair Anarchist's Almanac" -% -The public demands certainties; it must be told definitely and a bit -raucously that this is true and that is false. But there are no -certainties. - -- H. L. Mencken, "Prejudice" -% -The Public is merely a multiplied "me." - -- Mark Twain -% -The Puritan hated bear-baiting, not because it gave pain to the bear, but -because it gave pleasure to the spectators. - -- Thomas Macaulay, "History of England" -% -The purpose of Physics 7A is to make the engineers realize that they're -not perfect, and to make the rest of the people realize that they're not -engineers. -% -The qotc (quote of the con) was Liz's: - "My brain is paged out to my liver" -% -The quality of a pun is in the "Oy!" of the beholder. -% -The Queen is most anxious to enlist every one who can speak or write to -join in checking this mad, wicked folly of "Woman's Rights", with all its -attendant horrors, on which her poor feeble sex is bent, forgetting every -sense of womanly feeling and propriety. Lady-- ought to get a good -whipping. It is a subject which makes the Queen so furious that she cannot -contain herself. God created men and women different -- then let them -remain each in their own position. - -- Letter to Sir Theodore Martin, 29 May 1870, from - Queen Victoria -% -The question is, why are politicians so eager to be president? What is -it about the job that makes it worth revealing, on national television, -that you have the ethical standards of a slime-coated piece of -industrial waste? - -- Dave Barry, "On Presidential Politics" -% -The questions remain the same. -The answers are eternally variable. -% -The Rabbits The Cow -Here is a verse about rabbits The cow is of the bovine ilk; -That doesn't mention their habits. One end is moo, the other, milk. - -- Ogden Nash -% -The race is not always to the swift, nor the -battle to the strong, but that's the way to bet. - -- Damon Runyon -% -The rain it raineth on the just -And also on the unjust fella: -But chiefly on the just, because -The unjust steals the just's umbrella. - -- Lord Bowen -% -The Ranger isn't gonna like it, Yogi. -% -The rate at which a disease spreads through a corn field is a precise -measurement of the speed of blight. -% -The ratio of literacy to illiteracy is a constant, but nowadays the -illiterates can read. - -- Alberto Moravia -% -The reader this message encounters not failing to understand is -cursed. -% -The real man's Bloody Mary: - Ingredients: vodka, tomato juice, Tabasco, Worcestershire - sauce, A-1 steak sauce, ice, salt, pepper, celery. - - Fill a large tumbler with vodka. - Throw all the other ingredients away. -% -The real problem with hunting elephants carrying the decoys. -% -The real purpose of books is to trap the mind into doing its own thinking. - -- Christopher Morley -% -The real reason large families benefit society is because at least -a few of the children in the world shouldn't be raised by beginners. -% -The real reason psychology is hard is that -psychologists are trying to do the impossible. -% -The real trouble with reality is that there's no background music. -% -The reason computer chips are so small is computers don't eat much. -% -The reason it's called "Grape Nuts" is that it contains "dextrose", -which is also sometimes called "grape sugar", and also because "Grape -Nuts" is catchier, in terms of marketing, than "A Cross Between Gerbil -Food and Gravel", which is what it tastes like. - -- Dave Barry, "Tips for Writer's" -% -The reason people sweat is so they won't catch fire when making love. - -- Don Rose -% -The reason that every major university maintains a department of -mathematics is that it's cheaper than institutionalizing all those -people. -% -The reason they're called wisdom teeth -is that the experience makes you wise. -% -The reason we come up with new versions is not to fix bugs. It's -absolutely not. - -- Bill Gates -% -The reason why worry kills more people -than work is that more people worry than work. -% -The reasonable man adapts himself to the world; the unreasonable one -persists in trying to adapt the world to himself. Therefore all -progress depends on the unreasonable man. - -- George Bernard Shaw -% -The reasons that each of these countries has had to renege on its -financial commitments were all somewhat different: Argentina because of -a war, Poland because of its vast misguided overinvestment in heavy -industry, Honduras because the coffee price went sour, Zaire because -nobody in the government there has a clue as to how to run a country. - -- Paul Erdman's Money Book -% -The relative importance of files depends on their cost -in terms of the human effort needed to regenerate them. - -- T. A. Dolotta -% -The requirements of romantic love are difficult to satisfy in the trunk -of a Dodge Dart. - -- Lisa Alther -% -The Reverend Henry Ward Beecher -Called a hen a most elegant creature. - The hen, pleased with that, - Laid an egg in his hat -- -And thus did the hen reward Beecher. - -- Oliver Wendell Holmes -% -The reverse side also has a reverse side. - -- Japanese proverb -% -The revolution will not be televised. -% -The reward for working hard is more hard work. -% -The reward of a thing well done is to have done it. - -- Ralph Waldo Emerson -% -The rhino is a homely beast, -For human eyes he's not a feast. -Farewell, farewell, you old rhinoceros, -I'll stare at something less prepoceros. - -- Ogden Nash -% -The rich get rich, and the poor get poorer. -The haves get more, the have-nots die. -% -The right half of the brain controls the left half of the body. -This means that only left handed people are in their right mind. -% -The Right Honorable Gentleman is indebted to his memory for his jests -and to his imagination for his facts. - -- Sheridan -% -The right to be heard does not automatically include the right to be -taken seriously. - -- Hubert H. Humphrey -% -The right to be let alone is indeed the beginning of all freedom. - -- Justice Douglas -% -The right to revolt has sources deep in our history. - -- Supreme Court Justice William O. Douglas -% -The rights and interests of the laboring man will be protected and cared -for not by our labor agitators, but by the Christian men to whom God in his -infinite wisdom has given control of property interests of the country, and -upon the successful management of which so much remains. - -- George F. Baer, railroad industrialist -% -The rights you have are the rights given you by this Committee [the -House Un-American Activities Committee]. We will determine what rights -you have and what rights you have not got. - -- J. Parnell Thomas -% -The ripest fruit falls first. - -- William Shakespeare, "Richard II" -% -The road to Hades is easy to travel. - -- Bion -% -The road to hell is paved with good intentions. And littered with -sloppy analysis! -% -The road to hell is paved with NAND gates. - -- J. Gooding -% -The road to ruin is always in good repair, -and the travellers pay the expense of it. - -- Josh Billings -% -The Roman Rule - The one who says it cannot be done should never interrupt the - one who is doing it. -% -The root of all superstition is that men -observe when a thing hits, but not when it misses. - -- Francis Bacon -% -The rose of yore is but a name, mere names are left to us. -% -The Ruffed Pandanga of Borneo and Rotherham spreads out his feathers in -his courtship dance and imitates Winston Churchill and Tommy Cooper on -one leg. The padanga is dying out because the female padanga doesn't -take it too seriously. - -- Mike Harding, "The Armchair Anarchist's Almanac" -% -The rule is, jam to-morrow and jam yesterday, but never jam today. - -- Lewis Carroll, "Alice's Adventures in Wonderland" (1865) -% -The rule on staying alive as a forecaster is to give 'em a number or -give 'em a date, but never give 'em both at once. - -- Jane Bryant Quinn -% -The rules are rather simple to understand: Under democracy you -can defend any view, but only defend it. You can not try to realize -it through power, violence or weapons. - -- Poul Henningsen (1894-1967) -% -The rules: - -1: Thou shalt not worship other computer systems. -2: Thou shalt not impersonate Liberace or eat watermelon while sitting at - the console keyboard. -3: Thou shalt not slap users on the face, nor staple their silly little - card decks together. -4: Thou shalt not get physically involved with the computer system, - especially if you're already married. -5: Thou shalt not use magnetic tapes as Frisbees, nor use a disk pack as - a stool to reach another disk pack. -6: Thou shalt not stare at the blinking lights for more than one 8 hour - shift. -7: Thou shalt not tell users that you accidentally destroyed their - files/backup just to see the look on their little faces. -8: Thou shalt not enjoy canceling a job. -9: Thou shalt not display firearms in the computer room. -10: Thou shalt not push buttons "just to see what happens". -% -The Russians have put a small ball up in the air. -That does not raise my apprehensions one iota. - -- Dwight D. Eisenhower -% -The salary of the chief executive of the large corporation is not a market -award for achievement. It is frequently in the nature of a warm personal -gesture by the individual to himself. - -- John Kenneth Galbraith, "Annals of an Abiding Liberal" -% -The San Diego Freeway. Official Parking Lot of the 1984 Olympics! -% -The savior becomes the victim. -% -The scene: in a vast, painted desert, a cowboy faces his horse. - -Cowboy: "Well, you've been a pretty good hoss, I guess. Hardworkin'. -Not the fastest critter I ever come acrost, but..." - -Horse: "No, stupid, not feed*back*. I said I wanted a feed*bag*. -% -"The Schizophrenic: An Unauthorized Autobiography" -% -The Schwine-Kitzenger Institute study of 47 men over the age of 100 -showed that all had these things in common: - - (1) They all had moderate appetites. - (2) They all came from middle class homes. - (3) All but two of them were dead. -% -The scum also rises. - -- Dr. Hunter S. Thompson -% -The sealed-paper-in-a-safe thing is only your last resort if all your -password-knowers get hit by a redundant array of inexperienced busdrivers. - -- jpd on comp.unix.freebsd.bsd.misc -% -The search for the perfect martini is a fraud. The perfect martini is -a belt of gin from the bottle; anything else is the decadent trappings -of civilization. - -- T. K. -% -The second best policy is dishonesty. -% -The Second Law of Thermodynamics: - If you think things are in a mess now, just wait! - -- Jim Warner -% -The secret of happiness is total disregard of everybody. -% -The secret of healthy hitchhiking is to eat junk food. -% -The secret of success is sincerity. Once you can fake that, -you've got it made. - -- Jean Giraudoux -% -The secret source of humor is not joy but sorrow; -there is no humor in Heaven. - -- Mark Twain -% -The sendmail configuration file is one of those files that looks like someone -beat their head on the keyboard. After working with it... I can see why! - -- Harry Skelton -% -The seven deadly sins ... Food, clothing, firing, rent, taxes, -respectability and children. Nothing can lift those seven millstones -from Man's neck but money; and the spirit cannot soar until the -millstones are lifted. - -- George Bernard Shaw -% -The seven eyes of Ningauble the Wizard floated back to his hood as he -reported to Fafhrd: "I have seen much, yet cannot explain all. The Gray -Mouser is exactly twenty-five feet below the deepest cellar in the palace -of Gilpkerio Kistomerces. Even though twenty-four parts in twenty-five of -him are dead, he is alive. - Now about Lankhmar. She's been invaded, her walls breached -everywhere and desperate fighting is going on in the streets, by a fierce -host which out-numbers Lankhamar's inhabitants by fifty to one -- and -equipped with all modern weapons. Yet you can save the city." - "How?" demanded Fafhrd. - Ningauble shrugged. "You're a hero. You should know." - -- Fritz Leiber, "The Swords of Lankhmar" -% -The seven year itch comes from fooling around during the fourth, fifth, -and sixth years. -% -The sheep died in the wool. -% -The sheep that fly over your head are soon to land. -% -The shifts of Fortune test the reliability of friends. - -- Marcus Tullius Cicero -% -The shortest distance between any two puns is a straight line. -% -The shortest distance between two points is under construction. - -- Noelie Alito -% -The Shuttle is now going five times the sound of speed. - -- Dan Rather, first landing of Columbia -% -The six great gifts of an Irish girl are beauty, soft -voice, sweet speech, wisdom, needlework, and chastity. - -- Theodore Roosevelt, 1907 -% -The Sixth Commandment of Frisbee: - The greatest single aid to distance is for the disc to be going -in a direction you did not want. (Goes the wrong way = Goes a long -way.) - -- Dan Roddick -% -The sixth sheik's sixth sheep's sick. - -- [just say that five times...] -% -The sky is blue so we know where to stop mowing. - -- Judge Harold T. Stone -% -The smallest worm will turn being trodden on. - -- William Shakespeare, "Henry VI" -% -The smiling Spring comes in rejoicing, -And surly Winter grimly flies. -Now crystal clear are the falling waters, -And bonnie blue are the sunny skies. -Fresh o'er the mountains breaks forth the morning, -The ev'ning gilds the oceans's swell: -All creatures joy in the sun's returning, -And I rejoice in my bonnie Bell. - -The flowery Spring leads sunny Summer, -The yellow Autumn presses near; -Then in his turn come gloomy Winter, -Till smiling Spring again appear. -Thus seasons dancing, life advancing, -Old Time and Nature their changes tell; -But never ranging, still unchanging, -I adore my bonnie Bell. - -- Robert Burns, "My Bonnie Bell" -% -The so-called "desktop metaphor" of today's workstations is instead an -"airplane-seat" metaphor. Anyone who has shuffled a lap full of papers -while seated between two portly passengers will recognize the difference -- -one can see only a very few things at once. - -- Frederick Brooks, Jr. -% -The so-called lessons of history are for the most part the -rationalizations of the victors. History is written by the survivors. - -- Max Lerner -% -The society which scorns excellence in plumbing as a humble activity and -tolerates shoddiness in philosophy because it is an exalted activity will -have neither good plumbing nor good philosophy... neither its pipes nor -its theories will hold water. -% -The soldier came knocking upon the queen's door -He said, "I am not fighting for you anymore" -The queen knew she had seen his face someplace before -And slowly she let him inside. - -He said, "I see you now, and you're so very young -But I've seen more battles lost than I have battles won -And I have this intuition that it's all for your fun -And now will you tell me why?" - -- Suzanne Vega, "The Queen and The Soldier" -% -The solution of problems is the most characteristic -and peculiar sort of voluntary thinking. - -- William James -% -The solution of this problem is trivial -and is left as an exercise for the reader. -% -The somewhat old and crusty vicar was taking a well-earned retirement from -his rather old and crusty parish. As is usual in these cases, a locum was -sent to cover the transition period. This particular man was young and -active, and had the strange notion that church should also be active and -exciting. As a consequence he was more than a little disappointed with the -dull and tradition-bound church. He decided to do something about it. - For his first Sunday, he didn't wear the traditional robes and -vestments, but lead the service wearing a nice 2-piece suit. The congregation -was horrified! He changed the order of the service. The congregation was -horrified! Then came the children's lesson. - For this he came out of the pulpit, and sat on the communion table. -The congregation was mortified! He sat there swinging his legs against -the table as the children gathered around him. - He asked the children, "What's small, brown, furry and eats nuts?" - There was total silence. - He asked again, "What's small, brown, furry and eats nuts?" - Total silence. - Eventually, one timid youngster put up his hand and said, "Please, -sir, I know the answer is Jesus, but it sure sounds like a squirrel to me." -% -The sooner all the animals are dead, the sooner we'll find their money. - -- Ed Bluestone, "The National Lampoon" -% -The sooner you fall behind, the more time you'll have to catch up! -% -The sooner you make your first 5000 mistakes, the sooner you will be -able to correct them. - -- Nicolaides -% -The soul would have no rainbow had the eyes no tears. -% -The sounds of the nouns are mostly unbound. -In town a noun might wear a gown, -or further down, might dress a clown. -A noun that's sound would never clown, -but unsound nouns jump up and down. -The sound of a noun could disturb the plowing, -and then, my dear, you'd be put in the pound. -But please don't let that get you down, -the renown of your gown is the talk of the town. - -- A. Nonnie Mouse -% -The Soviet pre-eminence in chess can be traced to the average Russian's -readiness to brood obsessively over anything, even the arrangement of -some pieces of wood. Indeed, the Russians' predisposition for quiet -reflection followed by sudden preventive action explains why they led -the field for many years in both chess and ax murders. It is well -known that as early as 1970, the U.S.S.R., aware of what a defeat at -Reykjavik would do to national prestige, implemented a vigorous program -of preparation and incentive. Every day for an entire year, a team of -psychologists, chess analysts and coaches met with the top three -Russian grand masters and threatened them with a pointy stick. That -these tactics proved fruitless is now a part of chess history and a -further testament to the American way, which provides that if you want -something badly enough, you can always go to Iceland and get it from -the Russians. - -- Marshall Brickman, Playboy, April, 1973 -% -The Soviet Union, which has complained recently about alleged anti-Soviet -themes in American advertising, lodged an official protest this week -against the Ford Motor Company's new campaign: "Hey you stinking, fat -Russian, get off my Ford Escort." - -- Dennis Miller -% -The speed of anything depends on the flow of everything. -% -The spirit of Plato dies hard. We have been unable to escape the -philosophical tradition that what we can see and measure in the world -is merely the superficial and imperfect representation of an underlying -reality. - -- S. J. Gould, "The Mismeasure of Man" -% -The star of riches is shining upon you. -% -The startling truth finally became apparent, and it was this: Numbers -written on restaurant checks within the confines of restaurants do not -follow the same mathematical laws as numbers written on any other pieces -of paper in any other parts of the Universe. This single statement took -the scientific world by storm. So many mathematical conferences got held -in such good restaurants that many of the finest minds of a generation -died of obesity and heart failure, and the science of mathematics was put -back by years. - -- Douglas Adams, "Life, The Universe and Everything" -% -The state law of Pennsylvania prohibits singing in the bathtub. -% -The state of innocence contains the germs of all future sin. - -- Alexandre Arnoux, "Etudes et caprices" -% -The state that separates its scholars from its warriors will have its -thinking done by cowards, and its fighting by fools. - - -- Thucydides -% -The steady state of disks is full. - -- Ken Thompson -% -The story of the butterfly: - "I was in Bogota and waiting for a lady friend. I was in love, -a long time ago. I waited three days. I was hungry but could not go -out for food, lest she come and I not be there to greet her. Then, on -the third day, I heard a knock." - "I hurried along the old passage and there, in the sunlight, -there was nothing." - "Just," Vance Joy said, "a butterfly, flying away." - -- Peter Carey, BLISS -% -The story you are about to hear is true. -Only the names have been changed to protect the innocent. -% -The street preacher looked so baffled -When I asked him why he dressed -With forty pounds of headlines -Stapled to his chest. -But he cursed me when I proved to him -I said, "Not even you can hide. -You see, you're just like me. -I hope you're satisfied." - -- Bob Dylan -% -The streets are safe in Philadelphia, it's only the people who make -them unsafe. - -- Mayor Frank Rizzo -% -The streets were dark with something more than night. - -- Raymond Chandler -% -The strong give up and move on, while the weak give up and stay. -% -The strong individual loves the earth so much he lusts for recurrence. He -can smile in the face of the most terrible thought: meaningless, aimless -existence recurring eternally. The second characteristic of such a man is -that he has the strength to recognize -- and to live with the recognition -- -that the world is valueless in itself and that all values are human ones. -He creates himself by fashioning his own values; he has the pride to live -by the values he wills. - -- Friedrich Nietzsche -% -The student in question is performing minimally for his peer group and -is an emerging underachiever. -% -The study of non-linear physics is like the study of non-elephant -biology. -% -"The subspace _W inherits the other 8 properties of _V. And there aren't -even any property taxes." - -- J. MacKay, Mathematics 134b -% -The sudden sight of me causes panic in the streets. They have -yet to learn - only the savage fears what he does not understand. - -- The Silver Surfer -% -The sum of the intelligence of the world is constant. -The population is, of course, growing. -% -The sum of the Universe is zero. -% -The sun never sets on those who ride into it. - -- RKO -% -The sun was shining on the sea, -Shining with all his might: -He did his very best to make -The billows smooth and bright -- -And this was very odd, because it was -The middle of the night. - -- Lewis Carroll, - "Through the Looking-Glass, - and What Alice Found There" (1871) -% -The sunlights differ, but there is only one darkness. - -- Ursula K. LeGuin, "The Dispossessed" -% -The superfluous is very necessary. - -- Voltaire -% -The superior man understands what is right; -the inferior man understands what will sell. - -- Confucius -% -The superpowers often behave like two heavily armed blind men feeling their -way around a room, each believing himself in mortal peril from the other, -whom he assumes to have perfect vision. Each tends to ascribe to the other -side a consistency, foresight and coherence that its own experience belies. -Of course, even two blind men can do enormous damage to each other, not to -speak of the room. - -- Henry Kissinger -% -The Supreme Court does it with all deliberate speed. -% -The surest protection against temptation is cowardice. - -- Mark Twain -% -The surest sign that a man is in love is when he divorces his wife. -% -The surest way to corrupt a youth is to instruct him to hold in higher -esteem those who think alike than those who think differently. - -- Friedrich Nietzsche -% -The surest way to remain a winner is to -win once, and then not play any more. -% -The sweeter the apple, the blacker the core -- -Scratch a lover and find a foe! - -- Dorothy Parker, "Ballad of a Great Weariness" -% -The system was down for backups from 5am to 10am last Saturday. -% -The system will be down for 10 days for preventative maintenance. -% -The Tao doesn't take sides; -it gives birth to both wins and losses. -The Guru doesn't take sides; -she welcomes both hackers and lusers. - -The Tao is like a stack: -the data changes but not the structure. -the more you use it, the deeper it becomes; -the more you talk of it, the less you understand. - -Hold on to the root. -% -The Tao is like a glob pattern: -used but never used up. -It is like the extern void: -filled with infinite possibilities. - -It is masked but always present. -I don't know who built to it. -It came before the first kernel. -% -The tao that can be tar(1)ed -is not the entire Tao. -The path that can be specified -is not the Full Path. - -We declare the names -of all variables and functions. -Yet the Tao has no type specifier. - -Dynamically binding, you realize the magic. -Statically binding, you see only the hierarchy. - -Yet magic and hierarchy -arise from the same source, -and this source has a null pointer. - -Reference the NULL within NULL, -it is the gateway to all wizardry. -% -The technician should never forget that he is an artist, the -artist never that he is a technician. - -- Poul Henningsen (1894-1967) -% -The telephone is a good way to talk to people without having to offer -them a drink. - -- Fran Lebowitz, "Interview" -% -The temperature of Heaven can be rather accurately computed from available -data. Our authority is Isaiah 30:26, "Moreover, the light of the Moon -shall be as the light of the Sun and the light of the Sun shall be sevenfold, -as the light of seven days." Thus Heaven receives from the Moon as much -radiation as we do from the Sun, and in addition seven times seven (49) times -as much as the Earth does from the Sun, or fifty times in all. The light we -receive from the Moon is one ten-thousandth of the light we receive from the -Sun, so we can ignore that. With these data we can compute the temperature -of Heaven. The radiation falling on Heaven will heat it to the point where -the heat lost by radiation is just equal to the heat received by radiation, -i.e., Heaven loses fifty times as much heat as the Earth by radiation. Using -the Stefan-Boltzmann law for radiation, (H/E)^4 = 50, where E is the absolute -temperature of the earth (~300K), gives H as 798K (525C). The exact -temperature of Hell cannot be computed, but it must be less than 444.6C, the -temperature at which brimstone or sulphur changes from a liquid to a gas. -Revelations 21:8 says "But the fearful, and unbelieving ... shall have their -part in the lake which burneth with fire and brimstone." A lake of molten -brimstone means that its temperature must be at or below the boiling point, -or 444.6C (Above this point it would be a vapor, not a lake.) We have, -then, that Heaven, at 525C is hotter than Hell at 445C. - -- "Applied Optics", vol. 11, A14, 1972 -% -The temperature of the aqueous content of an unremittingly ogled -culinary vessel will not achieve 100 degrees on the Celsius scale. -% -The Ten Commandments for Technicians: - 1: Beware the lightening that lurketh in the undischarged - capacitor, lest it cause thee to bounce upon thy buttocks in a - most untechnician-like manner. - - 7: Work thou not on energized equipment, for if thou dost, thy - fellow workers will surely buy beers for thy widow and console - her in other ways. -% -The term "fire" brings up visions of violence and mayhem and the ugly scene -of shooting employees who make mistakes. We will now refer to this process -as "deleting" an employee (much as a file is deleted from a disk). The -employee is simply there one instant, and gone the next. All the terrible -temper tantrums, crying, and threats are eliminated. - -- Kenny's Korner -% -The test of a first-rate intelligence is the ability to hold two opposed -ideas in the mind at the same time and still retain the ability to function. - -- F. Scott Fitzgerald -% -The test of intelligent tinkering is to save all the parts. - -- Aldo Leopold -% -The thing that takes up the least amount of time -and causes the most amount of trouble is sex. -% -The things that interest people most are usually none of their business. -% -The Third Law of Photography: - If you did manage to get any good shots, they will be ruined - when someone inadvertently opens the darkroom door and all of - the dark leaks out. -% -The thought of being President frightens me and I do not think I -want the job. - -- Ronald Reagan in 1973 - -Reagan won because he ran against Jimmy Carter. Had he run unopposed he -would have lost. - -- Mort Sahl - -Ronald Reagan is a triumph of the embalmer's art. - -- Gore Vidal - -Ronald Reagan's platform seems to be: Hey, I'm a big good-looking guy and -I need a lot of sleep. - -- Roy G. Blount, Jr. - -You've got to be careful quoting Ronald Reagan, because when you quote him -accurately it's called mudslinging. - -- Walter Mondale -% -The Thought Police are here. They've come -To put you under cardiac arrest. -And as they drag you through the door -They tell you that you've failed the test. - -- Buggles, "Living in the Plastic Age" -% -The three best things about going to school are June, July, and August. -% -The three biggest software lies: - - 1: *Of course* we'll give you a copy of the source. - 2: *Of course* the third party vendor we bought that from - will fix the microcode. - 3: Beta test site? No, *of course* you're not a beta test site. -% -The three laws of thermodynamics: - (1) You can't get anything without working for it. - (2) The most you can accomplish by working is to break even. - (3) You can only break even at absolute zero. -% -THE THREE MOST COMMONLY-ASKED QUESTIONS AT DISNEYLAND: - -1) Where's the bathroom? -2) What time does the parade start? -3) Do you sell anything without that damn mouse on it? -% -The three most dangerous things in the world are a programmer with a -soldering iron, a hardware type with a program patch and a user with -an idea. - -- The Wizardry Compiled by Rick Cook -% -The three questions of greatest concern are -- 1. Is it attractive? -2. Is it amusing? 3. Does it know its place? - -- Fran Lebowitz, "Metropolitan Life" -% -The three rules of international air travel: - -(1) Never fly on Aeroflot if you can possibly avoid it (this used - to be Braniff or Aeroflot). -(2) Never bet a whole lot of money on two little pairs unless you - know *exactly* what you're doing. -(3) Never sleep with anyone whose troubles are worse than your own. -% -The thrill is here, but it won't last long -You'd better have your fun before it moves along... -% -The time for action is past! -Now is the time for senseless bickering. -% -The time is right to make new friends. -% -The time spent on any item of the agenda [of a finance -committee] will be in inverse proportion to the sum involved. - -- C. N. Parkinson -% -The time was the 19th of May, 1780. The place was Hartford, Connecticut. -The day has gone down in New England history as a terrible foretaste of -Judgment Day. For at noon the skies turned from blue to grey and by -mid-afternoon had blackened over so densely that, in that religious age, -men fell on their knees and begged a final blessing before the end came. -The Connecticut House of Representatives was in session. And, as some of -the men fell down and others clamored for an immediate adjournment, the -Speaker of the House, one Col. Davenport, came to his feet. He silenced -them and said these words: "The day of judgment is either approaching or -it is not. If it is not, there is no cause for adjournment. If it is, I -choose to be found doing my duty. I wish therefore that candles may be -brought." - -- Alistair Cooke -% -The tree in which the sap is stagnant remains fruitless. - -- Hosea Ballou -% -The Tree of Learning bears the noblest fruit, but noble fruit tastes bad. -% -The tree of research must from time to time -be refreshed with the blood of bean counters. - -- Alan Kay -% -The trouble is, there is an endless supply of White Men, -but there has always been a limited number of Human Beings. - -- Little Big Man -% -The trouble with a kitten is that -When it grows up, it's always a cat - -- Ogden Nash -% -The trouble with a lot of self-made men is that they worship their creator. -% -The trouble with being poor is that it takes up all your time. -% -The trouble with being punctual is that nobody's there to appreciate -it. - -- Franklin P. Jones -% -The trouble with being punctual is that people -think you have nothing more important to do. -% -The trouble with computers is that they do -what you tell them, not what you want. - -- D. Cohen -% -The trouble with doing something right the first -time is that nobody appreciates how difficult it was. -% -The trouble with eating Italian food is that -five or six days later you're hungry again. - -- George Miller -% -The trouble with heart disease is that the first -symptom is often hard to deal with: death. - -- Michael Phelps -% -The trouble with incest is that it gets you involved with relatives. - -- George S. Kaufman -% -The trouble with money is it costs too much! -% -The trouble with opportunity is that it -always comes disguised as hard work. - -- Herbert V. Prochnow -% -The trouble with some women is that they get all excited about nothing -- -and then marry him. - -- Cher -% -The trouble with superheros is what to do between phone booths. - -- Ken Kesey -% -The trouble with telling a good story is that it invariably reminds -the other fellow of a dull one. - -- Sid Caesar -% -The trouble with the rat-race is that even if you win, you're still a rat. - -- Lily Tomlin -% -The trouble with this country is that there are too many politicians -who believe, with a conviction based on experience, that you can fool -all of the people all of the time. - -- Franklin Adams -% -The trouble with you -Is the trouble with me. -Got two good eyes -But we still don't see. - -- Robert Hunter, "Workingman's Dead" -% -The true way goes over a rope which is not stretched at any great -height but just above the ground. It seems more designed to make -people stumble than to be walked upon. - -- Franz Kafka -% -The truth about a man lies first and foremost in what he hides. - -- Andre Malraux -% -The truth is rarely pure, and never simple. - -- Oscar Wilde -% -The truth is what is; what should be is a dirty lie. - -- Lenny Bruce -% -The truth of a proposition has nothing to do with its credibility. -And vice versa. -% -The truth of a thing is the feel of it, not the think of it. - -- Stanley Kubrick -% -The Truth Shall Rape You Over. - -- Caltech -% -The truth you speak has no past and no future. -It is, and that's all it needs to be. -% -The turtle lives 'twixt plated decks -Which practically conceal its sex. -I think it clever of the turtle -In such a fix to be so fertile. - -- Ogden Nash -% -The two most beautiful words in the English language are "Cheque Enclosed." - -- Dorothy Parker -% -The two most common things in the Universe are hydrogen and stupidity. - -- Harlan Ellison -% -The two oldest professions in the world have been ruined by amateurs. - -- George Bernard Shaw -% -The two party system ... is a triumph of the dialectic. It showed that -two could be one and one could be two and had probably been fabricated -by Hegel for the American market on a subcontract from General Dynamics. - -- I. F. Stone -% -The two things that can get you into trouble -quicker than anything else are fast women and slow horses. -% -The typewriting machine, when played with expression, is no more -annoying than the piano when played by a sister or near relation. - -- Oscar Wilde -% -The, uh, snowy mountains are like really cold, eh? -And the, um, plains stretch out like my moms girdle, eh? -There's lotsa beers and doughnuts for everyone, eh? -So the last one to be peaceful and everything is a big idiot, -Eh? -So shut yer face up and dry yer mukluks by the fire, eh? -And dream about girls with their high beams on, eh? -They may be cold, but that's okay! Beer's better that way! -Eh? - -- A, like, Tribute to the Great White North, eh? -Beauty! -% -The ultimate game show will be the one -where somebody gets killed at the end. - -- Chuck Barris, creator of "The Gong Show" -% -The unfacts, did we have them, are too -imprecisely few to warrant out certitude. -% -The United States also has its native Fascists who say that they are -"100 percent American"... - -- U.S. Army (1945) -% -The United States Army; 194 years of proud service, unhampered by progress. -% -The universe does not have laws -- it has habits, and habits can be -broken. -% -The universe is all a spin-off of the Big Bang. -% -The universe is an island, -surrounded by whatever it is that surrounds universes. -% -The universe is laughing behind your back. -% -The universe is like a safe to which there is a combination -- but the -combination is locked up in the safe. - -- Peter de Vries - -Corollary: The combination is not a problem since we are locked in the -same safe. -% -The Universe is populated by stable things. - -- Richard Dawkins -% -The universe is ruled by letting things take their course. -It cannot be ruled by interfering. - -- Chinese proverb -% -The universe seems neither benign nor hostile, merely indifferent. - -- Sagan -% -The University of California Bears announced the signing of Reggie -Philbin to a letter of intent to attend Cal next Fall. Philbin is -said to make up for no talent by cheating well. Says Philbin of -his decision to attend Cal, "I'm in it for the free ride." -% -The University of California Statistics Department; where mean is normal, -and deviation standard. -% -The UNIX philosophy basically involves giving you enough rope to -hang yourself. And then a couple of feet more, just to be sure. -% -The urge to gamble is so universal and its practice so pleasurable -that I assume it must be evil. - -- Heywood Broun -% -The USA is so enormous, and so numerous are its schools, colleges and -religious seminaries, many devoted to special religious beliefs ranging -from the unorthodox to the dotty, that we can hardly wonder at its -yielding a more bounteous harvest of gobbledygook than the rest of the -world put together. - -- Sir Peter Medawar -% -The use of anthropomorphic terminology when dealing with computing systems -is a symptom of professional immaturity. - -- Edsger W. Dijkstra -% -The use of COBOL cripples the mind; its teaching should, therefore, be -regarded as a criminal offence. - -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5 -% -The use of money is all the advantage there is to having money. - -- Benjamin Franklin -% -The value of a program is proportional to the weight of its output. -% -The verdict of a jury is the a priori opinion of that juror who smokes -the worst cigars. - -- H. L. Mencken -% -The very first essential for success is a perpetually -constant and regular employment of violence. - -- Adolf Hitler, "Mein Kampf" -% -The very ink with which all history is written is merely fluid -prejudice. - -- Mark Twain -% -The very powerful and the very stupid have one thing in common. -Instead of altering their views to fit the facts, they alter the facts -to fit their views ... which can be very uncomfortable if you happen to -be one of the facts that needs altering. - -- The Doctor, "Doctor Who: Face of Evil" -% -The very remembrance of my former misfortune proves a new one to me. - -- Miguel de Cervantes -% -The Vet Who Surprised A Cow - In the course of his duties in August 1977, a Dutch veterinary -surgeon was required to treat an ailing cow. To investigate its internal -gases he inserted a tube into that end of the animal not capable of facial -expression and struck a match. The jet of flame set fire first to some -bales of hay and then to the whole farm causing damage estimate at L45,000. -The vet was later fined L140 for starting a fire in a manner surprising to -the magistrates. The cow escaped with shock. - -- Stephen Pile, "The Book of Heroic Failures" -% -The VFW represents many who died to give this country a second chance -to make it what it is supposed to be -- God's guest house on earth. - -- John Wayne -% -The volume of paper expands to fill the available briefcases. - -- Jerry Brown -% -The voluptuous blond was chatting with her handsome escort in a posh -restaurant when their waiter, stumbling as he brought their drinks, -dumped a martini on the rocks down the back of the blonde's dress. She -sprang to her feet with a wild rebel yell, dashed wildly around the table, -then galloped wriggling from the room followed by her distraught boyfriend. -A man seated on the other side of the room with a date of his own beckoned -to the waiter and said, "We'll have two of whatever she was drinking." -% -The wages of sin are death; but after they're done taking out taxes, -it's just a tired feeling. -% -The wages of sin are high but you get your money's worth. -% -The wages of sin are unreported. -% -The War on Drugs is just a small part of the War on the United States -Constitution. -% -The warning message we sent the Russians was a -calculated ambiguity that would be clearly understood. - -- Alexander Haig -% -The water was not fit to drink. -To make it palatable, we had to add whiskey. -By diligent effort, I learned to like it. - -- Winston Churchill -% -The way I understand it, the Russians are sort of a combination of evil and -incompetence... sort of like the Post Office with tanks. - -- Emo Philips -% -The way of the world is to praise dead saints and prosecute live ones. - -- Nathaniel Howe -% -The way some people find fault, you'd think there was some kind of reward. -% -The way to a man's heart is through his -wife's belly, and don't you forget it. - -- Edward Albee, "Who's Afraid of Virginia Woolf?" -% -The way to a man's heart is through the left ventricle. -% -The way to a man's stomach is through his esophagus. -% -The way to fight a woman is with your hat. Grab it and run. -% -The way to love anything is to realize that it might be lost. -% -The way to make a small fortune in the -commodities market is to start with a large fortune. -% -The weather is here, I wish you were beautiful. -My thoughts aren't too clear, but don't run away. -My girlfriend's a bore; my job is too dutiful. -Hell nobody's perfect, would you like to play? -I feel together today! - -- Jimmy Buffet, "Coconut Telegraph" -% -The weed of crime bears bitter fruit. -% -The weed of crime bears bitter fruit... -but the leaves are good to smoke! - -- The Shadow -% -The White Rabbit put on his spectacles. - "Where shall I begin, please your Majesty?" he asked. - "Begin at the beginning," the King said, very gravely, -"and go on till you come to the end: then stop." - -- Lewis Carroll, "Alice's Adventures in Wonderland" (1865) -% -The white race is the cancer of history. - -- Susan Sontag -% -The whole earth is in jail and we're plotting this incredible jailbreak. - -- Wavy Gravy -% -The whole of life is futile unless you -consider it as a sporting proposition. -% -The whole problem with the world is that fools and fanatics are always -so certain of themselves, and wiser people so full of doubts. - -- Bertrand Russell -% -The whole world is a scab. The point is to pick it constructively. - -- Peter Beard -% -The whole world is a tuxedo and you are a pair of brown shoes. - -- George Gobel -% -The wind doth taste so bitter sweet, - Like Jaspar wine and sugar, -It must have blown through someone's feet, - Like those of Caspar Weinberger. - -- P. Opus -% -The wise and intelligent are coming belatedly to realize that alcohol, and -not the dog, is man's best friend. Rover is taking a beating -- and he -should. - -- W. C. Fields -% -The wise man seeks everything in himself; -the ignorant man tries to get everything from somebody else. -% -The wise shepherd never trusts his flock to a smiling wolf. -% -The woman hurried home from her doctor's appointment, devastated by the -medical report she had just received. When her husband came in from work, -she told him, "Darling, the doctor said I have only twelve more hours to -live. So I've decided I want to go to bed and make passionate love to you -throughout the night. How does that sound, dearest?" - "Hey, that's fine for *you*," replied the husband. "You don't have -to get up in the morning!" -% -The wonderful thing about a dancing bear -is not how well he dances, but that he dances at all. -% -The work [of software development] is becoming far easier (i.e. the tools -we're using work at a higher level, more removed from machine, peripheral -and operating system imperatives) than it was twenty years ago, and because -of this, knowledge of the internals of a system may become less accessible. -We may be able to dig deeper holes, but unless we know how to build taller -ladders, we had best hope that it does not rain much. - -- Paul Licker -% -The world has many unintentionally cruel mechanisms that are not -designed for people who walk on their hands. - -- John Irving, "The World According to Garp" -% -The world is a comedy to those who think, -and a tragedy to those who feel. - -- Horace Walpole -% -The world is coming to an end. Please log off. -% -The world is coming to an end... SAVE YOUR BUFFERS!! -% -The world is coming to an end! -Repent and return those library books! -% -The world is full of people who have never, since -childhood, met an open doorway with an open mind. - -- E. B. White -% -The world is moving so fast these days that the man who says -it can't be done is generally interrupted by someone doing it. - -- E. Hubbard -% -The world is not octal despite DEC. -% -The world is your exercise-book, the pages on which you do your sums. -It is not reality, although you can express reality there if you wish. -You are also free to write nonsense, or lies, or to tear the pages. - -- Messiah's Handbook: Reminders for the Advanced Soul -% -The world needs more people like us and fewer like them. -% -The world really isn't any worse. -It's just that the news coverage is so much better. -% -The world wants to be deceived. - -- Sebastian Brant -% -The world's as ugly as sin, -And almost as delightful. - -- Frederick Locker-Lampson -% -The world's great men have not commonly been great scholars, -nor its great scholars great men. - -- Oliver Wendell Holmes -% -The Worst American Poet - Julia Moore, "the Sweet Singer of Michigan" (1847-1920) was so bad that -Mark Twain said her first book gave him joy for 20 years. - Her verse was mainly concerned with violent death -- the great fire -of Chicago and the yellow fever epidemic proved natural subjects for her -pen. - Whether death was by drowning, by fits or by runaway sleigh, the -formula was the same: - Have you heard of the dreadful fate - Of Mr. P. P. Bliss and wife? - Of their death I will relate, - And also others lost their life - (in the) Ashbula Bridge disaster, - Where so many people died. - Even if you started out reasonably healthy in one of Julia's poems, -the chances are that after a few stanzas you would be at the bottom of a -river or struck by lightning. A critic of the day said she was "worse than -a Gatling gun" and in one slim volume counted 21 killed and 9 wounded. - Incredibly, some newspapers were critical of her work, even -suggesting that the sweet singer was "semi-literate". Her reply was -forthright: "The Editors that has spoken in this scandalous manner have went -beyond reason." She added that "literary work is very difficult to do". - -- Stephen Pile, "The Book of Heroic Failures" -% -THE WORST BANK ROBBERY - -In August 1975 three men were on their way in to rob the Royal Bank of -Scotland at Rothesay, when they got stuck in the revolving doors. They -had to be helped free by the staff and, after thanking everyone, -sheepishly left the building. -A few minutes later they returned and announced their intention of -robbing the bank, but none of the staff believed them. When they demanded -5,000 pounds in cash, the head cashier laughed at them, convinced that it -was a practical joke. -Then one of the men jumped over the counter, but fell to the floor -clutching his ankle. The other two tried to make their getaway, but got -trapped in the revolving doors again. -% -The Worst Car Hire Service - When David Schwartz left university in 1972, he set up Rent-a-wreck -as a joke. Being a natural prankster, he acquired a fleet of beat-up -shabby, wreckages waiting for the scrap heap in California. - He put on a cap and looked forward to watching people's faces as he -conducted them round the choice of bumperless, dented junkmobiles. - To his lasting surprise there was an insatiable demand for them and -he now has 26 thriving branches all over America. "People like driving -round in the worst cars available," he said. Of course they do. - "If a driver damages the side of a car and is honest enough to -admit it, I tell him, `Forget it'. If they bring a car back late we -overlook it. If they've had a crash and it doesn't involve another vehicle -we might overlook that too." - "Where's the ashtray?" asked one Los Angeles wife, as she settled -into the ripped interior. "Honey," said her husband, "the whole car's the -ash tray." - -- Stephen Pile, "The Book of Heroic Failures" -% -The worst cliques are those which consist of one man. - -- George Bernard Shaw -% -THE WORST HOMING PIGEON - -This historic bird was released in Pembrokeshire in June 1953 and was -expected to reach its base that evening. It was returned by post, dead, -in a cardboard box eleven years later from Brazil. - -- Stephen Pile, "The Book of Heroic Failures" -% -The worst is enemy of the bad. -% -The worst is not so long as we can say "This is the worst." - -- King Lear -% -The Worst Jury - A murder trial at Manitoba in February 1978 was well advanced, when -one juror revealed that he was completely deaf and did not have the -remotest clue what was happening. - The judge, Mr. Justice Solomon, asked him if he had heard any -evidence at all and, when there was no reply, dismissed him. - The excitement which this caused was only equalled when a second -juror revealed that he spoke not a word of English. A fluent French -speaker, he exhibited great surprised when told, after two days, that he -was hearing a murder trial. - The trial was abandoned when a third juror said that he suffered -from both conditions, being simultaneously unversed in the English language -and nearly as deaf as the first juror. - The judge ordered a retrial. - -- Stephen Pile, "The Book of Heroic Failures" -% -The Worst Lines of Verse -For a start, we can rule out James Grainger's promising line: - "Come, muse, let us sing of rats." -Grainger (1721-67) did not have the courage of his convictions and deleted -these words on discovering that his listeners dissolved into spontaneous -laughter the instant they were read out. - No such reluctance afflicted Adam Lindsay Gordon (1833-70) who was -inspired by the subject of war. - "Flash! flash! bang! bang! and we blazed away, - And the grey roof reddened and rang; - Flash! flash! and I felt his bullet flay - The tip of my ear. Flash! bang!" -By contrast, Cheshire cheese provoked John Armstrong (1709-79): - "... that which Cestria sends, tenacious paste of solid milk..." -While John Bidlake was guided by a compassion for vegetables: - "The sluggard carrot sleeps his day in bed, - The crippled pea alone that cannot stand." -George Crabbe (1754-1832) wrote: - "And I was ask'd and authorized to go - To seek the firm of Clutterbuck and Co." -William Balmford explored the possibilities of religious verse: - "So 'tis with Christians, Nature being weak - While in this world, are liable to leak." -And William Wordsworth showed that he could do it if he really tried when -describing a pond: - "I've measured it from side to side; - Tis three feet long and two feet wide." - -- Stephen Pile, "The Book of Heroic Failures" -% -The Worst Musical Trio - There are few bad musicians who have a chance to give a recital at -a famous concert hall while still learning the rudiments of their -instrument. This happened about thirty years ago to the son of a Rumanian -gentleman who was owed a personal favour by Georges Enesco, the celebrated -violinist. Enesco agreed to give lessons to the son who was quite -unhampered by great musical talent. - Three years later the boy's father insisted that he give a public -concert. "His aunt said that nobody plays the violin better than he does. -A cousin heard him the other day and screamed with enthusiasm." Although -Enesco feared the consequences, he arranged a recital at the Salle Gaveau -in Paris. However, nobody bought a ticket since the soloist was unknown. - "Then you must accompany him on the piano," said the boy's father, -"and it will be a sell out." - Reluctantly, Enesco agreed and it was. On the night an excited -audience gathered. Before the concert began Enesco became nervous and -asked for someone to turn his pages. - In the audience was Alfred Cortot, the brilliant pianist, who -volunteered and made his way to the stage. - The soloist was of uniformly low standard and next morning the -music critic of Le Figaro wrote: "There was a strange concert at the Salle -Gaveau last night. The man whom we adore when he plays the violin played -the piano. Another whom we adore when he plays the piano turned the pages. -But the man who should have turned the pages played the violin." - -- Stephen Pile, "The Book of Heroic Failures" -% -The worst part of having success is trying -to find someone who is happy for you. - -- Bette Midler -% -The worst part of valor is indiscretion. -% -The Worst Prison Guards - The largest number of convicts ever to escape simultaneously from a -maximum security prison is 124. This record is held by Alcoente Prison, -near Lisbon in Portugal. - During the weeks leading up to the escape in July 1978 the prison -warders had noticed that attendances had fallen at film shows which -included "The Great Escape", and also that 220 knives and a huge quantity -of electric cable had disappeared. A guard explained, "Yes, we were -planning to look for them, but never got around to it." The warders had -not, however, noticed the gaping holes in the wall because they were -"covered with posters". Nor did they detect any of the spades, chisels, -water hoses and electric drills amassed by the inmates in large quantities. -The night before the breakout one guard had noticed that of the 36 -prisoners in his block only 13 were present. He said this was "normal" -because inmates sometimes missed roll-call or hid, but usually came back -the next morning. - "We only found out about the escape at 6:30 the next morning when -one of the prisoners told us," a warder said later. [...] When they -eventually checked, the prison guards found that exactly half of the jail's -population was missing. By way of explanation the Justice Minister, Dr. -Santos Pais, claimed that the escape was "normal" and part of the -"legitimate desire of the prisoner to regain his liberty." - -- Stephen Pile, "The Book of Heroic Failures" -% -The worst sin towards our fellow creatures is not to hate them, -but to be indifferent to them; that's the essence of inhumanity. - -- George Bernard Shaw -% -The worst thing about some men is that when they are not drunk they -are sober. - -- William Butler Yeats -% -The worst thing one can do is not to try, to be aware of what one -wants and not give in to it, to spend years in silent hurt wondering -if something could have materialized -- and never knowing. - -- David Viscott -% -The Wright Brothers weren't the first to fly. -They were just the first not to crash. -% -The yankees, son, are up north. -The damnyankees are down here. -% -The years of peak mental activity are undoubtedly between the ages of -four and eighteen. At four we know all the questions, at eighteen all -the answers. -% -The young Georgia miss came to the hospital for a checkup. - "Have you been X-rayed?" asked the doctor. - "Nope," she said, "but ah've been ultraviolated." -% -The young lady had an unusual list, -Linked in part to a structural weakness. -She set no preconditions. -% -The young man-about-town enjoyed luxury but didn't always have the means -to buy it, and so he huffily walked out of the Miami Beach hotel when he -found out the charges for room, meals and golf privileges were $300 a day. -He registered across the street at an equally elegant hotel, where the -rates were only $70. The following morning he went down to the hotel's -golf course and asked Scotty, the pro, to sell him a couple of golf balls. -"Sure," said Scotty. "That'll be $25 apiece." - "What?" screamed the bachelor. "In the hotel across the street -they only charge $1 a ball!" - "Naturally," replied the pro. "Over there they get you by the -rooms." -% -THEGODDESSOFTHENETHASTWISTINGFINGERSANDHERVOICEISLIKEAJAVALININTHENIGHTDUDE -% -Their idea of an offer you can't refuse is an offer... -and you'd better not refuse. -% -Them as has, gets. -% -Then a man said: Speak to us of Expectations. - -He then said: If a man does not see or hear the waters of the Jordan, -then he should not taste the pomegranate or ply his wares in an open -market. - -If a man would not labour in the salt and rock quarries then he should -not accept of the Earth that which he refuses to give of himself. - -Such a man would expect a pear of a peach tree. -Such a man would expect a stone to lay an egg. -Such a man would expect Sears to assemble a lawnmower. - -- Kehlog Albran, "The Profit" -% -Then, gently touching my face, she hesitated for a moment as her -incredible eyes poured forth into mine love, joy, pain, tragedy, -acceptance, and peace. "'Bye for now," she said warmly. - -- Thea Alexander, "2150 A.D." -% -Then here's to the City of Boston, -The town of the cries and the groans. -Where the Cabots can't see the Kabotschniks, -And the Lowells won't speak to the Cohns. - -- Franklin Pierce Adams -% -Then there was LSD, which was supposed to make you think you could fly. -I remember it made you think you couldn't stand up, and mostly it was -right. - -- P. J. O'Rourke -% -Then there was the Formosan bartender named Taiwan-On. -% -Then there was the Scoutmaster who got a fantastic deal on this case of -Tates brand compasses for his troop; only $1.25 each! Only problem was, -when they got them out in the woods, the compasses were all stuck pointing -to the "W" on the dial. - -Moral: - He who has a Tates is lost! -% -Theology is an attempt to explain a subject by men who do not understand -it. The intent is not to tell the truth but to satisfy the questioner. - -- Elbert Hubbard -% -Theorem: a cat has nine tails. -Proof: - No cat has eight tails. A cat has one tail more than no cat. - Therefore, a cat has nine tails. -% -Theorem: All positive integers are equal. -Proof: Sufficient to show that for any two positive integers, A and B, A = B. - Further, it is sufficient to show that for all N > 0, if A and B - (positive integers) satisfy (MAX(A, B) = N) then A = B. - -Proceed by induction: - If N = 1, then A and B, being positive integers, must both be 1. - So A = B. - -Assume that the theorem is true for some value k. Take A and B with - MAX(A, B) = k+1. Then MAX((A-1), (B-1)) = k. And hence - (A-1) = (B-1). Consequently, A = B. -% -Theorem: All programs are dull. - -Proof: Assume the contrary; i.e., the set of interesting programs is -nonempty. Arrange them (or it) in order of interest (note that all -sets can be well ordered, so do it properly). The minimal element is -the "least interesting program", the obvious dullness of which provides -the contradictory denouement we so devoutly seek. - -- Stan Kelly-Bootle, "The Devil's DP Dictionary" -% -THEORY: - System of ideas meant to explain something, chosen with a view to - originality, controversialism, incomprehensibility, and how good - it will look in print. -% -Theory is gray, but the golden tree of life is green. - -- Johann Wolfgang von Goethe -% -Theory of Selective Supervision: - The one time in the day that you lean back and relax is - the one time the boss walks through the office. -% -There appears before you a threatening figure clad all over in heavy black -armor. His legs seem like the massive trunk of the oak tree. His broad -shoulders and helmeted head loom high over your own puny frame and you -realize that his powerful arms could easily crush the very life from your -body. There hangs from his belt a veritable arsenal of deadly weapons: -sword, mace, ball and chain, dagger, lance, and trident. -He speaks with a commanding voice: - - "YOU SHALL NOT PASS" - -As he grabs you by the neck all grows dim about you. -% -There appears to be irrefutable evidence that -the mere fact of overcrowding induces violence. - -- Harvey Wheeler -% -There are a few things that never go out of style, -and a feminine woman is one of them. - -- Ralston -% -There are a lot of lies going around.... and half of them are true. - -- Winston Churchill -% -There are bad times just around the corner, -There are dark clouds hurtling through the sky -And it's no good whining -About a silver lining -For we know from experience that they won't roll by... - -- Noel Coward -% -There are few people more often in the wrong -than those who cannot endure to be thought so. -% -There are few virtues that the Poles do not possess -- -and there are few mistakes they have ever avoided. - -- Winston Churchill, Parliament, August, 1945 -% -There are four boxes to be used in defense of liberty: soap, ballot, -jury, and ammo. Please use in that order. - -- Ed Howdershelt -% -There are four kinds of homicide: felonious, excusable, justifiable, -and praiseworthy ... - -- Ambrose Bierce, "The Devil's Dictionary" -% -There are four stages to a marriage. First there's the affair, then there's -the marriage, then children and finally the fourth stage, without which you -cannot know a woman, the divorce. - -- Norman Mailer -% -There are many intelligent species in -the universe, and they all own cats. -% -There are many of us in this old world of ours who hold that things break -about even for all of us. I have observed, for example, that we all get -about the same amount of ice. The rich get it in the summer and the poor -get it in the winter. - -- Bat Masterson -% -There are many people today who literally do not have a close personal -friend. They may know something that we don't. They are probably -avoiding a great deal of pain. -% -There are more dead people than living, and their numbers are increasing. - -- Eugene Ionesco -% -There are more old drunkards than old doctors. -% -There are more things in heaven and earth than any place else. -% -There are more things in heaven and earth, -Horatio, than are dreamt of in your philosophy. - -- Hamlet -% -There are more ways of killing a cat than choking her with cream. -% -There are never any bugs you haven't found yet. -% -There are new messages. -% -There are no accidents whatsoever in the universe. - -- Baba Ram Dass -% -There are no answers, only cross-references. - -- Weiner -% -There are no data that cannot be plotted on a straight line if the axes -are chosen correctly. -% -There are no emotional victims, only volunteers. -% -There are no games on this system. -% -There are no great men, buster. There are only men. - -- Elaine Stewart, "The Bad and the Beautiful" -% -There are no great men, only great challenges that -ordinary men are forced by circumstances to meet. - -- Admiral William Halsey -% -There are no manifestos like cannon and musketry. - -- The Duke of Wellington -% -There are no physicists in the hottest parts of hell, because the existence -of a "hottest part" implies a temperature difference, and any marginally -competent physicist would immediately use this to run a heat engine and make -some other part of hell comfortably cool. This is obviously impossible. - -- Richard Davisson -% -There are no rules for March. March is spring, sort -of, usually, March means maybe, but don't bet on it. -% -There are no winners in life, only survivors. -% -There are only two kinds of men -- the dead and the deadly. - -- Helen Rowland -% -There are only two kinds of tequila. Good and better. -% -There are only two things in this world that I am sure of, death and -taxes, and we just might do something about death one of these days. - -- shades -% -There are people so addicted to exaggeration -that they can't tell the truth without lying. - -- Josh Billings -% -There are people who find it odd to eat four or five Chinese meals -in a row; in China, I often remind them, there are a billion or so -people who find nothing odd about it. - -- Calvin Trillin -% -There are places I'll remember -All my life though some have changed. -Some forever not for better -Some have gone and some remain. -All these places had their moments -With lovers and friends I still recall. -Some are dead and some are living, -In my life I've loved them all. - -But of all these friends and lovers, -There is no one compared with you, -All these memories lose their meaning -When I think of love as something new. -Though I know I'll never lose affection -For people and things that went before, -I know I'll often stop and think about them -In my life I'll love you more. - -- Lennon/McCartney, "In My Life", 1965 -% -There are running jobs. -Why don't you go chase them? -% -There are some micro-organisms that exhibit characteristics of both -plants and animals. When exposed to light they undergo photosynthesis; -and when the lights go out, they turn into animals. But then again, -don't we all? -% -There are strange things done in the midnight sun - By the men who moil for gold; -The Arctic trails have their secret tales - That would make your blood run cold; -The Northern Lights have seen queer sights, - But the queerest they ever did see -Was that night on the marge of Lake Lebarge - I cremated Sam McGee. - -- Robert W. Service -% -There are ten or twenty basic truths, and life -is the process of discovering them over and over and over. - -- David Nichols -% -There are those who claim that magic is like the tide; that it swells and -fades over the surface of the earth, collecting in concentrated pools here -and there, almost disappearing from other spots, leaving them parched for -wonder. There are also those who believe that if you stick your fingers up -your nose and blow, it will increase your intelligence. - -- The Teachings of Ebenezum, Volume VII -% -There are three kinds of lies: Lies, Damned Lies, and Statistics. - -- Benjamin Disraeli -% -There are three kinds of people: men, women, and unix. -% -There are three possibilities: Pioneer's solar panel has turned away -from the sun; there's a large meteor blocking transmission; or someone -loaded Star Trek 3.2 into our video processor. -% -There are three possible parts to a date, of which at least two must be -offered: entertainment, food, and affection. It is customary to begin -a series of dates with a great deal of entertainment, a moderate amount -of food, and the merest suggestion of affection. As the amount of -affection increases, the entertainment can be reduced proportionately. -When the affection IS the entertainment, we no longer call it dating. -Under no circumstances can the food be omitted. - -- Miss Manners' Guide to Excruciatingly Correct Behavior -% -There are three principal ways to lose money: wine, women, and -engineers. While the first two are more pleasant, the third is by far -the more certain. - -- Baron Rothschild, ca. 1800 -% -There are three reasons for becoming a writer: the first is that you need -the money; the second that you have something to say that you think the -world should know; the third is that you can't think what to do with the -long winter evenings. - -- Quentin Crisp -% -There are three rules for writing a novel. -Unfortunately, no one knows what they are. - -- W. Somerset Maugham -% -There are three schools of magic. One: State a tautology, then ring the -changes on its corollaries; that's philosophy. Two: Record many facts. -Try to find a pattern. Then make a wrong guess at the next fact; that's -science. Three: Be aware that you live in a malevolent Universe controlled -by Murphy's Law, sometimes offset by Brewster's Factor; that's engineering. -% -There are three things I always forget. Names, faces -- the third I -can't remember. - -- Italo Svevo -% -There are three things I have always loved -and never understood -- art, music, and women. -% -There are three things men can do with women: -love them, suffer for them, or turn them into literature. - -- Stephen Stills -% -There are three ways to get something done: - 1: Do it yourself. - 2: Hire someone to do it for you. - 3: Forbid your kids to do it. -% -There are times when truth is stranger than fiction and lunch time is -one of them. -% -There are twenty-five people left in the world, -and twenty-seven of them are hamburgers. - -- Ed Sanders -% -There are two jazz musicians who are great buddies. They hang out and play -together for years, virtually inseparable. Unfortunately, one of them is -struck by a truck and killed. About a week later his friend wakes up in -the middle of the night with a start because he can feel a presence in the -room. He calls out, "Who's there? Who's there? What's going on?" - "It's me -- Bob," replies a faraway voice. - Excitedly he sits up in bed. "Bob! Bob! Is that you? Where are -you?" - "Well," says the voice, "I'm in heaven now." - "Heaven! You're in heaven! That's wonderful! What's it like?" - "It's great, man. I gotta tell you, I'm jamming up here every day. -I'm playing with Bird, and 'Trane, and Count Basie drops in all the time! -Man it is smokin'!" - "Oh, wow!" says his friend. "That sounds fantastic, tell me more, -tell me more!" - "Let me put it this way," continues the voice. "There's good news -and bad news. The good news is that these guys are in top form. I mean -I have *never* heard them sound better. They are *wailing* up here." - "The bad news is that God has this girlfriend that sings..." -% -There are two kinds of fool. One says, "This is old, and therefore good." -And one says, "This is new, and therefore better." - -- John Brunner, "The Shockwave Rider" -% -There are two kinds of pedestrians... the quick and the dead. - -- Lord Thomas Robert Dewar -% -There are two kinds of solar-heat systems: "passive" systems collect -the sunlight that hits your home, and "active" systems collect the -sunlight that hits your neighbors' homes, too. - -- Dave Barry, "Postpetroleum Guzzler" -% -There are two major products that come out of Berkeley: LSD and UNIX. -We don't believe this to be a coincidence. - -- Jeremy S. Anderson -% -There are two problems with a major hangover. You feel -like you are going to die and you're afraid that you won't. -% -There are two theories to arguing with women. Neither one works. -% -There are two times when a man doesn't understand a woman -- before -marriage and after marriage. -% -There are two ways of constructing a software design: One way is to -make it so simple that there are obviously no deficiencies, and the -other way is to make it so complicated that there are no obvious -deficiencies. - -- C. A. R. Hoare -% -There are two ways of disliking art. -One is to dislike it. -The other is to like it rationally. - -- Oscar Wilde -% -There are two ways of disliking poetry; -one way is to dislike it, the other is to read Pope. - -- Oscar Wilde -% -There are two ways to write error-free -programs; only the third one works. -% -There are very few personal problems that cannot be -solved through a suitable application of high explosives. -% -There are worse things in life than death. Have you ever spent an evening -with an insurance salesman? - -- Woody Allen -% -There be sober men a'plenty, and drunkards barely twenty; there are men -of over ninety who have never yet kissed a girl. But give me the rambling -rover, from Orkney down to Dover, we will roam the whole world over, and -together we'll face the world. - -- Andy Stewart, "After the Hush" -% -There but for the grace of God, goes God. - -- Winston Churchill, speaking of Sir Stafford Cripps -% -There can be no daily democracy without daily citizenship. - -- Ralph Nader -% -There can be no twisted thought without a twisted molecule. - -- R. W. Gerard -% -There cannot be a crisis next week. My schedule is already full. - -- Henry Kissinger -% -There comes a time in the affairs of a man when he -has to take the bull by the tail and face the situation. - -- W. C. Fields -% -There comes a time to stop being angry. - -- A Small Circle of Friends -% -There exist tasks which cannot be done -by more than 10 men or fewer than 100. - -- Steele's Law -% -There goes the good time that was had by all. - -- Bette Davis, remarking on a passing starlet -% -There has also been some work to allow the interesting use of macro names. -For example, if you wanted all of your "creat()" calls to include read -permissions for everyone, you could say - - #define creat(file, mode) creat(file, mode | 0444) - - I would recommend against this kind of thing in general, since it -hides the changed semantics of "creat()" in a macro, potentially far away -from its uses. - To allow this use of macros, the preprocessor uses a process that -is worth describing, if for no other reason than that we get to use one of -the more amusing terms introduced into the C lexicon. While a macro is -being expanded, it is temporarily undefined, and any recurrence of the macro -name is "painted blue" -- I kid you not, this is the official terminology --- so that in future scans of the text the macro will not be expanded -recursively. (I do not know why the color blue was chosen; I'm sure it -was the result of a long debate, spread over several meetings.) - -- From Ken Arnold's "C Advisor" column in Unix Review -% -There has been a little distress selling on the stock exchange. - -- Thomas W. Lamont, October 29, 1929 -% -There has been an alarming increase in the -number of things you know nothing about. -% -There is a 20% chance of tomorrow. -% -There is a building with four floors. On the first floor, there -is a convention of architects. On the second floor, there is a -vinyl manufacturing plant. On the third floor there is a fast food -stand, and on the fourth floor there is a library. - -Q: What would happen if a librarian traveled down in a small - elevator with one other person from each floor? -A: The elevator would be full. -% -There is a certain frame of mind to which a cemetery -is, if not an antidote, at least an alleviation. If -you are in a fit of the blues, go nowhere else. - -- Robert Louis Stevenson, "Immortelles" -% -There is a certain impertinence in allowing oneself to be burned for an -opinion. - -- Anatole France -% -There is a fly on your nose. -% -There is a good deal of solemn cant about the common interests of capital -and labour. As matters stand, their only common interest is that of cutting -each other's throat. - -- Brooks Atkinson, "Once Around the Sun" -% -There is a great discovery still to be made in Literature: -that of paying literary men by the quantity they do NOT write. -% -There is a green, multi-legged creature crawling on your shoulder. -% -There is a limit to the admiration we may hold for a man who spends -his waking hours poking the contents of chickens with a stick. - -- Tom Robbins, "Jitterbug Perfume" -% -There is a Massachusetts law requiring all dogs to have their hind legs -tied during the month of April. -% -There is a natural hootchy-kootchy to a goldfish. - -- Walt Disney -% -There is a new anti-communist organization that advocates the use of -wooden toilet seats. - -It's called the Birch John Society. -% -There is a road to freedom. Its milestones are Obedience, Endeavor, Honesty, -Order, Cleanliness, Sobriety, Truthfulness, Sacrifice, and love of the -Fatherland. - -- Adolf Hitler -% -There is a theory which states that if ever anyone discovers exactly -what the Universe is for and why it is here, it will instantly -disappear and be replaced by something even more bizarre and -inexplicable. - -There is another theory which states that this has already happened. - -- Douglas Adams, "The Restaurant at the End of the Universe" -% -There is a time in the tides of men, -Which, taken at its flood, leads on to success. -On the other hand, don't count on it. - -- T. K. Lawson -% -There is a vast difference between the savage and civilized man, but it -is never apparent to their wives until after breakfast. - -- Helen Rowland -% -There is always more hell that needs raising. - -- Lauren Leveut -% -There is always one thing to remember: writers are always selling -somebody out. - -- Joan Didion, "Slouching Towards Bethlehem" -% -There is always someone worse off than yourself. -% -There is always something new out of Africa. - -- Gaius Plinius Secundus -% -There is an innocence in admiration; it is found in those to whom it -has not yet occurred that they, too, might be admired some day. - -- Friedrich Nietzsche -% -There is an old time toast which is golden for its beauty. -"When you ascend the hill of prosperity may you not meet a friend." - -- Mark Twain -% -There is brutality and there is honesty. -There is no such thing as brutal honesty. -% -There is Good Information and there is Bad Information and the -Internet is generally pretty neutral about the difference. If you're -a computer, it's all just 0s and 1s. - -- Joel Achenbach -% -There is grandeur in this view of life, with its several powers, -having been originally breathed into a few forms or into one; and that, -whilst this planet has gone cycling on according to the fixed law of -gravity, from so simple a beginning endless forms most beautiful and -most wonderful have been, and are being, evolved. - -- Darwin -% -There is hardly a thing in the world that some man can -not make a little worse and sell a little cheaper. -% -There is hopeful symbolism in the fact that flags do not wave in a vacuum. - -- Arthur C. Clarke -% -There is in certain living souls -A quality of loneliness unspeakable, -So great it must be shared -As company is shared by lesser beings. -Such a loneliness is mine; so know by this -That in immensity -There is one lonelier than you. -% -There is, in fact, no reason to believe that any given natural phenomenon, -however marvelous it may seem today, will remain forever inexplicable. -Soon or late the laws governing the production of life itself will be -discovered in the laboratory, and man may set up business as a creator -on his own account. The thing, indeed, is not only conceivable; it is -even highly probable. - -- H. L. Mencken, 1930 -% -There *_i_s* intelligent life on Earth, but I leave for Texas on Monday. -% -There is Jackson standing like a stone wall. Let us determine to die, -and we will conquer. Follow me. - -- General Barnard E. Bee (CSA) -% -There is more simplicity in a man who eats caviar on impulse than in a -man who eats Grapenuts on principle. - -- G. K. Chesterton -% -There is more to life than increasing its speed. - -- Mohandas K. Gandhi -% -There is much Obi-Wan did not tell you. - -- Darth Vader -% -There is never enough time to do it right the first time, but there is -always enough time to do it over. -% -There is never time to do it right, but always time to do it over. -% -There is no act of treachery or mean-ness of which a political party -is not capable; for in politics there is no honour. - -- Benjamin Disraeli, "Vivian Grey" -% -There is no bad taste. There is only good taste, and that is bad. - -- Poul Henningsen (1894-1967) -% -There is no better way of exercising the imagination than the study of law. -No poet ever interpreted nature as freely as a lawyer interprets truth. - -- Jean Giraudoux, "Tiger at the Gates" -% -There is no choice before us. Either we must Succeed in providing -the rational coordination of impulses and guts, or for centuries -civilization will sink into a mere welter of minor excitements. -We must provide a Great Age or see the collapse of the upward -striving of the human race. - -- Alfred North Whitehead -% -There is no comfort without pain; thus -we define salvation through suffering. - -- Cato -% -There is no cure for birth and death other than to enjoy the interval. - -- George Santayana -% -There is no delight the equal of dread. -As long as it is somebody else's. - -- Clive Barker -% -There is no distinction between any AI program and some existent game. -% -There is no distinctly native American criminal class except Congress. - -- Mark Twain -% -There is no doubt that my lawyer is honest. For example, when he -filed his income tax return last year, he declared half of his salary -as "unearned income." - -- Michael Lara -% -There is no education that is not political. An apolitical -education is also political because it is purposely isolating. -% -There is no Father Christmas. It's just a marketing ploy to make low income -parents' lives a misery. ... I want you to picture the trusting face of a -child, streaked with tears because of what you just said. I want you to -picture the face of its mother, because one week's dole won't pay for one -Master of the Universe Battlecruiser! - -- Filthy Rich and Catflap -% -There is no fear in love; but perfect love casteth out fear. -% -There is no fool to the old fool. - -- John Heywood -% -There is no future in time travel. -% -There is no grief which time does not lessen and soften. -% -There is no hunting like the hunting of man, and those who have hunted -armed men long enough and liked it, never care for anything else thereafter. - -- Ernest Hemingway -% -There is no likelihood man can ever tap the power of the atom. - -- Robert Millikan, Nobel Prize in Physics, 1923 -% -There is no need to do any housework at all. After the first four years -the dirt doesn't get any worse. - -- Quentin Crisp -% -There is no ox so dumb as the orthodox. - -- George Francis Gillette -% -There is no point in waiting. -The train stopped running years ago. -All the schedules, the brochures, -The bright-colored posters full of lies, -Promise rides to a distant country -That no longer exists. -% -There is no proverb that is not true. - -- Cervantes -% -There is no realizable power that man cannot, in time, fashion the -tools to attain, nor any power so secure that the naked ape will not -abuse it. So it is written in the genetic cards -- only physics and -war hold him in check. And also the wife who wants him home by five, -of course. - -- Encyclopedia Apocryphia, 1990 ed. -% -There is no reason for any individual to have a computer in their home. - -- Ken Olsen (President of Digital Equipment Corporation), - Convention of the World Future Society, in Boston, 1977 -% -There is no royal road to geometry. - -- Euclid -% -There is no sadder sight than a young pessimist. -% -There is no satisfaction in hanging a man who does not object to it. - -- George Bernard Shaw -% -There is no security on this earth. There is only opportunity. - -- General Douglas MacArthur -% -There is no sin but ignorance. - -- Christopher Marlowe -% -There is no sincerer love than the love of food. - -- George Bernard Shaw -% -There is no statute of limitations on stupidity. -% -There is no substitute for good manners, except, perhaps, fast reflexes. -% -There *is* no such thing as a civil engineer. -% -There is no such thing as a free lunch. -% -There is no such thing as a problem without a gift for you in its hands. -% -There is no such thing as an ugly woman -- there are only -the ones who do not know how to make themselves attractive. - -- Christian Dior -% -There is no such thing as fortune. Try again. -% -There is no such thing as inner peace. There is only nervousness or death. -Any attempt to prove otherwise constitutes unacceptable behaviour. - -- Fran Lebowitz, "Metropolitan Life" -% -There is no such thing as pure pleasure; -some anxiety always goes with it. -% -There is no time like the pleasant. -% -There is no time like the present -for postponing what you ought to be doing. -% -There is no TRUTH. There is no REALITY. There is no CONSISTENCY. -There are no ABSOLUTE STATEMENTS. I'm very probably wrong. -% -There is not a man in the country that can't make a living for himself and -family. But he can't make a living for them *and* his government, too, -the way his government is living. What the government has got to do is -live as cheap as the people. - -- The Best of Will Rogers -% -There is not much to choose between a woman who deceives -us for another, and a woman who deceives another for ourselves. - -- Augier -% -There is not opinion so absurd that some philosopher will not express it. - -- Marcus Tullius Cicero, "Ad familiares" -% -There is nothing more exhilarating than to be shot at without result. - -- Winston Churchill -% -There is nothing more silly than a silly laugh. - -- Gaius Valerius Catullus -% -There is nothing new except what has been forgotten. - -- Marie Antoinette -% -There is nothing so easy but that it becomes difficult -when you do it reluctantly. - -- Publius Terentius Afer (Terence) -% -There is nothing stranger in a strange land than the stranger who -comes to visit. -% -There is nothing which cannot be answered by means of my doctrine," said -a monk, coming into a teahouse where Nasrudin sat. - "And yet just a short time ago, I was challenged by a scholar with -an unanswerable question," said Nasrudin. - "I could have answered it if I had been there." - "Very well. He asked, 'Why are you breaking into my house in -the middle of the night?'" -% -There is nothing wrong with abstinence, in moderation. -% -There is nothing wrong with Southern California that a rise in the -ocean level wouldn't cure. - -- Ross MacDonald -% -There is nothing wrong with writing ... as long as it -is done in private and you wash your hands afterward. -% -There is one difference between a tax collector and -a taxidermist -- the taxidermist leaves the hide. - -- Mortimer Caplan -% -There is one way to find out if a man is honest -- ask him. If he says -"Yes" you know he is crooked. - -- Groucho Marx -% -There is only one thing in the world worse than being -talked about, and that is not being talked about. - -- Oscar Wilde -% -There is only one way to be happy by means of the heart -- to have none. - -- Paul Bourget -% -There is only one way to console a widow. But remember the risk. - -- Robert A. Heinlein -% -There is only one way to kill capitalism -- -by taxes, taxes, and more taxes. - -- Karl Marx -% -There is only one word for aid that is genuinely without strings, -and that word is blackmail. - -- Colm Brogan -% -There is perhaps in every thing of any consequence, secret history, which -it would be amusing to know, could we have it authentically communicated. - -- James Boswell -% -There is plenty of time before progress goes too far. - -- Poul Henningsen (1894-1967) -% -There is something in the pang of change -More than the heart can bear, -Unhappiness remembering happiness. - -- Euripides -% -There is very little future in being right when your boss is wrong. -% -There isn't room enough in this dress for both of us! -% -There may be said to be two classes of people in the world; those who -constantly divide the people of the world into two classes and those -who do not. - -- Robert Benchley -% -There must be at least 500,000,000 rats in the United -States; of course, I never heard the story before. -% -There must be more to life than having everything. - -- Maurice Sendak -% -There never was a good war or a bad peace. - -- Benjamin Franklin -% -There once was a king who ruled his country long, wisely, and well. The -king had a son whom he hoped would someday rule the land. He also wished -in his heart that the son would be wise and compassionate. One day he said -to the prince: - "If you promised that you would give a certain woman anything, even -half of your kingdom, and then she demanded the life of your best friend, -what would your decision be, my son?" - The young prince thought for a moment and then said, "I would tell -her that she was my best friend, and then cut off her head." - The king knew that his son would be a great king. -% -There once was a king who ruled his country long, wisely, and well. The -king had a son whom he hoped would someday rule the land. He also wished -in his heart that the son would be wise and compassionate. One day he said -to the prince: - "If you promised that you would give a certain woman anything, even -half of your kingdom, and then she demanded the life of your best friend, -what would your decision be, my son?" - The young prince thought for a moment and then said, "I would tell -her that the life of my best friend did not lie in the half of the kingdom -that I had promised." - The king knew that his son would be a great king. -% -There seems no plan because it is all plan. - -- C. S. Lewis -% -There was a boy called Eustace Clarence Scrubb, and he almost deserved it. - -- C. S. Lewis, "The Chronicles of Narnia" -% -There was a little girl -Who had a little curl -Right in the middle of her forehead. -When she was good, she was very, very good -And when she was bad, she was very, very popular. - -- Max Miller, "The Max Miller Blue Book" -% -There was a man who enjoyed playing golf, and could occasionally put up -with taking in a round with his wife. One time (with his wife along) he -was having an extremely bad round. On the 12th hole, he sliced a drive -over by a grounds-keepers' shack. Although he did not have a clear shot -to the green, his wife noticed that there were two doors on the shack, -and there was a possibility that, if both doors were opened, he might be -able to hit through. Without hesitation, he instructed his wife to go -around to the other side and open the far door. Sure enough, this gave -him a clear path to the green. He stepped up to his ball and prepared -to hit. His wife had been standing by the far door waiting for him to -hit through. After a moment, she became curious and stuck her head in -the doorway, to see what he was doing. At that exact moment, the husband -cracked a three-wood that hit his wife square on the forehead, killing -her instantly. A few weeks later, the man was playing a round at the same -course, this time with a friend of his. Once again on the 12th hole, he -sliced his drive to the shack. His friend suggested that he might be able -to hit through, if he was to open both doors. - "Nah", replied the man, "Last time I did that I took a 7". -% -There was a phone call for you. -% -There was a plane crash over mid-ocean, and only three survivors were -left in the life-raft: the Pope, the President, and Mayor Daley. -Unfortunately, it was a one-man life-raft, and quickly sinking, so -they started debating who should be allowed to stay. The Pope pointed -out that he was the spiritual leader of millions all over the world, -the President explained that if he died then America would be stuck -with the Vice-President, and so forth. Then Mayor Daley said, "Look! -We're not solving anything like this! The only fair thing to do is -to vote on it." So they did, and Mayor Daley won by 97 votes. -% -There was a writer in 'Life' magazine ... who claimed that rabbits have -no memory, which is one of their defensive mechanisms. If they recalled -every close shave they had in the course of just an hour life would become -insupportable. - -- Kurt Vonnegut, Jr. -% -There was a young man from LeDoux, -Whose limericks stopped at line two. - -There was a young man from Verdunne. - - [Actually, there are three limericks in this series, the third one - is about some guy named Nero. If anyone has a copy of it, please - mail it to "fortune". Ed.] -% -There was an interesting development in the CBS-Westmoreland trial: -both sides agreed that after the trial, Andy Rooney would be allowed to -talk to the jury for three minutes about little things that annoyed him -during the trial. - -- David Letterman -% -There was an old Indian belief that by making love on the hide of -their favorite animal, one could guarantee the health and prosperity -of the offspring conceived thereupon. And so it goes that one Indian -couple made love on a buffalo hide. Nine months later, they were -blessed with a healthy baby son. Yet another couple huddled together -on the hide of a deer and they too were blessed with a very healthy -baby son. But a third couple, whose favorite animal was a hippopotamus, -were blessed with not one, but TWO very healthy baby sons at the conclusion -of the nine month interval. All of which proves the old theorem that: -The sons of the squaw of the hippopotamus are equal to the sons of -the squaws of the other two hides. -% -There was, it appeared, a mysterious rite of initiation through which, -in one way or another, almost every member of the team passed. The term -that the old hands used for this rite -- West invented the term, not the -practice -- was `signing up.' By signing up for the project you agreed -to do whatever was necessary for success. You agreed to forsake, if -necessary, family, hobbies, and friends -- if you had any of these left -(and you might not, if you had signed up too many times before). - -- Tracy Kidder, "The Soul of a New Machine" -% -There was this New Yorker that had a lifelong ambition to be a Texan. -Fortunately, he had a Texan friend and went to him for advice. "Mike, -you know I've always wanted to be a Texan. You're a *real* Texan, what -should I do?" - "Well," answered Mike, "The first thing you've got to do is look -like a Texan. That means you have to dress right. The second thing -you've got to do is speak in a southern drawl." - "Thanks, Mike, I'll give it a try," replied the New Yorker. - A few weeks passed and the New Yorker saunters into a store dressed -in a ten-gallon hat, cowboy boots, Levi jeans and a bandanna. "Hey, there, -pardner, I'd like some beef, not too rare, and some of them fresh biscuits," -he tells the counterman. - The guy behind the counter takes a long look at him and then says, -"You must be from New York." - The New Yorker blushes, and says, "Well, yes, I am. How did -you know?" - "Because this is a hardware store." -% -There were in this country two very large monopolies. The larger of -the two had the following record: the Vietnam War, Watergate, double- -digit inflation, fuel and energy shortages, bankrupt airlines, and the -8-cent postcard. The second was responsible for such things as the -transistor, the solar cell, lasers, synthetic crystals, high fidelity -stereo recording, sound motion pictures, radio astronomy, negative -feedback, magnetic tape, magnetic "bubbles", electronic switching -systems, microwave radio and TV relay systems, information theory, the -first electrical digital computer, and the first communications -satellite. Guess which one got to tell the other how to run the -telephone business? -% -There will always be beer cans rolling on the floor of your car when -the boss asks for a lift home from the office. -% -There will be big changes for you but you will be happy. -% -There will be sex after death, we just won't be able to feel it. - -- Lily Tomlin -% -Therefore it is necessary to learn how not to be good, and to use -this knowledge and not use it, according to the necessity of the cause. - -- Machiavelli -% -There's a couple of million dollars worth of baseball talent on the loose, -ready for the big leagues, yet unsigned by any major league. There are -pitchers who would win 20 games a season ... and outfielders [who] could -hit .350, infielders who could win recognition as stars, and there's at -least one catcher who at this writing is probably superior to Bill Dickey, -Josh Gibson. Only one thing is keeping them out of the big leagues, the -pigmentation of their skin. They happen to be colored. - -- Shirley Povich, 1941 -% -There's a fine line between courage and foolishness. Too bad it's not -a fence. -% -There's a lesson that I need to remember -When everything is falling apart -In life, just like in loving -There's such a thing as trying to hard - -You've gotta sing -Like you don't need the money -Love like you'll never get hurt -You've gotta dance -Like nobody's watching -It's gotta come from the heart -If you want it to work. - -- Kathy Mattea -% -There's a long-standing bug relating to the x86 architecture that -allows you to install Windows. - -- Matthew D. Fuller -% -There's a lot to be said for not saying a lot. -% -There's a man deeply in debt, see, and he takes the money he has left -and goes to Monte Carlo to try to recoup at the roulette tables. Won a -little, lost a lot, and was down to his last franc. Prayed for help. -A voice whispered in his ear: "Le rouge..." Man looked around; nobody -there. What the hell -- he puts his last franc on the red, and it won. -The voice immediately said, "Encore le rouge..." Played red again, and -it won again. The voice said, "Impair..." Played odd, and it won. Voice -said, "Quinze..." so he put all the money on 15, and it won. This went -on for hours, the voice telling him what to bet, and the man putting all -his money on what the voice said, and winning. Finally when the voice -spoke, the man protested that he'd won millions of dollars and wanted to -quit. The voice was inexorable: "Douze..." The man put the money on 12, -and 11 came up -- he had lost everything -- the voice murmured "Merde!!" -% -There's a thrill in store for all for we're about to toast -The corporation that we represent. -We're here to cheer each pioneer and also proudly boast, -Of that man of men our sterling president -The name of T. J. Watson means -A courage none can stem -And we feel honored to be here to toast the IBM. - -- Ever Onward, from the 1940 IBM Songbook -% -There's a trick to the Graceful Exit. It begins with the vision to -recognize when a job, a life stage, a relationship is over -- and to -let go. It means leaving what's over without denying its validity -or its past importance in our lives. It involves a sense of future, -a belief that every exit line is an entry, that we are moving on, -rather than out. The trick of retiring well may be the trick of -living well. It's hard to recognize that life isn't a holding -action, but a process. It's hard to learn that we don't leave the -best parts of ourselves behind, back in the dugout or the office. -We own what we learned back there. The experiences and the growth -are grafted onto our lives. And when we exit, we can take ourselves -along -- quite gracefully. - -- Ellen Goodman -% -There's a whole WORLD in a mud puddle! - -- Doug Clifford -% -There's always free cheese in a mousetrap. -% -There's an old proverb that says just about whatever you want it to. -% -There's been no top authority saying what marijuana does to you. I really -don't know that much about it. I tried it once but it didn't do anything -to me. - -- John Wayne -% -There's got to be more to life than compile-and-go. -% -There's just something I don't like about Virginia; the state. -% -There's little in taking or giving, - There's little in water or wine: -This living, this living, this living, - Was never a project of mine. -Oh, hard is the struggle, and sparse is - The gain of the one at the top, -For art is a form of catharsis, - And love is a permanent flop, -And work is the province of cattle, - And rest's for a clam in a shell, -So I'm thinking of throwing the battle -- - Would you kindly direct me to hell? - -- Dorothy Parker -% -There's no easy quick way out, we're gonna have to live through our -whole lives, win, lose, or draw. - -- Walt Kelly -% -There's no justice in this world. - -- Frank Costello, on the prosecution of "Lucky" Luciano - by New York district attorney Thomas Dewey after - Luciano had saved Dewey from assassination by Dutch - Schultz (by ordering the assassination of Schultz - instead) -% -There's no point in being grown up if you can't be childish sometimes. - -- The Doctor, "Doctor Who" -% -There's no real need to do housework -- after four years it doesn't get -any worse. -% -There's no room in the drug world for amateurs. - -- Raoul Duke -% -There's no saint like a reformed sinner. -% -There's no sense in being precise when you don't even know -what you're talking about. - -- John von Neumann -% -There's no such thing as a free lunch. - -- Milton Friendman -% -There's no such thing as an original sin. - -- Elvis Costello -% -There's no trick to being a humorist when you have the whole government -working for you. - -- Will Rogers -% -There's no use in having a dog and doing your own barking. -% -There's nothing in the middle of the road but yellow stripes and dead -armadillos. - -- Jim Hightower, Texas Agricultural Commissioner -% -There's nothing like a girl with a plunging -neckline to keep a man on his toes. -% -There's nothing like a good dose of another woman to make a man -appreciate his wife. - -- Clare Booth Luce -% -There's nothing like good food, good wine, and a bad girl. -% -There's nothing like the face of a kid eating a Hershey bar. -% -There's nothing remarkable about it. All one has to do is hit the right -keys at the right time and the instrument plays itself. - -- J. S. Bach -% -There's nothing so precious as a cafe full of Gap kiddies trying to -work out whether you're really wearing rubber pants. - -- Mike Smith -% -There's nothing to writing. All you do is sit at a typewriter -and open a vein. - -- Red Smith -% -There's nothing very mysterious about you, except that -nobody really knows your origin, purpose, or destination. -% -There's nothing worse for your business than -extra Santa Clauses smoking in the men's room. - -- W. Bossert -% -There's nothing wrong with teenagers that -reasoning with them won't aggravate. -% -There's one consolation about matrimony. When you look around you can -always see somebody who did worse. - -- Warren H. Goldsmith -% -There's one fool at least in every married couple. -% -There's only one everything. -% -There's only one way to have a happy marriage -and as soon as I learn what it is I'll get married again. - -- Clint Eastwood -% -There's small choice in rotten apples. - -- William Shakespeare, "The Taming of the Shrew" -% -There's so much plastic in this culture that -vinyl leopard skin is becoming an endangered synthetic. - -- Lily Tomlin -% -There's so much to say but your eyes keep interrupting me. -% -There's something different about us -- different from people of Europe, -Africa, Asia ... a deep and abiding belief in the Easter Bunny. - -- G. Gordon Liddy -% -There's something the technicians need to learn from the artists. -If it isn't aesthetically pleasing, it's probably wrong. -% -There's such a thing as too much point on a pencil. - -- H. Allen Smith, "Let the Crabgrass Grow" -% -There's too much beauty upon this earth for lonely men to bear. - -- Richard Le Gallienne -% -These activities have their own rules and methods -of concealment which seek to mislead and obscure. - -- Dwight D. Eisenhower, 1960 -% -"These are DARK TIMES for all mankind's HIGHEST VALUES!" -"These are DARK TIMES for FREEDOM and PROSPERITY!" -"These are GREAT TIMES to put your money on BAD GUY to kick the CRAP -out of MEGATON MAN!" -% -These days the necessities of life cost you about three times what -they used to, and half the time they aren't even fit to drink. -% -They also serve who only stand and wait. - -- John Milton -% -They also surf who only stand on waves. -% -They are called computers simply because computation is -the only significant job that has so far been given to them. -% -They are cold-blooded. They are completely ruthless about protecting -what they have. The only thing they connect to is the money aspect of -life. Let's face it: That's the American way. - -- Jeffrey M. Johnson, regional chairman of the District - of Columbia United Way, speaking of drug dealers. -% -They are ill discoverers that think there is no land, -when they can see nothing but sea. - -- Francis Bacon -% -They are relatively good but absolutely terrible. - -- Alan Kay, commenting on Apollos -% -They call them "squares" because it's the -most complicated shape they can deal with. -% -They can't stop us... we're on a mission from God! - -- The Blues Brothers -% -They couldn't hit an elephant at this dist... - -- Civil War General John Sedgwick, his last words, - Battle of Spotsylvania Court House, 1864 -% -They don't know how the world is shaped. And so they give it a shape, and -try to make everything fit it. They separate the right from the left, the -man from the woman, the plant from the animal, the sun from the moon. They -only want to count to two. - -- Emma Bull, "Bone Dance" -% -They don't suffer. They can't even speak English. - -- George F. Baer, answering a reporter's - question about the suffering of starving miners. -% -They finally got King Midas, I hear. Gild by association. -% -They have been at a great feast of languages, and stolen the scraps. - -- William Shakespeare, "Love's Labour's Lost" -% -They have their datasheets translated from Korean into English by -Russians with Greek->German dictionaries - -- Philip Paeps, on modern hardware documentation -% -They just buzzed and buzzed...buzzed. -% -They make a desert and call it peace. - -- Tacitus (55?-120?) -% -They say it's the responsibility of the media to look at government -- -especially the president -- with a microscope. I don't argue with that, -but when they use a proctoscope, it's going too far. - -- Richard M. Nixon -% -They seem to have learned the habit of cowering before authority even when -not actually threatened. How very nice for authority. I decided not to -learn this particular lesson. - -- Richard Stallman -% -They sentenced me to twenty years of boredom for trying to change the -system from within. I'm coming now I'm coming to reward them. First -we take Manhattan, then we take Berlin. - -I'm guided by a signal in the heavens. I'm guided by this birthmark on -my skin. I'm guided by the beauty of our weapons. First we take Manhattan, -then we take Berlin. - -I'd really like to live beside you, baby. I love your body and your spirit -and your clothes. But you see that line there moving through the station? -I told you I told you I told you I was one of those. - -- Leonard Cohen, "First We Take Manhattan" -% -They spell it "da Vinci" and pronounce it "da Vinchy". Foreigners -always spell better than they pronounce. - -- Mark Twain -% -They that can give up essential liberty to obtain a little temporary -safety deserve neither liberty nor safety. - -- Benjamin Franklin, 1759 -% -They told me I was gullible ... and I believed them! -% -They told me you had proven it When they discovered our results -About a month before. Their hair began to curl -The proof was valid, more or less Instead of understanding it -But rather less than more. We'd run the thing through PRL. - -He sent them word that we would try Don't tell a soul about all this -To pass where they had failed For it must ever be -And after we were done, to them A secret, kept from all the rest -The new proof would be mailed. Between yourself and me. - -My notion was to start again -Ignoring all they'd done -We quickly turned it into code -To see if it would run. -% -They took some of the Van Goghs, most -of the jewels, and all of the Chivas! -% -They Tore Out My Heart and Stomped That Sucker Flat - -- Book title by Lewis Grizzard -% -They use different words for things in America. -For instance they say elevator and we say lift. -They say drapes and we say curtains. -They say president and we say brain damaged git. - -- Alexie Sayle -% -They went rushing down that freeway, -Messed around and got lost. -They didn't care... they were just dying to get off, -And it was life in the fast lane. - -- Eagles, "Life in the Fast Lane" -% -They will only cause the lower classes to move about needlessly. - -- The Duke of Wellington, on early steam railroads -% -They wouldn't listen to the fact that I was a genius, -The man said "We got all that we can use", -So I've got those steadily-depressin', low-down, mind-messin', -Working-at-the-car-wash blues. - -- Jim Croce -% -They're an insidious bunch, your killer pianos. Had one get loose on me -back in '62. It slipped out of the cables while we were lowering it out -of its twelfth story apartment, and crushed six innocents in an insane bid -for freedom. - -- Stig's Inferno -% -They're basically very smelly houseplants until they get to the crawling -age. You're constantly terrified that they're going to randomly die on -you, but the rules for preventing that outcome are straightforward and -hard to forget. - -- Thomas Ptacek, giving advice to a new father -% -They're giving bank robbing a bad name. - -- John Dillinger, on Bonnie and Clyde -% -They're only trying to make me LOOK paranoid! -% -They're unfriendly, which is fortunate, really. They'd be difficult -to like. - -- Avon -% -Thieves respect property; they merely wish the property to become -their property that they may more perfectly respect it. - -- G. K. Chesterton, "The Man Who Was Thursday" -% -Things are more like they are today than they ever were before. - -- Dwight D. Eisenhower -% -Things are more like they used to be than they are now. -% -Things are not always what they seem. - -- Phaedrus -% -Things Charles Darwin did not say: - -Finches, eh? Seen one, seem 'em all. -% -Things Charles Darwin did not say: - -Nah, it's only a theory - I don't think it should be taught in schools. -% -Things fall apart; the centre cannot hold. -% -Things past redress and now with me past care. - -- William Shakespeare, "Richard II" -% -Things will be bright in P.M. -A cop will shine a light in your face. -% -Things will get better despite our efforts to improve them. - -- Will Rogers -% -Things worth having are worth cheating for. -% -Think big. -Pollute the Mississippi. -% -Think honk if you're a telepath. -% -Think lucky. If you fall in a pond, check your pockets for fish. - -- Darrell Royal -% -Think of it! With VLSI we can pack 100 ENIACs in 1 sq. cm.! -% -Think of your family tonight. -Try to crawl home after the computer crashes. -% -Think sideways! - -- Ed De Bono -% -Think twice before speaking, but don't say "think think click click". -% -Thinking you know something is a sure way to blind yourself. - -- Frank Herbert, "Chapterhouse: Dune" -% -Thinks't thou existence doth depend on time? -It doth; but actions are our epochs; mine -Have made my days and nights imperishable, -Endless, and all alike, as sands on the shore, -Innumerable atoms; and one desert, -Barren and cold, on which the wild waves break, -But nothing rests, save carcasses and wrecks, -Rocks, and the salt-surf weeds of bitterness. -% -Thirteen at a table is unlucky only -when the hostess has only twelve chops. - -- Groucho Marx -% -Thirty days hath Septober, -April, June, and no wonder. -all the rest have peanut butter -except my father who wears red suspenders. -% -Thirty white horses on a red hill, -First they champ, -Then they stamp, -Then they stand still. - -- Tolkien -% -This ae nighte, this ae nighte, -Everye nighte and alle, -Fire and sleet and candlelyte, -And Christe receive thy saule. - -- The Lykewake Dirge -% -This "brain-damaged" epithet is getting sorely overworked. When we can -speak of someone or something being flawed, impaired, marred, spoiled; -batty, bedlamite, bonkers, buggy, cracked, crazed, cuckoo, daft, demented, -deranged, loco, lunatic, mad, maniac, mindless, non compos mentis, nuts, -Reaganite, screwy, teched, unbalanced, unsound, witless, wrong; senseless, -spastic, spasmodic, convulsive; doped, spaced-out, stoned, zonked; {beef, -beetle,block,dung,thick}headed, dense, doltish, dull, duncical, numskulled, -pinhead; asinine, fatuous, foolish, silly, simple; brute, lumbering, oafish; -half-assed, incompetent; backward, retarded, imbecilic, moronic; when we have -a whole precisely nuanced vocabulary of intellectual abuse to draw upon, -individually and in combination, isn't it a little to be -limited to a single, now quite trite, adjective? -% -This door is baroquen, please wiggle Handel. -(If I wiggle Handel, will it wiggle Bach?) - -- Found on a door in the MSU music building -% -This dungeon is owned and operated by Frobazz Magic Co., Ltd. -% -This email and any files transmitted with it are confidential and -intended solely for the use of the individual or entity to which they -are addressed. If you are not the intended recipient of this -transmission, please delete it immediately. - -Obviously, I am the idiot who sent it to you by mistake. Furthermore, -there is no way I can force you to delete it. Worse, by the time you -have reached this disclaimer you have already read the document. -Telling you to forget it would seem absurd. In any event, I have no -legal right to force you to take any action upon this email anyway. - -This entire disclaimer is just a waste of everyone's time and -bandwidth. Therefore, let us just forget the whole thing and enjoy a -cold beer instead. - -- found on the dovecot mailinglist -% -This file will self-destruct in five minutes. -% -This Fortue Examined By INSPECTOR NO. 2-14 -% -This fortune cookie program out of order. For those in desperate -need, please use the program "randchar". This program generates -random characters, and, given enough time, will undoubtedly come -up with something profound. It will, however, take it no time at -all to be more profound than THIS program has ever been. -% -This fortune intentionally not included. -% -This fortune intentionally says nothing. -% -This fortune is dedicated to your mother, without whose -invaluable assistance last night would never have been possible. -% -This fortune is encrypted -- get your decoder rings ready! -% -This fortune is false. -% -This fortune is inoperative. Please try another. -% -This fortune soaks up 47 times its own weight in excess memory. -% -This fortune was brought to you by the people at Hewlett-Packard. -% -This fortune would be seven words long if it were six words shorter. -% -This generation doesn't have emotional baggage. -We have emotional moving vans. - -- Bruce Feirstein -% -This guy runs into his house and yells to his wife, "Kathy, pack up your -bags! I just won the California lottery!" - "Honey!", Kathy exclaims, "Shall I pack for warm weather or cold?" - "I don't care," responds the husband. "just so long as you're out -of the house by dinner!" -% -This is a country where people are free to practice their religion, -regardless of race, creed, color, obesity, or number of dangling keys... -% -This is a good time to punt work. -% -This is a job for BOB VIOLENCE and SCUM, the INCREDIBLY STUPID MUTANT -DOG. - -- Bob Violence -% -This is a test of the Emergency Broadcast System. If this had been an -actual emergency, do you really think we'd stick around to tell you? -% -This is a test of the emergency broadcast system. -Had there been an actual emergency, then you would no longer be here. -% -This is an especially good time for you vacationers who plan to fly, -because the Reagan administration, as part of the same policy under -which it recently sold Yellowstone National Park to Wayne Newton, has -"deregulated" the airline industry. What this means for you, the -consumer, is that the airlines are no longer required to follow any -rules whatsoever. They can show snuff movies. They can charge for -oxygen. They can hire pilots right out of Vending Machine Refill -Person School. They can conserve fuel by ejecting husky passengers -over water. They can ram competing planes in mid-air. These -innovations have resulted in tremendous cost savings which have been -passed along to you, the consumer, in the form of flights with -amazingly low fares, such as $29. Of course, certain restrictions do -apply, the main one being that all these flights take you to Newark, -and you must pay thousands of dollars if you want to fly back out. - -- Dave Barry, "Iowa -- Land of Secure Vacations" -% -This is an unauthorized cybernetic announcement. -% -This is Betty Frenel. I don't know who to call but I can't reach my -Food-a-holics partner. I'm at Vido's on my second pizza with sausage -and mushroom. Jim, come and get me! -% -This is clearly another case of too many mad scientists, -and not enough hunchbacks. -% -This is for all ill-treated fellows - Unborn and unbegot, -For them to read when they're in trouble - And I am not. - -- A. E. Housman -% -This is Jim Rockford. -At the tone leave your name and message; I'll get back to you. -% -This is lemma 1.1. We start a new chapter so the numbers all go back -to one. - -- Prof. Seager, C&O 351 -% -This is Maria, Liberty Bail Bonds. Your client, Todd Lieman, skipped and -his bail is forfeit. That's the pink slip on your '74 Firebird, I believe. -Sorry, Jim, bring it on over. -% -This is Marilyn Reed, I wanta talk to you... Is this a machine? -I don't talk to machines! [Click] -% -This is National Non-Dairy Creamer Week. -% -This is NOT a repeat. -% -This is not the age of pamphleteers. It is the age of the engineers. The -spark-gap is mightier than the pen. Democracy will not be salvaged by men -who talk fluently, debate forcefully and quote aptly. - -- Lancelot Hogben, Science for the Citizen, 1938 -% -THIS IS PLEDGE WEEK FOR THE FORTUNE PROGRAM - -If you like the fortune program, why not support it now with your -contribution of a pithy fortune, clean or obscene? We cannot continue -without your support. Less than 14% of all fortune users are -contributors. That means that 86% of you are getting a free ride. We -can't go on like this much longer. Federal cutbacks mean less money -for fortunes, and unless user contributions increase to make up the -difference, the fortune program will have to shut down between midnight -and 8 a.m. Don't let this happen. Mail your fortunes right now to -"fortune". Just type in your favorite pithy saying. Do it now before -you forget. Our target is 300 new fortunes by the end of the week. -Don't miss out. All fortunes will be acknowledged. If you contribute -30 fortunes or more, you will receive a free subscription to "The -Fortune Hunter", our monthly program guide. If you contribute 50 or -more, you will receive a free "Fortune Hunter" coffee mug ... -% -This is supposed to be a happy occasion. -Let's not BICKER and ARGUE over who killed who! -% -This is the Baron. Angel Martin tells me you buy information. Ok, -meet me at one a.m. behind the bus depot, bring five-hundred dollars -and come alone. I'm serious! -% -This is the first age that's paid much attention to the future, -which is a little ironic since we may not have one. - -- Arthur C. Clarke -% -This is the first numerical problem I ever did. It demonstrates the -power of computers: - -Enter lots of data on calorie & nutritive content of foods. Instruct the -thing to maximize a function describing nutritive content, with a minimum -level of each component, for fixed caloric content. The results are that -one should eat each day: - - 1/2 chicken - 1 egg - 1 glass of skim milk - 27 heads of lettuce. - -- Rev. Adrian Melott -% -This is the _L_A_S_T time I take travel suggestions from Ray Bradbury! -% -This is the sort of English up with which I will not put. - -- Winston Churchill -% -This is the story of the bee -Whose sex is very hard to see - -You cannot tell the he from the she -But she can tell, and so can he - -The little bee is never still -She has no time to take the pill - -And that is why, in times like these -There are so many sons of bees. -% -This is the theory that Jack built. -This is the flaw that lay in the theory that Jack built. -This is the palpable verbal haze that hid the flaw that lay in... -% -This is the tomorrow you worried about yesterday. -And now you know why. -% -This is the way the world ends, -This is the way the world ends, -This is the way the world ends, -Not with a bang but with a whimper. - -- T. S. Eliot, "The Hollow Men" -% -This is your fortune. -% -This isn't right. This isn't even wrong. - -- Wolfgang Pauli, on a colleague's paper -% -This isn't true in practice -- what we've missed out is Stradivarius's -constant. And then the aside: "For those of you who don't know, that's -been called by others the fiddle factor..." - -- From a 1B Electrical Engineering lecture -% -This land is full of trousers! -this land is full of mausers! - And pussycats to eat them when the sun goes down! - -- The Firesign Theatre -% -This land is made of mountains, -This land is made of mud, -This land has lots of everything, -For me and Elmer Fudd. - -This land has lots of trousers, -This land has lots of mousers, -And pussycats to eat them -When the sun goes down. -% -This land is my land, and only my land, -I've got a shotgun, and you ain't got one, -If you don't get off, I'll blow your head off, -This land is private property. - -- Apologies to Woody Guthrie -% -This life is a test. It is only a test. Had this been an -actual life, you would have received further instructions as -to what to do and where to go. -% -This life is yours. Some of it was given -to you; the rest, you made yourself. -% -This login session: $13.99 -% -This login session: $13.99, but for you $11.88 -% -This must be morning. I never could get the hang of mornings. -% -This night methinks is but the daylight sick. - -- William Shakespeare, "The Merchant of Venice" -% -This novel is not to be tossed lightly aside, but to be hurled with -great force. - -- Dorothy Parker -% -This one is for all you military types. For those who don't know, Rangers -are *extremely* well trained members of the U.S. Army. Marines are people -who start out as normal soldiers and then are made to believe that bullets -don't actually hurt. - One day a platoon of Marines are on patrol when they come upon a -Ranger relaxing on top of a small hill. The Ranger puts his hands on his -hips and screams out, "Do any of you seaweed sucking jarheads think you're -man enough to take me on?" - The biggest Marine comes running up the hill, screaming back at the -Ranger. When he gets to the top he simply plows into his foe and the two -tumble down the other side of the hill, out of sight. There is the sound of -a horrendous fight for a moment or two, and then all is quiet. Soon, the -Ranger reappears, quite untouched. He puts his hands on his hips and sneers, -"Well, looks to me like one of you couldn't do it, how about the rest?" - The enraged Marine platoon leader sends his entire platoon (30+men) -charging after the Ranger. They all go tumbling down the far side of the hill. -After 15 minutes of screaming and yelling and cursing a lone, bloodied Marine -crawls over the top of the hill. The platoon leader yells up to his man, -"What's going on up there?" The wounded Marine, with his last bit of breath, -replies, "Sir, it's a... a trap, sir. They're two of them!" -% -This place just isn't big enough for all of us. We've -got to find a way off this planet. -% -This planet has -- or rather had -- a problem, which was this: most of -the people living on it were unhappy for pretty much of the time. Many -solutions were suggested for this problem, but most of these were -largely concerned with the movements of small green pieces of paper, -which is odd because on the whole it wasn't the small green pieces of -paper that were unhappy. - -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -This process can check if this value is zero, and if it is, it does -something child-like. - -- Forbes Burkowski, CS, University of Washington -% -This product is meant for educational purposes only. Any resemblance to real -persons, living or dead is purely coincidental. Void where prohibited. Some -assembly may be required. Batteries not included. Contents may settle during -shipment. Use only as directed. May be too intense for some viewers. If -condition persists, consult your physician. No user-serviceable parts inside. -Breaking seal constitutes acceptance of agreement. Not responsible for direct, -indirect, incidental or consequential damages resulting from any defect, error -or failure to perform. Slippery when wet. For office use only. Substantial -penalty for early withdrawal. Do not write below this line. Your canceled -check is your receipt. Avoid contact with skin. Employees and their families -are not eligible. Beware of dog. Driver does not carry cash. Limited time -offer, call now to insure prompt delivery. Use only in well-ventilated area. -Keep away from fire or flame. Some equipment shown is optional. Price does -not include taxes, dealer prep, or delivery. Penalty for private use. Call -toll free before digging. Some of the trademarks mentioned in this product -appear for identification purposes only. All models over 18 years of age. Do -not use while operating a motor vehicle or heavy equipment. Postage will be -paid by addressee. Apply only to affected area. One size fits all. Many -suitcases look alike. Edited for television. No solicitors. Reproduction -strictly prohibited. Restaurant package, not for resale. Objects in mirror -are closer than they appear. Decision of judges is final. This supersedes -all previous notices. No other warranty expressed or implied. -% -This quote is taken from the Diamondback, the University of Maryland -student newspaper, of Tuesday, 3/10/87. - - One disadvantage of the Univac system is that it does not use - Unix, a recently developed program which translates from one - computer language to another and has a built-in editing system - which identifies errors in the original program. -% -This sad little lizard told me that he was a brontosaurus on his -mother's side. I did not laugh; people who boast of ancestry -often have little else to sustain them. Humoring them costs nothing and -adds happiness in a world in which happiness is always in short supply. - -- Lazarus Long -% -This screen intentionally left blank. -% -This sentence contradicts itself -- no actually it doesn't. - -- Douglas Hofstadter -% -This sentence does in fact not have the property it claims not to have. -% -This sentence no verb. -% -This system will self-destruct in five minutes. -% -This thing all things devours: -Birds, beasts, trees, flowers; -Gnaws iron, bites steel; -Grinds hard stones to meal; -Slays king, ruins town, -And beats high mountain down. -% -This unit... must... survive. -% -This universe shipped by weight, not by volume. Some expansion of the -contents may have occurred during shipment. -% -This was a Golden Age, a time of high adventure, rich living, and hard -dying... but nobody thought so. This was a future of fortune and theft, -pillage and rapine, culture and vice... but nobody admitted it. - -- Alfred Bester, "The Stars My Destination" -% -This was the most unkindest cut of all. - -- William Shakespeare, "Julius Caesar" -% -This wasn't just plain terrible, this was fancy terrible. -This was terrible with raisins in it. - -- Dorothy Parker -% -This week only, all our fiber-fill jackets are marked down! -% -This will be a memorable month -- no matter how hard you try to forget it. -% -This yuppie, see, was in a car wreck. His BMW was mangled, and so was he. -The paramedic was leaning over him getting his vitals, and all the yup -could groan was "My BMW! My BMW!" - The paramedic tried to quiet the man, pointing out that his car -wasn't his chief concern at the moment, especially as he'd been rearranged -pretty badly himself -- for example, his left arm was severed at the elbow -and was lying about twenty feet away. - There was a moment of stunned silence from the yup followed by -"Oh no! My Rolex! My Rolex!" -% -Those lovable Brits department: - They also have trouble pronouncing `vitamin'. -% -Those of you who think you know everything are very annoying to those -of us who do. -% -Those of you who think you know it all upset those of us who do. -% -Those parts of the system that you can hit with a hammer (not advised) -are called hardware; those program instructions that you can only curse -at are called software. - -- Levitating Trains and Kamikaze Genes: Technological - Literacy for the 1990's. -% -Those who are mentally and emotionally healthy are those who have -learned when to say yes, when to say no and when to say whoopee. - -- W. S. Krabill -% -Those who believe in astrology are living in houses with foundations of -Silly Putty. - -- Dennis Rawlins -% -Those who can, do; those who can't, simulate. -% -Those who can, do; those who can't, write. -Those who can't write work for the Bell Labs Record. -% -Those who can make you believe absurdities, can make you commit atrocities. - -- Voltaire -% -Those who cannot remember the past are condemned to repeat it. - -- George Santayana -% -Those who can't write, write manuals. -% -Those who claim the dead never return -to life haven't ever been around here at quitting time. -% -Those who do not do politics will be done in by politics. - -- French Proverb -% -Those who do not understand Unix are condemned to reinvent it, poorly. - -- Henry Spencer -% -Those who do things in a noble spirit of -self-sacrifice are to be avoided at all costs. - -- N. Alexander -% -Those who educate children well are more to be honored than -parents, for these only gave life, those the art of living well. - -- Aristotle -% -Those who express random thoughts to legislative committees are often -surprised and appalled to find themselves the instigators of law. - -- Mark B. Cohen -% -Those who have had no share in the good fortunes of the mighty -Often have a share in their misfortunes. - -- Bertolt Brecht, "The Caucasian Chalk Circle" -% -Those who have some means think that the most important thing in the -world is love. The poor know that it is money. - -- Gerald Brenan -% -Those who in quarrels interpose, must often wipe a bloody nose. -% -Those who make peaceful revolution impossible -will make violent revolution inevitable. - -- John F. Kennedy -% -Those who profess to favor freedom, and yet depreciate agitation, are -men who want rain without thunder and lightning. They want the ocean -without the roar of its many waters. - -- Frederick Douglass -% -Those who sweat in flames of hell, Leaden eared, some thought their bowels -Here's the reason that they fell: Lispeth forth the sweetest vowels. -While on earth they prayed in SAS, These they offered up in praise -PL/1, or other crass, Thinking all this fetid haze -Vulgar tongue. A rhapsody sung. - -Some the lord did sorely try Jabber of the mindless horde -Assembling all their pleas in hex. Sequel next did mock the lord -Speech as crabbed as devil's crable Slothful sequel so enfangled -Hex that marked on Tower Babel Its speaker's lips became entangled -The highest rung. In his bung. - -Because in life they prayed so ill -And offered god such swinish swill -Now they sweat in flames of hell -Sweat from lack of APL -Sweat dung! -% -Those who talk don't know. Those who don't talk, know. -% -Thou hast seen nothing yet. - -- Miguel de Cervantes -% -Though a program be but three lines long, someday it will have to -be maintained. - -- The Tao of Programming -% -Though I respect that a lot -I'd be fired if that were my job -After killing Jason off and -Countless screaming argonauts - -Bluebird of friendliness -Like guardian angels it's -Always near - -Blue canary in the outlet by the light switch -Who watches over you -Make a little birdhouse in your soul -Not to put too fine a point on it -Say I'm the only bee in your bonnet -Make a little birdhouse in your soul - - -- "Birdhouse in your Soul", They Might Be Giants -% -Thrashing is just virtual crashing. -% -Three great scientific theories of the structure of the universe are -the molecular, the corpuscular and the atomic. A fourth affirms, with -Haeckel, the condensation or precipitation of matter from ether -- -whose existence is proved by the condensation or precipitation ... A -fifth theory is held by idiots, but it is doubtful if they know any -more about the matter than the others. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Three hours a day will produce as much as a man ought to write. - -- Trollope -% -Three may keep a secret, if two of them are dead. - -- Benjamin Franklin -% -Three Midwesterners, a Kansan, a Missourian and an Iowan, -all appearing on a quiz program, were asked to complete this sentence: -"Old MacDonald had a . . ." - - "Old MacDonald had a carburetor," answered the Kansan. - "Sorry, that's wrong," the game show host said. - "Old MacDonald had a free brake alignment down at the - service station," said the Missourian. - "Wrong." - "Old MacDonald had a farm," said the Iowan. - "CORRECT!" shouts the quizmaster. "Now for $100,000, spell `farm.'" - "Easy," said the Iowan. "E-I-E-I-O." -% -Three minutes' thought would suffice to find this out; but thought -is irksome and three minutes is a long time. - -- A. E. Housman -% -Three o'clock in the afternoon is always just a little too -late or a little too early for anything you want to do. - -- Jean-Paul Sartre -% -Three Rings for the Elven-kings under the sky, -Seven for the Dwarf-lords in their halls of stone, -Nine for Mortal Men doomed to die, -One for the Dark Lord on his dark throne -In the Land of Mordor where the Shadows lie. -One Ring to rule them all, One Ring to find them, -One Ring to bring them all and in the darkness bind them -In the Land of Mordor where the Shadows lie. - -- J. R. R. Tolkien, "The Lord of the Rings" -% -Three rules for sounding like an expert: - 1. Oversimplify your explanations to the point of uselessness. - 2. Always point out second-order effects, - but never point out when they can be ignored. - 3. Come up with three rules of your own. -% -Throw away documentation and manuals, -and users will be a hundred times happier. -Throw away privileges and quotas, -and users will do the Right Thing. -Throw away proprietary and site licenses, -and there won't be any pirating. - -If these three aren't enough, -just stay at your home directory -and let all processes take their course. -% -Thus mathematics may be defined as the subject in which we never know -what we are talking about, nor whether what we are saying is true. - -- Bertrand Russell -% -Thus spake the master programmer: - "A well-written program is its own heaven; a poorly-written program - is its own hell." - -- Geoffrey James, "The Tao of Programming" -% -Thus spake the master programmer: - "After three days without programming, life becomes meaningless." - -- Geoffrey James, "The Tao of Programming" -% -Thus spake the master programmer: - "Let the programmer be many and the managers few -- then all will - be productive." - -- Geoffrey James, "The Tao of Programming" -% -Thus spake the master programmer: - "Though a program be but three lines long, someday it will have to - be maintained." - -- Geoffrey James, "The Tao of Programming" -% -Thus spake the master programmer: - "Time for you to leave." - -- Geoffrey James, "The Tao of Programming" -% -Thus spake the master programmer: - "When program is being tested, it is too late to make design changes." - -- Geoffrey James, "The Tao of Programming" -% -Thus spake the master programmer: - "When you have learned to snatch the error code from - the trap frame, it will be time for you to leave." - -- Geoffrey James, "The Tao of Programming" -% -Thus spake the master programmer: - "Without the wind, the grass does not move. Without software, - hardware is useless." - -- Geoffrey James, "The Tao of Programming" -% -Thus spake the master programmer: - "You can demonstrate a program for a corporate executive, but you - can't make him computer literate." - -- Geoffrey James, "The Tao of Programming" -% -Thyme's Law: - Everything goes wrong at once. -% -Ticking away the moments that make up a dull day -Fritter and waste the hours in an offhand way -Kicking around on a piece of ground in your hometown -Waiting for someone or something to show you the way - -Tired of lying in the sunshine And then one day you find -Staying home to watch the rain Ten years have got behind you -You are young and life is long No one told you when to run -And there is time to kill today You missed the starting gun - -And you run and you run to catch up with the sun but it's sinking -And racing around to come up behind you again -The sun is the same in a relative way but you're older -Shorter of breath and one day closer to death - -Every year is getting shorter Hanging on in quiet desperation - is the English way -Never seem to find the time The time is gone, the song is over -Plans that either come to nought Thought I'd something more to say... -Or half a page of scribbled lines - -- Pink Floyd, "Time" -% -Tiddely Quiddely -Edward M. Kennedy -Quite unaccountably -Drove in a stream. - -Pleas of amnesia -Incomprehensible -Possibly shattered -Political dream. -% -Tiger got to hunt, -Bird got to fly; -Man got to sit and wonder, "Why, why, why?" - -Tiger got to sleep, -Bird got to land; -Man got to tell himself he understand. - -- The Books of Bokonon -% -Time and tide wait for no man. -% -Time as he grows old teaches all things. - -- Aeschylus -% -Time flies like an arrow, but fruit flies like a banana. -% -Time goes, you say? -Ah no! -Time stays, *we* go. - -- Austin Dobson -% -Time is a great teacher, but unfortunately it kills all its pupils. - -- Hector Berlioz -% -Time is an illusion, lunchtime doubly so. - -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -Time is an illusion perpetrated by the manufacturers of space. -% -Time is but the stream I go a-fishing in. - -- Henry David Thoreau -% -Time is nature's way of making sure that -everything doesn't happen at once. - -Space is nature's way of making sure that -everything doesn't happen to you. -% -Time is the most valuable thing a man can spend. - -- Theophrastus -% -Time sharing: The use of many people by the computer. -% -Time sure flies when you don't know what you're doing. -% -Time to be aggressive. Go after a tattooed Virgo. -% -Time to take stock. -Go home with some office supplies. -% -Time washes clean -Love's wounds unseen. -That's what someone told me; -But I don't know what it means. - -- Linda Ronstadt, "Long Long Time" -% -Time will end all my troubles, -but I don't always approve of Time's methods. -% -Time-sharing is the junk-mail part of the computer business. - -- H. R. J. Grosch (attributed) -% -Timesharing, n.: - An access method whereby one computer abuses many people. -% -Timing must be perfect now. -Two-timing must be better than perfect. -% -Tip of the Day: - Never fry bacon in the nude. -% -Tip O'Neill is just like Congress; old, fat and out of control. - -- J. LeBoutillier -% -Tip the world over on its side and -everything loose will land in Los Angeles. - -- Frank Lloyd Wright -% -TIPS FOR PERFORMERS: - Playing cards have the top half upside-down to help cheaters. - There are a finite number of jokes in the universe. - Singing is a trick to get people to listen to music longer than - they would ordinarily. - There is no music in space. - People will pay to watch people make sounds. - Everything on stage should be larger than in real life. -% -TIRED of calculating components of vectors? Displacements along direction of -force getting you down? Well, now there's help. Try amazing "Dot-Product", -the fast, easy way many professionals have used for years and is now available -to YOU through this special offer. Three out of five engineering consultants -recommend "Dot-Product" for their clients who use vector products. Mr. -Gumbinowitz, mechanical engineer, in a hidden-camera interview... - "Dot-Product really works! Calculating Z-axis force components has - never been easier." -Yes, you too can take advantage of the amazing properties of Dot-Product. Use -it to calculate forces, velocities, displacements, and virtually any vector -components. How much would you pay for it? But wait, it also calculates the -work done in Joules, Ergs, and, yes, even BTUs. Divide Dot-Product by the -magnitude of the vectors and it becomes an instant angle calculator! Now, how -much would you pay? All this can be yours for the low, low price of $19.95!! -But that's not all! If you order before midnight, you'll also get "Famous -Numbers of Famous People" as a bonus gift, absolutely free! Yes, you'll get -Avogadro's number, Planck's, Euler's, Boltzmann's, and many, many, more!! -Call 1-800-DOT-6000. Operators are standing by. That number again... -1-800-DOT-6000. Supplies are limited, so act now. This offer is not -available through stores and is void where prohibited by law. -% -Tis man's perdition to be safe, when for the truth he ought to die. -% -'Tis more blessed to give than receive; for example, wedding presents. - -- H. L. Mencken -% -To a Californian, a person must prove himself criminally insane before he -is allowed to drive a taxi in New York. For New York cabbies, honesty and -stopping at red lights are both optional. - -- From "East vs. West: The War Between the Coasts" -% -To a Californian, all New Yorkers are cold; even in heat they rarely go -above fifty-eight degrees. If you collapse on a street in New York, plan -to spend a few days there. - -- From "East vs. West: The War Between the Coasts" -% -To a Californian, the basic difference between the people and the pigeons -in New York is that the pigeons don't shit on each other. - -- From "East vs. West: The War Between the Coasts" -% -To a New Yorker, all Californians are blond, even the blacks. There are, -in fact, whole neighborhoods that are zoned only for blond people. The -only way to tell the difference between California and Sweden is that the -Swedes speak better English. - -- From "East vs. West: The War Between the Coasts" -% -To a New Yorker, the only California houses on the market for less than -a million dollars are those on fire. These generally go for six hundred -thousand. - -- From "East vs. West: The War Between the Coasts" -% -To accuse others for one's own misfortunes is a sign of want of education. -To accuse oneself shows that one's education has begun. To accuse neither -oneself nor others shows that one's education is complete. - -- Epictetus -% -To add insult to injury. - -- Phaedrus -% -To announce that there must be no criticism of the president, or that we are -to stand by the president right or wrong, is not only unpatriotic and -servile, but is morally treasonable to the American public." - -- Theodore Roosevelt -% -To any truly impartial person, it would -be obvious that I am always right. -% -To avoid criticism, do nothing, say nothing, be nothing. - -- Elbert Hubbard -% -To be a kind of moral Unix, he touched the hem of Nature's shift. - -- Shelley -% -To be beautiful is enough! if a woman can do that well who -should demand more from her? You don't want a rose to sing. - -- Thackeray -% -To be considered successful, a woman must be much better at her job -than a man would have to be. Fortunately, this isn't difficult. -% -To be excellent when engaged in administration is to be like the North -Star. As it remains in its one position, all the other stars surround it. - -- Confucius -% -To be great is to be misunderstood. - -- Ralph Waldo Emerson -% -To be happy one must be a) well fed, unhounded by sordid cares, at ease in -Zion, b) full of a comfortable feeling of superiority to the masses of one's -fellow men, and c) delicately and unceasingly amused according to one's taste. -It is my contention that, if this definition be accepted, there is no country -in the world wherein a man constituted as I am -- a man of my peculiar -weaknesses, vanities, appetites, and aversions -- can be so happy as he can -be in the United States. Going further, I lay down the doctrine that it is -a sheer physical impossibility for such a man to live in the United States -and not be happy. - -- H. L. Mencken, "On Being An American" -% -To be intoxicated is to feel sophisticated but not be able to say it. -% -To be is to be related. - -- C. J. Keyser -% -To be is to do. - -- I. Kant -To do is to be. - -- A. Sartre -Do be a Do Bee! - -- Miss Connie, Romper Room -Do be do be do! - -- F. Sinatra -Yabba-Dabba-Doo! - -- F. Flintstone -% -To be loved is very demoralizing. - -- Katharine Hepburn -% -To be nobody-but-yourself in a world which is doing its best to, -night and day, to make you everybody else -- means to fight the hardest -battle which any human being can fight; and never stop fighting. - -- e. e. cummings, "A Miscellany" -% -To be or not to be. - -- Shakespeare -To do is to be. - -- Nietzsche -To be is to do. - -- Sartre -Do be do be do. - -- Sinatra -% -To be or not to be, that is the bottom line. -% -To be patriotic, hate all nations but your own; to be religious, all sects -but your own; to be moral, all pretences but your own. - -- Lionel Strachey -% -To be responsive at this time, though I will simply say, and therefore -this is a repeat of what I said previously, that which I am unable to -offer in response is based on information available to make no such -statement. -% -To be successful, a woman has to be much better at her job than a man. - -- Golda Meir -% -To be successful, a woman must do her job ten times -as well as a man. Fortunately, this is not difficult. -% -To be sure of hitting the target, shoot first -and, whatever you hit, call it the target. -% -To be trusted is a greater compliment than to be loved. -% -To be who one is, is not to be someone else. -% -To be wise, the only thing you really need -to know is when to say "I don't know." -% -To believe your own thought, to believe that what is true for -you in your private heart is true for all men -- that is genius. - -- Ralph Waldo Emerson -% -To code the impossible code, This is my quest -- -To bring up a virgin machine, To debug that code, -To pop out of endless recursion, No matter how hopeless, -To grok what appears on the screen, No matter the load, - To write those routines -To right the unrightable bug, Without question or pause, -To endlessly twiddle and thrash, To be willing to hack FORTRAN IV -To mount the unmountable magtape, For a heavenly cause. -To stop the unstoppable crash! And I know if I'll only be true - To this glorious quest, -And the queue will be better for this, That my code will run CUSPy and calm, -That one man, scorned and When it's put to the test. - destined to lose, -Still strove with his last allocation -To scrap the unscrappable kludge! - -- To "The Impossible Dream", from Man of La Mancha -% -To communicate is the beginning of understanding. - -- AT&T -% -To converse at the distance of the Indes by means of sympathetic contrivances -may be as natural to future times as to us is a literary correspondence. - -- Joseph Glanvill, 1661 -% -To craunch a marmoset. - -- Pedro Carolino, "English as She is Spoke" -% -To create quality software, the ability to say no is usually far -more important than the ability to say yes. - -- Michi Henning -% -To criticize the incompetent is easy; -it is more difficult to criticize the competent. -% -To defend the Saigon regime is not worth one more human life. - -- Senator Edmund Muskie -% -To do nothing is to be nothing. -% -To do two things at once is to do neither. - -- Publilius Syrus -% -To doubt everything or to believe everything are two equally -convenient solutions; both dispense with the necessity of reflection. - -- H. Poincare -% -To envision how a 4-processor system running [SunOS] 4.1.x works, think -of four kids and one bathroom. - -- John DiMarco -% -To err is human -- but it feels divine. - -- Mae West -% -To err is human -- to blame it on a computer is even more so. -% -To err is human, but I can REALLY foul things up. -% -To err is human, but to really foul things up requires a computer. -% -To err is human, but when the eraser wears out -before the pencil, you're overdoing it a little. -% -To err is human; to admit it, a blunder. -% -To err is human, to forgive, beyond the scope of the Operating System. -% -To err is human, to forgive, infrequent. -% -To err is human; to forgive is simply not our policy. - -- MIT Assassination Club -% -To err is human, to repent, divine, to persist, devilish. - -- Benjamin Franklin -% -To err is human, two curs canine. -To err is human, to moo bovine. -% -To err is human. -To blame someone else for your mistakes is even more human. -% -To err is human, -To purr feline. - -- Robert Byrne -% -To err is humor. -% -To every Ph.D. there is an equal and opposite Ph.D. - -- B. Duggan -% -To everything there is a season, a time for every purpose under heaven: -A time to be born, and a time to die; -A time to plant, and a time to pluck what is planted; -A time to kill, and a time to heal; -A time to break down, and a time to build up; -A time to weep, and a time to laugh; -A time to mourn, and a time to dance; -A time to cast away stones, and a time to gather stones; -A time to embrace, and a time to refrain from embracing; -A time to gain, and a time to lose; -A time to keep, and a time to throw away; -A time to tear, and a time to sew; -A time to keep silence, and a time to speak; -A time to love, and a time to hate; -A time of war, and a time of peace. - Ecclesiastes 3:1-9 -% -To fear love is to fear life, and those -who fear life are already three parts dead. - -- Bertrand Russell -% -To find a friend one must close one eye; to keep him -- two. - -- Norman Douglas -% -To find out a girl's faults, praise her to her girl friends. - -- Benjamin Franklin -% -To generalize is to be an idiot. - -- William Blake -% -To get back on your feet, miss two car payments. -% -To get something clean, one has to get something dirty. -To get something dirty, one does not have to get anything clean. -% -To get something done, a committee should consist of no more than three -persons, two of them absent. -% -To give happiness is to deserve happiness. -% -To give of yourself, you must first know yourself. -% -To have died once is enough. - -- Publius Vergilius Maro (Virgil) -% -To hell with the Prime Directive; -Let's _K_I_L_L something! -% -To invent, you need a good imagination and a pile of junk. - -- Thomas Edison -% -To iterate is human, to recurse, divine. - -- Robert Heller -% -To jaw-jaw is better than to war-war. - -- Winston Churchill, on Korean War negotiations -% -To keep your friends treat them kindly; -to kill them, treat them often. -% -To know Edina is to reject it. - -- Dudley Riggs, "The Year the Grinch Stole the Election" -% -To laugh at men of sense is the privilege of fools. -% -To lead people, you must follow behind. - -- Lao Tsu -% -To listen to some devout people, -one would imagine that God never laughs. - -- Sri Aurobindo -% -To love is good, love being difficult. -% -To make an enemy, do someone a favor. -% -To make tax forms true they should -read "Income Owed Us" and "Incommode You". -% -To many, total abstinence is easier than perfect moderation. - -- St. Augustine -% -TO ME, CLOWNS AREN'T FUNNY. In fact, they're kinda scary. I've wondered -where this started, and I think it goes back to the time I went to the -circus and a clown killed my dad. - -- Jack Handey, "The New Mexican" (1988) -% -To one large turkey add one gallon of vermouth and a demijohn of Angostura -bitters. Shake. - -- F. Scott Fitzgerald, recipe for turkey cocktail -% -To our sweethearts and wives. May they never meet. - -- 19th century toast -% -To refuse praise is to seek praise twice. -% -To restore a sense of reality, I think -Walt Disney should have a Hardluckland. - -- Jack Paar -% -To save a single life is better than to build a seven story pagoda. -% -To say that UNIX is doomed is pretty rabid, OS/2 will certainly play a role, -but you don't build a hundred million instructions per second multiprocessor -micro and then try to run it on OS/2. I mean, get serious. - -- William Zachmann, International Data Corp -% -To say you got a vote of confidence -would be to say you needed a vote of confidence. - -- Andrew Young -% -To see a need and wait to be asked, is to already refuse. -% -To see the butcher slap the steak, before he laid it on the block, -and give his knife a sharpening, was to forget breakfast instantly. It was -agreeable, too -it really was- to see him cut it off, so smooth and juicy. -There was nothing savage in the act, although the knife was large and keen; -it was a piece of art, high art; there was delicacy of touch, clearness of -tone, skillful handling of the subject, fine shading. It was the triumph of -mind over matter; quite. - -- Charles Dickens, "Martin Chuzzlewit" -% -To see you is to sympathize. -% -To spot the expert, pick the one who predicts -the job will take the longest and cost the most. -% -To stand and be still, -At the Birkenhead drill, -Is a damned tough bullet to chew. - -- Rudyard Kipling -% -To stay young requires unceasing cultivation -of the ability to unlearn old falsehoods. - -- Lazarus Long, "Time Enough For Love" -% -To stay youthful, stay useful. -% -To teach is to learn. -% -To teach is to learn twice. - -- Joseph Joubert -% -To the best of my recollection, Senator, I can't recall. -% -To the landlord belongs the doorknobs. -% -To the systems programmer, users and applications serve only to provide -a test load. -% -To Theodore Roosevelt: - You are like the Wind and I like the Lion. You form the Tempest. -The sand stings my eyes and the Ground is parched. I roar in defiance but -you do not hear. But between us there is a difference. I, like the lion, -must remain in my place. While you, like the wind, will never know yours. - Mulay Hamid El Raisuli - Lord of the Riff - Sultan to the Berbers - Last of the Barbary Pirates -% -To thine own self be true. -(If not that, at least make some money.) -% -To think contrary to one's era is heroism. But to speak against it is -madness. - -- Eugene Ionesco -% -To those accustomed to the precise, structured methods of conventional -system development, exploratory development techniques may seem messy, -inelegant, and unsatisfying. But it's a question of congruence: -precision and flexibility may be just as disfunctional in novel, -uncertain situations as sloppiness and vacillation are in familiar, -well-defined ones. Those who admire the massive, rigid bone structures -of dinosaurs should remember that jellyfish still enjoy their very -secure ecological niche. - -- Beau Sheil, "Power Tools for Programmers" -% -TO THOSE OF YOU WHO DESIRE IT, I GRANT YOU MADRAK'S BLESSING: - - Insofar as I may be heard by anything, which may or may not care -what I say, I ask, if it matters, that you be forgiven for anything you -may have done or failed to do which requires forgiveness. - Conversely, if not forgiveness but something else be required -to insure any possible benefit for which you may be eligible after the -destruction of your body, I ask that this, whatever it may be, be granted -or withheld, as the case may be, in such a manner as to insure your -receiving said benefit. - I ask this in my capacity as your elected intermediary between -yourself and that which may have an interest in the matter of your receiving -as much as it is possible for you to receive of this thing, and which may -in some way be influenced by this ceremony. - Amen. - -- Roger Zelazny, "Creatures of Light and Darkness", 1969 -% -To understand a program you must become both the machine and the program. -% -To understand the heart and mind of a person, look not at what -he has already achieved, but at what he aspires to do. -% -To understand this important story, you have to understand how the -telephone company works. Your telephone is connected to a local -computer, which is in turn connected to a regional computer, which is -in turn connected to a loudspeaker the size of a garbage truck on the -lawn of Edna A. Bargewater of Lawrence, Kan. - -Whenever you talk on the phone, your local computer listens in. If it -suspects you're going to discuss an intimate topic, it notifies the -computer above it, which listens in and decides whether to alert the -one above it, until finally, if you really humiliate yourself, maybe -break down in tears and tell your closest friend about a sordid -incident from your past involving a seedy motel, a neighbor's spouse, -an entire religious order, a garden hose and six quarts of tapioca -pudding, the top computer feeds your conversation into Edna's -loudspeaker, and she and her friends come out on the porch to listen -and drink gin and laugh themselves silly. - -- Dave Barry, "Won't It Be Just Great Owning Our Own - Phones?" -% -To use violence is to already be defeated. - -- Chinese proverb -% -To vacillate or not to vacillate, that is the question ... or is it? -% -To whom the mornings are like nights, -What must the midnights be! - -- Emily Dickinson (on hacking?) -% -To write a sonnet you must ruthlessly -strip down your words to naked, willing flesh. -Then bind them to a metaphor or three, -and take by force a satisfying mesh. -Arrange them to your will, each foot in place. -You are the master here, and they the slaves. -Now whip them to maintain a constant pace -and rhythm as they stand in even staves. -A word that strikes no pleasure? Cast it out! -What use are words that drive not to the heart? -A lazy phrase? Discard it, shrug off doubt, -and choose more docile words to take its part. -A well-trained sonnet lives to entertain, -by making love directly to the brain. -% -To you I'm an atheist; to God, I'm the loyal opposition. - -- Woody Allen -% -Tobacco is a filthy weed, -That from the devil does proceed; -It drains your purse, it burns your clothes, -And makes a chimney of your nose. - -- B. Waterhouse -% -TODAY: - A nice place to visit, but you can't stay here for long. -% -Today is a good day for information-gathering. -Read someone else's mail file. -% -Today is a good day to bribe a high-ranking public official. -% -Today is National Existential Ennui Awareness Day. -% -Today is the first day of the rest of the mess. -% -Today is the first day of the rest of your life. -% -Today is the first day of the rest of your lossage. -% -Today is the last day of your life so far. -% -Today is the tomorrow you worried about yesterday. -% -Today is what happened to yesterday. -% -Today, of course, it is considered very poor taste to use the F-word -except in major motion pictures. - -- Dave Barry, "$#$%#^%!^%&@%@!" -% -Today when a man gets married he gets a home, a housekeeper, a cook, a -cheering squad and another paycheck. When a woman marries, she gets a -boarder. -% -Today you'll start getting heavy metal radio on your dentures. -% -Today's scientific question is: What in the world is electricity? - -And where does it go after it leaves the toaster? - -- Dave Barry, "What is Electricity?" -% -Today's thrilling story has been brought to you by Mushies, the great new -cereal that gets soggy even without milk or cream. Join us soon for more -spectacular adventure starring... Tippy, the Wonder Dog! - -- Bob & Ray -% -Today's weirdness is tomorrow's reason why. - -- Hunter S. Thompson -% -Toddlers are the stormtroopers of the Lord of Entropy. -% -Toilet Toupee, n.: - Any shag carpet that causes the lid to become top-heavy, thus - creating endless annoyance to male users. - -- Rich Hall, "Sniglets" -% -Tom Hayden is the kind of politician who gives opportunism a bad name. - -- Gore Vidal -% -Tomorrow, this will be part of the unchangeable past -but fortunately, it can still be changed today. -% -Tomorrow will be canceled due to lack of interest. -% -Tomorrow, you can be anywhere. -% -Tomorrow's computers some time next month. - -- DEC -% -Tom's hungry, time to eat lunch. -% -Tonight you will pay the wages of sin; -Don't forget to leave a tip. -% -Tonight's the night: Sleep in a eucalyptus tree. -% -Toni's Solution to a Guilt-Free Life: - If you have to lie to someone, it's their fault. -% -Too bad all the people who know how to run the country are busy -driving cabs and cutting hair. - -- George Burns -% -TOO BAD YOU CAN'T BUY a voodoo globe so that you could make the earth spin -real fast and freak everybody out. - -- Jack Handey, "The New Mexican" (1988) -% -Too clever is dumb. - -- Ogden Nash -% -Too cool to calypso, -Too tough to tango, -Too weird to watusi - -- The Only Ones -% -Too Late - A large number of turkies [sic] went to San Francisco yesterday by -the two o'clock boats. If their object in going down was to participate in -the Thanksgiving festivities of that city, they would arrive "the day after -the affair," and of course be sadly disappointed thereby. - -- Sacramento Daily Union, November 29, 1861 -% -Too many of his [Mozart's] works sound like interoffice memos. - -- Glenn Gould -% -Too many people are thinking of security instead of opportunity. -They seem more afraid of life than death. - -- James F. Byrnes -% -Too much is just enough. - -- Mark Twain, on whiskey -% -Too much is not enough. -% -Too much of a good thing is WONDERFUL. - -- Mae West -% -Too much of everything is just enough. - -- Bob Wier -% -Too often I find that the volume of paper expands to fill the available -briefcases. - -- Governor Jerry Brown -% -Too often people have come to me and said, "If I had just one wish for -anything in all the world, I would wish for more user-defined equations -in the HP-51820A Waveform Generator Software." - -- Instrument News - [Once is too often. Ed.] -% -Too ripped. Gotta go. -% -Toothpaste never hurts the taste of good scotch. -% -Top 10 things likely to be overheard if you had a Klingon Programmer: - -10) Specifications are for the weak and timid! - 9) You question the worthiness of my code? I should kill you where you stand! - 8) Indentation?! - I will show you how to indent when I indent your skull! - 7) What is this talk of 'release'? Klingons do not make software 'releases'. - Our software 'escapes' leaving a bloody trail of designers and quality - assurance people in its wake. - 6) Klingon function calls do not have 'parameters' - they have 'arguments' - - and they ALWAYS WIN THEM. - 5) Debugging? Klingons do not debug. Our software does not coddle the weak. - 4) A TRUE Klingon Warrior does not comment his code! - 3) Klingon software does NOT have BUGS. It has FEATURES, and those features - are too sophisticated for a Romulan pig like you to understand. - 2) You cannot truly appreciate Dilbert unless you've read it in the - original Klingon. - 1) Our users will know fear and cower before our software! Ship it! Ship - it and let them flee like the dogs they are! -% -Top scientists agree that with the present rate of consumption, the -earth's supply of gravity will be exhausted before the 24th century. -As man struggles to discover cheaper alternatives, we need your help. -Please... - - CONSERVE GRAVITY - -Follow these simple suggestions: - -(1) Walk with a light step. Carry helium balloons if possible. -(2) Use tape, magnets, or glue instead of paperweights. -(3) Give up skiing and skydiving for more horizontal sports like - curling. -(4) Avoid showers ... take baths instead. -(5) Don't hang all your clothes in the closet ... Keep them in one big - pile. -(6) Stop flipping pancakes -% -Top Ten Things Overheard At The ANSI C Draft Committee Meetings: - -10: Sorry, but that's too useful. - 9: Dammit, little-endian systems *are* more consistent! - 8: I'm on the committee and I *still* don't know what the hell - #pragma is for. - 7: Well, it's an excellent idea, but it would make the compilers too - hard to write. - 6: Them bats is smart; they use radar. - 5: All right, who's the wiseguy who stuck this trigraph stuff in here? - 4: How many times do we have to tell you, "No prior art!" - 3: Ha, ha, I can't believe they're actually going to adopt this sucker. - 2: Thank you for your generous donation, Mr. Wirth. - 1: Gee, I wish we hadn't backed down on "noalias". -% -Topologists are just plane folks. - Pilots are just plane folks. - Carpenters are just plane folks. - Midwest farmers are just plain folks. - Musicians are just playin' folks. - Whodunit readers are just Spillaine folks. -Some Londoners are just P. Lane folks. -% -Torque is cheap. -% -Total strangers need love, too; and I'm stranger than most. -% -TOTD (T-shirt Of The Day): - I'm the person your mother warned you about. -% -Toto, I have a feeling we're not in Kansas anymore. - -- Judy Garland as Dorothy Gale, "The Wizard of Oz" -% -Tourists -- have some fun with New York's hard-boiled cabbies. When you -get to your destination, say to your driver, "Pay? I was hitch-hiking." - -- David Letterman -% -Tout choses sont dites deja, mais comme -personne n'ecoute, il faut toujours recommencer. - -- A. Gide -% -Traffic signals in New York are just rough guidelines. - -- David Letterman -% -TRANSACTION CANCELED - FARECARD RETURNED -% -TRANSFER: - A promotion you receive on the condition that you leave town. -% -TRANSPARENT: - Being or pertaining to an existing, nontangible object. - "It's there, but you can't see it" - -- IBM System/360 announcement, 1964 - -VIRTUAL: - Being or pertaining to a tangible, nonexistent object. - "I can see it, but it's not there." - -- Lady Macbeth -% -TRANSVESTITE: - Someone who spends his junior year at college abroad. -% -Trap full -- please empty. -% -TRAVEL: - Something that makes you feel like you're getting somewhere. -% -Travel important today; Internal Revenue men arrive tomorrow. -% -Traveling through hyperspace isn't like dusting crops, boy. - -- Han Solo -% -Traveling through New England, a motorist stopped for gas in a tiny village. -"What's this place called?" he asked the station attendant. - "All depends," the native drawled. "Do you mean by them that has -to live in this dad-blamed, moth-eaten, dust-covered, one-hoss dump, or -by them that's merely enjoying its quaint and picturesque rustic charms -for a short spell?" -% -Treat your friend as if he might become an enemy. - -- Publilius Syrus -% -Treaties are like roses and young girls -- they last while they last. - -- Charles DeGaulle -% -Trifles make perfection, and perfection is no trifle. - -- Michelangelo -% -Troglodytism does not necessarily imply a low cultural level. -% -Trouble always comes at the wrong time. -% -Trouble strikes in series of threes, but when working around the house the -next job after a series of three is not the fourth job -- it's the start of -a brand new series of three. -% -Troubled day for virgins over 16 who are beautiful, wealthy, and live -in eucalyptus trees. -% -Troubles are like babies; they only grow by nursing. -% -True happiness will be found only in true love. -% -True leadership is the art of changing -a group from what it is to what it ought to be. - -- Virginia Allan -% -True to our past we work with an inherited, observed, and accepted vision of -personal futility, and of the beauty of the world. - -- David Mamet -% -Truly great madness can not be achieved without significant intelligence. - -- Henrik Tikkanen -% -Truly simple systems... require infinite testing. - -- Norman Augustine -% -Trust everybody, but cut the cards. - -- Finley Peter Dunne, "Mr. Dooley's Philosophy" -% -Trust in Allah, but tie your camel. - -- Arabian proverb -% -TRUST ME: - Get me, give me, buy me, do me. -% -TRUST ME: - Translation of the Latin "caveat emptor." -% -Trust your husband, adore your husband, -and get as much as you can in your own name. - -- Joan Rivers -% -Truth can wait; he's used to it. -% -Truth has no special time of its own. Its hour is now -- always. - -- Albert Schweitzer -% -Truth is free, but information costs. -% -Truth is hard to find and harder to obscure. -% -Truth is stranger than fiction, because fiction has to make sense. -% -Truth is the most valuable thing we have -- so let us economize it. - -- Mark Twain -% -Truth never comes into the world but like a bastard, to the ignominy -of him that brought her birth. - -- Milton -% -Truth will be out this morning. (Which may really mess things up.) -% -Truthful, adj.: - Dumb and illiterate. - -- Ambrose Bierce, "The Devil's Dictionary" -% -try again -% -Try not to have a good time ... -This is supposed to be educational. - -- Charles Schulz -% -Try not. -Do. -Or do not. -There is no try. -% -Try `stty 0' -- it works much better. -% -Try the Moo Shu Pork. It is especially good today. -% -Try to be the best of whatever you are, even if what you are is no good. -% -Try to divide your time evenly to keep others happy. -% -Try to find the real tense of the report you are reading: Was it done, is -it being done, or is something to be done? Reports are now written in four -tenses: past tense, present tense, future tense, and pretense. Watch for -novel uses of CONGRAM (CONtractor GRAMmer), defined by the imperfect past, -the insufficient present, and the absolutely perfect future. - -- Amrom Katz -% -Try to get all of your posthumous medals in advance. -% -Try to have as good a life as you can under the circumstances. -% -Try to relax and enjoy the crisis. - -- Ashleigh Brilliant -% -Try to value useful qualities in one who loves you. -% -Trying to be happy is like trying to build a machine for which the only -specification is that it should run noiselessly. -% -Trying to define yourself is like trying to bite your own teeth. - -- Alan Watts -% -Trying to establish voice contact ... please _y_e_l_l into keyboard. -% -Trying to get an education here is like -trying to take a drink from a fire hose. -% -T-shirt: - Life is *not* a Cabaret, and stop calling me chum! -% -Tuesday After Lunch is the cosmic time of the week. -% -Tuesday is the Wednesday of the rest of your life. -% -Turn on, tune in, and take over. - -- Tim Leary -% -Turn the other cheek. - -- Jesus Christ -% -Turnaucka's Law: - The attention span of a computer is only as long as its - electrical cord. -% -Tussman's Law: - Nothing is as inevitable as a mistake whose time has come. -% -TV is chewing gum for the eyes. - -- Frank Lloyd Wright -% -'Twas a woman who drove me to drink, -and I never even had the decency to thank her. - -- R. B. Gossling -% -"Twas bergen and the eirie road -Did mahwah into patterson: "Beware the Hopatcong, my son! -All jersey were the ocean groves, The teeth that bite, the nails -And the red bank bayonne. that claw! - Beware the bound brook bird, and shun -He took his belmar blade in hand: The kearney communipaw." -Long time the folsom foe he sought -Till rested he by a bayway tree And, as in nutley thought he stood, -And stood a while in thought. The Hopatcong with eyes of flame, - Came whippany through the englewood, -One, two, one, two, and through And garfield as it came. - and through -The belmar blade went hackensack! "And hast thou slain the Hopatcong? -He left it dead and with it's head Come to my arms, my perth amboy! -He went weehawken back. Hohokus day! Soho! Rahway!" - He caldwell in his joy. -Did mahwah into patterson: -All jersey were the ocean groves, -And the red bank bayonne. - -- Paul Kieffer -% -'Twas brillig, and the slithy toves -Did gyre and gimble in the wabe. "Beware the Jabberwock, my son! -All mimsy were the borogroves The jaws that bite, the claws -And the mome raths outgrabe. that catch! - Beware the Jubjub bird, -He took his vorpal sword in hand And shun the frumious Bandersnatch!" -Long time the manxome foe he sought. -So rested he by the tumtum tree And as in uffish thought he stood -And stood awhile in thought. The Jabberwock, with eyes aflame - Came whuffling through the tulgey wood -One! Two! One! Two! And through and And burbled as it came! - through -The vorpal blade went snicker-snack. "Hast thou slain the Jabberwock? -He left it dead, and took its head, Come to my arms, my beamish boy! -And went galumphing back. Oh frabjous day! Calooh! Callay!" - He chortled in his joy. -'Twas brillig, and the slithy toves -Did gyre and gimble in the wabe. -All mimsy were the borogroves -And the mome raths outgrabe. - -- Lewis Carroll, "Jabberwocky" -% -'Twas bullig, and the slithy brokers -Did buy and gamble in the craze "Beware the Jabberstock, my son! -All rosy were the Dow Jones stokers The cost that bites, the worth -By market's wrath unphased. that falls! - Beware the Econ'mist's word, and shun -He took his forecast sword in hand: The spurious Street o' Walls!" -Long time the Boesk'some foe he sought - -Sake's liquidity, so d'vested he, And as in bearish thought he stood -And stood awhile in thought. The Jabberstock, with clothes of tweed, - Came waffling with the truth too good, -Chip Black! Chip Blue! And through And yuppied great with greed! - and through -The forecast blade went snicker-snack! "And hast thou slain the Jabberstock? -It bit the dirt, and with its shirt, Come to my firm, V.P.ish boy! -He went rebounding back. O big bucks day! Moolah! Good Play!" - He bought him a Mercedes Toy. -'Twas panic, and the slithy brokers -Did gyre and tumble in the Crash -All flimsy were the Dow Jones stokers -And mammon's wrath them bash! - -- Peter Stucki, "Jabberstocky" -% -'Twas midnight, and the UNIX hacks -Did gyre and gimble in their cave -All mimsy was the CS-VAX -And Cory raths outgrabe. - -"Beware the software rot, my son! -The faults that bite, the jobs that thrash! -Beware the broken pipe, and shun -The frumious system crash!" -% -'Twas midnight on the ocean, Her children all were orphans, -Not a streetcar was in sight, Except one a tiny tot, -So I stepped into a cigar store Who had a home across the way -To ask them for a light. Above a vacant lot. - -The man behind the counter As I gazed through the oaken door -Was a woman, old and gray, A whale went drifting by, -Who used to peddle doughnuts Its six legs hanging in the air, -On the road to Mandalay. So I kissed her goodbye. - -She said "Good morning, stranger", This story has a morale -Her eyes were dry with tears, As you can plainly see, -As she put her head between her feet Don't mix your gin with whiskey -And stood that way for years. On the deep and dark blue sea. - -- Midnight On The Ocean -% -'Twas the night before Christmas -- the very last one -- -When the blazing of lasers destroyed all our fun. -Just as Santa had lifted off, driving his sleigh, -A satellite spotted him making his way. -The Star Wars Defense System -- Reagan's desire -Was ready for action, and started to fire! -The laser beams criss-crossed and lit up the sky -Like a fireworks show on the Fourth of July. -I'd just finished wrapping the last of the toys -When out of my chimney there came a great noise. -I looked to the fireplace, hoping to see -St. Nick bringing presents for missus and me. -But what I saw next was disturbing and shocking: -A flaming red jacket setting fire to my stocking! -Charred reindeer remains and a melted sleigh-bell; -Outside burning toys like confetti they fell. -So now you know, children, why Christmas is gone: -The Star Wars computer had got something wrong. -Only programmed for battle, it hadn't a heart; -'Twas hardly a chance it would work from the start. -It couldn't be tested, and no one could tell, -If the crazy contraption would work very well. -So after a trillion or two had been spent -The system thought Santa a Red missile sent. -So kids dry your tears now, and get off to bed, -There won't be a Christmas -- since Santa is dead. -% -'Twas the nocturnal segment of the diurnal period - preceding the annual Yuletide celebration, And - throughout our place of residence, -Kinetic activity was not in evidence among the - possessors of this potential, including that - species of domestic rodent known as Mus musculus. -Hosiery was meticulously suspended from the forward - edge of the woodburning caloric apparatus, -Pursuant to our anticipatory pleasure regarding an - imminent visitation from an eccentric - philanthropist among whose folkloric appelations - is the honorific title of St. Nicklaus ... -% -Twenty Percent of Zero is Better than Nothing. - -- Walt Kelly -% -Twenty two thousand days. -Twenty two thousand days. -It's not a lot. -It's all you've got. -Twenty two thousand days. - -- Moody Blues, "Twenty Two Thousand Days" -% -Two battleships assigned to the training squadron had been at sea on maneuvers -in heavy weather for several days. I was serving on the lead battleship and -was on watch on the bridge as night fell. The visibility was poor with patchy -fog, so the Captain remained on the bridge keeping an eye on all activities. - Shortly after dark, the lookout on the wing of the bridge reported, -"Light, bearing on the starboard bow." - "Is it steady or moving astern?" the Captain called out. - Lookout replied, "Steady, Captain," which meant we were on a dangerous -collision course with that ship. - The Captain then called to the signalman, "Signal that ship: We are on -a collision course, advise you change course 20 degrees." - Back came a signal "Advisable for you to change course 20 degrees." - In reply, the Captain said, "Send: I'm a Captain, change course 20 -degrees!" - "I'm a seaman second class," came the reply, "You had better change -course 20 degrees." - By that time, the Captain was furious. He spit out, "Send: I'm a -battleship, change course 20 degrees." - Back came the flashing light: "I'm a lighthouse!" - We changed course. - -- The Naval Institute's "Proceedings" -% -Two can Live as Cheaply as One for Half as Long. - -- Howard Kandel -% -Two cars in every pot and a chicken in every garage. -% -Two Finns and a penguin are sitting on the front porch of a large house. The -penguin is dripping in sweat; his owner looks down and says to the other Finn, -"Hey Urho, I want that you should take the penguin to the zoo, okay?" The -owner then runs off to the sauna. When he gets out of the sauna, he looks -up at the porch, and sure enough, there is Urho and the penguin, sweating -away. So he yells out "Hey, Urho, I thought I told you to take the penguin to -the zoo, I did." And Urho yells back "Yup, and tomorrow we're going to -the movies!" -% -Two friends were out drinking when suddenly one lurched backward off his -barstool and lay motionless on the floor. - "One thing about Jim," the other said to the bartender, "he sure -knows when to stop." -% -Two heads are better than one. - -- John Heywood -% -Two heads are more numerous than one. -% -Two hundred years ago today, Irma Chine of White Plains, New York, was -performing her normal housekeeping routines. She was interrupted by -British soldiers who, rallying to the call of their supervisor, General -Hughes, sought to gain control of the voter registration lists kept in -her home. Masking her fear and thinking fast, Mrs. Chine quickly divided -a nearby apple in two and deftly stored the list in its center. Upon -entering, the British blatantly violated every conceivable convention, -and, though they went through the house virtually bit by bit, their -search was fruitless. They had to return empty handed. Word of the -incident propagated rapidly through the region. This historic event -became the first documented use of core storage for the saving of registers. -% -Two is company, three is an orgy. -% -Two is not equal to three, even for large values of two. -% -Two men are in a hot-air balloon. Soon, they find themselves lost in a -canyon somewhere. One of the three men says, "I've got an idea. We can -call for help in this canyon and the echo will carry our voices to the -end of the canyon. Someone's bound to hear us by then!" - So he leans over the basket and screams out, "Helllloooooo! Where -are we?" (They hear the echo several times). - Fifteen minutes later, they hear this echoing voice: "Helllloooooo! -You're lost!" - The shouter comments, "That must have been a mathematician." - Puzzled, his friend asks, "Why do you say that?" - "For three reasons. First, he took a long time to answer, second, -he was absolutely correct, and, third, his answer was absolutely useless." -% -Two men came before Nasrudin when he was magistrate. The first man said, -"This man has bitten my ear -- I demand compensation." The second man said, -"He bit it himself." Nasrudin withdrew to his chambers, and spent an hour -trying to bite his own ear. He succeeded only in falling over and bruising -his forehead. Returning to the courtroom, Nasrudin pronounced, "Examine -the man whose ear was bitten. If his forehead is bruised, he did it himself -and the case is dismissed. If his forehead is not bruised, the other man -did it and must pay three silver pieces." -% -Two men look out through the same bars; one sees mud, and one the stars. -% -Two men were sitting over coffee, contemplating the nature of things, -with all due respect for their breakfast. "I wonder why it is that -toast always falls on the buttered side," said one. - "Tell me," replied his friend, "why you say such a thing. Look -at this." And he dropped his toast on the floor, where it landed on the -dry side. - "So, what have you to say for your theory now?" - "What am I to say? You obviously buttered the wrong side." -% -Two peanuts were walking through the New York. One was assaulted. -% -Two percent of zero is almost nothing. -% -Two rights don't make a wrong, they make an airplane. -% -Two Russian friends happen to meet in Red Square. One of them says, "By -the way, did you hear that Romanov died?" - "No," replied the other, "I didn't even know he'd been arrested!" -% -Two sure ways to tell a REALLY sexy man; the first is, he has a bad memory. -I forget the second. -% -Two Swedish guys get of a ship and head for the nearest bars. Each one -orders two vodkas and immediately downs them. They they order two more -and once again quickly throw them back. They then order two more. When -they arrive, one of them picks up his glass, and, turning to the other, -toasts him, "Skoal!" - The other turns to the first man and scolds, "Hey! Did you come -here to screw around, or did you come here to drink?" -% -Two wrongs are only the beginning. - -- Kohn -% -Two wrongs don't make a right, but they make a good excuse. - -- Thomas Szasz -% -Two wrongs don't make a right, but three lefts do. -% -Tyger, Tyger, burning bright Where the hammer? Where the chain? -In the forests of the night, In what furnace was thy brain? -What immortal hand or eye What the anvil? What dread grasp -Dare frame thy fearful symmetry? Dare its deadly terrors clasp? - -Burnt in distant deeps or skies When the stars threw down their spears -The cruel fire of thine eyes? And water'd heaven with their tears -On what wings dare he aspire? Dare he laugh his work to see? -What the hand dare seize the fire? Dare he who made the lamb make thee? - -And what shoulder & what art Tyger, Tyger, burning bright -Could twist the sinews of they heart? In the forests of the night, -And when thy heart began to beat What immortal hand or eye -What dread hand & what dread feet Dare frame thy fearful symmetry? - -Could fetch it from the furnace deep -And in thy horrid ribs dare steep -In the well of sanguine woe? -In what clay & in what mould -Were thy eyes of fury roll'd? - -- William Blake, "The Tyger" -% -Type louder, please. -% -U: There's a U -- a Unicorn! - Run right up and rub its horn. - Look at all those points you're losing! - UMBER HULKS are so confusing. - -- The Roguelet's ABC -% -Ubi non accusator, ibi non judex. -(Where there is no police, there is no speed limit.) - -- Roman Law, trans. Petr Beckmann (1971) -% -Udall's Fourth Law: - Any change or reform you make - is going to have consequences you don't like. -% -UFO's are for real: the Air Force doesn't exist. -% -Uh-oh -- I've let the cat out of the bag. Let me, then, -straightforwardly state the thesis I shall now elaborate: -Making variations on a theme is really the crux of creativity. - -- Douglas R. Hofstadter, "Metamagical Themas" -% -Ummm, well, OK. The network's the network, the computer's the computer. -Sorry for the confusion. - -- Sun Microsystems -% -Unbearably lovely music is heard as the curtain rises, and we see the -woods on a summer afternoon. A fawn dances on and nibbles at some -leaves. He drifts lazily through the soft foliage. Soon he starts -coughing and drops dead. - -- Woody Allen, "Without Feathers" -% -Uncle Ed's Rule of Thumb: - Never use your thumb for a rule. - You'll either hit it with a hammer or get a splinter in it. -% -Under a government which imprisons any unjustly, the true place for a -just man is also in prison. - -- Henry David Thoreau -% -Under any conditions, anywhere, whatever you are doing, there is some -ordinance under which you can be booked. - -- Robert D. Sprecht, Rand Corp. -% -Under deadline pressure for the next week. -If you want something, it can wait. -Unless it's blind screaming paroxysmally hedonistic... -% -Under every stone lurks a politician. - -- Aristophanes -% -Under the wide and heavy VAX -Dig my grave and let me relax -Long have I lived, and many my hacks -And I lay me down with a will. -These be the words that tell the way: -"Here he lies who piped 64K, -Brought down the machine for nearly a day, -And Rogue playing to an awful standstill." -% -Under the wide and starry sky, -Dig my grave and let me lie, -Glad did I live and gladly die, -And laid me down with a will, -And this be the verse that you grave for me, -Here he lies where he longed to be, -Home is the sailor home from the sea, -And the hunter home from the hill. - -- R. Kipling -% -Underlying Principle of Socio-Genetics: - Superiority is recessive. -% -Understand, v.: - To reach a point, in your investigation of some subject, at which - you cease to examine what is really present, and operate on the - basis of your own internal model instead. -% -Understanding is always the understanding of a smaller problem -in relation to a bigger problem. - -- P. D. Ouspensky -% -UNFAIR COMPETITION: - Selling cheaper than we do. -% -Unfortunately, most programmers like to play with new toys. I have many -friends who, immediately upon buying a snakebite kit, would be tempted to -throw the first person they see to the ground, tie the tourniquet on him, -slash him with the knife, and apply suction to the wound. - -- Jon Bentley -% -UNION: - A dues-paying club workers wield to strike management. -% -United Nations, New York, December 25. The peace and joy of the Christmas -season was marred by a proclamation of a general strike of all the military -forces of the world. Panic reigns in the hearts of all the patriots of -every persuasion. Meanwhile, fears of universal disaster sank to an all-time -low over the world. - -- Isaac Asimov -% -Universe, n.: - The problem. -% -Universities are places of knowledge. The freshman each bring a little -in with them, and the seniors take none away, so knowledge accumulates. -% -University, n.: - Like a software house, except the software's free, and it's - usable, and it works, and if it breaks they'll quickly tell - you how to fix it, and... - - [Okay, okay, I'll leave it in, but I think you're destroying - the credibility of the entire fortune program. Ed.] -% -University politics are vicious precisely because the stakes are so small. - -- Henry Kissinger -% -UNIX enhancements aren't. -% -Unix gives you just enough rope to hang yourself -- and then a couple -of more feet, just to be sure. - -- Eric Allman - -... We make rope. - -- Rob Gingell on Sun Microsystems' new virtual memory -% -Unix is a lot more complicated (than CP/M) of course -- the typical Unix -hacker can never remember what the PRINT command is called this week -- -but when it gets right down to it, Unix is a glorified video game. -People don't do serious work on Unix systems; they send jokes around the -world on USENET or write adventure games and research papers. - -- E. Post - "Real Programmers Don't Use Pascal", Datamation, 7/83 -% -Unix is a Registered Bell of AT&T Trademark Laboratories. - -- Donn Seeley -% -UNIX is hot. It's more than hot. It's steaming. It's quicksilver -lightning with a laserbeam kicker. - -- Michael Jay Tucker -% -UNIX is many things to many people, -but it's never been everything to anybody. -% -Unix is the worst operating system; except for all others. - -- Berry Kercheval -% -Unix, n.: - A computer operating system, once thought to be flabby and - impotent, that now shows a surprising interest in making off - with the workstation harem. -% -unix soit qui mal y pense -% -UNIX was half a billion (500000000) seconds old on -Tue Nov 5 00:53:20 1985 GMT (measuring since the time(2) epoch). - -- Andrew S. Tanenbaum -% -UNIX was not designed to stop you from doing stupid things, because that -would also stop you from doing clever things. - -- Doug Gwyn -% -Unix will self-destruct in five seconds... 4... 3... 2... 1... -% -Unknown person(s) stole the American flag from its pole in Etra Park sometime -between 3pm Jan 17 and 11:30 am Jan 20. The flag is described as red, white -and blue, having 50 stars and was valued at $40. - -- Windsor-Heights Herald "Police Blotter", Jan 28, 1987 -% -Unless hours were cups of sack, and minutes capons, and clocks the tongues -of bawds, and dials the signs of leaping houses, and the blessed sun himself -a fair, hot wench in flame-colored taffeta, I see no reason why thou shouldst -be so superfluous to demand the time of the day. I wasted time and now doth -time waste me. - -- William Shakespeare -% -Unless you love someone, nothing else makes any sense. - -- e. e. cummings -% -Unnamed Law: - If it happens, it must be possible. -% -Unprovided with original learning, unformed in the habits of thinking, -unskilled in the arts of composition, I resolved to write a book. - -- Edward Gibbon -% -Unquestionably, there is progress. The average American now -pays out twice as much in taxes as he formerly got in wages. - -- H. L. Mencken -% -Until Eve arrived, this was a man's world. - -- Richard Armour -% -UNTOLD WEALTH: - What you left out on April 15th. -% -Up against the net, redneck mother, -Mother who has raised your son so well; -He's seventeen and hackin' on a Macintosh, -Flaming spelling errors and raisin' hell... -% -Usage: fortune -P [] -a [xsz] [Q: [file]] [rKe9] -v6[+] dataspec ... inputdir -% -Use a pun, go to jail. -% -Use an accordion. Go to jail. - -- KFOG, San Francisco -% -Use what talents you possess: the woods would be very silent -if no birds sang there except those that sang best. - -- Henry Van Dyke -% -USENET would be a better laboratory is there were -more labor and less oratory. - -- Elizabeth Haley -% -User hostile. -% -User, n.: - A programmer who will believe anything you tell him. -% -User, n.: - The word computer professionals use when they mean "idiot." - -- Dave Barry, "Claw Your Way to the Top" - -[I always thought "computer professional" was the phrase hackers used - when they meant "idiot." Ed.] -% -Using encryption on the Internet is the equivalent of arranging -an armoured car to deliver credit card information from someone -living in a cardboard box to someone living on a park bench. - -- Gene Spafford, Purdue University -% -Using TSO is like kicking a dead whale down the beach. - -- S. C. Johnson -% -Using [Windows] for any sort of serious work is like playing an old -text-based adventure game. You're five feet from making it to your -goal, when bup-POW! a ten ton rock falls on your head. Because you -didn't disarm the trap three hours before. [...] - -I always hated those adventure games. - -- David Gerard -% -Using words to describe magic is like using a screwdriver to cut roast beef. - -- Tom Robbins -% -/usr/news/gotcha -% -Usually, when a lot of men get together, it's called a war. - -- Mel Brooks, "The Listener" -% -Utility is when you have one telephone, luxury is when you have two, -opulence is when you have three -- and paradise is when you have none. - -- Doug Larson -% -VACATION: - A two-week binge of rest and relaxation so intense that - it takes another 50 weeks of your restrained workaday - life-style to recuperate. -% -Vail's Second Axiom: - The amount of work to be done increases in proportion to the - amount of work already completed. -% -Valerie: Aww, Tom, you're going maudlin on me ... -Tom: I reserve the right to wax maudlin as I wane eloquent ... - -- Tom Chapin -% -Van Roy's Law: - An unbreakable toy is useful for breaking other toys. -% -Van Roy's Law: - Honesty is the best policy - there's less competition. - -Van Roy's Truism: - Life is a whole series of circumstances beyond your control. -% -Vanilla, adj.: - Ordinary flavor, standard. See FLAVOR. When used of food, -very often does not mean that the food is flavored with vanilla -extract! For example, "vanilla-flavored won ton soup" (or simply -"vanilla won ton soup") means ordinary won ton soup, as opposed to hot -and sour won ton soup. -% -Variables don't; constants aren't. -% -Vax Vobiscum -% -Vegetables are what food eats. -Fruit are vegetables that fool you by tasting good. -Fish are fast moving vegetables. -Mushrooms are what grows on vegetables when food's done with them. - -- Meat Eater's Credo, according to Jim Williams -% -Vegetarians beware! You are what you eat. -% -Velilind's Laws of Experimentation: - 1. If reproducibility may be a problem, conduct the test only once. - 2. If a straight line fit is required, obtain only two data points. -% -Veni, Vidi, VISA: - I came, I saw, I did a little shopping. -% -Verba volant, scripta manent! -% -Vermouth always makes me brilliant unless it makes me idiotic. - -- E. F. Benson -% -Very few people do anything creative after the age of thirty-five. The -reason is that very few people do anything creative before the age of -thirty-five. - -- Joel Hildebrand -% -Very few profundities can be expressed in less than 80 characters. -% -Very few things actually get manufactured these days, because in an -infinitely large Universe, such as the one in which we live, most things one -could possibly imagine, and a lot of things one would rather not, grow -somewhere. A forest was discovered recently in which most of the trees grew -ratchet screwdrivers as fruit. The life cycle of the ratchet screwdriver is -quite interesting. Once picked it needs a dark dusty drawer in which it can -lie undisturbed for years. Then one night it suddenly hatches, discards its -outer skin that crumbles into dust, and emerges as a totally unidentifiable -little metal object with flanges at both ends and a sort of ridge and a hole -for a screw. This, when found, will get thrown away. No one knows what the -screwdriver is supposed to gain from this. Nature, in her infinite wisdom, -is presumably working on it. -% -Very few things happen at the right time, and the rest do not happen -at all. The conscientious historian will correct these defects. - -- Herodotus -% -Vests are to suits as seat-belts are to cars. -% -VI: - A hungry dog hunts best. - A hungrier dog hunts even better. -VII: - Decreased business base increases overhead. - So does increased business base. -VIII: - The most unsuccessful four years in the education of a cost-estimator - is fifth grade arithmetic. -IX: - Acronyms and abbreviations should be used to the maximum extent - possible to make trivial ideas profound. Q.E.D. -X: - Bulls do not win bull fights; people do. - People do not win people fights; lawyers do. - -- Norman Augustine -% -Victory uber allies! -% -Viking, n.: - 1. Daring Scandinavian seafarers, explorers, adventurers, - entrepreneurs world-famous for their aggressive, nautical import - business, highly leveraged takeovers and blue eyes. - 2. Bloodthirsty sea pirates who ravaged northern Europe beginning - in the 9th century. - -Hagar's note: The first definition is much preferred; the second is used -only by malcontents, the envious, and disgruntled owners of waterfront -property. -% -Vila: "I think I have just made the biggest mistake of my life." -Orac: "It is unlikely. I would predict there are far greater mistakes - waiting to be made by someone with your obvious talent for it." -% -Vini, vidi, vici. -[I came, I saw, I conquered]. - -- Gaius Julius Caesar -% -"Violence accomplishes nothing." What a contemptible lie! Raw, naked -violence has settled more issues throughout history than any other method -ever employed. Perhaps the city fathers of Carthage could debate the -issue, with Hitler and Alexander as judges? -% -Violence is a sword that has no handle -- you have to hold the blade. -% -Violence is molding. -% -Violence is the last refuge of the incompetent. - -- Salvor Hardin -% -Violence stinks, no matter which end of it you're on. But now and then -there's nothing left to do but hit the other person over the head with a -frying pan. Sometimes people are just begging for that frypan, and if we -weaken for a moment and honor their request, we should regard it as -impulsive philanthropy, which we aren't in any position to afford, but -shouldn't regret it too loudly lest we spoil the purity of the deed. - -- Tom Robbins -% -VIRGINIA: - A group of beautifully mounted hunters galloping behind - baying hounds in pursuit of a union organizer. -% -Virginia law forbids bathtubs in the house; tubs must be kept in the -yard. -% -VIRGO (Aug 23 - Sept 22) - You are the logical type and hate disorder. This nitpicking is -sickening to your friends. You are cold and unemotional and sometimes -fall asleep while making love. Virgos make good bus drivers. -% -VIRGO (Aug.23 - Sept.22) - Learn something new today, like how to spell or how to count - to ten without using your fingers. Be careful dressing this - morning. You may be hit by a car later in the day and you - wouldn't want to be taken to the doctor's office in some of - that old underwear you own. -% -"Virtual" means never knowing where your next byte is coming from. -% -Virtue does not always demand a heavy sacrifice -- -only the willingness to make it when necessary. - -- Frederick Dunn -% -Virtue is its own punishment. - -- Denniston - -Righteous people terrify me ... virtue is its own punishment. - -- Aneurin Bevan -% -Virtue is not left to stand alone. -He who practices it will have neighbors. - -- Confucius -% -Virtue would go far if vanity did not keep it company. - -- Francois de La Rochefoucauld -% -Visit beautiful Vergas Minnesota. -% -Visit beautiful Wisconsin Dells. -% -Visits always give pleasure: if not on arrival, then on the departure. - -- Edouard Le Berquier, "Pensees des Autres" -% -Vital papers will demonstrate their vitality by spontaneously moving -from where you left them to where you can't find them. -% -Vitamin C deficiency is apauling. -% -VMS is like a nightmare about RSX-11M. -% -VMS, n.: - The world's foremost multi-user adventure game. -% -VMS version 2.0 ==> -% -Voiceless it cries, -Wingless flutters, -Toothless bites, -Mouthless mutters. -What am I? -% -VOLCANO: - A mountain with hiccups. -% -Volcanoes have a grandeur that is grim -And earthquakes only terrify the dolts, -And to him who's scientific -There is nothing that's terrific -In the pattern of a flight of thunderbolts! - -- W. S. Gilbert, "The Mikado" -% -Volley Theory: - It is better to have lobbed and lost - than never to have lobbed at all. -% -Von Neumann was the subject of many dotty professor stories. Von Neumann -supposedly had the habit of simply writing answers to homework assignments on -the board (the method of solution being, of course, obvious) when he was asked -how to solve problems. One time one of his students tried to get more helpful -information by asking if there was another way to solve the problem. Von -Neumann looked blank for a moment, thought, and then answered, "Yes.". -% -Vote anarchist. -% -Vote early and vote often. - -- Al Capone's slogan for Big Bill Thompson's anti-reform - campaign for Mayor of Chicago, 1926. Big Bill won. -% -Vote for ME -- I'm well-tapered, half-cocked, ill-conceived and -TAX-DEFERRED! -% -VUJA DE: - The feeling that you've *never*, *ever* been in this situation before. -% -Wagner's music is better than it sounds. - -- Mark Twain -% -Wait for that wisest of all counselors, Time. - -- Pericles -% -Waiter: "Tea or coffee, gentlemen?" -1st customer: "I'll have tea." -2nd customer: "Me, too -- and be sure the glass is clean!" - (Waiter exits, returns) -Waiter: "Two teas. Which one asked for the clean glass?" -% -Wake up all you citizens, hear your country's call, -Not to arms and violence, But peace for one and all. -Crush out hate and prejudice, fear and greed and sin, -Help bring back her dignity, restore her faith again. - -Work hard for a common cause, don't let our country fall. -Make her proud and strong again, democracy for all. -Yes, make our country strong again, keep our flag unfurled. -Make our country well again, respected by the world. - -Make her whole and beautiful, work from sun to sun. -Stand tall and labor side by side, because there's so much to be done. -Yes, make her whole and beautiful, united strong and free, -Wake up, all you citizens, It's up to you and me. - -- Pansy Myers Schroeder -% -Wake up and smell the coffee. - -- Ann Landers -% -Waking a person unnecessarily should not be considered -a capital crime. For a first offense, that is. -% -Walk softly and carry a big stick. - -- Theodore Roosevelt -% -Walk softly and carry a megawatt laser. -% -Walking on water wasn't built in a day. - -- Jack Kerouac -% -Wall Street indices predicted nine out of the last five recessions - -- Paul A. Samuelson, Nobel laureate in economics - (Newsweek, Science and Stocks, 19 Sep. 1966.) -% -Walt: Dad, what's gradual school? -Garp: Gradual school? -Walt: Yeah. Mom says her work's more fun now that she's teaching - gradual school. -Garp: Oh. Well, gradual school is someplace you go and gradually - find out that you don't want to go to school anymore. - -- The World According To Garp -% -Walters' Rule: - All airline flights depart from the gates most distant from - the center of the terminal. Nobody ever had a reservation - on a plane that left Gate 1. -% -Wanna buy a duck? -% -Wanna tell you all a story 'bout a man named Jed, -A poor mountaineer, barely kept his family fed. -But then one day he was shootin' at some food, -When up through the ground come a bubblin' crude -- oil, that is; - black gold; "Texas tea" ... - -Well the next thing ya know, old Jed's a millionaire. -The kinfolk said, "Jed, move away from there!" -They said, "Californy is the place ya oughta be", -So they loaded up the truck and they moved to Beverly -- Hills, that is; - swimmin' pools; movie stars. -% -War doesn't prove who's right, just who's left. -% -War hath no fury like a non-combatant. - -- Charles Edward Montague -% -War is an equal opportunity destroyer. -% -War is delightful to those who have had no experience of it. - -- Desiderius Erasmus -% -War is like love, it always finds a way. - -- Bertolt Brecht, "Mother Courage" -% -War is much too serious a matter to be entrusted to the military. - -- Clemenceau -% -War is peace. Freedom is slavery. Ketchup is a vegetable. -% -War spares not the brave, but the cowardly. - -- Anacreon -% -WARNING: - Reading this fortune can affect the dimensionality of your - mind, change the curvature of your spine, cause the growth - of hair on your palms, and make a difference in the outcome - of your favorite war. -% -WARNING! - This system is subject to breakdowns during periods of critical need! -A special circuit in the computer called a "critical detector" senses the -user's emotional state in terms of how desperate they are to get their program -to run. The "critical detector" then creates a bug in the program proportional -to the desperation of the user. Threatening the terminal with violence only -aggravates the situation, causing the program to immediately crash or the -entire system to go down. Likewise, attempts to use another terminal may cause -it to core dump. (They all belong to the same LAN.) Keep cool and say nice -things to the terminal. -% -Warning: Do not look directly into laser with remaining eye. -% -Warning: Listening to WXRT on April Fools' Day is not recommended for -those who are slightly disoriented the first few hours after waking -up. - -- Chicago Reader 4/22/83 -% -Warning: Trespassers will be shot. -Survivors will be shot again. -% -WARNING!!! -This machine is subject to breakdowns during periods of critical need. - -A special circuit in the machine called "critical detector" senses the -operator's emotional state in terms of how desperate he/she is to use the -machine. The "critical detector" then creates a malfunction proportional -to the desperation of the operator. Threatening the machine with violence -only aggravates the situation. Likewise, attempts to use another machine -may cause it to malfunction. They belong to the same union. Keep cool -and say nice things to the machine. Nothing else seems to work. - -See also: flog(1), tm(1) -% -Warp 7 -- It's a law we can live with. -% -Was there a time when dancers with their fiddles -In children's circuses could stay their troubles? -There was a time they could cry over books, -But time has set its maggot on their track. -Under the arc of the sky they are unsafe. -What's never known is safest in this life. -Under the skysigns they who have no arms -Have cleanest hands, and, as the heartless ghost -Alone's unhurt, so the blind man sees best. - -- Dylan Thomas, "Was There A Time" -% -Washington, D.C: Fifty square miles almost completely surrounded by reality. -% -Washington [D.C.] is a city of Southern efficiency and Northern charm. - -- John F. Kennedy -% -[Washington, D.C.] is the home of... taste for -the people -- the big, the bland and the banal. - -- Ada Louise Huxtable -% -Washington, D.C: Wasting your money since 1810. -% -Wasn't there something about a PASCAL programmer -knowing the value of everything and the Wirth of nothing? -% -Waste not fresh tears over old griefs. - -- Euripides -% -Waste not, get your budget cut next year. -% -Wasting time is an important part of living. -% -Watch all-night Donna Reed reruns until your mind resembles oatmeal. -% -Watch your mouth, kid, or you'll find yourself floating home. - -- Han Solo -% -Water, taken in moderation cannot hurt anybody. - -- Mark Twain -% -Watership Down: -You've read the book. You've seen the movie. Now eat the stew! -% -Watson's Law: - The reliability of machinery is inversely proportional to the - number and significance of any persons watching it. -% -WE: - The single most important word in the world. -% -We all agree on the necessity of compromise. We just can't agree on -when it's necessary to compromise. - -- Larry Wall -% -We all declare for liberty, but in using the -same word we do not all mean the same thing. - -- Abraham Lincoln -% -We all dream of being the darling of everybody's darling. -% -We all know that no one understands anything that isn't funny. -% -We all like praise, but a hike in our pay is the best kind of ways. -% -We all live in a state of ambitious poverty. - -- Decimus Junius Juvenalis -% -We all live under the same sky, but we don't all have the same horizon. - -- Dr. Konrad Adenauer -% -We are all agreed that your theory is crazy. The question which divides us is -whether it is crazy enough to have a chance of being correct. My own feeling -is that it is not crazy enough. - -- Niels Bohr -% -We are all born charming, fresh and spontaneous and must be civilized -before we are fit to participate in society. - -- Judith Martin, "Miss Manners' Guide to Excruciatingly - Correct Behaviour" -% -We are all born equal... just some of us are more equal than others. -% -We are all born mad. Some remain so. - -- Samuel Beckett -% -We are all dying -- and we're gonna be dead for a long time. -% -We are all in the gutter, but some of us are looking at the stars. - -- Oscar Wilde -% -We are all so much together and yet we are all dying of loneliness. - -- Albert Schweitzer -% -We are all worms. But I do believe I am a glowworm. - -- Winston Churchill -% -We are anthill men upon an anthill world. - -- Ray Bradbury -% -We ARE as gods and might as well get good at it. - -- Whole Earth Catalog -% -We are confronted with insurmountable opportunities. - -- Walt Kelly, "Pogo" -% -We are drowning in information but starved for knowledge. - -- John Naisbitt, "Megatrends" -% -We are each entitled to our own opinion, but no one is entitled to his -own facts. - -- Patrick Moynihan -% -We are each only one drop in a great -ocean -- but some of the drops sparkle! -% -We are experiencing system trouble -- do not adjust your terminal. -% -We are giving instruction to FBI agents in the various Chinese -dialects ... to handle present and likely future contingencies. - -- J. Hoover -% -We are going to give a little something, a few little years more, to -socialism, because socialism is defunct. It dies all by itself. The bad -thing is that socialism, being a victim of its ... Did I say socialism? - -- Fidel Castro -% -We are going to have peace even if we have to fight for it. - -- Dwight D. Eisenhower -% -We are Microsoft. Unix is irrelevant. -Openness is futile. Prepare to be assimilated. -% -We are not a clone. -% -We are not a loved organization, but we are a respected one. - -- John Fisher -% -We are not alone. -% -We are not loved by our friends for what we are; -rather, we are loved in spite of what we are. - -- Victor Hugo -% -We are on the verge: Today our program proved Fermat's next-to-last -theorem. - -- Epigrams in Programming, ACM SIGPLAN Sept. 1982 -% -We are preparing to think about contemplating preliminary work on plans to -develop a schedule for producing the 10th Edition of the Unix Programmers -Manual. - -- Andrew Hume -% -We are simple killers of people and destroyers of property. -% -We are so fond of each other because our ailments are the same. - -- Jonathan Swift -% -We are sorry. We cannot complete your call as dialed. Please check -the number and dial again or ask your operator for assistance. - -This is a recording. -% -We are stronger than our skin of flesh and metal, for we carry and -share a spectrum of suns and lands that lends us legends as we craft -our immortality and interweave our destinies of water and air, -leaving shadows that gather color of their own, until they outshine -the substance that cast them. -% -We are the people our parents warned us about. -% -We are the unwilling... led by the unqualified... -to do the unnecessary... for the ungrateful... - -- GI in Vietnam, 1970 -% -We are unavoidably drawn towards conservatism and death. -The order is not insignificant. - -- Poul Henningsen (1894-1967) -% -We are what we are. -% -We are what we pretend to be. - -- Kurt Vonnegut, Jr. -% -We can defeat gravity. The problem is the paperwork involved. -% -We can embody the truth, but we cannot know it. - -- Yates -% -We can found no scientific discipline, nor a healthy profession on the -technical mistakes of the Department of Defense and IBM. - -- Edsger W. Dijkstra -% -We cannot command nature except by obeying her. - -- Sir Francis Bacon -% -We cannot do everything at once, but we can do something at once. - -- Calvin Coolidge -% -We cannot put the face of a person on a stamp unless said person is -deceased. My suggestion, therefore, is that you drop dead. - -- James E. Day, Postmaster General -% -We could do that, but it would be wrong, that's for sure. - -- Richard M. Nixon -% -We could nuke Baghdad into glass, wipe it with Windex, tie fatback on our -feet and go skating. - -- Fred Reed, Air Force Times columnist -% -We dedicate this book to our fellow citizens who, for love of truth, -take from their own wants by taxes and gifts, and now and then send -forth one of themselves as dedicated servant, to forward the search -into the mysteries and marvelous simplicities of this strange and -beautiful Universe, Our home. - -- "Gravitation", Misner, Thorne, and Wheeler -% -We demand rigidly defined areas of doubt and uncertainty! - -- Vroomfondel -% -We don't believe in rheumatism and true love until after the first attack. - -- Marie Ebner von Eschenbach -% -We don't care. We don't have to. We're the Phone Company. -% -We don't care how they do it in New York. -% -We don't have to protect the environment -- the Second Coming is at hand. - -- James Watt, noted theologian -% -We don't know one millionth of one percent about anything. -% -We don't know who discovered water, but we're certain it wasn't a fish. -% -We don't know who it was that discovered water, but we're pretty sure -that it wasn't a fish. - -- Marshall McLuhan -% -We don't like their sound. Groups of guitars are on the way out. - -- Decca Recording Company, turning down the Beatles, 1962 -% -We don't need no education, we don't need no thought control. - -- Pink Floyd -% -We don't need no indirection We don't need no compilation -We don't need no flow control We don't need no load control -No data typing or declarations No link edit for external bindings -Hey! did you leave the lists alone? Hey! did you leave that source alone? -Chorus: (Chorus) - Oh No. It's just a pure LISP function call. - -We don't need no side-effecting We don't need no allocation -We don't need no flow control We don't need no special-nodes -No global variables for execution No dark bit-flipping for debugging -Hey! did you leave the args alone? Hey! did you leave those bits alone? -(Chorus) (Chorus) - -- "Another Glitch in the Call", a la Pink Floyd -% -We don't really understand it, so we'll give it to the programmers. -% -We don't smoke and we don't chew, and we don't go with girls that do. - -- Walter Summers -% -We don't understand the software, and sometimes we don't -understand the hardware, but we can *see* the blinking lights! -% -We found on St. Paul's only two kinds of birds -- the booby and the noddy... -Both are of a tame and stupid disposition, and are so unaccustomed to -visitors, that I could have killed any number of them with my geological -hammer. - -- Charles Darwin -% -We gave you an atomic bomb, what do you want, mermaids? - -- I. I. Rabi to the Atomic Energy Commission -% -We give advice, but we cannot give the wisdom to profit by it. - -- Francois de La Rochefoucauld -% -We gotta get out of this place, -If it's the last thing we ever do. - -- The Animals -% -We had it tough ... I had to get up at 9 o'clock at night, half an -hour before I went to bed, eat a lump of dry poison, work 29 hours down -mill, and when we came home our Dad would kill us, and dance about on -our grave singing Hallelujah ... - -- Monty Python -% -We have an equal opportunity Calculus class -- it's fully integrated. -% -We have art that we do not die of the truth. - -- Friedrich Nietzsche -% -We have ears, earther...FOUR OF THEM! -% -We have gone on piling weapon upon weapon, missile upon missile, new -levels of destructiveness upon old ones. We have done this helplessly, -almost involuntarily: like the victims of some sort of hypnotism, like -men in a dream, like lemmings heading for the sea, like the children of -Hamelin marching blindly along behind their Pied Piper. And the result -is that today we have achieved, we and the Russians together, in the -creation of these devices and their means of delivery, levels of -redundancy of such grotesque dimensions as to defy rational understanding. - -- George Kennan, May 19, 1981 -% -We have lingered long enough on the shores of the Cosmic Ocean. - -- Carl Sagan -% -We have met the enemy, and he is us. - -- Walt Kelly -% -We have more to fear from the bungling of the incompetent -than from the machinations of the wicked. -% -We have no scorched earth policy. -We have a policy of scorched Communists. - -- General Efrain Rios Montt, President of Guatemala, 1982 -% -We have not inherited the earth from our parents, we've borrowed it from -our children. -% -We have nowhere else to go... this is all we have. - -- Margaret Mead -% -We have only two things to worry about: That things will never get -back to normal, and that they already have. -% -We have reason to be afraid. This is a terrible place. - -- John Berryman -% -We have seen the light at the end of the tunnel, and it's out. -% -We have the flu. I don't know if this particular strain has an -official name, but if it does, it must be something like "Martian Death -Flu". You may have had it yourself. The main symptom is that you wish -you had another setting on your electric blanket, up past "HIGH", that -said "ELECTROCUTION". - -Another symptom is that you cease brushing your teeth, because (a) your -teeth hurt, and (b) you lack the strength. Midway through the brushing -process, you'd have to lie down in front of the sink to rest for a -couple of hours, and rivulets of toothpaste foam would dribble sideways -out of your mouth, eventually hardening into crusty little toothpaste -stalagmites that would bond your head permanently to the bathroom -floor, which is how the police would find you. - -You know the kind of flu I'm talking about. - -- Dave Barry, "Molecular Homicide" -% -We interrupt this fortune for an important announcement... -% -We invented a new protocol and called it Kermit, after Kermit the Frog, -star of "The Muppet Show." [3] - -[3] Why? Mostly because there was a Muppets calendar on the wall when we -were trying to think of a name, and Kermit is a pleasant, unassuming sort of -character. But since we weren't sure whether it was OK to name our protocol -after this popular television and movie star, we pretended that KERMIT was an -acronym; unfortunately, we could never find a good set of words to go with the -letters, as readers of some of our early source code can attest. Later, while -looking through a name book for his forthcoming baby, Bill Catchings noticed -that "Kermit" was a Celtic word for "free", which is what all Kermit programs -should be, and words to this effect replaced the strained acronyms in our -source code (Bill's baby turned out to be a girl, so he had to name her Becky -instead). When BYTE Magazine was preparing our 1984 Kermit article for -publication, they suggested we contact Henson Associates Inc. for permission -to say that we did indeed name the protocol after Kermit the Frog. Permission -was kindly granted, and now the real story can be told. I resisted the -temptation, however, to call the present work "Kermit the Book." - -- Frank da Cruz, "Kermit - A File Transfer Protocol" -% -We know next to nothing about virtually everything. It is not necessary -to know the origin of the universe; it is necessary to want to know. -Civilization depends not on any particular knowledge, but on the disposition -to crave knowledge. - -- George Will -% -We laugh at the Indian philosopher, who to account for the support -of the earth, contrived the hypothesis of a huge elephant, and to support -the elephant, a huge tortoise. If we will candidly confess the truth, we -know as little of the operation of the nerves, as he did of the manner in -which the earth is supported: and our hypothesis about animal spirits, or -about the tension and vibrations of the nerves, are as like to be true, as -his about the support of the earth. His elephant was a hypothesis, and our -hypotheses are elephants. Every theory in philosophy, which is built on -pure conjecture, is an elephant; and every theory that is supported partly -by fact, and partly by conjecture, is like Nebuchadnezzar's image, whose -feet were partly of iron, and partly of clay. - -- Thomas Reid, "An Inquiry into the Human Mind", 1764 -% -We lie loudest when we lie to ourselves. - -- Eric Hoffer -% -We love our little Johnny -He's the best little boy in all the world -And we wouldn't trade him for anything -That's how much we love him. -No, we couldn't live without him -So that's why, since he died, -We keep him safe in our G.E. freezer. -He's so good, so well-behaved, -Even better than before; -Oh, such a wonderful kid he is. -Alice and me, we'll never be lonely, -Never miss our little Johnny, -He'll never grow up and leave us -That's why we love him like we do. - -- Mr. Mincemeat -% -"We maintain that the very foundation of our way of life is what we call -free enterprise," said Cash McCall, "but when one of our citizens -show enough free enterprise to pile up a little of that profit, we do -our best to make him feel that he ought to be ashamed of himself." - -- Cameron Hawley -% -We may eventually come to realize that chastity is no more a virtue -than malnutrition. - -- Alex Comfort -% -We may hope that machines will eventually compete with men in all purely -intellectual fields. But which are the best ones to start with? Many people -think that a very abstract activity, like the playing of chess, would be -best. It can also be maintained that it is best to provide the machine with -the best sense organs that money can buy, and then teach it to understand -and speak English. - -- Alan M. Turing -% -We may not be able to persuade Hindus that Jesus and not Vishnu should govern -their spiritual horizon, nor Moslems that Lord Buddha is at the center of -their spiritual universe, nor Hebrews that Mohammed is a major prophet, nor -Christians that Shinto best expresses their spiritual concerns, to say -nothing of the fact that we may not be able to get Christians to agree among -themselves about their relationship to God. But all will agree on a -proposition that they possess profound spiritual resources. If, in addition, -we can get them to accept the further proposition that whatever form the -Deity may have in their own theology, the Deity is not only external, but -internal and acts through them, and they themselves give proof or disproof -of the Deity in what they do and think; if this further proposition can be -accepted, then we come that much closer to a truly religious situation on -earth. - -- Norman Cousins, from his book "Human Options" -% -We may not like doctors, but at least they doctor. Bankers are not ever -popular but at least they bank. Policeman police and undertakers take -under. But lawyers do not give us law. We receive not the gladsome light -of jurisprudence, but rather precedents, objections, appeals, stays, -filings and forms, motions and counter-motions, all at $250 an hour. - -- Nolo News, summer 1989 -% -We may not return the affection of those who like us, -but we always respect their good judgment. -% -...we must be wary of granting too much power to natural selection -by viewing all basic capacities of our brain as direct adaptations. -I do not doubt that natural selection acted in building our oversized -brains -- and I am equally confident that our brains became large as -an adaptation for definite roles (probably a complex set of interacting -functions). But these assumptions do not lead to the notion, often -uncritically embraced by strict Darwinians, that all major capacities -of the brain must arise as direct products of natural selection. - -- S. J. Gould, "The Mismeasure of Man" -% -We must believe that it is the darkest before the dawn -of a beautiful new world. We will see it when we believe it. - -- Saul Alinsky -% -We must die because we have known them. - -- Ptah-hotep, 2000 B.C. -% -We must finish once and for all with the neutrality of chess. We must -condemn once and for all the formula "chess for the sake of chess," like -the formula "art for art's sake." We must organize shock-brigades of -chess-players, and begin the immediate realization of a Five-Year Plan -for chess. - -- Nikolai V. Krylenko, People's Commissar for Justice - (of RFSFR, later of USSR), speaking at a 1932 Congress - of Chess Players, as quoted in Boris Souvarine's - "Stalin," published London, 1939 -% -...we must not judge the society of the future by considering whether or not -we should like to live in it; the question is whether those who have grown up -in it will be happier than those who have grown up in our society or those of -the past. - -- Joseph Wood Krutch -% -We must remember that in time of war what is said on the enemy's side of -the front is always propaganda and what is said on our side of the front -is truth and righteousness, the cause of humanity and a crusade for peace. - -- Walter Lippmann -% -We must remember the First Amendment which -protects any shrill jackass no matter how self-seeking. - -- F. G. Withington -% -We must respect the other fellow's religion, but only in the sense and to -the extent that we respect his theory that his wife is beautiful and his -children smart. - -- H. L. Mencken, "Minority Report" -% -We only acknowledge small faults in order -to make it appear that we are free from great ones. - -- Francois de La Rochefoucauld -% -We ought to be very grateful that we have tools. Millions of years ago -people did not have them, and home projects were extremely difficult. -For example, when a primitive person wanted to put up paneling, he had -to drive the little paneling nails into the cave wall with his bare -fist, so generally the paneling wound up getting spattered with -primitive blood, which isn't really all that bad when you consider how -ugly paneling is to begin with. - -- Dave Barry, "The Taming of the Screw" -% -We prefer to believe that the absence of inverted commas guarantees the -originality of a thought, whereas it may be merely that the utterer has -forgotten its source. - -- Clifton Fadiman, "Any Number Can Play" -% -We prefer to speak evil of ourselves -rather than not speak of ourselves at all. -% -We promise according to our hopes, and perform according to our fears. -% -We rarely find anyone who can say he has lived a happy life, and who, -content with his life, can retire from the world like a satisfied guest. - -- Quintus Horatius Flaccus (Horace) -% -We read to say that we have read. -% -We really don't have any enemies. -It's just that some of our best friends are trying to kill us. -% -We secure our friends not by accepting favors but by doing them. - -- Thucydides -% -We seem to have forgotten the simple truth that reason is never perfect. -Only non-sense attains perfection. - -- Poul Henningsen (1894-1967) -% -We seldom repent talking too little, but very often talking too much. - -- Jean de la Bruyere -% -We should be careful to get out of an experience only the wisdom that is -in it - and stay there, lest we be like the cat that sits down on a hot -stove-lid. She will never sit down on a hot stove-lid again - and that -is well; but also she will never sit down on a cold one any more. - -- Mark Twain -% -We should be glad we're living in the time that we are. If any of us had been -born into a more enlightened age, I'm sure we would have immediately been taken -out and shot. - -- Strange de Jim -% -We should have a great many fewer disputes in the world if only words were -taken for what they are, the signs of our ideas only, and not for things -themselves. - -- John Locke -% -We should have a Vollyballocracy. We elect a six-pack of presidents. -Each one serves until they screw up, at which point they rotate. - -- Dennis Miller -% -We should keep the Panama Canal. After all, we stole it fair and square. - -- S. I. Hayakawa -% -We should realize that a city is better off with bad laws, so long as they -remain fixed, then with good laws that are constantly being altered, that -the lack of learning combined with sound common sense is more helpful than -the kind of cleverness that gets out of hand, and that as a general rule, -states are better governed by the man in the street than by intellectuals. -These are the sort of people who want to appear wiser than the laws, who -want to get their own way in every general discussion, because they feel that -they cannot show off their intelligence in matters of greater importance, and -who, as a result, very often bring ruin on their country. - -- Cleon, Thucydides, III, 37 translation by Rex Warner -% -We the unwilling, led by the ungrateful, are doing the impossible. -We've done so much, for so long, with so little, -that we are now qualified to do something with nothing. -% -We the Users, in order to form a more perfect system, establish priorities, -ensure connective tranquility, provide for common repairs, promote -preventive maintenance, and secure the blessings of liberty for ourselves -and our processes, do ordain and establish this Software of The Unixed States -of America. -% -We thrive on euphemism. We call multi-megaton bombs "Peace-keepers", closet -size apartments "efficient" and incomprehensible artworks "innovative". In -fact, "euphemism" has become a euphemism for "bald-faced lie". And now, here -are the euphemisms so colorfully employed in Personal Ads: - -EUPHEMISM REALITY -------------------- ------------------------- -Excited about life's journey No concept of reality -Spiritually evolved Oversensitive -Moody Manic-depressive -Soulful Quiet manic-depressive -Poet Boring manic-depressive -Sultry/Sensual Easy -Uninhibited Lacking basic social skills -Unaffected and earthy Slob and lacking basic social skills -Irreverent Nasty and lacking basic social skills -Very human Quasimodo's best friend -Swarthy Sweaty even when cold or standing still -Spontaneous/Eclectic Scatterbrained -Flexible Desperate -Aging child Self-centered adult -Youthful Over 40 and trying to deny it -Good sense of humor Watches a lot of television -% -We thrive on euphemism. We call multi-megaton bombs "Peace-keepers", closet -size apartments "efficient" and incomprehensible artworks "innovative". In -fact, "euphemism" has become a euphemism for "bald-faced lie". And now, here -are the euphemisms so colorfully employed in Personal Ads: - -EUPHEMISM REALITY -------------------- ------------------------- -Independent thinker Crazy -High spirited Crazy and hyperactive -Free spirited Crazy and irresponsible -Outrageous Crazy and obnoxious -Exotic Crazy with a pierced nose/nipple -Cuddly Overweight -Huggable/Zaftig/Rubenesque Fat (there's a lot to love) -Big and beautiful Really Fat -Fat 'n' sassy Really Fat and loud -Svelte/Slender Anorexic -Dynamic Pushy -Assertive Pushy with a mean streak -Feisty/Ambitious Would kill own mother for next corporate rung -Demanding Will make your life a living hell -Looking for Mr./Ms. Right Looking for Mr./Ms. Rich -% -We totally deny the allegations, and -we're trying to identify the allegators. -% -We tried to close Ohio's borders and ran into a Constitutional problem. -There's a provision in the Constitution that says you can't close your -borders to interstate commerce, and garbage is a form of interstate commerce. - -- Ohio Lt. Governor Paul Leonard -% -[We] use bad software and bad machines for the wrong things. - -- R. W. Hamming -% -We warn the reader in advance that the proof presented here -depends on a clever but highly unmotivated trick. - -- Howard Anton, "Elementary Linear Algebra" -% -We was playin' the Homestead Grays in the city of Pitchburgh. Josh -[Gibson] comes up in the last of the ninth with a man on and us a run -behind. Well, he hit one. The Grays waited around and waited around, -but finally the empire rules it ain't comin' down. So we win. The -next day, we was disputin' the Grays in Philadelphia when here come -a ball outta the sky right in the glove of the Grays' center fielder. -The empire made the only possible call. "You're out, boy!" he says -to Josh. "Yesterday, in Pitchburgh." - -- Satchel Paige -% -We were happily married for eight months. Unfortunately, we -were married for four and a half years. - -- Nick Faldo -% -We were so poor that we thought new clothes meant someone had died. -% -We were so poor we couldn't afford a watchdog. -If we heard a noise at night, we'd bark ourselves. - -- Crazy Jimmy -% -We were young and our happiness dazzled us with its strength. But there was -also a terrible betrayal that lay within me like a Merle Haggard song at a -French restaurant. [...] - I could not tell the girl about the woman of the tollway, of her milk -white BMW and her Jordache smile. There had been a fight. I had punched her -boyfriend, who fought the mechanical bulls. Everyone told him, "You ride the -bull, senor. You do not fight it." But he was lean and tough like a bad -rib-eye and he fought the bull. And then he fought me. And when we finished -there were no winners, just men doing what men must do. [...] - "Stop the car," the girl said. - There was a look of terrible sadness in her eyes. She knew about the -woman of the tollway. I knew not how. I started to speak, but she raised an -arm and spoke with a quiet and peace I will never forget. - "I do not ask for whom's the tollway belle," she said, "the tollway -belle's for thee." - The next morning our youth was a memory, and our happiness was a lie. -Life is like a bad margarita with good tequila, I thought as I poured whiskey -onto my granola and faced a new day. - -- Peter Applebome, International Imitation Hemingway - Competition -% -We who revel in nature's diversity and feel instructed by every animal -tend to brand Homo sapiens as the greatest catastrophe since the Cretaceous -extinction. - -- S. J. Gould -% -We will have solar energy as soon as the utility companies solve -one technical problem -- how to run a sunbeam through a meter. -% -we will invent new lullabies, new songs, new acts of love, -we will cry over things we used to laugh & -our new wisdom will bring tears to eyes of gentle -creatures from other planets who were afraid of us till then & -in the end a summer with wild winds & -new friends will be. -% -We will not be responsible for damage to equipment, your ego, county wide -power outages, spontaneously generated mini (or larger) black holes, -planetary disruptions, or personal injury or worse that may result from the -use of this material. - -- taken from Samuel M. Goldwasser's - Sam's Strobe FAQ Notes on the Troubleshooting - and Repair of Electronic Flash Units and Strobe Lights -% -We wish you a Hare Krishna -We wish you a Hare Krishna -We wish you a Hare Krishna -And a Sun Myung Moon! - -- Maxwell Smart -% -WEAPON: - An index of the lack of development of a culture. -% -Wedding is destiny, and hanging likewise. - -- John Heywood -% -Wedding, n.: - A ceremony at which two persons undertake to become one, one - undertakes to become nothing and nothing undertakes to become - supportable. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Wedding rings are the world's smallest handcuffs. -% -Weed's Axiom: - Never ask two questions in a business letter. - The reply will discuss the one in which you are - least interested and say nothing about the other. -% -Weekend, where are you? -% -Weiler's Law: - Nothing is impossible for the man who doesn't have to do it - himself. -% -Weinberg, as a young grocery clerk, advised the grocery manager to get -rid of rutabagas which nobody every bought. He did so. "Well, kid, that -was a great idea," said the manager. Then he paused and asked the killer -question, "NOW what's the least popular vegetable?" - -Law: Once you eliminate your #1 problem, #2 gets a promotion. - -- Gerald Weinberg, "The Secrets of Consulting" -% -Weinberg's First Law: - Progress is only made on alternate Fridays. -% -Weinberg's Principle: - An expert is a person who avoids the small errors while sweeping - on to the grand fallacy. -% -Weinberg's Second Law: - If builders built buildings the way programmers wrote programs, - then the first woodpecker that came along would destroy civilization. - -- Gerald Weinberg -% -Weiner's Law of Libraries: - There are no answers, only cross references. -% -Welcome thy neighbor into thy fallout shelter. -He'll come in handy if you run out of food. - -- Dean McLaughlin -% -Welcome to boggle - do you want instructions? - -D G G O - -O Y A N - -A D B T - -K I S P -Enter words: -> -% -Welcome to Lake Wobegon, where all the men are strong, -The women are pretty, and the children are above-average. - -- Garrison Keillor -% -Welcome to the Zoo! -% -Welcome to UNIX! Enjoy your session! Have a great time! Note the -use of exclamation points! They are a very effective method for -demonstrating excitement, and can also spice up an otherwise plain-looking -sentence! However, there are drawbacks! Too much unnecessary exclaiming -can lead to a reduction in the effect that an exclamation point has on -the reader! For example, the sentence - - Jane went to the store to buy bread - -should only be ended with an exclamation point if there is something -sensational about her going to the store, for example, if Jane is a -cocker spaniel or if Jane is on a diet that doesn't allow bread or if -Jane doesn't exist for some reason! See how easy it is?! Proper control -of exclamation points can add new meaning to your life! Call now to receive -my free pamphlet, "The Wonder and Mystery of the Exclamation Point!"! -Enclose fifteen(!) dollars for postage and handling! Operators are -standing by! (Which is pretty amazing, because they're all cocker spaniels!) -% -Welcome to Utah. -If you think our liquor laws are funny, you should see our underwear! -% -Well, anyway, I was reading this James Bond book, and right away I realized -that like most books, it had too many words. The plot was the same one that -all James Bond books have: An evil person tries to blow up the world, but -James Bond kills him and his henchmen and makes love to several attractive -women. There, that's it: 24 words. But the guy who wrote the book took -*thousands* of words to say it. - Or consider "The Brothers Karamazov", by the famous Russian alcoholic -Fyodor Dostoyevsky. It's about these two brothers who kill their father. -Or maybe only one of them kills the father. It's impossible to tell because -what they mostly do is talk for nearly a thousand pages. If all Russians talk -as much as the Karamazovs did, I don't see how they found time to become a -major world power. - I'm told that Dostoyevsky wrote "The Brothers Karamazov" to raise -the question of whether there is a God. So why didn't he just come right -out and say: "Is there a God? It sure beats the heck out of me." - Other famous works could easily have been summarized in a few words: - -* "Moby Dick" -- Don't mess around with large whales because they symbolize - nature and will kill you. -* "A Tale of Two Cities" -- French people are crazy. - -- Dave Barry -% -We'll be recording at the Paradise Friday -night. Live, on the Death label. - -- Swan, "Phantom of the Paradise" -% -Well begun is half done. - -- Aristotle -% -"Well," Brahma said, "even after ten thousand explanations, a fool is -no wiser, but an intelligent man requires only two thousand five -hundred." - -- The Mahabharata -% -We'll cross that bridge when we come back to it later. -% -Well, didja wake up grouchy or did you let her sleep? -% -Well, don't worry about it... It's nothing. - -- Lieutenant Kermit Tyler (Duty Officer of Shafter Information - Center, Hawaii), upon being informed that Private Joseph - Lockard had picked up a radar signal of what appeared to be - at least 50 planes soaring toward Oahu at almost 180 miles - per hour, December 7, 1941. -% -Well, fancy giving money to the Government! -Might as well have put it down the drain. -Fancy giving money to the Government! -Nobody will see the stuff again. -Well, they've no idea what money's for -- -Ten to one they'll start another war. -I've heard a lot of silly things, but, Lor'! -Fancy giving money to the Government! - -- A. P. Herbert -% -We'll have solar energy when the power companies develop a sunbeam meter. -% -Well, he didn't know what to do, so he decided to look at the government, -to see what they did, and scale it down and run his life that way. - -- Laurie Anderson -% -Well, here it is, 1983, so it won't be long before you start reading a -lot of boring stories about people like Vance Hartke. Hartke is a -governor or mayor or something from one of the flatter states, and the -reason you'll be reading about him is that he's one of the 50 top -contenders for the 1984 Democratic presidential nomination. These men -will spend the next 18 months going around the country engaging in the -most degrading activities imaginable, such as wearing idiot hats and -appearing on "Meet the Press". "Meet the Press" is one of those Sunday -morning public interest shows that the public is not the least bit -interested in. It features a panel of reporters who ask questions of a -guest politician, who wins an Amana home freezer if he can get through -the entire show without answering a single question ... - -- Dave Barry, "On Presidential Politics" -% -Well I looked at my watch and it said a quarter to five, -The headline screamed that I was still alive, -I couldn't understand it, I thought I died last night. -I dreamed I'd been in a border town, -In a little cantina that the boys had found, -I was desperate to dance, just to dig the local sounds. -When along came a senorita, -She looked so good that I had to meet her, -I was ready to approach her with my English charm, -When her brass knuckled boyfriend grabbed me by the arm, -And he said, grow some funk of your own, amigo, -Grow some funk of your own. -We no like to with the gringo fight, -But there might be a death in Mexico tonite. -... -Take my advice, take the next flight, -And grow some funk, grow your funk at home. - -- Elton John, "Grow Some Funk of Your Own" -% -Well, I would -- if they realized that we -- again if -- if we led them -back to that stalemate only because our retaliatory power, our seconds, -or strike at them after our first strike, would be so destructive they -couldn't afford it, that would hold them off. - -- President Ronald Reagan, on the MX missile -% -Well, if you can't believe what you read in a comic book, what *_c_a_n* -you believe?! - -- Bullwinkle J. Moose [Jay Ward] -% -Well, I'm disenchanted too. We're all disenchanted. - -- James Thurber -% -Well, it's hard for a mere man to believe that woman doesn't have equal -rights. - -- Dwight D. Eisenhower -% -Well, Jim, I'm not much of an actor either. -% -We'll know that rock is dead when you have to get a degree to work in it. -% -WE'LL LOOK INTO IT: - By the time the wheels make a full turn, we - assume you will have forgotten about it,too. -% -Well, my daddy left home when I was three, -And he didn't leave much for Ma and me, -Just and old guitar an'a empty bottle of booze. -Now I don't blame him 'cause he ran and hid, -But the meanest thing that he ever did, -Was before he left he went and named me Sue. -... -But I made me a vow to the moon and the stars, -I'd search the honkey tonks and the bars, -And kill the man that give me that awful name. -It was Gatlinburg in mid-July, -I'd just hit town and my throat was dry, -Thought I'd stop and have myself a brew, -At an old saloon on a street of mud, -Sitting at a table, dealing stud, -Sat that dirty (bleep) that named me Sue. -... -Now, I knew that snake was my own sweet Dad, -From a worn out picture that my Mother had, -And I knew that scar on his cheek and his evil eye... - -- Johnny Cash, "A Boy Named Sue" -% -Well, my terminal's locked up, and I ain't got any Mail, -And I can't recall the last time that my program didn't fail; -I've got stacks in my structs, I've got arrays in my queues, -I've got the : Segmentation violation -- Core dumped blues. - -If you think that it's nice that you get what you C, -Then go : illogical statement with your whole family, -'Cause the Supreme Court ain't the only place with : Bus error views. -I've got the : Segmentation violation -- Core dumped blues. - -On a PDP-11, life should be a breeze, -But with VAXen in the house even magnetic tapes would freeze. -Now you might think that unlike VAXen I'd know who I abuse, -I've got the : Segmentation violation -- Core dumped blues. - -- Core Dumped Blues -% -Well, of course it worked. You made the ritual blood sacrifice. If you -bleed on a machine while working on it, it will work. Unless it -doesn't. In which case, you need someone else to bleed on it as well. - -- Wayne Pascoe -% -We'll pivot at warp 2 and bring all tubes to bear, Mr. Sulu! -% -Well, some take delight in the carriages a-rolling, -And some take delight in the hurling and the bowling, -But I take delight in the juice of the barley, -And courting pretty fair maids in the morning bright and early. -% -Well thaaaaaaat's okay. -% -Well, the handwriting is on the floor. - -- Joe E. Lewis -% -We'll try to cooperate fully with the IRS, because, as citizens, -we feel a strong patriotic duty not to go to jail. - -- Dave Barry -% -Well, we'll really have a party, -but we've gotta post a guard outside. - -- Eddie Cochran, "Come On Everybody" -% -"Well, well, well! Well if it isn't fat stinking billy goat Billy Boy in -poison! How art thou, thou globby bottle of cheap stinking chip oil? Come -and get one in the yarbles, if ya have any yarble, ya eunuch jelly thou!" - -- Alex in "Clockwork Orange" -% -Well, we're big rock singers, we've got golden fingers, -And we're loved everywhere we go. -We sing about beauty, and we sing about truth, -At ten thousand dollars a show. -We take all kind of pills to give us all kind of thrills, -But the thrill we've never known, -Is the thrill that'll get'cha, when you get your picture, -On the cover of the Rolling Stone. - -I got a freaky old lady, name of Cole King Katie, -Who embroiders on my jeans. -I got my poor old gray-haired daddy, -Drivin' my limousine. -Now it's all designed, to blow our minds, -But our minds won't be really be blown; -Like the blow that'll get'cha, when you get your picture, -On the cover of the Rolling Stone. - -We got a lot of little, teen-aged, blue-eyed groupies, -Who'll do anything we say. -We got a genuine Indian guru, that's teachin' us a better way. -We got all the friends that money can buy, -So we never have to be alone. -And we keep gettin' richer, but we can't get our picture, -On the cover of the Rolling Stone. - -- Dr. Hook and the Medicine Show - [They eventually DID make the cover of RS. Ed.] -% -Well, we've come full circle, Lord; I'd like to think there's some -higher meaning to all this. It would certainly reflect well on you. -% -WELL-ADJUSTED: - The ability to play bridge or golf as if they were games. -% -We -own -this land. - -I don't spend -any time -on this land. - -This -is a tiny -little piece - -of my -business -interests. - -It's like -a grain -of sand. - -- "Alliance Airport, from The Poetry Of H. Ross Perot, - recited on ABC's Town Meeting, June 29, 1992. - From SPY Magazine, November 1992 -% -We're all in this alone. - -- Lily Tomlin -% -We're constantly being bombarded by insulting and humiliating music, which -people are making for you the way they make those Wonder Bread products. -Just as food can be bad for your system, music can be bad for your spiritual -and emotional feelings. It might taste good or clever, but in the long run, -it's not going to do anything for you. - -- Bob Dylan, "LA Times", September 5, 1984 -% -We're deep into the holiday gift-giving season, as you can tell from -the fact that everywhere you look, you see jolly old St. Nick urging -you to purchase things, to the point where you want to slug him right -in his bowl full of jelly. - -- Dave Barry, "Simple, Homespun Gifts" -% -We're fantastically incredibly sorry for all these extremely unreasonable -things we did. I can only plead that my simple, barely-sentient friend -and myself are underprivileged, deprived and also college students. - -- Waldo D. R. Dobbs -% -We're happy little Vegemites, - As bright as bright can be. -We all enjoy our Vegemite - For breakfast, lunch and tea. -% -Were it not for the presence of the unwashed and the half-educated, the -formless, queer and incomplete, the unreasonable and absurd, the infinite -shapes of the delightful human tadpole, the horizon would not wear so wide -a grin. - -- F. M. Colby, "Imaginary Obligations" -% -We're Knights of the Round Table -We dance whene'er we're able -We do routines and chorus scenes We're knights of the Round Table -With footwork impeccable Our shows are formidable -We dine well here in Camelot But many times -We eat ham and jam and Spam a lot. We're given rhymes - That are quite unsingable -In war we're tough and able, We're opera mad in Camelot -Quite indefatigable We sing from the diaphragm a lot. -Between our quests -We sequin vests -And impersonate Clark Gable -It's a busy life in Camelot. -I have to push the pram a lot. - -- Monty Python -% -We're living in a golden age. All you need is gold. - -- D. W. Robertson -% -We're mortal -- which is to say, we're ignorant, stupid, and sinful -- -but those are only handicaps. Our pride is that nevertheless, now and -then, we do our best. A few times we succeed. What more dare we ask for? - -- Ensign Flandry -% -"We're not talking about the same thing," he said. "For you the world is -weird because if you're not bored with it you're at odds with it. For me -the world is weird because it is stupendous, awesome, mysterious, -unfathomable; my interest has been to convince you that you must accept -responsibility for being here, in this marvelous world, in this marvelous -desert, in this marvelous time. I wanted to convince you that you must -learn to make every act count, since you are going to be here for only a -short while, in fact, too short for witnessing all the marvels of it." - -- Don Juan -% -We're only in it for the volume. - -- Black Sabbath -% -Were there no women, men might live like gods. - -- Thomas Dekker -% -Wernher von Braun settled for a V-2 when he coulda had a V-8. -% -Westheimer's Discovery: - A couple of months in the laboratory can - frequently save a couple of hours in the library. -% -Wethern's Law: - Assumption is the mother of all screw-ups. -% -We've sent a man to the moon, and that's 29,000 miles away. The center -of the Earth is only 4,000 miles away. You could drive that in a week, -but for some reason nobody's ever done it. - -- Andy Rooney -% -We've tried each spinning space mote -And reckoned its true worth: -Take us back again to the homes of men -On the cool, green hills of Earth. - -The arching sky is calling -Spacemen back to their trade. -All hands! Standby! Free falling! -And the lights below us fade. -Out ride the sons of Terra, -Far drives the thundering jet, -Up leaps the race of Earthmen, -Out, far, and onward yet-- - -We pray for one last landing -On the globe that gave us birth; -Let us rest our eyes on the fleecy skies -And the cool, green hills of Earth. - -- Robert A. Heinlein, 1941 -% -Wharbat darbid yarbou sarbay? -% -What!? Me worry? - -- A. E. Neuman -% -What a bonanza! An unknown beginner to be directed by Lubitsch, in a script -by Wilder and Brackett, and to play with Paramount's two superstars, Gary -Cooper and Claudette Colbert, and to be beaten up by both of them! - -- David Niven, "Bring On the Empty Horses" -% -What a misfortune to be a woman! And yet, the worst misfortune is not to -understand what a misfortune it is. - -- S. A. Kierkegaard (1813-1855) -% -What a strange game. The only winning move is not to play. - -- WOP, "War Games" -% -What, after all, is a halo? It's only one more thing to keep clean. - -- Christopher Fry -% -What an artist dies with me! - -- Nero -% -What an author likes to write most is his signature on the -back of a cheque. - -- Brendan Francis -% -What awful irony is this? -We are as gods, but know it not. -% -What causes the mysterious death of everyone? -% -What color is a chameleon on a mirror? -% -What did ya do with your burden and your cross? -Did you carry it yourself or did you cry? -You and I know that a burden and a cross, -Can only be carried on one man's back. - -- Louden Wainwright III -% -What did you bring that book I didn't want -to be read to out of about Down Under up for? -% -What did you do when the ship sank? -I grabbed a cake of soap and washed myself ashore. -% -What do I consider a reasonable person to be? I'd say a reasonable person -is one who accepts that we are all human and therefore fallible, and takes -that into account when dealing with others. Implicit in this definition is -the belief that it is the right and the responsibility of each person to -live his or her own life as he or she sees fit, to respect this right in -others, and to demand the assumption of this responsibility by others. -% -What do you give a man who has everything? Penicillin. - -- Jerry Lester -% -What do you have when you have six lawyers buried up to their necks in sand? -Not enough sand. -% -What does education often do? -It makes a straight cut ditch of a free meandering brook. - -- Henry David Thoreau -% -What does it mean if there is no fortune for you? -% -What does it take for Americans to do great things; to go to the moon, to -win wars, to dig canals linking oceans, to build railroads across a continent? -In independent thought about this question, Neil Armstrong and I concluded -that it takes a coincidence of four conditions, or in Neil's view, the -simultaneous peaking of four of the many cycles of American life. First, a -base of technology must exist from which to do the thing to be done. Second, -a period of national uneasiness about America's place in the scheme of human -activities must exist. Third, some catalytic event must occur that focuses -the national attention upon the direction to proceed. Finally, an articulate -and wise leader must sense these first three conditions and put forth with -words and action the great thing to be accomplished. The motivation of young -Americans to do what needs to be done flows from such a coincidence of -conditions. ... The Thomas Jeffersons, The Teddy Roosevelts, The John -Kennedys appear. We must begin to create the tools of leadership which they, -and their young frontiersmen, will require to lead us onward and upward. - -- Dr. Harrison H. Schmidt -% -What does not destroy me, makes me stronger. - -- Friedrich Nietzsche -% -What ever happened to happily ever after? -% -What excuses stand in your way? How can you eliminate them? - -- Roger von Oech -% -What foods these morsels be! -% -What fools these morals be! -% -What fools these mortals be. - -- Lucius Annaeus Seneca -% -What garlic is to food, insanity is to art. -% -What garlic is to salad, insanity is to art. -% -What George Washington did for us was to throw out the British, so -that we wouldn't have a fat, insensitive government running our -country. Nice try anyway, George. - -- Disk Jockey on KSFO/KYA -% -What goes up must come down. But don't expect it to come down -where you can find it. Murphy's Law applied to Newton's. -% -What good is a ticket to the good life, -if you can't find the entrance? -% -What good is an obscenity trial except to popularize literature? - -- Nero Wolfe, "The League of Frightened Men" -% -What good is having someone who can walk on water if you don't follow -in his footsteps? -% -What good is it if you talk in flowers, and they think in pastry? - -- Ashleigh Brilliant -% -What happened last night can happen again. -% -What happens if a big asteroid hits Earth? Judging from realistic simulations -involving a sledge hammer and a common laboratory frog, we can assume it will -be pretty bad. - -- Dave Barry -% -What happens to a dream deferred? -Does it dry up -Like a raisin in the sun? -Or fester like a sore -- -And then run? -Does it stink like rotten meat? -Or crust and sugar over -- -Like a syrupy sweet? - -Maybe it just sags -Like a heavy load. - -Or does it explode? - -- Langston Hughes -% -What happens when you cut back the jungle? It recedes. -% -What has roots as nobody sees, -Is taller than trees, -Up, up it goes, -And yet never grows? -% -What I do, first thing [in the morning], is I hop into the shower -stall. Then I hop right back out, because when I hopped in I landed -barefoot right on top of See Threepio, a little plastic robot character -from "Star Wars" whom my son, Robert, likes to pull the legs off of -while he showers. Then I hop right back into the stall because our -dog, Earnest, who has been alone in the basement all night building up -powerful dog emotions, has come bounding and quivering into the -bathroom and wants to greet me with 60 or 70 thousand playful nips, any -one of which -- bear in mind that I am naked and, without my contact -lenses, essentially blind -- could result in the kind of injury where -you have to learn a whole new part if you want to sing the "Messiah", -if you get my drift. Then I hop right back out, because Robert, with -that uncanny sixth sense some children have -- you cannot teach it; -they either have it or they don't -- has chosen exactly that moment to -flush one of the toilets. Perhaps several of them. - -- Dave Barry, "Saving Face" -% -What I mean (and everybody else means) by the word QUALITY cannot be -broken down into subjects and predicates. This is not because Quality -is so mysterious but because Quality is so simple, immediate, and direct. - -- Robert Pirsig, "Zen and the Art of Motorcycle Maintenance" -% -What I think is that the F-word is basically just a convenient nasty- -sounding word that we tend to use when we would really like to come up -with a terrifically witty insult, the kind Winston Churchill always -came up with when enormous women asked him stupid questions at -parties. - -- Dave Barry, "$#$%#^%!^%&@%@!" -% -What I want is all of the power and none of the responsibility. -% -What if everything is an illusion and nothing exists? -In that case, I definitely overpaid for my carpet. - -- Woody Allen, "Without Feathers" -% -What if nothing exists and we're all in somebody's dream? -Or what's worse, what if only that fat guy in the third row exists? - -- Woody Allen, "Without Feathers" -% -What if there had been room at the inn? - -- Linda Festa on the origins of Christianity -% -What is a magician but a practicing theorist? - -- Obi-Wan Kenobi -% -What is actually happening, I am afraid, is that we all tell each -other and ourselves that software engineering techniques should be -improved considerably, because there is a crisis. But there are a few -boundary conditions which apparently have to be satisfied: - - 1. We may not change our thinking habits. - 2. We may not change our programming tools. - 3. We may not change our hardware. - 4. We may not change our tasks. - 5. We may not change the organizational set-up - in which the work has to be done. - -Now under these five immutable boundary conditions, we have to try to -improve matters. This is utterly ridiculous. - -Edsger W. Dijkstra, on receiving the ACM Turing Award in 1972 -% -What is algebra, exactly? Is it one of those three-cornered things? - -- J. M. Barrie -% -What is comedy? Comedy is the art of making people laugh without making -them puke. - -- Steve Martin -% -What is food to one, is to others bitter poison. - -- Titus Lucretius Carus -% -What is good? Everything that heightens the feeling of power in man, the -will to power, power itself. What is bad? Everything that is born of -weakness. Not contentedness but more power; not peace but war; not virtue -but fitness. The weak and the failures shall perish: first principle of -our love of man. And they shall even be given every possible assistance. -What is more harmful than any vice? Active pity for all the failures and -all the weak: Christianity. - -- Friedrich Nietzsche -% -What is important is food, money and opportunities for scoring off one's -enemies. Give a man these three things and you won't hear much squawking -out of him. - -- Brian O'Nolan, "The Best of Myles" -% -What is irritating about love is that it is a crime that requires -an accomplice. - -- Charles Baudelaire -% -What is love but a second-hand emotion? - -- Tina Turner -% -What is mind? No matter. -What is matter? Never mind. - -- Thomas Hewitt Key (1799-1875) -% -What is now proved was once only imagin'd. - -- William Blake -% -What is research but a blind date with knowledge? - -- Will Harvey -% -What is robbing a bank compared with founding a bank? - -- Bertolt Brecht, "The Threepenny Opera" -% -What is status? - Status is when the President calls you for your opinion. - -Uh, no... - Status is when the President calls you in to discuss a - problem with him. - -Uh, that still ain't right... - STATUS is when you're in the Oval Office talking to the President, - and the phone rings. The President picks it up, listens for a - minute, and hands it to you, saying, "It's for you." -% -What is the difference between a Turing machine and the modern computer? -It's the same as that between Hillary's ascent of Everest and the -establishment of a Hilton on its peak. -% -"What is the Nature of God?" - - CLICK...CLICK...WHIRRR...CLICK...=BEEP!= - 1 QT. SOUR CREAM - 1 TSP. SAUERKRAUT - 1/2 CUT CHIVES. - STIR AND SPRINKLE WITH BACON BITS. - -"I've just GOT to start labeling my software..." - -- Bloom County -% -What is the sound of one hand clapping? -% -What is this line of duty, and suffering? You are not supposed to suffer -if you are an assassin. The other person is supposed to suffer. - -- Chiun, glory of the name of Sinanju, teacher of the youth - from outside Sinanju named Remo. -% -What is tolerance? -- it is the consequence of humanity. We are all formed -of frailty and error; let us pardon reciprocally each other's folly -- that -is the first law of nature. - -- Voltaire -% -What is truth? We must adopt a pragmatic definition: it is what is believed -to be the truth. A lie that is put across therefore becomes the truth and -may, therefore, be justified. The difficulty is to keep up lying... it is -simpler to tell the truth and if a sufficient emergency arises, to tell one, -big thumping lie that will then be believed. - -- Ministry of Information, memo on the maintenance of - British civilian morale, 1939 -% -What is wanted is not the will to believe, but the will to find out, -which is the exact opposite. - -- Bertrand Russell, "Skeptical_Essays", 1928 -% -What is worth doing is worth the trouble of asking somebody to do it. -% -What I've done, of course, is total garbage. - -- R. Willard, Pure Math 430a -% -What kind of sordid business are you on now? I mean, man, whither -goest thou? Whither goest thou, America, in thy shiny car in the night? - -- Jack Kerouac -% -What luck for the rulers that men do not think. - -- Adolf Hitler -% -What makes the Universe so hard to comprehend -is that there's nothing to compare it with. -% -What makes us so bitter against people who outwit us -is that they think themselves cleverer than we are. -% -What makes you think graduate school -is supposed to be satisfying? - -- Erica Jong, "Fear of Flying" -% -What most people want is all of the power but none of the responsibility. -% -What no spouse of a writer can ever understand -is that a writer is working when he's staring out the window. -% -What nonsense people talk about happy marriages! -A man can be happy with any woman so long as he doesn't love her. - -- Wilde -% -What on earth would a man do with himself -if something did not stand in his way? - -- H. G. Wells -% -What one believes to be true either is true or becomes true. - -- John Lilly -% -What one fool can do, another can. - -- Ancient Simian proverb -% -What orators lack in depth they make up in length. -% -What pains others pleasures me, -At home am I in Lisp or C; -There i couch in ecstasy, -'Til debugger's poke i flee, -Into kernel memory. -In system space, system space, there shall i fare-- -Inside of a VAX on a silicon square. -% -What passes for optimism is most often the effect of an intellectual error. - -- Raymond Aron, "The Opium of the Intellectuals" -% -What passes for woman's intuition is often nothing -more than man's transparency. - -- George Nathan -% -What publishers are looking for these days isn't radical feminism. -It's corporate feminism -- a brand of feminism designed to sell books -and magazines, three-piece suits, airline tickets, Scotch, cigarettes -and, most important, corporate America's message, which runs: Yes, -women were discriminated against in the past, but that unfortunate -mistake has been remedied; now every woman can attain wealth, prestige -and power by dint of individual rather than collective effort. - -- Susan Gordon -% -What really shapes and conditions and makes us is somebody only a few -of us ever have the courage to face: and that is the child you once -were, long before formal education ever got its claws into you -- that -impatient, all-demanding child who wants love and power and can't get -enough of either and who goes on raging and weeping in your spirit -till at last your eyes are closed and all the fools say, "Doesn't he -look peaceful?" It is those pent-up, craving children who make all -the wars and all the horrors and all the art and all the beauty and -discovery in life, because they are trying to achieve what lay beyond -their grasp before they were five years old. - -- Robertson Davies, "The Rebel Angels" -% -What sane person could live in this world and not be crazy? - -- Ursula K. LeGuin -% -What scoundrel stole the cork from my lunch? - -- J. D. Farley -% -What segment's this, that, laid to rest -On FHA0, is sleeping? -What system file, lay here a while This, this is "acct.run," -While hackers around it were weeping? Accounting file for everyone. - Dump, dump it and type it out, - The file, the highseg of login. -Why lies it here, on public disk -And why is it now unprotected? -A bug in incant, made it thus. Mount, mount all your DECtapes now -And copy the file somehow, somehow. The problem has not been corrected. - Dump, dump it and type it out, - The file, the highseg of login. - -- to Greensleeves -% -What sin has not been committed in the name of efficiency? -% -What soon grows old? Gratitude. - -- Aristotle -% -What, still alive at twenty-two, -A clean upstanding chap like you? -Sure, if your throat 'tis hard to slit, -Slit your girl's, and swing for it. -Like enough, you won't be glad, -When they come to hang you, lad: -But bacon's not the only thing -That's cured by hanging from a string. -So, when the spilt ink of the night -Spreads o'er the blotting pad of light, -Lads whose job is still to do -Shall whet their knives, and think of you. - -- Hugh Kingsmill -% -What the deuce is it to me? You say that we go around the sun. If we went -around the moon it would not make a pennyworth of difference to me or my work. - -- Sherlock Holmes, "A Study in Scarlet" -% -What the hell is it good for? - -- Robert Lloyd (engineer of the Advanced Computing Systems - Division of IBM), to colleagues who insisted that the - microprocessor was the wave of the future, c. 1968 -% -What the large print giveth, the small print taketh away. -% -What the scientists have in their briefcases is terrifying. - -- Nikita Khruschev -% -What the world *really* needs is a good Automatic Bicycle Sharpener. -% -What they said: - What they meant: - -"I recommend this candidate with no qualifications whatsoever." - (Yes, that about sums it up.) -"The amount of mathematics she knows will surprise you." - (And I recommend not giving that school a dime...) -"I simply can't say enough good things about him." - (What a screw-up.) -"I am pleased to say that this candidate is a former colleague of mine." - (I can't tell you how happy I am that she left our firm.) -"When this person left our employ, we were quite hopeful he would go -a long way with his skills." - (We hoped he'd go as far as possible.) -"You won't find many people like her." - (In fact, most people can't stand being around her.) -"I cannot recommend him too highly." - (However, to the best of my knowledge, he has never committed a - felony in my presence.) -% -What they said: - What they meant: - -"If you knew this person as well as I know him, you would think as much -of him as I do." - (Or as little, to phrase it slightly more accurately.) -"Her input was always critical." - (She never had a good word to say.) -"I have no doubt about his capability to do good work." - (And it's nonexistent.) -"This candidate would lend balance to a department like yours, which -already has so many outstanding members." - (Unless you already have a moron.) -"His presentation to my seminar last semester was truly remarkable: -one unbelievable result after another." - (And we didn't believe them, either.) -"She is quite uniform in her approach to any function you may assign her." - (In fact, to life in general...) -% -What they said: - What they meant: - -"You will be fortunate if you can get him to work for you." - (We certainly never succeeded.) -There is no other employee with whom I can adequately compare him. - (Well, our rats aren't really employees...) -"Success will never spoil him." - (Well, at least not MUCH more.) -"One usually comes away from him with a good feeling." - (And such a sigh of relief.) -"His dissertation is the sort of work you don't expect to see these days; -in it he has definitely demonstrated his complete capabilities." - (And his IQ, as well.) -"He should go far." - (The farther the better.) -"He will take full advantage of his staff." - (He even has one of them mowing his lawn after work.) -% -What they say: What they mean: - -A major technological breakthrough... Back to the drawing board. -Developed after years of research Discovered by pure accident. -Project behind original schedule due We're working on something else. - to unforeseen difficulties -Designs are within allowable limits We made it, stretching a point or two. -Customer satisfaction is believed So far behind schedule that they'll be - assured grateful for anything at all. -Close project coordination We're gonna spread the blame, campers! -Test results were extremely gratifying It works, and boy, were we surprised! -The design will be finalized... We haven't started yet, but we've got - to say something. -The entire concept has been rejected The guy who designed it quit. -We're moving forward with a fresh We hired three new guys, and they're - approach kicking it around. -A number of different approaches... We don't know where we're going, but - we're moving. -Preliminary operational tests are Blew up when we turned it on. - inconclusive -Modifications are underway We're starting over. -% -What they say: What they mean: - -New Different colors from previous version. -All New Not compatible with previous version. -Exclusive Nobody else has documentation. -Unmatched Almost as good as the competition. -Design Simplicity The company wouldn't give us any money. -Fool-proof Operation All parameters are hard-coded. -Advanced Design Nobody really understands it. -Here At Last Didn't get it done on time. -Field Tested We don't have any simulators. -Years of Development Finally got one to work. -Unprecedented Performance Nothing ever ran this slow before. -Revolutionary Disk drives go 'round and 'round. -Futuristic Only runs on a next generation supercomputer. -No Maintenance Impossible to fix. -Performance Proven Worked through Beta test. -Meets Tough Quality Standards It compiles without errors. -Satisfaction Guaranteed We'll send you another pack if it fails. -Stock Item We shipped it before and can do it again. -% -What this country needs is a dime that will buy a good five-cent bagel. -% -What this country needs is a good five cent ANYTHING! -% -What this country needs is a good five cent microcomputer. -% -What this country needs is a good five cent nickel. -% -What this country needs is a good five dollar plasma weapon. -% -What time is it? -I don't know, it keeps changing. -% -What upsets me is not that you lied to me, -but that from now on I can no longer believe you. - -- Friedrich Nietzsche -% -What use is magic if it can't save a unicorn? - -- Peter S. Beagle, "The Last Unicorn" -% -What we Are is God's give to us. -What we Become is our gift to God. -% -What we cannot speak about we must pass over in silence. - -- Wittgenstein -% -What we do not understand we do not possess. - -- Johann Wolfgang von Goethe -% -What we need in this country, instead of Daylight Savings Time, which -nobody really understands anyway, is a new concept called Weekday -Morning Time, whereby at 7 a.m. every weekday we go into a space- -launch-style "hold" for two to three hours, during which it just -remains 7 a.m. This way we could all wake up via a civilized gradual -process of stretching and belching and scratching, and it would still -be only 7 a.m. when we were ready to actually emerge from bed. - -- Dave Barry, "$#$%#^%!^%&@%@!" -% -What we need is either less corruption, -or more chance to participate in it. -% -What we see depends on mainly what we look for. - -- John Lubbock -% -What we wish, that we readily believe. - -- Demosthenes -% -What will happen when the 32-bit Unix date goes negative in mid-January -2038 does not bear thinking about. - -- Henry Spencer -% -What will you do if all your problems aren't solved by the time you die? -% -What would you do with a brain if you had one? - -- Judy Garland as Dorothy Gale, "The Wizard of Oz" -% -What you don't know can hurt you, only you won't know it. -% -What you don't know won't help you much either. - -- D. Bennett -% -What you see is from outside yourself, and may come, or not, but is beyond -your control. But your fear is yours, and yours alone, like your voice, or -your fingers, or your memory, and therefore yours to control. If you feel -powerless over your fear, you have not yet admitted that it is yours, to do -with as you will. - -- Marion Zimmer Bradley, "Stormqueen" -% -What you want, what you're hanging around in the world waiting for, is for -something to occur to you. - -- Robert Frost - - [Quoted in "VMS Internals and Data Structures", V4.4, when - referring to AST's.] -% -Whatever became of eternal truth? -% -Whatever became of Strange de Jim? Well, he found a substitute for -cocaine: "You cover Q-tips with sandpaper and ram them up your -nostrils as far as they will go. Then you sniff talcum powder while -shredding hundred dollar bills." - -- Herb Caen -% -Whatever doesn't succeed in two months and a half in California will -never succeed. - -- Rev. Henry Durant, founder of the University of California -% -Whatever else can be said about sex, it cannot be called a dignified -performance. - -- Helen Lawrenson -% -Whatever happened to the good old days -when sex was dirty and the air was clean? -% -Whatever is not nailed down is mine. What I can pry loose is not -nailed down. - -- Collis P. Huntingdon -% -Whatever is not nailed down is mine. -Whatever I can pry up is not nailed down. - -- Collis P. Huntingdon, railroad tycoon -% -Whatever it is, I fear Greeks even when they bring gifts. - -- Publius Vergilius Maro (Virgil) -% -Whatever occurs from love is always beyond good and evil. - -- Friedrich Nietzsche -% -Whatever the missing mass of the universe is, I hope it's not -cockroaches! - -- Mom -% -Whatever women do they must do twice as well as men to be thought half -as good. Luckily this is not difficult. - -- Charlotte Whitton -% -Whatever you do will be insignificant, -but it is very important that you do it. - -- Mahatma Gandhi -% -Whatever you may be sure of, be sure of this: that you are dreadfully like -other people. - -- James Russell Lowell, "My Study Windows" -% -Whatever you want to do, you have to do something else first. -% -What's a cult? It just means not enough people to make a minority. - -- Robert Altman -% -What's all this bru-ha-ha? -% -What's another word for "thesaurus"? - -- Steven Wright -% -What's done to children, they will do to society. -% -What's page one, a preemptive strike? - -- Professor Freund, Communication, Ramapo State College -% -What's so funny? -% -What's the matter with the world? Why, there ain't but one thing wrong -with every one of us - and that's "selfishness." - -- The Best of Will Rogers -% -What's the ugliest part of your body? -What's the ugliest part of your body? -Some say your nose, -Some say your toes, -But I think it's your mind. - -- Frank Zappa, 1965 -% -What's the use of a good quotation if you can't change it? - -- The Doctor, "Doctor Who" -% -What's this stuff about people being "released on their -own recognizance"? Aren't we all out on own recognizance? -% -When a Banker jumps out of a window, -jump after him -- that's where the money is. - -- Robespierre -% -When a camel flies, no one laughs if it doesn't get very far! -% -When a cow laughs, does milk come out of its nose? -% -When a fellow says, "It ain't the money but -the principle of the thing," it's the money. - -- Kin Hubbard -% -When a fly lands on the ceiling, does it do a half roll or a half -loop? -% -When a girl can read the handwriting on -the wall, she may be in the wrong rest room. -% -When a girl marries she exchanges the attentions of many men for the -inattentions of one. - -- Helen Rowland -% -When a lion meets another with a louder roar, -the first lion thinks the last a bore. - -- George Bernard Shaw -% -When a lot of remedies are suggested for -a disease, that means it can't be cured. - -- Chekhov, "The Cherry Orchard" -% -When a man assumes a public trust, he -should consider himself as public property. - -- Thomas Jefferson -% -When a man is tired of London, he is tired of life. - -- Samuel Johnson -% -When a man knows he is to be hanged in a fortnight, -it concentrates his mind wonderfully. - -- Samuel Johnson -% -When a man steals your wife, there is no better revenge than to let him -keep her. - -- Sacha Guitry -% -When a man you like switches from what he said a year ago, or four years -ago, he is a broad-minded man who has courage enough to change his mind -with changing conditions. When a man you don't like does it, he is a -liar who has broken his promises. - -- Franklin Adams -% -When a person goes on a diet, the first thing he loses is his temper. -% -When a place gets crowded enough to require ID's, social collapse is not -far away. It is time to go elsewhere. The best thing about space travel -is that it made it possible to go elsewhere. - -- Robert A. Heinlein, "Time Enough For Love" -% -When a shepherd goes to kill a wolf, and takes his dog along to see -the sport, he should take care to avoid mistakes. The dog has certain -relationships to the wolf the shepherd may have forgotten. - -- Robert Pirsig, "Zen and the Art of Motorcycle Maintenance" -% -When a woman gives me a present I have always two surprises: -first is the present, and afterward, having to pay for it. - -- Donnay -% -When a woman marries again it is because she detested her first husband. -When a man marries again, it is because he adored his first wife. - -- Wilde -% -When alerted to an intrusion by tinkling glass or otherwise, 1) Calm -yourself 2) Identify the intruder 3) If hostile, kill him. - -Step number 3 is of particular importance. If you leave the guy alive -out of misguided softheartedness, he will repay your generosity of spirit -by suing you for causing his subsequent paraplegia and seek to force you -to support him for the rest of his rotten life. In court he will plead -that he was depressed because society had failed him, and that he was -looking for Mother Teresa for comfort and to offer his services to the -poor. In that lawsuit, you will lose. If, on the other hand, you kill -him, the most that you can expect is that a relative will bring a wrongful -death action. You will have two advantages: first, there be only your -story; forget Mother Teresa. Second, even if you lose, how much could -the bum's life be worth anyway? A lot less than 50 years worth of -paralysis. Don't play George Bush and Saddam Hussein. Finish the job. - -- G. Gordon Liddy's Forbes column on personal security -% -When Alexander Graham Bell died in 1922, the telephone people -interrupted service for one minute in his honor. They've been -honoring him intermittently ever since, I believe. - -- The Grab Bag -% -When all else fails, EAT!!! -% -When all else fails, pour a pint of Guinness in the gas tank, advance -the spark 20 degrees, cry "God Save the Queen!", and pull the starter -knob. - -- MG "Series MGA" Workshop Manual -% -When all else fails, try Kate Smith. -% -When all other means of communication fail, try words. -% -When among apes, one must play the ape. -% -When angry, count four; when very angry, swear. - -- Mark Twain -% -When are you BUTTHEADS gonna learn that you can't oppose Gestapo -tactics *with* Gestapo tactics? - -- Reuben Flagg -% -When arguments fail, use a blackjack. - -- Edward "Spike" O'Donnell, Al Capone associate -% -When asked by an anthropologist what the Indians called America before -the white men came, an Indian said simply "Ours." - -- Vine Deloria, Jr. -% -When asked the definition of "pi": -The Mathematician: - Pi is the number expressing the relationship between the - circumference of a circle and its diameter. -The Physicist: - Pi is 3.1415927, plus or minus 0.000000005. -The Engineer: - Pi is about 3. -% -When Boy Scouts do it, it's intense. -% -When childhood dies, its corpses are called adults. - -- Brian Aldiss -% -When choosing between two evils, I always -like to take the one I've never tried before. - -- Mae West, "Klondike Annie" -% -When confronted by a difficult problem, you can often solve it quite -easily by reducing it to the question, "How would the Lone Ranger -handle this?" -% -When Cthulhu calls, He calls collect! -% -When democracy granted democratic methods to us in times of opposition, this -was bound to happen in a democratic system. However, we National Socialists -never asserted that we represented a democratic point of view, but we have -declared openly that we used the democratic methods only to gain power and -that, after assuming the power, we would deny to our adversaries without any -consideration the means which were granted to us in times of our opposition. - -- Josef Goebbels -% -When Dexter's on the Internet, can Hell be far behind? -% -When does later become never? -% -When does summertime come to Minnesota, you ask? -Well, last year, I think it was a Tuesday. -% -When eating an elephant take one bite at a time. - -- Gen. C. Abrams -% -When forecasting, give them a number -or give them a date, but never both. -% -When God endowed human beings with brains, -He did not intend to guarantee them. -% -When God saw how faulty was man He tried again and made woman. As to -why he then stopped there are two opinions. One of them is woman's. - -- DeGourmont -% -When he got in trouble in the ring, [Ali] imagined a door swung open and -inside he could see neon, orange, and green lights blinking, and bats -blowing trumpets and alligators blowing trombones, and he could hear snakes -screaming. Weird masks and actors' clothes hung on the wall, and if he -stepped across the sill and reached for them, he knew that he was committing -himself to destruction. - -- George Plimpton -% -When I came back to Dublin I was courtmartialed in my absence and sentenced -to death in my absence, so I said they could shoot me in my absence. - -- Brendan Behan -% -When I demanded of my friend what viands he preferred, -He quoth: "A large cold bottle, and a small hot bird!" - -- Eugene Field, "The Bottle and the Bird" -% -when i die, i'd like to go peacefully. -in my sleep. -like my grandfather. - -not screaming, -like the passengers in his car... -% -When I first arrived in this country I had only fifteen cents in my pocket -and a willingness to compromise. - -- Weber cartoon caption -% -When I get real bored, I like to drive downtown and get a great parking spot, -then sit in my car and count how many people ask me if I'm leaving. - -- Steven Wright -% -When I grow up, I want to be an honest -lawyer so things like that can't happen. - -- Richard M. Nixon, as a boy, on the Teapot Dome scandal -% -When I have one foot in the grave I will tell the truth about women. I -shall tell it, jump into my coffin, pull the lid over me, and say, "Do -what you like now." - -- Tolstoy -% -When I hear a man applauded by the mob I always feel a pang of pity -for him. All he has to do to be hissed is to live long enough. - -- H. L. Mencken, "Minority Report" -% -When I heated my home with oil, I used an average of 800 gallons a -year. I have found that I can keep comfortably warm for an entire -winter with slightly over half that quantity of beer. - -- Dave Barry, "Postpetroleum Guzzler" -% -When I kill, the only thing I feel is recoil. -% -When I look at the horse heads and men's faces, the immense -live torrent once raised by my will and now whirling to -nowhere through the red sunset desert, I often wonder where -I am in this torrent. - -- Chinggis (Genghis) Khan -% -When I said "we", officer, I was referring to -myself, the four young ladies, and, of course, the goat. -% -When I saw a sign on the freeway that said, "Los Angeles 445 miles," I said -to myself, "I've got to get out of this lane." - -- Franklyn Ajaye -% -When I say the magic word to all these people, they will vanish forever. -I will then say the magic words to you, and you, too, will vanish -- never -to be seen again. - -- Kurt Vonnegut, Jr., "Between Time and Timbuktu" -% -When I sell liquor, it's called bootlegging; when my patrons serve -it on silver trays on Lake Shore Drive, it's called hospitality. - -- Al Capone -% -When I think about myself, -I almost laugh myself to death, -My life has been one great big joke, Sixty years in these folks' world -A dance that's walked The child I works for calls me girl -A song that's spoke, I say "Yes ma'am" for working's sake. -I laugh so hard I almost choke Too proud to bend -When I think about myself. Too poor to break, - I laugh until my stomach ache, - When I think about myself. -My folks can make me split my side, -I laughed so hard I nearly died, -The tales they tell, sound just like lying, -They grow the fruit, -But eat the rind, -I laugh until I start to crying, -When I think about my folks. - -- Maya Angelou -% -When I was 16, I thought there was no hope for my father. -By the time I was 20, he had made great improvement. -% -When I was a boy I was told that anyone could become President. -Now I'm beginning to believe it. - -- Clarence Darrow -% -When I was a child... We had a quick-sand box in the backyard... -I was an only child... eventually. - -- Steven Wright -% -When I was a kid I said to my father one afternoon, "Daddy, will you -take me to the zoo?" He answered, "If the zoo wants you let them come -and get you." - -- Jerry Lewis -% -When I was a kid my favorite relative was Uncle Caveman. After school we'd -all go play in his cave, and every once in a while he would eat one of us. -It wasn't until later that I found out that Uncle Caveman was a bear. - -- Jack Handey -% -When I was a young man, I vowed never to marry until I found the ideal -woman. Well, I found her -- but alas, she was waiting for the ideal man. - -- Robert Schuman -% -When I was crossing the border into Canada, they asked if -I had any firearms with me. I said, "Well, what do you need?" - -- Steven Wright -% -When I was growing up my mother kept telling me we're just friends. - -I tell ya I was an ugly kid. I was so ugly that my Dad kept the kid's -picture that came with the wallet he bought. - -- Rodney Dangerfield -% -When I was in college, there were a lot of four-letter words you couldn't -say in front of girls. Now you can say them. But you can't say "girls". -% -When I was in school, I cheated on my metaphysics exam: -I looked into the soul of the boy sitting next to me. - -- Woody Allen -% -When I was little, I went into a pet shop and they asked how big I'd get. - -- Rodney Dangerfield -% -When I was seven years old, I was once reprimanded by my mother for an act -of collective brutality in which I had been involved at school. A group of -seven-year-olds had been teasing and tormenting a six-year-old. "It is -always so," my mother said. "You do things together which not one of you -would think of doing alone." ... Wherever one looks in the world of human -organization, collective responsibility brings a lowering of moral standards. -The military establishment is an extreme case, an organization which seems -to have been expressly designed to make it possible for people to do things -together which nobody in his right mind would do alone. - -- Freeman Dyson, "Weapons and Hope" -% -When I was young we didn't have MTV; we -had to take drugs and go to concerts. - -- Steven Pearl -% -When I was younger, I could remember anything, whether it had happened -or not; but my faculties are decaying now and soon I shall be so I cannot -remember any but the things that never happened. It is sad to go to -pieces like this but we all have to do it. - -- Mark Twain -% -When I woke up this morning, my girlfriend asked if I had -slept well. I said, "No, I made a few mistakes." - -- Steven Wright -% -When I works, I works hard. -When I sits, I sits easy. -And when I thinks, I goes to sleep. -% -When I'm gone, boxing will be nothing again. The fans with the cigars and -the hats turned down'll be there, but no more housewives and little men in -the street and foreign presidents. It's goin' to be back to the fighter who -comes to town, smells a flower, visits a hospital, blows a horn and says -he's in shape. Old hat. I was the onliest boxer in history people asked -questions like a senator. - -- Muhammad Ali -% -When I'm good, I'm great; but when I'm bad, I'm better. - -- Mae West -% -When in charge ponder, -When in doubt mumble, -When in trouble delegate. -% -When in doubt, do it. It's much easier -to apologize than to get permission. - -- Grace Murray Hopper -% -When in doubt, do what the President does -- guess. -% -When in doubt, follow your heart. -% -When in doubt, have a man come through the door with a gun in his hand. - -- Raymond Chandler -% -When in doubt, lead trump. -% -When in doubt, mumble; when in trouble, delegate; when in charge, ponder. - -- James H. Boren -% -When in doubt, tell the truth. - -- Mark Twain -% -When in doubt, use brute force. - -- Ken Thompson -% -When in panic, fear and doubt, -Drink in barrels, eat, and shout. -% -When in this world the headlines read -Of those whose hearts are filled with greed -Who rob and steal from those who need -The cry goes up with blinding speed for Underdog (UNDERDOG!) -Underdog (UNDERDOG!) -Speed of lightning, roar of thunder -Fighting all who rob or plunder -Underdog (ah-ah-ah-ah) -Underdog -UNDERDOG! -% -When in trouble or in doubt, run in circles, scream and shout. -% -When it comes to broken marriages most husbands will split the blame -- -half his wife's fault, and half her mother's. -% -When it comes to helping you, some people stop at nothing. -% -When it is not necessary to make a decision, -it is necessary not to make a decision. -% -When it's dark enough you can see the stars. - -- Ralph Waldo Emerson -% -When license fees are too high, -users do things by hand. -When the management is too intrusive, -users lose their spirit. - -Hack for the user's benefit. -Trust them; leave them alone. -% -When love is gone, there's always justice. -And when justice is gone, there's always force. -And when force is gone, there's always Mom. -Hi, Mom! - -- Laurie Anderson -% -When man calls an animal "vicious", he usually means that it -will attempt to defend itself when he tries to kill it. -% -When Marriage is Outlawed, -Only Outlaws will have Inlaws. -% -When more and more people are thrown out of work, unemployment results. - -- Calvin Coolidge -% -When my brain begins to reel from my -literary labors, I make an occasional cheese dip. - -- Ignatius Reilly -% -When my fist clenches crack it open, -Before I use it and lose my cool. -When I smile tell me some bad news, -Before I laugh and act like a fool. - -And if I swallow anything evil, -Put you finger down my throat. -And if I shiver please give me a blanket, -Keep me warm let me wear your coat - -No one knows what it's like to be the bad man, - to be the sad man. -Behind blue eyes. -No one knows what its like to be hated, - to be fated, -To telling only lies. - -- The Who, "Behind Blue Eyes" -% -When my freshman roommate at Cornell found out I was Jewish, she was, -at her request, moved to a different room. She told me she didn't -think she had ever seen a Jew before. My only response was to begin -wearing a small Star of David on a chain around my neck. I had not -become a more observing Jew; rather, discovering that the label of -Jew was offensive to others made me want to let people know who I -was and what I believed in. Similarly, after talking to these young -women -- one of whom told me that she didn't think she had ever met -a feminist -- I've taken to identifying myself as a feminist in the -most unlikely of situations. - -- Susan Bolotin, "Voices From the Post-Feminist Generation" -% -When neither their poverty nor their honor is -touched, the majority of men live content. - -- Niccolo Machiavelli -% -When nothing can possibly go wrong, it will. -% -When one burns one's bridges, what a very nice fire it makes. - -- Dylan Thomas -% -When one knows women one pities men, -but when one studies men, one excuses women. - -- Horne Tooke -% -When one wants to get rid of an unsupportable pressure, one needs hashish. - -- Friedrich Nietzsche -% -When one woman was asked how long she had been going to symphony concerts, -she paused to calculate and replied, "Forty-seven years -- and I find I mind -it less and less." - -- Louise Andrews Kent -% -When operating the diopter adjustment knob with your eye to the view- -finder, be careful not to put your fingers or fingernails in your eye. - -- found in the users manual of the Nikon D2x camera, - a camera for professional photographers -% -When Oxygen Tech played Hydrogen U. -The Game had just begun, when Hydrogen scored two fast points -And Oxygen still had none -Then Oxygen scored a single goal -And thus it did remain, At Hydrogen 2 and Oxygen 1 -Called because of rain. -% -When people have trouble communicating, -the least they can do is to shut up. - -- Tom Lehrer -% -When people say nothing, they don't necessarily mean nothing. -% -When pleasure remains, does it remain a pleasure? -% -When President Paul Doumer of France was assassinated in Paris in 1932, -newspapers differed in their versions of the event. This is from "Paris -was Yesterday: 1925-1939" by Janet Flanner, edited by Irving Drutman. - - Taste varied as to his cry when he was shot down, the more popular - papers preferring his despairing "Oh, la la!," the graver dailies - favoring "Is it possible?" What few reported were his dying words: - "But what kind of chauffeur was it?" Having been told by his aides - not that he had been shot but that he had been struck by a taxi, the - President spent the last conscious moments of his life wondering how - an automobile got into the charity book sale at the Maison - Rothschild, where his assassination occurred. -% -When properly administered, vacations do not diminish productivity: for -every week you're away and get nothing done, there's another when your boss -is away and you get twice as much done. - -- Daniel B. Luten -% -When smashing monuments, save the pedestals -- they always come in handy. - -- Stanislaw J. Lec, "Unkempt Thoughts" -% -When some people decide it's time for everyone to make -big changes, it means that they want you to change first. -% -When some people discover the truth, they just -can't understand why everybody isn't eager to hear it. -% -When someone makes a move We'll send them all we've got, -Of which we don't approve, John Wayne and Randolph Scott, -Who is it that always intervenes? Remember those exciting fighting scenes? -U.N. and O.A.S., To the shores of Tripoli, -They have their place, I guess, But not to Mississippoli, -But first, send the Marines! What do we do? We send the Marines! - -For might makes right, Members of the corps -And till they've seen the light, All hate the thought of war: -They've got to be protected, They'd rather kill them off by - peaceful means. -All their rights respected, Stop calling it aggression-- -Till somebody we like can be elected. We hate that expression! - We only want the world to know - That we support the status quo; - They love us everywhere we go, - So when in doubt, send the Marines! - -- Tom Lehrer, "Send The Marines" -% -When someone says "I want a programming language in -which I need only say what I wish done," give him a lollipop. -% -When speculation has done its worst, two plus two still equals four. - -- S. Johnson -% -When taxes are due, Americans tend to feel quite bled-white and blue. -% -When the Apple IIc was introduced, the informative copy led off with a couple -of asterisked sentences: - - It weighs less than 8 pounds.* - And costs less than $1,300.** - -In tiny type were these "fuller explanations": - - * Don't asterisks make you suspicious as all get out? Well, all - this means is that the IIc alone weights 7.5 pounds. The power - pack, monitor, an extra disk drive, a printer and several bricks - will make the IIc weigh more. Our lawyers were concerned that you - might not be able to figure this out for yourself. - - ** The FTC is concerned about price fixing. You can pay more if - you really want to. Or less. - -- Forbes -% -When the ax entered the forest, the trees said, "The handle is one of us!" - -- Turkish proverb -% -When the blind lead the blind they will both fall over the cliff. - -- Chinese proverb -% -When the bosses talk about improving productivity, they are never talking -about themselves. -% -When the cup is full, carry it level. -% -When the doubt vanishes and the issue becomes evident, stupidity reigns. - -- Poul Henningsen (1894-1967) -% -When the English language gets in my way, I walk over it. - -- Billy Sunday -% -When the fog came in on little cat feet last night, it left these little -muddy paw prints on the hood of my car. -% -When the going gets tough, the tough get empirical. - -- Jon Carroll -% -When the going gets tough, the tough go grab a beer. -% -When the going gets tough, the tough go shopping. -% -When the going gets weird, the weird turn pro. - -- Hunter S. Thompson -% -When the government bureau's remedies do not match -your problem, you modify the problem, not the remedy. -% -When the Guru administers, the users -are hardly aware that he exists. -Next best is a sysop who is loved. -Next, one who is feared. -And worst, one who is despised. - -If you don't trust the users, -you make them untrustworthy. - -The Guru doesn't talk, he hacks. -When his work is done, -the users say, "Amazing: -we implemented it, all by ourselves!" -% -When the leaders speak of peace -The common folk know -That war is coming -When the leaders curse war -The mobilization order is already written out. - -Every day, to earn my daily bread -I go to the market where lies are bought -Hopefully -I take my place among the sellers. - -- Bertolt Brecht, "Hollywood" -% -When the Ngdanga tribe of West Africa hold their moon love ceremonies, -the men of the tribe bang their heads on sacred trees until they get a -nose bleed, which usually cures them of _t_h_a_t. - -- Mike Harding, "The Armchair Anarchist's Almanac" -% -When the only tool you have is a hammer, every problem starts to look -like a nail. -% -When the President does it, that means it is not illegal. - -- Richard M. Nixon -% -When the revolution comes, count your change. -% -When the salesman's car broke down, he walked to the nearest farmhouse to ask -if he could stay the night. The farmer agreed to put him up. "I live alone," -he continued, "you can have the bedroom at the top of the stairs, to the -right." - "Oh, never mind," the disappointed salesman said. "I think I'm in -the wrong joke." -% -When the speaker and he to whom he is speaking do not understand, that is -metaphysics. - -- Voltaire -% -When the sun shineth, make hay. - -- John Heywood -% -When the Universe was not so out of whack as it is today, and all the -stars were lined up in their proper places, you could easily count them -from left to right, or top to bottom, and the larger and bluer ones -were set apart, and the smaller yellowing types pushed off to the -corners as bodies of a lower grade ... - -- Stanislaw Lem, "Cyberiad" -% -When the usher noticed a man stretched across three seats in a movie theatre, -he walked over and whispered, "I'm sorry, sir, but you're allowed only a single -seat." The man moaned, but did not budge. "Sir," the user said more loudly, -"if you don't move, I'll have to call a manager." The man moaned again but -stayed where he was. The usher left, and returned with the manager, who, after -several more attempts at dislodging the fellow, called the police. - The cop took a look at the reclining man and said, "All right, boyo, -what's your name?" - "Samuel," he mumbled. - "And where're you from, Sam?" - "The balcony." -% -When the weight of the paperwork equals the weight of the plane, the -plane will fly. - -- Donald Douglas -% -When the wind is great, bow before it; -when the wind is heavy, yield to it. -% -When there are two conflicting versions of the story, the wise course -is to believe the one in which people appear at their worst. - -- H. Allen Smith, "Let the Crabgrass Grow" -% -When there is an old maid in the house, a watch dog is unnecessary. - -- Honore de Balzac -% -When things go well, expect something to -explode, erode, collapse or just disappear. -% -When two people are under the influence of the most violent, most -insane, most delusive, and most transient of passions, they are -required to swear that they will remain in that excited, abnormal, and -exhausting condition continuously until death do them part. - -- George Bernard Shaw -% -When users see one GUI as beautiful, -other user interfaces become ugly. -When users see some programs as winners, -other programs become lossage. - -Pointers and NULLs reference each other. -High level and assembler depend on each other. -Double and float cast to each other. -High-endian and low-endian define each other. -While and until follow each other. - -Therefore the Guru -programs without doing anything -and teaches without saying anything. -Warnings arise and he lets them come; -processes are swapped and he lets them go. -He has but doesn't possess, -acts but doesn't expect. -When his work is done, he deletes it. -That is why it lasts forever. -% -When we are planning for posterity, -we ought to remember that virtue is not hereditary. - -- Thomas Paine -% -When we jumped into Sicily, the units became separated, and I couldn't find -anyone. Eventually I stumbled across two colonels, a major, three captains, -two lieutenants, and one rifleman, and we secured the bridge. Never in the -history of war have so few been led by so many. - -- General James Gavin -% -When we talk of tomorrow, the gods laugh. -% -When we understand knowledge-based systems, it will be as before -- -except our fingertips will have been singed. - -- Epigrams in Programming, ACM SIGPLAN Sept. 1982 -% -When we write programs that "learn", -it turns out we do and they don't. -% -When women kiss it always reminds one of prize fighters shaking hands. - -- H. L. Mencken, "Sententiae" -% -When women love us, they forgive us everything, even our crimes; -when they do not love us, they give us credit for nothing, not -even our virtues. - -- Honore de Balzac -% -When you are about to die, a wombat is better than no company at all. - -- Roger Zelazny, "Doorways in the Sand" -% -When you are about to do an objective and scientific piece of investigation -of a topic, it is well to have the answer firmly in hand, so that you can -proceed forthrightly, without being deflected or swayed, directly to the -goal. - -- Amrom Katz -% -When you are at Rome live in the Roman style; -when you are elsewhere live as they live elsewhere. - -- St. Ambrose -% -When you are in it up to your ears, keep your mouth shut. -% -When you are working hard, get up and retch every so often. -% -When you are young, you enjoy a sustained illusion that sooner or later -something marvelous is going to happen, that you are going to transcend -your parents' limitations... At the same time, you feel sure that in all -the wilderness of possibility; in all the forests of opinion, there is a -vital something that can be known -- known and grasped. That we will -eventually know it, and convert the whole mystery into a coherent -narrative. So that then one's true life -- the point of everything -- -will emerge from the mist into a pure light, into total comprehension. -But it isn't like that at all. But if it isn't, where did the idea come -from, to torture and unsettle us? - -- Brian Aldiss, "Helliconia Summer" -% -When you become used to never being alone, -you may consider yourself Americanized. -% -When you dial a wrong number you never get a busy signal. -% -When you die, you lose a very important part of your life. - -- Brooke Shields -% -When you dig another out of trouble, -you've got a place to bury your own. -% -When you don't know what to do, walk fast and look worried. -% -When you don't know what you are doing, do it neatly. -% -When you find yourself in danger, -When you're threatened by a stranger, -When it looks like you will take a lickin'... - -There is one thing you should learn, -When there is no one else to turn to, - Caaaall for Super Chicken!! (**bwuck-bwuck-bwuck-bwuck**) - Caaaall for Super Chicken!! -% -When you get what you want in your struggle for pelf, -And the world makes you King for a day, -Then go to the mirror and look at yourself, -And see what that guy has to say. - For it isn't your Father, or Mother, or Wife, - Who judgement upon you must pass. - The feller whose verdict counts most in your life - Is the guy staring back from the glass. -He's the feller to please, never mind all the rest, -For he's with you clear up to the end, -And you've passed your most dangerous, difficult test -If the guy in the glass is your friend. - You may be like Jack Horner and "chisel" a plum, - And think you're a wonderful guy, - But the man in the glass says you're only a bum - If you can't look him straight in the eye. -You can fool the whole world down the pathway of years, -And get pats on the back as you pass, -But your final reward will be heartaches and tears -If you've cheated the guy in the glass. - -- "The Guy in the Glass" - Copyright 1934, Dale Wimbrow (1895-1954) - [Pelf is a Middle English word for wealth or riches, - especially when acquired dishonestly. Ed.] -% -When you go into court you are putting your fate into the hands of twelve -people who weren't smart enough to get out of jury duty. - -- Norm Crosby -% -When you go out to buy, don't show your silver. -% -When you have an efficient government, you have a dictatorship. - -- Harry S. Truman -% -When you have eliminated the impossible, whatever -remains, however improbable, must be the truth. - -- Sherlock Holmes, "The Sign of Four" -% -When you have shot and killed a man you have in some measure -clarified your attitude toward him. You have given a definite -answer to a definite problem. For better or worse you have -acted decisively. In a way, the next move is up to him. - -- R. A. Lafferty -% -When you have to kill a man it costs nothing to be polite. - -- Winston Churchill, on formal declarations of war -% -When you jump for joy, beware that no-one -moves the ground from beneath your feet. - -- Stanislaw J. Lec, "Unkempt Thoughts" -% -When you know absolutely nothing about the topic, make your forecast by -asking a carefully selected probability sample of 300 others who don't -know the answer either. - -- Edgar R. Fiedler -% -When you live in a sick society, -just about everything you do is wrong. -% -When you make your mark in the world, -watch out for guys with erasers. - -- The Wall Street Journal -% -When you meet a master swordsman, -show him your sword. -When you meet a man who is not a poet, -do not show him your poem. - -- Rinzai, ninth century Zen master -% -When you overesteem great hackers, -more users become cretins. -When you develop encryption, -more users become crackers. - -The Guru leads -by emptying user's minds -and increasing their quotas, -by weakening their ambition -and toughening their resolve. -When users lack knowledge and desire, -management will not try to interfere. - -Practice not-looping, -and everything will fall into place. -% -When you say that you agree to a thing in principle, you mean that -you have not the slightest intention of carrying it out in practice. - -- Otto von Bismarck -% -When you speak to others for their own good it's advice; -when they speak to you for your own good it's interference. -% -When you try to make an impression, the -chances are that is the impression you will make. -% -When you were born, a big chance was taken for you. -% -When your conscious becomes unconscious, you are drunk. -When your unconscious becomes conscious, you are stoned. -% -When your life is a leaf that the seasons tear off and condemn -They will bind you with love that is graceful and green as a stem. - -- Leonard Cohen, "Sisters of Mercy" -% -When your memory goes, forget it! -% -When your work speaks for itself, don't interrupt. - -- Henry J. Kaiser -% -When you're a Yup -You're a Yup all the way -From your first slice of Brie -To your last Cabernet. - -When you're a Yup -You're not just a dreamer -You're making things happen -You're driving a Beamer. -% -When you're away, I'm restless, lonely -Wretched, bored, dejected, only -Here's the rub, my darling dear, -I feel the same when you are near. - -- Samuel Hoffenstein, "Poems in Praise of Practically Nothing" -% -When you're bored with yourself, marry, and be bored with someone else. - -- David Pryce-Jones -% -When you're dining out and you suspect -something's wrong, you're probably right. -% -When you're down and out, lift up your -voice and shout, "I'M DOWN AND OUT"! -% -When you're in command, command. - -- Admiral Nimitz -% -When you're married to someone, they take you for granted ... when -you're living with someone it's fantastic ... they're so frightened -of losing you they've got to keep you satisfied all the time. - -- Nell Dunn, "Poor Cow" -% -When you're not looking at it, this fortune is written in FORTRAN. -% -When you're ready to give up the struggle, who can you surrender to? -% -WHEN YOU'RE RIDING IN A TIME MACHINE way far into the future, don't stick -your elbow out the window or it'll turn into a fossil. - -- Jack Handey, "The New Mexican" (1988) -% -WHENEVER ANYBODY SAYS he's struggling to become a human being I have to -laugh because the apes beat him to it by about a million years. Struggle -to become a parrot or something. - -- Jack Handey, "The New Mexican" (1988) -% -Whenever anyone says, "theoretically," they really mean "not really". - -- Dave Parnas -% -Whenever I date a guy, I think, is this the man I want my children -to spend their weekends with? - -- Rita Rudner -% -Whenever I feel like exercise, I lie down until the feeling passes. -% -Whenever I hear anyone arguing for slavery, I feel -a strong impulse to see it tried on him personally. - -- Abraham Lincoln -% -Whenever I see an old lady slip and fall on a wet sidewalk, my first instinct -is to laugh. But then I think, what if I was an ant, and she fell on me. -Then it wouldn't seem quite so funny. - -- Jack Handey -% -Whenever people agree with me I always feel I must be wrong. - -- Oscar Wilde -% -Whenever Richard Cory went downtown, - We people on the pavement looked at him: -He was a gentleman from sole to crown, - Clean-favored, and imperially slim. -And he was always quietly arrayed, - And he was always human when he talked; -But still he fluttered pulses when he said, - "Good morning," and he glittered when he walked. -And he was rich -- yes, richer than a king -- - And admirably schooled in every grace: -In fine, we thought that he was everything - To make us wish that we were in his place. -So on we worked, and waited for the light, - And went without the meat, and cursed the bread; -And Richard Cory, one calm summer night, - Went home and put a bullet through his head. - -- E. A. Robinson, "Richard Cory" -% -Whenever someone tells you to take their advice, -you can be pretty sure that they're not using it. -% -Whenever the literary German dives into a sentence, that is the last -you are going to see of him until he emerges on the other side of his -Atlantic with his verb in his mouth. - -- Mark Twain - "Connecticut Yankee in King Arthur's Court" -% -Whenever you find that you are on the -side of the majority, it is time to reform. - -- Mark Twain -% -Where a calculator on the ENIAC is equipped with 18,000 vacuum tubes and -weighs 30 tons, computers in the future may have only 1,000 vacuum tubes -and perhaps weigh 1 1/2 tons. - -- Popular Mechanics, March 1949 -% -Where am I? Who am I? Am I? I -% -Where am I, and what am I doing in this handbasket? - -- Mark A. Matthews, to Wes Peters, circa 1996 -% -Where are the calculations that go with a calculated risk? -% -WHERE CAN THE MATTER BE - Oh, dear, where can the matter be - When it's converted to energy? - There is a slight loss of parity. - Johnny's so long at the fair. -% -Where do I find the time for not reading so many books? - -- Karl Kraus -% -Where do you go to get anorexia? - -- Shelley Winters -% -Where humor is concerned there are no standards -- no one can say what -is good or bad, although you can be sure that everyone will. - -- John Kenneth Galbraith -% -Where is John Carson now that we need him? - -- RLG -% -Where it is a duty to worship the sun it is pretty sure to be a crime to -examine the laws of heat. - -- Christopher Morley -% -Where, oh, where, are you tonight? -Why did you leave me here all alone? -I searched the world over, and I thought I'd found true love. -You met another, and *PPHHHLLLBBBBTTT*, you wuz gone. - -Gloom, despair and agony on me. -Deep dark depression, excessive misery. -If it weren't for bad luck, I'd have no luck at all. -Oh, gloom, despair and agony on me. - -- Hee Haw -% -Where the hell is Wall Drug? -% -Where the system is concerned, you're not allowed to ask "Why?". -% -Where there are visible vapors, having their prevenance -in ignited carbonaceous materials, there is conflagration. -% -Where there is much light there is also much shadow. - -- Johann Wolfgang von Goethe -% -Where there's a whip there's a way. -% -Where there's a will, there's a relative. -% -Where there's a will, there's an Inheritance Tax. -% -Where will it all end? -Probably somewhere near where it all began. -% -Where you stand depends on where you sit. - -- Rufus Miles, HEW -% -Whereof one cannot speak, thereof one must be silent. - -- Wittgenstein -% -Where's the man could ease a heart -Like a satin gown? - -- Dorothy Parker, "The Satin Dress" -% -...whether it is better to spend a life not knowing what you want or to -spend a life knowing exactly what you want and that you will never have it. - -- Richard Shelton -% -Whether weary or unweary, O man, do not rest, -Do not cease your single-handed struggle. -Go on, do not rest. - -- An old Gujarati hymn -% -Whether you can hear it or not -The Universe is laughing behind your back - -- National Lampoon, "Deteriorata" -% -Which is worse: ignorance or apathy? Who knows? Who cares? -% -Which would you rather have, a bursting -planet or an earthquake here and there? - -- John Joseph Lynch -% -While anyone can admit to themselves they were -wrong, the true test is admission to someone else. -% -While Europe's eye is fix'd on mighty things, -The fate of empires and the fall of kings; -While quacks of State must each produce his plan, -And even children lisp the Rights of Man; -Amid this mighty fuss just let me mention, -The Rights of Woman merit some attention. - -- Robert Burns, Address on "The Rights of Woman", - November 26, 1792 -% -While having never invented a sin, -I'm trying to perfect several. -% -While he was in New York on location for _Bronco Billy_ (1980), Clint -Eastwood agreed to a television interview. His host, somewhat hostile, -began by defining a Clint Eastwood picture as a violent, ruthless, -lawless, and bloody piece of mayhem, and then asked Eastwood himself to -define a Clint Eastwood picture. "To me," said Eastwood calmly, "what -a Clint Eastwood picture is, is one that I'm in." - -- Boller and Davis, "Hollywood Anecdotes" -% -While I nodded, nearly napping, suddenly there came a tapping, -As of some one gently rapping, rapping at my chamber door. - -- Edgar Allan Poe, "The Raven" - - [Quoted in "VMS Internals and Data Structures", V4.4, when - referring to hardware interrupts.] - -And now I see with eye serene -The very pulse of the machine. - -- William Wordsworth, "She Was a Phantom of Delight" - - [Quoted in "VMS Internals and Data Structures", V4.4, when - referring to software interrupts.] -% -While it may be true that a watched pot never boils, the one you don't -keep an eye on can make an awful mess of your stove. - -- Edward Stevenson -% -While money can't buy happiness, it certainly -lets you choose your own form of misery. -% -While most peoples' opinions change, -the conviction of their correctness never does. -% -While passing a vacant lot late one night, a jogger was stopped by a man who -held a gun to his head. - "Who are you for," the gunman snarled, "Bush or Dukakis?" - The runner thought for a moment, shifting nervously from foot to foot, -as the muzzle pressed harder into his temple. - "Bush or Dukakis?" the mugger insisted. - Finally, the jogger shrugged his shoulders, closed his eyes and bowed -his head. "Go ahead and shoot." -% -While there's life, there's hope. - -- Publius Terentius Afer (Terence) -% -While walking down a crowded -City street the other day, -I heard a little urchin -To a comrade turn and say, -"Say, Chimmey, lemme tell youse, -I'd be happy as a clam -If only I was de feller dat -Me mudder t'inks I am. - -"She t'inks I am a wonder, My friends, be yours a life of toil -An' she knows her little lad Or undiluted joy, -Could never mix wit' nuttin' You can learn a wholesome lesson -Dat was ugly, mean or bad. From that small, untutored boy. -Oh, lot o' times I sit and t'ink Don't aim to be an earthly saint -How nice, 'twould be, gee whiz! With eyes fixed on a star: -If a feller was de feller Just try to be the fellow that -Dat his mudder t'inks he is." Your mother thinks you are. - -- Will S. Adkin, "If I Only Was the Fellow" -% -While we are sleeping, two-thirds of the world is plotting to do us in. - -- Dean Rusk -% -While you don't greatly need the outside world, it's -still very reassuring to know that it's still there. -% -While you recently had your problems on the run, -they've regrouped and are making another attack. -% -While your friend holds you affectionately by both your hands you are -safe, for you can watch both of his. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Whip it, whip it good! -% -Whistler's Law: - You never know who is right, but you always know who is in charge. -% -Whistler's mother is off her rocker. -% -White dwarf seeks red giant for binary relationship. -% -Whitehead's Law: - The obvious answer is always overlooked. -% -White's Statement: - Don't lose heart! - -Owen's Commentary on White's Statement: - ...they might want to cut it out... - -Byrd's Addition to Owen's Commentary: - ...and they want to avoid a lengthy search. -% -Who are you? -% -Who can take the demands of the SDS seriously? - -- Nathan Pusey -% -Who cares if it doesn't do anything? It was made with -our new Triple-Iso-Bifurcated-Krypton-Gate-MOS process... -% -Who dat who say "who dat" when I say "who dat"? - -- Hattie McDaniel -% -Who does not love wine, women, and song, -Remains a fool his whole life long. - -- Johann Heinrich Voss -% -Who does not trust enough will not be trusted. - -- Lao Tsu -% -Who goeth a-borrowing goeth a-sorrowing. - -- Thomas Tusser -% -Who is D. B. Cooper, and where is he now? -% -Who is John Galt? -% -Who is W. O. Baker, and why is he saying those terrible things about me? -% -Who loves me will also love my dog. - -- John Donne -% -Who loves not wisely but too well -Will look on Helen's face in hell, -But he whose love is thin and wise -Will view John Knox in Paradise. - -- Dorothy Parker -% -Who made the world I cannot tell; -'Tis made, and here am I in hell. -My hand, though now my knuckles bleed, -I never soiled with such a deed. - -- A. E. Housman -% -Who messed with my anti-paranoia shot? -% -Who needs friends when you can sit alone in your room and drink? -% -Who on earth would eat a charred caterpillar!? -No, no, you SINGE 'em! You SINGE 'em and eat 'em! -% -Who the hell wants to hear actors talk? - -- Harry Warner, Warner Bros. Pictures, c. 1927 -% -Who to himself is law no law doth need, -offends no law, and is a king indeed. - -- George Chapman -% -Who took the MMMMMM out of MURINE? -% -Who was that masked man? -% -Who will take care of the world after you're gone? -% -Whoever dies with the most toys wins. -% -Whoever fights monsters should see to it that in the process he does not -become a monster. And when you look into an abyss, the abyss also looks -into you. - -- Friedrich Nietzsche -% -Whoever named it "necking" was a poor judge of anatomy. - -- Groucho Marx -% -Whoever tells a lie cannot be pure in heart -- and only the -pure in heart can make a good soup. - -- Ludwig van Beethoven -% -Whoever would lie usefully should lie seldom. -% -"Whom are you?" said he, for he had been to night school. - -- George Ade -% -Whom computers would destroy, they must first drive insane. -% -Whom the gods wish to destroy they first call promising. -% -Whom the mad would destroy, first they make Gods. - -- Bernard Levin -% -Who's on first? -% -Who's scruffy-looking? - -- Han Solo -% -Why a man would want a wife is a big mystery to some people. -Why a man would want *two* wives is a bigamystery. -% -Why am I so soft in the middle when the rest of my life is so hard? - -- Paul Simon -% -Why are programmers non-productive? -Because their time is wasted in meetings. - -Why are programmers rebellious? -Because the management interferes too much. - -Why are the programmers resigning one by one? -Because they are burnt out. - -Having worked for poor management, they no longer value their jobs. - -- Geoffrey James, "The Tao of Programming" -% -Why are we importing all these highbrow plays like "Amadeus?" I could -have told you Mozart was a jerk for nothing. - -- Ian Shoales -% -Why are you so hard to ignore? -% -Why are you watching -The washing machine? -I love entertainment -So long as it's clean. - -Professor Doberman: - While the preceding poem is unarguably a change from the guarded -pessimism of "The Hound of Heaven," it cannot be regarded as an unqualified -improvement. Obscurity is of value only when it tends to clarify the poetic -experience. As much as one is compelled to admire the poem's technique, one -must question whether its byplay of complex literary allusions does not in -fact distract from the unity of the whole. In the final analysis, one -receives the distinct impression that the poem's length could safely have -been reduced by a factor of eight or ten without sacrificing any of its -meaning. It is to be hoped that further publication of this poem can be -suspended pending a thorough investigation of its potential subversive -implications. -% -Why attack God? He may be as miserable as we are. - -- Erik Satie -% -Why be a man when you can be a success? - -- Bertolt Brecht -% -Why be difficult, when, with just a -little more effort, you can be impossible? -% -Why bother building anymore nuclear -warheads until we use the ones we have? -% -Why can't you be a non-conformist like everyone else? -% -Why did the Lord give us so much quickness of -movement unless it was to avoid responsibility with? -% -Why did the Roman Empire collapse? What is the Latin for office -automation? -% -Why do mathematicians insist on using words that already have another -meaning? "It is the complex case that is easier to deal with." "If it -doesn't happen at a corner, but at an edge, it nonetheless happens at a -corner." -% -Why do seagulls live near the sea? -'Cause if they lived near the bay, they'd be called baygulls. -% -Why do so many foods come packaged in plastic? -It's quite uncanny. -% -Why do they call a fast a fast, when it goes so slow? -% -Why do they call it baby-SITTING when all you do is run after them? -% -Why do we have two eyes? To watch 3-D movies with. -% -Why do we want intelligent terminals -when there are so many stupid users? -% -Why does a hearse horse snicker, hauling a lawyer away? - -- Carl Sandburg -% -Why does a ship carry cargo and a truck carry shipments? -% -Why does man kill? He kills for food. -And not only food: frequently there must be a beverage. - -- Woody Allen, "Without Feathers" -% -Why does New Jersey have more toxic waste dumps and California have -more lawyers? - -New Jersey had first choice. -% -Why doesn't everybody leave everybody else the hell alone? - -- Jimmy Durante -% -Why don't elephants eat penguins ? - -Because they can't get the wrappers off ... -% -Why don't somebody print the truth about our present economic condition? -We spent years of wild buying on credit, everything under the sun, whether -we needed it or not, and now we are having to pay for it, howling like a -pet coon. This would be a great world to dance in if we didn't have to -pay the fiddler. - -- The Best of Will Rogers -% -Why don't you fix your little problem... and light this candle? - -- Alan Shepard, the first American into space, Gemini program -% -Why, every one as they like; as the good woman said when she -kissed her cow. - -- Rabelais -% -Why I Can't Go Out With You: - -I'd LOVE to, but... - -- I have to answer all of my "occupant" letters. - -- None of my socks match. - -- I'm having all my plants neutered. - -- I changed the lock on my door and now I can't get out. - -- My yucca plant is feeling yucky. - -- I'm touring China with a wok band. - -- My chocolate-appreciation class meets that night. - -- I'm running off to Yugoslavia with a foreign-exchange student - named Basil Metabolism. - -- There are important world issues that need worrying about. - -- I'm going to count the bristles in my toothbrush. - -- I prefer to remain an enigma. - -- I think you want the OTHER Peggy/Cathy/Mike/whomever. - -- I feel a song coming on. -% -Why I Can't Go Out With You: - -I'd LOVE to, but... - -- I have to draw "Cubby" for an art scholarship. - -- I have to sit up with a sick ant. - -- I'm trying to be less popular. - -- My bathroom tiles need grouting. - -- I'm waiting to see if I'm already a winner. - -- My subconscious says no. - -- I just picked up a book called "Glue in Many Lands" and I - can't seem to put it down. - -- My favorite commercial is on TV. - -- I have to study for my blood test. - -- I've been traded to Cincinnati. - -- I'm having my baby shoes bronzed. - -- I have to go to court for kitty littering. -% -Why I Can't Go Out With You: - -I'd LOVE to, but... - -- I have to floss my cat. - -- I've dedicated my life to linguini. - -- I need to spend more time with my blender. - -- It wouldn't be fair to the other Beautiful People. - -- It's my night to pet the dog/ferret/goldfish/radio. - -- I'm going downtown to try on some gloves. - -- I have to check the freshness dates on my dairy products. - -- I'm due at the bakery to watch the buns rise. - -- I have an appointment with a cuticle specialist. - -- I have some really hard words to look up. -% -Why I Can't Go Out With You: - -I'd LOVE to, but... - -- I'm trying to see how long I can go without saying yes. - -- I'm attending the opening of my garage door. - -- The monsters haven't turned blue yet, and I have to eat more dots. - -- I'm converting my calendar watch from Julian to Gregorian. - -- I have to fulfill my potential. - -- I don't want to leave my comfort zone. - -- It's too close to the turn of the century. - -- I have to bleach my hare. - -- I'm worried about my vertical hold knob. - -- I left my body in my other clothes. -% -Why I Can't Go Out With You: - -I'd LOVE to, but... - -- I've got a Friends of the Lowly Rutabaga meeting. - -- I promised to help a friend fold road maps. - -- I've been scheduled for a karma transplant. - -- I'm staying home to work on my cottage cheese sculpture. - -- It's my parakeet's bowling night. - -- I'm building a plant from a kit. - -- There's a disturbance in the Force. - -- I'm doing door-to-door collecting for static cling. - -- I'm teaching my ferret to yodel. - -- My crayons all melted together. -% -Why is it called a funny bone when it hurts so much? -% -Why is it taking so long for her to bring out all the good in you? -% -Why is it that we rejoice at a birth and grieve at a funeral? -It is because we are not the person involved. - -- Mark Twain -% -Why is the alphabet in that order? Is it because of that song? - -- Steven Wright -% -Why isn't there a special name for the tops of your feet? - -- Lily Tomlin -% -Why isn't there some cheap and easy -way to prove how much she means to me? -% -Why must you tell me all your secrets when it's hard enough to love -you knowing nothing? - -- Lloyd Cole and the Commotions -% -Why my thoughts are my own, when they are in, but when they are out they -are another's. - -- Susanna Martin, executed for witchcraft, 1681 -% -Why not? -- What? -- Why not? -- Why should I not send it? -- Why should I -not dispatch it? -- Why not? -- Strange! I don't know why I shouldn't -- -Well, then -- You will do me this favor. -- Why not? -- Why should you not -do it? -- Why not? -- Strange! I shall do the same for you, when you want -me to. Why not? Why should I not do it for you? Strange! Why not? -- -I can't think why not. - -- Wolfgang Amadeus Mozart, from a letter to his cousin Maria, - "The Definitive Biography of PDQ Bach", Peter Schickele -% -Why not go out on a limb? -Isn't that where the fruit is? -% -Why not have an old-fashioned Christmas for your family this year? -Just picture the scene in your living room on Christmas morning as your -children open their old-fashioned presents. - -Your 11-year-old son: "What the heck is this?" - -You: "A spinning top! You spin it around, and then eventually it - falls down. What fun! Ha, ha!" - -Son: "Is this a joke? Jason Thompson's parents got him a computer - with two disk drives and 128 kilobytes of random-access memory, - and I get this cretin TOP?" - -Your 8-year-old daughter: "You think that's bad? Look at this." - -You: "It's figgy pudding! What a treat!" - -Daughter: "It looks like goat barf." - -- Dave Barry, "Simple, Homespun Gifts" -% -Why on earth do people buy old bottles of wine when they can get a -fresh one for a quarter of the price? -% -Why was I born with such contemporaries? - -- Oscar Wilde -% -Why, when no honest man will deny in private that every ultimate problem is -wrapped in the profoundest mystery, do honest men proclaim in pulpits that -unhesitating certainty is the duty of the most foolish and ignorant? Is it -not a spectacle to make the angels laugh? We are a company of ignorant -beings, feeling our way through mists and darkness, learning only be -incessantly repeated blunders, obtaining a glimmering of truth by falling -into every conceivable error, dimly discerning light enough for our daily -needs, but hopelessly differing whenever we attempt to describe the ultimate -origin or end of our paths; and yet, when one of us ventures to declare that -we don't know the map of the universe as well as the map of our infinitesimal -parish, he is hooted, reviled, and perhaps told that he will be damned to all -eternity for his faithlessness. - -- Leslie Stephen, "An Agnostic's Apology", - Fortnightly Review, 1876 -% -Why won't you let me kiss you goodnight? Is it something I said? - -- Tom Ryan -% -Why would anyone want to be called "Later"? -% -Why You Can't Run When There's Trouble in the Office: - No matter where you stand, no matter how far or fast you flee, -when it hits the fan, as much as possible will be propelled in your -direction, and almost none will be returned to the source. - -- John L. Shelton -% -Why you say you no bunny rabbit when you have little powder-puff tail? - -- The Tasmanian Devil -% -Wiker's Law: - Government expands to absorb all - available revenue and then some. -% -Wilcox's Law: - A pat on the back is only a few - centimeters from a kick in the pants. -% -Will Rogers never met you. -% -Will you loan me $20.00 and only give me ten of it? -That way, you will owe me ten, and I'll owe you ten, and we'll be even! -% -Will your long-winded speeches never end? -What ails you that you keep on arguing? - -- Job 16:3 -% -Williams and Holland's Law: - If enough data is collected, - anything may be proven by statistical methods. -% -Willie in the cauldron fell; Willie saw some dynamite, -See the grief on mother's brow; Couldn't understand it quite; -Mother loved her darling well -- Curiosity never pays: -Willie's quite hard-boiled by now. It rained Willie seven days. - -Little Willie with a shout, William in a nice new sash, -Gouged the baby's eyeballs out; Fell in the fire and burned to an ash. -Stamped on them to make them pop. Now, although the room grows chilly, -Mother cried, "Now, William, stop!" I haven't the heart to poke poor Billy. - -William with a thirst for gore, Little Willie mean as hell, -Nailed the baby to the door. Threw his sister in the well! -Mother said, with humor quaint: Said his mother when drawing water, -"Careful, Will, don't mar the paint." "sure is hard to raise a daughter." - -- Harry Graham, "Ruthless Rhymes for Heartless Homes", 1899 -% -Wilner's Observation: - All conversations with a potato should be conducted in private. -% -Winning isn't everything. It's the only thing. - -- Vince Lombardi -% -Winning isn't everything, but losing isn't anything. -% -Winny and I lived in a house that ran on static electricity... -If you wanted to run the blender, you had to rub balloons on your -head... if you wanted to cook, you had to pull off a sweater real quick... - -- Steven Wright -% -Winter is nature's way of saying, "Up yours." - -- Robert Byrne -% -Winter is the season in which people try to keep the house -as warm as it was in the summer, when they complained about the heat. -% -[Wisdom] is a tree of life to those laying -hold of her, making happy each one holding her fast. - -- Proverbs 3:18, NSV -% -Wisdom is knowing what to do with what you know. - -- J. Winter Smith -% -Wisdom is rarely found on the best-seller list. -% -Wishing without work is like fishing without bait. - -- Frank Tyger -% -Wit, n.: - The salt with which the American Humorist spoils his cookery... - by leaving it out. - -- Ambrose Bierce, "The Devil's Dictionary" -% -With a gentleman I try to be a gentleman and a half, and with a fraud I -try to be a fraud and a half. - -- Otto von Bismarck -% -With a rubber duck, one's never alone. - -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" -% -With all the fancy scientists in the world, -why can't they just once build a nuclear balm. -% -With all the talent around, it's sort of -amazing that a woman could be up here with us. - -- Ralph Kiner, on introducing an award winner -% -With clothes the new are best, with friends the old are best. -% -With Congress, every time they make a joke it's a law; and every time -they make a law it's a joke. - -- W. Rogers -% -With every passing hour our solar system comes forty-three thousand -miles closer to globular cluster M13 in the constellation Hercules, -and still there are some misfits who continue to insist that there -is no such thing as progress. - -- Ransom K. Ferm -% -With her body, woman is more sincere than man; but with her mind -she lies. And when she lies, she does not believe herself. - -- Tolstoy -% -With listening comes wisdom, with speaking repentance. -% -With reasonable men I will reason; -with humane men I will plead; -but to tyrants I will give no quarter. - -- William Lloyd Garrison -% -With the end of the football season, a star player for the college team -celebrated the relaxation of team curfew by attending a late-night campus -party. Soon after arriving, he became captivated by a beautiful coed and -eased into a conversation with her by asking if she met many dates at -parties. - "Oh, I have a three point eight, so I'm much more attracted to the -strong academic types than to the dumb party animals," she said. "What's -your G.P.A.?" - Grinning ear to ear, the jock boasted, "I get about twenty-five in -the city and forty on the highway." -% -With women, I've got a long bamboo pole with a leather loop on the end of -it. I slip the loop around their necks so they can't get away or come too -close. Like catching snakes. - -- Marlon Brando -% -Within a computer, natural language is unnatural. -% -Within a month [in 1969] I had met the first of a small but not uninfluential -community of people who violently opposed SALT for a simple reason: It might -keep America from developing a first-strike capability against the Soviet -Union. I'll never forget being lectured by an Air Force colonel about how -we should have "nuked" the Soviets in late 1940s before they got The Bomb. -I was told that if SALT would go away, we'd soon have the capability to nuke -them again -- and this time we'd use it. - -- Roger Molander, former nuclear strategist for the - White House's National Security Council, Washington - Post, 21 March, 1982 -% -Without adventure, civilization is in full decay. - -- Alfred North Whitehead -% -Without coffee he could not work, or at least he could not have worked in the -way he did. In addition to paper and pens, he took with him everywhere as an -indispensable article of equipment the coffee machine, which was no less -important to him than his table or his white robe. - -- Stefan Zweigs, Biography of Balzac -% -Without fools there would be no wisdom. -% -Without ice cream life and fame are meaningless. -% -Without life, Biology itself would be impossible. -% -Without love intelligence is dangerous; -without intelligence love is not enough. - -- Ashley Montagu -% -With/Without - and who'll deny it's what the fighting's all about? - -- Pink Floyd -% -Woke up this mornin' an' I had myself a beer, -Yeah, Ah woke up this mornin' an' I had myself a beer -The future's uncertain and the end is always near. - -- Jim Morrison, "Roadhouse Blues" -% -Woke up this morning, don't believe what I saw. Hundred billion -bottles washed up on the shore. Seems I never noted being alone. -Hundred billion castaways looking for a call. -% -WOLF: - A man who knows all the ankles. -% -Woman: "Is Yoo-Hoo hyphenated?" -Yogi Berra: "No, ma'am, its not even carbonated." -% -Woman inspires us to great things, and prevents us from achieving them. - -- Dumas -% -Woman is generally so bad that the difference -between a good and a bad woman scarcely exists. - -- Tolstoy -% -Woman, n.: - An animal usually living in the vicinity of Man, and - having a rudimentary susceptibility to domestication. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Woman on Street: Sir, you are drunk; very, very drunk. -Winston Churchill: Madame, you are ugly; very, very ugly. - I shall be sober in the morning. -% -Woman was taken out of man -- not out of his head, to rule over him; nor -out of his feet, to be trampled under by him; but out of his side, to be -equal to him -- under his arm, that he might protect her, and near his heart -that he might love her. - -- Henry -% -Woman would be more charming if one could -fall into her arms without falling into her hands. - -- DeGourmont -% -Woman's advice has little value, but he who won't take it is a fool. - -- Cervantes -% -Wombat's Laws of Computer Selection: - (1) If it doesn't run Unix, forget it. - (2) Any computer design over 10 years old is obsolete. - (3) Anything made by IBM is junk. (See number 2) - (4) The minimum acceptable CPU power for a single user is a - VAX/780 with a floating point accelerator. - (5) Any computer with a mouse is worthless. - -- Rich Kulawiec -% -Women are a problem, but if you haven't already guessed, -they're the kind of problem I enjoy wrestling with. - -- Warren Beatty -% -Women are all alike. When they're maids they're mild as milk: -once make 'em wives, and they lean their backs against their -marriage certificates, and defy you. - -- Jerrold -% -Women are always anxious to urge bachelors to matrimony; is it -from charity, or revenge? - -- Gustave Vapereau -% -Women are just like men, only different. -% -Women are like elephants to me: I like to -look at them, but I wouldn't want to own one. - -- W. C. Fields -% -Women are not much, but they are the best other sex we have. - -- Herold -% -Women are nothing but machines for producing children. - -- Napoleon -% -Women are wiser than men because they know less and understand more. - -- Stephens -% -Women aren't as mere as they used to be. - -- Pogo -% -Women can keep a secret just as well as men, -but it takes more of them to do it. -% -Women come and go, but BSD is forever. - -- Derek Young -% -Women complain about sex more than men. Their gripes fall into two -categories: (1) Not enough and (2) Too much. - -- Ann Landers -% -Women, deceived by men, want to marry them; it is a kind of revenge -as good as any other. - -- Philippe De Remi -% -Women give themselves to God when the -Devil wants nothing more to do with them. - -- Arnould -% -Women give to men the very gold of their lives. Possibly; -but they invariably want it back in such very small change. - -- Wilde -% -Women in love consist of a little sighing, a little -crying, a little dying -- and a good deal of lying. - -- Ansey -% -Women of genius commonly have masculine faces, figures and manners. -In transplanting brains to an alien soil God leaves a little of the -original earth clinging to the roots. - -- Ambrose Bierce -% -Women reason with the heart and are much less often wrong -than men who reason with the head. - -- DeLescure -% -Women sometimes forgive a man who forces the opportunity, -but never a man who misses one. - -- Charles De Talleyrand-Perigord -% -Women treat us just as humanity treats its gods. They worship -us and are always bothering us to do something for them. - -- Wilde -% -Women want their men to be cops. They want you to punish them and tell -them what the limits are. The only thing that women hate worse from a man -than being slapped is when you get on your knees and say you're sorry. - -- Mort Sahl -% -Women waste men's lives and think they have -indemnified them by a few gracious words. - -- Honore de Balzac -% -Women, when they are not in love, have all -the cold blood of an experienced attorney. - -- Honore de Balzac -% -Women, when they have made a sheep of a man, -always tell him that he is a lion with a will of iron. - -- Honore de Balzac -% -Women who want to be equal to men lack imagination. -% -Women wish to be loved without a why or a wherefore; -not because they are pretty, or good, or well-bred, or -graceful, or intelligent, but because they are themselves. - -- Amiel -% -Women's Libbers are OK, I just wouldn't want my sister to marry one. -% -Women's virtue is man's greatest invention. - -- Cornelia Otis Skinner -% -Wonder is the feeling of a philosopher, -and philosophy begins in wonder. - Socrates, quoting Plato -% -Wonderful day. -Your hangover just makes it seem terrible. -% -Wood is highly ecological, since trees are a renewable resource. If -you cut down a tree, another will grow in its place. And if you cut -down the new tree, still another will grow. And if you cut down that -tree, yet another will grow, only this one will be a mutation with -long, poisonous tentacles and revenge in its heart, and it will sit -there in the forest, cackling and making elaborate plans for when you -come back. - -Wood heat is not new. It dates back to a day millions of years ago, -when a group of cavemen were sitting around, watching dinosaurs rot. -Suddenly, lightning struck a nearby log and set it on fire. One of the -cavemen stared at the fire for a few minutes, then said: "Hey! Wood -heat!" The other cavemen, who did not understand English, immediately -beat him to death with stones. But the key discovery had been made, -and from that day forward, the cavemen had all the heat they needed, -although their insurance rates went way up. - -- Dave Barry, "Postpetroleum Guzzler" -% -Woodward's Law: - A theory is better than its explanation. -% -Woody: What's the story, Mr. Peterson? -Norm: The Bobbsey twins go to the brewery. - Let's just cut to the happy ending. - -- Cheers, Airport V - -Woody: Hey, Mr. Peterson, there's a cold one waiting for you. -Norm: I know, and if she calls, I'm not here. - -- Cheers, Bar Wars II: The Woodman Strikes Back - -Sam: Beer, Norm? -Norm: Have I gotten that predictable? Good. - -- Cheers, Don't Paint Your Chickens -% -Woody: Hey, Mr. Peterson, Jack Frost nipping at your nose? -Norm: Yep, now let's get Joe Beer nipping at my liver, huh? - -- Cheers, Feeble Attraction - -Sam: What are you up to Norm? -Norm: My ideal weight if I were eleven feet tall. - -- Cheers, Bar Wars III: The Return of Tecumseh - -Woody: Nice cold beer coming up, Mr. Peterson. -Norm: You mean, `Nice cold beer going *down* Mr. Peterson.' - -- Cheers, Loverboyd -% -Woody: Hey, Mr. Peterson, what do you say to a cold one? -Norm: See you later, Vera, I'll be at Cheers. - -- Cheers, Norm's Last Hurrah - -Sam: Well, look at you. You look like the cat that - swallowed the canary. -Norm: And I need a beer to wash him down. - -- Cheers, Norm's Last Hurrah - -Woody: Would you like a beer, Mr. Peterson? -Norm: No, I'd like a dead cat in a glass. - -- Cheers, Little Carla, Happy at Last, Part 2 -% -Woody: Hey, Mr. Peterson, what's up? -Norm: The warranty on my liver. - -- Cheers, Breaking In Is Hard to Do - -Sam: What can I do for you, Norm? -Norm: Open up those beer taps and, oh, take the day off, Sam. - -- Cheers, Veggie-Boyd - -Woody: What's going on, Mr. Peterson? -Norm: Another layer for the winter, Wood. - -- Cheers, It's a Wonderful Wife -% -Woody: How are you feeling today, Mr. Peterson? -Norm: Poor. -Woody: Oh, I'm sorry to hear that. -Norm: No, I meant `pour'. - -- Cheers, Strange Bedfellows, Part 3 - -Woody: Hey, Mr. Peterson, what's the story? -Norm: Boy meets beer. Boy drinks beer. Boy gets another beer. - -- Cheers, The Proposal - -Paul: Hey Norm, how's the world been treating you? -Norm: Like a baby treats a diaper. - -- Cheers, Tan 'n Wash -% -Woody: What's going on, Mr. Peterson? -Norm: Let's talk about what's going *in* Mr. Peterson. A beer, Woody. - -- Cheers, Paint Your Office - -Sam: How's life treating you? -Norm: It's not, Sammy, but that doesn't mean you can't. - -- Cheers, A Kiss is Still a Kiss - -Woody: Can I pour you a draft, Mr. Peterson? -Norm: A little early, isn't it Woody? -Woody: For a beer? -Norm: No, for stupid questions. - -- Cheers, Let Sleeping Drakes Lie -% -Woody: What's happening, Mr. Peterson? -Norm: The question is, Woody, why is it happening to me? - -- Cheers, Strange Bedfellows, Part 1 - -Woody: What's going down, Mr. Peterson? -Norm: My cheeks on this barstool. - -- Cheers, Strange Bedfellows, Part 2 - -Woody: Hey, Mr. Peterson, can I pour you a beer? -Norm: Well, okay, Woody, but be sure to stop me at one. ... - Eh, make that one-thirty. - -- Cheers, Strange Bedfellows, Part 2 -% -Woolsey-Swanson Rule: - People would rather live with a problem they cannot - solve rather than accept a solution they cannot understand. -% -Words are the voice of the heart. -% -Words can never express what words can never express. -% -Words have a longer life than deeds. - -- Pindar -% -Words must be weighed, not counted. -% -WORK: - The blessed respite from screaming kids and - soap operas for which you actually get paid. -% -Work consists of whatever a body is obliged to do. -Play consists of whatever a body is not obliged to do. - -- Mark Twain -% -Work continues in this area. - -- DEC's SPR-Answering-Automaton -% -Work expands to fill the time available. - -- Cyril Northcote Parkinson, "The Economist", 1955 -% -Work is of two kinds: first, altering the position of matter at or near -the earth's surface relative to other matter; second, telling other people -to do so. - -- Bertrand Russell -% -Work is the crab grass in the lawn of life. - -- Schulz -% -Work is the curse of the drinking classes. - -- Mike Romanoff -% -Work like hell, tell everyone everything you know, close a deal with -a handshake, and have fun. - -- Harold "Doc" Edgerton, summing up his life's philosophy, - shortly before dying at the age of 86. -% -Work Rule: Leave of Absence (for an Operation): - We are no longer allowing this practice. We wish to discourage -any thoughts that you may not need all of whatever you have, and you -should not consider having anything removed. We hired you as you are, -and to have anything removed would certainly make you less than we -bargained for. -% -Work smarter, not harder, and be careful of your speling. -% -Work without a vision is slavery, -Vision without work is a pipe dream, -But vision with work is the hope of the world. -% -Workers of the world, arise! You have nothing to lose but your -chairs. -% -Working with Julie Andrews is like getting hit over the head with -a valentine. - -- Christopher Plummer -% -World tensions have, if anything, increased in the quarter century -since H. G. Wells uttered his glum warning: "There is no more evil -thing on earth than race prejudice, none at all. I write deliberately --- it is the worst single thing in life now. It justifies and holds -together more baseness, cruelty and abomination than any other sort of -error in the world." - -- Sydney Harris -% -World War Three can be averted by adherence to a strictly enforced -dress code! -% -Worrying is like rocking in a rocking chair-- -It gives you something to do, but it doesn't get you anywhere. -% -Worst Month of 1981 for Downhill Skiing: - August. The lift lines are the shortest, though. - -- Steve Rubenstein -% -Worst Month of the Year: - February. February has only 28 days in it, which means that if - you rent an apartment, you are paying for three full days you - don't get. Try to avoid Februarys whenever possible. - -- Steve Rubenstein -% -Worst Response To A Crisis, 1985: - From a readers' Q and A column in TV GUIDE: "If we get involved - in a nuclear war, would the electromagnetic pulses from - exploding bombs damage my videotapes?" -% -Worst Vegetable of the Year: - Brussel sprout. This is also the worst vegetable of next year. - -- Steve Rubenstein -% -Worth seeing? -Yes, but not worth going to see. -% -Worthless. - -- Sir George Bidell Airy, KCB, MA, LLD, DCL, FRS, FRAS - (Astronomer Royal of Great Britain), estimating for the - Chancellor of the Exchequer the potential value of the - "analytical engine" invented by Charles Babbage, September - 15, 1842. -% -Would it help if I got out and pushed? - -- Princess Leia Organa -% -Would that my hand were as swift as my tongue. - -- Alfieri -% -Would the last person to leave Michigan please turn out the lights? -% -Would ye both eat your cake and have your cake? - -- John Heywood -% -Would you care to drift aimlessly in my direction? -% -Would you care to view the ruins of my good intentions? -% -Would you people stop playing these stupid games?!?!?!!!! -% -Would you please have another look at my nose and put in that cocaine -stuff ... - -- Adolf Hitler, quoted by Dr. Giesing in Nuremberg - trial testimony, 1947 -% -Would you *really* want to get on a non-stop flight? - -- George Carlin -% -Wouldn't this be a great world if being insecure and desperate were -a turn-on? - -- "Broadcast News" -% -Wrinkles should merely indicate where smiles have been. - -- Mark Twain -% -Write a wise saying and your name will live forever. - -- Anonymous -% -Write yourself a threatening letter and pen a defiant reply. -% -Write-protect tab, n.: - A small sticker created to cover the unsightly notch carelessly left - by disk manufacturers. The use of the tab creates an error message - once in a while, but its aesthetic value far outweighs the momentary - inconvenience. - -- Robb Russon -% -Writers who use a computer swear to its liberating power in tones that bear -witness to the apocalyptic power of a new divinity. Their conviction results -from something deeper than mere gratitude for the computer's conveniences. -Every new medium of writing brings about new intensities of religious belief -and new schisms among believers. In the 16th century the printed book helped -make possible the split between Catholics and Protestants. In the 20th -century this history of tragedy and triumph is repeating itself as a farce. -Those who worship the Apple computer and those who put their faith in the IBM -PC are equally convinced that the other camp is damned or deluded. Each cult -holds in contempt the rituals and the laws of the other. Each thinks that it -is itself the one hope for salvation. - -- Edward Mendelson, "The New Republic", February 22, 1988 -% -Writing about music is like dancing about architecture. - -- Frank Zappa -% -Writing free verse is like playing tennis with the net down. -% -Writing is easy; all you do is sit staring at the blank sheet of -paper until drops of blood form on your forehead. - -- Gene Fowler -% -Writing is turning one's worst moments into money. - -- J. P. Donleavy -% -Writing software is more fun than working. -% -WRONG! -% -"Wrong," said Renner. - -"The tactful way," Rod said quietly, "the polite way to disagree with -the Senator would be to say, `That turns out not to be the case.'" -% -WYSIWYG: - What You See Is What You Get. -% -X windows: - Accept any substitute. - If it's broke, don't fix it. - If it ain't broke, fix it. - Form follows malfunction. - The Cutting Edge of Obsolescence. - The trailing edge of software technology. - Armageddon never looked so good. - Japan's secret weapon. - You'll envy the dead. - Making the world safe for competing window systems. - Let it get in YOUR way. - The problem for your problem. - If it starts working, we'll fix it. Pronto. - It could be worse, but it'll take time. - Simplicity made complex. - The greatest productivity aid since typhoid. - Flakey and built to stay that way. - -One thousand monkeys. One thousand MicroVAXes. One thousand years. - X windows. -% -X windows: - It's not how slow you make it. It's how you make it slow. - The windowing system preferred by masochists 3 to 1. - Built to take on the world... and lose! - Don't try it 'til you've knocked it. - Power tools for Power Fools. - Putting new limits on productivity. - The closer you look, the cruftier we look. - Design by counterexample. - A new level of software disintegration. - No hardware is safe. - Do your time. - Rationalization, not realization. - Old-world software cruftsmanship at its finest. - Gratuitous incompatibility. - Your mother. - THE user interference management system. - You can't argue with failure. - You haven't died 'til you've used it. - -The environment of today... tomorrow! - X windows. -% -X windows: - Something you can be ashamed of. - 30%% more entropy than the leading window system. - The first fully modular software disaster. - Rome was destroyed in a day. - Warn your friends about it. - Climbing to new depths. Sinking to new heights. - An accident that couldn't wait to happen. - Don't wait for the movie. - Never use it after a big meal. - Need we say less? - Plumbing the depths of human incompetence. - It'll make your day. - Don't get frustrated without it. - Power tools for power losers. - A software disaster of Biblical proportions. - Never had it. Never will. - The software with no visible means of support. - More than just a generation behind. - -Hindenburg. Titanic. Edsel. - X windows. -% -X windows: - The ultimate bottleneck. - Flawed beyond belief. - The only thing you have to fear. - Somewhere between chaos and insanity. - On autopilot to oblivion. - The joke that kills. - A disgrace you can be proud of. - A mistake carried out to perfection. - Belongs more to the problem set than the solution set. - To err is X windows. - Ignorance is our most important resource. - Complex nonsolutions to simple nonproblems. - Built to fall apart. - Nullifying centuries of progress. - Falling to new depths of inefficiency. - The last thing you need. - The de facto substandard. - -Elevating brain damage to an art form. - X windows. -% -X windows: - We will dump no core before its time. - One good crash deserves another. - A bad idea whose time has come. And gone. - We make excuses. - It didn't even look good on paper. - You laugh now, but you'll be laughing harder later! - A new concept in abuser interfaces. - How can something get so bad, so quickly? - It could happen to you. - The art of incompetence. - You have nothing to lose but your lunch. - When uselessness just isn't enough. - More than a mere hindrance. It's a whole new barrier! - When you can't afford to be right. - And you thought we couldn't make it worse. - -If it works, it isn't X windows. -% -X windows: - You'd better sit down. - Don't laugh. It could be YOUR thesis project. - Why do it right when you can do it wrong? - Live the nightmare. - Our bugs run faster. - When it absolutely, positively HAS to crash overnight. - There ARE no rules. - You'll wish we were kidding. - Everything you never wanted in a window system. And more. - Dissatisfaction guaranteed. - There's got to be a better way. - The next best thing to keypunching. - Leave the thrashing to us. - We wrote the book on core dumps. - Even your dog won't like it. - More than enough rope. - Garbage at your fingertips. - -Incompatibility. Shoddiness. Uselessness. - X windows. -% -Xerox does it again and again and again and ... -% -Xerox never comes up with anything original. -% -XEROX never does anything original. -% -XI: - If the Earth could be made to rotate twice as fast, managers would - get twice as much done. If the Earth could be made to rotate twenty - times as fast, everyone else would get twice as much done since all - the managers would fly off. -XII: - It costs a lot to build bad products. -XIII: - There are many highly successful businesses in the United States. - There are also many highly paid executives. The policy is not to - intermingle the two. -XIV: - After the year 2015, there will be no airplane crashes. There will - be no takeoffs either, because electronics will occupy 100 percent - of every airplane's weight. -XV: - The last 10 percent of performance generates one-third of the cost - and two-thirds of the problems. - -- Norman Augustine -% -XIIdigitation, n.: - The practice of trying to determine the year a movie was made - by deciphering the Roman numerals at the end of the credits. - -- Rich Hall, "Sniglets" -% -XLI: - The more one produces, the less one gets. -XLII: - Simple systems are not feasible because they require infinite testing. -XLIII: - Hardware works best when it matters the least. -XLIV: - Aircraft flight in the 21st century will always be in a westerly - direction, preferably supersonic, crossing time zones to provide the - additional hours needed to fix the broken electronics. -XLV: - One should expect that the expected can be prevented, but the - unexpected should have been expected. -XLVI: - A billion saved is a billion earned. - -- Norman Augustine -% -XLVII: - Two-thirds of the Earth's surface is covered with water. The other - third is covered with auditors from headquarters. -XLVIII: - The more time you spend talking about what you have been doing, the - less time you have to spend doing what you have been talking about. - Eventually, you spend more and more time talking about less and less - until finally you spend all your time talking about nothing. -XLIX: - Regulations grow at the same rate as weeds. -L: - The average regulation has a life span one-fifth as long as a - chimpanzee's and one-tenth as long as a human's -- but four times - as long as the official's who created it. -LI: - By the time of the United States Tricentennial, there will be more - government workers than there are workers. -LII: - People working in the private sector should try to save money. - There remains the possibility that it may someday be valuable again. - -- Norman Augustine -% -XML is a giant step in no direction at all. - -- Erik Naggum -% -XML is like violence: if it doesn't solve your problem, you aren't using -enough of it. - -- XML guru Chris Maden -% -X-rated movies are all alike -- the only thing -they leave to the imagination is the plot. -% -XVI: - In the year 2054, the entire defense budget will purchase just one - aircraft. This aircraft will have to be shared by the Air Force and - Navy 3-1/2 days each per week except for leap year, when it will be - made available to the Marines for the extra day. -XVII: - Software is like entropy. It is difficult to grasp, weighs nothing, - and obeys the Second Law of Thermodynamics, i.e., it always increases. -XVIII: - It is very expensive to achieve high unreliability. It is not uncommon - to increase the cost of an item by a factor of ten for each factor of - ten degradation accomplished. -XIX: - Although most products will soon be too costly to purchase, there will - be a thriving market in the sale of books on how to fix them. -XX: - In any given year, Congress will appropriate the amount of funding - approved the prior year plus three-fourths of whatever change the - administration requests -- minus 4-percent tax. - -- Norman Augustine -% -XXI: - It's easy to get a loan unless you need it. -XXII: - If stock market experts were so expert, they would be buying stock, - not selling advice. -XXIII: - Any task can be completed in only one-third more time than is - currently estimated. -XXIV: - The only thing more costly than stretching the schedule of an - established project is accelerating it, which is itself the most - costly action known to man. -XXV: - A revised schedule is to business what a new season is to an athlete - or a new canvas to an artist. - -- Norman Augustine -% -XXVI: - If a sufficient number of management layers are superimposed on each - other, it can be assured that disaster is not left to chance. -XXVII: - Rank does not intimidate hardware. Neither does the lack of rank. -XXVIII: - It is better to be the reorganizer than the reorganizee. -XXIX: - Executives who do not produce successful results hold on to their - jobs only about five years. Those who produce effective results - hang on about half a decade. -XXX: - By the time the people asking the questions are ready for the answers, - the people doing the work have lost track of the questions. - -- Norman Augustine -% -XXXI: - The optimum committee has no members. -XXXII: - Hiring consultants to conduct studies can be an excellent means of - turning problems into gold -- your problems into their gold. -XXXIII: - Fools rush in where incumbents fear to tread. -XXXIV: - The process of competitively selecting contractors to perform work - is based on a system of rewards and penalties, all distributed - randomly. -XXXV: - The weaker the data available upon which to base one's conclusion, - the greater the precision which should be quoted in order to give - the data authenticity. - -- Norman Augustine -% -XXXVI: - The thickness of the proposal required to win a multimillion dollar - contract is about one millimeter per million dollars. If all the - proposals conforming to this standard were piled on top of each other - at the bottom of the Grand Canyon it would probably be a good idea. -XXXVII: - Ninety percent of the time things will turn out worse than you expect. - The other 10 percent of the time you had no right to expect so much. -XXXVIII: - The early bird gets the worm. - The early worm ... gets eaten. -XXXIX: - Never promise to complete any project within six months of the end of - the year -- in either direction. -XL: - Most projects start out slowly -- and then sort of taper off. - -- Norman Augustine -% -Ya know, Quaker Oats make you feel good twice! -% -Yacc owes much to a most stimulating collection of users, who have -goaded me beyond my inclination, and frequently beyond my ability in -their endless search for "one more feature". Their irritating -unwillingness to learn how to do things my way has usually led to my -doing things their way; most of the time, they have been right. - -- Stephen C. Johnson, "Yacc guide acknowledgments" -% -Y'all hear about the geometer who went to the beach to catch some -rays and became a tangent ? -% -Yawd [noun, Bostonese]: the campus of Have Id. - -- Webster's Unafraid Dictionary -% -Yea from the table of my memory -I'll wipe away all trivial fond records. - -- Hamlet -% -Yea, though I walk through the valley of the shadow of APL, I shall -fear no evil, for I can string six primitive monadic and dyadic -operators together. - -- Steve Higgins -% -Yeah, but you're taking the universe out of context. -% -Yeah, God is dead, he laughed himself to death. -% -Yeah, if it looks like a duck, and walks like -a duck, and quacks like a duck -- shoot it. -% -Yeah, that's me, Tracer Bullet. I've got eight slugs in me. One's lead, -the rest bourbon. The drink packs a wallop, and I pack a revolver. I'm -a private eye. - -- Calvin -% -Yeah, there are more important things in life than money, -but they won't go out with you if you don't have any. -% -Year Name James Bond Book ----- -------------------------------- -------------- ---- -50's James Bond TV Series Barry Nelson -1962 Dr. No Sean Connery 1958 -1963 From Russia With Love Sean Connery 1957 -1964 Goldfinger Sean Connery 1959 -1965 Thunderball Sean Connery 1961 -1967* Casino Royale David Niven 1954 -1967 You Only Live Twice Sean Connery 1964 -1969 On Her Majesty's Secret Service George Lazenby 1963 -1971 Diamonds Are Forever Sean Connery 1956 -1973 Live And Let Die Roger Moore 1955 -1974 The Man With The Golden Gun Roger Moore 1965 -1977 The Spy Who Loved Me Roger Moore 1962 (novelette) -1979 Moonraker Roger Moore 1955 -1981 For Your Eyes Only Roger Moore 1960 (novelette) -1983 Octopussy Roger Moore 1965 -1983* Never Say Never Again Sean Connery -1985 A View To A Kill Roger Moore 1960 (novelette) -1987 The Living Daylights Timothy Dalton 1965 (novelette) - * -- Not a Broccoli production -% -Year, n.: - A period of three hundred and sixty-five disappointments. - -- Ambrose Bierce, "The Devil's Dictionary" -% -Yes, but every time I try to see things your way, I get a headache. -% -Yes, but which self do you want to be? -% -Yes, I was surprised how easy it was to cut the door off my cat. - -- James D. Nicoll -% -Yes, I've now got this nice little apartment in New York, one of those -L-shaped ones. Unfortunately, it's a lower case l. - -- Rita Rudner -% -Yes me, I got a bottle in front of me. -And Jimmy has a frontal lobotomy. -Just different ways to kill the pain the same. -But I'd rather have a bottle in front of me, -Than to have to have a frontal lobotomy. -I might be drunk but at least I'm not insane. - -- Randy Ansley M.D. (Dr. Rock) -% -Yes, we will be going to OSI, Mars and, Pluto, but not necessarily in -that order. - -- George Michaelson -% -Yesterday I was a dog. Today I'm a dog. -Tomorrow I'll probably still be a dog. -Sigh! There's so little hope for advancement. - -- Snoopy -% -Yesterday upon the stair -I met a man who wasn't there. -He wasn't there again today -- -I think he's from the CIA. -% -Ye've also got to remember that ... respectable people do the most -astonishin' things to preserve their respectability. Thank God -I'm not respectable. - -- Ruthven Campbell Todd -% -Yevtushenko has... an ego that can crack crystal at a distance of twenty -feet. - -- John Cheever -% -Yield to Temptation ... it may not pass your way again. - -- Lazarus Long, "Time Enough for Love" -% -Yinkel, n.: - A person who combs his hair over his bald spot, - hoping no one will notice. - -- Rich Hall, "Sniglets" -% -You ain't learning nothing when you're talking. -% -You always have the option of pitching baseballs at empty -spray paint cans in a cul-de-sac in a Cleveland suburb. -% -You are a bundle of energy, always on the go. -% -You are a fluke of the universe; you have no right to be here. -% -You are a taxi driver. Your cab is yellow and black, and has been in -use for only seven years. One of its windshield wipers is broken, and -the carburetor needs adjusting. The tank holds 20 gallons, but at the -moment is only three-quarters full. How old is the taxi driver?" -% -You are a very redundant person, that's what kind of person you are. -% -You are a wish to be here wishing yourself. - -- Philip Whalen -% -You are absolute plate-glass. I see to the very back of your mind. - -- Sherlock Holmes -% -You are always busy. -% -You are always doing something marginal when the boss drops by your desk. -% -You are an insult to my intelligence! -I demand that you log off immediately. -% -You are as I am with You. -% -You are capable of planning your future. -% -You are confused; but this is your normal state. -% -You are deeply attached to your friends and acquaintances. -% -You are destined to become the commandant of the -fighting men of the department of transportation. -% -You are dishonest, but never to the point of hurting a friend. -% -You are fairminded, just and loving. -% -You are false data. -% -You are farsighted, a good planner, -an ardent lover, and a faithful friend. -% -You are fighting for survival in your own sweet and gentle way. -% -You are going to have a new love affair. -% -You are here: - *** - *** - ********* - ******* - ***** - *** - * - - But you're not all there. -% -You are in a maze of little twisting passages, all alike. -% -You are in a maze of little twisting passages, all different. -% -You are in the hall of the mountain king. -% -You are lost in the Swamps of Despair. -% -You are loved by the multitudes. -Have you been to the clinic lately? -% -You are magnetic in your bearing. -% -You are never given a wish without also being given the -power to make it true. You may have to work for it, however. - -- R. Bach, - "Messiah's Handbook: Reminders for the Advanced Soul" -% -You are not a fool just because you have done -something foolish -- only if the folly of it escapes you. -% -You are not dead yet. -But watch for further reports. -% -You are not permitted to kill a woman who has wronged you, but nothing -forbids you to reflect that she is growing older every minute. You are -avenged fourteen hundred and forty times a day. - -- Ambrose Bierce -% -You are now in Atlanta, Georgia. -Please set your clocks back 200 years. -% -You are number 6! Who is number one? -% -"You are old, Father William," the young man said, - "All your papers these days look the same; -Those William's would be better unread -- - Do these facts never fill you with shame?" - -"In my youth," Father William replied to his son, - "I wrote wonderful papers galore; -But the great reputation I found that I'd won, - Made it pointless to think any more." -% -"You are old, father William," the young man said, - "And your hair has become very white; -And yet you incessantly stand on your head -- - Do you think, at your age, it is right?" - -"In my youth," father William replied to his son, - "I feared it might injure the brain; -But, now that I'm perfectly sure I have none, - Why, I do it again and again." - -- Lewis Carroll, "Alice's Adventures in Wonderland" (1865) -% -"You are old," said the youth, "and I'm told by my peers - That your lectures bore people to death. -Yet you talk at one hundred conventions per year -- - Don't you think that you should save your breath?" - -"I have answered three questions and that is enough," - Said his father, "Don't give yourself airs! -Do you think I can listen all day to such stuff? - Be off, or I'll kick you downstairs!" -% -"You are old," said the youth, "and your jaws are too weak - For anything tougher than suet; -Yet you finished the goose, with the bones and the beak -- - Pray, how did you manage to do it?" - -"In my youth," said his father, "I took to the law, - And argued each case with my wife; -And the muscular strength which it gave to my jaw, - Has lasted the rest of my life." - -- Lewis Carroll, "Alice's Adventures in Wonderland" (1865) -% -"You are old," said the youth, "and your programs don't run, - And there isn't one language you like; -Yet of useful suggestions for help you have none -- - Have you thought about taking a hike?" - -"Since I never write programs," his father replied, - "Every language looks equally bad; -Yet the people keep paying to read all my books - And don't realize that they've been had." -% -"You are old," said the youth, "as I mentioned before, - And have grown most uncommonly fat; -Yet you turned a back-somersault in at the door -- - Pray what is the reason of that?" - -"In my youth," said the sage, as he shook his grey locks, - "I kept all my limbs very supple -By the use of this ointment -- one shilling the box -- - Allow me to sell you a couple?" - -- Lewis Carroll, "Alice's Adventures in Wonderland" (1865) -% -"You are old," said the youth, "as I mentioned before, - And make errors few people could bear; -You complain about everyone's English but yours -- - Do you really think this is quite fair?" - -"I make lots of mistakes," Father William declared, - "But my stature these days is so great -That no critic can hurt me -- I've got them all scared, - And to stop me it's now far too late." -% -"You are old," said the youth, "one would hardly suppose - That your eye was as steady as ever; -Yet you balanced an eel on the end of your nose -- - What made you so awfully clever?" - -"I have answered three questions, and that is enough," - Said his father. "Don't give yourself airs! -Do you think I can listen all day to such stuff? - Be off, or I'll kick you down stairs!" - -- Lewis Carroll, "Alice's Adventures in Wonderland" (1865) -% -You are only young once, but you can stay immature indefinitely. -% -You are scrupulously honest, frank, and straightforward. -Therefore you have few friends. -% -You are sick, twisted and perverted. -I like that in a person. -% -You are so boring that when I see you my feet go to sleep. -% -You are standing on my toes. -% -You are taking yourself far too seriously. -% -You are the only person to ever get this message. -% -You are transported to a room where you are faced by a wizard who -points to you and says, "Them's fighting words!" You immediately get -attacked by all sorts of denizens of the museum: there is a cobra -chewing on your leg, a troglodyte is bashing your brains out with a -gold nugget, a crocodile is removing large chunks of flesh from you, a -rhinoceros is goring you with his horn, a sabre-tooth cat is busy -trying to disembowel you, you are being trampled by a large mammoth, a -vampire is sucking you dry, a Tyrannosaurus Rex is sinking his six inch -long fangs into various parts of your anatomy, a large bear is -dismembering your body, a gargoyle is bouncing up and down on your -head, a burly troll is tearing you limb from limb, several dire wolves -are making mince meat out of your torso, and the wizard is about to -transport you to the corner of Westwood and Broxton. Oh dear, you seem -to have gotten yourself killed, as well. - -You scored 0 out of 250 possible points. -That gives you a ranking of junior beginning adventurer. -To achieve the next higher rating, you need to score 32 more points. -% -You are wise, witty, and wonderful, -but you spend too much time reading this sort of trash. -% -You ask what a nice girl will do? -She won't give an inch, but she won't say no. - -- Marcus Valerius Martialis -% -You attempt things that you do not even plan -because of your extreme stupidity. -% -You auto buy now. -% -You buttered your bread, now lie in it! -% -You buy a judge by weight, like iron in a junk yard. A justice of the -peace or a magistrate can be had for a five-dollar bill. In the -municipal courts, he will cost you ten. In the circuit or superior -courts, he wants fifteen. The state appellate courts or the state -supreme court is on a par with the Federal courts. By the time a judge -reaches such courts, he is middle-aged, thick around the middle, fat -between the ears. He's heavy. You can't buy a Federal judge for less -than a twenty-dollar bill. - -- Jake "Greasy Thumb" Guzik -% -You can always pick up your needle and move to another groove. - -- Tim Leary -% -You can always tell luck from ability by its duration. -% -You can always tell the Christmas season is here when you start getting -incredibly dense, tinfoil-and-ribbon- wrapped lumps in the mail. -Fruitcakes make ideal gifts because the Postal Service has been unable -to find a way to damage them. They last forever, largely because -nobody ever eats them. In fact, many smart people save the fruitcakes -they receive and send them back to the original givers the next year; -some fruitcakes have been passed back and forth for hundreds of years. - -The easiest way to make a fruitcake is to buy a darkish cake, then -pound some old, hard fruit into it with a mallet. Be sure to wear -safety glasses. - -- Dave Barry, "Simple, Homespun Gifts" -% -You can always tell the people that are forging the new frontier. -They're the ones with arrows sticking out of their backs. -% -You can approach truth, but never capture it. -Lies can be had 'round the corner. - -- Poul Henningsen (1894-1967) -% -You can be replaced by this computer. -% -You can bear anything if it isn't your own fault. - -- Katharine Fullerton Gerould -% -You can bring any calculator you like to the midterm, as long as it -doesn't dim the lights when you turn it on. - -- Hepler, Systems Design 182, University of Washington -% -You can bring men from other parts of the world who are sane. And you -know what happens? At the very moment they cross those mountains... -they go mad. Instantaneously and automatically, at the very moment -they cross the mountains into California, they go insane. - -- Quentin Genter -% -You can build a throne out of bayonets, but you can't sit on it for very long. - -- Boris Yeltsin -% -You can cage a swallow, can't you, - but you can't swallow a cage, can you? -Girl, bathing on Bikini, eyeing boy, - finds boy eyeing bikini on bathing girl. -A man, a plan, a canal -- Panama! - -- The Palindromist -% -You can create your own opportunities this week. -Blackmail a senior executive. -% -You can destroy your now by worrying about tomorrow. - -- Janis Joplin -% -You can do this in a number of ways. IBM chose to do all of them. -Why do you find that funny? - -- D. Taylor, Computer Science 350, University of Washington -% -You can do very well in speculation where -land or anything to do with dirt is concerned. -% -You can drive a horse to water, but a pencil must be lead. -% -You can fool all the people all of the time if the advertising is right -and the budget is big enough. - -- Joseph E. Levine -% -You can fool some of the people all of the time and all -of the people some of the time, but you can never fool your Mom. -% -You can fool some of the people all of the time, -and all of the people some of the time, -but you can make a fool of yourself anytime. -% -You can fool some of the people some of the time, -and some of the people all of the time, and that is sufficient. -% -You can get *anywhere* in ten minutes if you drive fast enough. -% -You can get everything in life you want, -if you will help enough other people get what they want. -% -You can get more of what you want with a kind word and a gun than you -can with just a kind word. - -- Bumper Sticker -% -You can get much further with a kind word and a -gun than you can with a kind word alone. - -- Al Capone - [Also attributed to Johnny Carson. Ed.] -% -You can get there from here, but why on earth would you want to? -% -You can go anywhere you want if you look serious and carry a clipboard. -% -You can grovel with a lover, you can grovel with a friend, -You can grovel with your boss, and it never has to end. - -(chorus) Grovel, grovel, grovel, every night and every day, - Grovel, grovel, grovel, in your own peculiar way. - -You can grovel in a hallway, you can grovel in a park, -You can grovel in an alley with a mugger after dark. -(chorus) - -You can grovel with your uncle, you can grovel with your aunt, -You can grovel with your Apple, even though you say you can't. -(chorus) -% -You can have a dog as a friend. You can have whiskey as a friend. But -if you have a woman as a friend, you're going to wind up drunk and kissing -your dog. - -- foolin' around -% -You can have peace. Or you can have freedom. -Don't ever count on having both at once. - -- Lazarus Long -% -You can imagine my embarrassment when I killed the wrong guy. - -- Joe Valachi -% -You can learn many things from children. How much patience you have, -for instance. - -- Franklin P. Jones -% -You can make it illegal, but you can't make it unpopular. -% -You can measure a programmer's perspective by noting his attitude on -the continuing viability of FORTRAN. - -- Alan J. Perlis -% -You can move the world with an idea, -but you have to think of it first. -% -You can never trust a woman; she may be true to you. -% -You can no more win a war than you can win an earthquake. - -- Jeannette Rankin -% -You can not get anything worthwhile done without raising a sweat. - -- The First Law Of Thermodynamics - -What ever you want is going to cost a little more than it is worth. - -- The Second Law Of Thermodynamics - -You can not win the game, and you are not allowed to stop playing. - -- The Third Law Of Thermodynamics -% -You can now buy more gates with less -specifications than at any other time in history. - -- Kenneth Parker -% -You can observe a lot just by watching. - -- Yogi Berra -% -You can only live once, but if you do it right, once is enough. -% -You can rent this space for only $5 a week. -% -You can take all the impact that science considerations have on funding -decisions at NASA, put them in the navel of a flea, and have room left -over for a caraway seed and Tony Calio's heart. - -- F. Allen -% -You can tell how far we have to go, -when Fortran is the language of supercomputers. - -- Steven Feiner -% -You can tell the ideals of a nation by its advertisements. - -- Norman Douglas -% -You can tune a piano, but you can't tuna fish. -% -You can write a small letter to Grandma in the filename. - -- Forbes Burkowski, Computer Science 454, - University of Washington -% -You canna change the laws of physics, Captain; -I've got to have thirty minutes! -% -You cannot achieve the impossible without attempting the absurd. -% -You cannot choose your battlefield, the gods do that for you. -But you can plant a standard where a standard never flew. - -- Nathalia Crane -% -You cannot have a science without measurement. - -- R. W. Hamming -% -You cannot kill time without injuring eternity. -% -You cannot propel yourself forward by patting yourself on the back. -% -You cannot see the wood for the trees. - -- John Heywood -% -You cannot shake hands with a clenched fist. - -- Indira Gandhi -% -You cannot use your friends and have them too. -% -You can't break eggs without making an omelet. -% -You can't carve your way to success without cutting remarks. -% -You can't cheat an honest man, never give -a sucker an even break or smarten up a chump. - -- W. C. Fields -% -You can't cheat the phone company. -% -You can't cross a large chasm in two small jumps. -% -You can't depend on the man who made the mess to clean it up. - -- Richard M. Nixon (1952) -% -You can't erase a dream, you can only wake me up. - -- Peter Frampton -% -You can't expect a boy to be vicious till he's been to a good school. - -- H. H. Munro -% -"You can't expect a mother to be with a small child all the time", -Margaret Mead once remarked, with her usual good sense, but in 1978 -she shocked feminists by snapping that women don't really have -children to put them in day care twelve hours a day, either. - -- Caroline Bird, "The Two Paycheck Marriage" -% -You can't fall off the floor. -% -You can't get there from here. -% -You can't go home again, unless you set $HOME. -% -You can't have everything. Where would you put it? - -- Steven Wright -% -You can't have your cake and let your neighbor eat it too. - -- Ayn Rand -% -You can't hold a man down without staying down with him. - -- Booker T. Washington -% -You can't hug a child with nuclear arms. -% -You can't judge a book by the way it wears its hair. -% -You can't kiss a girl unexpectedly -- -only sooner than she thought you would. -% -You can't learn too soon that the most useful thing about a principle -is that it can always be sacrificed to expediency. - -- W. Somerset Maugham, "The Circle" -% -You can't make a program without broken egos. -% -You can't mend a wristwatch while falling from an airplane. -% -You can't play your friends like marks, kid. - -- Henry Gondorf, "The Sting" -% -You can't push on a string. -% -You can't run away forever, -But there's nothing wrong with getting a good head start. - -- Jim Steinman, "Rock and Roll Dreams Come Through" -% -You can't say civilization don't advance... in every war they kill you a -new way. - -- Will Rogers -% -You can't start worrying about what's going to happen. -You get spastic enough worrying about what's happening now. - -- Lauren Bacall -% -You can't survive by sucking the juice from a wet mitten. - -- Charles Schulz, "Things I've Had to Learn Over and - Over and Over" -% -You can't take damsel here now. -% -You can't take it with you -- -especially when crossing a state line. -% -You can't teach people to be lazy -- -either they have it, or they don't. - -- Dagwood Bumstead -% -You climb to reach the summit, but once -there, discover that all roads lead down. - -- Stanislaw Lem, "The Cyberiad" -% -You could get a new lease on life -- if only you -didn't need the first and last month in advance. -% -You could live a better life, if you -had a better mind and a better body. -% -You couldn't even prove the White House -staff sane beyond a reasonable doubt. - -- Ed Meese, on the Hinckley verdict -% -You definitely intend to start living sometime soon. -% -You dialed 5483. -% -You display the wonderful traits of charm and courtesy. -% -You do not have mail. -% -You don't become a failure until you're satisfied with being one. -% -You don't have to be nice to people on the way up -if you're not planning on coming back down. - -- Oliver Warbucks, "Annie" -% -You don't have to explain something you never said. - -- Calvin Coolidge -% -You don't have to know how the computer -works, just how to work the computer. -% -You don't have to think too hard when you talk to teachers. - -- J. D. Salinger -% -You don't move to Edina, you achieve Edina. - -- Guindon -% -You don't sew with a fork, so I see no -reason to eat with knitting needles. - -- Miss Piggy, on eating Chinese Food -% -You enjoy the company of other people. -% -You feel a whole lot more like you do -now than you did when you used to. -% -You fill a much-needed gap. -% -You first have to decide whether to use the short or the long form. -The short form is what the Internal Revenue Service calls "simplified", -which means it is designed for people who need the help of a Sears -tax-preparation expert to distinguish between their first and last -names. Here's the complete text: - - "(1) How much did you make? (AMOUNT) - "(2) How much did we here at the government take out? (AMOUNT) - "(3) Hey! Sounds like we took too much! So we're going to - send an official government check for (ONE-FIFTEENTH OF - THE AMOUNT WE TOOK) directly to the (YOUR LAST NAME) - household at (YOUR ADDRESS), for you to spend in any way - you please! Which just goes to show you, (YOUR FIRST - NAME), that it pays to file the short form!" - -The IRS wants you to use this form because it gets to keep most of your -money. So unless you have pond silt for brains, you want the long -form. - -- Dave Barry, "Sweating Out Taxes" -% -You first parent of the human race... who ruined yourself for an apple, -what might you have done for a truffled turkey? - -- Brillat-Savarin, "Physiologie du go^ut" -% -You get along very well with everyone except animals and people. -% -You get what you pay for. - -- Gabriel Biel -% -You give me space to belong to myself yet without separating me -from your own life. May it all turn out to your happiness. - -- Johann Wolfgang von Goethe -% -You go down to the pickup station, - craving warmth and beauty; -You settle for less than fascination -- - a few drinks later you're not so choosy. -And the closing lights strip off the shadows - on this strange new flesh you've found -- -Clutching the night to you like a fig leaf - you hurry to the blackness - and the blankets to lay down an impression - and your loneliness. - -- Joni Mitchell -% -You got to be very careful if you don't know -where you're going, because you might not get there. - -- Yogi Berra -% -You got to pay your dues if you want to sing the blues, -And you know it don't come easy ... -I don't ask for much, I only want trust, -And you know it don't come easy ... -% -You guys have been practicing discrimination for years. -Now it's our turn. - -- Thurgood Marshall, quoted by Justice Douglas -% -You had mail, but the super-user read it, and deleted it! -% -You had mail. -Paul read it, so ask him what it said. -% -You had some happiness once, -but your parents moved away, and you had to leave it behind. -% -You have a deep appreciation of the arts and music. -% -You have a deep interest in all that is artistic. -% -You have a massage (from the Swedish prime minister). -% -You have a message from the operator. -% -You have a reputation for being thoroughly reliable and trustworthy. -A pity that it's totally undeserved. -% -You have a strong appeal for members of the opposite sex. -% -You have a strong appeal for members of your own sex. -% -You have a strong desire for a home -and your family interests come first. -% -You have a tendency to feel you are superior to most computers. -% -You have a truly strong individuality. -% -You have a will that can be influenced -by all with whom you come in contact. -% -You have acquired a scroll entitled 'irk gleknow mizk'(n).--More-- - -This is an IBM Manual scroll.--More-- - -You are permanently confused. - -- Dave Decot -% -You have all eternity to be cautious in when you're dead. - -- Lois Platford -% -You have all the characteristics of a popular politician: -a horrible voice, bad breeding, and a vulgar manner. - -- Aristophanes -% -You have an ability to sense and know higher truth. -% -You have an ambitious nature and may make a name for yourself. -% -You have an unusual equipment for success. -Be sure to use it properly. -% -You have an unusual magnetic personality. Don't walk too close to -metal objects which are not fastened down. -% -You have an unusual understanding of -the problems of human relationships. -% -You have been in Afghanistan, I perceive. - -- Sherlock Holmes, "A Study in Scarlet" -% -You have been selected for a secret mission. -% -You have Egyptian flu: you're going to be a mummy. -% -You have had a long-term stimulation relative to business. -% -You have junk mail. -% -You have literary talent that you should take pains to develop. -% -You have mail. -% -You have many friends and very few living enemies. -% -You have no real enemies. -% -You have not converted a man because you have silenced him. - -- John Viscount Morley -% -You have only to mumble a few words in church to get married -and few words in your sleep to get divorced. -% -You have the body of a 19 year old. Please return it before it gets -wrinkled. -% -You have the capacity to learn from mistakes. -You'll learn a lot today. -% -You have the power to influence all with whom you come in contact. -% -You have to run as fast as you can just to stay where you are. -If you want to get anywhere, you'll have to run much faster. - -- Lewis Carroll, - "Through the Looking-Glass, - and What Alice Found There" (1871) -% -You humans are all alike. -% -You just know when a relationship is about to end. My girlfriend called me -at work and asked me how you change a lightbulb in the bathroom. "It's very -simple," I said. "You start by filling up the bathtub with water..." -% -You just wait, I'll sin till I blow up! - -- Dylan Thomas -% -You k'n hide de fier, but w'at you gwine do wid de smoke? - -- Joel Chandler Harris, proverbs of Uncle Remus -% -You knew the job was dangerous when you took it, Fred. - -- Superchicken -% -You know, Callahan's is a peaceable bar, but if -you ask that dog what his favorite formatter is, -and he says "roff! roff!", well, I'll just have to... -% -You know how to win a victory, Hannibal, but not how to use it. - -- Maharbal -% -You know if they ever find a way to harness sarcasm as an energy source, -you people are all going to owe me big. - -- Bill Paul -% -You know it's going to be a bad day when you want to put on the clothes -you wore home from the party and there aren't any. -% -You know it's going to be a long day when you get up, shave and shower, -start to get dressed and your shoes are still warm. - -- Dean Webber -% -You know it's Monday when you wake up and it's Tuesday. - -- Garfield -% -You know my heart keeps tellin' me, -You're not a kid at thirty-three, -You play around you lose your wife, -You play too long, you lose your life. -Some gotta win, some gotta lose, -Goodtime Charlie's got the blues. -% -You know, of course, that the Tasmanians, who never committed adultery, -are now extinct. - -- W. Somerset Maugham -% -You know, the difference between this company and -the Titanic is that the Titanic had paying customers. -% -You know the great thing about TV? If something important happens -anywhere at all in the world, no matter what time of the day or night, -you can always change the channel. - -- Jim Ignatowski -% -You know very well that whether you are on page one or page thirty depends -on whether [the press] fear you. It is just as simple as that. - -- Richard M. Nixon -% -You know what I wish? I wish all the scum of the Earth had one throat -and I had my hands about it. - -- Rorschach, "Watchmen" -% -You know what they say -- the sweetest word in the English language -is revenge. - -- Peter Beard -% -You know what we can be like: See a guy and think he's cute one minute, the -next minute our brains have us married with kids, the following minute we see -him having an extramarital affair. By the time someone says "I'd like you to -meet Cecil," we shout, "You're late again with the child support!" - -- Cynthia Heimel, "A Girl's Guide to Chaos" -% -You know you are getting old when you think you should drive the speed limit. - -- E. A. Gilliam -% -You know you have a small apartment when Rice Krispies echo. - -- S. Rickly Christian -% -You know your apartment is small... - when you can't know its position and velocity at the same time. - you put your key in the lock and it breaks the window. - you have to go outside to change your mind. - you can vacuum the entire place using a single electrical outlet. -% -You know you're a little fat if you have stretch marks on your car. - -- Cyrus, Chicago Reader 1/22/82 -% -You know you're getting old when you're Dad, and you're measuring your -daughter for camp clothes, and there are certain measurements only her -mother is allowed to take. -% -You know you're in a small town when... - You don't use turn signals because everybody knows where you're going. - You're born on June 13 and your family receives gifts from the local - merchants because you're the first baby of the year. - Everyone knows whose credit is good, and whose wife isn't. - You speak to each dog you pass, by name... and he wags his tail. - You dial the wrong number, and talk for 15 minutes anyway. - You write a check on the wrong bank and it covers you anyway. -% -You know you're in trouble when... -1) You wake up face down on the pavement. -2) Your wife wakes up feeling amorous and you have a headache. -3) You turn on the news and they're showing emergency routes - out of the city. -4) Your twin sister forgot your birthday. -5) You wake up and discover your waterbed broke and then - remember that you don't have a waterbed. -6) Your doctor tells you you're allergic to chocolate. -% -You know you're in trouble when... -1) Your car horn goes off accidentally and remains stuck as you - follow a group of Hell's Angels on the freeway. -2) You want to put on the clothes you wore home from the party - and there aren't any. -3) Your boss tells you not to bother to take off your coat. -4) The bird singing outside your window is a buzzard. -5) You wake up and your braces are locked together. -6) Your mother approves of the person you're dating. -% -You know you're in trouble when... -(1) Your only son tells you he wishes Anita Bryant would mind - her own business. -(2) You put your bra on backwards and it fits better. -(3) You call Suicide Prevention and they put you on hold. -(4) You see a `60 Minutes' news team waiting in your office. -(5) Your birthday cake collapses from the weight of the candles. -(6) Your 4-year old reveals that it's "almost impossible" to - flush a grapefruit down the toilet. -(7) You realize that you've memorized the back of the cereal box. -% -You know you're in trouble when... -(1) You've been at work for an hour before you notice that your - skirt is caught in your pantyhose. -(2) Your blind date turns out to be your ex-wife. -(3) Your income tax check bounces. -(4) You put both contact lenses in the same eye. -(5) Your wife says, "Good morning, Bill" and your name is George. -(6) You wake up to the soothing sound of flowing water... the day - after you bought a waterbed. -(7) You go on your honeymoon to a remote little hotel and the desk - clerk, bell hop, and manager have a "Welcome Back" party - for your spouse. -% -You know you've been sitting in front of your Lisp machine too long -when you go out to the junk food machine and start wondering how to -make it give you the CADR of Item H so you can get that yummie -chocolate cupcake that's stuck behind the disgusting vanilla one. -% -You know you've been spending too much time on the computer when your -friend misdates a check, and you suggest adding a "++" to fix it. -% -You know you've landed gear-up when it takes full power to taxi. -% -You learn to write as if to someone else -because NEXT YEAR YOU WILL BE "SOMEONE ELSE". -% -You like to form new friendships and make new acquaintances. -% -You lived with a man who wore white belts? -Laura, I'm disappointed in you. - -- Remington Steele -% -You look like a million dollars. All green and wrinkled. -% -You look tired. -% -You love peace. -% -You love your home and want it to be beautiful. -% -You may already be a loser. - -- Form letter received by Rodney Dangerfield -% -You may be gone tomorrow, but that -doesn't mean that you weren't here today. -% -You may be infinitely smaller than some things, -but you're infinitely larger than others. -% -You may be recognized soon. Hide. -% -You may be right, I may be crazy, -But maybe it's a lunatic you're looking for? - -- Billy Joel -% -You may be sure that when a man begins to call himself a "realist," he -is preparing to do something he is secretly ashamed of doing. - -- Sydney Harris -% -You may carve it on his tombstone, you may cut it on his card -That a young man married is a young man marred. - -- Rudyard Kipling, "The Story of the Gadsbys" -% -You may easily play a joke on a man who likes to argue -- agree with -him. - -- Edgar W. Howe -% -You may get an opportunity for advancement today. Watch it! -% -You may have heard that a dean is -to faculty as a hydrant is to a dog. - -- Alfred Kahn -% -You may my glories and my state dispose, -But not my griefs; still am I king of those. - -- William Shakespeare, "Richard II" -% -You may not be able to judge a book by its cover, but -you sure as hell can tell how much it's going to cost. -% -You may worry about your hair-do today, but tomorrow much peanut butter will -be sold. -% -You mean you didn't *know* she was off -making lots of little phone companies? -% -You men out there probably think you already know how to dress for -success. You know, for example, that you should not wear leisure suits -or white plastic belts and shoes, unless you are going to a costume -party disguised as a pig farmer vacationing at Disney World. - -- Dave Barry, "How to Dress for Real Success" -% -You mentioned your name as if I should recognize it, but beyond the -obvious facts that you are a bachelor, a solicitor, a freemason, and -an asthmatic, I know nothing whatever about you. - -- Sherlock Holmes, "The Norwood Builder" -% -You might have mail. -% -You might like to know that I looked at a detailed map of NT, and I'm -now able to confirm that in all probability Microsoft NT does not -exist. If it does, it's so small as to be completely insignificant. - -- Greg Lehey -% -You must dine in our cafeteria. -You can eat dirt cheap there!!!! -% -You must include all income you receive in the form of money, property -and services if it is not specifically exempt. Report property (goods) -and services at their fair market values. Examples include income from -bartering or swapping transactions, side commissions, kickbacks, rent -paid in services, illegal activities (such as stealing, drugs, etc.), -cash skimming by proprietors and tradesmen, "moonlighting" services, -gambling, prizes and awards. Not reporting such income can lead to -prosecution for perjury and fraud. - -- Excerpt from Taxachussettes income tax forms -% -You must know that a man can have only one invulnerable loyalty, loyalty -to his own concept of the obligations of manhood. All other loyalties -are merely deputies of that one. - -- Nero Wolfe -% -You must realize that the computer has it in for you. The irrefutable -proof of this is that the computer always does what you tell it to do. -% -You need more time; and you probably always will. -% -You need no longer worry about the future. -This time tomorrow you'll be dead. -% -You need not worry about your future. -% -You need only reflect that one of the best ways to get yourself a -reputation as a dangerous citizen these days is to go about repeating -the very phrases which our founding fathers used in the struggle for -independence. - -- Charles A. Beard -% -You never gain something but that you lose something. - -- Thoreau -% -You never get a second chance to make a first impression. -% -You never go anywhere without your soul. -% -You never have to change anything you -got up in the middle of the night to write. - -- Saul Bellow -% -You never hesitate to tackle the most difficult problems. -% -You never know how many friends you have until you rent a house on the -beach. -% -You never know what is enough until you know what is more than enough. - -- William Blake -% -You never learned anything by doing it right. -% -You notice that after Ginzburg admitted he had tried marijuana everyone -got in line to admit it, too. But you also notice they all said they -"experimented" with marijuana. The didn't "use" it; they "experimented" -with it. Let me tell you something -- Jonas Salk "experiments"; these -guys were getting stoned! - -- Johnny Carson -% -You now have Asian Flu. -% -You or I must yield up his life to Ahrimanes. I would rather it were -you. I should have no hesitation in sacrificing my own life to spare -yours, but we take stock next week, and it would not be fair on the -company. - -- J. Wellington Wells -% -You own a dog, but you can only feed a cat. -% -You plan things that you do not even -attempt because of your extreme caution. -% -You possess a mind not merely twisted, but actually sprained. -% -You prefer the company of the opposite -sex, but are well liked by your own. -% -You probably wouldn't worry about what people -think of you if you could know how seldom they do. - -- Olin Miller -% -You recoil from the crude; you tend naturally toward the exquisite. -% -You roll my log, and I will roll yours. - -- Lucius Annaeus Seneca -% -You say potatoe, -And I say potato. -You say tomatoe, -And I say tomato. -Potatoe, potato, -Tomatoe, tomato. -Let's go be the Vice President... -% -You scratch my tape, and I'll scratch yours. -% -You see, I consider that a man's brain originally is like a little empty -attic, and you have to stock it with such furniture as you choose. A fool -takes in all the lumber of every sort he comes across, so that the knowledge -which might be useful to him gets crowded out, or at best is jumbled up with -a lot of other things, so that he has difficulty in laying his hands upon it. -Now the skillful workman is very careful indeed as to what he takes into his -brain-attic. He will have nothing but the tools which may help him in doing -his work, but of these he has a large assortment, and all in the most perfect -order. It is a mistake to think that that little room has elastic walls and -can distend to any extent. Depend upon it there comes a time when for every -addition of knowledge you forget something that you knew before. It is of -the highest importance, therefore, not to have useless facts elbowing out -the useful ones. - -- Sherlock Holmes -% -You see things; and you say "Why?" -But I dream things that never were; and I say "Why not?" - -- George Bernard Shaw, "Back to Methuselah" - [No, it wasn't John F. Kennedy. Ed.] -% -You see, wire telegraph is a kind of a very, very long cat. You pull -his tail in New York and his head is meowing in Los Angeles. Do you -understand this? And radio operates exactly the same way: you send -signals here, they receive them there. The only difference is that -there is no cat. - -- Albert Einstein, when asked to describe radio -% -You seek to shield those you love -and you like the role of the provider. -% -You shall be rewarded for a dastardly deed. -% -You shall judge of a man by his foes as well as by his friends. - -- Joseph Conrad -% -You should avoid hedging, at least that's what I think. -% -You should emulate your heros, but don't carry it too far. Especially -if they are dead. -% -You should go home. -% -You should make a point of trying every experience once -- except -incest and folk-dancing. - -- A. Bax, "Farewell My Youth" -% -You should never bet against anything in science at odds of more than -about 10^12 to 1. - -- Ernest Rutherford -% -You should never ride in an airplane with a sports team, -because if the plane goes down, it's you they're gonna eat! - -- Gordon Downie, singer for Tragically Hip -% -You should never wear your best trousers -when you go out to fight for freedom and liberty. - -- Henrik Ibsen -% -You should not use your fireplace, because scientists now believe that, -contrary to popular opinion, fireplaces actually remove heat from -houses. Really, that's what scientists believe. In fact many -scientists actually use their fireplaces to cool their houses in the -summer. If you visit a scientist's house on a sultry August day, -you'll find a cheerful fire roaring on the hearth and the scientist -sitting nearby, remarking on how cool he is and drinking heavily. - -- Dave Barry, "Postpetroleum Guzzler" -% -You should tip the waiter $10, minus $2 if he tells you his name, -another $2 if he claims it will be His Pleasure to serve you and -another $2 for each "special" he describes involving confusing terms -such as "shallots," and $4 if the menu contains the word "fixin's." In -many restaurants, this means the waiter will actually owe you money. -If you are traveling with a child aged six months to three years, you -should leave an additional amount equal to twice the bill to compensate -for the fact that they will have to take the banquette out and burn it -because the cracks are wedged solid with gobbets made of partially -chewed former restaurant rolls saturated with baby spit. - -In New York, tip the taxicab driver $40 if he does not mention his -hemorrhoids. - -- Dave Barry, "The Stuff of Etiquette" -% -You should, without hesitation, pound your typewriter into a -plowshare, your paper into fertilizer, and enter agriculture. - -- Business Professor, University of Georgia -% -You shouldn't have to pay for your love with your bones and your flesh. - -- Pat Benatar, "Hell is for Children" -% -You shouldn't wallow in self-pity. But it's OK to put -your feet in it and swish them around a little. - -- Guindon -% -You single-handedly fought your way into this hopeless mess. -% -You teach best what you most need to learn. -% -You think Oedipus had a problem -- Adam was Eve's mother. -% -YOU TOO CAN MAKE BIG MONEY IN THE EXCITING FIELD OF PAPER SHUFFLING! - -Mr. Smith of Muddle, Mass. says: "Before I took this course I used to be -a lowly bit twiddler. Now with what I learned at MIT Tech I feel really -important and can obfuscate and confuse with the best." - -Mr. Watkins had this to say: "Ten short days ago all I could look forward -to was a dead-end job as an engineer. Now I have a promising future and -make really big Zorkmids." - -MIT Tech can't promise these fantastic results to everyone, but when -you earn your MDL degree from MIT Tech your future will be brighter. - - SEND FOR OUR FREE BROCHURE TODAY! -% -You too can wear a nose mitten. -% -You tread upon my patience. - -- William Shakespeare, "Henry IV" -% -You two ought to be more careful-- -your love could drag on for years and years. -% -You want to know why I kept getting promoted? -Because my mouth knows more than my brain. - -- W. G. -% -You will always get the greatest recognition for the job you least like. -% -You will always have good luck in your personal affairs. -% -You will attract cultured and artistic people to your home. -% -You will be a winner today. Pick a fight with a four-year-old. -% -You will be advanced socially, -without any special effort on your part. -% -You will be aided greatly by a person -whom you thought to be unimportant. -% -You will be attacked by a beast who has the body of a wolf, the tail of -a lion, and the face of Donald Duck. -% -You will be audited by the Internal Revenue Service. -% -You will be awarded a medal for disregarding safety in saving someone. -% -You will be awarded some great honor. -% -You will be awarded the Nobel Peace Prize... posthumously. -% -You will be called upon to help a friend in trouble. -% -You will be dead within a year. -% -You will be divorced within a year. -% -You will be given a post of trust and responsibility. -% -You will be held hostage by a radical group. -% -You will be honored for contributing -your time and skill to a worthy cause. -% -You will be imprisoned for contributing -your time and skill to a bank robbery. -% -You will be married within a year. -% -You will be married within a year, and divorced within two. -% -You will be misunderstood by everyone. -% -You will be recognized and honored as a community leader. -% -You will be reincarnated as a toad; and you will be much happier. -% -You will be run over by a beer truck. -% -You will be run over by a bus. -% -You will be singled out for promotion in your work. -% -You will be successful in love. -% -You will be surprised by a loud noise. -% -You will be surrounded by luxury. -% -You will be the last person to buy a Chrysler. -% -You will be the victim of a bizarre joke. -% -You will be Told about it Tomorrow. Go Home and Prepare Thyself. -% -You will be traveling and coming into a fortune. -% -You will be winged by an anti-aircraft battery. -% -You will become rich and famous unless you don't. -% -You will contract a rare disease. -% -You will engage in a profitable business activity. -% -You will experience a strong urge to do good; but it will pass. -% -You will feel hungry again in another hour. -% -You will find me drinking gin -In the lowest kind of inn, -Because I am a rigid Vegetarian. - -- G. K. Chesterton -% -You will forget that you ever knew me. -% -You will gain money by a fattening action. -% -You will gain money by a speculation or lottery. -% -You will gain money by an illegal action. -% -You will gain money by an immoral action. -% -You will get what you deserve. -% -You will give someone a piece of your mind, which you can ill afford. -% -You will have a head crash on your private pack. -% -You will have a long and boring life. -% -You will have a long and unpleasant discussion with your supervisor. -% -You will have domestic happiness and faithful friends. -% -You will have good luck and overcome many hardships. -% -You will have long and healthy life. -% -You will have many recoverable tape errors. -% -You will hear good news from one you thought unfriendly to you. -% -You will inherit millions of dollars. -% -You will inherit some money or a small piece of land. -% -You will live a long, healthy, happy life and make bags of money. -% -You will live to see your grandchildren. -% -You will lose an important disk file. -% -You will lose an important tape file. -% -You will lose your present job and have to become a door to door -mayonnaise salesman. -% -You will meet an important person who will help you advance professionally. -% -You will never amount to much. - -- Munich Schoolmaster, to Albert Einstein, age 10 -% -You will never know hunger. -% -You will not be elected to public office this year. -% -You will obey or molten silver will be poured into your ears. -% -You will outgrow your usefulness. -% -You will overcome the attacks of jealous associates. -% -You will pass away very quickly. -% -You will pay for your sins. -If you have already paid, please disregard this message. -% -You will pioneer the first Martian colony. -% -You will probably marry after a very brief courtship. -% -You will reach the highest possible point in your business or profession. -% -You will receive a legacy which will place you above want. -% -You will remember something that you should not have forgotten. -% -You will remember, Watson, how the dreadful business of the Abernetty family -was first brought to my notice by the depth which the parsley had sunk into -the butter upon a hot day. - -- Sherlock Holmes -% -You will soon forget this. -% -You will soon meet a person who will play an important role in your life. -% -You will step on the night soil of many countries. -% -You will stop at nothing to reach your objective, -but only because your brakes are defective. -% -You will think of something funnier than this to add to the fortunes. -% -You will triumph over your enemy. -% -You will visit the Dung Pits of Glive soon. -% -You will win success in whatever calling you adopt. -% -You will wish you hadn't. -% -You won't skid if you stay in a rut. - -- Frank Hubbard -% -You work very hard. Don't try to think as well. -% -You worry too much about your job. -Stop it. You are not paid enough to worry. -% -"You would do well not to imagine profundity," he said. "Anything that seems -of momentous occasion should be dwelt upon as though it were of slight note. -Conversely, trivialities must be attended to with the greatest of care. -Because death is momentous, give it no thought; because victory is important, -give it no thought; because the method of achievement and discovery is less -momentous than the effect, dwell always upon the method. You will strengthen -yourself in this way." - -- Jessica Salmonson, "The Swordswoman" -% -You would if you could but you can't so you won't. -% -You'd best be snoozin', 'cause you don't -be gettin' no work done at 5 a.m. anyway. - -- From the wall of the Wurster Hall stairwell -% -You'd better beat it. You can leave in a taxi. If you can't get a -taxi, you can leave in a huff. If that's too soon, you can leave in a -minute and a huff. - -- Groucho Marx -% -You'd better smile when they watch you, smile like you're in control. - -- Smile, "Was (Not Was)" -% -You'd like to do it instantaneously, but that's too slow. -% -You'll always be, -What you always were, -Which has nothing to do with, -All to do, with her. - -- Company -% -You'll be called to a post requiring -ability in handling groups of people. -% -You'll be sorry... -% -You'll feel devilish tonight. -Toss dynamite caps under a flamenco dancer's heel. -% -You'll feel much better once you've given up hope. -% -You'll never be the man your mother was! -% -You'll never see all the places, or read all the -books, but fortunately, they're not all recommended. -% -You'll wish that you had done some of the -hard things when they were easier to do. -% -Young men are fitter to invent than to judge; fitter for execution than for -counsel; and fitter for new projects than for settled business. For the -experience of age, in things that fall within the compass of it, directeth -them; but in new things, abuseth them. The errors of young men are the ruin -of business; but the errors of aged men amount but to this, that more might -have been done, or sooner. Young men, in the conduct and management of -actions, embrace more than they can hold; stir more than they can quiet; fly -to the end, without consideration of the means and degrees; pursue some few -principles which they have chanced upon absurdly; care not how they innovate, -which draws unknown inconveniences; and, that which doubleth all errors, will -not acknowledge or retract them; like an unready horse, that will neither stop -nor turn. Men of age object too much, consult too long, adventure too little, -repent too soon, and seldom drive business home to the full period, but -content themselves with a mediocrity of success. Certainly, it is good to -compound employments of both ... because the virtues of either age may correct -the defects of both. - -- Francis Bacon, "Essay on Youth and Age" -% -Young men, hear an old man to whom -old men hearkened when he was young. - -- Augustus Caesar -% -Young men think old men are fools; -but old men know young men are fools. - -- George Chapman -% -Your aim is high and to the right. -% -Your aims are high, and you are capable of much. -% -Your analyst has you mixed up with another patient. -Don't believe a thing he tells you. -% -Your best consolation is the hope that the things -you failed to get weren't really worth having. -% -Your boss climbed the corporate ladder, wrong by wrong. -% -Your boss is a few sandwiches short of a picnic. -% -Your boyfriend takes chocolate from strangers. -% -Your business will assume vast proportions. -% -Your business will go through a period of considerable expansion. -% -Your code should be more efficient! -% -Your computer account is overdrawn. Please reauthorize. -% -Your computer account is overdrawn. Please see Big Brother. -% -Your conscience never stops you from doing anything. It just stops you -from enjoying it. -% -Your Co-worker Could Be a Space Alien, Say Experts - ...Here's How You Can Tell -Many Americans work side by side with space aliens who look human -- but you -can spot these visitors by looking for certain tip-offs, say experts. They -listed 10 signs to watch for: - #3. Bizarre sense of humor. Space aliens who don't understand - earthly humor may laugh during a company training film or tell - jokes that no one understands, said Steiger. - #6. Misuses everyday items. "A space alien may use correction - fluid to paint its nails," said Steiger. - #8. Secretive about personal life-style and home. "An alien won't - discuss details or talk about what it does at night or on weekends." - #10. Displays a change of mood or physical reaction when near certain - high-tech hardware. "An alien may experience a mood change when - a microwave oven is turned on," said Steiger. -The experts pointed out that a co-worker would have to display most if not -all of these traits before you can positively identify him as a space alien. - -- National Enquirer, Michael Cassels, August, 1984 - - [I thought everybody laughed at company training films. Ed.] -% -Your depth of comprehension may tend to make you lax in worldly ways. -% -Your digestive system is your body's Fun House, whereby food goes on a long, -dark, scary ride, taking all kinds of unexpected twists and turns, being -attacked by vicious secretions along the way, and not knowing until the last -minute whether it will be turned into a useful body part or ejected into the -Dark Hole by Mister Sphincter. We Americans live in a nation where the -medical-care system is second to none in the world, unless you count maybe -25 or 30 little scuzzball countries like Scotland that we could vaporize in -seconds if we felt like it. - -- Dave Barry, "Stay Fit & Healthy Until You're Dead" -% -Your domestic life may be harmonious. -% -Your education begins where what is called your education is over. -% -Your fault - core dumped -% -Your files are now being encrypted and thrown into the bit bucket. -EOF -% -Your fly might be open (but don't check it just now). -% -YOUR FOAMY FUTURE - by Miss Fortune - -AQUARIUS (Jan. 20 - Feb. 18) - You have nothing better to think about than what to wear and what -type of champagne to take to the neighbors Halloween Party. Just take beer! -Don't try to copy the "Joneses", pull them up to your level and remember, in -California Halloween is redundant anyhow. - -PISCES (Feb. 19 - March 20) - Focus on strengthening friendships this Fall. You find others are -fascinated by your intelligence, your wit, your drinking ability, and your -bank account. Just make sure you realize it's far more impressive when -other discover your good qualities without your help. -% -YOUR FOAMY FUTURE - by Miss Fortune - -ARIES (March 21 - April 19) - Matters are not good, where your health is concerned. This Fall, be -sure to "walk groundly, talk profoundly, drink roundly, and sleep soundly" -and you will live all the days of your life. - -TAURUS (April 20 - May 20) - You spent a fortune on beer this past summer and now find yourself -in a deep depression because you can't afford even one of your favorite -brewskis. Don't fret too much, Taurus. To get back on your feet simply -miss two car payments. - -GEMINI (May 21 - June 21) - You think you're falling in love with a person who has a lot in -common with yourself. You both prefer ales, you've both tried your hand -at homebrewing, and you both want to visit every new brewpub that opens. -Sounds impressive but remember you really don't know your partner until -you meet in court. -% -YOUR FOAMY FUTURE - by Miss Fortune - -CANCER (Jun 22 - July 22) - You've been awarded a clean bill of health this month and you feel -you owe it all to the excessive amount of Vitamin B, Iron, and Malt you get -in your beer. Being healthy is admirable but don't you think you're going -to feel stupid one day lying in a hospital dying of nothing? - -LEO (July 23 - August 22) - You will soon acquire a large sum of money and will be in seventh -heaven as you head to the nearest Liquor Barn and buy all the beer they have -in stock. Whoever said money couldn't buy happiness didn't know where to -shop. - -VIRGO (August 23 - September 22) - Your late night, beer drinking, "life in the fast lane" parties are -affecting your job production the next morning. You feel a nine to five job -is not for a "party animal" such as yourself and may feel the need for a -career change. Just remember, people who work sitting down get paid more -than people who work standing up. -% -Your friends will know you better in the first minute you -meet than your acquaintances will know you in a thousand years. - -- Richard Bach, "Illusions" -% -Your goose is cooked. -(Your current chick is burned up too!) -% -Your happiness is intertwined with your outlook on life. -% -Your heart is pure, and your mind clear, and your soul devout. -% -Your ignorance cramps my conversation. -% -Your life would be very empty if you had nothing to regret. -% -Your love life will be happy and harmonious. -% -Your love life will be... interesting. -% -Your lover will never wish to leave you. -% -Your lucky color has faded. -% -Your lucky number has been disconnected. -% -Your lucky number is 3552664958674928. -Watch for it everywhere. -% -Your manuscript is both good and original, but the part that is good is not -original and the part that is original is not good. - -- Samuel Johnson -% -Your mind is the part of you that says, - "Why'n'tcha eat that piece of cake?" -... and then, twenty minutes later, says, - "Y'know, if I were you, I wouldn't have done that!" - -- Steven and Ondrea Levine -% -Your mind understands what you have been -taught; your heart, what is true. -% -Your mode of life will be changed for -the better because of good news soon. -% -Your mode of life will be changed for -the better because of new developments. -% -Your mode of life will be changed to ASCII. -% -Your mode of life will be changed to EBCDIC. -% -Your mothers ghost stands at your shoulder -Face like ice, a little bit colder -She says "You can't do that it breaks all the rules -You learned in school" -But I don't really see -Why can't we go on as three? - -- David Crosby, "Triad" -% -Your motives for doing whatever good deed you -may have in mind will be misinterpreted by somebody. -% -Your nature demands love and your happiness depends on it. -% -Your object is to save the world, -while still leading a pleasant life. -% -Your only obligation in any lifetime is to be true to yourself. Being -true to anyone else or anything else is not only impossible, but the -mark of a fake messiah. The simplest questions are the most profound. -Where were you born? Where is your home? Where are you going? What -are you doing? Think about these once in awhile and watch your answers -change. - -- Messiah's Handbook: Reminders for the Advanced Soul -% -Your own qualities will help prevent your advancement in the world. -% -Your password is pitifully obvious. -% -Your picture of the world often changes just before you get it into focus. -% -Your present plans will be successful. -% -Your program is sick! Shoot it and put it out of its memory. -% -Your reasoning is excellent -- it's -only your basic assumptions that are wrong. -% -Your reasoning powers are good, and you are a fairly good planner. -% -Your responsibility as a parent is not as great as you might imagine. You -need not supply the world with the next conqueror of disease or major motion -picture star. If your child simply grows up to be someone who does not use -the word "collectible" as a noun, you can consider yourself an unqualified -success. - -- Fran Lebowitz, "Social Studies" -% -Your sister swims out to meet troop ships. -% -Your society will be sought by people of taste and refinement. -% -Your step will soil many countries. -% -Your supervisor is thinking about you. -% -Your talents will be recognized and suitably rewarded. -% -Your temporary financial embarrassment will -be relieved in a surprising manner. -% -Your true value depends entirely on what you are compared with. -% -Your wig steers the gig. - -- Lord Buckley -% -Your wise men don't know how it feels -To be thick as a brick. - -- Jethro Tull, "Thick As A Brick" -% -Your worship is your furnaces -which, like old idols, lost obscenes, -have molten bowels; your vision is -machines for making more machines. - -- Gordon Bottomley, 1874 -% -You're a card which will have to be dealt with. -% -You're a good example of why some animals eat their young. - -- Jim Samuels to a heckler - -Ah, yes. I remember my first beer. - -- Steve Martin to a heckler - -When your IQ rises to 28, sell. - -- Professor Irwin Corey to a heckler -% -You're all clear now, kid. -Now blow this thing so we can all go home. - -- Han Solo -% -You're almost as happy as you think you are. -% -You're already carrying the sphere! -% -You're always thinking you're gonna be -the one that makes 'em act different. - -- Woody Allen, "Manhattan" -% -You're at the end of the road again. -% -You're at Witt's End. -% -You're being followed. Cut out the hanky-panky for a few days. -% -You're currently going through a difficult transition period called "Life." -% -You're definitely on their list. -The question to ask next is what list it is. -% -You're either part of the solution or part of the problem. - -- Eldridge Cleaver -% -You're growing out of some of your problems, -but there are others that you're growing into. -% -You're just the sort of person I imagined marrying, when I was little... -except, y'know, not green... and without all the patches of fungus. - -- Swamp Thing -% -You're never too old to become younger. - -- Mae West -% -You're not Dave. Who are you? -% -You're not drunk if you can lie on the floor without holding on. - -- Dean Martin -% -You're not my type. For that matter, you're not even my species!!! -% -You're ugly and your mother dresses you funny. -% -You're using a keyboard! How quaint! -% -You're working under a slight handicap. -You happen to be human. -% -Yours is not to reason why, -Just to Sail Away. -And when you find you have to throw -Your Legacy away; -Remember life as was it is, -And is as it were; -Chasing sounds across the galaxy -'Till silence is but a blur. - -- QYX -% -Youth. It's a wonder that anyone ever outgrows it. -% -Youth -- not a time of life but a state of mind... a predominance of -courage over timidity, of the appetite for adventure over the love of ease. - -- Robert F. Kennedy -% -Youth had been a habit of hers so long that she could not part with it. -% -Youth is a blunder, manhood a struggle, old age a regret. - -- Benjamin Disraeli, "Coningsby" -% -Youth is a disease from which we all recover. - -- Dorothy Fuldheim -% -Youth is such a wonderful thing. What a crime to waste it on children. - -- George Bernard Shaw -% -Youth is the trustee of posterity. -% -Youth is when you blame all your troubles on your parents; maturity is -when you learn that everything is the fault of the younger generation. -% -You've always made the mistake of being yourself. - -- Eugene Ionesco -% -You've been Berkeley'ed! -% -You've been leading a dog's life. Stay off the furniture. -% -You've been telling me to relax all the way here, -and now you're telling me just to be myself? - -- The Return of the Secaucus Seven -% -You've decked the halls with a dozen miles' length of electric lights. -Your front lawn is a gleaming testament of incandescent wonder. The neighbors -wear sunglasses 24/7, and orbiting satellites have officially picked up -and pinpointed your house as the brightest spot on earth. - -You've finally put together the Christmas wonderland of your dreams... now -if only you could get a good picture of it. - -Photographing holiday lights is no easy task. - -- from an email sent by photojojo.com -% -You've got to have a gimmick if your band sucks. - -- Gary Giddens -% -You've got to pity New Mexico... so far from heaven and so close to Texas. -% -You've got to think about tomorrow! - -TOMORROW! I haven't even prepared for *_y_e_s_t_e_r_d_a_y* yet! -% -YO-YO: - Something that is occasionally up but normally down. - (see also Computer). -% -Zall's Laws: - 1: Any time you get a mouthful of hot soup, the next thing you do - will be wrong. - 2: How long a minute is, depends on which side of the bathroom - door you're on. -% -Zeal, n.: - Quality seen in new graduates -- if you're quick. -% -Zero Defects, n.: - The result of shutting down a production line. -% -Zero Mostel: That's it baby! When you got it, flaunt it! Flaunt it! - -- Mel Brooks, "The Producers" -% -Zeus gave Leda the bird. -% -Zisla's Law: - If you're asked to join a parade, don't march behind the elephants. -% -Zounds! I was never so bethump'd with words -since I first call'd my brother's father dad. - -- William Shakespeare, "King John" -% -Zymurgy's Law of Volunteer Labor: - People are always available for work in the past tense. -% diff --git a/usr.bin/fortune/datfiles/fortunes.sp.ok b/usr.bin/fortune/datfiles/fortunes.sp.ok deleted file mode 100644 index 02229cd5a791..000000000000 --- a/usr.bin/fortune/datfiles/fortunes.sp.ok +++ /dev/null @@ -1,4469 +0,0 @@ -# $FreeBSD$ -AAAAAAAAAaaaaaaaaaaaaaaaccccccccckkkkkk -AAAARRRRGGGGHHHH -aafte -Abbie -ABC -ABC's -ABCDEF -Abelson -abends -ABENDs -Abernetty -abhors -ABM -Absolutum -absurdum -Abzug -AC -acacia -Academicians -accessibleness -accurancy -accursed -accusator -Achenbach -Acheson -ACHTUNG -ACLU -ACLU's -acne -acupuncture -Adamite -Ade -Adenauer -Adhem -Adhem's -adhoc -Adidas -adj -Adkin -Adlai -Adler -Adler's -admin's -Adolf -adv -Aelius -Aeroflot -Aeschylus -Aesop -Aesop's -AFOF -Agnew -Aha -Ahab -Ahhh -ahhhed -Ahhhhhh -Ahrimanes -AI -AIIIEEEEEE -Aiken -Aim's -airbags -Akakia -Akihabara -Alaquon -Albertano -Albran -ALBRECHT'S -Alcoente -Aldiss -Aldo -Aldous -Aldrich -Aleksandr -Aleliunas -Alfieri -Algolian -ALgorithmic -Algren -Ali -Alighieri -alimentary -Alinsky -Alito -alkafluence -All's -Allan -alleygaroo -Allman -Allucquere -Alo -Alph -Alpo -alrighty -Altgeld -Alther -Altman -altum -ALU -Alva -Alvarado -Alvy -Alzado -Amana -Ameche -Amerigo -Ameringer -Amica -Amiri -Amityville -amnesia -Amp -Amputees -Amrom -anal -Ananthanarayanan -anat -Anatol -anatomies -Anaxagoras -anchorman -andIsaidYesIsee -Andrea's -Andretti -Androids -Andropov's -Angelou -animalculous -Animaux -Ankh -Annaeus -Annau -Anoint -anomali -Anorexic -Anouilh -ANRS -Ansley -answerback -Anthony's -Antonym -Antrim -Anwar -anxivs -anymore -anytime -AOPA's -apauling -apertures -APL -Apocryphia -apolitical -apostrophe's -appelations -Applebome -Appleby -Appledom -approx -Apr -Aquadextrous -Aquarians -archaisms -ARCHDUKE -Archimedeans -Arcturan -Ardele -Ardis -Arenberg -Arendt -arias -Aristophanes -Arlen -Arlo -Arman -Armenians -Armistead -Arnoux -Arrakis -Arsdall -arse -Artemus -Arthur's -Artic -Artoo -Arturo -artworks -ary -ASCAR -asdf -Ashbula -ASHes -Ashleigh -Asimov -asketh -Aspasia -Aspin -Assateague -assed -Assoc -AST's -Astaire's -asterisked -Asterix -asthma's -Astro -astrology -Astroturf -asvgy -Atlee -ATN -atrium -Attila -Auberon -Auden -AUDITME -Audubon -Auerbach -Aug -Augier -Aunty -Auribus -Aurobindo -ause -ausgraben -Austen -AUUGM -Avengers -Avocado's -Avogadro's -awakenings -awestruck -awk -AWNS -awoken -Aww -Axton -Ayn -Ayres -AZ -Azerbaijanis -B'nai -Ba -Baaa -Baaaaah -Baba -Babbage -Babson -bac -Bacall -Bachtrian -backflips -backfstat -backhoe -backlit -backscratcher -bacon's -Baez -Bagbiter -bagbiting -Bagdikian's -bagel -Baggins -bahz -bai -Balfour -ballasted -Balliett -BALLISTOPHOBIA -Balloonists -Balmford -Balthazar -bamboozled -Banacek's -Banach -bananosecond -Bandifante -Banectomy -Bankhead -banquette -Banton -Barach's -Baraka -Barbara's -Barbie -BARC -barf -BARFUCIOUS -Bargewater -Barker's -Barrie -Barris -barristers -Barrymore's -Barth's -Baruch's -BASICs -Basie's -Baskins -bassists -Bathquake -Batman -Battie -Battlecruiser -Baum -Baumol -Bax -Baycon -baygulls -bayonetted -bazingas -BBBF -BBC -BBW -BC -Beagle -Beal -BEANSTACK -bearproof -Beatles -Beaton -Beatty -Beaumadine -Beaumarchais -Beauvoir -Becker's -Beckett -Beckmann -BeDears -bedecked -bedfellows -bedpans -beduerfen -Beeblebrox -Beekman -beepers -Beer's -Beerbohm -Beerbohm's -Beeton -befriends -Begathon -Begatting -Begone -Behan -Behrendt -Beifeld's -being's -Belchazar -beleaguered -believer's -Bellamy -Bellbottoms -Belli -Belloc -Benares -Benatar -Benchley -Benson's -Bento's -bequeathin -Bergman -Berke -Berle -Bernadette -Berner -Bernighan -Berquier -Berryman -Bershere's -bertillion -Bertolt -Besicovitch -Beslove -Betazoid -Bette -Bevan -BEW -Beyerstein -BH -Bics -bicuspids -Bidell -Bidlake -Bierce -Bierman's -Biff -bigamystery -Bigfoot -Biggs -Billericay -billigrahams -Bing's -bingo -Binstead -Bionic -Birnbaum -bisexual -Bistromathics -BITCHEN -BITCOUNT -Bitti -Bizoos -Bjarne -bjnk -Blaauw -blackguard -blackrimmed -BLAH -Blaise -blandishments -BLEAH -BLETCHEROUS -blindman's -blinkenlights -Blish -blockhead -Bloodnok -Bloom's -Bloomberg -Bloomingdale's -Blore -Blore's -blotters -BLOTTO -blound -Blount -blowenfusen -Bluestone -Blutarsky's -Blythe -BMR -BMW -Bodanis -Bodenheim -body's -Boffo -bogglingly -bogons -bogosity -Bohr's -Boies -Bok -Bokonon -Boleyn -Bolger -Boling's -Bolotin -Boltzmann's -Bolub's -Bombeck -Bombeck's -Bompzidaize -Bonanno -Bondian -bonehead -bonked -Bonnard -bonnie -Boob's -boobs -Booch -BOOGA -booing -bookaholic -Booker's -boola -Boorstin -bootable -Boothe -Bootle -Boquist -Boren -Boren's -Borge -Borges -Borgias -Bosquet -boss's -Bossert -bossy -Bostic -Boucher's -Bounceoids -Bounders -bounteous -Bourget -Bourjaily -Bower's -Bowie's -bowlin -boyfriend -Boyland -Boyle -Boynton -Bozoness -Bozos -BPO -bra -Brackett -Bradley's -Brady's -Brahma -brain's -Bramah -Brandirali -Brando -Brandwein -Brautigan -BREAKAGES -Brecher -Brecheux -Brecht -Brenan -Brescia -Breslin -brewsky -Brewster's -Brezhnev -Briarton -Brickman -brilgue -brilig -Brillineggiava -bringeth -Brith -Broder -Brodsky -Brogan's -Broido -Bromberg -Brontosaurus -Brooke's -Brophy -Brosnan -Broughton -Brownmiller -Broxton -brucification -brucified -brucify -Brunner -Bruton -Brutus -Bruyere -Brylcreem -Brynner -Bryson -BST -BTUs -Bubba -Buckley -Buckminster -bucky -Bucy's -budgie -budgies -Buford -Buford's -bug'll -Buggles -Bugleboy -Bugsy -Buhr -Bukhara -Bukowski -Bull's -bullpen -bullrushes -Bullwinkle -Bulwer -bumperless -Bumstead -Bungei -Buren -Burggoven -burgled -Burke's -Burkhalter -Burkowski -Burn's -burneth -Burnham -Bush's -Busmanship -BUTTERWORTH -BUTTHEADS -buzzzzzzzzplooop -bwuck -BX -BYOB -Byrd's -Bysshe -c'est -C'mon -Caaaall -caaddr -caadr -CAAR -cabbies -CABERNET -Cabots -Cabrillo -cadadr -cadavers -CADDR -CADR -Caen -Caesar's -Caicedo -Caillavet -Caissons -Calafia's -Calibree -Calibrees -Calio's -Callahan -Callahan's -Callimachus -Camden -Cameron -Camillo -Campbell -Campbell's -Camptown -Candice -Capades -capillarized -Capone -Capone's -Capt -carabineri -Caramels -carbolized -cardio -Cardozo -Carey -Carly -Carlyle's -Carmel -Carney's -Carotene -Carotene's -Carperpetuation -Carroll -Carson's -Carswell's -CARTABLANCA -Cartmill -Carus -Cary -Casablanca -Caskie -Caspar -Cassidy -castaways -Castenada -Casteneda -catalyzes -Catchings -Catflap -Catiline -Cato -Catullus -caulking -causeth -Cavett -Cavour -CB -cbosgd -CBS -CChheecckk -CCI -CDAR -cddr -CDR -CDS -Cebrian -Cec -Cecelia -Celibacy -Celtics -Celts -Centauri -centerfold -Cerebron -Cerebus -Cerf -Cestria -cevalon -cevalovipus -CFF -Chadwick -chainsaw -challengehood -Chameleotoptor -Chamfort -Chaney -Changtse -Channing -Chapin -Chappaquidick -Chapterhouse -charbroiled -CHARDONNAY -Charnelhouse -Charnock's -chastened -Chateaubriand -Chatterley's -Chauncey -Chavez -Chaykin -Chazal -Cheatham -CHECK'S -cheddar -cheesemakers -Cheetos -Cheez -Cheit's -Chekov -Chem -chemotherapy -cheque -Chernenko -Chesterson -cheval -Chevins -chezlogs -Chichester -Chihuahuas -childproof -childproofed -chimeras -chimp -chimpanzee's -Chincholles -Chinggis -chirruped -Chism's -Chisolm's -Chivas -ChiWriter -Chloroplast's -Chmod -chmod'd -Chok -CHOMPER -CHOMPING -Choo -chopsticks -chown -Christensen -Christgau -chromosome -chronodimensional -chroots -Chrysostom -Chuan -Chuang -Chung's -Church's -Churchill's -Churchy -Chuzzlewit -CI -Ciardi -cinched -cinema's -Cinemuck -Claghorn -Clair -Clairol -Clampett's -Clapiers -Clapton -Clarke's -Clarkson -Claudette -claus -Clavin -Clavin's -CLBR -CLBRI -Clemenceau -Cleyre -clickity -Clifton -Clopton -clovers -Clutterbuck -CMFRM -cmptr -Cobalt's -Cobb -Cobb's -Cochran -cockamamie -Cocteau -Cody -Coevolution -cogito -Cohen's -Cohn's -Cointment -Colbert -Cole's -Colette -Collis -Collymore -Colson -Colton -Colvard's -Comaneci -Combermere -Comebacks -Commedia -Commie -CommUNIXque -computatis -Computerdom -computerites -Computerspeak -Computo -Conan -congeries -CONGRAM -congresspersons -Coningsby -Conkling -conks -Connell -Connellan -Connery -consoleth -Constipation -contendere -continuums -CONtractor -Contrariwise -conversationalists -Conway -Conway's -Cooley -COONDOG -Coonts -copacetic -Coppock -Coppola -Corbomite -corkenpoppen -Corky -coroner's -corpuscle -Corrado -Corry's -Cortot -Corwin -Cory -Cosby -Cosmo -Cosmotronic -COUGHBOL -Coult -countdown -coupestibles -Court's -CP -CPPR -cpu -CPUs -crabgrass -crapshoot -Cray -Crayolas -Creemy -Crenna's -cretinisms -Crichton -criminology -Cringely -Cripps -Crisco -CRN -Croce -croissants -Croll -Croll's -Cronkite -Cropp's -croquet -crosseth -crossoffs -crossword -crowbar -Crucifixes -cruftier -Cruickshank's -crunchy -crustaceans -Crustimoney -crusty -Cruz -CS -CSA -CSH -cshrc -CSICOP -CSSG -CTA -Cthulhu -CTY -Cuba's -cuckolds -CUISINART -cummings -Cuomo -curiae -CUSPy -Custer -custodiet -cuticle -CVP -Cyberiad -cybernetic -Cyborg -cynic's -d'Albert -D'Arcy -D'Azevedo -D'Hericault -d'oeuvres -Dabba -DAC -Daft -Dagobah -Dagwood -Daibashiw -Daley -Dalglish -Damian -DAMMIT -dancer's -Dandridge -dandruff -Dangerfield -dans -darkish -darkroom -Darrow -Darryl -Darth -Darwin's -Darwinians -das -Dass -Datamation -datasheets -dataspec -DAV -Davey -Davis's -Davisson -Dawkins -dawn's -DC -DCL -DCS -dduupplleexx -deadest -Deadnet -DEALISM -DEC's -Decapitating -decipi -decipiatur -deconstructionists -Decot -DECtapes -DECWARS -DECWORLD -DECzilla -DEF -Defactualization -defamed -Deford -DEFUN -defuse -DeGaulle -DeGourmont -DeLescure -delivermail -DeLorean -Delores -Deloria -demagogism -demigodic -demo -Democritus -Demosthenes -Denham -Dennett -Denning -Denniston -Depew -deppart -deregulated -dermis -DeSalvo -Desiree -deStalinization -destitution -destructure -Deteriorata -determinists -Detroit -Devine -Devo -DeVries -Dexter's -dextrose -DFA -Diamondback -Dibble's -Dickery -diddie -Diddley -Diddly -Didion -Didja -dieeeeee -Diefenbaker -DIETER'S -Dieu -Dijkstra -Dilbert -Diller -Diller's -Dills -DiMarco -dimwit -dinette -Dingell -Dino -Diran -Dirbanu -Dirisha -Dirksen -Dirksen's -disarrayed -disco -discotheques -disenchanted -dishes -dishonourable -dishrags -dishwashing -disjoins -diskdrives -dismembering -Disraeli -Divina -DIX -dixerunt -Diyathinkhesaurus -DJ -DMPK -Dobb's -Dobbs -Dobie -Doc -Docquier -doderez -doggerel -doggy -dogmatized -DOGO -Dogtender -Doheny's -Dolby -doloop -Dolotta -Dolph -Donatus -Donleavy -Donnell -Donner -Doo -DOODAH -Dooley's -Doonesbury -doorstops -Doppelgutt -Doren -dorky -dost -doth -dotty -Doublespeak -Dow's -downslide -DP -Drabek -Dracula -Drake's -Drakenberg's -draweth -Drescher -Dreshfield -Drew's -drivel -drop't -Dropt -Droz -Drucker -Druids -druther -druthers -DSK -Ducharme's -Duckie -Duckies -Ducky -dudes -dUdX -duenkt -Duggan -Dukakis -Dum -dumbass -Dumbfounding -dummkopfen -dumpster -Dunaway -Dunne -dunno -Durance -Durant -Durante -Durocher -Dutsky -dwelleth -Dyer's -Dykes -dyslexic -Dyson -Eagleson -Eagleson's -earflaps -EAROM -Earthlings -Eater's -EBCDIC -Ebenezum -Ebert -Ebner -ecamier -Eckstein -ECL -Ecoles -ecosphere -Edina -Edison's -Edman -Edmonson's -Edna's -Edpress -EDSAC -Edsel -EDT -educationists -EE -EECS -eeee -eeeee -eeeeee -Eeny -Eeyore -egg's -Eggheads -eggnog -egoless -Egomaniac's -egrep -Ehrenfest -Ehrman's -Eichmann's -Eiffelberg -Einhorn -EINS -Einstein's -Eisley -Elbert -Eldridge -electrocommunications -Electrocution -electrofreak -electromicrograph -Electroworld -eliras -elitist -Ellery -Elliot -Elmo -ELO -Elroy -Elton -Elven -Elvis -Elvish -embalmer's -Emersons -Emile -Emmons -Emo -empathetical -EMPC -Emu -Encyclopaedia -endian -Enesco -Enfolding -England's -Englishman's -ENIACs -enkindles -Enm -Ennius -Ennui -ENOTADUCK -Epcot -Ephron -EPI -Epictetus -Epitres -Epperson's -Erdman's -ergo -ergonomically -Erhard -Erlenmeyer -Erlich -Erling -Erogenous -erogeny -Ertz -Esalen -Esar -escalators -Eschenbach -Escher -esperantisto -Esplandian -est -estas -Estes -Estienne -ethernet -Etienne -Etudes -etus -Euch -Euell -Euler's -eurocentric -Eustace -ev'ry -EVAL -Eve's -Evelyn's -Everclear -Evinrude -EWD -EXCE -excitements -exCUUUUUSE -executioners -exhalation -exhibitionists -EXP -expatriated -extracurricular -Exupery -Exxon's -eyestalks -Eyquem -Ezrin -FAA -Factorials -Fadiman -Fafhrd -Fagan -Fagon -fainali -fairings -fairminded -Faisse -Fakir -Falkland -fallaron -Fallian -familiares -Fandal -fandangos -FARECARD -Farnum -Farrah -Farrow -fatback -Fatherland -faudrait -faut -Fawcett -FC -FCN -feeder's -Feghoot -Feibleman -Feiffer -Feiner -Feirstein -fella -Fellgett's -Felton -feminism's -Femme -Fenelon -Fenster -Ferber -Ferengi -Ferentz -Ferguson's -Ferm -Fermat's -Ferrari -FERSURE -fertsneet -Festa -fetishists -Feynman -FF -FFT -FHA -FICA -Fidel -Fiebig -Fiedler -figgy -fighting's -Figliuolo -fikcio -fiks -filees -filename -filigrees -Filkharmonics -Fillmore -filors -Finagle -Finagle's -Finagling -findeth -Fine's -Finke -Finklestein -finks -Finley -FINO -Finster's -firehose -Firesign -Firth -Fishhawk -fix'd -fixin's -Flaccus -Flagg -Flakey -flamewars -Flandry -Flannagan's -Flannery -Flappity -flatfoot -flatteries -Flaubert -Fleischman's -Flintstone -flippered -Flon's -floppity -Florio -floss -Flugg's -Flummery -flutterby -flyswatter -Fogerty -Foghorn -foghorns -folkloric -Follen -fool's -Forbiddie -Forcade -forelegs -foreplay -fornia -forsooth -Forssman -fortiter -Fortue -Fosdick -fountainheads -Fowler's -fractal -Frampton -Fran -Francois -Frankau -Frankenstein's -Franklin's -FRAS -Fratianno -Frayn -freaking -FreeBSD -FreeBSDcon -freelancer -Freeman's -freezin -Freitzke's -Frenchman's -Fresco's -Freudians -fridge -Fried's -Friedenberg -Friedrich -Friendman -frillant -Frisbee -Frisbees -Frisbeetarianism -Frito -Fritzkee's -Fritzlar -frob -frob'nitsm -Frobazz -frobbing -FROBBOTZIM -FROBBOZ -Frobenius -Frobnicate -Frobnitz -Frobnitzem -FROBNODULE -FROBNULE -FrobTech -FROBULE -frolicked -Froot -Frostee -FROTZ -FRS -fruitcake -fruitcakes -frumious -Frumkes -fseek -FTC -FTL -FTSD -Fuch's -Fudd -Fudd's -fuddyduddy -Fuldheim -Fulghum -Fulke -fumblefingers -functionaries -funhouse -Fuoss -Furbling -Furst -FWWAAAAAAPPPP -Fylstra -Fyodor -Gabe's -Gabor -Gadsbys -Gaius -Galactica -Galbraith -Galbraith's -Galilei -Galileo -Galileo's -Gallagher -Galliano -Gallienne -Gallois -galore -Galsworthy -Galton -Galvani -Galvani's -gambler's -gamekeeper -Gamekeeping -Gandalf -Gandhi -ganz -Garagiola -Garbers -Gardner's -garnishment -Garp -Gatling -Gaulle -Gauls -Gaultier -Gauvreay -Gaveau -GC -GCC -GCing -GCs -Gdansk -gefingerpoken -Geis -Gelbart -Gellett -Geminis -Genderplex -Genesereth -Genghis -genocide -Genter -Geritol -Germaine -Gerould -Gerrold's -Gesserit -gesteckt -getchar -Getraenke -Gettys -gewerken -gharsley -Ghostbusters -Giancana -Gibaud -Gibran -Gibrovacco -Giddens -Giesing -giftlist -Gigo -Gilbert's -Gilchrist -Gilda -Gilliam -Gilmore -Gilpkerio -gimble -Gimlet -Gimme -gimmick -gimmie -Gingell -gingivectomist -Ginsberg -Ginsberg's -Ginsburg's -Ginzburg -Giraudoux -Giraudy -girlfriend -Giuggiolo -Giuseppe -Glanvill -Glaser -gleekzorp -Glegg -gleknow -Glib's -Glimco -globby -Gloffing -Glogg -glowworm -Glymour -glyphs -GMT -Gnagloot -gobbets -Gobel -GOBLIN -Goda's -Godard -Godard's -Goddard's -Godel's -Godot -Godzilla -Goebbels -goest -Goestheveezl -goeth -Gold's -Golda -Goldengrove -Goldenstern -Goldenstern's -Goldfinger -Goldfoot -Goldwater's -Goldwyn -Goleta -Gomme's -Gondoliers -gonna -Gonnet -goodbye -GoodGulf -Goodgulf -Goodstein -Gopete -Gorbachev -Gorden -Gordon's -Gorey -Gorin -Gossling -Gotlieb -goto -goto's -Gotos -GOTOs -gotta -Gotti -Goudsmit -gougebosquex -Gould -Goulden -GOUTS -Goy's -goyim -goyish -goyisha -GPU -Grabel's -Graf -Graffiti -graffitiest -graffito -Grainger -Grainger's -Gramm -grammarian's -GRAMmer -Grandad -grandsires -Granholm -Grantland -Graper -GRASSHOPPOTAMUS -grave's -gravitons -Gravity's -Gray's -Greaser's -Green's -Greener's -Greenfatigues -Greenleaf -Greensleeves -Greenspun's -Greenstein -Greenstreet -Greer -Gregorian -Gregory's -Greider -Grelb's -grep -Gretzky -Greville -Gries -Griffin's -Grinnell's -Gripton -Grishman -Grizzard -grizzlies -GRODY -Groening -Grogan -grok -grommets -Groucho -grouse -Gruber -gry -Guadalajara -Guardsman -Guaspari -guave -Guerre -Guerrero -GUGUs -guideth -Guildenstern -Guindon -Guinness -Gulag -Gulbenkian -gumball -gumballs -Gumbinowitz -GUMM -GUMMed -Gumperson's -Gumps -gunships -Gunter's -guppies -Gurmlish -Gusenberg -Gustav -Gustave -guttersnipe -Gutzwiller -Guzik -Guzman -Gween -Gyles -gyre -gyrent -haben -Hackensack -Hacking's -Hadamard -Hadamard's -Hadassah -hadda -Haeckel -hag's -Hagar's -Hahahahahahahahaha -Haig -hairstyles -Hakuin -Halas -Haldeman -Haley -halfbreed -halfwits -Halley's -Hallifax -Halliwell -Hallock -hallucinogens -Halpern -HALs -Halsey -Halstead -Hammarskjold -Hammerstein -handcraftsmanship -Handel's -Handey -handsprings -handwaving -hanky -Hanlon's -Hanson's -Hanukka -Harary -Harbride -hardbound -hardcore -Hardluckland -Hargrave -Harlan -Harlequin -Harley -Harlow -Harpo -Harpoon -Harriet's -Harris's -Harrisberger's -Harrison's -Harrold -Harter -Hartke -Hartley's -Harvard's -hast -Hathrume -Hausdorff -Havabanana -Havelock -HavenTree -Hawes -Hawkeye -Hawkeye's -Hawkwind -Hayakawa -Hayden -Haynie -Hazlitt -HBD -HCF -headgear -Heartwarming -heatwave -Hebb -hectare -HED -Hedy -HEE -Hegel -heifer's -Heimel -Heine -Heineken -Heinlein -heinous -Helen's -Helens -Helga -Heller's -Helliconia -Helllloooooo -Hellman -Hellman's -HELMS -hematophagous -Hemiel -Henningsen -Henny -Henri -Henrik -Henson -Hepler -her's -Herbert's -Herford -hermit -hernias -Herrgott -Hershey's -Herth's -Herzog -hev -Hewett's -Hewitt -hexagram -Hexahex -Hickery -Hickson -Higgeldy -Higgins -highbrow -Hightower -Hilaire -Hildago -Hildebrandt -Hildebrant's -Hillary's -Hillbillies -Hinckley -Hinckley's -Hindenburg -Hipcrime -Hippensteel -Hippocrates -hippogriff -hippopotamuses -Hirschfield -Hitchcock's -Hitchhiker's -Hiya -hjioasdvbnuio -Hlade's -Hmm -Hmmm -Hmmmm -Hoaars -Hoare -Hoare's -Hoarsepower -HOAX -HOB'LIN -Hoban -Hobbits -Hochstetter -Hoest -Hoffa -Hoffenstein -Hoffer -Hoffer's -Hofstadter -Hofstadter's -Hogan's -Hogarth -Hogben -Holton -homeowner's -Homespun -Honesty's -Honeymoon's -Honig -honorific -honour -hoofprints -HOOTCH -hootchy -hooved -Hoppe -Horace's -horgrave -hormonal -Horne -Horner's -Horngren's -hors -Horstmann -Horta -hound's -houseplant -houseplants -HOUSERED -housewares -Housman -How'd -Howdershelt -Howe's -Hoyt -HR -Hubbard -Hubbard's -Huffman -hullabaloo -human's -humour -Humperdinck -Humpf -Humpfed -Humphrey's -hunchbacks -Huneker -Huntingdon -Hurewitz's -Hussein -Husserl's -Huxtable -Hyatt -Hyde -hyper -hyperdrive -Hyperion -Hypermint -hyperplanes -IA -Iacocca -Ian -ibi -IBMer -IBMese -IBP -IC -ICBM -icepacks -ICs -ID's -ideogram -ideograms -Idi -iear -Iears -IEC -IEH -iers -if's -ifthen -Igmmlptk -Ignatowski -ihuxw -IIc -III's -Il -Iles -Iles's -illiterate's -Illiterati -Imamu -imbeciles -Imbesi's -IMMANUEL's -imperiling -impersonators -impo -Inamorati -Inanities -inattentions -incivility -incorrige -incrustations -incurreth -infiniteloop -InfoWorld -ingenium -Ingliy -Ingmar -Ingrid -inhalations -init -inkahol -inkwells -Inlaws -innumerate -inprectoo -inputdir -inquit -inrushing -insa -Insider's -INSQSW -interdicted -interferon -interpreter's -interunderstanding -Ionesco -IOS -IOT -Iowans -Iphicrates -ipsos -IQ -IQs -Irishman's -ironmongery -irrelephant -IRS -Irulan -Isaak -Iso -Issawi -Issawi's -Ist -Italo -itn -Itty -Ium -ius -Ivanovo -Iverson -IXDRTYju -Jabberstock -Jabberstocky -Jacek -Jackals -Jackasses -jackrabbit -jackrabbits -Jacquard -Jacquin's -Jael -Jaglan -Jahnke -Jahoda -Jaka -Janelle -Janx -jarheads -Jarry -Jaspar -jast -Jawaharlal -Jayne -JCL -Jed's -Jedi -jeered -Jeffersons -Jehan -Jekyll -Jell -Jeltz -Jenerally -Jenkinson's -Jenks -Jenning's -Jerrold -jeunesse -JFK -JFK's -Jillette -Jimbo -Jimi -jklsR -jkzxdjkl -JMP -Jodie -joggers -Jogging -Johnson's -Johnston -Jone's -Jones's -Jonesboro -Joost -Jordache -Josh -joules -jour -Jourdain -Jove's -Joyce's -Juall's -judex -jukebox -Julia's -Juliana -jumpsuit -Jun -Jung -junkmobiles -Juris -Justin -Juvenalis -Kabaidze -Kabotschniks -Kafka's -Kahlil -Kahn -Kairos -Kamerman -Kaminer -Kaminsky -Kan -Kandel -Kant's -Kaplan -Karabakh -Karamazov -Karamazovs -karat -Kari -Karloff -Karlovich -Karlson's -Karlstrom -karma -Karpis -Karyl -Kasi -Kasner -Kasspe -katydids -Katz -Kauffmann -Kaufman -Kaufman's -Kaul -KCB -Keate -Keeler's -keepen -Kehlog -Keillor -Keir -Kellen -Kempis -Kempson -Kennedy's -Kennedys -Kennicott -Kenny's -Kenobi -Kent's -Kercheval -kerning -Kerouac -Kerr's -Kerwin -Kesey -Kessler -Kettering's -Keyser -Kezar -KFOG -Khayyam -Khruschev -Kidner -Kierkegaard -Kiernan -Kilgore -Killfest -Killibrew -Kime's -kinda -Kiner -kinfolk -Kingsmen's -Kingsmill -Kington's -Kinkler's -Kinks -Kinnan -Kion -Kiplings -Kirrman -Kissinger -Kistomerces -Kitman -kitsch -Kitzenger -KKK -KL -Klapka -Kleppner -Kleptomaniac -Kliban -Kliban's -Klingon -Klingons -Klink -Klipstein -Klone -klows -kludge -kludgy -klutz -kmxsij -Knapp -Knebel -Knebel's -Knicks -Knivlen -knock'd -knoooooowww -knowest -knownness -Knucklehead -Knuth -Ko -koan -Koblas -KOBOLDS -kohirnt -Kolenhow -Koln -komputilisto -konsonant -konsonants -kontinue -Kool -kootchy -Kopp -Korda -Kovacs -KPH -Kr -Krabill -Krainian -Kramer's -Krasnoyarsk -Kraus -Kreitzer -Kringle -Krispies -Kristofferson -Kristol -krizzle -Kroc -Krogt -Kronecker -kroo -Krylenko -KRYPTONITE -KSFO -Kt -Kubla -Kubrick -kudn't -Kulawiec -kulero -Kwaheri -KYA -Kyogen -l'amour -l'Amour -l'esprit -l'Informatique -l'inventer -l'oeil -Labour's -lacessit -Lackland's -LACS -Lactomangulation -lad's -ladybug -Laetrile -Lafferty -LAFITE -LaGrange -LAIDBACK -Lamarr -lambchops -Lamont -lampshades -Lampson -Lancelot -Landburgher -Landor -Langan -Langsam's -Langston -Lanier -lank -Lankhamar's -Lankhmar -LAPD -Lapham -Lapsley -Lapwarmer -Lardner -Larkin -Larkinson's -Lascl -laserbeam -Lasorda -Lasorda's -Lassie -Late'll -Lauer -Laukikanyay -laundromat -lavishes -Lavoris -lawnmower -Lawrenson -Lazenby -Lazlo's -LBJ -leadeth -leafmeal -Leahy -Lean's -Leautaud -Lebarge -LeBlanc -LeBoutillier -Lebowitz -LeCarre -LeDoux -Leedom -legas -legendarily -Lego -LeGuin -Lehenbauer -Lehey -Lehman -Lehrer -Leia -Leibe -Leiber -Leibniz -Leibowitz's -Leith -Lem -Lenin's -Lenore -Lensmen -LeoGrande -Lerner -lerts -les -LeSage -letez -Lettvin -Levant -Levenson -Leverett -Leveut -Levinson -Lewin -Lewis's -Lewyt -lexicographer -Leyna -li'l -Libbers -libdialog -Libra -libricilleux -LiBrizzi -Lichtenberg -Lichty -Liddy -Liddy's -Lieberman's -Liebling -Liebowitz -liegt -Liepmann -lightbulb -lightbulbs -Lightfoot -LII -Lileks -Lilla -Lillian -Lillis -limerick -Lincoln's -Lindbergh -linguini -Linimon's -Linkletter -Lippmann -Lipson -Lir -Lisle's -LITHP -lithtth -liveware -Livius -Livy -Liza -LLD -lobbed -lobbest -lobotomy -LOCF -Lockard -locksmiths -Lockwood's -locutions -Loeb -Logg's -loggerheads -Logicians -logick -logout -logy -logzerneg -lojikl -Lombardi -Londoners -Longworth -lookest -lookie -Lookit -loons -Loos -Lorax -Lord'll -Los -Lothair -lotsa -loudmouth -Lourdes -Loverboyd -Lovin -Lowells -Lowery's -Lowes -LP -LPA -LSD -LSD's -Lt -Ltd -Lubarsky's -Lubitsch -Lucasian -Lucci -Luce -Luciano -Ludcke -Luddites -Luigi -Lumsden -Lundstrom -lurketh -LUSER -Lustbader -Luten -LVME -Lyman -lynching -Lyndon -Lyndon's -lysdexia -Lysistrata -Lytton -m'I -ma'am -Ma's -Mabbitt -Mabley -Macaroons -Maccius -MacDowell -MacDuff -Machturtle -Macinelli -MacKay -MacLaine -MacNelley -MacNiece -MacWhirter -Macy's -Madariaga -Madelyn -MADMAN'S -MADRAK'S -Madre -MAFIA -Magary's -Magee -magnifique -Magnocartic -magtape -Mahabharata -Mahasamatman -Mahatma -Maher -Mai -maidservants -Maier -Maier's -Maimie -Main's -maindz -mainframe -mais -Maistre -Maj -maketh -mal -Malek's -Mallomars -Malraux -maltreated -Mamet -Mammel -mammon's -Mancha -Mandrell -Manhandling -manifestos -Mankiewicz -mankind's -Manly's -Manson -mantas -mantises -MAPCAR -Mapplethorpe's -Marceau -Marcuse -margarita -Margaronis -Margolies -Markham -Markoff -Markowsky -Marley -Marlo -Marlon -Marshalltown -MARTA -Maryann's -Maryel -Mascheroni -Maslow -Maslow's -masochist -Masterson -Masterson's -masticating -Mathis -Mattel -Matz's -Maud -Maud'Dib -Maugham -Maupin -Maureens -Maurois -mausers -Maxey -Maxson -May's -Mayorga -MBAs -MBH -MC -McAfee -McCartney -McCartney's -McClanahan -McCloctnik -McCorkle -McDunn -McElroy -McEvoy -McEwan's -McGowan's -McGrew -McGroarty -McGuane -McIntire -McKuen -McKusick -McLeavy -McLuhan -McManus -McNally -McNeill -McNulty -McQueen -McQuillin -McShane -MDL -Meade's -Meader's -meatballs -Meck -Mecum -Medawar -Meeny -Meese -megacycles -Megatrends -megs -meik -Meir -Melancholia's -Melott -meltdown -Melugin -Mem'ry -MEMBAD -Menander -Mencken -Mencken's -Mendelson -mendicants -Mengot -Menninger -Menschen -Meow -meowing -MERCUTIO -merinos -Merrick -Meskimen's -Messiah's -meta -Metamagical -Metasexuals -Metermaids -methionyllysylalanylalanylthreonylarginylserine -Metkovich -Metz -Mewling -Meyrowitz -MG -MGA -MGM -MHz -Mia -Michener -Mickos -microchips -Microcomputing -micrometric -Microsystems -MicroVAXes -midgets -Midler -midterm -midtown -Mieux -Miffin -Mikado -Miksch's -milk's -Milkbone -Millay -Milligan -Millikan -Millikan's -millions -Millipicture -Milliway's -Millman -Milpitas -mimsy -Minas -mindedly -minimalization -miniraft -miniskirts -minix -Minneapple -Minnelli -Minnesotans -Minow -Minsky -minx -MIPS -MIRVed -misapportionment -misdates -Misner -misquotations -misspent -mistresses -Mitford -Mitgong -mittengrabben -mitts -MITZIE -Mix's -Miyamoto -mizk -Mizner -mkdir -MMMMMM -MN -mobocracy -Moby -Modelski -modifaiing -Modula -Moebius -Mohandas -mohmen -Moishe -Molander -moldy -molehills -Mollison's -Mom -mome -Momma's -mon -Mondale -monde -Mongo -monkey's -Monopurpose -Montagu -Montalvo -Montand -Montesquieu -Moolah -moonshiner's -Moore's -mopeds -Moping -moralists -Mordecai -Mordor -Morley -morons -Morrisey -mortician's -MOS -Mosher's -Mostel -motd -mounteth -mousetraps -mousies -mouthwashes -moveth -Moyers -Moynihan -MOZ -mrbill -MSCP -MSDOS -MSU -Mt -MTA -Muad'dib -muckest -Mudgeeraba -Mudhead -mudslide -mugged -Muggeridge -Muhammad -Mulcahey -Mulcahey's -multe -multidextrous -multiline -Mum's -munchies -Munchkin -Mundis -Mundus -Munro -Muppet -Muppets -Murdoch -Murphy's -Murray's -Musashi -musculus -Mushies -Mustgo -MVS -MW -MX -Myles -MySQL -Myung -myxbl -n'ecoute -n'est -n'existait -n'oeuvres -Naah -Nabokov -naches -Nachman -Nachman's -Nader -Nadia -Naggum -Nagorno -Naiman -Naisbitt -Namath -NAND -nanocentury -nanohenry -nanometers -Nansen -Napoleon's -Narnia -Nasium's -Naso -Nasrudin -Nasrudin's -Natasha -Nate -Nathalia -Nather -naturalists -naugahyde -Naughton -Navasky -Nazgul -NCONS -NCTE -Neantical -Nebuchadnezzar -Nebuchadnezzar's -necesas -NecroSoft -Nehru -Neil's -Neizant -nell -Nemo -nennen -Neophyte's -nerd -Nerd's -Neronic -Nesbit -Nesbitt -NetBSD -NetHack -Netiquette -netnews -neuroscience -neuroscientists -neurotics -Nevil -Newell's -Newkirk -Newlan's -Newman's -NEWSFLASH -NF -NFL -Ngdanga -Niagra -Nicklaus -Nicol -Nicolaides -Niels -Niemoller -Nietzsche's -Nikita -Niklaus -Nikon -Nillity -Nimitz -Ningauble -Nintendo -Nisker -Nissan -Nissan's -nitpicking -Niven -Nixon's -Noah's -noalias -Noelie -nog -nogiftlist -nohow -Nolan -Nome -nonproblems -nonrefusable -nonsolutions -nontangible -nooooothing -NOP -Nora's -Norman's -Normanorum -Normie -Northcote -Norwood -nostra -Notetaking -nothing's -Nov -Novato -Novell -Novinson's -Novocain -Novocaine -Now's -Nowlan's -Noxzema -NP -NSV -NSW -NT -nth -Nubar -nucleophile -NULLs -Nullum -nunnery -Nuremberg -Nusbaum's -Nutley -NY -NYT -O'Brian's -O'Casey -O'Hara -O'Henry -O'Longhlin -O'Malley -O'Neil -O'Neill -O'Nolan -O'Reilly's -O'Rourke -O'Toole's -Oahu -Obi -obits -obius -obscurantist -obsoletum -Ochs -OCP -Oct -octalthorpe -Octopussy -Oech -Oedipa -Ogborn -Ogden's -Ogdin -Oglethorp -OHHHHHH -Ohm's -ohnegleich -okay -OKOKOKOK -Olin -Olinthus -Olivier -Olivier's -Olsen's -Omar -omelette -omerade -OMERTA -omnibiblious -omnivorous -ompzidaize -Onan -Onasander -Onassis -Oncler -Ontopsychological -Ontopsychology -oodsou -ooh -Oooh -ooohed -Ooohh -Oooo -OOOOT -Ope -Ophelia -Oppernockity -Oprah -OR'd -Orac -Orben -orbs -Orbury -Orcs -Oreo -Organa -Orkney -Oroville -orphan's -Orrin -Orson -Orton -orxogrefkl -OS -Osborn's -OSI -OTOPHOBIA -oughta -our's -Ouspensky -OUTCONERR -outcumbents -outdone -outfitting -outgrabe -outgunned -outstubborn -outta -outweird -overesteem -overserved -overstayed -overstuffed -overtruncated -oves -Ovidius -Owen's -Owsley -Ozman's -Paar -pacifists -padanga -Padlipsky -Paeps -Paglia -Paglia's -Pagnol -paisley -Paley -pallbearer -Palo -pamphleteers -Pandanga -Pandora's -Panjandrum's -panky -pantaloons -Pante -pantyhose -Panza -paperboy -Papert -paraboloids -paramedic -Paramount's -Paranoids -paraquat -Pardo's -parDOOOOOnu -Parker's -Parkinson's -parkways -Parnas -Parnell -paroxysmally -Parrafin -Parthenon -passwd -pastureland -Patageometry -Pathmark -patrino -Paxton -PBC -PCC -PDGERS -PDP -PDQ -PDSK -Pearsall -PECCATOPHOBIA -Pecor's -Pedaeration -Peers's -Pegler -pelted -Pembrokeshire -PENGUINICITY -penis -Penn's -Penrose -Pensacoola -pense -Pensees -Penzance -percussionists -Pereant -perfum'd -Perignon -Perigord -Perl -Perlis -Perlstein -Perot -Perriwinkle -Personifiers -Petaluma -Petersons -Petr -Petronius -Pfeiffer -Pfffttt -Phaedrus -Pharoah's -Phathotep -Philbin -Philips -philogyny -phoney -Phooey -Picadilly -Pickard -Pickle's -Picninnies -piercings -pietists -pietzsche -Piggeldy -Pilgermann -Pindar -Pinero -Pintauro -Pioneer's -piranhas -Pirsig -Pithiests -pkasdjbasdfbuil -PL -Plaese -planaria -plasmoids -Platford -Plato's -platypus -Plauger -pleasantest -pleasurific -pleH -Plimpton -Plinius -Plotinus -Plotkin -PLUGBOARDS -Plumber's -plunked -Pluribus -Plyter -Pocataligo -Pocatello -Podunk -Pohl's -Poincare's -pointy -Polanski -Pollyanna's -poly -polytetien -polytheism -polywog -Pompeius -ponytails -Poorman's -popcorn -POPI -POPped -Poppins -Porcius -Porcus -porkers -Porky's -porrf -Porsche -posibl -POSSLQ -posthole -postindustrial -postjudice -Postnews -Postpetroleum -potholes -Potluck -potty -Poul -Pournelle -pouvait -Povich -POWDERMILK -powerfail -Powermom -Powerpoint -poz -PPHHHLLLBBBBTTT -ppo -PPRB -Prabhupada -praemium -pragma -prawns -pre -Precipitations -predicaments -prepareth -prepoceros -Presley -Presume's -pretzel -Preudhomme's -prgrmmng -Price's -Priest's -priestess -primordial -Princeton's -Pritchard -Pritzi -PRIV's -PRL -PROCESSORs -Prochnow -proelium -profundities -proletarian -Propos -propounded -Proseedcake -Prosser -Prostetnic -prostrates -Protagoras -protheththing -protoplasmal -protracting -Provan -PRs -Prue -Prufrock -Pryne -Pryor's -PS -Psblurtex -Psychotics -Publilius -Publius -Pudd'nhead -Pudden -Pudder's -Puff's -Pumpernickel -punchline -punning -PUPs -Purshottam -PUSHes -pushy -pussycats -Putt's -PVLC -PxP -Pynchon -Pyro's -Python's -QED -QLX -qotc -QOTD -QT -quadrupic -quaffing -Quaid -Qualactin -quandry -Quanucci -Quasimodo's -Quentin -qui -quia -quiche -Quicky -Quiddely -Quidquid -Quigley's -Quincey -Quincunx -Quinton -quizmaster -quop -Quux -Qvid -QWERT -QWERTY -QWERTYUIOP -QYX -Rabelais -rackmount -Racter -radiateth -Radner -raed -Raffiniert -raineth -Raisa -Raisinets -raisiny -RAM's -Ramapo -randchar -Rankin -Ransford -rapturous -Raquel -RASC -Raskin -raspy -Ratcliffe -Ratri -Ratsy -RC -rd -RDTBL -Readyhough -Reaganite -Reba -rebinds -Recamier -Redd -Regan -Reggie -Reginald's -reich -Reichel's -Reinfeld -Reinhart -Reisner's -Relaxen -RENE -Renegades -Renner -Renning's -replased -replasing -restoreth -retards -retrospectoscope -Reykjavik -RFCs -RFD -RFSFR -rhinoceri -Rhode -Rhode's -RHU -Richardian -Richie -Richler -Ricks -Rico -ridandant -rigadoon -Rigby -Rigg's -Rilke -rimeining -rind -Ringo -Ringworld -Rinzai -riplais -Rippingille -Risch's -rispektivli -risqu -Ritt -Rivera -Rizzo -RKO -RLG -Roadrunner -Robb -Robespierre -Roche -Rochefoucauld -Rocky's -Roddick -Rogerians -Roguelet's -Roguies -Rolex -rollups -ROLM -ROM's -Romanoff -Romanov -Romas -ROMS -Romulan -Romulans -Ronstadt -Rooney -Rorschach -Roscoe -Rosencrantz -rosewater -Rospach -Rossetti -Rosten -Rotherham -Rothesay -Rothschild -Roumania -rousers -Rowlands -Roxbury -Royce -Royces -Royko -RPG -RPLACA -RPLACD -RS's -RSSC -RSuX -RTAB -rubbernecken -Rubenesque -Rubenstein -Rubik's -Rubin -Rubinstein -rubout -Rudd's -Rudin's -Rudman -Rudner -Rudyard -Ruffed -rugby -Rukn -ruminations -Rune's -runneth -runtime -Rupert -Russel -Russon -rustproofers -Ruth's -Ruthven -RWDSK -RWOC -RY -Saberhagen -Sacher's -Sadat -Saddam -Saens -Safford -Safire's -Sagan -Sagdeev -Sagittarians -sailer's -salesman's -Sallust -Salmanazar -Salmonson -Salome -Salter's -Salvadorans -Salvor -sam -Sammet -samurai -Sanka -Santoro -Santraginean -Santraginus -sapiens -Sappho -Sardi -Sargon -Sarnoff -Sartre -SAS -Sattinger's -Satyrs -Sauron -SAUV -Savage's -savait -savour -sawhorse -Saxbe -Sayre -Scalia -Scallopinni -scats -SCCS -Schaeberle -Schapiro's -Schenk -Scherr -Schibe -Schickel -Schickele -Schieffer -schisms -schizophrenics -schlichte -schluerfen -Schmendrick -Schmidt's -Schmivalry -Schmonsequences -schnappen -Schneier -Schnoebelen -Schrier -Schroder -Schrodinger's -Schryer -Schumacher's -Schure -Schwambach -Schweitzer -Schwiggle -Schwine -Scientologist -scintillate -Scintillae -Scott's -Scoville -SCRBL -Scrubb -scullery -scurries -scuzzball -Scythians -sdoihjfh -SDS -Seager -Seagoon -seal's -seatcovers -Secombe's -Seeger -Segal -sei -Seldon -Seleznick's -SEMPER -Sendak -Sententiae -Sep -Septober -sequiturs -Serendipity -Serling -Serocki's -Serres -SETQ -Seuss -Sevareid -Sevenoaks -Sextus -Shadow's -shallots -shalt -Shannon's -Shapley -Sharif -Sharpless -Shaw's -Shawcross -shed's -Shedenhelm's -Sheeley -Sheep's -Sheil -Shel -Sherany -Sherrill -Shhh -Shick's -shineth -shinnied -shins -shlafen -Shmoedipus -Shoaff -Shoales -Shockwave -Shoffstall -ShopRite -shorn -shouldst -Shriekback -Shrivers -Shulman -Shuman -Shunju -shutouts -shysters -Si -sickens -sickle's -sidestepped -Siegel -sightseeren -Sigismund -Sigmund's -SIGPLAN -Silentarius -Silurian -Silverman's -Silverstein -Simard -Simon's -Simonize -Simons -Simpson's -Sinanju -Sinbad -siouxeyesighed -Siouxicide -SISSIES -situationalist -Sitwell -Sixtus -sizeof -Sizi -Sjoberg -Skelton -skldfjkl -skyhigh -Skyler -Skywalker -Slagle -SLC -sledgehammers -Slick's -Slingwine -Slinkies -Slinkys -SLOBOL -Slous -Slurm -sluts -Smaalders -Smalltalk -Smirnoff -Smit -Smithsonian's -smokeouts -Smoky's -Smollet -Smorgrav -SMP -smudges -Smugs -smurfette -Smurfies -Smurfs -SNA -Snacktrek -snake's -snarley -Sniglets -Snipehunter -SNL -snowman -Snowmass -Socio -sociocybernetics -sociopathic -soda's -Sodd's -Solanas -soliloquies -Solipsists -Solzhenitsyn -somebody'd -something's -Sondheim -Sooooo -Sorhed -sort've -sorta -souffrir -Soundtrack -SoupCon -Souvarine's -sow's -Sox -Soxer -SP -Spacemen -Spaceport -spacewar -spake -Spam -spank -Spark's -Spartacus -Speer's -spel -speling -Spence's -Spielberg -Spinoza -Spirtle -Spisani -spitzensparken -spl -sploosh -Spock -spokesperson -SPR -Sprecht -springenwerk -Springsteen -sprites -SPSW -squaws -squealers -squrooneg -SRSD -sswwiittcchh -stalagmites -Stallman -Stallone -standest -Standpunkt -Stanfield -Stanislaw -stardust -starfield -Starfighter -Starlin -starships -Stasheff -statecraft -stderr -stdin -steamrolling -Steckel's -Steele's -Steelypips -steeplechase -Steiger -Steinbach -Steinbach's -Steinbeck -Steinem -Steinman -Stekel -Stenderup's -Stengel -Stepanakert -stepstool -Stig's -stingiest -stinkmouthing -Stinnett -Stock's -Stockdale -Stoffel -stogies -Stonemenge -stooge's -Stoolie -Stoppard -Stormqueen -Stormtroopers -Strachey -straitjackets -strategem -Straub -Stretchy -Strewzinski -Strindberg -structs -Strumpets -Strunk -stty -stuckness -Stult's -Suaviter -subordinations -subsittute -Suenden -suet -Sugarcreek -Suggoth -Sulu -Sumeria -Sumatra -sunbathing -SunCheckup -SUNKIST -sunlamps -SunOS -Suntiger -Sunward -superannuated -Superchicken -superheros -Superieure -superpowers -superstar -superstars -Suplee -supplieth -surly -Surtees -Sushido -Suslowicz -Sussman -Suzie -Sven -Svevo -svm -Swaller -swami's -swang -Swayze -sweatsocks -Sweden's -sweeteners -Swinburne -Swipple's -synagog -syncs -synthetase -Syrus -sysadmin -syscalls -SYSIN -sysinstall -SYSNOTE -Szasz -T'ai -t'git -T'umps -Tabby -Taber -Taber's -Tac -tachyon -Taggart -Tai -takest -taketh -Talking's -Tallulah -tamperest -Tanenbaum -tannogallate -tapeworms -tapioca -tappity -Tarkin -Tarkington -Tarradiddles -Tasmanians -TATERNATOR -tbsp -TDB -Tech's -Technolorata -Tecumseh -teddy -Teddywookie -tee'd -teepers -telematic -telepath -teleportation -telepsychology -tempfile -tendrils -tequila -Terence -Terentius -Teriyaki -Termiter's -Tertullian -TEXage -textfiles -thaaaaaaat's -Thackeray -Thalberg -Thames -Theatre -Themas -Theophrastus -thermia -Thermopylae -Thieu -thing's -thinkle -Thom -thou'lt -Thoul't -Threepio -Throop -thru -Thucydides -Thurber -Thurgood -Thurston -Thyme's -thyself -Tiburcio -Tiddely -Tiffany's -Tijuana -Tikkanen -Timbuktu -time's -tinhorn -tinpot -Tirith -tis -Tiselius -tites -TLC -TM -toastings -Tobaben -Tobias -Tock -toehold -Tolkien -tollway -Tomalin -Tomash -Tomlin -tommyo -Tonka -Topanga -Topologists -Torek -tornpee -Tortue -Tortue's -Torvalds -TOTD -Toto -touch'd -Touche -toujours -toun -Tourbillon -Toven -trans -transmogrifiers -trapezes -Traub -traumatized -treacle -Trenchtown -Tribbles -TRICHOPHOBIA -Tricia -Trillian -Trillin -Trimble -Trobin -Troney -Trotsky -trovato -TRS -Trudeau -truffula -truncheons -Truscott -Trygve -tryptophan -Tse -tsetse -TSO -tsp -Tsu -tsunamis -ttyTV -Tue -tuit -tuits -Tukey -Tullius -tumbleweeds -tune's -Tunstall -tuppenny -Turds -Turgenev -Turnaucka's -turneth -Tussman's -Tut's -Twain's -Twas -Tweedledee -Tweedledum -tween -tweety -twitches -twits -twixt -Twodor -Twodor's -TYDFS -tyg -typefaces -Tyroon -Ubi -UDA -Udall's -UFO -UFO's -uh -ukulele -Umberto -Ummm -umsige -Un -Una -unamerican -unbegot -unbelievers -UNC -undemanding -underachiever -Unger -Unhhh -unhounded -unionists -unkindest -unleaving -unmasks -unscrappable -Unseld -untechnician -unvoist -Updike -uponst -Urey -Urho -Urk -USEnauts -Usenetter -useth -USL -Ustinov -UT -UTCS -uuclean -uulog -VA -Vader -Vader's -Vail's -Valachi -Valerius -Valery -VALGOL -Valiel's -valium -VanDam -Vannevar -Vapereau -vaporized -varicose -Varro -Vasquez -Vastgota -vatch -Vate -Vaughan -Vauvenargues -Vax -VAX's -Vaxen -VAXen -VAXs -VCR -VCR's -Veeck -velcro -Velilind's -Velveeta -Veni -Venkman -Venn -ventious -Verdunne -Vergas -Vergilius -veritas -Vernor -verreckt -Vespucci -Vespuccia -VESTIPHOBIA -vetted -VFW -Vic -vichyssoise -Vidal -VIDEOCASSETTE -Vidi -viditur -Vido's -vieillesse -viiiiiiiiiiiinnnneee -Vila -Vinchy -Vinci -Vinge -Virgil -Virt -Viscott -Vittorini -VLSI -VMI -VMS -VMSPDGERS -Vobiscum -Vocab -VODKA -vodkas -Vogon -Vogons -voist -Volkswagen -Vollyballocracy -Voltarine -von -Vonada -Vondel's -Vonnegut -Vonnegut's -VOOM -vowlz -Vries -Vroomfondel -VSOP -VUJA -Vulgate -VW -VWD -vyui -Waben -WAC's -Wald -Walinsky -Walla -Wallbangers -walleting -Wallis -Walter's -Walton's -Waltons -Wanda -wanna -wanwood -Warbucks -Warburton -warders -Warhol -warlord -Washlesky -WASPs -WastebasketSLMHQ -Wat -watchout -Watership -Watford -Watney's -Watt's -Watterson -WBT -wearers -weatherman -Weed's -Weederman -weenies -Weil -Weiler -Weiler's -Weinberg's -Weinberger -Weiner's -Weir's -weirdo -Weisert -Weizenbaum -Weller -Welles -welp -Wemm -wench -werld -Wernher -Wertheimer -Westbrook -Westbury -westerns -Westheimer -Westheimer's -Westmoreland -Wethern's -Wh -Whaddaya -Whaddya -whaledreck -What'll -WHATEVERSAROUND -Whattaya -whilst -Whipsnade -WHIRRR -Whistler's -White's -Whitehead's -Whitehorn -Whitton -Whitty -whoami -whodo -whomped -Whooa -Whoopie -Wickersham -Wiggam -Wihelminalaan -Wiker's -Wilcox's -Wilde -wilds -Willeford -Willie's -Willis -Wilner's -Wimbrow -wimmelten -wimp -Winchell -Windex -windstorms -Winfrey -winnowed -Winny -Winokur -Winsor -Winwood -Wir -Wirrten -Wirth -wiseguy -witch's -Wither's -Withington -Witt's -Wittgenstein -WL -Wobegon -Wodehouse -woes -wolfing -wollen -Wollman -wombat -Wombat's -wombats -Womblike -woodburning -Woodhead -woodlands -Woodstock -Woodward's -Wookiee -Woolf -Woollcott -worketh -workingman -Workingman's -workup -WORLD's -worth's -wreckages -Wrenshaw -writest -wrung -WSJ -WXRT -Wynand -Xanadu -xanthic -Xanthippe's -Xaviera -XCVI -xen -xenophobic -XGP -XIIdigitation -XINU -XL -XLI -XLII -XLIII -XLIV -XLIX -XLV -XLVI -XLVII -XLVIII -xrewawt -xsz -XTC -XXI -XXII -XXIII -XXIV -XXIX -XXV -XXVI -XXVII -XXVIII -XXX -XXXI -XXXII -XXXIII -XXXIV -XXXIX -XXXV -XXXVI -XXXVII -XXXVIII -XY -Y'all -y'are -Y'know -Yabba -Yacob -yams -Yankovic -Yay -Yellowstone -Yeltsin -Yessir -Yevtushenko -Yewtoo -Yinkel -Yippie -Yoda -Yoda's -Yoko -Yorba -Yoric -Yorker's -you'se -Youghkins -Youngman -yourselfer -Yuggoth -Yul -Yuletide -Yutang -yyoouurr -Zachmann -Zadeh -Zaftig -Zall's -Zamphuor -Zanuck -Zaphod -Zappa -Zarathud -zayda -zcat -Zelazny -Zelkowitz -Zeno's -zephyr's -Zern -Zevon -Zilla -Zimmer -Zippos -Zisla's -Zolman -ZON -zonked -Zonker -zookeepers -ZORAC -Zork -Zorkmids -Zorn's -Zorro -Zoso -Zow -Zsa -Zukav -Zwanzig -Zwart -Zweigs -Zwicky -Zymurgy's diff --git a/usr.bin/fortune/datfiles/gerrold.limerick b/usr.bin/fortune/datfiles/gerrold.limerick deleted file mode 100644 index f0bbce637cb2..000000000000 --- a/usr.bin/fortune/datfiles/gerrold.limerick +++ /dev/null @@ -1,814 +0,0 @@ -%% $FreeBSD$ -%% From The War Against The Chtorr, -%% Copyright David Gerrold, 1984-2000, all rights reserved, -%% used with permission of the author. -%% -%%© This is the copyright line. -%%Eighty-nine is the year we assign. -%% These verses are caroled -%% by one David Gerrold. -%%All rights are reserved. This is mine. * -%% -A limerick of classic proportion -should have meter and rhyme and a portion - of humor quite lewd, - and a frightfully crude, -impossible sexual contortion. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A limerick is best when it's lewd, -gross, titillating and crude -- - but this one is clean, - unless you are seen -reading it aloud in the nude. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -I wanted to print here a medley -of limericks so gross they were deadly, - but when the typesetter tried - to set them, he died; -(not to mention my editor, Smedly.) - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -I have written some limericks quite fateful, -malicious and vicious and hateful; - but I've torn up the jokes - that would sicken most folks, -and humanity ought to be grateful. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There was a young lady named Susie, -Who everyone thought was a floozy. - She liked boy scout troops - and Shriners, in groups; -"What the hell?" She replied. "I'm not choosy." - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A fellow who lived in West Perkin -was always a-jerkin' his gherkin. - Said he, "It's not fickle - to play with my pickle. -At least my gherkin's a workin'." - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A proctologist name of McGee -once bent over double to see - an eyeball of glass - he had shoved up his ass, -"-- so I can see one that looks back at me." - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -Bart has a singular penis -for his wife who is built like a Venus. - He awoke with a fright - last Saturday night: -"Hey! Something is coming between us!" - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A lady who lives in New Delhi -has habits disgusting and smelhi. - She likes to eat feces - of various species. -(The recipe is tattooed or her belhi.) - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A daisy chain isn't a riddle. -just some folks who are happy to fiddle, - by twos and by threes, - on their backs or their knees, -and it's fun getting caught in the middle! - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A lad with a marvelous bend -has no need of a lover or friend. - What he does to himself - would fill up a shelf, -but alas, he has come to his end. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There was an old witch, name of Jessie -whose crotch was all smelly and messie. - She enjoyed a good squirm - with an alien worm --- and got stains all over her dressie! - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A lady who favors coition, -has invented the spaceship position. - She lies down with ease - and pulls up her knees, -and hollers, "Lift off!" and "Ignitions!" - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -Isaac the famous seducer, -will meet a young lass and conducer - to let him get fresh - with her quivering flesh, -but if there isn't the time, he'll just gucer. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -And old man of Texas named Tanners -was notorious for his bad manners. - When he noticed the start - of an imminent fart, -he'd announce it with bullhorns and banners. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A woman who wanted to see, -if she stood up, how far she could pee, - had pardon to beg, - when it ran down her leg, -and formed icicles off her left knee. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A promiscuous sort was dear Laurie -(Yes, this is that kind of story.) - She did it with Joe - and Larry and Moe -and Curly and Howard and Morrie. - -And Johnny and Richard and Pritchard and Kerry -And Lonnie and Horace and Boris and Barry - and Donald and Harold - and Ronald and Gerald -and Tommy and Dicky and Harry. - -And . . . Peter and Paul and Teddy and Todd -and Matthew and Mark and Simon and Rod - and Brucie and Mark - and Bobby and Clarck -and she still isn't finished! My God! - -And David and Dennis and Huey and Ken -and Dewey and Louie, then David again, - and Willy and Ben - and David again -and again and again and again. - -And Danny and Manny and Gary and Fred -and Mackie and Jackie and Dougie and Ned - and Harvey and Len - (then David again) -and -- hold on just a second, she's dead! - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There was a young man from St. Loo, -who gave his dear sister a screw. - Said he, with aplomb, - "You're better than Mom." -Said she, "That's what Dad told me too!" - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A lady who didn't like flies -managed to hide her surprise, - when she opened up one - and found it was fun. -Now she willingly widens her thighs. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There was a young lady named Nancy, -who liked having sex, plain of fancy. - With lightning and thunder, - and a profound sense of wonder, -But not with a partner -- much too chancy. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There was a young lady quite tearful. -Of sucking a cock, she was fearful. - In a moment of dread, - she just turned her head. -And, boy! Did she get an earful! - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A mathematician named Boris -had a wife with a wondrous clitoris. - He charged a small fee - for his colleagues to see -that it was made in the shape of a torus. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -The ladies all had to agree -that Mort's penis was too small to see. - A whore named Louise - sniffed, "Who will _that_ please?" -Mort proudly submitted, "Just me!" - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There was a young fellow named Fisk -whose comings and goings were brisk, - He hid things that were stolen - inside his colon, -and said, "Hey! It's my own *." - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A stunning young lady named Joan -thought a penis was made with a bone. - She just didn't know - 'twas her sexual glow -that turned parts of men into stone. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A midwife named Flo from Arabia -often enjoys giving baby a - forty-volt shock - to the base of the cock. -(On a girl, she goes for the labia.) - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -I know of a lass who's for sale. -She's really a nice piece of tail. - From June to September, - she'll devour your member, -but the rest of the year, she's in jail. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -Miss Wilkerson thought it her duty -to maintain her conjugal beauty. - She mixed up a paste - of industrial waste, -and applied it to her sweet patootie.* - -* The facts about beauty are known, -and well-learned by those who are grown: - beauty is thin, - it lies on the skin; -but ugly goes down to the bone. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -The punctual Cynthia Rolen -missed a period, (or it was stolen) - She looked up her ass - with a tube made of glass, -but found only her own semi-colon; - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A short-organ fellow named Kevin -used a vacuum to stretch it to seven, - then to eight and to nine, - and though ten was divine, -there will be film at eleven.* - -* If you think that our boy's now a stud, -you've been fooled by the size of his pud. - Although twelve inches soft, - when it rises aloft, -he just faints from the sheer lack of blood. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There once was a lady named Lizard, -who got lost in a pink candy blizzard, - with a fellow named Jim - who wanted to swim -up her legs to visit her gizzard. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There was a young fellow named Ted, -who had a radio put in his head. - Long wave or short - he did it for sport --- and to improve his reception in bed. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There was a young lady from Venus, -whose body was shaped like a penis. - A fellow named Hunt - was shaped like a cunt, -so it all worked out fine, just between us. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There was an old bastard named Gene, -impotent, selfish, and mean. - His dick was so shamed - by what the man claimed, -it pretended that is was a spleen. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There once was a fellow named Jason, -whose horrible death I would hasten. - I'd feed him to worms, - just to see how he squirms --- but they'd vomit his crap in a basin. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -With a French lass, it's unwise to trifle. -They have urges they simply can't stifle. - A woman of France - will pull down her pants -at the sight of a towering eye-full. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -"My God!" screamed devout Mrs. Pike, -as she fondled her stableman's spike. - "This is quite out of place, - and a great loss of face --- but I think I have fallen in like!" - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A well-endower fellow from Ortening -prepared for an evening of sportening, - with a boy from a disco, - till he lubed up his Crisco, -and discovered, alas, it was _shortening_! - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A lady who read Sigmund Freud, -thought her genitals underemployed; - so she put in a stand - for a seven-piece band, -and held dances that we all enjoyed. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A lady named Shirley was mellow -and she said to her eager young fellow, - "I prefer bagels and lox - to sucking off cocks, -Or even a nice dish of Jell-O!" - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There was a young man from St. Helens -afflicted with shrinkin's and swellin's. - His dick was so small - it was not there at all, -but his balls looked like honeydew melons. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A woman who once faked a lettera -reference by which she could gettera - job much improved, - regretted her move -when they asked her to show her et cetera. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A lady of South Madagascar -wears a bag on her head; it's to mask her. - A bottle of scotch - might loosen her crotch. -Wait here, I'll go and I'll ask her. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -Chuck is weird, let the whole world know it. -He brought in his bucket to show it. - We all had a fit - when we saw it was shit. -We didn't know he was planning to throw it. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -"Which partners are best? Sixty-niners. -And better than that? Try the Shriners." - These are the results - of consenting adults, -(and occasional like-minded minors.) - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A lady's iambic pentameter -is thirty-two inches diameter. - The breadth of her scansion - is due to expansion -in the pants of a critical amateur. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There was a young fellow from Norwich -Who liked having sex with his porridge. - With sugar and cream - and a buttery scream -- -(The leftovers went into storage.) - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There was a young fellow named Jim -who liked to get naked and swim - with plastic sex toys - shaped like pubescent boys, -'cause he'd rather be gay than be grim. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A lady who jogged in the breeze -had bosoms that flapped to her knees. - Said she, "They're quite warm, - they keep me dry in a storm, -and when it snows, I use them for skis." - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There was an old voyeur named Zeke, -who liked to hide in the closet and peek, - then jump out with loud cries - of "Aha!" and "Surprise!" -and point out your flaws in technique. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -Rick promised to gently deflower -a maiden who lived on South Gower, - (The truth is, he spread - her legs wide on the bed, -and finished her off in an hour.) - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -These poems have come out of my forehead. -The subject are all fairly torrid - -- except for the few - that will make you say, "Pugh!" -And those are the ones that are horrid. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -Juanita, the subject of scandals, -used to use unscented candles, - but now thinks it nice - to use a device -with batteries, buzzers, and handles. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There was an old prune name of Ginty -who only ate muffins and thin tea. - Thinking of sex - gave her the blecchs, -and left her all dried up and squinty. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -Here's the tale of Benjamin Sneed: -Where others were two'd he was three'd - and when they unmasked it, - (three balls in his basket), -he was voted "Most Likely to Breed." - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A maiden who had a third breast -always kept her hand close to her chest, - and I promised her well - that I never would tell. -(Write me privately. Name on request.) - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -Skydiver Daniel McDopp -used to masturbate right from the top. - Whenever he fell, - he jerked off like hell. -He was good to the very last drop. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A necrophile name of Ned Schultz, -often brags of his deed and exults, - "Tis legal, it's said, - to make love to the dead, -if performed by consenting adults." - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -Have you ever met Jamie McBeezis? -He does any damn thing that he pleases. - Says Jamie, undaunted, - "If you've got it,then flaunt it!" -But he's referring to social diseases. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There once was a nearsighted gynie -whose glasses were sparkly and shiny; - but they stayed in the drawer - while he worked on a whore -and tied up the tubes of her hiney. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A shepherd named Jimmie Fitzhugh, -said to his sweetheart, "It's true. - Nothing is moister - than a fresh oister, -unless, of course, it is ewe." - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There's a reason why Barton is queer. -When you meet him, the reason is clear. - A goddess named Venus - gave him a penis, -but Mother Nature filled up his brassiere. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -Then there was Benjamin Bright, -a contestant on "What's My Delight?" - They guesses at his habits - with little white rabbits, -but were stumped by his mouse and his kite. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There was a young man from St. Lutz, -who had a remarkable putz. - It would sniff, it would hunt, - for it only liked cunt. -Absolutely no lips, hands, or butts. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -Sally's sex life was carefully planned. -Said she, "I prefer to be manned. - Things that are anal, - are always so banal, -but things that expand are just grand." - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -Sally-Jo was exceedingly vexed, -when they said she was quite oversexed. - She said, "That's not true, - I just like to screw, -Now, please take a number. Who's next?" - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -Sally sued for support; she was claimin' -Phil had fathered her baby (named Damon). - She said, "I ought to know." - as she pointed below. -"'Cause this is the box that he came in." - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -We will need a computer to tally -all the cowboys who scouted our Sally. - There were some on her mountains - and some on her fountains, -and quite a few down in the valley. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A lady who overly lusted -was frequently opened and thrusted. - When the baby came due - it was female too, -and its hymen was already busted. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -When writing these verses of mine, -I start with a clever last line, - then work backward from there, - toward the opening pair, -with the hope it'll all work out fine.* - -*only sometimes it doesn't. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There once was a whore from St. Paul, -who took anyone, wide, short, or tall. - She said to her clients, - "It's not really science -- -it's just that one size will fit all!" - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There was a young fellow named Forrest -whose cornhole was one of the sorest. - Said he, "I don't mind - a regular grind --- but I do wish my ass were clitorised." - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -When Shakespeare awakes with a scream -and his member a-drippin' with cream, - 'tis just the commission - of nocturnal emission, -which he dubs, "A Mid-Slumber Night-Stream." - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -Sally-Jo taught erotic correction. -She told her student to get an erection. - "Put your dick in my mouth. - Move it north, move it south -- -Now, you're getting a sense of direction!" - -Her instructions were very explicit, -and more than a little illicit: - "Please fill up my cunny - with fresh clover honey, -and butter my buns like a biscuit." - -"Then wrap me up nice in a blanket, -and I'll sit on your staff while you crank it. - I'll put on some feathers, - and laces and leathers, -and wiggle my ass while you spank it." - -"Now that your fingers are stinky, -tie me up in some chains that are clinky. - Bring in goats and a sheik, - give my titties a tweak ---and _now_, we can start getting kinky!" - -"Forget what the chain and the whip meant. -Just get the straps and the slings and a shipment - of high-grade Vaseline, - and a strong trampoline, -and all of the other equipment!" - -"Now, when we get all the bedsprings a-drummin', -that's when I'll start in a-hummin', - then quickly, my dear, - put it into my ear, -so I'll hear the sound of it comin'!" - -"I don't know how much this is costing," -said her student, still covered with frosting. - "But I can say with affinity - that I've lost my virginity. -Quite frankly, my dear, you're _exhausting_!" - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There was a mad pilot named Lizzy, -whose manners were said to be skizzy. - She could loop, she could twirl, - she could make your head whirl. -She left all her men fucking dizzy. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -The speed of Ed's seed is unclocked -whenever a lady's unfrocked. - Tho' his spirit is willin', - when a pussy needs fillin', -he's a man who goes off half-cocked. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A lady whose name is Tirelli -has tits made of dynamite jelli. - If you take on this dare, - you must fondle with care. -(The detonator's south of her belli.) - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -The fame of our Mame was her tushy, -and the front of her cunt. (It was bushy.) - But I heard that her Mike - preferred for his spike -the place in her face that was skwooshy. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A whore with a face like a hound -complained that her sales were down, - till a lover named Michael - bought her a cycle, -and she peddled it all over town. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -There was a young man named Levine -who said to his lady, inclined, - "Thanks for the spasm, - it felt like orgasm; -as a matter of fact, 'twas divine." - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% -A king who was mad at the time, -decreed limerick writing a crime. - but late in the night - all the poets would write -verses without any rhyme or meter. - -From The War Against The Chtorr, (c) David Gerrold, 1984-2000, all -rights reserved, used with permission of the author. -% diff --git a/usr.bin/fortune/datfiles/limerick b/usr.bin/fortune/datfiles/limerick deleted file mode 100644 index 5a92c786ac7a..000000000000 --- a/usr.bin/fortune/datfiles/limerick +++ /dev/null @@ -1,4812 +0,0 @@ -%% $FreeBSD$ -% -A bad little girl in Madrid, -A most reprehensible kid, - Told her Tante Louise - That her cunt smelled like cheese, -And the worst of it was that it did! -% -A bather whose clothing was strewed -By breezes that left her quite nude, - Saw a man come along - And, unless I'm quite wrong, -You expected this line to be lewd. -% -A beat schizophrenic said, "Me? -I am not I, I'm a tree." - But another, more sane, - Shouted, "I'm a Great Dane!" -And covered his pants leg with pee. -% -A beautiful belle of Del Norte -Is reckoned disdainful and haughty - Because during the day - She says: "Boys, keep away!" -But she fucks in the gloaming like forty. -% -A beautiful lady named Psyche -Is loved by a fellow named Ikey. - One thing about Ike - The lady can't like -Is his prick, which is dreadfully spikey. -% -A beetling young woman named Pridgets -Had a violent abhorrence of midgets; - Off the end of a wharf - She once pushed a dwarf -Whose truncation reduced her to fidgets. - -- Edward Gorey -% -A big-bosomed Bunny named Gression -Sold cigars at a key-club concession. - When she swiveled about - Even strong men cried out, -For her costume did not keep her flesh in. -% -A bobby of Nottingham Junction -Whose organ had long ceased to function - Deceived his good wife - For the rest of her life -With the aid of his constable's truncheon. -% -A broken-down harlot named Tupps -Was heard to confess in her cups: - "The height of my folly - Was diddling a collie- -But I got a nice price for the pups." -% -A burlesque dancer, a pip -Named Virginia, could peel in a zip; - But she read science fiction - And died of constriction -Attempting a Moebius strip. - -- Cyril Kornbluth, "The Unfortunate Topology" -% -A busy young lady named Gloria -Was had by Sir Gerald du Maurier - And then by six men, - Sir Gerald again, -And the band at the Waldorf-Astoria. -% -A cabin boy on an old clipper -Grew steadily flipper and flipper. - He plugged up his ass - With fragments of glass -And thus circumcised his old skipper. -% -A cautious young fellow named Lodge, -Had seatbelts installed in his Dodge. - With his date all strapped in - He committed a sin -Without even leaving the garage. - -- "A Boy and His Dog" -% -A cautious young fellow named Tunney -Had a whang that was worth any money. - When eased in half-way, - The girl's sigh made him say, -"Why the sigh?" "For the rest of it, honey." -% -A certain young man, it was noted, -Went about in the heat thickly-coated; - He said, "You may scoff, - But I shan't take it off; -Underneath I am horribly bloated." - -- Edward Gorey -% -A certain young person of Ghent, -Uncertain if lady or gent, - Shows his organs at large - For a small handling charge -To assist him in paying the rent. -% -A certain young sheik of Algiers -Said to his harem, "My dears, - Though you may think it odd of me, - I'm tired of just sodomy -Let's try straight fucking." (loud cheers!) -% -A chap down in Oklahoma -Had a cock that could sing La Paloma, - But the sweetness of pitch - Couldn't put off the hitch -Of impotence, size and aroma. -% -A charmer from old Amarillo, -Sick of finding strange heads on her pillow, - Decided one day - That to keep men away -She would stuff up her crevice with Brillo. -% -A chippy who worked in Black Bluff -Had a pussy as large as a muff. - It had room for both hands - And some intimate glands, -And was soft as a little duck's fluff. -% -A clerical student named Pryne -Through pain sought to reach the divine: - He wore a hair shirt, - Quite often ate dirt, -And bathed every Friday in brine. - -- Edward Gorey -% -A clever young man named Eugene -Invented a jack-off machine. - On the twenty-third stroke - The fuckin' thing broke -And beat both his balls to a creame. -% -A cocksucking steno named Beeman -Remarked as she swallowed my semen: - "On my minuscule salary - I must watch every calorie, -So I get `ahead' eating you he-men!" -% -A computer called Illiac4 -Had a rather tough bug in its core. - It chewed up its cards - And spewed yards and yards -Of illegible tape on the floor. -% -A contortionist hailing from Lynch -Used to rent out his tool by the inch. - A foot cost a quid -- - He could and he did -Stretch it to three in a pinch. -% -A corpulent maiden named Kroll -Had a notion exceedingly droll: - At a masquerade ball, - Dressed in nothing at all, -She backed in as a Parker House roll. -% -A cowhand way out in Seattle -Had a dooflicker flat as a paddle. - He said, "No, I can't fuck - A lamb or a duck, -But golly! it just fits the cattle." -% -A crusader's wife slipped from the garrison -And had an affair with a Saracen. - She was not oversexed, - Or jealous or vexed, -She just wanted to make a comparison. -% -A CS student named Lin -Had a prick the size of a pin - It was no good for girls - But just great for squirrels -Who squealed with delight with it in. -% -A cute little twerp from Samoa -Had a cock of one inch and no moa. - It was good for keyholes - And debutantes' peeholes -But not worth a damn on a whoa. -% -A daredevil skater named Lowe, -Leaps barrels arranged in the snow, - But is proudest of doing, - Some incredible screwing, -Since he's jumped thirteen girls in a row! -% -A deep-throated virgin named Netty -Was sucking a cock on the jetty. - She said, "It tastes nice, - Much better than rice, -Though not quite as good as spaghetti." -% -A delighted, incredulous bride -Remarked to her groom at her side: - "I never could quite - Believe till tonight -Our anatomies would coincide." -% -A dentist, young doctor Malone, -Got a charming girl patient alone, - And, in his depravity, - Filled the wrong cavity. -God, how his practice has grown. -% -A despairing old landlord named Fyfe, -With a frigid and quarrelsome wife, - Let his third-story front, - To a willing young cunt, -Who supplied him a new lease on life! -% -A desperate spinster from Clare -Once knelt in the moonlight all bare, - And prayed to her God - For a romp on the sod-- -'Twas a passerby answered her prayer. -% -A distinguished professor from Swarthmore -Got along with a sexy young sophomore. - As quick as a glance - He stripped off his pants, -But he found that the sophomore'd got off more. -% -A doctoral student from Buckingham -Wrote his thesis on cunts and on fucking'em. - But a dropout from paree - Taught him Gamahuchee -- so he added a footnote on sucking 'em. -% -A do-it-yourselfer named Alice, -Used a dynamite stick for a phallus. - She blew her vagina - To South Carolina, -And her tits landed somewhere in Dallas. - -A cute friend of hers, Fanny Hill, -Used two dynamite sticks for a dil. - They found her vagina, - In South Carolina, -And part of her ass in Brazil. -% -A dolly in Dallas named Alice, -Whose overworked sex is all callous, - Wore the foreskin away - On uncircumcised Ray, -Through exuberance, tightness, and malice. -% -A dreary young bank clerk named Fennis -Wished to foster an aura of menace. - To make people afraid - He wore gloves of grey suede -And white footgear intended for tennis. - -- Edward Gorey, "Amphigorey" -% -A dulcet-voiced callgirl named Shedd, -Who's cultured, well-spoken, well-bred, - Had achieved some renown - For her tone going down-- -There's a nice civil tongue in her head. -% -A fair-haired young damsel named Grace -Thought it very, very foolish to place - Her hand on your cock - When it turned hard as rock, -For fear it would explode in your face. -% -A farmer I know named O'Doole -Had a long and incredible tool. - He can use it to plow, - Or to diddle a cow, -Or just as a cue-stick at pool. -% -A fellatrix's healthful condition -Proved the value of spunk as nutrition. - Her remarkable diet - (I suggest that you try it) -Was only her clients' emission. -% -A fellow whose surname was Hunt -Trained his cock to perform a slick stunt: - This versatile spout - Could be turned inside out, -Like a glove, and be used as a cunt. -% -A fisherman off of Cape Cod -Said, "I'll bugger that tuna, by God!" - But the high-minded fish - Resented his wish, -And nimbly swam off with his rod. -% -A foolish geologist from Kissen -Just didn't know what he was missin', - By studying rock - And neglecting his cock, -And using it merely for pissin'. -% -A Frenchman who lived in Alsace -Had sex with a virgin named Grace. - When he popped her cherry, - She made things hairy -By bleeding all over his face. -% -A gay young prince from Morocco -Made love in a manner rococo. - He painted his penis - To resemble a Venus -And flavored his semen with cocoa. -% -A geneticist living in Delft -Scientifically played with himself, - And when he was done - He labeled it: son, -And filed him away on a shelf. -% -A gentleman, otherwise meek, -Detested with passion the leek; - When offered one out - He dealt such a clout -To the maid, she was down for a week. - -- Edward Gorey -% -A german composer named Bruckner -Remarked to a lady while fuckener: - "Less lento, my dear, - With your cute little rear; -I like a hot presto when muckener!" -% -A gift was delivered to Laura -From a cousin who lived in Gomorrah; - Wrapped in tissue and crepe, - It was peeled, like a grape, -And emitted a pale, greenish aura. - -- Edward Gorey -% -A gifted young fellow from Sparta -Was widely renowned as a farta'. - He could fart anything - From "Of Thee I Sing," -To Beethoven's "Moonlight Sonata." -% -A girl camper once had an affair -With a fellow all covered with hair. - When she gave him his hat - She realized that -She'd been had by Smokey the Bear. -% -A girl of the Enterprise crew -Refused every offer to screw. - But a Vulcan named Spock - Crawled under her smock, -And now she is eating for two. -% -A girl of uncertain nativity -Had an ass of extreme sensitivity - While she sat on the lap - Of a German or Jap, -She could sense Fifth Column activity. -% -A graduate student named Zac -Was said to be great in the sack. - An inch of his boner - Put girls in a coma -And two gave them epileptic attacks. -% -A greedy young lady from Sidney -Liked it in up to her kidney, - Till a man from Quebec - Shoved it up to her neck-- -He really diddled her, didn' he? -% -A green-thumbed young farmer from Leeds -Once swallowed a package of seeds. - In a month, his ass - Was covered with grass -And his balls were grown over with weeds. -% -A guest in a household quite charmless -Was informed its eccentric was harmless: - "If you're caught unawares - At the head of the stairs, -Just remember, he's eyeless and armless." - -- Edward Gorey -% -A habit depraved and unsavory -Held the bishop of Bingham in slavery - Midst screeches and howls - He deflowered young owls -Which he kept in an underground aviary -% -A habit obscene and bizarre, -Has taken a-hold of papa. - He brings home young camels - And other odd mammals, -And gives them a go at mama. -% -A habit obscene and unsavory, -Holds a CS professor in slavery. - With maniacal howls, - He deflowers young owls, -That he keeps in an underground aviary. -% -A hacker who screwed a mag tape -Was caught and convicted of rape. - To jail he did go, - From which, to his woe -He couldn't get out with ESC. -% -A hacker-turned-pervert named Fisk -Made love to the drive of his disk. - The thing circumsized him, - Which rather surprised him. -He wasn't aware of *that* risk. -% -A handsome young rodent named Gratian -As a lifeguard became a sensation. - All the lady mice waved - And screamed to be saved -By his mouse-to-mouse resuscitation. -% -A happy old hooker named Grace -Once sponsored a cunt-lapping race. - It was hard for beginners - To tell who were winners: -There were cunt hairs all over the place. -% -A hardware debugger named Court -Shoved his tool in an Ethernet port. - But its buffer array - Only handled 1K, -So the port's driver cut it off short. -% -A haughty young wench of Del Norte -Would fuck only men over forty. - Said she, "It's too quick - With a young fellow's prick; -I like it to last, and be warty." -% -A headstrong young woman in Ealing -Threw her two weeks' old child at the ceiling; - When quizzed why she did, - She replied, "To be rid -Of a strange, overpowering feeling." - -- Edward Gorey -% -A hearty young fellow named Yost -Once had an affair with a ghost. - At the height of the spasm - The poor ectoplasm -Cried, "Goodie, I feel it... almost." -% -A hidebound young virgin named Carrie -Would say, when the fellows got hairy: - "Keep your prick in your pants - Till the end of this dance--" -Which is why Carrie still has her cherry. -% -A highly aesthetic young Jew -Had eyes of a heavenly blue; - The end of his dillie - Was shaped like a lilly, -And his balls were too utterly two! -% -A highway patrol buff named Claire, -Once screwed half a troop on a dare, - And her parts grew so hot, - There was steam on her twat, -So they nicknamed her Smokey the Bare! -% -A horny young fellow named Reg, -Was jerking off under a hedge. - The gardener drew near - With a huge pruning shear, -And trimmed off the edge of his wedge. -% -A huge-organed female in Dallas, -Named Alice, who yearned for a phallus, - Was virgo intacto, - Because, ipso facto, -No phallus in Dallas fit Alice. -% -A joker who haunts Monticello -Is really a terrible fellow. - In the midst of caresses - He fills ladies dresses -With garter snakes, ice cubes, and jello. -% -A lacklustre lady of Brougham -Weaveth all night at her loom. - Anon she doth blench - When her lord and his wench -Pull a chain in the neighbouring room. -% -A lad, at his first copulation, -Cried, "What a sensation! Inflation, - Gyration, elation - Throughout the duration, -I guess I'll give up masturbation." -% -A lad from far-off Transvaal -Was lustful, but tactful withal. - He'd say, just for luck, - "Mam'selle, do you fuck?" -But he'd bow till he almost would crawl. -% -A lad of the brainier kind -Had erogenous zones in his mind. - He got his sensations, - By solving equations, -(Of course, in the end, he went blind.) -% -A lady born under a curse -Used to drive forth each day in a hearse; - From the back she would wail - Through a thickness of veil: -"Things do not get better, but worse." - -- Edward Gorey -% -A lady both callous and brash -Met a man with a vast black moustache; - She cried, "Shave it, O do! - And I'll put it with glue -On my hat as a sort of panache." - -- Edward Gorey -% -A lady from Kalamazoo -Once found she had nothing to do, - So she sat on the stairs - And she counted her hairs: -4,302. -% -A lady from Old Little Rock -In fidelity took little stock, - And deserted her man - In the streets of Japan -For a boy with a prehensile cock. -% -A lady removing her scanties, -Heard them crackle electrical chanties. - Said her beau, "Have no fear, - For the reason is clear: -You simply have amps in your panties. -% -A lady stockholder quite hetera -Decided her fortune to bettera: - On the floor, quite unclad, - She successively had -Merrill Lynch, Pierce, Fenner, et cetera... -% -A lady was seized with intent -To revise her existence misspent. - So she climbed up the dome - Of St. Peter's in Rome, -Where she stayed through the following Lent. - -- Edward Gorey -% -A lady, while dining in Crewe, -Found an elephant's whang in her stew. - Said the waiter, "Don't shout - Or wave it about -Or the others will ask for one, too." -% -A lady who signs herself "Vexed" -Writes to say she believes she's been hexed: - "I don't mind my shins - Being stuck full of pins, -But I fear I am coming unsexed." - -- Edward Gorey -% -A lady with features cherubic -Was famed for her area pubic. - When they asked her its size - She replied in surprise, -"Are you speaking of square feet, or cubic?" -% -A lass at the foot of her class -Asked a brainier chick how to pass. - She replied, "With no fuss - You can get a B-plus, -By letting the prof pat your ass." -% -A lecherous barkeep named Dale, -After fucking his favorite female, - Mixed Drambuie and scotch - With the cream in her crotch -For a lustier, Rusty-er Nail. -% -A licentious old justice of Salem -Used to catch all the harlots and jail 'em. - But instead of a fine - He would stand them in line, -With his common-law tool to impale 'em. -% -A linguist thought it a farce -That memory space was so sparse. - One day they increased it. - Said he as he seized it: -"At last! Enough core for the parse". -% -A lonely young lad of Eton -Used always to sleep with the heat on, - Till he ran into a lass - Who showed him her ass -- -Now they sleep with only a sheet on. -% -A lovely young diver named Nancy, -Wore a bikini bottom quite chancy, - The fish of Bonaire, - Watched her Derriere, -And the sea fans all tickled her fancy. -% -A lovely young maid from St. Jude -Once rode through the streets in the nude. - The police cried, "Whatam-- - Agnificent bottom" -And slapped it as hard as they could. -% -A lusty young maid from Seattle -Got pleasure by sleeping with cattle; - Till she found a bull - Who filled her so full -It made both her ovaries rattle. -% -A lusty young woodsman of Maine -For years with no woman had lain, - But he found sublimation - At a high elevation -In the crotch of a pine -- God, the pain! -% -A madam who ran a bordello -Put come in her pineapple jello, - For the rich, sexy taste - And not wanting to waste -That greasy kid stuff from a fellow. -% -A maestro directing in Rome -Had a quaint way of driving it home. - Whoever he climbed - Had to keep her tail timed -To the beat of his old metronome. -% -A maiden who lived in Virginny -Had a cunt that could bark, neigh and whinny. - The horsey set rushed her, - But success finally crushed her -For her tone soon became harsh and tinny. -% -A maiden who travelled in France -Once got on a train, just by chance. - The engineer fucked her, - The conductor sucked her, -And the fireman came in his pants. -% -A maiden who wrote of big cities -Some songs full of love, fun and pities, - Sold her stuff at the shop - Of a musical wop -Who played with her soft little titties. -% -A man was once heard to boast, -That he received a parcel by post, - It contained, so we heard, - A magnificent turd, -And the balls of his grandfather's ghost. -% -A marine being sent to Hong Kong -Got a doctor to alter his dong. - He sailed off with a tool - Flat and thin as a rule - -When he got there he found he was wrong. -% -A mathematician named Hall -Had a hexahedronical ball, - And the square of its weight - Times his pecker's, plus eight, -Was four-fifths of five-eighths of fuck-all. -% -A mathematician named Hall -Has a hexahedronical ball, - And the cube of its weight - Times his pecker's, plus eight -Is his phone number -- give him a call... -% -A mathematician named Klein -Thought the Moebius band was divine. - Said he, "If you glue - The edges of two, -You'll get a weird bottle like mine! -% -A middle-aged codger named Bruin -Found his love life completely in ruin, - For he flirted with flirts - Wearing pants and no skirts, -And he never got in for no screwin'. -% -A milkmaid there was, with a stutter, -Who was lonely and wanted a futter. - She had nowhere to turn, - So she diddled a churn, -And managed to come with the butter. -% -A mortician who practised in Fife -Made love to the corpse of his wife. - "How could I know, Judge? - She was cold, did not budge-- -Just the same as she'd acted in life." -% -A nasty old drunk in Carmel -Thinks it funny to piss in the well. - He says, "Some don't favor - That unusual flavor, -But I don't drink the stuff -- what the hell!" -% -A nervous young fellow named Fred -Took a charming young widow to bed. - When he'd diddled a while - She remarked with a smile, -"You've got it all in but the head." -% -A new dramatist of the absurd -Has a voice that will shortly be heard. - I learn from my spies - He's about to devise -An unprintable three-letter word. -% -A newlywed couple from Goshen -Spent their honeymoon sailing the ocean. - In twenty-eight days - They got laid eighty ways -- -Imagine such fucking devotion! -% -A newly-wed man of Peru -Found himself in a terrible stew: - His wife was in bed - Much deader than dead, -And so he had no one to screw. -% -A notorious whore named Ms. Hearst, -In the pleasures of men was well-versed. - Reads the sign o'er the head - Of her well-rumpled bed -"The customer always comes first." -% -A novice was told by the Abbot: -"Consider the goat and the rabbit. - While they roll in the hay - You just stay home and pray. -You've got to get out of that habit." -% -A nudist resort at Benares -Took a midget in all unawares. - But he made members weep - For he just couldn't keep -His nose out of private affairs. -% -A nurse motivated by spite -Tied her infantine charge to a kite; - She launched it with ease - On the afternoon breeze, -And watched till it flew out of sight. - -- Edward Gorey -% -A passionate red-haired girl -When you kissed her, her senses would whirl, - And her twat would get wet, - And would wiggle and fret, -And her cunt-lips would curl and unfurl. -% -A pathetic old maid of Bordeaux -Fell in love with a dashing young beau. - To arrest his regard - She would squat in his yard -And longingly pee in the sneaux. -% -A physical fellow named Fisk -Could screw at a rate very brisk. - So fast was his action - The Fitzgerald contraction -Would shrink up his rod to a disk. -% -A pious old woman named Tweak -Had taught her vagina to speak. - It was frequently liable - To quote from the Bible, -But when fucking -- not even a squeak! -% -A pious young lady named Finnegan -Would caution her friend, "Well, you're in again; - So time it aright, - Make it last through the night, -For I certainly don't want to sin again!" -% -A pious young lady of Chichester -Made all of the saints in their niches stir - And each morning at matin - Her breast in pink satin -Made the bishop of Chichester's breeches stir. -% -A playful young chemist named Byrd -Had an urge that could not be deferred. - So to irritate Knox - He shit in his sox, -And plastered the walls with his turd. -% -A plumber whose name was John Brink -Plumbed the cook as she bent o'er the sink. - Her resistance was stout, - And John Brink petered out, -With his pipe-wrench all limber and pink. -% -A pretty wife living in Tours -Demanded her daily amour. - But the husband said, "No! - It's to much. Let it go! -My backsides are dragging the floor." -% -A pretty young boy known as Kevin -Was raped in a pasture by seven - Lascivious beasts - (Oh, those Anglican priests) -And such is the Kingdom of Heaven. -% -A pretty young lady named Vogel -Once sat herself down on a molehill. - A curious mole - Nosed into her hole -- -Ms. Vogel's okay, but the mole's ill. -% -A pretty young maiden from France -Decided she'd "just take a chance." - She let herself go - For an hour or so, -And now all her sisters are aunts. -% -A princess who lived near a bog -Met a prince in the form of a frog. - Now she and her prince - Are the parents of quints, -Four boys and one fine polliwog. -% -A princess who reigned in Baroda -Made her home on a purple pagoda. - She festooned the walls - Of her halls with the balls -And the tools of the fools who be-stroda'. -% -A programmer down in Moline -Said, I'm the match for any machine. - My secret's aversion, - To loops and recursion, -Just acres of in-line routine. - -- W. J. Wilson -% -A progressive professor named Winners -Held classes each evening for sinners. - They were graded and spaced - So the vile and debased -Would not be held back by beginners. -% -A rapist who reeked of cheap booze -Attempted to ravish Miss Hughes. - She cried, "I suppose - There's no time for my clothes, -But PLEASE let me take off my shoes!" -% -A rapturous young fellatrix -One day was at work on five pricks. - With an unholy cry - She whipped out her glass eye: -"Tell the boys I can now take on six." -% -A reckless young lady of France -Had no qualms about taking a chance, - But she thought it was crude - To get screwed in the nude, -So she always went home with damp pants. -% -A remarkable race are the Persians, -They have such peculiar diversions. - They screw the whole day - In the regular way, -And save up the nights for perversions. -% -A responsive young girl from the East -In bed was an able artiste. - She had learned two positions - From family physicians, -And ten more from the old parish priest. -% -A romantic attraction has clung -To a chap of whom damsels have sung: - "'Tis the Scourge from the East, - That lascivious beast -Who was known as Attila the Hung!" -% -A sailor who slept in the sun, -Woke to find his fly buttons undone, - He remarked with a smile, - "Good grief, a sun-dial! -And now it's a quarter-past one." -% -A savvy young hooker named Gail -Got busted and lodged in the jail. - But the jailer got hot, - To be lodged in her twat, -And so Gail made the bail with her tail. -% -A scandal involving an oyster -Sent the Countess of Clews to a cloister - She preferred it, in bed, - To the count (so she said) -'Cause it's longer and stronger and moister. -% -A scream from the crypt of St. Giles -Resounded for miles upon miles. - Said the friar, "Good gracious, - The brother Ignatious -Forgeteth the abbot hath piles." -% -A seafaring hacker named Slatey -Went to bed with a VAX/780. - The thing's learned to swear - With a nautical air, -And refers to its users as "matey". -% -A sex-loving coed named Bree -Caught the clap from her Apple IIE. - The joystick, she found, - Had been fooling around -With a neighboring student's PC. -% -A silly young man from Hong Kong -Had hands that were skinny and long. - He ate rice with his fingers-- - The taste of it lingers, -But now all his fingers are gone. -% -A slick talking pirate named Bruce -To steal code, had a plan to seduce - An Apple II+. - Now Bruce wears a truss -And was jailed for computer abuse. -% -A software technician from Digital -Had hardware extremely prodigical. - It's rumoured, I hear, - That when he was near -He made the ladies all flustered and fidgital. -% -A space shuttle pilot named Ventry, -Made love to a lovely girl sentry. - She started to pout, - Because it fell out, -But the mission was saved by re-entry. -% -A sperm faced, alack and forsooth, -His moment of sexual truth. - He'd expected to fall - On a womb's spongy wall -But was dashed to his death on a tooth. -% -A spinster in Kalamazoo -Once strolled after dark by the zoo. - She was seized by the nape, - And fucked by an ape, -And she murmured, "A wonderful screw." - -And she added, "You're rough, yes, and hairy, -But I hope -- yes I do -- that I marry - A man with a prick - Half as stiff and as thick -As the kind that you zoo-keepers carry." -% -A spunky young schoolboy named Fred -Used to toss off each night while in bed. - Said his mother, "Dear lad, - That's exceedingly bad-- -Jump in here with your mama instead." -% -A starship commander named Kirk -Emerged from his cabin berserk. - He grabbed a girl yeoman - Beneath the abdomen, -And gave her a physical jerk. -% -A stout Gaelic warrior, McPherson, -Was having a captive, a person - Who was not averse - Though she had the curse, -And he'd breeches of bristling furs on. -% -A structured programmer named Drew -Was intensely turned on by "goto". - When he saw it in code - He'd shoot off his load. -It's a good thing his shop used so few. -% -A studious professor named Nestor -Bet a whore all his books that he could best her. - But she drained out his balls - And skipped up the walls, -Beseeching poor Nestor to rest her. -% -A sweetheart named Teresa Arden -Went down on her beau in the garden. - He said, "Good lord, Tess, - Don't swallow that mess!" -And she replied, "Ulp, beg your pardon?" -% -A systems programmer named Sprotic -Found his software intensely erotic. - In jealous distress - He wiped his OS. -It's possible that he's psychotic. -% -A talented fuckstress, Miss Chisholm, -Was renowned for her fine paroxysm. - While the man detumesced - She still spent on with zest, -Her rapture sheer anachronism. -% -A team playing baseball in Dallas -Called the umpire blind out of malice. - While this worthy had fits - The team made eight hits -And a girl in the bleachers named Alice. -% -A teenage protester named Lil -Cried, "Those Watergate spies make me ill - First they bugged our martinis, - Our bras and bikinis, -And now they are bugging the pill." -% -A thrice-married gal from L.A. -Said, "My hymen's intact to this day, - 'Cause my first (a shrink) talked of it, - The voyeur only gawked at it, -And my most recent man's a gourmet." -% -A tidy young lady of Streator -Dearly loved to nibble a peter. - She always would say, - "I prefer it this way. -I think it is very much neater." -% -A timid young woman named Jane -Found parties a terrible strain; - With movements uncertain - She'd hide in a curtain -And make sounds like a rabbit in pain. - -- Edward Gorey -% -A tired young trollop of Nome -Was worn out from her toes to her dome. - Eight miners came screwing, - But she said, "Nothing doing; -One of you has to go home!" -% -A trapper named Francois Lefebrve -Once captured and buggered a beabrve. - The result of this fuck - Was a three titted duck, -A canoe, and an Irish retriebrve. -% -A tutor who tooted a flute -Tried to tutor two tutors to toot - Said the two to the tutor: - "Is it harder to toot or -To tutor two tutors to toot" -% -A vengeful technician named Schmitz -Caused a disk drive to go on the fritz. - He covered the platter - With bats' fecal matter. -Now it's seek time is really the pits. -% -A very intelligent turtle -Found programming UNIX a hurdle - The system, you see, - Ran as slow as did he, -And that's not saying much for the turtle. -% -A very odd pair are the Pitts: -His balls are as large as her tits, - Her tits are as large - As an invasion barge-- -Neither knows how the other cohabits. -% -A wanton young lady from Wimley -Reproached for not acting quite primly - Said, "Heavens above! - I know sex isn't love, -But it's such an entrancing facsimile." -% -A water pipe suited Miss Hunt; -She used it for many a bunt. - But the unlucky wench - Got it caught in her trench --- -It took twenty-two men and a big Stillson wrench, -To get the thing out of her cunt. -% -A weary old lecher named Blott -Took a luscious young blond to his yacht. - Too lazy to rape her, - He made darts out of paper, -Which he leisurely tossed at her twat. -% -A whimsical fellow named Bloch -Could beat the base drum with his cock. - With a special erection - He could play a selection -From Johann Sebastian Bach. -% -A wicked stone cutter named Cary -Drilled holes in divine statuary. - With eyes full of malice - He pulled out his phallus, -And buggered a stone Virgin Mary. -% -A wide-bottomed girl named Trasket -Had a hole as big as a basket. - A spot, as a bride, - In it now, you could hide, -And include with your luggage your mascot. -% -A widow whose singular vice -Was to keep her late husband on ice - Said, "It's been hard since I lost him -- - I'll never defrost him! -Cold comfort, but cheap at the price." -% -A wonderful bird is the pelican. -His mouth can hold more than his belican. - He can take in his beak - Enough food for a week. -I'm darned if I know how the helican. -% -A wonderful tribe are the Sweenies, -Renowned for the length of their peenies. - The hair on their balls - Sweeps the floors of their halls, -But they don't look at women, the meanies. -% -A wood-fetish busboy named Gable -Is rapid, is thorough, is able; - But when everything's cleared, - He gives way to the weird, -As he lovingly busses each table. -% -A worn-out young husband named Lehr -Heard daily his wife's plaintive prayer: - "Slip on a sheath, quick, - Then slip your big dick -Between these lips covered with hair." -% -A worried young man from Stamboul -Discovered red spots on his tool. - Said the doctor, a cynic, - "Get out of my clinic -Just wipe off the lipstick, you fool." -% -A young bride and groom of Australia -Remarked as they joined genitalia: - "Though the system seems odd, - We are thankful that God -Developed the genus Mammalia." -% -A young fellow discovered through Freud -That although of penis devoid, - He could practice coitus - By eating a foetus, -And his parents were quite overjoyed. -% -A young Juliet of St. Louis -On a balcony stood acting screwy. - Her Romeo climbed, - But he wasn't well timed, -And half-way up, off he went -- blooey! -% -A young lad named Lester McGraw -Caught a stranger on top of his Maw. - As he watched him stick her - He said, with a snicker, -"You do it much faster than Paw." -% -A young lady sat by the sea, -Just as proper as proper could be. - A young fellow goosed her, - And roughly seduced her, -So she thanked him and went home to tea. -% -A young lady who lived by the Usk -Subsisted each day on a rusk; - She ate the first bite - Before it was light, -And the last crumb sometime after dusk. - -- Edward Gorey -% -A young lass got married at Chester; -Her mother she kissed and she blessed her. - Said she, "You're in luck -- - 'E's a stunning good fuck, -For I've 'ad 'im meself down in Leicester." -% -A young maiden from France was no prude, -She decided to dive in the nude, - But her buddy, behind, - Went out of his mind, -When he noticed where she was tattooed. -% -A young man by a girl was desired -To give her the thrills she required, - But he died of old age - Ere his cock could assuage -The volcanic desire it inspired. -% -A young man from the banks of the Po -Found his cock had elongated so, - That when he'd pee - It was never he -But only his neighbors who'd know. -% -A young man grew increasingly peaky -In a house where the hinges were squeaky, - The ferns curled up brown, - The ceilings flaked down, -And all of the faucets were leaky. - -- Edward Gorey -% -A young man maintained that his trigger -Was so big that there weren't any bigger. - But this long and thick pud - Was so heavy it could -Scarcely lift up its head. It lacked vigor. -% -A young man of acumen and daring, -Who'd amassed a great fortune in herring, - Was left quite alone - When it soon became known -That their use at his board was unsparing. - -- Edward Gorey -% -A young man of Llanfairpwllgwyngyll -While bent over plucking a dingle - Had the whole of Eisteddfod - Taking turns at his pod -While they sang some impossible jingle. -% -A young man with passions quite gingery -Tore a hole in his sister's best lingerie. - He slapped her behind - And made up his mind -To add incest to insult and injury. -% -A young polo-player of Berkeley -Made love to his sweetheart berserkly. - In the midst of each chukker - He would break off and fuck her -Horizontally, laterally and verkeley. -% -A young wife in the outskirts of Reims -Preferred frigging to going to mass. - Said her husband, "Take Jacques, - Or any young cock, -For I cannot live up to your ass." -% -A young woman got married at Chester, -Her mother she kissed her and blessed her. - Says she, "You're in luck, - He's a stunning good fuck, -For I've had him myself down in Leicester." -% -According to experts, the oyster -In its shell - a crustacean cloister - - May frequently be - Either he or a she -Or both, if it should be its choice ter. -% -Alas for the Countess d'Isere, -Whose muff wasn't furnished with hair. - Said the Count, "Quelle surprise!" - When he parted her thighs; -"Magnifique! Pourtant pas de la guerre." -% -All the female apes ran from King Kong -For his dong was unspeakably long. - But a friendly giraffe - Quaffed his yard and a half, -And ecstatically burst into song. -% -An aesthete from South Carolina -Had a cock that tickled like China, - But while shooting his load - It cracked like old Spode, -So he's bought him a Steuben vagina. -% -An agreeable girl named Miss Doves -Likes to jack off the young men she loves. - She will use her bare fist - If the fellows insist -But she really prefers to wear gloves. -% -An AI researcher named Bluth -Wrote, to find out the sexual truth, - Eroticon VI, - Which he taught certain tricks -Which I'm sure can't be found in Knuth. -% -An amazon giantess named Dunne -Let a midget screw her for fun. - But the poor little runt - Was engulfed in her cunt -And re-born as the twin of his son. -% -An ambitious lady named Harriet -Once dreamed she was raped in a chariot - By seventeen sailors - A monk and three tailors, -Mohammed and Judas Iscariot. -% -An anonymous woman we knew -Was dozing one day in her pew; - When the preacher yelled "Sin!" - She said, "Count me in -As soon as the service is through." -% -An architect fellow named Yoric -Could, when feeling euphoric, - Display for selection - Three kinds of erection- -Corinthian, ionic, and doric. -% -An ardent young man named Magruder -Once wooed a girl nude in Bermuda. - She thought it quite lewd - To be wooed in the nude, -But Magruder was shrewder, he screwed her. -% -An Argentine gaucho named Bruno -Who said, "Fucking is one thing I do know. - Women are fine - And sheep are divine -But llamas are numero uno." -% -An ARPAnaut name of Corvette -Had a fetish involving the net. - As he fondled his IMP - His cock went from limp -To as hard as concrete which has set. -% -An arrogant wench from Salt Lake -Liked to tease all the boys on the make. - She was finally the prize - Of a man twice her size -And all she recalls is the ache. -% -An artist who lived in Australia -Once painted his ass like a Dahlia. - The drawing was fine, - The colour - divine, -The scent - ah, that was a failia. -% -An eager young hacker named Gus -Once buggered a VAX Unibus. - The hardware went bad, - But not the young lad -(Except for the toupee and truss). -% -An earnest young woman in Thrace -Said, "Darling, that's not the right place!" - So he gave her a thwack, - And did on her back, -What he couldn't have done face to face. -% -An Edwardian father named Udgeon, -Whose offspring provoked him to dudgeon, - Used on Saturday nights - To turn down the lights, -And chase them around with a bludgeon. - -- Edward Gorey -% -An envious girl named McMeanus -Was jealous of her lover's big penis. - It was small consolation - That the rest of the nation -Of women were with her in weeness. -% -An exotic young lady named Suki -Once danced in a troupe of kabuki - When asked for a fuck - She said, "Solly, no luck-- -See here: looky looky, no nuki " -% -An impish young fellow named James -Had a passion for idiot games. - He lighted the hair - Of his lady's affair -And laughed as she pissed through the flames. -% -An impotent Scot named MacDougall -Had to husband his sperm and be frugal. - He was gathering semen - To gender a he-man, -By screwing his wife through a bugle. -% -An incautious young woman named Venn -Was seen with the wrong sort of men; - She vanished one day, - But the following May -Her legs were retrieved from a fen. - -- Edward Gorey -% -An indefatigable woman named Bavel -Had often occasion to travel; - On the way she would sit - And furiously knit, -And on the way back she'd unravel. - -- Edward Gorey -% -An ingenious young man in South Bend -Made a synthetic ass for a friend, - But the friend shortly found - Its construction unsound, -It was simply a bother -- no end. -% -An innocent maiden named Herridge -Was cruelly tricked into marriage; - When she later found out - What her spouse was about, -She threw herself under a carriage. - -- Edward Gorey -% -An inquisitive virgin named Dora -Asked the man who started to bore 'er: - "Do you mean birds and bees - Go through antics like these, -To supply us our fauna and flora?" -% -An irate young lady named Booker -Told her husband, "You beast, I'm no hooker! - If you want it queer ways, - Go to whores for your lays!" -So he packed up his tool and forsook 'er. -% -An octagenerian Jew -To his wife remained steadfastly true. - This was not from compunction, - But due to dysfunction -Of his spermatic glands -- nuts to you. -% -An old couple just at Shrovetide -Were having a piece -- when he died. - The wife for a week - Sat tight on his peak, -And bounced up and down as she cried. -% -An old electronic designer -Had designs on a minor named Dinah. - He couldn't carry them out - For his prick was too stout, -And too small was the minor's vagina. -% -An old gentleman's crotchets and quibblings -Were a terrible trial to his siblings, - But he was not removed - Till one day it was proved -That the bell-ropes were damp with his dribblings. - -- Edward Gorey -% -An old maid who had a pet ape -Lived in fear of perpetual rape. - His red, hairy phallus - So filled her with malice -That she sealed up her snatch with Scotch tape. -% -An old man at the Folies Bergere -Had a jock, a most wondrous affair: - It snipped off a twat-curl - From each new chorus girl, -And he had a wig made of the hair. -% -An organist playing in York -Had a prick that could hold a small fork, - And between obbligatos - He'd munch at tomatoes, -To keep up his strength while at work. -% -An orgasmic young sex star named Sue -Was a hit as she writhed to a screw. - Her climatic fame spread - With an ad blitz that said: -Coming soon at a theater near you! -% -An uptight young lady named Breerley -Who valued her morals too dearly - Had sex, so I hear, - Only once every year, -And she strained her vagina severely. -% -And then there's the story that's fraught -With disaster -- of balls that got caught, - When a chap took a crap - In the woods, and a trap -Underneath... Oh, I can't bear the thought! -% -As for weirdness, the guy who's the tops -Is a kinky old butcher named Pops. - Since he thinks it's effete - To be beating his meat, -What he's into is licking his chops. -% -As he came in his chubby choirboy, -Father Burke said, "There's no greater joy! - If no sodomy levens - And possible heavens, -Existence will merely annoy." -% -As the breeches-buoy swing towards the rocks, -Its occupant cried, "Save my socks! - I could not bear the loss, - For with scarlet silk floss -My mama has embroidered their clocks." - -- Edward Gorey -% -As tourists inspected the apse -An ominous series of raps - Came from under the altar, - Which caused some to falter -And others to shriek and collapse. - -- Edward Gorey -% -Asked a supplicant priest of the pontiff, -"Do I sin if I do what I want, if - I screw a young nun - In the eastertide sun?" -His holiness murmured, "Gut yontiff." -% -At a contest for farting in Butte -One lady's exertion was cute: - It won the diploma - For fetid aroma, -And three judges were felled by the brute. -% -At a dance, a girl from Connecticut -Showed an absolute absence of etiquette - Letting all comers press - Through the skirt of her dress -And wiping the mess with her petticoat. -% -At the end of all civilization -Is the planet Terminus's location. - There's a girl there whose feat, - Without stone or concrete, -Nonetheless, was to lay the Foundation. -% -At the moment Japan declared war -A sailor was fucking a whore. - He said, "After this poke - `Long and hard' ain't no joke; -This means months 'til I get back ashore." -% -At the Villa Nemetia the sleepers -Are disturbed by a phantom in weepers; - It beats all night long - A dirge on a gong -As it staggers about in the creepers. - -- Edward Gorey -% -At Vassar, sex isn't injurious, -Though of love we are never penurious. - Thanks to vulcanized aids, - Though we may die old maids, -At least we shall never die curious. -% -At whist drives and strawberry teas -Fan would giggle and show off her knees; - But when she was alone - She'd drink eau de cologne, -And weep from a sense of unease. - -- Edward Gorey -% -Augustus, for splashing his soup, -Was put for the night on the stoop; - In the morning he'd not - Repented a jot, -And next day he was dead of the croup. - -- Edward Gorey -% -Back in the days of old Adam -The grass served as mattress for madam, - And they spent the whole day - On the sex that today -They would bounce on box springs, if they had 'em. -% -Each Friday his engines abort, -But Scotty is never caught short. - He fills his machines - With space-navy beans, -And farts the ship back into port. -% -Each night Father fills me with dread -When he sits on the foot of my bed; - I'd not mind that he speaks - In gibbers and squeaks, -But for the seventeen years he's been dead. - -- Edward Gorey -% -From deep in the crypt at St. Giles -Came a bellow that echoed for miles. - Said the rector, "My gracious, - Has Father Ignatius -Forgotten the Bishop has piles!?" -% -From Number Nine, Penwiper Mews, -There is really abominable news; - They've discovered a head - In the box for the bread, -But nobody seems to know whose. - -- Edward Gorey -% -From the bathing machine came a din -As of jollification within; - It was heard far and wide, - And the incoming tide -Had a definite flavour of gin. - -- Edward Gorey -% -"Fucked by the finger of Fate!" -Bewailed a young fellow named Tate. - "Since dating Miss Baugh, - My whole tongue has been raw-- -It must have been something I ate." -% -In the case of a lady named Frost, -Whose cunt's a good two feet acrost, - It's the best part of valor - To bugger the gal, or -You're apt to fall in and get lost. -% -In the Garden of Eden lay Adam, -Complacently stroking his madam, - And loud was his mirth - For on all of the earth -There were only two balls -- and he had 'em. -% -It always delights me at Hank's -To walk up the old river banks. - One time in the grass - I stepped on an ass, -And heard a young girl murmur, "Thanks." -% -It had snowed, and the man in the drift, -Flagged her down and asked, "Give me a lift?" - They sat in her Bentley, - She fondled him gently, -And the lift that he'd asked for was swift! -% -The late Brigham Young was no neuter -- -No faggot, no fairy, no fruiter. - Where ten thousand virgins - Succumbed to his urgin's -There now stands the great State of Utah. -% -The latest reports from Good Hope -State that apes there have pricks thick as rope, - And fuck high, wide, and free, - From the top of one tree -To the top of the next -- what a scope! -% -The limerick, a verse form iniquitous, -Has nonetheless been ubiquitous. - Once Congress in session, - Declared its suppression, -But people got around that by writing the last line with no rhyme or meter. -% -The limerick is furtive and mean; -You must keep her in close quarantine, - Or she sneaks to the slums - And promptly becomes -Disorderly, drunk, and obscene. - -- Morris Bishop -% -The old archeologist, Throstle, -Discovered a marvelous fossil. - He knew from its bend - And the knot on the end, -T'was the penis of Paul the Apostle. -% -There once was a bishop from Birmingham -Who deflowered young girls while confirming 'em. - As they knelt on the hassock - He lifted his cassock -And slipped his episcopal worm in 'em. -% -There once was a boy named Carruthers -Who was busily fucking his mother - "I know it's a sin," - He said, shoving it in, -"But it's better than blowing my brother." -% -There once was a chick named Longet, -Who went out to Aspen to play. - Along came a Spyder, - Who sat down beside her -And she blew the poor bastard away. -% -There once was a clergyman's daughter -Who detested the pony he bought her, - Till she found that its dong - Was as hard and as long -As the prayers her father had taught her. - -She married a fellow named Tony -Who soon found her fucking the pony. - Said he, "What's it got, - My dear, that I've not?" -Sighed she, "Just a yard-long bologna." -% -There once was a couple named Kelley, -Who lived their life belly to belly. - Because in their haste - They used library paste, -Instead of petroleum jelly. -% -There once was a dentist named Stone -Who saw all his patients alone. - In a fit of depravity - He filled the wrong cavity, -And my, how his practice has grown! -% -There once was a Duchess of Beever -Who slept with her golden retriever. - Said the potted old Duke: - "Such tricks make me puke! -Were it not for her money, I'd leave her." -% -There once was a Duchess of Bruges -Whose cunt was incredibly huge. - Said the king to this dame - As he thunderously came: -"Mon Dieu! Apres moi, le deluge!" -% -There once was a fag of Khartoum -Who spent the night in a Lesbian's room. - They argued all night, - Over who had the right, -To do what, and with which, and to whom. -% -There once was a fairy named Avers -Who encircled his cock with lifesavers. - Though buggers all claimed - That their asses were maimed, -Sixty-niners all cheered the new flavors. -% -There once was a fellow named Bob -Who in sexual ways was a snob. - One day he was swimmin' - With twelve naked women -And deserted them all for a gob. -% -There once was a fellow named Brewster -Who said to his wife, as he goosed her, - "It used to be grand - But look at my hand -You're not wiping as clean as ya uster." -% -There once was a fellow named Howard, -Whose tool it was nuclear-powered, - While grabbing some ass, - He reached critical mass, -But think of the girl he deflowered! -% -There once was a fellow named Potts -Who was prone to having the trots - But his humble abode - Was without a commode -So his carpet was covered with spots. -% -There once was a fellow named Siegel -Who attempted to bugger a beagle, - But the mettlesome bitch - Turned and said with a twitch, -"It's fun, but you know it's illegal." -% -There once was a fencer named Fisk, -Whose speed was incredibly brisk. - So fast was his action, - The Fitzgerald contraction, -Foreshortened his foil to a disk. -% -There once was a fiesty young terrier -Who liked to bite girls on the derriere. - He'd yip and he'd yap, - Then leap up and snap; -And the fairer the derriere the merrier. -% -There once was a floozie named Annie -Whose prices were cosy--but cannie: - A buck for a fuck, - Fifty cents for a suck, -And a dime for a feel of her fanny. -% -There once was a freshman named Lin, -Whose tool was as thin as a pin, - A virgin named Joan - From a bible belt home, -Said "This won't be much of a sin." -% -There once was a gangster named Brown -- the sneakiest bastard in town. - He was caught by G-men - Shooting his semen -Where the cops would slip and fall down. -% -There once was a gaucho named Bruno, -Who said, "About sex, well, I do know, - Sheep are just fine, - Chickens, divine, -But iguanas are Numero Uno." -% -There once was a gay young Parisian -Who screwed an appendix incision, - And the girl of his choice - Could hardly rejoice -At the horrible lack of precision. -% -There once was a girl from Cornell -Whose teats were shaped like a bell. - When you touched them they shrunk, - Except when she was drunk, -And then they got bigger than hell. -% -There once was a girl from Decatur, -Who got laid by a big alligator. - Now nobody knew - The result of that screw, -'Cause after he laid her, he ate her. -% -There once was a girl from Madras -Who had such a beautiful ass - - It was not round and pink - (As you bastards think) -But had two ears, a tail, and ate grass. -% -There once was a girl from Spokane, -Went to bed with a one-legged man. - She said, "I know you-- - You've really got two! -Why didn't you say so when we began?" -% -There once was a girl named Irene -Who lived on distilled kerosene - But she started absorbin' - A new hydrocarbon -And since then has never benzene. -% -There once was a girl named Louise -Who cunt hair hung down to her knees - The crabs in her twat - Tied the hairs in a knot -And constructed a flying trapeze -% -There once was a girl named Mcgoffin -Who was diddled amazingly often. - She was rogered by scores - Who'd been turned down by whores, -And was finally screwed in her coffin. -% -There once was a girl named Priscilla -Whose vagina was flavored vanilla. - The taste was so fine - Man and beast stood in line -(Including a stud armadilla). -% -There once was a girl so lovely, -Who wanted to make love in the bubbly, - She strapped on her tanks, - And started her pranks, -But the lobsters all thought she was ugly. -% -There once was a golfer named Leer, -Who got put in the clink for a year, - For an action obscene, - On the very first green. -Where the sign said "Enter course here." -% -There once was a gouty old colonel -Who grew glum when the weather grew vernal, - And he cried in his tiffin - For his prick wouldn't stiffen, -And the size of the thing was infernal. -% -There once was a guardsman from Buckingham -Who said, "As for girls, I hate fucking 'em. - But when I meet boys, - God! how I enjoys -Just licking their peckers and sucking 'em." -% -There once was a hacker named Ken -Who inherited truckloads of Yen. - So he built him some chicks, - Of silicon chips, -And hasn't been heard from since then. -% -There once was a handsome young seaman -Who with ladies was really a demon. - In peace or in war, - At sea or on shore, -He could certainly dish out the semen. -% -There once was a horny old bitch -With a motorized self-frigger which - She would use with delight - All day long and all night - -Twenty bucks: Abercrombie & Fitch. -% -There once was a horse named Lily -Whose dingus was really a dilly. - It was vaginoid duply, - And labial quadruply -- -In fact, he was really a filly. -% -There once was a husky young Viking -Whose sexual prowess was striking. - Every time he got hot - He would scour the twat -Of some girl that might be to his liking. -% -There once was a jolly old bloke -Who picked up a girl for a poke. - He took down her pants, - Fucked her into a trance, -And then shit into her shoe for a joke. -% -There once was a kiddie named Carr -Caught a man on top of his mar. - As he saw him stick 'er, - He said with a snicker, -"You do it much faster than par." -% -There once was a lady from Kansas -Whose cunt was as big as Bonanzas. - It was nine inches deep - And the sides were quite steep -- -It had whiskers like General Carranza's. -% -There once was a lady named Carter, -Fell in love with a virile young Tartar. - She stripped off his pants, - At his prick quickly glanced, -And cried: "For that I'll be a martyr!" -% -There once was a lady named Clair, -Who possessed a magnificent pair. - Or that's what I thought, - Till I saw one get caught, -On a thorn and begin losing air. -% -There once was a lady named Myrtle -Who had an affair with a turtle. - She had crabs, so they say, - In a year and a day -Which proved that that turtle was fertile. -% -There once was a lawyer named Rex -With minuscule organs of sex. - Arraigned for exposure, - He maintained with composure, -"De minimis non curat lex." - - [Trans: the law does not concern itself with small things. Ed.] -% -There once was a lifeguard named Lee -Who rescued a girl from the sea - She asked how to pay, - And he said "Try this way, -Go down for the third time on me." -% -There once was a maid from Mobile -Whose cunt was made of blue steel. - She only got thrills - From pneumatic drills -And an off-centered emery wheel. -% -There once was a man from Bombay -He would do it all night and all day - He soon became sore - You shoulda' heard him roar -When his wife rubbed his balls with Ben-Gay! -% -There once was a man from Calcutta -Who used to beat off in the gutta - The heat of the sun - Affected his gun -And turned all his cream into butta! -% -There once was a man from Dunoon, -Who always ate soup with a fork. - He said "When I eat - Either fish, foul or flesh, -I otherwise finish too quick." -% -There once was a man from Nantucket -Who kept all his cash in a bucket. - His daughter, named Nan, - Ran away with a man, -And as for the bucket, Nantucket. - -The pair of them went to Manhasset, -(Nan and the man with the asset.) - Pa followed them there, - But they left in a tear, -And as for the asset, Manhasset. - -Pa followed the pair to Pawtucket, -(Nan and the man with the bucket.) - Pa said to the man, - "You're welcome to Nan." -But as for the bucket, Pawtucket. -% -There once was a man from Racine, -Who invented a screwing machine. - Both concave and convex, - It could please either sex, -But, oh, what a bastard to clean! -% -There once was a man from Sandem -Who was making his girl on a tandem. - At the peak of the make - She jammed on the brake -And scattered his semen at random. -% -There once was a man from Sydney -Who could put it up to her kidney. - But the man from Quebec - Put it up to her neck; -He had a big one, now didn't he? -% -There once was a man named McGruder, -Who canoed with a girl in Bermuder. - But the girl thought it crude, - To be wooed in the nude, -So McGru took an oar and subduder. -% -There once was a man named McSweeny -Who spilled lots of gin on his weeney. - So just to be couth, - He added vermouth, -And slipped his best girl a martini. -% -There once was a man named Parridge -With peculiar views on marriage. - He sucked off his brother, - Fucked his own mother, -And gobbled his sister's miscarriage. -% -There once was a man with a hernia -Who said to his doctor, "Gol dern ya, - When you work on my middle - Be sure you don't fiddle -With things that do not concern ya." -% -There once was a member of Mensa -Who was a most excellent fencer. - The sword that he used - Was his -- (line is refused, -And has now been removed by the censor). -% -There once was a miner named Dave, -Who kept a dead whore in his cave. - She was ugly as shit, - And missing one tit, -But think of the money he saves. -% -There once was a monk of Camyre -Who was seized with a carnal desire - And the primary cause - Was the abbess's drawers -Which were hung up to dry by the fire. -% -There once was a newspaper vendor, -A person of dubious gender. - He would charge one-and-two - For permission to view -His remarkable double pudenda. -% -There once was a plumber from Leigh -Who was plumbing his maid by the sea. - Said she, "Please stop plumbing, - I think someone's coming!" -Said he, "Yes, I know love, it's me." -% -There once was a pretty young Mrs. -Whose tearful but short story thrs. - Her mind lost its grasp - - Now she thinks she's an asp -And just sits in the corner and hrs. -% -There once was a queen of Bulgaria -Whose bush had grown hairier and hairier, - Till a prince from Peru - Who came up for a screw -Had to hunt for her cunt with a terrier. -% -There once was a reverend at Kings -Whose mind 'twas on heavenly things. - But his heart was on fire - For a boy in the choir -Whose buns were like jelly on springs. -% -There once was a sad Maitre d'hotel -Who said, "They can all go to hell! - What they do to my wife -- - Why it ruins my life; -And the worst is they all do it well." -% -There once was a sailor named Gasted, -A swell guy, as long as he lasted, - He could jerk himself off - In a basket, aloft, -Or a breeches-buoy swung from the masthead. -% -There once was a Scot named McAmeter -With a tool of prodigious diameter. - But it wasn't the size - That caused such surprise; -'Twas his rhythm -- iambic pentameter. -% -There once was a son-of-a-bitch, -Neither clever, nor handsome, nor rich, - Yet the girls he would dazzle, - And fuck to a frazzle, -And then ditch them, the son-of-a-bitch! -% -There once was a spaceman named Spock -Who had a huge Vulcanized cock. - A girl from Missouri - Whose name was Uhura -Just fainted away from the shock. -% -There once was a Swede in Minneapolis, -Discovered his sex life was hapless: - The more he would screw - The more he'd want to, -And he feared he would soon be quite sapless. -% -There once was a Usenetter named Mark, -Whose gender was kept in the dark. - He/she/it said with a nod, - "My ancestors were odd!" -Did Noah need two for the ark? -% -There once was a whore from Regina -Who had a stupendous vagina. - To save herself time, - She had six at a time, -And another one working behind her. -% -There once was a woman from Arden -Who sucked off a man in a garden. - He said, "My dear Flo, - Where does all that stuff go?" -And she said, "[Swallow hard] I beg pardon?" -% -There once was a yokel of Beaconsfield -Engaged to look after the deacon's field, - But he lurked in the ditches - And diddled the bitches -Who happened to cross that antique 'un's field. -% -There once was a young girl from Natches -Who chanced to be born with two snatches - She often said, "Shit! - I'd give either tit -For a guy with equipment that matches." -% -There once was a young man from Boston -Who drove around town in an Austin, - There was room for his ass, - And a gallon of gas, -So he hung out his balls and he lost 'em. -% -There once was a young man from France -Who waited ten years for his chance; -Then he muffed it... -% -There once was a young man from Yuma -Who attempted sex with a puma - He gave up real quick - Minus nose, toes, and prick -In obvious pain and ill huma. -% -There once was a young man from Yuma, -Who told an elephant joke to a puma. - Now his dry bleached bones lie, - Under hot Asian skies, -'Cause the puma had no sense of huma. -% -There once was a young man named Clyde -Who fell in an outhouse, and died. - He had a twin brother - Who fell in another -And now they're interred side by side. -% -There once was a young man named Lancelot -Whom the townsfolk would look at askance a lot - For when he should pass - A desirable lass -The front of his pants would advance a lot. -% -There once was an Arpanet freak, -Who better response-time did seek. - He searched coast to coast, - For a reliable host, -Whose logger took less than a week. -% -There once was an old man from Esser, -Who's knowledge grew lesser and lesser. - It at last grew so small, - He knew nothing at all, -And now he's a College Professor. -% -There once were two brothers named Luntz -Who buggered each other at once. - When asked to account - For this intricate mount, -They said, "Ass-holes are tighter than cunts." -% -There was a bluestocking in Florence -Wrote anti-sex pamphlets in torrents, - Till a Spanish grandee, - Got her off with his knee, -And she burned all her works with abhorrence. -% -There was a family named Doe, -An ideal family to know. - As father screwed mother, - She said, "You're heavier than brother." -And he said, "Yes, Sis told me so!" -% -There was a fat lady of China -Who'd a really enormous vagina, - And when she was dead - They painted it red, -And used it for docking a liner. -% -There was a fat man from Rangoon -Whose prick was much like a balloon. - He tried hard to ride her - And when finally inside her -She thought she was pregnant too soon. -% -There was a gay countess of Bray, -And you may think it odd when I say, - That in spite of high station, - Rank and education, -She always spelled cunt with a "k." -% -There was a gay dog from Ontario -Who fancied himself a Lothario. - At a wench's glance - He'd snatch off his pants -And make for her Mons Venerio. -% -There was a gay parson of Norton -Whose prick, although thick, was a short 'un. - To make up for this loss, - He had balls like a horse, -And never spent less than a quartern. -% -There was a gay parson of Tooting -Whose roe he was frequently shooting, - Till he married a lass - With a face like my arse, -And a cunt you could put a top-boot in. -% -There was a lewd fellow named Duff -Who loved to dive deep in the muff. - With his head in a whirl - He said, "Spread it, Pearl; -I cunt get enough of the stuff!" -% -There was a man from Mich. -Who used to wish and wich. - That spring would come - So he could bum -Around and go out fich. -% -There was a pianist named Liszt -Who played with one hand while he pissed, - But as he grew older - His technique grew bolder, -And in concert jacked off with his fist. -% -There was a poor parson from Goring, -Who made a small hole in his flooring, - Fur-lined it all round, - Then laid on the ground, -And declared it was cheaper than whoring. -% -There was a strong man of Drumrig -Who one day did seven times frig. - He buggered three sailors, - Four dogs and two tailors, -And ended by fucking a pig. -% -There was a teenager named Donna -Who never said, "No, I don't wanna." - Two days out of three - She would shoot LSD, -And on weekends she smoked marijuana. -% -There was a young belle of old Natchez -Whose garments were always in patchez. - When comment arose - On the state of her clothes -She, drawled, "When ah itchez, ah scratchez." -% -There was a young blade from South Greece -Whose bush did so greatly increase - That before he could shack - He must hunt needle in stack. -'Twas as bad as being obese. -% -There was a young bride, a Canuck, -Told her husband, "Let's do more than suck. - You say that I, maybe, - Can have my first baby-- -Let's give up this Frenchin' and fuck!" -% -There was a young bride of Antigua -Whose husband said, "Dear me, how big you are!" - Said the girl, "What damn'd rot! - Why, you've only felt my twot, -My legs and my arse and my figua!" -% -There was a young chap in Arabia -Who courted a widow named Fabia. - "Yes, my tongue is as long - As the average man's dong," -He said, licking the lips of her labia. -% -There was a young cook with the art -Of making a delicious tart - With a handful of shit, - Some snot and some spit, -And he'd flavor the whole with a fart. -% -There was a young curate whose brain -Was deranged from the use of cocaine; - He lured a small child - To a copse dark and wild, -Where he beat it to death with his cane. - -- Edward Gorey -% -There was a young damsel named Baker -Who was poked in a pew by a Quaker. - He yelled, "My God! what - Do you call this -- a twat? -Why, the entrance is more than an acre!" -% -There was a young dolly named Molly -Who thought that to frig was a folly. - Said she, "Your pee-pee - Means nothing to me, -But I'll do it just to be jolly." -% -There was a young fellow from Cal., -In bed with a passionate gal. - He leapt from the bed, - To the toilet he sped; -Said the gal, "What about me, old pal?" -% -There was a young fellow from Florida -Who liked a friend's wife, so he borrowed her. - When they got into bed - He cried, "God strike me dead! -This ain't a cunt -- it's a corridor!" -% -There was a young fellow from Leeds -Who swallowed a package of seeds. - Great tufts of grass - Sprouted out of his ass -And his balls were all covered with weeds. -% -There was a young fellow from Parma -Who was solemnly screwing his charmer. - Said the damsel demure, - "You'll excuse me, I'm sure, -But I must say you fuck like a farmer." -% -There was a young fellow name Tucker -Who, instructing a novice cock-sucker, - Said, "Don't bow out your lips - Like an elephant's hips, -The boys like it best when they pucker." -% -There was a young fellow named Ades -Whose favorite fruit was young maids. - But sheep, nigger boys, whores, - And the knot holes in doors -Were by no means exempt from his raids. -% -There was a young fellow named Babbitt -Who could screw nine times like a rabbit, - But a girl from Johore - Could do it twice more, -Which was just enough extra to crab it. -% -There was a young fellow named Bill, -Who took an atomic pill, - His navel corroded, - His asshole exploded, -And they found his nuts in Brazil. -% -There was a young fellow named Blaine, -And he screwed some disgusting old jane. - She was ugly and smelly - With an awful pot-belly, -But... well, they were caught in the rain. -% -There was a young fellow named Bliss -Whose sex life was strangely amiss, - For even with Venus - His recalcitrant penis -Would never do better than t - h - i - s - . -% -There was a young fellow named Bowen -Whose pecker kept growin' and growin'. - It grew so tremendous, - So long and so pendulous, -'Twas no good for fuckin' -- just showin'. -% -There was a young fellow named Brewer -Whose girl made her home in a sewer. - Thus he, the poor soul, - Could get into her hole, -And still not be able to screw her! -% -There was a young fellow named Case -Who entered a cunt-lapping race. - He licked his way clean - Through Number thirteen, -But then slipped and got pissed in the face. -% -There was a young fellow named Charteris -Put his hand where his young lady's garter is. - Said she, "I don't mind, - And higher up you'll find -The place where my fucker and farter is." -% -There was a young fellow named Cribbs -Whose cock was so big it had ribs. - They were inches apart, - And to suck it took art, -While to fuck it took forty-two trips. -% -There was a young fellow named dick -Who had a magnificent prick. - It was shaped like a prism - And shot so much gism -It made every cocksucker sick. -% -There was a young fellow named Feeney -Whose girl was a terrible meany. - The hatch of her snatch - Had a catch that would latch -- She could only be screwed by Houdini. -% -There was a young fellow named Fletcher, -Was reputed an infamous lecher. - When he'd take on a whore - She'd need a rebore, -And they'd carry him out on a stretcher. -% -There was a young fellow named Fyfe -Whose marriage was ruined for life, - For he had an aversion - To every perversion, -And only liked fucking his wife. - -Well, one year the poor woman struck, -And she wept, and she cursed at her luck, - And said, "Where have you gotten us - With your goddamn monotonous -Fuck after fuck after fuck? - -"I once knew a harlot named Lou -- -And a versatile girl she was, too. - After ten years of whoredom - She perished of boredom -When she married a jackass like you!" -% -There was a young fellow named Gene -Who first picked his asshole quite clean. - He next picked his toes, - And lastly his nose, -And he never did wash in between. -% -There was a young fellow named Gluck -Who found himself shit out of luck. - Though he petted and wooed, - When he tried to get screwed -He found virgins just don't give a fuck. -% -There was a young fellow named Goody -Who claimed that he wouldn't, but would he? - If he found himself nude - With a gal in the mood -The question's not woody but could he? -% -There was a young fellow named Grant -Who was made like the sensitive plant. - When they asked "Do you fuck?" - He replied, "No such luck. -I would if I could, but I can't." -% -There was a young fellow named Grimes -Who fucked his girl seventeen times - In the course of a week -- - And this isn't to speak -Of assorted venereal crimes. -% -There was a young fellow named Harry, -Had a joint that was long, huge and scary. - He grabbed him a virgin, - Who, without any urgin', -Immediately spread like a fairy. -% -There was a young fellow named Hatch -Who was fond of the music of Bach. - He said: "It's not fussy - Like Brahms and Debussy; -Sit down, and I'll play you a snatch." -% -There was a young fellow named Kimble -Whose prick was exceedingly nimble, - But fragile and slender, - And dainty and tender, -So he kept it encased in a thimble. -% -There was a young fellow named Meek -Who invented a lingual technique. - It drove women frantic, - And made them romantic, -And wore all the hair off his cheek. -% -There was a young fellow named Morgan -Who possessed an unusual organ: - The end of his dong, - Which was nine inches long, -Was tipped with the head of a gorgon. -% -There was a young fellow named Paul -Who confessed, "I have only one ball. - But the size of my prick - Is God's dirtiest trick, -For my girls always ask, `Is that all?'" -% -There was a young fellow named Pell -Who didn't like cunt very well. - He would finger or fuck one, - But never would suck one-- -He just couldn't get used to the smell. -% -There was a young fellow named Price -Who dabbled in all sorts of vice. - He had virgins and boys - And mechanical toys, -And on Mondays... he meddled with mice! -% -There was a young fellow named Prynne -Whose prick was so short and so thin, - His wife found she needed - A Fuckoscope -- she did -- -To see if he'd gotten it in. -% -There was a young fellow named Skinner -Who took a young lady to dinner - At a quarter to nine, - They sat down to dine, -At twenty to ten it was in her. -The dinner, not Skinner -- Skinner was in her before dinner. - -There was a young fellow named Tupper -Who took a young lady to supper. - At a quarter to nine, - They sat down to dine, -And at twenty to ten it was up her. -Not the supper -- not Tupper -- It was some son-of-a-bitch named Skinner! -% -There was a young fellow named Sweeney, -Whose girl was a terrible meanie, - The hatch of her snatch, - Had a catch that would latch, -She could only be screwed by Houdini. -% -There was a young fellow of Burma -Whose betrothed had good reason to murmur. - But now that he's married he's - Been using cantharides -And the root of their love is much firmer. -% -There was a young fellow of Greenwich -Whose balls were all covered with spinach. - He had such a tool - It was wound on a spool, -And he reeled it out inich by inich. - -But this tale has an unhappy finich, -For due to the sand in the spinach - His ballocks grew rough - And wrecked his wife's muff, -And scratched up her thatch in the scrimmage. -% -There was a young fellow of Harrow -Whose john was the size of a marrow. - He said to his tart, - "How's this for a start? -My balls are outside in a barrow." -% -There was a young fellow of Kent -Whose prick was so long that it bent, - So to save himself trouble - He put it in double, -And instead of coming he went. -% -There was a young fellow of Mayence -Who fucked his own arse in defiance - Not only of custom - And morals, dad-bust him, -But of most of the known laws of science. -% -There was a young fellow of Perth -Whose balls were the finest on earth. - They grew to such size - That one won a prize, -And goodness knows what they were worth. -% -There was a young fellow of Strensall -Whose prick was as sharp as a pencil. - On the night of his wedding - It went through the bedding, -And shattered the chamber utensil. -% -There was a young fellow of Warwick -Who had reason for feeling euphoric, - For he could by election - Have triune erection: -Ionic, Corinthian, and Doric. -% -There was a young fellow whose dong -Was prodigiously massive and long. - On each side of his whang - Two testes did hang -That attracted a curious throng. -% -There was a young German named Ringer -Who was screwing an opera singer. - Said he with a grin, - "Well, I've sure got it in!" -Said she, "You mean that ain't your finger?" -% -There was a young girl from Annista -Who dated a lecherous mister. - He fondled her titty, - Got one finger shitty, -Then screwed up his courage and kissed 'er. -% -There was a young girl from Decatur -Who was raped by an alligator. - But no one quite knew - How she relished that screw, -For after he screwed her, he ate her. -% -There was a young girl from Dundee, -From her fanny there grew a plum tree. - No one ate the nice fruit, - To tell you the truth, -Because they knew it came from her tooty-toot-toot. -% -There was a young girl from Hong Kong -Who said, "You are utterly wrong - To say my vagina - Is the largest in China -Just because of your mean little dong." -% -There was a young girl from Hong Kong -Whose cervical cap was a gong. - She said with a yell, - As a shot rang her bell, -"I'll give you a ding for a dong!" -% -There was a young girl from Medina -Who could completely control her vagina. - She could twist it around - Like the cunts that are found -In Japan, Manchukuo and China. -% -There was a young girl from New York -Who plugged up her cunt with a cork. - A woodpecker or two - Made the grade it is true, -But it totally baffled the stork. - -Till along came a man who presented -A tool that was strangely indented. - With a dizzying twirl - He punctured that girl, -And thus was the cork-screw invented. -% -There was a young girl from Peru, -Who had nothing whatever to do. - So she sat on the stairs, - And counted cunt hairs, -Four thousand, three hundred and two. -% -There was a young girl from Peru, -Who noticed her lovers were few; - So she walked out her door - With a fig leaf, no more, -And now she's in bed - with the flu. -% -There was a young girl from Samoa -Who pledged that no man would know her. - One young fellow tried, - But she wriggled aside, -And he spilled all his spermatozoa. -% -There was a young girl from Seattle, -Whose hobby was sucking off cattle. - But a bull from the South - Shot a wad in her mouth -That made both her ovaries rattle. -% -There was a young girl from Siam -Who said to her boyfriend Priam, - "To seduce me, of course, - You'll have to use force, -And thank goodness you're stronger than I am. -% -There was a young girl from St. Cyr -Whose reflex reactions were queer. - Her escort said, "Mable, - Get up off the table; -That money's to pay for the beer." -% -There was a young girl from St. Paul -Who went to a newspaper ball. - Her dress caught on fire - And burnt her entire -Front page and sport section and all. -% -There was a young girl from the Bronix -Who had a vagina of onyx. - She had so much `tsoris' - With her clitoris, -She traded it in for a Packard. -% -There was a young girl from the coast -Who, just when she needed it most, - Lost her Kotex and bled - All over the bed, -And the head and the beard of her host. -% -There was a young girl in Berlin -Who eked out a living through sin. - She didn't mind fucking, - But much preferred sucking, -And she'd wipe off the pricks on her chin. -% -There was a young girl in Berlin -Who was fucked by an elderly Finn. - Though he diddled his best, - And fucked her with zest, -She kept asking, "Hey, Pop, is it in?" -% -There was a young girl in Dakota -Had a letter from Ickes; he wrote her: - "In addition to gas - We are rationing ass, -And you've greatly exceeded your quota." -% -There was a young girl name McKnight -Who got drunk with her boy-friend one night. - She came to in bed, - With a split maidenhead-- -That's the last time she ever was tight. -% -There was a young girl named Ann Heuser -Who swore that no man could surprise her. - But Pabst took a chance, - Found a Schlitz in her pants, -And now she is sadder Budweiser. -% -There was a young girl named Heather -Whose twitcher was made out of leather. - She made a queer noise, - Which attracted the boys, -By flapping the edges together. -% -There was a young girl named McCall -Whose cunt was exceedingly small, - But the size of her anus - Was something quite heinous -- -It could hold seven pricks and one ball. -% -There was a young girl named O'Clare -Whose body was covered with hair. - It was really quite fun - To probe with one's gun, -For her quimmy might be anywhere. -% -There was a young girl named O'Malley -Who wanted to dance in the ballet. - She got roars of applause - When she kicked off her drawers, -But her hair and her bush didn't tally. -% -There was a young girl named Sapphire -Who succumbed to her lover's desire. - She said, "It's a sin, - But now that it's in, -Could you shove it a few inches higher?" -% -There was a young girl of Aberystwyth -Who screwed every man that she kissed with. - She tickled the balls - Of the men in the halls, -And pulled on the prongs that they pissed with. -% -There was a young girl of Aberystwyth -Who took grain to the mill to get grist with. - The miller's sun, Jack, - Laid her flat on her back, -And united the organs they pissed with. -% -There was a young girl of Angina -Who stretched catgut across her vagina. - From the love-making frock - (With the proper sized cock) -Came Toccata and Fugue in D minor. -% -There was a young girl of Asturias -With a penchant for practices curious. - She loved to bat rocks - With her gentlemen's cocks -- -A practice both rude and injurious. -% -There was a young girl of Batonger -who diddled herself with a conger, - When asked how it feels - To be pleasured by eels -She said, "Just like a man, only longer. -% -There was a young girl of Cah'lina, -Had a very capricious vagina: - To the shock of the fucker - "Twould suddenly pucker, -And whistle the chorus of "Dinah." -% -There was a young girl of Cape Cod -Who dreamt she'd been buggered by God. - But it wasn't Jehovah - That turned the girl over, -'Twas Roger the lodger, the dirty old codger, - the bugger, the bastard, the sod! -% -There was a young girl of Cape Town -Who usually fucked with a clown. - He taught her the trick - Of sucking his prick, -And when it went up -- she went down. -% -There was a young girl of Coxsaxie -Whose skirt was more mini than maxi. - She was fucked at the show - In the twenty-third row, -And once more going home in the taxi. -% -There was a young girl of Darjeeling -Who could dance with such exquisite feeling - There was never a sound - For miles around -Save of fly-buttons hitting the ceiling. -% -There was a young girl of Des Moines -Whose cunt could be fitted with coins, - Till a guy from Hoboken - Went and dropped in a token, -And now she rides free on the ferry. -% -There was a young girl of Detroit -Who at fucking was very adroit: - She could squeeze her vagina - To a pin-point, or finer, -Or open it out like a quoit. - -And she had a friend named Durand -Whose cock could contract or expand. - He could diddle a midge - Or the arch of a bridge -- -Their performance together was grand! -% -There was a young girl of East Lynne -Whose mother, to save her from sin, - Had filled up her crack, - To the brim with shellac, -But the boys picked it out with a pin. -% -There was a young girl of Gibraltar -Who was raped as she knelt at the altar. - It really seems odd - That a virtuous God -Should answer her prayers and assault her. -% -There was a young girl of LLewellyn -Whose breasts were as big as a melon. - They were big it is true, - But her cunt was big too, -Like a bifocal, full-color, aerial view -Of Cape Horn and the Straits of Magellan. -% -There was a young girl of Mobile, -Who hymen was made of chilled steel, - To give her a thrill, - Took a rotary drill, -Or a number nine emery wheel. -% -There was a young girl of Moline -Whose fucking was sweet and obscene. - She would work on a prick - With every known trick, -And finish by winking it clean. -% -There was a young girl of Newcastle -Whose charms were declared universal. - While one man in front - Wired into her cunt, -Another was engaged at her arsehole. -% -There was a young girl of Pawtucket -Whose box was as big as a bucket. - Her boy-friend said, "Toots, - I'll have to wear boots, -For I see I must muck it, not fuck it." -% -There was a young girl of Penzance -Who boarded a bus in a trance. - The passengers fucked her, - Likewise the conductor, -While the driver shot off in his pants. -% -There was a young girl of Pitlochry -Who was had by a man in a rockery. - She said, "Oh! You've come - All over my bum; -This isn't a fuck -- it's a mockery." -% -There was a young girl of Rangoon -Who was blocked by the Man in the Moon. - "Well, it has been great fun," - She remarked when he'd done, -"But I'm sorry you came quite so soon." -% -There was a young girl of Spitzbergen, -Whose people all thought her a virgin, - Till they found her in bed - With her twat very red, -And the head of a kid just emergin'. -% -There was a young girl, very sweet, -Who thought sailors' meat quite a treat. - When she sat on their lap - She unbuttoned their flap, -And always had plenty to eat. -% -There was a young girl who begat -Three brats, by name Nat, Pat, and Tat. - It was fun in the breeding, - But hell in the feeding, -When she found there was no tit for Tat. -% -There was a young harlot from Kew -Who filled her vagina with glue. - She said with a grin, - "If they pay to get in, -They'll pay to get out of it too." -% -There was a young harlot named Schwartz -Whose cock-pit was studded with warts, - And they tickled so nice - She drew a high price -From the studs at the summer resorts. - -Her pimp, a young fellow named Biddle, -Was seldom hard up for a diddle, - For according to rumor - His tool had a tumor -And a fine row of warts down the middle. -% -There was a young hayseed from Tiffan -Whose cock would constantly stiffen. - The knob out in front - Attracted foul cunt -Which he greatly delighted in sniffin'. -% -There was a young idler named Blood, -Made a fortune performing at stud, - With a fifteen-inch peter, - A double-beat metre, -And a load like the Biblical Flood. -% -There was a young Jew of Far Rockaway -Whose screams could be heard for a block away. - Perceiving his error, - The Rabbi in terror -Cried, "God! I have cut his whole cock away!" -% -There was a young lad from Siam, -Whose sex life was caught in a jam. - He loved them real small, - 'Cause they're funner to ball, -So he went out and bought him a lamb! -% -There was a young lad name of Durcan -Who was always jerkin' his gherkin. - His father said, "Durcan! - Stop jerkin' your gherkin! -Your gherkin's for ferkin', not jerkin'. -% -There was a young lad name of Ward -Who strung himself up with a cord - Said he, of his work - (Ere the rope snapped with a jerk) -"I am leaving because I am bored." - -- E. A. Guest -% -There was a young lad named McFee -Who was stung in the balls by a bee - He made oodles of money - By oozing pure honey -Every time he attempted to pee. -% -There was a young lady at sea -Who complained that it hurt her to pee. - Said the brawny old mate, - "That accounts for the state -Of the cook and the captain and me." -% -There was a young lady called Ciss -Who went to the river to piss. - A young man in a punt - Put his hand on her cunt; -No wonder she thought it was bliss. -% -There was a young lady from Bangor -Who slept while the ship lay at anchor - She woke in dismay - When she heard the mate say: -"Let's lift up the topsheet and spanker!" -% -There was a young lady from Bristol -Who went to the Palace called Crystal. - Said she, "It's all glass, - And as round as my ass," -And she farted as loud as a pistol. -% -There was a young lady from Brussels -Who was proud of her vaginal muscles. - She could easily plex them - And so interflex them -As to whistle love songs through her bustles. -% -There was a young lady from Drew -Who ended her verse at line two. -% -There was a young lady from Dumfries -Who said to her boyfriend, "It's some freeze! - My navel's all bare, - So stick it in there, -Before both my legs and my bum freeze." -% -There was a young lady from Exeter, -So pretty that men craned their necks at her. - One was even so brave - As to take out and wave -The distinguishing mark of his sex at her. -% -There was a young lady from Hyde -Who ate a green apple and died. - While her lover lamented - The apple fermented -And made cider inside her inside. -% -There was a young lady from Maine -Who claimed she had men on her brain. - But you knew from the view, - As her abdomen grew, -It was not on her brain that he'd lain. -% -There was a young lady from Munich -Who had an affair with a eunuch. - At the height of their passion - He dealt her a ration -From a squirt gun concealed in his tunic. -% -There was a young lady from Norway -Who hung by her heels in a doorway. - She told her young man, - "Get off the divan, -I think I've discovered one more way" -% -There was a young lady from Prentice -Who had an affair with a dentist. - To make things easier - He used anesthesia, -And diddled her, `non compos mentis'. -% -There was a young lady from Rheims -Who amazingly pissed in four streams. - A friend poked around - And a fly-button found -Lodged tight in her hole so it seems. -% -There was a young lady from Rio -Who slept with the Fornier trio. - As she dropped her panties - She said, "No andantes, -I want this allegro con brio!" -% -There was a young lady from Siam -Who said to her lover, one Kiam, - "You may kiss me of course, - But you'll have to use force. -Though god knows you're stronger than I am." -% -There was a young lady from Spain -Who demurely undressed on a train. - A helpful young porter - Helped more than he orter, -And she promptly cried "Help me again" -% -There was a young lady from Spain -Who got sick as she rode on a train; - Not once, but again, - And again, and again, -And again, and again, and again. -% -There was a young lady from Spain -Whose face was exceedingly plain, - But her cunt had a pucker - That made the men fuck her, -Again, and again, and again. -% -There was a young lady from Troy -Had a moustache, just like a young boy - Though it tickled to kiss - 'Twas a source of much bliss -When she used it to brush a man's toy. -% -There was a young lady from Wheeling -Who claimed to lack sexual feeling. - But a cynic named Boris - Just touched her clitoris -And she had to be scraped off the ceiling. -% -There was a young lady from Wheeling -Who had a peculiar feeling. - She laid on her back - And tickled her crack -And pissed all over the ceiling. -% -There was a young lady from Wooster -Who complained that too many men gooster. - So she traded her scanties - For sandpaper panties, -Now they goose her much less than they used 'ter. -% -There was a young lady in Reno, -Who lost all her dough playing Keno. - But she lay on her back, - And opened her crack, -So now she owns the Casino! -% -There was a young lady named Alice -Who was known to have peed in a chalice. - 'Twas the common belief - It was done for relief, -And not out of protestant malice. -% -There was a young lady named Astor -Who never let any get past her. - She finally got plenty - By stopping twenty, -Which certainly ought to last her. -% -There was a young lady named Banker, -Who slept while the ship lay at anchor, - She woke in dismay, - When she heard the mate say, -"Now hoist up the topsheet and spanker." -% -There was a young lady named Blount -Who had a rectangular cunt. - She learned for diversion - Posterior perversion, -Since no one could fit here in front. -% -There was a young lady named Bower -Who dwelt in an Ivory Tower. - But a poet from Perth - Laid her flat on the earth, -And proceeded with penis to plough her. -% -There was a young lady named Brent -With a cunt of enormous extent, - And so deep and so wide, - The acoustics inside -Were so good you could hear when you spent. -% -There was a young lady named Bright -Who could travel much faster than light. - She took off one day, - In a relative way, -And returned on the previous night. -% -There was a young lady named Brook -Who never could learn how to cook. - But on a divan - She could please any man- -She knew every darn trick in the book! -% -There was a young lady named Cager -Who, as the result of a wager, - Consented to fart - The entire oboe part -Of Mozart's quartet in F major. -% -There was a young lady named Ciss -Who said, "I think skating's a bliss" - But she'll never restate, - For a wheel off her skate -.siht ekil gnihtemos pu hsinif reh edaM -% -There was a young lady named Dot -Whose cunt was so terribly hot - That ten bishops of Rome - And the Pope's private gnome -Failed to quench her Vesuvial twat. -% -There was a young lady named Duff -With a lovely, luxuriant muff. - In his haste to get in her - One eager beginner -Lost both of his balls in the rough. -% -There was a young lady named Etta -Who was constantly seen in a swetta. - Three reasons she had: - To keep warm wasn't bad, -But the other two reasons were betta. -% -There was a young lady named Fleager -Who was terribly, terribly eager - To be all the rage - On the tragedy stage, -Though her talents were pitifully meagre. - -- Edward Gorey -% -There was a young lady named Flo -Whose lover had pulled out too slow. - So they tried it all night, - Till he got it just right... -Well, practice makes pregnant, you know. -% -There was a young lady named Flynn -Who thought fornication a sin, - But when she was tight - It seemed quite all right, -So everyone filled her with gin. -% -There was a young lady named Gilda -Who went on a date with a builder. - He said that he would, - And he could and he should, -And he did and it damn well near killed her. -% -There was a young lady named Gloria, -Whose boyfriend said, "May I explore ya?" - She replied to the chap, - "I'll draw you a map, -Of where others have been to before ya." -% -There was a young lady named Grace -Who would not take a prick in her "place." - Though she'd kiss it and suck it, - She never would fuck it-- -She just couldn't relax face-to-face. -% -There was a young lady named Hall, -Wore a newspaper dress to a ball. - The dress caught on fire - And burned her entire -Front page, sporting section, and all. -% -There was a young lady named Hatch -Who would always come through in a scratch. - If a guy wouldn't neck her, - She'd grab up his pecker -And shove the damn thing up her snatch. -% -There was a young lady named Mable -Who liked to sprawl out on the table, - Then cry to her man, - "Stuff in all you can -- -Get your ballocks in, too, if you're able." -% -There was a young lady named Mandel -Who caused quite a neighborhood scandal - By coming out bare - On the main village square -And frigging herself with a candle. -% -There was a young lady named Maud, -A terrible society fraud: - In company, I'm told, - She was distant and cold, -But if you got her alone, Oh God! -% -There was a young lady named May -Who strolled in a park by the way, - And she met a young man - Who fucked her and ran -- -Now she goes to the park every day. -% -There was a young lady named Nance -Who learned about fucking in France, - And when you'd insert it - She'd squeeze till she hurt it, -And shoved it right back in your pants. -% -There was a young lady named Nelly -Whose tits would jiggle like jelly. - They could tickle her twat - Or be tied in a knot, -And could even swat flies on her belly. -% -There was a young lady named Ransom -Who was rogered three times in a hansom. - When she cried out for more - A voice from the floor -Replied, "My name is Simpson, not Samson." -% -There was a young lady named Riddle -Who had an untouchable middle. - She had many friends - Because of her ends, -Since it isn't the middle you diddle. -% -There was a young lady named Rose -Who fainted whenever she chose; - She did so one day - While playing croquet, -But was quickly revived with a hose. - -- Edward Gorey -% -There was a young lady named Rose -With erogenous zones in her toes. - She remained onanistic - Till a foot-fetishistic -Young man became one of her beaux. -% -There was a young lady named Schneider -Who often kept trysts with a spider. - She found a strange bliss, - In the hiss of her piss, -As it strained through the cobwebs inside her. -% -There was a young lady named Smith -Whose virtue was largely a myth. - She said, "Try as I can - I can't find a man -Who it's fun to be virtuous with." -% -There was a young lady named Twiss -Who said she thought fucking a bliss, - For it tickled her bum - And caused her to come -.siht ekil gniyl ylbatrofmoc elihW -% -There was a young lady named Wylde -Who kept herself quite undefiled - By thinking of Jesus; - Contagious diseases; -And the bother of having a child. -% -There was a young lady of Arden, -The tool of whose swain wouldn't harden. - Said she with a frown, - "I've been sadly let down -By the tool of a fool in a garden." -% -There was a young lady of Bicester -Who was nicer by far than her sister: - The sister would giggle - And wiggle and jiggle, -But this one would come if you kissed her. -% -There was a young lady of Brabant -Who slept with an impotent savant. - She admitted, "We shouldn't, - But it turned out he couldn't- -So you can't say we have when we haven't." -% -There was a young lady of Bude -Who walked down the street in the nude. - A bobby said, "Whattum - Magnificent bottom!" -And slapped it as hard as he could. -% -There was a young lady of Carmia -Whose housekeeping ways would alarm ya. - At every cold snap - She would climb in your lab, -So her little base burner could warm ya. -% -There was a young lady of Dee -Who went down to the river to pee. - A man in a punt - Put his hand on her cunt, -And God! how I wish it were me. -% -There was a young lady of Dee -Whose hymen was split into three. - And when she was diddled - The middle string fiddled: -"Nearer My God To Thee." -% -There was a young lady of Dexter -Whose husband exceedingly vexed her, - For whenever they'd start - He'd unfailingly fart -With a blast that damn nearly unsexed her. -% -There was a young lady of Dover -Whose passion was such that it drove her - To cry, when you came, - "Oh dear! What a shame! -Well, now we shall have to start over." -% -There was a young lady of Ealing -And her lover before her was kneeling. - Said she, "Dearest Jim, - Take your hands off my quim; -I much prefer fucking to feeling." -% -There was a young lady of fashion -Who had oodles and oodles of passion. - To her lover she said, - As they climbed into bed, -"Here's one thing the bastards can't ration!" -% -There was a young lady of Fez -Who was known to the public as "Jez." - Jezebel was her name, - Sucking cocks was the game -She excelled at (so everyone says). -% -There was a young lady of Gaza -Who shaved her cunt bare with a razor. - The crabs, in a lump, - Made tracks to her rump-- -This passing parade did amaze her. -% -There was a young lady of Gloucester, -Met a passionate fellow who tossed her. - She wasn't much hurt, - But he dirtied her skirt, -So think of the anguish it cost her. -% -There was a young lady of Gloucester -Whose friends they thought they had lost her - Till they found on the grass - The marks of her arse, -And the knees of the man who had crossed her. -% -There was a young lady of Kent, -Who admitted she knew what it meant - When men asked her to dine, - And plied her with wine, -She knew, oh she knew -- but she went! -% -There was a young lady of Lee -Who scrambled up into a tree, - When she got there - Her arsehole was bare, -And so was her C U N T. -% -There was a young lady of Lincoln -Who said that her cunt was a pink'un, - So she had a prick lent her - Which turned it magenta, -This artful old lady of Lincoln. -% -There was a young lady of Natchez -Who chanced to be born with two snatches, - And she often said, "Shit! - Why, I'd give either tit -For a man with equipment that matches." - -There was a young fellow named Locke -Who was born with a two-headed cock. - When he'd fondle the thing - It would rise up and sing -An antiphonal chorus by Bach. - -But whether these two ever met -Has not been recorded as yet, - Still, it would be diverting - To see him inserting -His whang while it sang a duet. -% -There was a young lady of Norway -Who hung by her toes in a doorway. - She said to her beau - "Just look at me Joe -I think I've discovered one more way." -% -There was a young lady of Rhyll -In an omnibus was taken ill, - So she called the conductor, - Who got in and fucked her, -Which did more good than a pill. -% -There was a young lady of Spain -Who took down her pants on a train. - There was a young porter - Saw more than he orter, -And asked her to do it again. -% -There was a young lady of Spain -Who was fucked by a monk in a drain. - They did it again - And again and again, -And again and again and again. -% -There was a young lady of Twickenham -Who thought men had not enough prick in 'em. - On her knees every day - To God she would pray -To lengthen and strengthen and thicken 'em. -% -There was a young lady of Wheeling -Said to her beau, "I've a feeling - My little brown jug - Has need of a plug" -- -And straightaway she started to peeling. -% -There was a young lady who said, -As her bridegroom got into the bed, - "I'm tired of this stunt, - That they do with one's cunt, -You can get up my bottom instead." -% -There was a young lady whose cunt -Could accommodate a small punt. - Her mother said, "Annie, - It matches your fanny, -Which never was that of a runt." -% -There was a young lady whose thighs, -When spread showed a slit of such size, - And so deep and so wide, - You could play cards inside, -Much to her bridegroom's surprise. -% -There was a young lass from Surat. -The cheeks of her ass were so fat - That they had to be parted - Whenever she farted, -And also whenever she shat. -% -There was a young laundress named Wrangle -Whose tits tilted up at an angle. - "They may tickle my chin," - She said with a grin, -"But at least they keep out of the mangle." -% -There was a young maiden from Osset -Whose quim was nine inches across it. - Said a young man named Tong, - With tool nine inches long, -"I'll put bugger-in if I loss it." -% -There was a young man from Bear Ridge -Who had strange ideas about marriage. - He fucked his wife's mother - And sucked off her brother -And ate up her sister's miscarriage. -% -There was a young man from Bel-Aire -Who was screwing his girl on the stair. - But the banister broke - So he doubled his stroke -And finished her off in mid-air. -% -There was a young man from Biloxi -Whose bowels responded to Moxie. - Drinking glass after glass, - He would tune up his ass, -Till he played like the band at the Roxy. -% -There was a young man from Bombay -Who fashioned a cunt out of clay - But the heat of his prick - Turned it into a brick -And rubbed all his foreskin away. -% -There was a young man from Calcutta -Who was heard in his beard to mutter, - "If her Bartholin glands - Don't respond to my hands, -I'm afraid I shall have to use butter." -% -There was a young man from Dallas -Who had an exceptional phallus. - He couldn't find room - In any girl's womb -Without rubbing it first with Vitalis. -% -There was a young man from Dundee -Who buggered an ape in a tree. - The results were quite horrid: - All ass and no forehead, -Three balls and a purple goatee. -% -There was a young man from East Lizes -Whose balls were of two different sizes - One was so small - It was no ball at all -The other was large and won prizes. -% -There was a young man from East Wubley -Whose cock was bifurcated doubly. - Each quadruplicate shaft - Had two balls hanging aft, -And the general effect was quite lovely. - -There was a young man from Hong Kong -Who had a trifurcated prong: - A small one for sucking, - A large one for fucking, -And a `boney' for beating a gong. -% -There was a young man from Glengozzle -Who found a remarkable fossil. - He knew by the bend - And the wart on the end, -'Twas the peter of Paul the Apostle. -% -There was a young man from Jodhpur -Who found he could easily cure - His dread diabetes - By eating a foetus -Served up in a sauce of manure. -% -There was a young man from Kent -Whose tool was so long that it bent. - To save himself trouble - He put it in double -And instead of coming, he went. -% -There was a young man from Lynn -Whose cock was the size of a pin. - Said his girl with a laugh - As she felt his staff, -"This won't be much of a sin." -% -There was a young man from Maine -Whose prick was as strong as a crane; - It was almost as long, - So he strolled with his dong -Extended in sunshine and rain. -% -There was a young man from Nantucket -Whose cock was so long he could suck it. - But he looked in the glass, - And saw his own ass, -And broke his neck trying to fuck it. -% -There was a young man from Nantucket -Whose cock was so long he could suck it. - He said with a grin, - While wiping his chin, -"If my ear was a cunt, I could fuck it." -% -There was a young man from New Haven -Who had an affair with a raven. - He said with a grin - As he wiped off his chin, -"Nevermore!" -% -There was a young man from Peru, -Who took a long trip by canoe. - While staring at Venus, - And rubbing his penis, -He wound up with a handful of goo. -% -There was a young man from Purdue -Who was only just learning to screw, - But he hadn't the knack, - And he got too far back -- -In the right church, but in the wrong pew. -% -There was a young man from Racine -Who invented a fucking machine. - Concave or convex, - It served either sex, -But oh what a bitch to keep clean. -% -There was a young man from Rangoon -Who used to lament 'neath the moon - That he had the luck - To be born of a fuck -That was scraped off the sheets with a spoon. -% -There was a young man from Salinas -Who had an extremely long penis: - Believe it or not, - When he lay on his cot -It reached from Marin to Martinez. -% -There was a young man from Seattle -Whose testicles tended to rattle. - He said as he fuck-ed - Some stones in a bucket, -"If Stravinsky won't deafen you -- that'll." -% -There was a young man from Siam -Who said, "I go in with a wham, - But I soon lose my starch - Like the mad month of March, -And the lion comes out like a lamb." -% -There was a young man from St. Paul's -Who read "Harper's Bazaar" and "McCall's" - Till he grew such a passion - For feminine fashion -That he knitted a snood for his balls. -% -There was a young man from Stamboul -Who boasted so torrid a tool - That each female crater - Explored by this satyr -Seemed almost unpleasantly cool. -% -There was a young man from the Coast -Who had an affair with a ghost. - At the height of orgasm - Said the pallid phantasm, -"I think I can feel it -- almost!" -% -There was a young man from Tibet- -And this is the strangest one yet- - Whose tool was so long, - So pointed and strong, -He could bugger six Greeks "en brochette". -% -There was a young man in Havana, -Banged his girl on a player-piana. - At the height of their fever - Her ass hit the lever -And: yes, he has no banana. -% -There was a young man in Norway, -Tried to jerk himself off in a sleigh, - But the air was so frigid - It froze his cock rigid, -And all he could come was frappe. -% -There was a young man in the choir -Whose penis rose higher and higher, - Till it reached such a height - It was quite out of sight -- -But of course you know I'm a liar. -% -There was a young man, name of Fred, -Who spent every Thursday in bed; - He lay with his feet - Outside of the sheet, -And the pillows on top of his head. - -- Edward Gorey -% -There was a young man, name of Saul, -Who was able to bounce either ball, - He could stretch them and snap them, - And juggle and clap them, -Which earned him the plaudits of all. -% -There was a young man named Crockett -Whose balls got caught in a socket. - His wife was a bitch - So she threw the switch, -And Crockett went off like a rocket. -% -There was a young man named Hughes -Who swore off all kinds of booze. - He said, "When I'm muddled - My senses get fuddled, -And I pass up too many screws." -% -There was a young man named Knute -Who had warts all over his root. - He put acid on these - And now when he pees, -He fingers the thing like a flute. -% -There was a young man named Rex -Who really was small for his sex. - When tried for exposure - The judge's disclosure -Was "de minimus non curat lex." -% -There was a young man named Zerubbabel -Who had only one real, and one rubber ball. - When they asked if his pleasure - Was only half measure, -He replied, "That is highly improbable." -% -There was a young man named Zerubbabub -Who belonged to the Block, Fuck & Bugger Club - But the pride of his life - Were the tits of his wife -- -One real, and one India-rubber bub. -% -There was a young man of Arras -Who stretched himself out on the grass, - And with no little trouble, - He bent himself double, -And stuck his prick well up his ass. -% -There was a young man of Australia -Who went on a wild bacchanalia. - He buggered a frog, - Two mice and a dog, -And a bishop in fullest regalia. -% -There was a young man of Belgrade -Who remarked, "I'm a queer piece of trade. - I will suck, without charge, - Any cock, if it's large. -If it's small, I expect to be paid." -% -There was a young man of Belgrade -Who slept with a girl in the trade. - She said to him, "Jack, - Try the hole in the back; -The front one is badly decayed." -% -There was a young man of Bengal -Who swore he had only one ball, - But two little bitches - Unbuttoned his britches, -And found he had no balls at all. -% -There was a young man of Bombay -Who buggered his dad once a day. - He said, "I like, rather, - Fucking my father -- -He's clean, and there's nothing to pay." -% -There was a young man of Calcutta, -Who tried to write "cunt" on a shutter. - When he got to c-u, - A pious Hindoo -Knocked him ass-over-head in the gutter. -% -There was a young man of Cape Horn -Who wished he had never been born, - And he wouldn't have been - If his father had seen -That the end of the rubber was torn. -% -There was a young man of Coblenz -Whose ballocks were simply immense: - It took forty-four draymen, - A priest and three laymen -To carry them thither and thence. -% -There was a young man of Darjeeling -Whose cock reached up to the ceiling. - In the electric light socket, - He'd put it and rock it-- -Oh God! What a wonderful feeling! -% -There was a young man of Devizes, -Whose balls were of different sizes. - One was so small, - It was nothing at all; -The other took numerous prizes. -% -There was a young man of Dumfries -Who said to his girl, "If you please, - It would give me great bliss - If, while playing with this, -You would pay some attention to these!" -% -There was a young man of high station -Who was found by a pious relation - Making love in a ditch - To -- I won't say a bitch -- -But a woman of no reputation. -% -There was a young man of Khartoum, -The strength of whose balls was his doom. - So strong was his shootin', - The third law of Newton -Propelled the poor chap to the Moon. -% -There was a young man of Khartoum -Who lured a poor girl to her doom. - He not only fucked her, - But buggered and sucked her-- -And left her to pay for the room. -% -There was a young man of Kutki -Who could blink himself off with one eye. - For a while though, he pined, - When his organ declined -To function, because of a stye. -% -There was a young man of Lahore -Whose prick was one inch and no more. - It was all right for key-holes - And little girl's pee-holes, -But not worth a damn with a whore. -% -There was a young man of Lake Placid -Whose prick was lethargic and flaccid. - When he wanted to sport - He would have to resort -To injections of sulphuric acid. -% -There was a young man of Madras -Whose balls were constructed of brass. - When jangled together - They played "Stormy Weather", -And lightning shot out of his ass. -% -There was a young man of Missouri -Who fucked with a terrible fury. - Till hauled into court - For his beastial sport, -And condemned by a poorly-hung jury. -% -There was a young man of Natal -And Sue was the name of his gal. - One day, north of Aden, - He got his hard rod in, -And came clear up Suez Canal. -% -There was a young man of Natal -Who was fucking a Hottentot gal. - Said she, "You're a sluggard!" - Said he, "You be buggered! -I like to fuck slow and I shall." -% -There was a young man of Ostend -Who let a girl play with his end. - She took hold of Rover, - And felt it all over, -And it did what she didn't intend. -% -There was a young man of Ostend -Whose wife caught him fucking her friend. - "It's no use, my duck, - Interrupting our fuck, -For I'm damned if I draw till I spend." -% -There was a young man of Saskatchewan, -Whose penis was truly gargantuan. - It was good for large whores, - And for small dinosaurs, -And was rough enough to scratch a match upon. -% -There was a young man of Seattle -Who bested a bull in a battle. - With fire and gumption - He assumed the bull's function, -And deflowered a whole herd of cattle. -% -There was a young man of St. John's -Who wanted to bugger the swans. - But the loyal hall porter - Said, "Pray take my daughter! -Those birds are reserved for the dons." -% -There was a young man of Tibet --- And this is the strangest one yet -- - His prick was so long, - And so pointed and strong, -He could bugger six sheep en brochette. -% -There was a young man of Toulouse -Who had a deficient prepuce, - But the foreskin he lacked - He made up in his sac; -The result was, his balls were too loose. -% -There was a young man who appeared -To his friends with a full growth of beard; - They at once said, "Although - We can't say why it's so, -The effect is uncommonly weird." - -- Edward Gorey -% -There was a young man who said "God, -I find it exceedingly odd, - That the willow oak tree - Continues to be, -When there's no one about in the Quad." - -"Dear Sir, your astonishment's odd, -For I'm always about in the Quad; - And that's why the tree, - Continues to be," -Signed "Yours faithfully, God." -% -There was a young man with a fiddle -Who asked of his girl, "Do you diddle?" - She replied, "Yes, I do, - But prefer to with two -- -It's twice as much fun in the middle." -% -There was a young man with a prick -Which into his wife he would stick - Every morning and night - If it stood up all right -- -Not a very remarkable trick. - -His wife had a nice little cunt: -It was hairy, and soft, and in front, - And with this she would fuck him, - Though sometimes she'd suck him -- -A charming, if commonplace, stunt. -% -There was a young man with one foot -Who had a very long root. - If he used this peg - As an extra leg -Is a question exceedingly moot. -% -There was a young miss from Johore -Who'd lie on a mat on the floor; - In a manner uncanny - She'd wobble her fanny, -And drain your nuts dry to the core. -% -There was a young monk from Siberia -Whose life got drearia' and drearia' - Till he did to a nun - What shouldn't be done -And made her a mother superia'. -% -There was a young monk from Tibet -And this is the damnedest one yet - His cock was so long - And incredibly strong -That he buggered six Greeks en brochette. -% -There was a young monk in Siberia, -Whose morals were very inferior, - He jumped on a nun - Which he shouldn't have done, -And now she's a Mother Superior. -% -There was a young monk of Dundee -Who complained that it hurt him to pee, - He said, "Pax vobiscum, - Now why won't the piss come? -I'm afraid I've the c-l-a-p." -% -There was a young parson of Harwich, -Tried to grind his betrothed in a carriage. - She said, "No, you young goose, - Just try self-abuse. -And the other we'll try after marriage." -% -There was a young peasant named Gorse -Who fell madly in love with his horse. - Said his wife, "You rapscallion, - That horse is a stallion -- -This constitutes grounds for divorce." -% -There was a young person of Kent -Who was famous wherever he went. - All the way through a fuck, - He would quack like a duck, -And he crowed like a cock when he spent. -% -There was a young physicist named Fisk -Whose lovemaking was rather brisk. - So quick was his action, - The Lorentz Contraction -Shortened his rod to a disc! -% -There was a young plumber named Lee -Who was plumbing his girl by the sea. - She said, "Stop your plumbing, - There's somebody coming" -Said the plumber, still plumbing, "It's me." -% -There was a young poet named Dan, -Whose poetry never would scan. - When told this was so, - He said, "Yes, I know, -It's because I try to put every possible syllable into that last line that I can." -% -There was a young royal marine, -Who tried to fart "God Save the Queen". - When he reached the soprano - Out came only guano -And his britches weren't fit to be seen. -% -There was a young sailor from Brighton, -Who remarked to his girl, "You're a tight one." - She replied, "'Pon my soul, - You're in the wrong hole; -There's plenty of room in the right one." -% -There was a young sapphic named Anna -Who stuffed her friend's cunt with banana, - Which she sucked, bit by bit, - From her partner's warm slit, -In the most approved lesbian manner. -% -There was a young Scot in Madrid -Who got fifty-five fucks for a quid. - When they said, "Are you faint?" - He replied, "No, I ain't, -But I don't feel as good as I did." -% -There was a young soldier from Munich -Whose penis hung down past his tunic, - And their chops girls would lick - When they thought of his prick, -But alas! he was only a eunuch. -% -There was a young sportsman named Peel -Who went for a trip on his wheel; - He pedaled for days - Through crepuscular haze, -And returned feeling somewhat unreal. - -- Edward Gorey -% -There was a young squaw of Wohunt -Who possessed a collapsible cunt. - It had many odd uses, - Produced no papooses, -And fitted both giant and runt. -% -There was a young student from Yale -Who was getting his first piece of tail. - He shoved in his pole, - But in the wrong hole, -And a voice from beneath yelled: "No sale!" -% -There was a young trollop at Yale, -Who had verses tattooed on her tail, - And on her behind, - For the sake of the blind, -A duplicate version in Braille. -% -There was a young woman called Pearl -Who quite resembled a churl; - When she asked a young man named Tex - Whether he would like to have sex, -"Certainly," quoth he, "Who's the girl?" -% -There was a young woman from Bude, -Who went for a swim in the nude, - But a man in a punt, - Grabbed at her elbow, -And said "Hey, lady, you can't swim here, it's private property." -% -There was a young woman in Dee -Who stayed with each man she did see. - When it came to a test - She wished to be best, -And practice makes perfect, you see. -% -There was a young woman named Alice -Who peed in a Catholic chalice. - She said, "I do this - From a great need to piss, -And not from sectarian malice." -% -There was a young woman named Ells -Who was subject to curious spells - When got up very oddly, - She'd cry out things ungodly -by the palms in expensive hotels. - -- Edward Gorey -% -There was a young woman named Florence -Who for fucking professed an abhorrence, - But they found her in bed - With her cunt flaming red, -And her poodle-dog spending in torrents. -% -There was a young woman named Plunnery -Who rejoiced in the practice of gunnery. - Till one day unobservant, - She blew up a servant, -And was forced to retire to a nunnery. - -- Edward Gorey -% -There was a young woman named Sutton -Who said, as she carved up the mutton, - "My father preferred - The last sheep in the herd -- -This is one of his children I'm cuttin'." -% -There was a young woman of Cheadle, -Who once gave the clap to a beadle. - Said she, "Does it itch?" - "It does, you damned bitch, -And it burns like hell-fire when I peedle." -% -There was a young woman of Condover -Whose husband had ceased to be fond of 'er. - Her pussy was juicy, - Her arse soft and goosey, -But peroxide had now made a blonde of 'er. -% -There was a young woman of Croft -Who played with herself in a loft, - Having reasoned that candles - Could never cause scandals, -Besides which they did not go soft. - -Said another young woman of Croft, -Amusing herself in the loft, - "A salami or wurst - Is what I'd choose first -- -With bologna you know you've been boffed." -% -There was a young woman, quite handsome, -Who got stuck in a sleeping room transom. - When she offered much gold - For release, she was told -That the view was worth more than the ransom. -% -There was a young woman whose stammer -Was atrocious, and so was her grammar; - But they were not improved - When her husband was moved -To knock out her teeth with a hammer. - -- Edward Gorey -% -There was an old abbess quite shocked -To find nuns where the candles were locked. - Said the abbess, "You nuns - Should behave more like guns, -And never go off till you're cocked." -% -There was an old bishop from Buckingham -Who fell in love with some oysters while shucking 'em. - His wife with distain - Could scarcely restrain -That sprightly old bishop from * * *. -% -There was an old count of Swoboda -Who would not pay a whore what he owed her. - So, with great savoir-faire, - She stood on a chair -And pissed in his whiskey-and-soda. -% -There was an old curate of Hestion -Who'd erect at the slightest suggestion. - But so small was his tool - He could scarce screw a spool, -And a cunt was quite out of the question. -% -There was an old fellow named Art -Who awoke with a horrible start, - For down by his rump - Was a generous lump -Of what should have been just a fart. -% -There was an old fellow named Skinner -Whose prick, his wife said, had grown thinner. - But still, by and large, - It would always discharge -Once he could just get it in her. -% -There was an old feminine blighter -Who trained a Chow dog to delight her. - She would cream her own pool - While she sucked off his tool -- -How his cock in her cunt would excite her! -% -There was an old gent from Kentuck -Who boasted a filigreed schmuck, - But he put it away - For fear that one day -He might put it in and get stuck. -% -There was an old girl of Kilkenny -Whose usual charge was a penny. - For half of that sum - You could finger her bum-- -A source of amusement to many. -% -There was an old harlot from Dijon -Who in her old age got religion. - "When I'm dead & gone," - Said she, "I'll take on -The Father, the Son, and the Pigeon." -% -There was an old lady of Bingly -Who wailed, "I do hate to sleep singly. - I thought I had got - A bloke for my twat, -But he seems rather queenly than kingly." -% -There was an old lady of Glascow, -Whose party proved quite a fiasco. - At nine-thirty, about, - The lights all went out, -Through a lapse on the part of the Gas Co. -% -There was an old lady of Kewry -Whose cunt was a `lusus naturae': - The `introitus vaginae', - Was unnaturally tiny, -And the thought of it filled her with fury. -% -There was an old lady who lay -With her legs wide apart in the hay, - Then, calling the ploughman, - She said, "Do it now, man! -Don't wait till your hair has turned gray." -% -There was an old maid from Cape Cod -Who thought all good things came from god. - But it wasn't the almighty - Who lifted her nighty, -It was Roger, the lodger, by god. -% -There was an old man from Bengal -Who liked to do tricks in the hall. - His favorite trick - Was to stand on his dick -While he rolled around on one ball. -% -There was an old man from Fort Drum -Whose son was incredibly dumb. - When he urged him ahead, - He went down instead, -For he thought to succeed meant succumb. -% -There was an old man of Alsace -Who played the trombone with his ass. - He put in a trap - To take out the crap, -But the vapors corroded the brass. -% -There was an old man of Brienz -The length of whose cock was immense: - With one swerve he could plug - A boy's bottom in Zug, -And a kitchen-maid's cunt in Coblenz. -% -There was an old man of Cajon -Who never could get a good bone. - With the aid of a gland - It grew simply grand; -Now his wife cannot leave it alone. -% -There was an old man of Calcutta -Who spied through a chink in the shutter. - But all he could see - Was his wife's bare knee, -And the back of the bloke who was up her. -% -There was an old man of Connaught -Whose prick was remarkably short. - When he got into bed, - The old woman said, -"This isn't a prick, it's a wart." -% -There was an old man of Duddee -Who came home as drunk as could be. - He wound up the clock - With the end of his cock, -And buggered his wife with the key. -% -There was an old man of Duluth -Whose cock was shot off in his youth. - He fucked with his nose - And with fingers and toes, -And he came through a hole in his tooth. -% -There was an old man of Hong Kong -Who never did anything wrong. - He would lie on his back - With his head in a sack -And secretly finger his dong. -% -There was an old man of St. Bees, -Who was stung in the arm by a wasp. - When asked, "Does it hurt?" - He replied, "No, it doesn't. -I'm so glad that it wasn't a hornet." - -- W. S. Gilbert -% -There was an old man of Tagore -Whose tool was a yard long or more, - So he wore the damn thing - In a surgical sling -To keep it from wiping the floor. -% -There was an Old Man of the Mountain -Who frigged himself into a fountain - Fifteen times had he spent, - Still he wasn't content, -He simply got tired of the counting. -% -There was an old man who said, "Tush! -My balls always hang in the brush, - And I fumble about, - Half in and half out, -With a pecker as limber as mush." -% -There was an old man with a beard -Who said, "It is just what I feared! - Two owls and a hen, - Four larks and a wren -Have all built their nests in my beard!" -% -There was an old person of Ware -Who had an affair with a bear. - He explained, "I don't mind, - For it's gentle and kind, -But I wish it had slightly less hair." -% -There was an old pirate named Bates -Who was learning to rhumba on skates - He fell on his cutlass - Which rendered him nutless -And practically useless on dates. -% -There was an old satyr named Mack -Whose prick had a left handed tack. - If the ladies he loves - Don't spin when he shoves, -Their cervixes frequently crack. -% -There was an old Scot named McTavish -Who attempted an anthropoid ravish. - The object of rape - Was the wrong sex of ape, -And the anthropoid ravished McTavish. -% -There was an old whore from Silesia -Who'd croak: "If my box doesn't please ya, - For a slight extra sum - You can go up my bum -But watchout or my tapeworm'll seize ya." -% -There was an old whore in the Azores -Whose body was covered with festers & sores. - Why the dogs in the street - Wouldn't eat the green meat -That hung in festoons from her drawers. -% -There was an old woman of Ghent -Who swore that her cunt had no scent. - She got fucked so often - At last she got rotten, -And didn't she stink when she spent. -% -There was once a mechanic named Bench -Whose best tool was a sturdy gut-wrench. - With this vibrant device - He could reach, in a trice, -The innermost parts of a wench. -% -There were three ladies of Huxham, -And whenever we meets 'em we fucks 'em, - And when that game grows stale - We sits on a rail, -And pulls out our pricks and they sucks 'em. -% -There were three young ladies of Birmingham, -And this is the scandal concerning 'em. - They lifted the frock - And tickled the cock -Of the Bishop engaged in confirming 'em. - -Now, the Bishop was nobody's fool, -He'd been to a good public school, - So he took down their britches - And buggered those bitches -With his ten-inch episcopal tool. - -Then up spoke a lady from Kew, -And said, as the Bishop withdrew, - "The vicar is quicker - And thicker and slicker, -And longer and stronger than you." - -- Abuses of the Clergy -% -There's a charming young girl in Tobruk -Who refers to her quiff as a nook. - It's deep and it's wide, - -- You can curl up inside -With a nice easy chair and a book. -% -There's a charming young lady named Beaulieu -Who's often been screwed by yours truly, - But now--it's appallin'-- - My balls always fall in! -I fear that I've fucked her unduly. -% -There's a dowager near Sweden Landing -Whose manners are odd and demanding. - It's one of her jests - To suck off her guests -- -She hates to keep gentlemen standing. -% -There's a lovely young lady named Shittlecock -Who loves to play diddle and fiddle-cock, - But her cunt's got a pucker - That's best not to fuck, or -When least you expect it to, it'll lock. -% -There's a rather odd couple in Herts -Who are cousins (or so each asserts); - Their sex is in doubt - For they're never without -Their moustaches and long, trailing skirts. - -- Edward Gorey -% -There's a sports-minded coed named Sue, -Who's been coxing the varsity crew. - In the shell Sue is great, - But her boyfriend's irate, -When she calls out the stroke as they screw. -% -There's a tavern in London that's staffed, -By a barmaid who's tops at her craft: - In her striving to please, - She serves ale on her knees, -So the patrons get head with their draft. -% -There's a very hot babe at the Aggies -Who's to men what to bulls a red rag is. - The seniors go round - Hanging down to the ground, -And one extra-large Soph has to drag his. -% -There's a vicar who's classed as nefarious, -Since his shocking perversions are various... - He will bugger some lad - With a dildo (the cad!) -While exulting, "My pleasure's vicarious!" -% -There's a young Yiddish slut with two cunts, -Whose pleasure in life is to pruntz. - When one pireg is shot, - There's that alternate twat, -But the ausgefuckt male merely grunts. -% -There's an oversexed lady named Whyte -Who insists on a dozen a night. - A fellow named Cheddar - Had the brashness to wed her- -His chance of survival is slight. -% -There's an unbroken babe from Toronto, -Exceedingly hard to get onto, - But when you get there, - And have parted the hair, -You can fuck her as much as you want to. -% -They had come in the fugue to the stretto -When a dark, bearded man from a ghetto - Slipped forward and grabbed - Her tresses and stabbed -Her to death with a rusty stiletto. - -- Edward Gorey -% -Though his plan, when he gave her a buzz, -Was to do what man normally does, - She declared, "I'm a Soul- - Not a sexual goal!" -So he shrugged and called someone who was. -% -Though most of the crewmen are whites, -Uhura has full equal rights. - Her crewmates, you see, - Love De-mo-cra-cy, -And the way that she fills out her tights. -% -Though the invalid Saint of Brac -Lay all of his life on his back, - His wife got her share, - And the pilgrims now stare -At the scene, in his shrine, on a plaque. -% -'Tis a custom in Castellamare -To fuck in the back of a lorry. - The chassis and springs - Are like woodwinds and strings -In the midst of a musical soiree. -% -To a weepy young woman in Thrums -Her betrothed remarked, "This is what comes - Of allowing your tears - To fall into my ears - -I think they have rotted the drums." - -- Edward Gorey -% -To bear offspring, Noah's snakes were unable. -Their fertility was somewhat unstable. - He constructed a bed - Out of tree trunks and said, -"Even adders can multiply on a log table." -% -To his bride a young bridegroom said, "Pish! -Your cunt is as big as a dish!" - She replied, "Why, you fool, - With your limp little tool -It's like driving a nail with a fish!" -% -To his bride said a numskull named Clarence: -"I trust you will show some forbearance. - My sexual habits - I picked up from rabbits, -And occasionally watching my parents." -% -To his bride said economist Fife: -"The semen you'll launch as my wife, - We will salvage and freeze - To resemble goat's cheese, -And slice for hors d'oeuvres with a knife." -% -To his bride, said the sharp eyed detective, -"Can it be that my eyesight's defective? - Is your east tit the least bit - The best of your west tit, -Or is it a trick of perspective?" -% -To his clubfooted child said Lord Stipple, -As he poured his post-prandial tipple, - "Your mother's behaviour - Gave pain to Our Saviour, -And that's why He made you a cripple." - -- Edward Gorey -% -Two anglers were fishing off Wight -And his bobber was dipping all night. - Murmured she, with a laugh, - "It's ready to gaff, -But don't break your rod which is light." - -A couple was fishing near Clombe -When the maid began looking quite glum, - And said, "Bother the fish! - I'd rather coish!" -Which they did -- which was why they had come. - -As two consular clerks in Madras -Fished, hidden in deep shore-grass, - "What a marvelous pole," - Said she, "but control -Your sinkers -- they're banging my ass." -% -Two eager young men from Cawnpore -Once buggered and fucked the same whore. - But her partition split - And the blood and the shit -Rolled out in a mess on the floor. -% -Two roosters in one of our pens -Found their pricks were no larger than wens. - As they looked at their foreskins - And wished they had more skins, -They discovered they'd both become hens. -% -Under the spreading chestnut tree -The village smith he sat, - Amusing himself - By abusing himself -And catching the load in his hat. -% -Une joile epousetta a Tours -Voulait de gig-gig tous le jours. - Mais le mari disait, "Non! - De trop n'est pas bon! -Mon derriere exige du secours!" -% -Visas erat: huic geminarum -Dispar modus testicularum: - Minor haec nihili, - Palma triplici, -Jam fecerat altera clarum. -% -We dedicate this to the cunt, -The kind the broad-minded guys hunt: - All hail to the twat, - Willing, thrilling, and hot, -That wears peckers down, limp and blunt! -% -When I was a baby, my penis -Was as white as the buttocks of Venus. - But now 'tis as red - As her nipples instead-- -All because of the feminine genus! -% -When they asked a pert baggage name Alice, -Who'd been bedded and banged in the palace, - "Was he modest or vain?" - "Was he regal or plain?" -She replied, "He's a jolly good phallus!" -% -When you fuck little Annie in Anza -You get a great bosom bonanza: - Sucking Annie's soft tits - Makes her throw fifty fits, -And the fuck is a sextravaganza! -% -While his duchess lay practically dead, -The Duke of Daguerrodargue said: - "Can it be this is all? - How puny! How small! -Have destroyed this disgrace to my bed." - -- Edward Gorey -% -While I, with my usual enthusiasm, -Was exploring in Ermintrude's busiasm, - She explained, "They are flat, - But think nothing of that -- -You will find that my sweet sister Susiasm." -% -While out on a date in his Fiat, -The man exclaimed "Where's my key at?" - As he bent down to seek, - She let out a shriek: -"That's not where it's likely to be at." -% -While spending the winter at Pau -Lady Pamela forgot to say "No." - So the head-porter made her - And the second-cook laid her; -The waiters were all hanging low. -% -While Titian was mixing rose madder, -His model reclined on a ladder. - Her position to Titian - Suggested coition, -So he leapt up the ladder and had 'er. -% -While traveling in farthest Tibet, -Lord Irongate found cause to regret - The buttered-up tea, - A pain in his knee, -And the frivolous tourists he met. - -- Edward Gorey -% -Winter is here with his grouch, -The time when you sneeze and you slouch. - You can't take your women - Canoein' or swimmin', -But a lot can be done on a couch. -% -With his penis in turgid erection, -And aimed at woman's mid-section, - Man looks most uncouth - In that Moment of Truth, -But she sheathes it with loving affection. -% -You Women's Lib gals won't agree, -But dependent on men you must be: - You'll need a him - With a rod firm and trim, -To puggle your water-drains free! -% -Young Frederick the great was a beaut. -To a guard he cried, "Hey, man, you're cute. - If you'll come to my palace, - I'll finger your phallus, -And then I shall blow on your flute." -% -You've heard of the bishop of Birmingham, -Well, here's the new story concerning 'im: - He buggers the choir - As they sing "Ave Maria," -And fucks all the girls whilst confirming 'em. -% diff --git a/usr.bin/fortune/datfiles/limerick.sp.ok b/usr.bin/fortune/datfiles/limerick.sp.ok deleted file mode 100644 index be7135d57027..000000000000 --- a/usr.bin/fortune/datfiles/limerick.sp.ok +++ /dev/null @@ -1,462 +0,0 @@ -# $FreeBSD$ -abbess's -Abercrombie -Aberystwyth -acrost -Aden -Ades -Alsace -altera -Amphigorey -anatomies -andantes -Annie's -Annista -Antigua -Anza -Apres -archeologist -Arden -ARPAnaut -arsehole -astonishment's -Asturias -Attila -ausgefuckt -Azores -backsides -ballocks -Baroda -Bartholin -Batonger -Baugh -Bavel -beabrve -Beaconsfield -beastial -Beaulieu -Beever -belican -Benares -Bergere -Bermuder -berserkly -bettera -Bicester -Bingly -Bloch -Blott -Blount -Bluth -boffed -bologna -Bonaire -boney -Breerley -bridegroom's -Brienz -Brighton -Brillo -brio -Bronix -Bruckner -Bruges -Buckingham -Bude -bull's -busiasm -bustles -Byrd -Cah'lina -Cajon -callgirl -Camyre -cannie -Carmia -Carranza's -Carruthers -Castellamare -Cawnpore -cervixes -chanties -Charteris -Cheadle -Cheddar -Chichester -Chichester's -circumsized -Ciss -clarum -clergyman's -Clews -Clombe -Coblenz -cocksucking -coish -Condover -coxing -Coxsaxie -creame -Crewe -crewmates -Cribbs -crusader's -curat -d'hotel -d'Isere -d'oeuvres -Daguerrodargue -Decatur -deflowered -deflowers -Detroit -detumesced -Devizes -Dieu -dillie -disait -Dispar -dooflicker -doric -Drambuie -draymen -dribblings -Drumrig -duck's -Duddee -Dumfries -Dundee -Dunoon -duply -Durand -Durcan -Ealing -eastertide -edaM -eighths -ekil -elihW -Ells -epousetta -erat -Ermintrude's -Eroticon -ESC -Esser -Eton -exige -eyesight's -Fabia -faggot -faire -fanny -fart -farta -farted -farter -farting -farts -fecerat -Feeney -fellatrix -fellatrix's -Fenner -Fennis -festooned -festoons -fidgital -fiesty -Fleager -floozie -Folies -foreskins -Forgeteth -Fornier -frigged -frigger -frigging -fritz -fuckener -fucking'em -Fuckoscope -fuckstress -fuddled -Fyfe -Gamahuchee -Gasted -gaucho -gawked -Gaza -geminarum -Glengozzle -gnihtemos -gniyl -Gomorrah -goosey -gooster -Gorey -Gratian -Gression -guerre -Hank's -Harper's -Harwich -helican -Herridge -Herts -Hestion -hetera -Heuser -hexahedronical -hexed -hsinif -huic -Huxham -Hyde -hymen's -Ickes -Ignatious -iguanas -IIE -Illiac -intacto -interflex -Irongate -itchez -jello -Jodhpur -Johore -joile -Kew -Kewry -Khartoum -Kiam -Kilkenny -Kimble -Kissen -Kornbluth -Kotex -Kroll -Kutki -lacklustre -Lahore -Lancelot -laundress -Leeds -Lefebrve -Lesbian's -lifesavers -lilly -Lizes -llamas -Llanfairpwllgwyngyll -LLewellyn -Longet -looky -Lorentz -lovemaking -Lowe -LSD -Luntz -lusus -Mable -MacDougall -Magnifique -Mais -Maitre -Mam'selle -Manchukuo -Mandel -Manhasset -mari -Maurier -maxi -Mayence -McAmeter -McFee -Mcgoffin -McGru -McGruder -McMeanus -McSweeny -McTavish -meanie -meanies -meany -Mensa -mentis -midgets -minimis -missin -misspent -Moebius -moi -moister -mole's -Mons -Moxie -muckener -n'est -Natches -naturae -navel's -Nemetia -nighty -nihili -niners -Noah's -Norte -nuki -nutless -O'Clare -O'Doole -O'Malley -obbligatos -octagenerian -organed -orter -Ostend -oversexed -Paloma -papooses -paree -Parridge -patchez -pecker's -peckers -peedle -peeholes -peenies -pees -Penzance -pink'un -pissin -Pitlochry -Pitts -plaudits -pleasure's -ploughman -Plunnery -port's -Pourtant -Priam -Pridgets -prodigical -pruntz -Pryne -Prynne -Quaffed -Quelle -question's -quibblings -quim -quimmy -quints -ravished -Reims -Resounded -retriebrve -Rhyll -rogered -Salinas -Sandem -savoir -Schmitz -scratchez -seatbelts -secours -secret's -sextravaganza -Shedd -shins -Shittlecock -shitty -shootin -shrewder -Siegel -siht -skating's -Slatey -Smokey -sneaux -sniffin -sophomore'd -spaceman -spikey -Spitzbergen -Sprotic -Spyder -Stamboul -Stillson -Streator -Strensall -strewed -stroda -Suki -Susiasm -Sweenies -Swoboda -T'was -Tagore -Tante -tapeworm'll -Terminus's -testicularum -thing's -Thrace -Thrums -Tiffan -tis -titted -titties -Tobruk -tooty -topsheet -tous -Trans -Trasket -trifurcated -triplici -trop -truckloads -trysts -Tunney -Tupper -Tupps -Twickenham -Twiss -Twould -Udgeon -Uhura -urgin's -Usenetter -vaginae -vaginoid -Vassar -Venerio -Ventry -verkeley -Vesuvial -Virginny -virgo -Vitalis -vobiscum -Vogel's -Voulait -wanna -Weaveth -weeney -Whatam -Whyte -Wimley -Wohunt -Wubley -Wylde -ylbatrofmoc -yontiff -Yoric -Yost -yourselfer -Zerubbabel -Zerubbabub -Zug diff --git a/usr.bin/fortune/datfiles/murphy b/usr.bin/fortune/datfiles/murphy deleted file mode 100644 index 949d944ac49b..000000000000 --- a/usr.bin/fortune/datfiles/murphy +++ /dev/null @@ -1,2212 +0,0 @@ -%%$FreeBSD$ -% -(1) Anyone can make a decision given enough facts. -(2) A good manager can make a decision without enough - facts. -(3) A perfect manager can operate in perfect ignorance. -% -(1) Everything depends. -(2) Nothing is always. -(3) Everything is sometimes. -% -(1) Everything is a system. -(2) Everything is part of a larger system. -(3) The universe is infinitely systematized both upward - (larger systems) and downward (smaller systems). -(4) All systems are infinitely complex. (The illusion - of simplicity comes from focusing attention on - one or a few variables). -% -(1) If it's green or it wiggles, it's biology. -(2) If it stinks, it's chemistry. -(3) If it doesn't work, it's physics. -% -(1) If the weather is extremely bad, church - attendance will be down. -(2) If the weather is extremely good, church - attendance will be down. -(3) If the bulletin covers are in short supply - church attendance will exceed all expectations. -% -(1) If you like it, they don't have it in your size. -(2) If you like it and it's in your size, it doesn't - fit anyway. -(4) If you like it and it fits, you can't afford it. -(5) If you like it, it fits and you can afford it, it - falls apart the first time you wear it. -% -(1) Never draw what you can copy. -(2) Never copy what you can trace. -(3) Never trace what you can cut out and paste down. -% -(1) The telephone will ring when you are outside the - door, fumbling for your keys. - -(2) You will reach it just in time to hear the click - of the caller hanging up. -% -1) Things will get worse before they get better. -2) Who said things would get better? -% -80% of the final exam will be based on the one lecture -you missed about the one book you didn't read. -% -90% of everything is crud. -% -A $300.00 picture tube will protect a 10c fuse by blowing -first. -% -A 60-day warranty guarantees that the product will -self-destruct on the 61st day. -% -A bird in hand is safer than one overhead. -% -A bird in the hand is dead. -% -A budget is a plan that falls apart when the plumber -has to make an emergency visit. -% -A budget is buying a dress two sizes too small because -it was marked down. -% -A budget is saving quarters in a mason jar for -Christmas and spending them by Easter. -% -A budget is spending $15.00 on gas to drive to a -shopping mall to save $4.30 on a 20 pound turkey. -% -A budget is trying to figure out how the family next -door is doing it. -% -A budget is trying to make $25.00 go as far today as -it did when you were first married. -% -A budget is wondering why you should balance yours -if the government can not balance theirs. -% -A car and a truck approaching each other on an otherwise -deserted road will meet at the narrow bridge. -% -A carelessly planned project will take three times -longer than expected; a carefully planned project will -take only twice as long. -% -A child will not spill on a dirty floor. -% -A closed mouth gathers no foot. -% -A complex system designed from scratch never works and -cannot be patched up to make it work. You have to start -over, beginning with a working simple system. -% -A complex system that works is invariably found to have -evolved from a simple system that works. -% -A conclusion is the place where you got tired of thinking. -% -A consultant is an ordinary person a long way from home. -% -A coup that is known in advance is a coup that does not -take place. -% -A crisis is when you can't say "let's forget the -whole thing". -% -A day without sunshine .... -is like ... night! -% -A disagreeable task is its own reward. -% -A drug is that substance which, when injected into a -rat, will produce a scientific report. -% -A fail-safe circuit will destroy others. - -- Klipstein -% -A fool and his money are invited places. -% -A fool and his money soon go partying. -% -A fool and your money are soon partners. -% -A free agent is anything but. -% -A hug is the perfect gift - one size fits all, and -nobody minds if you exchange it. -% -A large system, produced by expanding the dimensions of -a smaller system, does not behave like the smaller system. -% -A little ambiguity never hurt anyone. -% -A little humility is arrogance. -% -A little ignorance can go a long way. -% -A lot of what appears to be progress is just so much -technological roccoco. -% -A man of quality does not fear a woman seeking equality. -% -A man should be greater than some of his parts. -% -A mediocre player will sink to the level of his or -her opposition. -% -A meeting is an event at which the minutes are kept -and the hours are lost. -% -A pat on the back is only a few inches from a kick -in the pants. -% -A penny saved is ... not much. -% -A pessimist is an optimist with experience. -% -A physician's ability is inversely proportional -to his availability. -% -A prerequisite for a desired course will be offered -only during the semester following the desired course. -% -A president of a democracy is a man who is always ready, -willing, and able to lay down your life for his country. -% -A RACF protected dataset is inaccessible. -% -A short cut is the longest distance between two points. -% -A shy, introverted child will choose a crowded public -area to loudly demonstrate newly acquired vocabulary. -% -A stagnant science is at a standstill. -% -A theory is better than its explanation. -% -A work project expands to fill the space available. -% -Absolutely nothing in the world is friendlier than -a wet dog. -% -Access holes will be 1/2" too small. -Holes that are the right size will be in the wrong place. -% -ACF2 is a four letter word. -% -Adding manpower to a late software product makes it later. -% -After all is said and done, a hell of a lot more is said -than done -% -After things have gone from bad to worse, the cycle -will repeat itself. -% -After winning an argument with his wife, -the wisest thing a man can do is apologize. -% -All American cars are basically Chevrolets. -% -All breakdowns occur on the plumber's day off. -% -All general statements are false. (Think about it.) -% -All good things must come to an end. -I want to know when they start! -% -All things being equal, all things are never equal. -% -All things being equal, you lose. - -All things being in your favor, you still lose. - -Win or lose, you lose. -% -All things come to him whose name is on a mailing list. -% -All trails have more uphill sections than they have -level or downhill sections. -% -All warranties expire upon payment of invoice. -% -Almost anything is easier to get into than out of. -% -Among economists, the real world is often a special case. -% -An alcoholic is a person who drinks more than his -own physician. -% -An auditor enters the battlefield after the war is over, -and attacks the wounded. -% -An easily-understood, workable falsehood is more useful -than a complex, incomprehensible truth. -% -An expert doesn't know any more than you do. He or she is -merely better organized and uses slides. -% -An expert is anyone from out of town. -% -An expert is one who knows more and more about less -and less until he knows absolutely everything -about nothing. -% -An optimist believes we live in the best of all -possible worlds. -A pessimist fears this is true. -% -An optimist is a person who looks forward to marriage. -A pessimist is a married optimist! -% -An original idea can never emerge from committee -in its original form. -% -An ounce of application is worth a ton of abstraction. -% -An unbreakable toy is useful for breaking other toys. -% -Any child who chatters non-stop at home will adamantly -refuse to utter a word when requested to demonstrate -for an audience. -% -Any circuit design must contain at least one part which -is obsolete, two parts which are unobtainable and three -parts which at still under development. -% -Any cooking utensil placed in the dishwasher will be -needed immediately thereafter for something else. -% -Any given program costs more and takes longer. -% -Any given program, when running, is obsolete. -% -Any given program will expand to fill all available memory. -% -Any improbable event which would create maximum confusion -if it did occur, will occur. -% -Any line, however short, is still too long. -% -Any measuring utensil used for liquid ingredients will -be needed immediately thereafter for dry ingredients. -% -Any task worth doing was worth doing yesterday. -% -Any technical problem can be overcome given enough -time and money. - -You are never given enough time or money. -% -Any theory can be made to fit any facts by means of -approximate, additional assumptions. -% -Any time you wish to demonstrate something, the number of -faults is proportional to the number of viewers. -% -Any tool dropped while repairing a car will roll underneath -to the exact center. -% -Anybody can win - unless there happens to be a second entry. -% -Anyone who follows a crowd will -never be followed by a crowd. -% -Anything good in life either causes cancer in -laboratory mice or is taxed beyond reality. -% -Anything hit with a big enough hammer will fall apart. -% -Anything is possible, but nothing is easy. -% -Anything is possible if you don't know what you're -talking about. -% -Anything that can go wrong, will go wrong. -% -Anything you try to fix will take longer and cost more than -you thought. -% -As the economy gets better, everything else gets worse. -% -Assumption is the mother of all foul-ups. -% -Assumption is the mother of all screw-ups. -% -At any event, the people whose seats are furthest from -the aisle arrive last. -% -At any level of traffic, any delay is intolerable. -% -At the end of the semester you will recall having -enrolled in a course at the beginning of the semester --- and never attending. -% -Authorization for a project will be granted only when -none of the authorizers can be blamed if the project -fails but when all of the authorizers can claim credit -if it succeeds. -% -Automotive engine repairing law: -If you drop something, it will never reach the ground. -% -Bad law is more likely to be supplemented than repealed. -% -Bad news drives good news out of the media. -% -Bare feet magnetize sharp metal objects so they always -point upward from the floor -- especially in the dark. -% -Beauty is only skin deep, ugly goes clear to the bone. -% -Before ordering a test decide what you will do if it is, -(1) positive, or -(2) negative. -If both answers are the same, don't do the test. -% -Beware of the physician who is great at getting -out of trouble. -% -Blessed are those who go around in circles, -for they shall be known as wheels. -% -Blessed is he who expects no gratitude, -for he shall not be disappointed. -% -Blessed is he who has reached the point of no return and -knows it for he shall enjoy living. -% -Build a system that even a fool can use, -and only a fool will use it. -% -Calm down .... it is only ones and zeros. -% -Can't produces countercan't. -% -Capitalism can exist in one of only two states: -welfare or warfare. -% -Celibacy is not hereditary. -% -Class schedules are designed so that every student will -waste the maximum time between classes. -% -Cleanliness is next to impossible. -% -Clearly stated instructions will consistently produce -multiple interpretations. -% -"Close" only counts in horseshoes, hand grenades and -thermonuclear devices. -% -Common sense is not so common. -% -Complex problems have simple, easy-to-understand -wrong answers. -% -Complex systems tend to oppose their own proper function. -% -Complicated systems produce unexpected outcomes. -% -Consultants are mystical people who ask a company for -a number and then give it back to them. -% -Consumer assistance doesn't. -% -Cop-out number 1. -You should have seen it when I got it. -% -Cost of repair can be determined by multiplying the -cost of your new coat by 1.75, or by multiplying the -cost of a new washer by .75. -% -Create problems for which only you have the answer. -% -Definition of an elephant: -A mouse built to government specifications. -% -Democracy is that form of government where -everybody gets what the majority deserves. -% -Despite the sign that says "wet paint", -please don't. -% -Do not believe in miracles -- rely on them. -% -Do whatever your enemies don't want you to do. -% -Don't ask the barber if you need a haircut. -% -Don't bite the hand that has your pay check in it. -% -Don't fight with a bear in his own cage. -% -Don't force it, -get a bigger hammer. -% -Don't let your superiors know you're better than -they are. -% -Don't look back, something may be gaining on you. -% -Don't make your doctor your heir. -% -Don't mess with Mrs. Murphy! -% -Don't permit yourself to get between a dog and a lamppost. -% -Don't smoke in bed - the ashes on the floor might be your -own. -% -Don't stop to stomp on ants -when the elephants are stampeding. -% -During the time an item is on back-order, it will be -available cheaper and quicker from many other sources. -% -Each problem solved introduces a new unsolved problem. -% -Easy doesn't do it. -% -Eat a live toad the first thing in the morning and nothing -worse will happen to you the rest of the day. -% -Entropy has us outnumbered. -% -Envelopes and stamps which don't stick when you lick -them will stick to other things when you don't want -them to. -% -Even paranoids have enemies. -% -Even water tastes bad when taken on doctors orders. -% -Every great idea has a disadvantage equal to or -exceeding the greatness of the idea. -% -Everybody is ignorant, only on different subjects. -% -Everybody lies; but it doesn't matter, since -nobody listens. -% -Everybody wants a pain shot at the same time. -% -Everybody who didn't want a pain shot when you were -passing out pain shots wants one when you are passing -out sleeping pills. -% -Everybody's gotta be someplace. -% -Everyone breaks more than the seven-year-bad-luck allotment -to cover rotten luck throughout an entire lifetime. -% -Everyone gets away with something. -No one gets away with everything. -% -Everyone has a scheme for getting rich that will not work. -% -Everything east of the San Andreas fault will eventually -plunge into the Atlantic ocean. -% -Everything happens at the same time with nothing in between. -% -Everything is contagious. -% -Everything is revealed to he who turns over enough stones. -(Including the snakes that he did not want to find.) -% -Everything may be divided into as many parts as you please. -% -Everything put together sooner or later falls apart. -% -Everything takes longer than you expect. -% -Exciting plays occur only while you are watching the -scoreboard or out buying a hot dog. -% -Fact is solidified opinion. -% -Facts may weaken under extreme heat and pressure. -% -Far-away talent always seems better than home-developed -talent. -% -Flynn is dead -Tron is dead -long live the MCP. -% -Fools rush in -- and get the best seats. -% -For every action, there is an equal and opposite -criticism. -% -For every credibility gap there is a gullibility fill. -% -For every credibility gap there is a gullibility gap. -% -For every human problem, there is a neat, plain solution -- -and it is always wrong. -% -For every vision, there is an equal and opposite revision. -% -Forgive and remember. -% -Freud's 23rd law: ideas endure and prosper in inverse -proportion to their soundness and validity. -% -Friends come and go, but enemies accumulate. -% -Fuzzy project objectives are used to avoid the -embarrassment of estimating the corresponding costs. -% -Go where the money is. -% -He who dies with the most toys wins. -% -He who hesitates is not only lost, but several miles from -the next freeway exit. -% -He who laughs last -- probably didn't get the joke. -% -He who marries for money ... better be nice to his wife. -% -Hindsight is an exact science. -% -History doesn't repeat itself -- historians merely -repeat each other. -% -History proves nothing. -% -History repeats itself. -that's one of the things wrong with history. -% -Hockey is a game played by six good players and the -home team. -% -Hollerith got us into this hole mess! -% -Hot glass looks exactly the same as cold glass. -% -How did they measure hail before the golf ball was invented? -% -How do they know no two snowflakes are alike? -% -How long a minute is depends on which side of the -bathroom door you're on. -% -I can only please one person per day. -Today is not your day. -(Tomorrow isn't looking good either.) -% -I finally got it all together... -but I forgot where I put it. -% -I have not lost my mind, it is backed up on tape somewhere. -% -I have yet to see any problem, however complicated, which, -when you looked at it in the right way, did not become -still more complicated. - -- Poul Anderson -% -I know you believe you understand - what you think I said, - however, I am not sure you realize, - that what I think you heard - is not what I meant -% -I no longer get lost in the shuffle.... -I shuffle along with the lost. -% -I think ... therefore I am confused. -% -If a program is useful, it will be changed. -% -If a program is useless, it will be documented. -% -If a scientist uncovers a publishable fact, it will -become central to his theory. - -His theory, in turn, will become central to all -scientific truth. -% -If a series of events can go wrong, it will do so in -the worst possible sequence. -% -If a situation requires undivided attention, it will -occur simultaneously with a compelling distraction. -% -If a straight line fit is required, obtain only two -data points. -% -If a thing is done wrong often enough -it becomes right. -% -If an experiment works, you must be using the wrong -equipment. -% -If an idea can survive a bureaucratic review and be -implemented, it wasn't worth doing. -% -If an item is advertised as "under $50," you can bet -it's not $19.95. -% -If anything can go wrong, it will. -% -If anything can't go wrong it will. -% -If at first you don't succeed ... get new batteries. -% -If at first you don't succeed, transform your dataset. -% -If at first you don't succeed, try something else. -% -If at first you don't succeed, -blame it on your supervisor. -% -If daily class attendance is mandatory, a scheduled -exam will produce increased absenteeism. If attendance -is optional, a scheduled exam will produce persons you -have never seen before. -% -If everybody doesn't want it, nobody gets it. -% -If everything is coming your way, you're in the -wrong lane. -% -If everything seems to be going well, -you obviously don't know what the hell is going on. -% -If facts do not conform to the theory, -they must be disposed of. -% -If his IQ was any lower he'd be a plant. -% -If it can be borrowed and it can be broken, -you will borrow it and -you will break it. -% -If it happens, it must be possible. -% -If it jams --- force it. If it breaks, -it needed replacing anyway. -% -If it sits on your desk for 15 minutes, you've just -become the expert. -% -If it weren't for the opinion polls we'd never know -what people are undecided about. -% -If it would be cheaper to buy a new unit, the company -will insist upon repairing the old one. -% -If it would be cheaper to repair the old one, the -company will insist on the latest model. -% -If it's clean, it isn't laundry. -% -If it's good, they discontinue it. -% -If it's good they will stop making it. -% -If it's not in the computer, it doesn't exist. -% -If more than one person is responsible for a -miscalculation, no one will be at fault. -% -If Murphy's law can go wrong, it will. -% -If not controlled, work will flow to the competent -man until he submerges. -% -If on an actuarial basis there is a 50/50 chance that -something will go wrong, -It will actually go wrong nine times out of ten. -% -If one views his problem closely enough he will -recognize himself as part of the problem. -% -If only one price can be obtained for any quotation, -the price will be unreasonable. -% -If opportunity came disguised as temptation, -one knock would be enough. -% -If project content is allowed to change freely, the rate of -change will exceed the rate of progress. -% -If reproducibility may be a problem conduct the -test only once. -% -If several things that could have gone wrong have not -gone wrong, it would have been ultimately beneficial -for them to have gone wrong. -% -If the assumptions are wrong, -the conclusions aren't likely to be very good. -% -If the course you wanted most has room for 'n' students -you will be the 'n + 1' to apply. -% -If the faulty part is in stock, it didn't need replacing -in the first place. -% -If there are only two shows worth watching, they will -be on together. -% -If there isn't a law, there will be. -% -If there was any justice in this world, people would -occasionally be permitted to fly over pigeons. -% -If things were left to chance, they'd be better. -% -If two wrongs don't make a right, try three. - -- Dr. Laurence J. Peter -% -If we learn by our mistakes, -I'm getting one hell of an education!! -% -If you allow someone to get in front of you either: -(1) The car in front will be the last one over a - railroad crossing, and you will be stuck waiting - for a long, slow-moving train; or -(2) you both will have the same destination and the - other car will get the last parking space. -% -If you are already in a hole, there's no use to continue -digging. -% -If you are given an open-book exam, you will forget -your book. -If you are given a take-home exam, you will forget -where you live. -% -If you buy bananas or avocados before they are ripe, -there won't be any left by the time they are ripe. If -you buy them ripe, they rot before they are eaten. -% -If you can get the faulty part off, the parts house -will have it back-ordered. -% -If you can get to the faulty part, you don't have the -tool to get it off. -% -If you can keep your head when all about you are losing -theirs, then you just don't understand the problem. -% -If you can't convince them, confuse them. -% -If you can't measure it, I'm not interested. -% -If you can't measure output then you measure input. -% -If you change lines, the one you just left will start -to move faster than the one you are now in. -% -If you do something right once, someone will ask -you to do it again. -% -If you don't care where you are, you ain't lost. -% -If you don't like the answer, -you shouldn't have asked the question. -% -If you don't say it, they can't repeat it. -% -If you don't write to complain, you'll never receive -your order. -If you do write, you'll receive the merchandise before -your angry letter reaches its destination. -% -If you fool around with a thing for very long you will -screw it up. -% -If you have a difficult task give it to a lazy man, he -will find an easier way to do it. -% -If you have always done it that way, it is probably wrong. -% -If you have something to do, and you put it off long enough -chances are someone else will do it for you. -% -If you have to ask, you are not entitled to know. -% -If you have to park six blocks away, you will find two -new parking spaces right in front of the building -entrance. -% -If you have watched a TV series only once, and you watch -it again, it will be a rerun of the same episode. -% -If you help a friend in need, he is sure to remember -you - the next time he's in need. -% -If you just try long enough and hard enough, you can always -manage to boot yourself in the posterior. -% -If you know, you can't say. -% -If you leave the room, you're elected. -% -If you lived here you'd be home now. -% -If you plan to leave your mark in the sands of time, -you better wear work shoes. -% -If you see a man approaching you with the obvious intent -of doing you good, you should run for your life. -% -If you see that there are four possible ways in which a -procedure can go wrong, and circumvent these, then a -fifth way, unprepared for, will promptly develop. -% -If you smile when everything goes wrong, you are -either a nitwit or a repairman. -% -If you try to please everybody, nobody will like it. -% -If you wait, it will go away -... having done it's damage. -If it was bad, it'll be back. -% -If you want to get along, go along. -% -If you want to make an enemy, do someone a favor. -% -If your condition seems to be getting better, it's -probably your doctor getting sick. -% -If your next pot of chili tastes better, it probably is -because of something left out, rather than added. -% -If you're coasting, you're going downhill. -% -If you're early, it'll be canceled. -If you knock yourself out to be on time, you will - have to wait. -If you're late, you will be too late. -% -If you're feeling good, don't worry, -you'll get over it. -% -If you're wondering if you have enough money to take -the family out to eat tonight, you don't. -% -If you're wondering if you left the coffee pot -plugged in, you did. -% -If you're wondering if you need to stop and pick up -bread and eggs on the way home, you do. -% -If you're wondering if you took the meat out to -thaw, you didn't. -% -If you're worried about being crazy, -don't be overly concerned: -If you were, you would think you were sane. -% -If you've got them by the balls, -their hearts and minds will follow. -% -Ignorance should be painful. -% -Important letters which contain no errors will develop -errors in the mail. -% -In a bureaucratic hierarchy, the higher up the -organization the less people appreciate Murphy's law, -the Peter Principle, etc. -% -In a family recipe you just discovered in an old book, -the most vital measurement will be illegible. -% -In a hierarchical organization, the higher the level, -the greater the confusion. -% -In a hierarchical system, the rate of pay varies -inversely with the unpleasantness and difficulty -of the task. -% -In a three-story building served by one elevator, nine -times out of ten the elevator car will be on a floor -where you are not. -% -In any bureaucracy, paperwork increases as you spend -more and more time reporting on the less and less you -are doing. Stability is achieved when you spend all of -your time reporting on the nothing you are doing. -% -In any dealings with a collective body of people, the -people will always be more tacky than originally expected. -% -In any hierarchy, each individual rises to his own level -of incompetence, and then remains there. -% -In any household, junk accumulates to the space -available for its storage. -% -In any organization there will always be one person -who knows what is going on. -This person must be fired. -% -In any series of calculations, errors tend to occur -at the opposite end to the end at which you begin -checking for errors. -% -In case of doubt, make it sound convincing. -% -In order for something to become clean, something -else must become dirty. -... but you can get everything dirty without getting -anything clean. -% -In the fight between you and the world, back the world. -% -Incompetence knows no barriers of time or place. -% -Indecision is the basis for flexibility. -% -Indifference is the only sure defense. -% -Information deteriorates upward through the bureaucracies. -% -Information travels more surely to those with a -lesser need to know. -% -Inside every large program -is a small program struggling to get out. -% -Interchangeable parts --- won't. -% -It always takes longer to get there than to get back. -% -It does not matter if you fall down as long as you pick -up something from the floor while you get up. -% -It is a simple task to make things complex, but a complex -task to make them simple. -% -It is better for civilization to be going down the drain, -than to be coming up it. -% -It is better to be part of the idle rich class -than be part of the idle poor class. -% -It is better to solve a problem with a crude -approximation and know the truth, than to demand an -exact solution and not know the truth at all. -% -It is easier to get forgiveness than permission. -% -It is far better to do nothing than to do -something efficiently. - -- Siezbo -% -It is impossible for an optimist to be pleasantly -surprised. -% -It is impossible to build a fool proof system; -because fools are so ingenious. -% -It is ok to be ignorant in some areas, -but some people abuse the privilege. -% -It takes longer to glue a vase together than to -break one. -% -It takes longer to lose 'x' number of pounds than -to gain 'x' number of pounds. -% -It the shoe fits, it's ugly. -% -It works better if you plug it in. -% -It's always darkest before ... daylight saving time. -% -It's always darkest just before the lights go out. - -- Alex Clark -% -It's always easier to go down hill, but the view is -from the top. -% -It's better to retire too soon than too late. -% -It's tough to get reallocated when you're the one -who's redundant. -% -Just about the time when you think you can make ends meet -somebody moves the ends! -% -Just because you are paranoid -doesn't mean "they" aren't out to get you. -% -Just because your doctor has a name for your condition -doesn't mean he knows what it is. -% -Just when you get really good at something, -you don't need to do it anymore. -% -Justice always prevails... -three times out of seven. -% -Keep emotionally active, -cater to your favorite neurosis. -% -King Arthur ran the first knight club. -% -Laugh and the world laughs with you. cry and ... -you have to blow your nose. -% -Law expands in proportion to the resources available -for its enforcement. -% -Laziness is the mother of nine inventions out of ten. -% -Lead, follow, or get the hell out of the way!! -% -Leakproof seals --- will. -% -Learn to be sincere. Even if you have to fake it. -% -Left to themselves, all things go from bad to worse. -% -Leftover nuts never match leftover bolts. -% -Life is like an ice-cream cone: You have to learn to -lick it. -% -Liquidity tends to run out. -% -Live within your income, -even if you have to borrow to do so. -% -Magellan was the first strait man. -% -Make it possible for programmers to write programs -in English and you will find that programmers cannot -write in English. -% -Make three correct guesses consecutively and you will -establish yourself as an expert. -% -Management can't. -% -Mass man must be serviced by mass means. -% -Misery no longer loves company -nowadays it insists on it. -% -Most people want to be delivered from temptation but -would like it to keep in touch. -% -Most projects require three hands. -% -Multiple-function gadgets will not perform any -function adequately. -% -Murphy's rule for precision: - Measure with a micrometer - Mark with chalk - Cut with an axe -% -Nature always sides with the hidden flaw. -% -Nature is a mother. -% -Nature will tell you a direct lie if she can. -% -Never admit anything. -Never regret anything -whatever it is, you're not responsible. -% -Never argue with a fool, -people might not know the difference. -% -Never argue with an artist. -% -Never be first to do anything. -% -Never create a problem for which you do not have -the answer. -% -Never eat prunes when you are famished. -% -Never get excited about a blind date because of how -it sounds over the phone. -% -Never go to a doctor whose office plants have died. - -- Erma Bombeck -% -Never insult an alligator -until after you have crossed the river. -% -Never leave hold of what you've got until you've got hold -of something else. -% -Never make a decision you can get someone else to make. -% -Never needlessly disturb a thing at rest. -% -Never offend people with style -when you can offend them with substance. -% -Never play leapfrog with a photo enlarger. -% -Never play leapfrog with a unicorn. -% -Never put all your eggs in your pocket. -% -Never say "oops" after you have submitted a job. -% -Never tell them what you wouldn't do. -% -Never test for an error condition you don't know -how to handle. -% -Never wrestle with a pig; you both get dirty, and the pig -likes it! -% -New systems generate new problems. -% -No experiment is ever a complete failure. -It can always be used as a bad example. -% -No good deed goes unpunished. - -- Clare Boothe Luce -% -No major project is ever installed on time, within budgets, -with the same staff that started it. Yours will not be the -first. -% -No man is lonely while eating spaghetti. -% -No matter how large the work space, if two projects -must be done at the same time they will require the -same part of the work space. -% -No matter how long or hard you shop for an item, after -you have bought it, it will be on sale somewhere cheaper. -% -No matter how minor the task, you will inevitably end -up covered with grease and motor oil. -% -No matter how strong the breeze when you leave the dock -once you have reached the furthest point from port -the wind will die. -% -No matter what goes wrong, there is always somebody -who knew it would. -% -No matter what happens, there is always somebody -who knew that it would. -% -No matter what they're talking about, they're -talking about money. -% -No matter what they're telling you, they're not -telling you the whole truth. -% -No matter which direction you start, -it's always against the wind coming back. -% -No news is ... impossible. -% -No one keeps a record of decisions you could have made -but didn't. Everyone keeps a records of your bad ones. -% -No one's life, liberty, or property are safe -while the legislature is in session. -% -No system is ever completely debugged: Attempts to debug -a system will inevitably introduce new bugs that are even -harder to find. -% -Nobody notices when things go right. -% -Nothing improves an innovation like lack of controls. -% -Nothing is ever accomplished by a reasonable man. -% -Nothing is ever as simple as it seems. -% -Nothing is ever done for the right reasons. -% -Nothing is ever so bad it can't be made worse by -firing the coach. -% -Nothing is ever so bad that it can't get worse. -% -Nothing is impossible for the person who doesn't have -to do it himself/herself. -% -Nothing is indestructible, with the possible exception -of discount-priced fruitcakes. -% -Of two possible events, -only the undesired one will occur. -% -Office machines which function perfectly during normal -business hours will break down when you return to the -office at night to use them for personal business. -% -Old age is always fifteen years older than I am. -% -Old programmers never die - they just abend. -% -On a beautiful day like this it's hard to believe anyone -can be unhappy -- but we will work on it. -% -On a clear disk, you can seek forever. -% -On successive charts of the same organization, the number of -boxes will never decrease. -% -Once a dish is fouled up, anything added to save it -only makes it worse. -% -One man's error is another man's data. -% -One place where you're sure to find the perfect -driver is in the back seat. -% -Only a mediocre person is always at their best. -% -Only adults have difficulty with child-proof bottles. -% -Only errors exist. -% -Opportunity always knocks at the least opportune -moment. -% -Other people's romantic gestures seem novel and exciting. - -Your own romantic gestures seem foolish and clumsy. -% -Our customers' paperwork is profit. -Our own paperwork is loss. -% -People are promoted not by what they can do, but what -people think they can do. -% -People can be divided into three groups: -Those who make things happen, -Those who watch things happen and -Those who wonder what happened. -% -People don't change; they only become more so. -% -People in systems do not do what the systems say -they are doing. -% -People to whom you are attracted invariably think you -remind them of someone else. -% -People who love sausage and respect the law should -never watch either one being made. -% -People will accept your idea much more readily if you tell -them Benjamin Franklin said it first. -% -People will believe anything if you whisper it. -% -People will buy anything that is one to a customer. -% -Performance is directly affected by the perversity of -inanimate objects. -% -Personnel recruiting is a triumph of hope over -experience. -% -Persons disagreeing with your facts are always emotional -and employ faulty reasoning. -% -Pills to be taken in twos always come -out of the bottle in threes. -% -Please don't steal, the IRS hates competition! -% -Possessions increase to fill the space available for -their storage. -% -Program complexity grows until it exceeds the capability -of the programmer who must maintain it. -% -Program design philosophy: - - Start at the beginning and continue until the end, - then stop. - -- Lewis Carroll -% -Progress does not consist in replacing a theory that is -wrong with one that is right. It consists in replacing -a theory that is wrong with one that is more subtly wrong. -% -Progress is made on alternate Fridays. -% -Pure drivel tends to drive ordinary -drivel off the TV screen. -% -Quit while you're still behind. -% -RACF is a four letter word. -% -Real programmers always have a better idea. -% -Real programmers are kind to rookies. -% -Real programmers are secure enough to write readable code, -which they then self-righteously refuse to explain. -% -Real programmers argue with the systems analyst as a -matter of principle. -% -Real programmers can do octal, hexadecimal and -binary math in their heads. -% -Real programmers do not apply DP terminology to non-DP -situations. -% -Real programmers do not document. -Documentation is for simps who can't read listings or -object code. -% -Real programmers do not eat breakfast from the -vending machines. -% -Real programmers do not practice four-syllable words before -walkthroughs. -% -Real programmers do not read books like -"effective listening" and "communication skills". -% -Real programmers do not utter profanities at an elevated -decibel level. -% -Real programmers don't advertise their hangovers. -% -Real programmers don't announce how many times the -operations department called them last night. -% -Real programmers don't comment their code. if it is hard -to write, it should be hard to understand. -% -Real programmers don't dress for success unless -they are trying to convince others that they are -going on interviews. -% -Real programmers don't eat muffins. -% -Real programmers don't eat quiche. In fact, real -programmers don't know how to spell quiche. They eat -Twinkies and szechuan food. -% -Real programmers don't grumble about the disadvantages -of Cobol when they don't know any other language. -% -Real programmers don't notch their desks for each -completed service request. -% -Real programmers don't number paragraph names -consecutively. -% -Real programmers don't play tennis or any other sport -that requires you to change clothes. Mountain climbing is -O.K., and real programmers wear their climbing boots to work -in case a mountain should suddenly spring up in the middle -of the machine room. -% -Real programmers don't play video games, they write them. -% -Real programmers don't write applications programs; they -program right down on the bare metal. Application -programming is for feebs who can't do systems programming. -% -Real programmers don't write COBOL. -COBOL is for wimpy applications programmers. -% -Real programmers don't write in Basic. Actually, no -programmers write in Basic after age 12. -% -Real programmers don't write in Pascal, Bliss, or Ada, or -any of those pinko computer science languages. Strong -typing is for people with weak memories. -% -Real programmers don't write in PL/1. PL/1 is for -programmers who can't decide whether to write in -COBOL or Fortran. -% -Real programmers don't write memos. -% -Real programmers don't write specs -- users should -consider themselves lucky to get any programs at all and -take what they get. -% -Real programmers drink too much coffee so that they will -always seem tense and overworked. -% -Real programmers have read the standards manual -but won't admit it. -% -Real programmers know it's not operations' -fault if their jobs go into "hogs". -% -Real programmers know what saad means. -% -Real programmers never work 9 to 5. If any real -programmers are around at 9 a.m., it's because they -were up all night. -% -Real programmers print only clean compiles, -fixing all errors through the terminal. -% -Real programmer's programs never work the first time. But -if you throw them on the machine, they can be patched into -working in "only a few" 30-hour debugging sessions. -% -Real programmers punch up their own programs. -% -Real programmers understand Pascal. -% -Remain silent about your intentions until you are sure -% -Return on investments won't. -% -Roses are red violets are blue -I am schizophrenic and so am I -% -Sale promotions don't. -% -Sanity and insanity overlap a fine gray line. -% -Science is true. Don't be misled by facts. -% -Security isn't. -% -Self starters --- won't. -% -Show me a person who's never made a mistake and I'll -show you somebody who's never achieved much. -% -Simple jobs always get put off because there will be -time to do them later. -% -Some come to the fountain of knowledge to drink, -some prefer to just gargle. -% -Some errors will always go unnoticed until the book -is in print. -% -Some of it plus the rest of it is all of it. -% -Souffles rise and cream whips only for the family and -for guests you didn't really want to invite anyway. -% -Success can be insured only by devising a defense against -failure of the contingency plan. -% -Superiority is recessive. -% -Systems should not be unnecessarily multiplied. -% -Systems tend to grow and as they grow they encroach. -% -Talent in staff work or sales will continually be -interpreted as managerial ability. -% -Teamwork is essential. It allows you to blame someone else. -% -That component of any circuit which has the shortest -service life will be placed in the least -accessible location. -% -The amount of flak received on any subject is inversely -proportional to the subject's true value. -% -The amount of wind will vary inversely with the number -and experience of the people you have on board. -% -The best shots are generally attempted through the -lens cap. -% -The best shots happen immediately after the last -frame is exposed. -% -The best way to inspire fresh thoughts is to seal -the letter. -% -The best way to lie is to tell the truth..... -carefully edited truth. -% -The big guys always win. -% -The bigger they are, the harder they hit. -% -The boss who attempts to impress employees with his -knowledge of intricate details has lost sight of his -final objective. -% -The chance of a piece of bread falling with the buttered -side down is directly proportional to the cost of the -carpet. -% -The chances of anybody doing anything are inversely -proportional to the number of other people who are in -a position to do it instead. -% -The chief cause of problems is solutions. - -- Eric Sevareid -% -The client who pays the least complains the most -% -The closer you are to the facts of a situation, the -more obvious are the errors in all news coverage of -the situation. -% -The "consumer report" on the item will come out a week -after you've made your purchase: - -(1) The one you bought will be rated "unacceptable". -(2) The one you almost bought will be rated "best buy". -% -The cream rises to the top. -So does the scum. -% -The crucial memorandum will be snared in the out-basket by -the paper clip of the overlying memo and go to file. -% -The deficiency will never show itself during the test runs. -% -The distance to the gate is inversely proportional -to the time available to catch your flight. -% -The early worm deserves the bird. -% -The easiest way to find something lost around the house -is to buy a replacement. -% -The faster the plane, -the narrower the seats. -% -The feasibility of an operation is not the best -indication for its performance. -% -The final test is when it goes production ... -w h e n i t g o e s p r o d u c t i o n ... -w h e n i t g o e s p r o d u c t -w h e n i t g o e s p r o -% -The first 90 percent of the task takes 90 percent of the -time, the last 10 percent takes the other 90 percent. -% -The first bug to hit a clean windshield lands directly -in front of your eyes. -% -The first insurance agent was David - -he gave Goliath a piece of the rock. -% -The first myth of management is that it exists -the second myth of management is that success equals skill. -% -The first page the author turns to upon receiving an -advance copy will be the page containing the worst -error. -% -The first place to look for anything is the last place -you would expect to find it. -% -The first rule of intelligent tinkering is to -save all of the parts. -% -The first time is for love. -The next time is $200. -% -The further away the disaster or accident occurs, the -greater the number of dead and injured required for it -to become a story. -% -The further you are from the facts of a situation, -the more you tend to believe news coverage of the -situation. -% -The greater the cost of putting a plan into operation, -the less chance there is of abandoning the plan - even -if it subsequently becomes irrelevant. -% -The hand that rocks the cradle usually is attached -to someone who isn't getting enough sleep. -% -The hidden flaw never remains hidden. -% -The higher the level of prestige accorded the people -behind the plan, the least less chance there is of -abandoning it. -% -The inside contact that you have developed at great -expense is the first person to be let go in any -reorganization. -% -The item you had your eye on the minute you walked in -will be taken by the person in front of you. -% -The lagging activity in a project will invariably be found -in the area where the highest overtime rates lie waiting. -% -The last person who quit or was fired will be held -responsible for everything that goes wrong -- until -the next person quits or is fired. -% -The least experienced fisherman always catches the -biggest fish. -% -The length of a marriage is inversely proportional -to the amount spent on the wedding. -% -The life expectancy of a house plant varies inversely -with its price and directly with its ugliness. -% -The light at the end of the tunnel can be a helluva -nuisance, especially if you're using the tunnel -as a darkroom. -% -The light at the end of the tunnel is the headlamp of -an oncoming train. -% -The light at the end of the tunnel really is a train. -% -The lion and the calf shall lie down together, -but the calf won't get much sleep. -% -The longer the title the less important the job. -% -The longer you wait in line, the greater the -likelihood that you are standing in the wrong line. -% -The love letter you finally got the courage to send -will be delayed in the mail long enough for you to -make a fool of yourself in person. -% -The man who can smile when things go wrong has thought of -someone he can blame it on. -% -The man who has no more problems is out of the game. -% -The meek shall inherit the earth, -but not its mineral rights. -% -The meek will inherit the earth -after the rest of us go to the stars. -% -The more boring and out-of-date the magazines in the -waiting room, the longer you will have to wait for -your scheduled appointment. -% -The more carefully you plan a project, the more -confusion there is when something goes wrong. -% -The more complicated and grandiose the plan, the -greater the chance of failure. -% -The more directives you issue to solve a problem, -the worse it gets. -% -The more elaborate and costly the equipment, the greater -the chance of having to stop at the fish market -on the way home. -% -The more expensive the gadget, the less often you -will use it. -% -The more general the title of a course, the less -you will learn from it. -% -The more ridiculous a belief system, -the higher probability of its success. -% -The more specific the title of a course, the less you -will be able to apply it later. -% -The more studying you did for the exam, the less sure -you are as to which answer they want. -% -The more time and energy you put into preparing a meal -the greater the chance your guests will spend the entire -meal discussing other meals they have had. -% -The most important item in an order will no longer -be available. -% -The most interesting specimen will not be labeled. -% -The most valuable quotation will be the one for which -you cannot determine the source. -% -The mountain gets steeper as you get closer. -% -The mountain looks closer than it is. -% -The one course you must take to graduate will not be -offered during your last semester. -% -The one day you'd sell your soul for something, -souls are a glut. -% -The one ingredient you made a special trip to the store -to get will be the one thing your guest is allergic to. -% -The one thing that money can not buy is poverty. -% -The one time in the day that you lean back and relax -is the one time the boss walks through the office. -% -The one who least wants to play is the one who will win. -% -The one who snores will fall asleep first. -% -The one wrench or drill bit you need will be the one -missing from the tool chest. -% -The one you want is never the one on sale. -% -The only game that can't be fixed is peek-a-boo. -% -The only new TV show worth watching will be canceled. -% -The only way to make up for being lost is to make -record time while you are lost. -% -The only winner in the war of 1812 was Tchaikovsky. -% -The organization of any program reflects the organization -of the people who developed it. -% -The other line always moves faster. -% -The phone will not ring until you leave your desk and walk -to the other end of the building. -% -The pills to be taken with meals will be the least -appetizing ones. -% -The primary function of the design engineer is to make -things difficult for the fabricator and impossible -for the serviceman. -% -The probability of a cat eating its dinner has -absolutely nothing to do with the price of the food -placed before it. -% -The probability of anything happening is in -inverse ratio to its desirability. -% -The probability of meeting someone you know increases -when you are with someone you don't want to be seen with. -% -The probability that a household pet will raise a fuss -to go in or out is directly proportional to the number -and importance of your dinner guests. -% -The quality of correlation is inversely proportional -to the density of control. -% -The quickest way to experiment with acupuncture is to -try on a new shirt. -% -The race goes not always to the swift, nor the battle -to the strong, but that's the way to bet. -% -The radiologists' national flower is the hedge. -% -The ratio of time involved in work to time available for -work is usually about 0.6 -% -The repairman will never have seen a model quite like -yours before. -% -The road to hell is paved with good intentions -and littered with sloppy analyses! -% -The rotten egg will be the one you break into the -cake batter. -% -The scratch on the record is always through the song -you like most. -% -The secret of success is sincerity. Once you can fake -that you've got it made. -% -The severity of an itch is inversely proportional -to the reach. -% -The simpler the instruction, e.g. "press here", the -more difficult it will be to open the package. -% -The six steps of program management are: -(1) Wild enthusiasm -(2) Disenchantment -(3) Total confusion -(4) Search for guilty -(5) Punishment for the innocent -(6) Promotion of the non-participants -% -The slowest checker is always at the quick-check-out -lane. -% -The source for an unattributed quotation will appear -in the most hostile review of your work. -% -The speed of an oncoming vehicle is directly proportional -to the length of the passing zone. -% -The spot you are scrubbing on glassware is always on -the other side. -% -The stomach expands to accommodate the amount of -junk food available. -% -The success of any venture will be helped by prayer, -even in the wrong denomination. -% -The sun goes down just when you need it the most. -% -The system itself does not do what it says it is doing. -% -The tendency of smoke from a cigarette, barbeque, -campfire, etc. to drift into a person's face varies -directly with that person's sensitivity to smoke. -% -The "think positive" leader tends to listen to his -subordinate's premonitions only during the postmortems. -% -The time available to go fishing shrinks as the fishing -season draws nearer. -% -The time it takes to rectify a situation is -inversely proportional to the time it took -to do the damage. -% -The total behavior of large systems cannot be predicted. -% -The TV show you've been looking forward to all week -will be preempted. -% -The usefulness of any meeting -is in inverse proportion to the attendance. -% -The value of a program is proportional -to the weight of its output. -% -The worse your line is tangled, the better is the -fishing around you. -% -The wrong quarterback is the one that's in there. -% -The yoo-hoo you yoo-hoo into the forest is the yoo-hoo you -get back. -% -Them what gets--has. -% -There are no winners in life: Only survivors. -% -There are some things which are impossible to know - -but it is impossible to know these things. -% -There are three ways to get things done: - (1) Do it yourself, - (2) Hire someone to do it, or - (3) Forbid your kids to do it. -% -There are two kinds of adhesive tape: That which won't -stay on and that which won't come off. -% -There is a solution to every problem; -the only difficulty is finding it. -% -There is always more dirty laundry then clean laundry. -% -There is always one more bug. -% -There is no safety in numbers, or in anything else. -% -There is no such thing as a "dirty capitalist", -only a capitalist. -% -There is no such thing as a straight line. -% -There is nothing more frightening than ignorance in action. -% -There's never time to do it right, but there's always -time to do it over. -% -There's no time like the present for postponing -what you don't want to do. -% -Things equal to nothing else are equal to each other. -% -Things get worse under pressure. -% -This space for rent. -% -Those whose approval you seek the most give you the least. -% -Those with the best advice offer no advice. -% -Time spent consuming a meal is in inverse proportion -to time spent preparing it. -% -To err is human -- to blame it on someone else is -even more human. -% -To err is human, but to really foul things up requires -a computer. -% -To err is human, to forgive is divine -- -but to forget it altogether is humane. -% -To get a loan, you must first prove you don't need it. -% -To know yourself is the ultimate form of aggression. -% -To spot the expert, pick the one who predicts the job -will take the longest and cost the most. -% -Trial balances don't. -% -Truth is elastic. -% -Unless the results are known in advance, funding -agencies will reject the proposal. -% -Unless you intend to kill him immediately; never kick a man -in the balls, not even symbolically or perhaps especially -not symbolically. -% -Usefulness is inversely proportional to its reputation -for being useful. -% -Vital papers will demonstrate their vitality by -spontaneously moving from where you left them to where -you can't find them. -% -Washing machines only break down during the wash cycle. -% -Washing your car to make it rain doesn't work. -% -"Watching a birdie" in hand is safer than watching -one overhead. -% -Whatever can go to New York, will. -% -Whatever carrousel you stand by, your baggage will -come in on another one. -% -Whatever creates the greatest inconvenience for the largest -number must happen. -% -Whatever happens to you, it will previously have -happened to everyone you know only more so. -% -Whatever hits the fan will not be evenly distributed. -% -Whatever it is, somebody will have had it for lunch. -% -When a broken appliance is demonstrated for the repairman, -it will work perfectly. -% -When a distinguished scientist states something is possible, -he is almost certainly right. When he states that -something is impossible, he is very probably wrong. -% -When a student asks for a second time if you have read -his book report, he did not read the book. -% -When a writer prepares a manuscript on a subject he does -not understand, his work will be understood only by -readers who know more about that subject than he does. -% -When all else fails, read the instructions. -% -When an exaggerated emphasis is placed upon delegation, -responsibility, like sediment, sinks to the bottom. -% -When in doubt, don't mumble, overexpose ... then mumble. -% -When in doubt, mumble. When in trouble, delegate. -% -When in doubt, mumble. -When in trouble, delegate. -When in charge, ponder. -% -When in doubt, predict that the trend will continue. -% -When in trouble, obfuscate. -% -When life hands you a lemon, make lemonade. -% -When more and more people are thrown out of work, -unemployment results. -% -When necessary, metric and inch tools can be used -interchangeably. -% -When outrageous expenditures are divided finely enough -the public will not have enough stake in any one -expenditure to squelch it. -% -When properly administered, vacations do not diminish -productivity. For every week you are away and get nothing -done, there is another week when your boss is away and you -get twice as much done. -% -When putting it into memory, remember where you put it. -% -When reviewing your notes before an exam, the most -important ones will be illegible. -% -When somebody drops something, everybody will kick it -around instead of picking it up. -% -When the going gets tough, everyone leaves. - -- Lynch -% -When the government bureau's remedies do not match your -problem, you modify the problem, not the remedy. -% -When the need arises, any tool or object closest to you -becomes a hammer. -% -When the product is destined to fail, the delivery system -will perform perfectly. -% -When they want it bad (in a rush), they get it bad. -% -When things are going well, someone will inevitably -experiment detrimentally. -% -When things are going well, something will go wrong. -When things just can't get any worse, they will. -When things appear to be going better you have overlooked -something. -% -When traveling overseas, the exchange rate improves -markedly the day after one has purchased foreign -currency. - -Upon returning home, the exchange rate drops again as -soon as one has converted all unused foreign currency. -% -When we try to pick out anything by itself we find -it hitched to everything else in the universe. -% -When working toward the solution of a problem, -it always helps if you know the answer. -Provided of course you know there is a problem. -% -When you are able to schedule two classes in a row, -they will be held in classrooms at opposite end of -the campus. -% -When you are right be logical, -when you are wrong be-fuddle. -% -When you are sure you're right, you have a moral duty -to impose your will upon anyone who disagrees with you. -% -When you consider there are 24 hours in a day, it's -sad to know that only one is called the happy hour. -% -When you dial a wrong number, you never get a busy signal -% -When you do not know what you are doing, do it neatly. -% -When you need to knock on wood is when you realize the -world's composed of aluminum and vinyl. -% -When your opponent is down, kick him. -% -When you're not in a hurry, the traffic light will turn -green as soon as your vehicle comes to a complete stop. -% -Whenever a superstar is traded to your favorite team, -he fades. Whenever your team trades away a useless -no-name, he immediately rises to stardom. -% -Whenever you cut your fingernails you will find a -need for them an hour later. -% -Where you stand on an issue depends on where you sit. -% -Why worry about tomorrow? We may not make it through today! -% -Work is accomplished by those employees who have not yet -reached their level of incompetence. -% -Work may be the crabgrass of life, but money is still the -water that keeps it green. -% -Workers won't. -% -Working capital doesn't. -% -Writings prepared without understanding must fail in the -first objective of communication -- informing -the uninformed. -% -You are always complimented on the item which took the -least effort to prepare. - -Example: - If you make "duck a l'orange" you will be - complimented on the baked potato. -% -You are not drunk if you can lay on the floor without -holding on. -% -You can always find what you're not looking for. -% -You can lead a horse to water, but if you can get him to -float on his back, you've really got something. -% -You can never do just one thing. - -- Hardin -% -You can pray hard enough to make water run uphill -how hard? -Hard enough to make water run uphill. -% -You can't expect to hit the jackpot -if you don't put a few nickels in the machine. -% -You can't fix it if it ain't broke. -% -You can't guard against the arbitrary. -% -You can't tell how deep a puddle is until you step into it. -% -You don't have to be crazy to work here -but it sure helps!!!!!!! -% -You may be recognized soon. -Hide! -If they find you, lie. -% -You may know where the market is going, but you can't -possibly know where it's going after that. -% -You never have the right number of pills left on the -last day of a prescription. -% -You never know who's right, but you always know -who's in charge. -% -You sure have to borrow a lot of money these days to -be an average consumer. -% -You will always find something in the last place you look. -% -You will remember that you forgot to take out the trash -when the garbage truck is two doors away. -% -You will save yourself a lot of needless worry if you -don't burn your bridges until you come to them. -% -You win some, lose some, and some get rained out; but you -gotta suit up for them all. -% diff --git a/usr.bin/fortune/datfiles/murphy-o b/usr.bin/fortune/datfiles/murphy-o deleted file mode 100644 index 94c9cc22bc4f..000000000000 --- a/usr.bin/fortune/datfiles/murphy-o +++ /dev/null @@ -1,30 +0,0 @@ -%%$FreeBSD$ -% -All probabilities are 50%: either a thing will -happen or it won't. - -This is especially true when dealing with women. - -Likelihoods, however, are 90% against you. -% -Early to rise and early to bed makes a male -healthy and wealthy and dead. -% -It's always the wrong time of the month. -% -Never sleep with anyone crazier than yourself. -% -One's life tends to be like a beaver's, -one dam thing after another. -% -Pity the poor egg; -It only gets laid once in its life. -% -Sow your wild oats on Saturday night - then on -Sunday pray for crop failure. -% -When you're up to your nose in shit, -be sure to keep your mouth shut. -% -You can lead a horticulture, but you can't make her think. -% diff --git a/usr.bin/fortune/datfiles/murphy.sp.ok b/usr.bin/fortune/datfiles/murphy.sp.ok deleted file mode 100644 index 0287e6a3301f..000000000000 --- a/usr.bin/fortune/datfiles/murphy.sp.ok +++ /dev/null @@ -1,36 +0,0 @@ -# $FreeBSD$ -abend -ACF -barbeque -Carroll -Chevrolets -countercan't -crabgrass -DP -feebs -Freud's -fruitcakes -gotta -headlamp -IQ -IRS -l'orange -MCP -Murphy's -paranoids -plumber's -postmortems -Poul -profanities -RACF -radiologists -roccoco -saad -Siezbo -simps -Souffles -subordinate's -superstar -szechuan -Twinkies -walkthroughs diff --git a/usr.bin/fortune/datfiles/startrek b/usr.bin/fortune/datfiles/startrek deleted file mode 100644 index af3f9d4ef95e..000000000000 --- a/usr.bin/fortune/datfiles/startrek +++ /dev/null @@ -1,759 +0,0 @@ -%% $FreeBSD$ -% - "... freedom ... is a worship word..." - "It is our worship word too." - -- Cloud William and Kirk, "The Omega Glory", stardate unknown -% - "Beauty is transitory." - "Beauty survives." - -- Spock and Kirk, "That Which Survives", stardate unknown -% - "Can you imagine how life could be improved if we could do away -with jealousy, greed, hate ..." - "It can also be improved by eliminating love, tenderness, -sentiment -- the other side of the coin" - -- Dr. Roger Corby and Kirk, - "What are Little Girls Made Of?", stardate 2712.4 -% - "Evil does seek to maintain power by suppressing the truth." - "Or by misleading the innocent." - -- Spock and McCoy, "And The Children Shall Lead", - stardate 5029.5. -% - "Get back to your stations!" - "We're beaming down to the planet, sir." - -- Kirk and Mr. Leslie, "This Side of Paradise", - stardate 3417.3 -% - "I think they're going to take all this money that we spend now -on war and death --" - "And make them spend it on life." - -- Edith Keeler and Kirk, "The City on the Edge of Forever", - stardate unknown. -% - "It's hard to believe that something which is neither seen nor -felt can do so much harm." - "That's true. But an idea can't be seen or felt. And that's -what kept the Troglytes in the mines all these centuries. A mistaken idea." - -- Vanna and Kirk, "The Cloud Minders", stardate 5819.0 -% - "Life and death are seldom logical." - "But attaining a desired goal always is." - -- McCoy and Spock, "The Galileo Seven", stardate 2821.7 -% - "Logic and practical information do not seem to apply here." - "You admit that?" - "To deny the facts would be illogical, Doctor" - -- Spock and McCoy, "A Piece of the Action", stardate unknown -% - "No one talks peace unless he's ready to back it up with war." - "He talks of peace if it is the only way to live." - -- Colonel Green and Surak of Vulcan, "The Savage Curtain", - stardate 5906.5. -% - "That unit is a woman." - "A mass of conflicting impulses." - -- Spock and Nomad, "The Changeling", stardate 3541.9 -% - "The combination of a number of things to make existence worthwhile." - "Yes, the philosophy of 'none,' meaning 'all.'" - -- Spock and Lincoln, "The Savage Curtain", stardate 5906.4 -% - "The glory of creation is in its infinite diversity." - "And in the way our differences combine to create meaning and -beauty." - -- Dr. Miranda Jones and Spock, - "Is There in Truth No Beauty?", stardate 5630.8 -% - "The release of emotion is what keeps us healthy. Emotionally -healthy." - "That may be, Doctor. However, I have noted that the healthy -release of emotion is frequently unhealthy for those closest to you." - -- McCoy and Spock, "Plato's Stepchildren", stardate 5784.3 -% - "There's only one kind of woman ..." - "Or man, for that matter. You either believe in yourself or -you don't." - -- Kirk and Harry Mudd, "Mudd's Women", stardate 1330.1 -% - "We have the right to survive!" - "Not by killing others." - -- Deela and Kirk, "Wink of An Eye", stardate 5710.5 -% - "What a terrible way to die." - "There are no good ways." - -- Sulu and Kirk, "That Which Survives", stardate unknown -% - "What happened to the crewman?" - "The M-5 computer needed a new power source, the crewman merely -got in the way." - -- Kirk and Dr. Richard Daystrom, "The Ultimate Computer", - stardate 4731.3. -% -... bacteriological warfare ... hard to believe we were once foolish -enough to play around with that. - -- McCoy, "The Omega Glory", stardate unknown -% -... The prejudices people feel about each other disappear when they get -to know each other. - -- Kirk, "Elaan of Troyius", stardate 4372.5 -% -... The things love can drive a man to -- the ecstasies, the -miseries, the broken rules, the desperate chances, the glorious -failures and the glorious victories. - -- McCoy, "Requiem for Methuselah", stardate 5843.7 -% -A father doesn't destroy his children. - -- Lt. Carolyn Palamas, "Who Mourns for Adonais?", - stardate 3468.1. -% -A little suffering is good for the soul. - -- Kirk, "The Corbomite Maneuver", stardate 1514.0 -% -A man either lives life as it happens to him, meets it head-on and -licks it, or he turns his back on it and starts to wither away. - -- Dr. Boyce, "The Menagerie" ("The Cage"), stardate unknown -% -A princess should not be afraid -- not with a brave knight to protect -her. - -- McCoy, "Shore Leave", stardate 3025.3 -% -A star captain's most solemn oath is that he will give his life, even -his entire crew, rather than violate the Prime Directive. - -- Kirk, "The Omega Glory", stardate unknown -% -A Vulcan can no sooner be disloyal than he can exist without -breathing. - -- Kirk, "The Menagerie", stardate 3012.4 -% -A woman should have compassion. - -- Kirk, "Catspaw", stardate 3018.2 -% -Actual war is a very messy business. Very, very messy business. - -- Kirk, "A Taste of Armageddon", stardate 3193.0 -% -After a time, you may find that "having" is not so pleasing a thing, -after all, as "wanting." It is not logical, but it is often true. - -- Spock, "Amok Time", stardate 3372.7 -% -All your people must learn before you can reach for the stars. - -- Kirk, "The Gamesters of Triskelion", stardate 3259.2 -% -Another Armenia, Belgium ... the weak innocents who always seem to be -located on a natural invasion route. - -- Kirk, "Errand of Mercy", stardate 3198.4 -% -Another dream that failed. There's nothing sadder. - -- Kirk, "This side of Paradise", stardate 3417.3 -% -Another war ... must it always be so? How many comrades have we lost -in this way? ... Obedience. Duty. Death, and more death ... - -- Romulan Commander, "Balance of Terror", stardate 1709.2 -% -Behind every great man, there is a woman -- urging him on. - -- Harry Mudd, "I, Mudd", stardate 4513.3 -% -Blast medicine anyway! We've learned to tie into every organ in the -human body but one. The brain! The brain is what life is all about. - -- McCoy, "The Menagerie", stardate 3012.4 -% -But it's real. And if it's real it can be affected ... we may not be -able to break it, but, I'll bet you credits to Navy Beans we can put a -dent in it. - -- deSalle, "Catspaw", stardate 3018.2 -% -Change is the essential process of all existence. - -- Spock, "Let That Be Your Last Battlefield", stardate 5730.2 -% -Compassion -- that's the one thing no machine ever had. Maybe it's -the one thing that keeps men ahead of them. - -- McCoy, "The Ultimate Computer", stardate 4731.3 -% -Computers make excellent and efficient servants, but I have no wish to -serve under them. Captain, a starship also runs on loyalty to one -man. And nothing can replace it or him. - -- Spock, "The Ultimate Computer", stardate 4729.4 -% -Conquest is easy. Control is not. - -- Kirk, "Mirror, Mirror", stardate unknown -% -Death. Destruction. Disease. Horror. That's what war is all about. -That's what makes it a thing to be avoided. - -- Kirk, "A Taste of Armageddon", stardate 3193.0 -% -Death, when unnecessary, is a tragic thing. - -- Flint, "Requiem for Methuselah", stardate 5843.7 -% -Do you know about being with somebody? Wanting to be? If I had the -whole universe, I'd give it to you, Janice. When I see you, I feel -like I'm hungry all over. Do you know how that feels? - -- Charlie Evans, "Charlie X", stardate 1535.8 -% -Do you know the one -- "All I ask is a tall ship, and a star to steer -her by ..." You could feel the wind at your back, about you ... the -sounds of the sea beneath you. And even if you take away the wind and -the water, it's still the same. The ship is yours ... you can feel her -... and the stars are still there. - -- Kirk, "The Ultimate Computer", stardate 4729.4 -% -[Doctors and Bartenders], We both get the same two kinds of customers --- the living and the dying. - -- Dr. Boyce, "The Menagerie" ("The Cage"), stardate unknown -% -Each kiss is as the first. - -- Miramanee, Kirk's wife, "The Paradise Syndrome", - stardate 4842.6 -% -Earth -- mother of the most beautiful women in the universe. - -- Apollo, "Who Mourns for Adonais?" stardate 3468.1 -% -Either one of us, by himself, is expendable. Both of us are not. - -- Kirk, "The Devil in the Dark", stardate 3196.1 -% -Emotions are alien to me. I'm a scientist. - -- Spock, "This Side of Paradise", stardate 3417.3 -% -Even historians fail to learn from history -- they repeat the same -mistakes. - -- John Gill, "Patterns of Force", stardate 2534.7 -% -Every living thing wants to survive. - -- Spock, "The Ultimate Computer", stardate 4731.3 -% -Extreme feminine beauty is always disturbing. - -- Spock, "The Cloud Minders", stardate 5818.4 -% -Fascinating, a totally parochial attitude. - -- Spock, "Metamorphosis", stardate 3219.8 -% -Fascinating is a word I use for the unexpected. - -- Spock, "The Squire of Gothos", stardate 2124.5 -% -First study the enemy. Seek weakness. - -- Romulan Commander, "Balance of Terror", stardate 1709.2 -% -Four thousand throats may be cut in one night by a running man. - -- Klingon Soldier, "Day of the Dove", stardate unknown -% -Genius doesn't work on an assembly line basis. You can't simply say, -"Today I will be brilliant." - -- Kirk, "The Ultimate Computer", stardate 4731.3 -% -He's dead, Jim - -- McCoy, "The Devil in the Dark", stardate 3196.1 -% -History tends to exaggerate. - -- Col. Green, "The Savage Curtain", stardate 5906.4 -% -Humans do claim a great deal for that particular emotion (love). - -- Spock, "The Lights of Zetar", stardate 5725.6 -% -I am pleased to see that we have differences. May we together become -greater than the sum of both of us. - -- Surak of Vulcan, "The Savage Curtain", stardate 5906.4 -% -I have never understood the female capacity to avoid a direct answer to -any question. - -- Spock, "This Side of Paradise", stardate 3417.3 -% -I object to intellect without discipline; I object to power without -constructive purpose. - -- Spock, "The Squire of Gothos", stardate 2124.5 -% -I realize that command does have its fascination, even under -circumstances such as these, but I neither enjoy the idea of command -nor am I frightened of it. It simply exists, and I will do whatever -logically needs to be done. - -- Spock, "The Galileo Seven", stardate 2812.7 -% -I thought my people would grow tired of killing. But you were right, -they see it is easier than trading. And it has its pleasures. I feel -it myself. Like the hunt, but with richer rewards. - -- Apella, "A Private Little War", stardate 4211.8 -% -If a man had a child who'd gone anti-social, killed perhaps, he'd still -tend to protect that child. - -- McCoy, "The Ultimate Computer", stardate 4731.3 -% -If I can have honesty, it's easier to overlook mistakes. - -- Kirk, "Space Seed", stardate 3141.9 -% -If some day we are defeated, well, war has its fortunes, good and bad. - -- Commander Kor, "Errand of Mercy", stardate 3201.7 -% -If there are self-made purgatories, then we all have to live in them. - -- Spock, "This Side of Paradise", stardate 3417.7 -% -I'm a soldier, not a diplomat. I can only tell the truth. - -- Kirk, "Errand of Mercy", stardate 3198.9 -% -I'm frequently appalled by the low regard you Earthmen have for life. - -- Spock, "The Galileo Seven", stardate 2822.3 -% -Immortality consists largely of boredom. - -- Zefrem Cochrane, "Metamorphosis", stardate 3219.8 -% -In the strict scientific sense we all feed on death -- even -vegetarians. - -- Spock, "Wolf in the Fold", stardate 3615.4 -% -Insufficient facts always invite danger. - -- Spock, "Space Seed", stardate 3141.9 -% -Insults are effective only where emotion is present. - -- Spock, "Who Mourns for Adonais?" stardate 3468.1 -% -Intuition, however illogical, is recognized as a command prerogative. - -- Kirk, "Obsession", stardate 3620.7 -% -Is not that the nature of men and women -- that the pleasure is in the -learning of each other? - -- Natira, the High Priestess of Yonada, "For the World is - Hollow and I Have Touched the Sky", stardate 5476.3. -% -Is truth not truth for all? - -- Natira, "For the World is Hollow and I have Touched - the Sky", stardate 5476.4. -% -It [being a Vulcan] means to adopt a philosophy, a way of life which is -logical and beneficial. We cannot disregard that philosophy merely for -personal gain, no matter how important that gain might be. - -- Spock, "Journey to Babel", stardate 3842.4 -% -It is a human characteristic to love little animals, especially if -they're attractive in some way. - -- McCoy, "The Trouble with Tribbles", stardate 4525.6 -% -It is more rational to sacrifice one life than six. - -- Spock, "The Galileo Seven", stardate 2822.3 -% -It is necessary to have purpose. - -- Alice #1, "I, Mudd", stardate 4513.3 -% -It is undignified for a woman to play servant to a man who is not -hers. - -- Spock, "Amok Time", stardate 3372.7 -% -It would be illogical to assume that all conditions remain stable. - -- Spock, "The Enterprise Incident", stardate 5027.3 -% -It would be illogical to kill without reason - -- Spock, "Journey to Babel", stardate 3842.4 -% -It would seem that evil retreats when forcibly confronted - -- Yarnek of Excalbia, "The Savage Curtain", stardate 5906.5 -% -I've already got a female to worry about. Her name is the Enterprise. - -- Kirk, "The Corbomite Maneuver", stardate 1514.0 -% -Killing is stupid; useless! - -- McCoy, "A Private Little War", stardate 4211.8 -% -Killing is wrong. - -- Losira, "That Which Survives", stardate unknown -% -Knowledge, sir, should be free to all! - -- Harry Mudd, "I, Mudd", stardate 4513.3 -% -Landru! Guide us! - -- A Beta 3-oid, "The Return of the Archons", stardate 3157.4 -% -Leave bigotry in your quarters; there's no room for it on the bridge. - -- Kirk, "Balance of Terror", stardate 1709.2 -% -Live long and prosper. - -- Spock, "Amok Time", stardate 3372.7 -% -Lots of people drink from the wrong bottle sometimes. - -- Edith Keeler, "The City on the Edge of Forever", - stardate unknown -% -Love sometimes expresses itself in sacrifice. - -- Kirk, "Metamorphosis", stardate 3220.3 -% -Madness has no purpose. Or reason. But it may have a goal. - -- Spock, "The Alternative Factor", stardate 3088.7 -% -Many Myths are based on truth - -- Spock, "The Way to Eden", stardate 5832.3 -% -Men don't talk peace unless they're ready to back it up with war. - -- Col. Green, "The Savage Curtain", stardate 5906.4 -% -Men of peace usually are [brave]. - -- Spock, "The Savage Curtain", stardate 5906.5 -% -Men will always be men -- no matter where they are. - -- Harry Mudd, "Mudd's Women", stardate 1329.8 -% -Military secrets are the most fleeting of all. - -- Spock, "The Enterprise Incident", stardate 5027.4 -% -Most legends have their basis in facts. - -- Kirk, "And The Children Shall Lead", stardate 5029.5 -% -Murder is contrary to the laws of man and God. - -- M-5 Computer, "The Ultimate Computer", stardate 4731.3 -% -No more blah, blah, blah! - -- Kirk, "Miri", stardate 2713.6 -% -No one can guarantee the actions of another. - -- Spock, "Day of the Dove", stardate unknown -% -No one may kill a man. Not for any purpose. It cannot be condoned. - -- Kirk, "Spock's Brain", stardate 5431.6 -% -No one wants war. - -- Kirk, "Errand of Mercy", stardate 3201.7 -% -No problem is insoluble. - -- Dr. Janet Wallace, "The Deadly Years", stardate 3479.4 -% -Not one hundred percent efficient, of course ... but nothing ever is. - -- Kirk, "Metamorphosis", stardate 3219.8 -% -Oblivion together does not frighten me, beloved. - -- Thalassa (in Anne Mulhall's body), "Return to Tomorrow", - stardate 4770.3. -% -Oh, that sound of male ego. You travel halfway across the galaxy and -it's still the same song. - -- Eve McHuron, "Mudd's Women", stardate 1330.1 -% -On my planet, to rest is to rest -- to cease using energy. To me, it -is quite illogical to run up and down on green grass, using energy, -instead of saving it. - -- Spock, "Shore Leave", stardate 3025.2 -% -One does not thank logic. - -- Sarek, "Journey to Babel", stardate 3842.4 -% -One of the advantages of being a captain is being able to ask for -advice without necessarily having to take it. - -- Kirk, "Dagger of the Mind", stardate 2715.2 -% -Only a fool fights in a burning house. - -- Kang the Klingon, "Day of the Dove", stardate unknown -% -Our missions are peaceful -- not for conquest. When we do battle, it -is only because we have no choice. - -- Kirk, "The Squire of Gothos", stardate 2124.5 -% -Our way is peace. - -- Septimus, the Son Worshiper, "Bread and Circuses", - stardate 4040.7. -% -Pain is a thing of the mind. The mind can be controlled. - -- Spock, "Operation -- Annihilate!" stardate 3287.2 -% -Peace was the way. - -- Kirk, "The City on the Edge of Forever", stardate unknown -% -Power is danger. - -- The Centurion, "Balance of Terror", stardate 1709.2 -% -Prepare for tomorrow -- get ready. - -- Edith Keeler, "The City On the Edge of Forever", - stardate unknown -% -Punishment becomes ineffective after a certain point. Men become -insensitive. - -- Eneg, "Patterns of Force", stardate 2534.7 -% -Respect is a rational process - -- McCoy, "The Galileo Seven", stardate 2822.3 -% -Romulan women are not like Vulcan females. We are not dedicated to -pure logic and the sterility of non-emotion. - -- Romulan Commander, "The Enterprise Incident", - stardate 5027.3 -% -Schshschshchsch. - -- The Gorn, "Arena", stardate 3046.2 -% -Sometimes a feeling is all we humans have to go on. - -- Kirk, "A Taste of Armageddon", stardate 3193.9 -% -Sometimes a man will tell his bartender things he'll never tell his doctor. - -- Dr. Phillip Boyce, "The Menagerie" ("The Cage"), - stardate unknown. -% -Star Trek Lives! -% -Suffocating together ... would create heroic camaraderie. - -- Khan Noonian Singh, "Space Seed", stardate 3142.8 -% -Superior ability breeds superior ambition. - -- Spock, "Space Seed", stardate 3141.9 -% -The face of war has never changed. Surely it is more logical to heal -than to kill. - -- Surak of Vulcan, "The Savage Curtain", stardate 5906.5 -% -The games have always strengthened us. Death becomes a familiar -pattern. We don't fear it as you do. - -- Proconsul Marcus Claudius, "Bread and Circuses", - stardate 4041.2 -% -The heart is not a logical organ. - -- Dr. Janet Wallace, "The Deadly Years", stardate 3479.4 -% -The idea of male and female are universal constants. - -- Kirk, "Metamorphosis", stardate 3219.8 -% -The joys of love made her human and the agonies of love destroyed her. - -- Spock, "Requiem for Methuselah", stardate 5842.8 -% -The man on tops walks a lonely street; the "chain" of command is often -a noose. - -- McCoy, "The Conscience of the King," stardate 2818.9 -% -The more complex the mind, the greater the need for the simplicity of -play. - -- Kirk, "Shore Leave", stardate 3025.8 -% -The only solution is ... a balance of power. We arm our side with -exactly that much more. A balance of power -- the trickiest, most -difficult, dirtiest game of them all. But the only one that preserves -both sides. - -- Kirk, "A Private Little War", stardate 4211.8 -% -The people of Gideon have always believed that life is sacred. That -the love of life is the greatest gift ... We are incapable of -destroying or interfering with the creation of that which we love so -deeply -- life in every form from fetus to developed being. - -- Hodin of Gideon, "The Mark of Gideon", stardate 5423.4 -% -The sight of death frightens them [Earthers]. - -- Kras the Klingon, "Friday's Child", stardate 3497.2 -% -The sooner our happiness together begins, the longer it will last. - -- Miramanee, "The Paradise Syndrome", stardate 4842.6 -% -There are always alternatives. - -- Spock, "The Galileo Seven", stardate 2822.3 -% -There are certain things men must do to remain men. - -- Kirk, "The Ultimate Computer", stardate 4929.4 -% -There are some things worth dying for. - -- Kirk, "Errand of Mercy", stardate 3201.7 -% -There comes to all races an ultimate crisis which you have yet to face -.... One day our minds became so powerful we dared think of ourselves -as gods. - -- Sargon, "Return to Tomorrow", stardate 4768.3 -% -There is a multi-legged creature crawling on your shoulder. - -- Spock, "A Taste of Armageddon", stardate 3193.9 -% -There is an old custom among my people. When a woman saves a man's -life, he is grateful. - -- Nona, the Kanuto witch woman, "A Private Little War", - stardate 4211.8. -% -There is an order of things in this universe. - -- Apollo, "Who Mourns for Adonais?" stardate 3468.1 -% -There's a way out of any cage. - -- Captain Christopher Pike, "The Menagerie" ("The Cage"), - stardate unknown. -% -There's another way to survive. Mutual trust -- and help. - -- Kirk, "Day of the Dove", stardate unknown -% -There's no honorable way to kill, no gentle way to destroy. There is -nothing good in war. Except its ending. - -- Abraham Lincoln, "The Savage Curtain", stardate 5906.5 -% -There's nothing disgusting about it [the Companion]. It's just another -life form, that's all. You get used to those things. - -- McCoy, "Metamorphosis", stardate 3219.8 -% -This cultural mystique surrounding the biological function -- you -realize humans are overly preoccupied with the subject. - -- Kelinda the Kelvan, "By Any Other Name", stardate 4658.9 -% -Those who hate and fight must stop themselves -- otherwise it is not -stopped. - -- Spock, "Day of the Dove", stardate unknown -% -Time is fluid ... like a river with currents, eddies, backwash. - -- Spock, "The City on the Edge of Forever", stardate 3134.0 -% -To live is always desirable. - -- Eleen the Capellan, "Friday's Child", stardate 3498.9 -% -Too much of anything, even love, isn't necessarily a good thing. - -- Kirk, "The Trouble with Tribbles", stardate 4525.6 -% -Totally illogical, there was no chance. - -- Spock, "The Galileo Seven", stardate 2822.3 -% -Uncontrolled power will turn even saints into savages. And we can all -be counted on to live down to our lowest impulses. - -- Parmen, "Plato's Stepchildren", stardate 5784.3 -% -Violence in reality is quite different from theory. - -- Spock, "The Cloud Minders", stardate 5818.4 -% -Virtue is a relative term. - -- Spock, "Friday's Child", stardate 3499.1 -% -Vulcans believe peace should not depend on force. - -- Amanda, "Journey to Babel", stardate 3842.3 -% -Vulcans do not approve of violence. - -- Spock, "Journey to Babel", stardate 3842.4 -% -Vulcans never bluff. - -- Spock, "The Doomsday Machine", stardate 4202.1 -% -Vulcans worship peace above all. - -- McCoy, "Return to Tomorrow", stardate 4768.3 -% -Wait! You have not been prepared! - -- Mr. Atoz, "Tomorrow is Yesterday", stardate 3113.2 -% -[War] is instinctive. But the instinct can be fought. We're human -beings with the blood of a million savage years on our hands! But we -can stop it. We can admit that we're killers ... but we're not going -to kill today. That's all it takes! Knowing that we're not going to -kill today! - -- Kirk, "A Taste of Armageddon", stardate 3193.0 -% -War is never imperative. - -- McCoy, "Balance of Terror", stardate 1709.2 -% -War isn't a good life, but it's life. - -- Kirk, "A Private Little War", stardate 4211.8 -% -We do not colonize. We conquer. We rule. There is no other way for -us. - -- Rojan, "By Any Other Name", stardate 4657.5 -% -We fight only when there is no other choice. We prefer the ways of -peaceful contact. - -- Kirk, "Spectre of the Gun", stardate 4385.3 -% -We have found all life forms in the galaxy are capable of superior -development. - -- Kirk, "The Gamesters of Triskelion", stardate 3211.7 -% -We have phasers, I vote we blast 'em! - -- Bailey, "The Corbomite Maneuver", stardate 1514.2 -% -We Klingons believe as you do -- the sick should die. Only the strong -should live. - -- Kras, "Friday's Child", stardate 3497.2 -% -We're all sorry for the other guy when he loses his job to a machine. -But when it comes to your job -- that's different. And it always will -be different. - -- McCoy, "The Ultimate Computer", stardate 4729.4 -% -What kind of love is that? Not to be loved; never to have shown love. - -- Commissioner Nancy Hedford, "Metamorphosis", - stardate 3219.8 -% -When a child is taught ... it's programmed with simple instructions -- -and at some point, if its mind develops properly, it exceeds the sum of -what it was taught, thinks independently. - -- Dr. Richard Daystrom, "The Ultimate Computer", - stardate 4731.3. -% -When dreams become more important than reality, you give up travel, -building, creating; you even forget how to repair the machines left -behind by your ancestors. You just sit living and reliving other lives -left behind in the thought records. - -- Vina, "The Menagerie" ("The Cage"), stardate unknown -% -Where there's no emotion, there's no motive for violence. - -- Spock, "Dagger of the Mind", stardate 2715.1 -% -Witch! Witch! They'll burn ya! - -- Hag, "Tomorrow is Yesterday", stardate unknown -% -Without facts, the decision cannot be made logically. You must rely on -your human intuition. - -- Spock, "Assignment: Earth", stardate unknown -% -Without followers, evil cannot spread. - -- Spock, "And The Children Shall Lead", stardate 5029.5 -% -Without freedom of choice there is no creativity. - -- Kirk, "The return of the Archons", stardate 3157.4 -% -Women are more easily and more deeply terrified ... generating more -sheer horror than the male of the species. - -- Spock, "Wolf in the Fold", stardate 3615.4 -% -Women professionals do tend to over-compensate. - -- Dr. Elizabeth Dehner, "Where No Man Has Gone Before", - stardate 1312.9. -% -Worlds are conquered, galaxies destroyed -- but a woman is always a -woman. - -- Kirk, "Conscience of the King", stardate unknown -% -Worlds may change, galaxies disintegrate, but a woman always remains a -woman. - -- Kirk, "The Conscience of the King", stardate 2818.9 -% -Yes, it is written. Good shall always destroy evil. - -- Sirah the Yang, "The Omega Glory", stardate unknown -% -You! What PLANET is this?! - -- McCoy, "The City on the Edge of Forever", stardate 3134.0 -% -You are an excellent tactician, Captain. You let your second in -command attack while you sit and watch for weakness. - -- Khan Noonian Singh, "Space Seed", stardate 3141.9 -% -You can't evaluate a man by logic alone. - -- McCoy, "I, Mudd", stardate 4513.3 -% -You Earth people glorified organized violence for forty centuries. But -you imprison those who employ it privately. - -- Spock, "Dagger of the Mind", stardate 2715.1 -% -You go slow, be gentle. It's no one-way street -- you know how you -feel and that's all. It's how the girl feels too. Don't press. If -the girl feels anything for you at all, you'll know. - -- Kirk, "Charlie X", stardate 1535.8 -% -You humans have that emotional need to express gratitude. "You're -welcome," I believe, is the correct response. - -- Spock, "Bread and Circuses", stardate 4041.2 -% -You say you are lying. But if everything you say is a lie, then you -are telling the truth. You cannot tell the truth because everything -you say is a lie. You lie, you tell the truth ... but you cannot, for -you lie. - -- Norman the android, "I, Mudd", stardate 4513.3 -% -You speak of courage. Obviously you do not know the difference between -courage and foolhardiness. Always it is the brave ones who die, the -soldiers. - -- Kor, the Klingon Commander, "Errand of Mercy", - stardate 3201.7 -% -You'll learn something about men and women -- the way they're supposed -to be. Caring for each other, being happy with each other, being good -to each other. That's what we call love. You'll like that a lot. - -- Kirk, "The Apple", stardate 3715.6 -% -You're dead, Jim. - -- McCoy, "Amok Time", stardate 3372.7 -% -You're dead, Jim. - -- McCoy, "The Tholian Web", stardate unknown -% -You're too beautiful to ignore. Too much woman. - -- Kirk to Yeoman Rand, "The Enemy Within", stardate unknown -% -Youth doesn't excuse everything. - -- Dr. Janice Lester (in Kirk's body), "Turnabout Intruder", - stardate 5928.5. -% diff --git a/usr.bin/fortune/datfiles/startrek.sp.ok b/usr.bin/fortune/datfiles/startrek.sp.ok deleted file mode 100644 index ccca7090d602..000000000000 --- a/usr.bin/fortune/datfiles/startrek.sp.ok +++ /dev/null @@ -1,86 +0,0 @@ -# $FreeBSD$ -Adonais -Amanda -Apella -Archons -Armenia -Atoz -Capellan -Catspaw -Centurion -Changeling -Claudius -Corbomite -Corby -Daystrom -Deela -Elaan -Eleen -Eneg -Excalbia -Galileo -Gorn -Gothos -Hag -Hedford -Hodin -Kang -Kanuto -Kelinda -Kelvan -Klingon -Klingons -Kor -Kras -Landru -Losira -Lt -McHuron -Miramanee -Miri -Mulhall's -Natira -Nomad -Nona -Noonian -Palamas -Parmen -Phillip -Priestess -Proconsul -Requiem -Rojan -Romulan -Sarek -Sargon -Schshschshchsch -Septimus -Singh -Sirah -Spectre -Spock -Spock's -Stepchildren -Sulu -Surak -Thalassa -Tholian -Tribbles -Triskelion -Troglytes -Troyius -Vanna -Vina -Yarnek -Yonada -Zefrem -Zetar -android -backwash -bacteriological -blah -deSalle -oid -stardate -tactician -ya diff --git a/usr.bin/fortune/datfiles/zippy b/usr.bin/fortune/datfiles/zippy deleted file mode 100644 index 7c43436f93cf..000000000000 --- a/usr.bin/fortune/datfiles/zippy +++ /dev/null @@ -1,1335 +0,0 @@ -%% $FreeBSD$ -% - Talking Pinhead Blues: -Oh, I LOST my ``HELLO KITTY'' DOLL and I get BAD reception on channel - TWENTY-SIX!! - -Th'HOSTESS FACTORY is closin' down and I just heard ZASU PITTS has been - DEAD for YEARS.. (sniff) - -My PLATFORM SHOE collection was CHEWED up by th' dog, ALEXANDER HAIG - won't let me take a SHOWER 'til Easter ... (snurf) - -So I went to the kitchen, but WALNUT PANELING whup me upside mah HAID!! - (on no, no, no.. Heh, heh) -% -... bleakness ... desolation ... plastic forks ... -% -... he dominates the DECADENT SUBWAY SCENE. -% -... I don't know why but, suddenly, I want to discuss declining I.Q. -LEVELS with a blue ribbon SENATE SUB-COMMITTEE! -% -... I don't like FRANK SINATRA or his CHILDREN. -% -... I have read the INSTRUCTIONS ... -% --- I have seen the FUN -- -% --- I love KATRINKA because she drives a PONTIAC. We're going away -now. I fed the cat. -% -... I see TOILET SEATS ... -% -... I think I'd better go back to my DESK and toy with a few common -MISAPPREHENSIONS ... -% -... I want a COLOR T.V. and a VIBRATING BED!!! -% -... I want FORTY-TWO TRYNEL FLOATATION SYSTEMS installed within -SIX AND A HALF HOURS!!! -% -... ich bin in einem dusenjet ins jahr 53 vor chr ... ich lande im -antiken Rom ... einige gladiatoren spielen scrabble ... ich rieche -PIZZA ... -% -... If I had heart failure right now, I couldn't be a more fortunate -man!! -% -... I'm IMAGINING a sensuous GIRAFFE, CAVORTING in the BACK ROOM -of a KOSHER DELI -- -% -... My pants just went on a wild rampage through a Long Island Bowling -Alley!! -% -... Now, it's time to "HAVE A NAGEELA"!! -% -... or were you driving the PONTIAC that HONKED at me in MIAMI last -Tuesday? -% -... the HIGHWAY is made out of LIME JELLO and my HONDA is a barbequeued -OYSTER! Yum! -% -... the MYSTERIANS are in here with my CORDUROY SOAP DISH!! -% -... this must be what it's like to be a COLLEGE GRADUATE!! -% -A can of ASPARAGUS, 73 pigeons, some LIVE ammo, and a FROZEN DAQUIRI!! -% -A dwarf is passing out somewhere in Detroit! -% -A shapely CATHOLIC SCHOOLGIRL is FIDGETING inside my costume.. -% -A wide-eyed, innocent UNICORN, poised delicately in a MEADOW filled -with LILACS, LOLLIPOPS & small CHILDREN at the HUSH of twilight?? -% -Actually, what I'd like is a little toy spaceship!! -% -All I can think of is a platter of organic PRUNE CRISPS being trampled -by an army of swarthy, Italian LOUNGE SINGERS ... -% -All of a sudden, I want to THROW OVER my promising ACTING CAREER, grow -a LONG BLACK BEARD and wear a BASEBALL HAT!! ... Although I don't know -WHY!! -% -All of life is a blur of Republicans and meat! -% -All right, you degenerates! I want this place evacuated in 20 seconds! -% -All this time I've been VIEWING a RUSSIAN MIDGET SODOMIZE a HOUSECAT! -% -Alright, you!! Imitate a WOUNDED SEAL pleading for a PARKING SPACE!! -% -Am I accompanied by a PARENT or GUARDIAN? -% -Am I elected yet? -% -Am I in GRADUATE SCHOOL yet? -% -Am I SHOPLIFTING? -% -America!! I saw it all!! Vomiting! Waving! JERRY FALWELLING into -your void tube of UHF oblivion!! SAFEWAY of the mind ... -% -An air of FRENCH FRIES permeates my nostrils!! -% -An INK-LING? Sure -- TAKE one!! Did you BUY any COMMUNIST UNIFORMS?? -% -An Italian is COMBING his hair in suburban DES MOINES! -% -And furthermore, my bowling average is unimpeachable!!! -% -ANN JILLIAN'S HAIR makes LONI ANDERSON'S HAIR look like RICARDO -MONTALBAN'S HAIR! -% -Are the STEWED PRUNES still in the HAIR DRYER? -% -Are we live or on tape? -% -Are we on STRIKE yet? -% -Are we THERE yet? -% -Are we THERE yet? My MIND is a SUBMARINE!! -% -Are you mentally here at Pizza Hut?? -% -Are you selling NYLON OIL WELLS?? If so, we can use TWO DOZEN!! -% -Are you still an ALCOHOLIC? -% -As President I have to go vacuum my coin collection! -% -Awright, which one of you hid my PENIS ENVY? -% -BARBARA STANWYCK makes me nervous!! -% -Barbie says, Take quaaludes in gin and go to a disco right away! -But Ken says, WOO-WOO!! No credit at "Mr. Liquor"!! -% -BARRY ... That was the most HEART-WARMING rendition of "I DID IT MY -WAY" I've ever heard!! -% -Being a BALD HERO is almost as FESTIVE as a TATTOOED KNOCKWURST. -% -BELA LUGOSI is my co-pilot ... -% -BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI- -% -Bo Derek ruined my life! -% -Boy, am I glad it's only 1971... -% -Boys, you have ALL been selected to LEAVE th' PLANET in 15 minutes!! -% -But they went to MARS around 1953!! -% -But was he mature enough last night at the lesbian masquerade? -% -Calling J-Man Kink. Calling J-Man Kink. Hash missile sighted, target -Los Angeles. Disregard personal feelings about city and intercept. -% -Can I have an IMPULSE ITEM instead? -% -Can you MAIL a BEAN CAKE? -% -Catsup and Mustard all over the place! It's the Human Hamburger! -% -CHUBBY CHECKER just had a CHICKEN SANDWICH in downtown DULUTH! -% -Civilization is fun! Anyway, it keeps me busy!! -% -Clear the laundromat!! This whirl-o-matic just had a nuclear meltdown!! -% -Concentrate on th'cute, li'l CARTOON GUYS! Remember the SERIAL -NUMBERS!! Follow the WHIPPLE AVE. EXIT!! Have a FREE PEPSI!! Turn -LEFT at th'HOLIDAY INN!! JOIN the CREDIT WORLD!! MAKE me an OFFER!!! -% -CONGRATULATIONS! Now should I make thinly veiled comments about -DIGNITY, self-esteem and finding TRUE FUN in your RIGHT VENTRICLE?? -% -Content: 80% POLYESTER, 20% DACRON ... The waitress's UNIFORM sheds -TARTAR SAUCE like an 8" by 10" GLOSSY ... -% -Could I have a drug overdose? -% -Did an Italian CRANE OPERATOR just experience uninhibited sensations in -a MALIBU HOT TUB? -% -Did I do an INCORRECT THING?? -% -Did I say I was a sardine? Or a bus??? -% -Did I SELL OUT yet?? -% -Did YOU find a DIGITAL WATCH in YOUR box of VELVEETA? -% -Did you move a lot of KOREAN STEAK KNIVES this trip, Dingy? -% -DIDI ... is that a MARTIAN name, or, are we in ISRAEL? -% -Didn't I buy a 1951 Packard from you last March in Cairo? -% -Disco oil bussing will create a throbbing naugahyde pipeline running -straight to the tropics from the rug producing regions and devalue the -dollar! -% -Do I have a lifestyle yet? -% -Do you guys know we just passed thru a BLACK HOLE in space? -% -Do you have exactly what I want in a plaid poindexter bar bat?? -% -Do you like "TENDER VITTLES"? -% -Do you think the "Monkees" should get gas on odd or even days? -% -Does someone from PEORIA have a SHORTER ATTENTION span than me? -% -does your DRESSING ROOM have enough ASPARAGUS? -% -DON'T go!! I'm not HOWARD COSELL!! I know POLISH JOKES ... WAIT!! -Don't go!! I AM Howard Cosell! ... And I DON'T know Polish jokes!! -% -Don't hit me!! I'm in the Twilight Zone!!! -% -Don't SANFORIZE me!! -% -Don't worry, nobody really LISTENS to lectures in MOSCOW, either! ... -FRENCH, HISTORY, ADVANCED CALCULUS, COMPUTER PROGRAMMING, BLACK -STUDIES, SOCIOBIOLOGY! ... Are there any QUESTIONS?? -% -Edwin Meese made me wear CORDOVANS!! -% -Eisenhower!! Your mimeograph machine upsets my stomach!! -% -Either CONFESS now or we go to "PEOPLE'S COURT"!! -% -Everybody gets free BORSCHT! -% -Everybody is going somewhere!! It's probably a garage sale or a -disaster Movie!! -% -Everywhere I look I see NEGATIVITY and ASPHALT ... -% -Excuse me, but didn't I tell you there's NO HOPE for the survival of -OFFSET PRINTING? -% -FEELINGS are cascading over me!!! -% -Finally, Zippy drives his 1958 RAMBLER METROPOLITAN into the faculty -dining room. -% -First, I'm going to give you all the ANSWERS to today's test ... So -just plug in your SONY WALKMANS and relax!! -% -FOOLED you! Absorb EGO SHATTERING impulse rays, polyester poltroon!! -% -for ARTIFICIAL FLAVORING!! -% -Four thousand different MAGNATES, MOGULS & NABOBS are romping in my -gothic solarium!! -% -FROZEN ENTREES may be flung by members of opposing SWANSON SECTS ... -% -FUN is never having to say you're SUSHI!! -% -Gee, I feel kind of LIGHT in the head now, knowing I can't make my -satellite dish PAYMENTS! -% -Gibble, Gobble, we ACCEPT YOU ... -% -Give them RADAR-GUIDED SKEE-BALL LANES and VELVEETA BURRITOS!! -% -Go on, EMOTE! I was RAISED on thought balloons!! -% -GOOD-NIGHT, everybody ... Now I have to go administer FIRST-AID to my -pet LEISURE SUIT!! -% -HAIR TONICS, please!! -% -Half a mind is a terrible thing to waste! -% -Hand me a pair of leather pants and a CASIO keyboard -- I'm living for -today! -% -Has everybody got HALVAH spread all over their ANKLES?? ... Now, it's -time to "HAVE A NAGEELA"!! -% -He is the MELBA-BEING ... the ANGEL CAKE ... XEROX him ... XEROX him -- -% -He probably just wants to take over my CELLS and then EXPLODE inside me -like a BARREL of runny CHOPPED LIVER! Or maybe he'd like to -PSYCHOLOGICALLY TERRORISE ME until I have no objection to a RIGHT-WING -MILITARY TAKEOVER of my apartment!! I guess I should call AL PACINO! -% -Hello? Enema Bondage? I'm calling because I want to be happy, I -guess ... -% -Hello. I know the divorce rate among unmarried Catholic Alaskan -females!! -% -Hello... IRON CURTAIN? Send over a SAUSAGE PIZZA! World War III? No -thanks! -% -Hello. Just walk along and try NOT to think about your INTESTINES -being almost FORTY YARDS LONG!! -% -HELLO, everybody, I'm a HUMAN!! -% -Hello, GORRY-O!! I'm a GENIUS from HARVARD!! -% -HELLO KITTY gang terrorizes town, family STICKERED to death! -% -Here I am at the flea market but nobody is buying my urine sample -bottles ... -% -Here I am in 53 B.C. and all I want is a dill pickle!! -% -Here I am in the POSTERIOR OLFACTORY LOBULE but I don't see CARL SAGAN -anywhere!! -% -Here we are in America ... when do we collect unemployment? -% -Hey, wait a minute!! I want a divorce!! ... you're not Clint Eastwood!! -% -Hey, waiter! I want a NEW SHIRT and a PONY TAIL with lemon sauce! -% -Hiccuping & trembling into the WASTE DUMPS of New Jersey like some -drunken CABBAGE PATCH DOLL, coughing in line at FIORUCCI'S!! -% -Hmmm ... a CRIPPLED ACCOUNTANT with a FALAFEL sandwich is HIT by a -TROLLEY-CAR ... -% -Hmmm ... A hash-singer and a cross-eyed guy were SLEEPING on a deserted -island, when ... -% -Hmmm ... a PINHEAD, during an EARTHQUAKE, encounters an ALL-MIDGET -FIDDLE ORCHESTRA ... ha ... ha ... -% -Hmmm ... an arrogant bouquet with a subtle suggestion of POLYVINYL -CHLORIDE ... -% -Hold the MAYO & pass the COSMIC AWARENESS ... -% -HOORAY, Ronald!! Now YOU can marry LINDA RONSTADT too!! -% -How do I get HOME? -% -How do you explain Wayne Newton's POWER over millions? It's th' -MOUSTACHE ... Have you ever noticed th' way it radiates SINCERITY, -HONESTY & WARMTH? It's a MOUSTACHE you want to take HOME and introduce -to NANCY SINATRA! -% -How many retired bricklayers from FLORIDA are out purchasing PENCIL -SHARPENERS right NOW?? -% -How's it going in those MODULAR LOVE UNITS?? -% -How's the wife? Is she at home enjoying capitalism? -% -hubub, hubub, HUBUB, hubub, hubub, hubub, HUBUB, hubub, hubub, hubub. -% -HUGH BEAUMONT died in 1982!! -% -HUMAN REPLICAS are inserted into VATS of NUTRITIONAL YEAST ... -% -I always have fun because I'm out of my mind!!! -% -I am a jelly donut. I am a jelly donut. -% -I am a traffic light, and Alan Ginzberg kidnapped my laundry in 1927! -% -I am covered with pure vegetable oil and I am writing a best seller! -% -I am deeply CONCERNED and I want something GOOD for BREAKFAST! -% -I am having FUN... I wonder if it's NET FUN or GROSS FUN? -% -I am NOT a nut.... -% -I appoint you ambassador to Fantasy Island!!! -% -I brought my BOWLING BALL -- and some DRUGS!! -% -I can't decide which WRONG TURN to make first!! -% -I can't decide which WRONG TURN to make first!! I wonder if BOB -GUCCIONE has these problems! -% -I can't think about that. It doesn't go with HEDGES in the shape of -LITTLE LULU -- or ROBOTS making BRICKS ... -% -I demand IMPUNITY! -% -I didn't order any WOO-WOO ... Maybe a YUBBA ... But no WOO-WOO! -% -I don't believe there really IS a GAS SHORTAGE ... I think it's all -just a BIG HOAX on the part of the plastic sign salesmen -- to sell -more numbers!! -% -I don't know WHY I said that ... I think it came from the FILLINGS in -my read molars ... -% -I don't understand the HUMOUR of the THREE STOOGES!! -% -I feel ... JUGULAR ... -% -I feel better about world problems now! -% -I feel like a wet parking meter on Darvon! -% -I feel like I am sharing a ``CORN-DOG'' with NIKITA KHRUSHCHEV ... -% -I feel like I'm in a Toilet Bowl with a thumbtack in my forehead!! -% -I feel partially hydrogenated! -% -I fill MY industrial waste containers with old copies of the -"WATCHTOWER" and then add HAWAIIAN PUNCH to the top ... They look NICE -in the yard ... -% -I guess it was all a DREAM ... or an episode of HAWAII FIVE-O ... -% -I guess you guys got BIG MUSCLES from doing too much STUDYING! -% -I had a lease on an OEDIPUS COMPLEX back in '81 ... -% -I had pancake makeup for brunch! -% -I have a TINY BOWL in my HEAD -% -I have a very good DENTAL PLAN. Thank you. -% -I have a VISION! It's a RANCID double-FISHWICH on an ENRICHED BUN!! -% -I have accepted Provolone into my life! -% -I have many CHARTS and DIAGRAMS.. -% -I have seen these EGG EXTENDERS in my Supermarket ... -% -I have seen these EGG EXTENDERS in my Supermarket ... I have read the -INSTRUCTIONS ... -% -I have the power to HALT PRODUCTION on all TEENAGE SEX COMEDIES!! -% -I HAVE to buy a new "DODGE MISER" and two dozen JORDACHE JEANS because -my viewscreen is "USER-FRIENDLY"!! -% -I haven't been married in over six years, but we had sexual counseling -every day from Oral Roberts!! -% -I hope I bought the right relish ... zzzzzzzzz ... -% -I hope something GOOD came in the mail today so I have a REASON to -live!! -% -I hope the ``Eurythmics'' practice birth control ... -% -I hope you millionaires are having fun! I just invested half your life -savings in yeast!! -% -I invented skydiving in 1989! -% -I joined scientology at a garage sale!! -% -I just forgot my whole philosophy of life!!! -% -I just got my PRINCE bumper sticker ... But now I can't remember WHO he -is ... -% -I just had a NOSE JOB!! -% -I just had my entire INTESTINAL TRACT coated with TEFLON! -% -I just heard the SEVENTIES were over!! And I was just getting in touch -with my LEISURE SUIT!! -% -I just remembered something about a TOAD! -% -I KAISER ROLL?! What good is a Kaiser Roll without a little COLE SLAW -on the SIDE? -% -I Know A Joke -% -I know how to do SPECIAL EFFECTS!! -% -I know things about TROY DONAHUE that can't even be PRINTED!! -% -I know th'MAMBO!! I have a TWO-TONE CHEMISTRY SET!! -% -I left my WALLET in the BATHROOM!! -% -I like the way ONLY their mouths move ... They look like DYING OYSTERS -% -I like your SNOOPY POSTER!! -% -I love ROCK 'N ROLL! I memorized the all WORDS to "WIPE-OUT" in -1965!! -% -I need to discuss BUY-BACK PROVISIONS with at least six studio -SLEAZEBALLS!! -% -I once decorated my apartment entirely in ten foot salad forks!! -% -I own seven-eighths of all the artists in downtown Burbank! -% -I put aside my copy of "BOWLING WORLD" and think about GUN CONTROL -legislation.. -% -I represent a sardine!! -% -I request a weekend in Havana with Phil Silvers! -% -I selected E5 ... but I didn't hear "Sam the Sham and the Pharoahs"! -% -I smell a RANCID CORN DOG! -% -I smell like a wet reducing clinic on Columbus Day! -% -I think I am an overnight sensation right now!! -% -I think I'll KILL myself by leaping out of this 14th STORY WINDOW while -reading ERICA JONG'S poetry!! -% -I think my career is ruined! -% -I used to be a FUNDAMENTALIST, but then I heard about the HIGH -RADIATION LEVELS and bought an ENCYCLOPEDIA!! -% -I want a VEGETARIAN BURRITO to go ... with EXTRA MSG!! -% -I want a WESSON OIL lease!! -% -I want another RE-WRITE on my CAESAR SALAD!! -% -I want EARS! I want two ROUND BLACK EARS to make me feel warm 'n -secure!! -% -I want the presidency so bad I can already taste the hors d'oeuvres. -% -I want to dress you up as TALLULAH BANKHEAD and cover you with VASELINE -and WHEAT THINS ... -% -I want to kill everyone here with a cute colorful Hydrogen Bomb!! -% -I want to perform cranial activities with Tuesday Weld!! -% -I want to read my new poem about pork brains and outer space ... -% -I want to so HAPPY, the VEINS in my neck STAND OUT!! -% -I want you to MEMORIZE the collected poems of EDNA ST VINCENT MILLAY -... BACKWARDS!! -% -I want you to organize my PASTRY trays ... my TEA-TINS are gleaming in -formation like a ROW of DRUM MAJORETTES -- please don't be FURIOUS with -me -- -% -I was born in a Hostess Cupcake factory before the sexual revolution! -% -I was making donuts and now I'm on a bus! -% -I wish I was a sex-starved manicurist found dead in the Bronx!! -% -I wish I was on a Cincinnati street corner holding a clean dog! -% -I wonder if BOB GUCCIONE has these problems! -% -I wonder if I could ever get started in the credit world? -% -I wonder if I ought to tell them about my PREVIOUS LIFE as a COMPLETE -STRANGER? -% -I wonder if I should put myself in ESCROW!! -% -I wonder if there's anything GOOD on tonight? -% -I would like to urinate in an OVULAR, porcelain pool -- -% -I'd like MY data-base JULIENNED and stir-fried! -% -I'd like some JUNK FOOD ... and then I want to be ALONE -- -% -If a person is FAMOUS in this country, they have to go on the ROAD for -MONTHS at a time and have their name misspelled on the SIDE of a -GREYHOUND SCENICRUISER!! -% -If elected, Zippy pledges to each and every American a 55-year-old -houseboy ... -% -If I am elected no one will ever have to do their laundry again! -% -If I am elected, the concrete barriers around the WHITE HOUSE will be -replaced by tasteful foam replicas of ANN MARGARET! -% -If I felt any more SOPHISTICATED I would DIE of EMBARRASSMENT! -% -If I had a Q-TIP, I could prevent th' collapse of NEGOTIATIONS!! -% -If I pull this SWITCH I'll be RITA HAYWORTH!! Or a SCIENTOLOGIST! -% -if it GLISTENS, gobble it!! -% -If our behavior is strict, we do not need fun! -% -If Robert De Niro assassinates Walter Slezak, will Jodie Foster marry -Bonzo?? -% -I'll eat ANYTHING that's BRIGHT BLUE!! -% -I'll show you MY telex number if you show me YOURS ... -% -I'm a fuschia bowling ball somewhere in Brittany -% -I'm a GENIUS! I want to dispute sentence structure with SUSAN -SONTAG!! -% -I'm a nuclear submarine under the polar ice cap and I need a Kleenex! -% -I'm also against BODY-SURFING!! -% -I'm also pre-POURED pre-MEDITATED and pre-RAPHAELITE!! -% -I'm ANN LANDERS!! I can SHOPLIFT!! -% -I'm changing the CHANNEL ... But all I get is commercials for "RONCO -MIRACLE BAMBOO STEAMERS"! -% -I'm continually AMAZED at th'breathtaking effects of WIND EROSION!! -% -I'm definitely not in Omaha! -% -I'm DESPONDENT ... I hope there's something DEEP-FRIED under this -miniature DOMED STADIUM ... -% -I'm dressing up in an ill-fitting IVY-LEAGUE SUIT!! Too late... -% -I'm EMOTIONAL now because I have MERCHANDISING CLOUT!! -% -I'm encased in the lining of a pure pork sausage!! -% -I'm GLAD I remembered to XEROX all my UNDERSHIRTS!! -% -I'm gliding over a NUCLEAR WASTE DUMP near ATLANTA, Georgia!! -% -I'm having a BIG BANG THEORY!! -% -I'm having a MID-WEEK CRISIS! -% -I'm having a RELIGIOUS EXPERIENCE ... and I don't take any DRUGS -% -I'm having a tax-deductible experience! I need an energy crunch!! -% -I'm having an emotional outburst!! -% -I'm having an EMOTIONAL OUTBURST!! But, uh, WHY is there a WAFFLE in -my PAJAMA POCKET?? -% -I'm having BEAUTIFUL THOUGHTS about the INSIPID WIVES of smug and -wealthy CORPORATE LAWYERS ... -% -I'm having fun HITCHHIKING to CINCINNATI or FAR ROCKAWAY!! -% -I'm in direct contact with many advanced fun CONCEPTS. -% -I'm into SOFTWARE! -% -I'm meditating on the FORMALDEHYDE and the ASBESTOS leaking into my -PERSONAL SPACE!! -% -I'm mentally OVERDRAWN! What's that SIGNPOST up ahead? Where's ROD -STERLING when you really need him? -% -I'm not an Iranian!! I voted for Dianne Feinstein!! -% -I'm not available for comment.. -% -I'm pretending I'm pulling in a TROUT! Am I doing it correctly?? -% -I'm pretending that we're all watching PHIL SILVERS instead of RICARDO -MONTALBAN! -% -I'm QUIETLY reading the latest issue of "BOWLING WORLD" while my wife -and two children stand QUIETLY BY ... -% -I'm rated PG-34!! -% -I'm receiving a coded message from EUBIE BLAKE!! -% -I'm RELIGIOUS!! I love a man with a HAIRPIECE!! Equip me with -MISSILES!! -% -I'm reporting for duty as a modern person. I want to do the Latin -Hustle now! -% -I'm shaving!! I'M SHAVING!! -% -I'm sitting on my SPEED QUEEN ... To me, it's ENJOYABLE ... I'm WARM -... I'm VIBRATORY ... -% -I'm thinking about DIGITAL READ-OUT systems and computer-generated -IMAGE FORMATIONS ... -% -I'm totally DESPONDENT over the LIBYAN situation and the price of -CHICKEN ... -% -I'm using my X-RAY VISION to obtain a rare glimpse of the INNER -WORKINGS of this POTATO!! -% -I'm wearing PAMPERS!! -% -I'm wet! I'm wild! -% -I'm young ... I'm HEALTHY ... I can HIKE THRU CAPT GROGAN'S LUMBAR -REGIONS! -% -I'm ZIPPY the PINHEAD and I'm totally committed to the festive mode. -% -In 1962, you could buy a pair of SHARKSKIN SLACKS, with a "Continental -Belt," for $10.99!! -% -In Newark the laundromats are open 24 hours a day! -% -INSIDE, I have the same personality disorder as LUCY RICARDO!! -% -Inside, I'm already SOBBING! -% -Is a tattoo real, like a curb or a battleship? Or are we suffering in -Safeway? -% -Is he the MAGIC INCA carrying a FROG on his shoulders?? Is the FROG -his GUIDELIGHT?? It is curious that a DOG runs already on the -ESCALATOR ... -% -Is it 1974? What's for SUPPER? Can I spend my COLLEGE FUND in one -wild afternoon?? -% -Is it clean in other dimensions? -% -Is it NOUVELLE CUISINE when 3 olives are struggling with a scallop in a -plate of SAUCE MORNAY? -% -Is something VIOLENT going to happen to a GARBAGE CAN? -% -Is this an out-take from the "BRADY BUNCH"? -% -Is this going to involve RAW human ecstasy? -% -Is this TERMINAL fun? -% -Is this the line for the latest whimsical YUGOSLAVIAN drama which also -makes you want to CRY and reconsider the VIETNAM WAR? -% -Isn't this my STOP?! -% -It don't mean a THING if you ain't got that SWING!! -% -It was a JOKE!! Get it?? I was receiving messages from DAVID -LETTERMAN!! YOW!! -% -It's a lot of fun being alive ... I wonder if my bed is made?!? -% -It's NO USE ... I've gone to "CLUB MED"!! -% -It's OBVIOUS ... The FURS never reached ISTANBUL ... You were an EXTRA -in the REMAKE of "TOPKAPI" ... Go home to your WIFE ... She's making -FRENCH TOAST! -% -It's OKAY -- I'm an INTELLECTUAL, too. -% -It's the RINSE CYCLE!! They've ALL IGNORED the RINSE CYCLE!! -% -I've got a COUSIN who works in the GARMENT DISTRICT ... -% -I've got an IDEA!! Why don't I STARE at you so HARD, you forget your -SOCIAL SECURITY NUMBER!! -% -I've read SEVEN MILLION books!! -% -JAPAN is a WONDERFUL planet -- I wonder if we'll ever reach their level -of COMPARATIVE SHOPPING ... -% -Jesuit priests are DATING CAREER DIPLOMATS!! -% -Jesus is my POSTMASTER GENERAL ... -% -Kids, don't gross me off ... "Adventures with MENTAL HYGIENE" can be -carried too FAR! -% -Kids, the seven basic food groups are GUM, PUFF PASTRY, PIZZA, -PESTICIDES, ANTIBIOTICS, NUTRA-SWEET and MILK DUDS!! -% -Laundry is the fifth dimension!! ... um ... um ... th' washing machine -is a black hole and the pink socks are bus drivers who just fell in!! -% -LBJ, LBJ, how many JOKES did you tell today??! -% -Leona, I want to CONFESS things to you ... I want to WRAP you in a -SCARLET ROBE trimmed with POLYVINYL CHLORIDE ... I want to EMPTY your -ASHTRAYS ... -% -Let me do my TRIBUTE to FISHNET STOCKINGS ... -% -Let's all show human CONCERN for REVEREND MOON's legal difficulties!! -% -Let's send the Russians defective lifestyle accessories! -% -Life is a POPULARITY CONTEST! I'm REFRESHINGLY CANDID!! -% -Like I always say -- nothing can beat the BRATWURST here in DUSSELDORF!! -% -Loni Anderson's hair should be LEGALIZED!! -% -Look! A ladder! Maybe it leads to heaven, or a sandwich! -% -LOOK!! Sullen American teens wearing MADRAS shorts and "Flock of -Seagulls" HAIRCUTS! -% -Look DEEP into the OPENINGS!! Do you see any ELVES or EDSELS ... or a -HIGHBALL?? ... -% -Look into my eyes and try to forget that you have a Macy's charge -card! -% -Make me look like LINDA RONSTADT again!! -% -Mary Tyler Moore's SEVENTH HUSBAND is wearing my DACRON TANK TOP in a -cheap hotel in HONOLULU! -% -Maybe we could paint GOLDIE HAWN a rich PRUSSIAN BLUE -- -% -MERYL STREEP is my obstetrician! -% -MMM-MM!! So THIS is BIO-NEBULATION! -% -Mmmmmm-MMMMMM!! A plate of STEAMING PIECES of a PIG mixed with the -shreds of SEVERAL CHICKENS!! ... Oh BOY!! I'm about to swallow a -TORN-OFF section of a COW'S LEFT LEG soaked in COTTONSEED OIL and -SUGAR!! ... Let's see ... Next, I'll have the GROUND-UP flesh of CUTE, -BABY LAMBS fried in the MELTED, FATTY TISSUES from a warm-blooded -animal someone once PETTED!! ... YUM!! That was GOOD!! For DESSERT, -I'll have a TOFU BURGER with BEAN SPROUTS on a stone-ground, WHOLE -WHEAT BUN!! -% -Mr and Mrs PED, can I borrow 26.7% of the RAYON TEXTILE production of -the INDONESIAN archipelago? -% -My Aunt MAUREEN was a military advisor to IKE & TINA TURNER!! -% -My BIOLOGICAL ALARM CLOCK just went off ... It has noiseless DOZE -FUNCTION and full kitchen!! -% -My CODE of ETHICS is vacationing at famed SCHROON LAKE in upstate New -York!! -% -My EARS are GONE!! -% -My face is new, my license is expired, and I'm under a doctor's -care!!!! -% -My haircut is totally traditional! -% -MY income is ALL disposable! -% -My LESLIE GORE record is BROKEN ... -% -My life is a patio of fun! -% -My mind is a potato field ... -% -My mind is making ashtrays in Dayton ... -% -My nose feels like a bad Ronald Reagan movie ... -% -my NOSE is NUMB! -% -My pants just went to high school in the Carlsbad Caverns!!! -% -My polyvinyl cowboy wallet was made in Hong Kong by Montgomery Clift! -% -My uncle Murray conquered Egypt in 53 B.C. And I can prove it too!! -% -My vaseline is RUNNING... -% -NANCY!! Why is everything RED?! -% -NATHAN ... your PARENTS were in a CARCRASH!! They're VOIDED -- They -COLLAPSED They had no CHAINSAWS ... They had no MONEY MACHINES ... They -did PILLS in SKIMPY GRASS SKIRTS ... Nathan, I EMULATED them ... but -they were OFF-KEY ... -% -NEWARK has been REZONED!! DES MOINES has been REZONED!! -% -Nipples, dimples, knuckles, NICKLES, wrinkles, pimples!! -% -Not SENSUOUS ... only "FROLICSOME" ... and in need of DENTAL WORK ... -in PAIN!!! -% -Now I am depressed ... -% -Now I think I just reached the state of HYPERTENSION that comes JUST -BEFORE you see the TOTAL at the SAFEWAY CHECKOUT COUNTER! -% -Now I understand the meaning of "THE MOD SQUAD"! -% -Now I'm being INVOLUNTARILY shuffled closer to the CLAM DIP with the -BROKEN PLASTIC FORKS in it!! -% -Now I'm concentrating on a specific tank battle toward the end of World -War II! -% -Now I'm having INSIPID THOUGHTS about the beautiful, round wives of -HOLLYWOOD MOVIE MOGULS encased in PLEXIGLASS CARS and being approached -by SMALL BOYS selling FRUIT ... -% -Now KEN and BARBIE are PERMANENTLY ADDICTED to MIND-ALTERING DRUGS ... -% -Now, let's SEND OUT for QUICHE!! -% -Now my EMOTIONAL RESOURCES are heavily committed to 23% of the SMELTING -and REFINING industry of the state of NEVADA!! -% -Now that I have my "APPLE", I comprehend COST ACCOUNTING!! -% -Of course, you UNDERSTAND about the PLAIDS in the SPIN CYCLE -- -% -Oh, I get it!! "The BEACH goes on", huh, SONNY?? -% -Oh my GOD -- the SUN just fell into YANKEE STADIUM!! -% -Okay ... I'm going home to write the "I HATE RUBIK's CUBE HANDBOOK FOR -DEAD CAT LOVERS" ... -% -OKAY!! Turn on the sound ONLY for TRYNEL CARPETING, FULLY-EQUIPPED -R.V.'S and FLOATATION SYSTEMS!! -% -OMNIVERSAL AWARENESS?? Oh, YEH!! First you need 4 GALLONS of JELL-O -and a BIG WRENCH!! ... I think you drop th'WRENCH in the JELL-O as if -it was a FLAVOR, or an INGREDIENT ... ... or ... I ... um ... WHERE'S -the WASHING MACHINES? -% -On SECOND thought, maybe I'll heat up some BAKED BEANS and watch REGIS -PHILBIN ... It's GREAT to be ALIVE!! -% -On the other hand, life can be an endless parade of TRANSSEXUAL -QUILTING BEES aboard a cruise ship to DISNEYWORLD if only we let it!! -% -On the road, ZIPPY is a pinhead without a purpose, but never without a -POINT. -% -Once, there was NO fun ... This was before MENU planning, FASHION -statements or NAUTILUS equipment ... Then, in 1985 ... FUN was -completely encoded in this tiny MICROCHIP ... It contain 14,768 vaguely -amusing SIT-COM pilots!! We had to wait FOUR BILLION years but we -finally got JERRY LEWIS, MTV and a large selection of creme-filled -snack cakes! -% -Once upon a time, four AMPHIBIOUS HOG CALLERS attacked a family of -DEFENSELESS, SENSITIVE COIN COLLECTORS and brought DOWN their PROPERTY -VALUES!! -% -ONE: I will donate my entire "BABY HUEY" comic book collection to - the downtown PLASMA CENTER ... -TWO: I won't START a BAND called "KHADAFY & THE HIT SQUAD" ... -THREE: I won't ever TUMBLE DRY my FOX TERRIER again!! -% -One FISHWICH coming up!! -% -Our father who art in heaven ... I sincerely pray that SOMEBODY at this -table will PAY for my SHREDDED WHAT and ENGLISH MUFFIN ... and also -leave a GENEROUS TIP .... -% -over in west Philadelphia a puppy is vomiting ... -% -OVER the underpass! UNDER the overpass! Around the FUTURE and BEYOND -REPAIR!! -% -PARDON me, am I speaking ENGLISH? -% -Pardon me, but do you know what it means to be TRULY ONE with your -BOOTH! -% -PEGGY FLEMMING is stealing BASKET BALLS to feed the babies in VERMONT. -% -PIZZA!! -% -Place me on a BUFFER counter while you BELITTLE several BELLHOPS in the -Trianon Room!! Let me one of your SUBSIDIARIES! -% -Please come home with me ... I have Tylenol!! -% -Psychoanalysis?? I thought this was a nude rap session!!! -% -PUNK ROCK!! DISCO DUCK!! BIRTH CONTROL!! -% -Quick, sing me the BUDAPEST NATIONAL ANTHEM!! -% -RELATIVES!! -% -Remember, in 2039, MOUSSE & PASTA will be available ONLY by -prescription!! -% -RHAPSODY in Glue! -% -SANTA CLAUS comes down a FIRE ESCAPE wearing bright blue LEG WARMERS -... He scrubs the POPE with a mild soap or detergent for 15 minutes, -starring JANE FONDA!! -% -Send your questions to ``ASK ZIPPY'', Box 40474, San Francisco, CA -94140, USA -% -SHHHH!! I hear SIX TATTOOED TRUCK-DRIVERS tossing ENGINE BLOCKS into -empty OIL DRUMS ... -% -Should I do my BOBBIE VINTON medley? -% -Should I get locked in the PRINCICAL'S OFFICE today -- or have a -VASECTOMY?? -% -Should I start with the time I SWITCHED personalities with a BEATNIK -hair stylist or my failure to refer five TEENAGERS to a good OCULIST? -% -Sign my PETITION. -% -So, if we convert SUPPLY-SIDE SOYABEAN FUTURES into HIGH-YIELD T-BILL -INDICATORS, the PRE-INFLATIONARY risks will DWINDLE to a rate of 2 -SHOPPING SPREES per EGGPLANT!! -% -So this is what it feels like to be potato salad -% -someone in DAYTON, Ohio is selling USED CARPETS to a SERBO-CROATIAN -% -Sometime in 1993 NANCY SINATRA will lead a BLOODLESS COUP on GUAM!! -% -Somewhere in DOWNTOWN BURBANK a prostitute is OVERCOOKING a LAMB -CHOP!! -% -Somewhere in suburban Honolulu, an unemployed bellhop is whipping up a -batch of illegal psilocybin chop suey!! -% -Somewhere in Tenafly, New Jersey, a chiropractor is viewing "Leave it -to Beaver"! -% -Spreading peanut butter reminds me of opera!! I wonder why? -% -TAILFINS!! ... click ... -% -TAPPING? You POLITICIANS! Don't you realize that the END of the "Wash -Cycle" is a TREASURED MOMENT for most people?! -% -Tex SEX! The HOME of WHEELS! The dripping of COFFEE!! Take me to -Minnesota but don't EMBARRASS me!! -% -Th' MIND is the Pizza Palace of th' SOUL -% -Thank god!! ... It's HENNY YOUNGMAN!! -% -The appreciation of the average visual graphisticator alone is worth -the whole suaveness and decadence which abounds!! -% -The entire CHINESE WOMEN'S VOLLEYBALL TEAM all share ONE personality -- -and have since BIRTH!! -% -The fact that 47 PEOPLE are yelling and sweat is cascading down my -SPINAL COLUMN is fairly enjoyable!! -% -The FALAFEL SANDWICH lands on my HEAD and I become a VEGETARIAN ... -% -The Korean War must have been fun. -% -The Osmonds! You are all Osmonds!! Throwing up on a freeway at -dawn!!! -% -The PILLSBURY DOUGHBOY is CRYING for an END to BURT REYNOLDS movies!! -% -The PINK SOCKS were ORIGINALLY from 1952!! But they went to MARS -around 1953!! -% -The SAME WAVE keeps coming in and COLLAPSING like a rayon MUU-MUU ... -% -There's a little picture of ED MCMAHON doing BAD THINGS to JOAN RIVERS -in a $200,000 MALIBU BEACH HOUSE!! -% -There's enough money here to buy 5000 cans of Noodle-Roni! -% -These PRESERVES should be FORCE-FED to PENTAGON OFFICIALS!! -% -They collapsed ... like nuns in the street ... they had no teen -appeal! -% -This ASEXUAL PIG really BOILS my BLOOD ... He's so ... so ... URGENT!! -% -This is a NO-FRILLS flight -- hold th' CANADIAN BACON!! -% -This MUST be a good party -- My RIB CAGE is being painfully pressed up -against someone's MARTINI!! -% -This PIZZA symbolizes my COMPLETE EMOTIONAL RECOVERY!! -% -This PORCUPINE knows his ZIPCODE ... And he has "VISA"!! -% -This TOPS OFF my partygoing experience! Someone I DON'T LIKE is -talking to me about a HEART-WARMING European film ... -% -Those aren't WINOS -- that's my JUGGLER, my AERIALIST, my SWORD -SWALLOWER, and my LATEX NOVELTY SUPPLIER!! -% -Thousands of days of civilians ... have produced a ... feeling for the -aesthetic modules -- -% -Today, THREE WINOS from DETROIT sold me a framed photo of TAB HUNTER -before his MAKEOVER! -% -Toes, knees, NIPPLES. Toes, knees, nipples, KNUCKLES ... -Nipples, dimples, knuckles, NICKLES, wrinkles, pimples!! -% -TONY RANDALL! Is YOUR life a PATIO of FUN?? -% -Uh-oh!! I forgot to submit to COMPULSORY URINALYSIS! -% -UH-OH!! I put on "GREAT HEAD-ON TRAIN COLLISIONS of the 50's" by -mistake!!! -% -UH-OH!! I think KEN is OVER-DUE on his R.V. PAYMENTS and HE'S having a -NERVOUS BREAKDOWN too!! Ha ha. -% -Uh-oh!! I'm having TOO MUCH FUN!! -% -UH-OH!! We're out of AUTOMOBILE PARTS and RUBBER GOODS! -% -Uh-oh -- WHY am I suddenly thinking of a VENERABLE religious leader -frolicking on a FORT LAUDERDALE weekend? -% -Used staples are good with SOY SAUCE! -% -VICARIOUSLY experience some reason to LIVE!! -% -Vote for ME -- I'm well-tapered, half-cocked, ill-conceived and -TAX-DEFERRED! -% -Wait ... is this a FUN THING or the END of LIFE in Petticoat -Junction?? -% -Was my SOY LOAF left out in th'RAIN? It tastes REAL GOOD!! -% -We are now enjoying total mutual interaction in an imaginary hot -tub ... -% -We have DIFFERENT amounts of HAIR -- -% -We just joined the civil hair patrol! -% -We place two copies of PEOPLE magazine in a DARK, HUMID mobile home. -45 minutes later CYNDI LAUPER emerges wearing a BIRD CAGE on her head! -% -Well, here I am in AMERICA.. I LIKE it. I HATE it. I LIKE it. I -HATE it. I LIKE it. I HATE it. I LIKE it. I HATE it. I LIKE ... -EMOTIONS are SWEEPING over me!! -% -Well, I'm a classic ANAL RETENTIVE!! And I'm looking for a way to -VICARIOUSLY experience some reason to LIVE!! -% -Well, I'm INVISIBLE AGAIN ... I might as well pay a visit to the LADIES -ROOM ... -% -Well, O.K. I'll compromise with my principles because of EXISTENTIAL -DESPAIR! -% -Were these parsnips CORRECTLY MARINATED in TACO SAUCE? -% -What a COINCIDENCE! I'm an authorized "SNOOTS OF THE STARS" dealer!! -% -What GOOD is a CARDBOARD suitcase ANYWAY? -% -What I need is a MATURE RELATIONSHIP with a FLOPPY DISK ... -% -What I want to find out is -- do parrots know much about Astro-Turf? -% -What PROGRAM are they watching? -% -What UNIVERSE is this, please?? -% -What's the MATTER Sid? ... Is your BEVERAGE unsatisfactory? -% -When I met th'POPE back in '58, I scrubbed him with a MILD SOAP or -DETERGENT for 15 minutes. He seemed to enjoy it ... -% -When this load is DONE I think I'll wash it AGAIN ... -% -When you get your PH.D. will you get able to work at BURGER KING? -% -When you said "HEAVILY FORESTED" it reminded me of an overdue CLEANING -BILL ... Don't you SEE? O'Grogan SWALLOWED a VALUABLE COIN COLLECTION -and HAD to murder the ONLY MAN who KNEW!! -% -Where do your SOCKS go when you lose them in th' WASHER? -% -Where does it go when you flush? -% -Where's SANDY DUNCAN? -% -Where's th' DAFFY DUCK EXHIBIT?? -% -Where's the Coke machine? Tell me a joke!! -% -While my BRAINPAN is being refused service in BURGER KING, Jesuit -priests are DATING CAREER DIPLOMATS!! -% -While you're chewing, think of STEVEN SPIELBERG'S bank account ... his -will have the same effect as two "STARCH BLOCKERS"! -% -WHO sees a BEACH BUNNY sobbing on a SHAG RUG?! -% -WHOA!! Ken and Barbie are having TOO MUCH FUN!! It must be the -NEGATIVE IONS!! -% -Why are these athletic shoe salesmen following me?? -% -Why don't you ever enter and CONTESTS, Marvin?? Don't you know your -own ZIPCODE? -% -Why is everything made of Lycra Spandex? -% -Why is it that when you DIE, you can't take your HOME ENTERTAINMENT -CENTER with you?? -% -Will it improve my CASH FLOW? -% -Will the third world war keep "Bosom Buddies" off the air? -% -Will this never-ending series of PLEASURABLE EVENTS never cease? -% -With YOU, I can be MYSELF ... We don't NEED Dan Rather ... -% -World War III? No thanks! -% -World War Three can be averted by adherence to a strictly enforced -dress code! -% -Wow! Look!! A stray meatball!! Let's interview it! -% -Xerox your lunch and file it under "sex offenders"! -% -Yes, but will I see the EASTER BUNNY in skintight leather at an IRON -MAIDEN concert? -% -YOU!! Give me the CUTEST, PINKEST, most charming little VICTORIAN -DOLLHOUSE you can find!! An make it SNAPPY!! -% -You can't hurt me!! I have an ASSUMABLE MORTGAGE!! -% -You mean now I can SHOOT YOU in the back and further BLUR th' -distinction between FANTASY and REALITY? -% -You mean you don't want to watch WRESTLING from ATLANTA? -% -YOU PICKED KARL MALDEN'S NOSE!! -% -You should all JUMP UP AND DOWN for TWO HOURS while I decide on a NEW -CAREER!! -% -You were s'posed to laugh! -% -Your CHEEKS sit like twin NECTARINES above a MOUTH that knows no BOUNDS -- -% -Youth of today! Join me in a mass rally for traditional mental -attitudes! -% -Yow! -% -Yow! Am I having fun yet? -% -Yow! Am I in Milwaukee? -% -Yow! And then we could sit on the hoods of cars at stop lights! -% -Yow! Are we laid back yet? -% -Yow! Are we wet yet? -% -Yow! Are you the self-frying president? -% -Yow! Did something bad happen or am I in a drive-in movie?? -% -YOW!! Everybody out of the GENETIC POOL! -% -YOW!!! I am having fun!!! -% -Yow! I just went below the poverty line! -% -Yow! I threw up on my window! -% -Yow! I want my nose in lights! -% -Yow! I want to mail a bronzed artichoke to Nicaragua! -% -Yow! I'm having a quadrophonic sensation of two winos alone in a steel -mill! -% -Yow! I'm imagining a surfer van filled with soy sauce! -% -YOW!! I'm in a very clever and adorable INSANE ASYLUM!! -% -Yow! Is my fallout shelter termite proof? -% -Yow! Is this sexual intercourse yet?? Is it, huh, is it?? -% -Yow! It's a hole all the way to downtown Burbank! -% -Yow! It's some people inside the wall! This is better than mopping! -% -Yow! Maybe I should have asked for my Neutron Bomb in PAISLEY -- -% -Yow! Now I get to think about all the BAD THINGS I did to a BOWLING -BALL when I was in JUNIOR HIGH SCHOOL! -% -YOW!! Now I understand advanced MICROBIOLOGY and th' new TAX REFORM -laws!! -% -Yow! Now we can become alcoholics! -% -YOW!! The land of the rising SONY!! -% -Yow! Those people look exactly like Donnie and Marie Osmond!! -% -YOW!! Up ahead! It's a DONUT HUT!! -% -Yow! We're going to a new disco! -% -YOW!! What should the entire human race DO?? Consume a fifth of -CHIVAS REGAL, ski NUDE down MT. EVEREST, and have a wild SEX WEEKEND! -% -Zippy's brain cells are straining to bridge synapses ... -% diff --git a/usr.bin/fortune/datfiles/zippy.sp.ok b/usr.bin/fortune/datfiles/zippy.sp.ok deleted file mode 100644 index b2f3fff9a251..000000000000 --- a/usr.bin/fortune/datfiles/zippy.sp.ok +++ /dev/null @@ -1,211 +0,0 @@ -# $FreeBSD$ -ANAL -ASEXUAL -Astro -B.C -BANKHEAD -BI -BIO -BORSCHT -BRAINPAN -BURRITO -BURRITOS -Barbie -Bo -Bonzo -CARCRASH -CASIO -CHAINSAWS -CHIVAS -COM -CORDOVANS -COSELL -CROATIAN -Carlsbad -Clift -Cosell -Cupcake -DAQUIRI -DELI -DIDI -DISCO -DISNEYWORLD -DONUT -DOUGHBOY -Darvon -Di -Disco -Donnie -EDSELS -EMOTE -EUBIE -Enema -FALAFEL -FISHNET -FISHWICH -FLEMMING -FLOATATION -FROLICSOME -Feinstein -GOLDIE -GORRY -GUCCIONE -GUIDELIGHT -Gibble -Ginzberg -HAIRPIECE -HAWN -HAYWORTH -HITCHHIKING -HOAX -HOUSECAT -Hmmm -I.Q -INTESTINAL -Iranian -JELL -JELLO -JILLIAN'S -JULIENNED -Jodie -KATRINKA -KNOCKWURST -LBJ -LING -LONI -LUGOSI -Loni -Lycra -MALIBU -MCMAHON -MELBA -MERYL -MMM -MOGULS -MONTALBAN'S -MOUSSE -MSG -MT -MTV -MYSTERIANS -Macy's -Meese -Monkees -NABOBS -NAGEELA -NEBULATION -NICKLES -NUTRA -Niro -OLFACTORY -OMNIVERSAL -OVULAR -Osmond -Osmonds -PAISLEY -PASTA -PG -Pharoahs -Provolone -R.V.'S -RAPHAELITE -RICARDO -RITA -Rom -Roni -SAGAN -SANFORIZE -SCHROON -SCIENTOLOGIST -SERBO -SHOPLIFT -SINATRA -SKEE -SODOMIZE -SONTAG -STREEP -Safeway -Slezak -Spandex -T.V -TACO -TAILFINS -TALLULAH -TINA -TRANSSEXUAL -TRYNEL -Tenafly -Tex -Th -Tylenol -Uh -VASELINE -VELVEETA -WESSON -YEH -YUBBA -Yum -ZIPPY -Zippy -Zippy's -barbequeued -chr -co -cranial -creme -devalue -disco -donut -donuts -dusenjet -einem -einige -frolicking -fuschia -gladiatoren -gothic -graphisticator -hors -houseboy -ich -im -jahr -kidnapped -lande -laundromat -laundromats -lesbian -li'l -manicurist -matic -meatball -meltdown -naugahyde -obstetrician -poindexter -pre -psilocybin -quaaludes -quadrophonic -rieche -s'posed -scientology -skintight -skydiving -solarium -spielen -telex -th -th'HOLIDAY -th'MAMBO -th'RAIN -th'WRENCH -th'cute -thru -thumbtack -uh -um -urinate -vaseline -vor -zzzzzzzzz diff --git a/usr.bin/mail/mail.1 b/usr.bin/mail/mail.1 index 54966d9fa9fe..b2f03bd4a908 100644 --- a/usr.bin/mail/mail.1 +++ b/usr.bin/mail/mail.1 @@ -327,9 +327,6 @@ but any reply returned to the machine will have the system wide alias expanded as all mail goes through .Xr sendmail 8 . .Ss "Network Mail (ARPA, UUCP, Berknet)" -See -.Xr mailaddr 7 -for a description of network addresses. .Pp The .Nm @@ -1245,11 +1242,7 @@ if it exists. .Xr newaliases 1 , .Xr vacation 1 , .Xr aliases 5 , -.Xr mailaddr 7 , .Xr sendmail 8 -.Rs -.%T "The Mail Reference Manual" -.Re .Sh HISTORY A .Nm diff --git a/usr.bin/rctl/rctl.c b/usr.bin/rctl/rctl.c index 4b3b8e18f936..05809d39eb26 100644 --- a/usr.bin/rctl/rctl.c +++ b/usr.bin/rctl/rctl.c @@ -586,7 +586,7 @@ usage(void) } int -main(int argc __unused, char **argv __unused) +main(int argc, char **argv) { int ch, aflag = 0, hflag = 0, nflag = 0, lflag = 0, rflag = 0, uflag = 0; diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index 34fd9d82d168..13e4e38f14a2 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -1059,7 +1059,7 @@ dosum(void) sum.v_vnodepgsin); xo_emit("{:vnode-page-outs/%9u} {N:vnode pager pageouts}\n", sum.v_vnodeout); - xo_emit("{:vnode-page-outs/%9u} {N:vnode pager pages paged out}\n", + xo_emit("{:vnode-page-out-pages/%9u} {N:vnode pager pages paged out}\n", sum.v_vnodepgsout); xo_emit("{:page-daemon-wakeups/%9u} {N:page daemon wakeups}\n", sum.v_pdwakeups); diff --git a/usr.bin/zstd/Makefile b/usr.bin/zstd/Makefile index 8499b65a0dde..73bcbbcc371c 100644 --- a/usr.bin/zstd/Makefile +++ b/usr.bin/zstd/Makefile @@ -7,11 +7,11 @@ SRCS= bench.c \ fileio.c \ zstdcli.c -CFLAGS+= -I${SRCTOP}/contrib/zstd/programs \ - -I${SRCTOP}/contrib/zstd/lib/common \ - -I${SRCTOP}/contrib/zstd/lib/compress \ - -I${SRCTOP}/contrib/zstd/lib/dictBuilder \ - -I${SRCTOP}/contrib/zstd/lib \ +CFLAGS+= -I${SRCTOP}/sys/contrib/zstd/programs \ + -I${SRCTOP}/sys/contrib/zstd/lib/common \ + -I${SRCTOP}/sys/contrib/zstd/lib/compress \ + -I${SRCTOP}/sys/contrib/zstd/lib/dictBuilder \ + -I${SRCTOP}/sys/contrib/zstd/lib \ -DXXH_NAMESPACE=ZSTD_ \ -DHAVE_THREAD=1 \ -DZSTD_MULTITHREAD=1 @@ -25,6 +25,6 @@ MLINKS= zstd.1 unzstd.1 \ WARNS= 2 LIBADD= zstd -.PATH: ${SRCTOP}/contrib/zstd/programs +.PATH: ${SRCTOP}/sys/contrib/zstd/programs .include diff --git a/usr.sbin/bhyve/uart_emul.c b/usr.sbin/bhyve/uart_emul.c index 94ac89daca97..2c95523f417b 100644 --- a/usr.sbin/bhyve/uart_emul.c +++ b/usr.sbin/bhyve/uart_emul.c @@ -678,20 +678,24 @@ uart_set_backend(struct uart_softc *sc, const char *opts) if (retval == 0) retval = fcntl(sc->tty.fd, F_SETFL, O_NONBLOCK); + if (retval == 0) { #ifndef WITHOUT_CAPSICUM - cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, CAP_WRITE); - if (cap_rights_limit(sc->tty.fd, &rights) == -1 && errno != ENOSYS) - errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (cap_ioctls_limit(sc->tty.fd, cmds, nitems(cmds)) == -1 && errno != ENOSYS) - errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (!uart_stdio) { - if (caph_limit_stdin() == -1 && errno != ENOSYS) + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, + CAP_WRITE); + if (cap_rights_limit(sc->tty.fd, &rights) == -1 && + errno != ENOSYS) errx(EX_OSERR, "Unable to apply rights for sandbox"); - } + if (cap_ioctls_limit(sc->tty.fd, cmds, nitems(cmds)) == -1 && + errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (!uart_stdio) { + if (caph_limit_stdin() == -1 && errno != ENOSYS) + errx(EX_OSERR, + "Unable to apply rights for sandbox"); + } #endif - - if (retval == 0) uart_opentty(sc); + } return (retval); } diff --git a/usr.sbin/bhyveload/Makefile b/usr.sbin/bhyveload/Makefile index f0241b84f43b..48bed64c26e4 100644 --- a/usr.sbin/bhyveload/Makefile +++ b/usr.sbin/bhyveload/Makefile @@ -9,6 +9,6 @@ LIBADD= vmmapi WARNS?= 3 -CFLAGS+=-I${SRCTOP}/sys/boot/userboot +CFLAGS+=-I${SRCTOP}/stand/userboot .include diff --git a/usr.sbin/efivar/Makefile b/usr.sbin/efivar/Makefile index 89d453eeb962..92f8a70b1c95 100644 --- a/usr.sbin/efivar/Makefile +++ b/usr.sbin/efivar/Makefile @@ -7,7 +7,7 @@ LIBADD= efivar SRCS= efivar.c efiutil.c -EFIBOOT=${SRCTOP}/sys/boot/efi +EFIBOOT=${SRCTOP}/stand/efi CFLAGS+= -I${EFIBOOT}/include .include diff --git a/usr.sbin/efivar/efivar.c b/usr.sbin/efivar/efivar.c index d156f78f1851..25eb8415b5a5 100644 --- a/usr.sbin/efivar/efivar.c +++ b/usr.sbin/efivar/efivar.c @@ -147,7 +147,7 @@ write_variable(char *name, char *val) breakdown_name(name, &guid, &vname); data = get_value(val, &datalen); - if (efi_set_variable(guid, vname, data, datalen, attrib, 0) < 0) + if (efi_set_variable(guid, vname, data, datalen, attrib) < 0) err(1, "efi_set_variable"); } diff --git a/usr.sbin/jail/command.c b/usr.sbin/jail/command.c index f95344cfe4e2..bf6e96da0c88 100644 --- a/usr.sbin/jail/command.c +++ b/usr.sbin/jail/command.c @@ -432,7 +432,7 @@ run_command(struct cfjail *j) argv[argc] = down ? "-alias" : "alias"; argv[argc + 1] = NULL; - break; + break; #endif case IP_VNET_INTERFACE: @@ -603,13 +603,13 @@ run_command(struct cfjail *j) bg = 1; } comcs = alloca(comstring->len + 1); - strcpy(comcs, comstring->s); + strcpy(comcs, comstring->s); argc = 0; for (cs = strtok(comcs, " \t\f\v\r\n"); cs; cs = strtok(NULL, " \t\f\v\r\n")) argc++; argv = alloca((argc + 1) * sizeof(char *)); - strcpy(comcs, comstring->s); + strcpy(comcs, comstring->s); argc = 0; for (cs = strtok(comcs, " \t\f\v\r\n"); cs; cs = strtok(NULL, " \t\f\v\r\n")) diff --git a/usr.sbin/jail/jail.8 b/usr.sbin/jail/jail.8 index 166c79b8b0b0..7a6f1d7d0c38 100644 --- a/usr.sbin/jail/jail.8 +++ b/usr.sbin/jail/jail.8 @@ -483,7 +483,7 @@ and uname -K. Some restrictions of the jail environment may be set on a per-jail basis. With the exception of -.Va allow.set_hostname +.Va allow.set_hostname and .Va allow.reserved_ports , these boolean parameters are off by default. @@ -614,7 +614,7 @@ Sockets within a jail are normally restricted to IPv4, IPv6, local (UNIX), and route. This allows access to other protocol stacks that have not had jail functionality added to them. .It Va allow.reserved_ports -The jail root may bind to ports lower than 1024. +The jail root may bind to ports lower than 1024. .El .El .Pp diff --git a/usr.sbin/jail/jail.c b/usr.sbin/jail/jail.c index 24f4536b53f3..c28278366f15 100644 --- a/usr.sbin/jail/jail.c +++ b/usr.sbin/jail/jail.c @@ -94,7 +94,7 @@ static const enum intparam startcommands[] = { IP_MOUNT_DEVFS, IP_MOUNT_FDESCFS, IP_MOUNT_PROCFS, - IP_EXEC_PRESTART, + IP_EXEC_PRESTART, IP__OP, IP_VNET_INTERFACE, IP_EXEC_START, @@ -269,7 +269,7 @@ main(int argc, char **argv) &sysval, &sysvallen, NULL, 0) == 0) add_param(NULL, NULL, perm_sysctl[pi].ipnum, - (sysval ? 1 : 0) ^ + (sysval ? 1 : 0) ^ perm_sysctl[pi].rev ? NULL : "false"); } diff --git a/usr.sbin/jexec/jexec.c b/usr.sbin/jexec/jexec.c index f8974dc4e916..28ae794bb734 100644 --- a/usr.sbin/jexec/jexec.c +++ b/usr.sbin/jexec/jexec.c @@ -187,5 +187,5 @@ usage(void) fprintf(stderr, "%s\n", "usage: jexec [-l] [-u username | -U username] jail [command ...]"); - exit(1); + exit(1); }