From owner-svn-src-all@FreeBSD.ORG Sun Sep 18 11:07:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EC5D106564A; Sun, 18 Sep 2011 11:07:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D9C58FC0A; Sun, 18 Sep 2011 11:07:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8IB7qip030073; Sun, 18 Sep 2011 11:07:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8IB7qw0030070; Sun, 18 Sep 2011 11:07:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201109181107.p8IB7qw0030070@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 18 Sep 2011 11:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225649 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Sep 2011 11:07:52 -0000 Author: kib Date: Sun Sep 18 11:07:51 2011 New Revision: 225649 URL: http://svn.freebsd.org/changeset/base/225649 Log: Welcome Robert Millan. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Sun Sep 18 09:42:21 2011 (r225648) +++ svnadmin/conf/access Sun Sep 18 11:07:51 2011 (r225649) @@ -194,6 +194,7 @@ rdivacky remko rik rmacklem +rmh rnoland roberto rodrigc Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Sun Sep 18 09:42:21 2011 (r225648) +++ svnadmin/conf/mentors Sun Sep 18 11:07:51 2011 (r225649) @@ -27,6 +27,7 @@ nork imp randi cperciva ray adrian rdivacky rpaulo +rmh adrian Co-mentor: kib sbruno scottl snb dwmalone sson gnn From owner-svn-src-all@FreeBSD.ORG Mon Sep 19 05:12:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C73C2106564A; Mon, 19 Sep 2011 05:12:53 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5AFC8FC0A; Mon, 19 Sep 2011 05:12:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8J5CrFq064600; Mon, 19 Sep 2011 05:12:53 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8J5CrX2064588; Mon, 19 Sep 2011 05:12:53 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201109190512.p8J5CrX2064588@svn.freebsd.org> From: Josh Paetzel Date: Mon, 19 Sep 2011 05:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225657 - in head/usr.sbin/pc-sysinstall: backend backend-partmanager examples X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2011 05:12:54 -0000 Author: jpaetzel Date: Mon Sep 19 05:12:53 2011 New Revision: 225657 URL: http://svn.freebsd.org/changeset/base/225657 Log: Fix a logic bug in pc-sysinstall creating partitions. Improve exit when an error occurs. Fix parsing to grab values which contain extra '=' signs. Fix a bug setting the timezone properly. Fix a usage bug when setting up with gmirror. Allow a uzip file from local media to be used. Allow specifying flags for "newfs" when using UFS as the file system. Run custom commands after doing final cleanup / fstab generation and such. Also fix using relative path for config file. Approved by: re (bz) Modified: head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh head/usr.sbin/pc-sysinstall/backend/functions-disk.sh head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh head/usr.sbin/pc-sysinstall/backend/functions-localize.sh head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh head/usr.sbin/pc-sysinstall/backend/functions-parse.sh head/usr.sbin/pc-sysinstall/backend/functions-unmount.sh head/usr.sbin/pc-sysinstall/backend/functions.sh head/usr.sbin/pc-sysinstall/backend/parseconfig.sh head/usr.sbin/pc-sysinstall/examples/README Modified: head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh Mon Sep 19 04:08:52 2011 (r225656) +++ head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh Mon Sep 19 05:12:53 2011 (r225657) @@ -90,7 +90,7 @@ if [ $? -eq 0 -a "${SLICENUM}" = "1" ] ; fi # If we have a starting block, use it -if [ -z "$STARTBLOCK" ] ; then +if [ -n "$STARTBLOCK" ] ; then sBLOCK="-b $STARTBLOCK" fi Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Mon Sep 19 04:08:52 2011 (r225656) +++ head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Mon Sep 19 05:12:53 2011 (r225657) @@ -45,7 +45,6 @@ check_for_enc_pass() }; # On check on the disk-label line if we have any extra vars for this device -# Only enabled for ZFS devices now, may add other xtra options in future for other FS's get_fs_line_xvars() { ACTIVEDEV="${1}" @@ -76,6 +75,15 @@ get_fs_line_xvars() return fi # End of ZFS block + # See if we are looking for UFS specific newfs options + echo $LINE | grep -q '^UFS' 2>/dev/null + if [ $? -eq 0 ] ; then + FSVARS="`echo $LINE | cut -d '(' -f 2- | cut -d ')' -f 1 | xargs`" + VAR="${FSVARS}" + export VAR + return + fi + fi # End of xtra-options block # If we got here, set VAR to empty and export @@ -278,7 +286,7 @@ setup_gpart_partitions() # Check if using zfs mirror echo ${XTRAOPTS} | grep -q "mirror" 2>/dev/null - if [ $? -eq 0 ] ; then + if [ $? -eq 0 -a "$FS" = "ZFS" ] ; then if [ "${_pType}" = "gpt" ] ; then XTRAOPTS=$(setup_zfs_mirror_parts "$XTRAOPTS" "${_pDisk}p${CURPART}") else Modified: head/usr.sbin/pc-sysinstall/backend/functions-disk.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Mon Sep 19 04:08:52 2011 (r225656) +++ head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Mon Sep 19 05:12:53 2011 (r225657) @@ -554,7 +554,7 @@ init_gmirror() local _mDisk=$3 # Create this mirror device - rc_halt "gmirror label -vb ${_mBal} gm${_mNum} /dev/${_mDisk}" + rc_halt "gmirror label -vb ${_mBal} gm${_mNum} ${_mDisk}" sleep 3 Modified: head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh Mon Sep 19 04:08:52 2011 (r225656) +++ head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh Mon Sep 19 05:12:53 2011 (r225657) @@ -55,6 +55,10 @@ start_extract_uzip_tar() case ${PACKAGETYPE} in uzip) + if ! kldstat -v | grep -q "geom_uzip" ; then + exit_err "Kernel module geom_uzip not loaded" + fi + # Start by mounting the uzip image MDDEVICE=`mdconfig -a -t vnode -o readonly -f ${INSFILE}` mkdir -p ${FSMNT}.uzip @@ -435,6 +439,16 @@ init_extraction() rsync) start_rsync_copy ;; image) start_image_install ;; + local) + get_value_from_cfg localPath + if [ -z "$VAL" ] + then + exit_err "Install medium was set to local, but no localPath was provided!" + fi + LOCALPATH=$VAL + INSFILE="${LOCALPATH}/${INSFILE}" ; export INSFILE + start_extract_uzip_tar + ;; *) exit_err "ERROR: Unknown install medium" ;; esac Modified: head/usr.sbin/pc-sysinstall/backend/functions-localize.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-localize.sh Mon Sep 19 04:08:52 2011 (r225656) +++ head/usr.sbin/pc-sysinstall/backend/functions-localize.sh Mon Sep 19 05:12:53 2011 (r225657) @@ -509,7 +509,7 @@ run_localize() # Check if we need to set a timezone - echo $line | -q grep "^timeZone=" 2>/dev/null + echo $line | grep -q "^timeZone=" 2>/dev/null if [ $? -eq 0 ] ; then get_value_from_string "$line" set_timezone "$VAL" Modified: head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh Mon Sep 19 04:08:52 2011 (r225656) +++ head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh Mon Sep 19 05:12:53 2011 (r225657) @@ -138,7 +138,7 @@ setup_filesystems() UFS) echo_log "NEWFS: ${PARTDEV} - ${PARTFS}" sleep 2 - rc_halt "newfs ${PARTDEV}${EXT}" + rc_halt "newfs ${PARTXTRAOPTS} ${PARTDEV}${EXT}" sleep 2 rc_halt "sync" rc_halt "glabel label ${PARTLABEL} ${PARTDEV}${EXT}" @@ -154,7 +154,7 @@ setup_filesystems() UFS+S) echo_log "NEWFS: ${PARTDEV} - ${PARTFS}" sleep 2 - rc_halt "newfs -U ${PARTDEV}${EXT}" + rc_halt "newfs ${PARTXTRAOPTS} -U ${PARTDEV}${EXT}" sleep 2 rc_halt "sync" rc_halt "glabel label ${PARTLABEL} ${PARTDEV}${EXT}" @@ -169,7 +169,7 @@ setup_filesystems() UFS+SUJ) echo_log "NEWFS: ${PARTDEV} - ${PARTFS}" sleep 2 - rc_halt "newfs -U ${PARTDEV}${EXT}" + rc_halt "newfs ${PARTXTRAOPTS} -U ${PARTDEV}${EXT}" sleep 2 rc_halt "sync" rc_halt "tunefs -j enable ${PARTDEV}${EXT}" @@ -192,7 +192,7 @@ setup_filesystems() sleep 2 rc_halt "gjournal label -f ${PARTDEV}${EXT}" sleep 2 - rc_halt "newfs -O 2 -J ${PARTDEV}${EXT}.journal" + rc_halt "newfs ${PARTXTRAOPTS} -O 2 -J ${PARTDEV}${EXT}.journal" sleep 2 rc_halt "sync" rc_halt "glabel label ${PARTLABEL} ${PARTDEV}${EXT}.journal" Modified: head/usr.sbin/pc-sysinstall/backend/functions-parse.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-parse.sh Mon Sep 19 04:08:52 2011 (r225656) +++ head/usr.sbin/pc-sysinstall/backend/functions-parse.sh Mon Sep 19 05:12:53 2011 (r225657) @@ -33,7 +33,7 @@ get_value_from_string() { if [ -n "${1}" ] then - export VAL="`echo ${1} | cut -d '=' -f 2`" + export VAL="`echo ${1} | cut -d '=' -f 2-15`" else echo "Error: Did we forgot to supply a string to parse?" exit 1 @@ -45,7 +45,7 @@ get_value_from_cfg_with_spaces() { if [ -n "${1}" ] then - export VAL=`grep "^${1}=" ${CFGF} | head -n 1 | cut -d '=' -f 2` + export VAL=`grep "^${1}=" ${CFGF} | head -n 1 | cut -d '=' -f 2-15` else exit_err "Error: Did we forgot to supply a setting to grab?" fi @@ -57,7 +57,7 @@ get_value_from_cfg() { if [ -n "${1}" ] then - export VAL=`grep "^${1}=" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '` + export VAL=`grep "^${1}=" ${CFGF} | head -n 1 | cut -d '=' -f 2-15 | tr -d ' '` else exit_err "Error: Did we forgot to supply a setting to grab?" fi Modified: head/usr.sbin/pc-sysinstall/backend/functions-unmount.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-unmount.sh Mon Sep 19 04:08:52 2011 (r225656) +++ head/usr.sbin/pc-sysinstall/backend/functions-unmount.sh Mon Sep 19 05:12:53 2011 (r225657) @@ -176,35 +176,35 @@ unmount_all_filesystems_failure() then if [ "${PARTENC}" = "ON" ] then - rc_nohalt "swapoff ${PARTDEV}.eli" + swapoff ${PARTDEV}.eli >/dev/null 2>/dev/null else - rc_nohalt "swapoff ${PARTDEV}" + swapoff ${PARTDEV} >/dev/null 2>/dev/null fi fi # Check if we've found "/" again, don't need to mount it twice if [ "$PARTMNT" != "/" -a "${PARTMNT}" != "none" -a "${PARTFS}" != "ZFS" ] then - rc_nohalt "umount -f ${PARTDEV}" - rc_nohalt "umount -f ${FSMNT}${PARTMNT}" + umount -f ${PARTDEV} >/dev/null 2>/dev/null + umount -f ${FSMNT}${PARTMNT} >/dev/null 2>/dev/null fi done # Last lets the /mnt partition ######################################################### - rc_nohalt "umount -f ${FSMNT}" + umount -f ${FSMNT} >/dev/null 2>/dev/null fi else # We are doing a upgrade, try unmounting any of these filesystems - chroot ${FSMNT} /sbin/umount -a >>${LOGOUT} >>${LOGOUT} - umount -f ${FSMNT}/usr >>${LOGOUT} 2>>${LOGOUT} - umount -f ${FSMNT}/dev >>${LOGOUT} 2>>${LOGOUT} - umount -f ${FSMNT} >>${LOGOUT} 2>>${LOGOUT} - rc_nohalt "sh ${TMPDIR}/.upgrade-unmount" + chroot ${FSMNT} /sbin/umount -a >/dev/null 2>/dev/null + umount -f ${FSMNT}/usr >/dev/null 2>/dev/null + umount -f ${FSMNT}/dev >/dev/null 2>/dev/null + umount -f ${FSMNT} >/dev/null 2>/dev/null + sh ${TMPDIR}/.upgrade-unmount >/dev/null 2>/dev/null fi # Unmount our CDMNT - rc_nohalt "umount ${CDMNT}" + umount ${CDMNT} >/dev/null 2>/dev/null }; Modified: head/usr.sbin/pc-sysinstall/backend/functions.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions.sh Mon Sep 19 04:08:52 2011 (r225656) +++ head/usr.sbin/pc-sysinstall/backend/functions.sh Mon Sep 19 05:12:53 2011 (r225657) @@ -98,10 +98,10 @@ strip_white_space() exit_err() { # Echo the message for the users benefit - echo "$1" + echo "EXITERROR: $1" # Save this error to the log file - echo "${1}" >>$LOGOUT + echo "EXITERROR: ${1}" >>$LOGOUT # Check if we need to unmount any file-systems after this failure unmount_all_filesystems_failure @@ -446,12 +446,12 @@ install_fresh() # Now add any users setup_users - # Now run any commands specified - run_commands - # Do any last cleanup / setup before unmounting run_final_cleanup + # Now run any commands specified + run_commands + # Unmount and finish up unmount_all_filesystems fi Modified: head/usr.sbin/pc-sysinstall/backend/parseconfig.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/parseconfig.sh Mon Sep 19 04:08:52 2011 (r225656) +++ head/usr.sbin/pc-sysinstall/backend/parseconfig.sh Mon Sep 19 05:12:53 2011 (r225657) @@ -58,12 +58,8 @@ fi # Set our config file variable CFGF="$1" -# Check the dirname of the provided CFGF and make sure its a full path -DIR="`dirname ${CFGF}`" -if [ "${DIR}" = "." ] -then - CFGF="`pwd`/${CFGF}" -fi +# Resolve any relative pathing +CFGF="`realpath ${CFGF}`" export CFGF # Start by doing a sanity check, which will catch any obvious mistakes in the config @@ -72,7 +68,7 @@ file_sanity_check "installMode installTy # We passed the Sanity check, lets grab some of the universal config settings and store them check_value installMode "fresh upgrade extract" check_value installType "PCBSD FreeBSD" -check_value installMedium "dvd usb ftp rsync image" +check_value installMedium "dvd usb ftp rsync image local" check_value packageType "uzip tar rsync split" if_check_value_exists partition "all s1 s2 s3 s4 free image" if_check_value_exists mirrorbal "load prefer round-robin split" Modified: head/usr.sbin/pc-sysinstall/examples/README ============================================================================== --- head/usr.sbin/pc-sysinstall/examples/README Mon Sep 19 04:08:52 2011 (r225656) +++ head/usr.sbin/pc-sysinstall/examples/README Mon Sep 19 05:12:53 2011 (r225657) @@ -184,7 +184,7 @@ the listing of any additional diskX= dir The following settings specify the partitioning / mount points to setup on the target partition -# disk0-part=UFS+S 500 / +# disk0-part=UFS+S 500 / (-n -o time) # disk0-part=SWAP 2000 none # disk0-part=UFS.eli 500 /usr # encpass=mypass @@ -219,6 +219,12 @@ All sizes are expressed in MegaBytes Specifying a size 0 instructs pc-sysinstall to use the rest of the available slice size, and should only be used for the last partition / mount +When using "UFS" and its various types, it is possible to specify custom options +for newfs using (). For examplei: +disk0-part=UFS+SUJ 1000 / (-o time) +In this case "-o time" would be passed to newfs when creating the "/" filesystem. + + When using "ZFS" specifically, it is possible to specify additional disks / partitions to include in the zpool. By using the syntax: (mirror: ad1,ad2) or (raidz: ad1,ad2), it is possible to include the disk "ad1" into the zpool for this partition, using the raidz / mirror methods. From owner-svn-src-all@FreeBSD.ORG Mon Sep 19 08:52:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65A441065672; Mon, 19 Sep 2011 08:52:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53E5D8FC1A; Mon, 19 Sep 2011 08:52:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8J8q7Hx071270; Mon, 19 Sep 2011 08:52:07 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8J8q7RO071262; Mon, 19 Sep 2011 08:52:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201109190852.p8J8q7RO071262@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 19 Sep 2011 08:52:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225659 - head/lib/libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2011 08:52:07 -0000 Author: hselasky Date: Mon Sep 19 08:52:06 2011 New Revision: 225659 URL: http://svn.freebsd.org/changeset/base/225659 Log: Implement missing USB debug information functions. Approved by: re (kib) MFC after: 1 week Modified: head/lib/libusb/Makefile head/lib/libusb/libusb.3 head/lib/libusb/libusb.h head/lib/libusb/libusb10.c head/lib/libusb/libusb20.3 head/lib/libusb/libusb20.c head/lib/libusb/libusb20.h Modified: head/lib/libusb/Makefile ============================================================================== --- head/lib/libusb/Makefile Mon Sep 19 08:01:21 2011 (r225658) +++ head/lib/libusb/Makefile Mon Sep 19 08:52:06 2011 (r225659) @@ -40,6 +40,7 @@ CFLAGS+= -DCOMPAT_32BIT MLINKS += libusb.3 libusb_init.3 MLINKS += libusb.3 libusb_exit.3 MLINKS += libusb.3 libusb_strerror.3 +MLINKS += libusb.3 libusb_error_name.3 MLINKS += libusb.3 libusb_set_debug.3 MLINKS += libusb.3 libusb_get_device_list.3 MLINKS += libusb.3 libusb_free_device_list.3 @@ -210,3 +211,5 @@ MLINKS += libusb20.3 libusb20_me_get_2.3 MLINKS += libusb20.3 libusb20_me_encode.3 MLINKS += libusb20.3 libusb20_me_decode.3 MLINKS += libusb20.3 libusb20_desc_foreach.3 +MLINKS += libusb20.3 libusb20_strerror.3 +MLINKS += libusb20.3 libusb20_error_name.3 Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Mon Sep 19 08:01:21 2011 (r225658) +++ head/lib/libusb/libusb.3 Mon Sep 19 08:52:06 2011 (r225659) @@ -63,6 +63,14 @@ Other libusb routines may not be called Get the ASCII representation of the error given by the .Fa code argument. +This function does not return NULL. +.Pp +.Ft const char * +.Fn libusb_error_name "int code" +Get the ASCII representation of the error enum given by the +.Fa code +argument. +This function does not return NULL. .Pp .Ft void .Fn libusb_set_debug "libusb_context *ctx" "int level" @@ -502,7 +510,8 @@ The library is also compliant with LibUS .Sh SEE ALSO .Xr libusb20 3 , .Xr usb 4 , -.Xr usbconfig 8 +.Xr usbconfig 8 , +.Xr usbdump 8 .Pp .Pa http://libusb.sourceforge.net/ .Sh HISTORY Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Mon Sep 19 08:01:21 2011 (r225658) +++ head/lib/libusb/libusb.h Mon Sep 19 08:52:06 2011 (r225659) @@ -303,6 +303,7 @@ typedef struct libusb_transfer { void libusb_set_debug(libusb_context * ctx, int level); const char *libusb_strerror(int code); +const char *libusb_error_name(int code); int libusb_init(libusb_context ** context); void libusb_exit(struct libusb_context *ctx); Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Mon Sep 19 08:01:21 2011 (r225658) +++ head/lib/libusb/libusb10.c Mon Sep 19 08:52:06 2011 (r225659) @@ -1449,6 +1449,73 @@ libusb_le16_to_cpu(uint16_t x) const char * libusb_strerror(int code) { - /* TODO */ - return ("Unknown error"); + switch (code) { + case LIBUSB_SUCCESS: + return ("Success"); + case LIBUSB_ERROR_IO: + return ("I/O error"); + case LIBUSB_ERROR_INVALID_PARAM: + return ("Invalid parameter"); + case LIBUSB_ERROR_ACCESS: + return ("Permissions error"); + case LIBUSB_ERROR_NO_DEVICE: + return ("No device"); + case LIBUSB_ERROR_NOT_FOUND: + return ("Not found"); + case LIBUSB_ERROR_BUSY: + return ("Device busy"); + case LIBUSB_ERROR_TIMEOUT: + return ("Timeout"); + case LIBUSB_ERROR_OVERFLOW: + return ("Overflow"); + case LIBUSB_ERROR_PIPE: + return ("Pipe error"); + case LIBUSB_ERROR_INTERRUPTED: + return ("Interrupted"); + case LIBUSB_ERROR_NO_MEM: + return ("Out of memory"); + case LIBUSB_ERROR_NOT_SUPPORTED: + return ("Not supported"); + case LIBUSB_ERROR_OTHER: + return ("Other error"); + default: + return ("Unknown error"); + } +} + +const char * +libusb_error_name(int code) +{ + switch (code) { + case LIBUSB_SUCCESS: + return ("LIBUSB_SUCCESS"); + case LIBUSB_ERROR_IO: + return ("LIBUSB_ERROR_IO"); + case LIBUSB_ERROR_INVALID_PARAM: + return ("LIBUSB_ERROR_INVALID_PARAM"); + case LIBUSB_ERROR_ACCESS: + return ("LIBUSB_ERROR_ACCESS"); + case LIBUSB_ERROR_NO_DEVICE: + return ("LIBUSB_ERROR_NO_DEVICE"); + case LIBUSB_ERROR_NOT_FOUND: + return ("LIBUSB_ERROR_NOT_FOUND"); + case LIBUSB_ERROR_BUSY: + return ("LIBUSB_ERROR_BUSY"); + case LIBUSB_ERROR_TIMEOUT: + return ("LIBUSB_ERROR_TIMEOUT"); + case LIBUSB_ERROR_OVERFLOW: + return ("LIBUSB_ERROR_OVERFLOW"); + case LIBUSB_ERROR_PIPE: + return ("LIBUSB_ERROR_PIPE"); + case LIBUSB_ERROR_INTERRUPTED: + return ("LIBUSB_ERROR_INTERRUPTED"); + case LIBUSB_ERROR_NO_MEM: + return ("LIBUSB_ERROR_NO_MEM"); + case LIBUSB_ERROR_NOT_SUPPORTED: + return ("LIBUSB_ERROR_NOT_SUPPORTED"); + case LIBUSB_ERROR_OTHER: + return ("LIBUSB_ERROR_OTHER"); + default: + return ("LIBUSB_ERROR_UNKNOWN"); + } } Modified: head/lib/libusb/libusb20.3 ============================================================================== --- head/lib/libusb/libusb20.3 Mon Sep 19 08:01:21 2011 (r225658) +++ head/lib/libusb/libusb20.3 Mon Sep 19 08:52:06 2011 (r225659) @@ -212,6 +212,10 @@ USB access library (libusb -lusb) .Fn libusb20_me_decode "const void *pdata" "uint16_t len" "void *pdecoded" .Ft "const uint8_t *" .Fn libusb20_desc_foreach "const struct libusb20_me_struct *me" "const uint8_t *pdesc" +.Ft "const char *" +.Fn libusb20_strerror "int code" +.Ft "const char *" +.Fn libusb20_error_name "int code" . . .Sh DESCRIPTION @@ -996,6 +1000,22 @@ The total decoded length is returned. The buffer pointer cannot be NULL. . . +.Sh USB DEBUGGING +.Pp +.Ft const char * +.Fn libusb20_strerror "int code" +Get the ASCII representation of the error given by the +.Fa code +argument. +This function does not return NULL. +.Pp +.Ft const char * +.Fn libusb20_error_name "int code" +Get the ASCII representation of the error enum given by the +.Fa code +argument. +This function does not return NULL. +. .Sh FILES . . @@ -1003,7 +1023,8 @@ The buffer pointer cannot be NULL. .Sh SEE ALSO .Xr usb 4 , .Xr libusb 3 , -.Xr usbconfig 8 +.Xr usbconfig 8 , +.Xr usbdump 8 . . .Sh HISTORY Modified: head/lib/libusb/libusb20.c ============================================================================== --- head/lib/libusb/libusb20.c Mon Sep 19 08:01:21 2011 (r225658) +++ head/lib/libusb/libusb20.c Mon Sep 19 08:52:06 2011 (r225659) @@ -1244,3 +1244,77 @@ libusb20_be_dequeue_device(struct libusb { TAILQ_REMOVE(&(pbe->usb_devs), pdev, dev_entry); } + +const char * +libusb20_strerror(int code) +{ + switch (code) { + case LIBUSB20_SUCCESS: + return ("Success"); + case LIBUSB20_ERROR_IO: + return ("I/O error"); + case LIBUSB20_ERROR_INVALID_PARAM: + return ("Invalid parameter"); + case LIBUSB20_ERROR_ACCESS: + return ("Permissions error"); + case LIBUSB20_ERROR_NO_DEVICE: + return ("No device"); + case LIBUSB20_ERROR_NOT_FOUND: + return ("Not found"); + case LIBUSB20_ERROR_BUSY: + return ("Device busy"); + case LIBUSB20_ERROR_TIMEOUT: + return ("Timeout"); + case LIBUSB20_ERROR_OVERFLOW: + return ("Overflow"); + case LIBUSB20_ERROR_PIPE: + return ("Pipe error"); + case LIBUSB20_ERROR_INTERRUPTED: + return ("Interrupted"); + case LIBUSB20_ERROR_NO_MEM: + return ("Out of memory"); + case LIBUSB20_ERROR_NOT_SUPPORTED: + return ("Not supported"); + case LIBUSB20_ERROR_OTHER: + return ("Other error"); + default: + return ("Unknown error"); + } +} + +const char * +libusb20_error_name(int code) +{ + switch (code) { + case LIBUSB20_SUCCESS: + return ("LIBUSB20_SUCCESS"); + case LIBUSB20_ERROR_IO: + return ("LIBUSB20_ERROR_IO"); + case LIBUSB20_ERROR_INVALID_PARAM: + return ("LIBUSB20_ERROR_INVALID_PARAM"); + case LIBUSB20_ERROR_ACCESS: + return ("LIBUSB20_ERROR_ACCESS"); + case LIBUSB20_ERROR_NO_DEVICE: + return ("LIBUSB20_ERROR_NO_DEVICE"); + case LIBUSB20_ERROR_NOT_FOUND: + return ("LIBUSB20_ERROR_NOT_FOUND"); + case LIBUSB20_ERROR_BUSY: + return ("LIBUSB20_ERROR_BUSY"); + case LIBUSB20_ERROR_TIMEOUT: + return ("LIBUSB20_ERROR_TIMEOUT"); + case LIBUSB20_ERROR_OVERFLOW: + return ("LIBUSB20_ERROR_OVERFLOW"); + case LIBUSB20_ERROR_PIPE: + return ("LIBUSB20_ERROR_PIPE"); + case LIBUSB20_ERROR_INTERRUPTED: + return ("LIBUSB20_ERROR_INTERRUPTED"); + case LIBUSB20_ERROR_NO_MEM: + return ("LIBUSB20_ERROR_NO_MEM"); + case LIBUSB20_ERROR_NOT_SUPPORTED: + return ("LIBUSB20_ERROR_NOT_SUPPORTED"); + case LIBUSB20_ERROR_OTHER: + return ("LIBUSB20_ERROR_OTHER"); + default: + return ("LIBUSB20_ERROR_UNKNOWN"); + } +} Modified: head/lib/libusb/libusb20.h ============================================================================== --- head/lib/libusb/libusb20.h Mon Sep 19 08:01:21 2011 (r225658) +++ head/lib/libusb/libusb20.h Mon Sep 19 08:52:06 2011 (r225659) @@ -293,6 +293,11 @@ void libusb20_be_dequeue_device(struct l void libusb20_be_enqueue_device(struct libusb20_backend *pbe, struct libusb20_device *pdev); void libusb20_be_free(struct libusb20_backend *pbe); +/* USB debugging */ + +const char *libusb20_strerror(int); +const char *libusb20_error_name(int); + #if 0 { /* style */ #endif From owner-svn-src-all@FreeBSD.ORG Mon Sep 19 10:58:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37E99106567C; Mon, 19 Sep 2011 10:58:31 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2735C8FC17; Mon, 19 Sep 2011 10:58:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8JAwVC6076947; Mon, 19 Sep 2011 10:58:31 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8JAwVv2076945; Mon, 19 Sep 2011 10:58:31 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201109191058.p8JAwVv2076945@svn.freebsd.org> From: Attilio Rao Date: Mon, 19 Sep 2011 10:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225662 - head/sys/dev/coretemp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2011 10:58:31 -0000 Author: attilio Date: Mon Sep 19 10:58:30 2011 New Revision: 225662 URL: http://svn.freebsd.org/changeset/base/225662 Log: #PROCHOT assertion is sticky after reading the MSR (accordingly with Intel manuals) it must be cleared by writing a 0. Fix that. Sponsored by: Sandvine Incorporated Reported by: rstone Reviewed by: delphij, emaste, rstone Approved by: re (kib) MFC after: 1 week Modified: head/sys/dev/coretemp/coretemp.c Modified: head/sys/dev/coretemp/coretemp.c ============================================================================== --- head/sys/dev/coretemp/coretemp.c Mon Sep 19 10:28:59 2011 (r225661) +++ head/sys/dev/coretemp/coretemp.c Mon Sep 19 10:58:30 2011 (r225662) @@ -384,6 +384,7 @@ coretemp_get_val_sysctl(SYSCTL_HANDLER_A } if (msr & THERM_STATUS_LOG) { + coretemp_clear_thermal_msr(device_get_unit(dev)); sc->sc_throttle_log = 1; /* @@ -424,8 +425,10 @@ coretemp_throttle_log_sysctl(SYSCTL_HAND msr = coretemp_get_thermal_msr(device_get_unit(dev)); sc = device_get_softc(dev); - if (msr & THERM_STATUS_LOG) + if (msr & THERM_STATUS_LOG) { + coretemp_clear_thermal_msr(device_get_unit(dev)); sc->sc_throttle_log = 1; + } val = sc->sc_throttle_log; From owner-svn-src-all@FreeBSD.ORG Mon Sep 19 11:08:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CAC910656EC; Mon, 19 Sep 2011 11:08:31 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 718828FC27; Mon, 19 Sep 2011 11:08:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8JB8VrC077307; Mon, 19 Sep 2011 11:08:31 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8JB8VgF077301; Mon, 19 Sep 2011 11:08:31 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201109191108.p8JB8VgF077301@svn.freebsd.org> From: Attilio Rao Date: Mon, 19 Sep 2011 11:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225663 - in stable/8/sys: conf kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2011 11:08:31 -0000 Author: attilio Date: Mon Sep 19 11:08:31 2011 New Revision: 225663 URL: http://svn.freebsd.org/changeset/base/225663 Log: MFC r225448: Improve busy buffers diagnostic on shutdown path. Modified: stable/8/sys/conf/NOTES stable/8/sys/conf/options stable/8/sys/kern/kern_shutdown.c stable/8/sys/kern/vfs_bio.c stable/8/sys/sys/buf.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/conf/NOTES ============================================================================== --- stable/8/sys/conf/NOTES Mon Sep 19 10:58:30 2011 (r225662) +++ stable/8/sys/conf/NOTES Mon Sep 19 11:08:31 2011 (r225663) @@ -2845,7 +2845,6 @@ options SCSI_NCR_MYADDR=7 options SC_DEBUG_LEVEL=5 # Syscons debug level options SC_RENDER_DEBUG # syscons rendering debugging -options SHOW_BUSYBUFS # List buffers that prevent root unmount options VFS_BIO_DEBUG # VFS buffer I/O debugging options KSTACK_MAX_PAGES=32 # Maximum pages to give the kernel stack Modified: stable/8/sys/conf/options ============================================================================== --- stable/8/sys/conf/options Mon Sep 19 10:58:30 2011 (r225662) +++ stable/8/sys/conf/options Mon Sep 19 11:08:31 2011 (r225663) @@ -150,7 +150,6 @@ QUOTA SCHED_4BSD opt_sched.h SCHED_STATS opt_sched.h SCHED_ULE opt_sched.h -SHOW_BUSYBUFS SLEEPQUEUE_PROFILING SLHCI_DEBUG opt_slhci.h SPX_HACK Modified: stable/8/sys/kern/kern_shutdown.c ============================================================================== --- stable/8/sys/kern/kern_shutdown.c Mon Sep 19 10:58:30 2011 (r225662) +++ stable/8/sys/kern/kern_shutdown.c Mon Sep 19 11:08:31 2011 (r225663) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_kdb.h" #include "opt_panic.h" -#include "opt_show_busybufs.h" #include "opt_sched.h" #include "opt_watchdog.h" @@ -66,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef SW_WATCHDOG #include #endif @@ -123,6 +123,14 @@ TUNABLE_INT("kern.sync_on_panic", &sync_ SYSCTL_NODE(_kern, OID_AUTO, shutdown, CTLFLAG_RW, 0, "Shutdown environment"); +#ifndef DIAGNOSTIC +static int show_busybufs; +#else +static int show_busybufs = 1; +#endif +SYSCTL_INT(_kern_shutdown, OID_AUTO, show_busybufs, CTLFLAG_RW, + &show_busybufs, 0, ""); + /* * Variable panicstr contains argument to first call to panic; used as flag * to indicate that the kernel has already called panic. @@ -388,13 +396,17 @@ boot(int howto) } #endif nbusy++; -#if defined(SHOW_BUSYBUFS) || defined(DIAGNOSTIC) - printf( - "%d: bufobj:%p, flags:%0x, blkno:%ld, lblkno:%ld\n", - nbusy, bp->b_bufobj, - bp->b_flags, (long)bp->b_blkno, - (long)bp->b_lblkno); -#endif + if (show_busybufs > 0) { + printf( + "%d: buf:%p, vnode:%p, flags:%0x, blkno:%jd, lblkno:%jd, buflock:", + nbusy, bp, bp->b_vp, bp->b_flags, + (intmax_t)bp->b_blkno, + (intmax_t)bp->b_lblkno); + BUF_LOCKPRINTINFO(bp); + if (show_busybufs > 1) + vn_printf(bp->b_vp, + "vnode content: "); + } } } if (nbusy) { Modified: stable/8/sys/kern/vfs_bio.c ============================================================================== --- stable/8/sys/kern/vfs_bio.c Mon Sep 19 10:58:30 2011 (r225662) +++ stable/8/sys/kern/vfs_bio.c Mon Sep 19 11:08:31 2011 (r225663) @@ -4106,7 +4106,7 @@ DB_SHOW_COMMAND(buffer, db_show_buffer) db_printf("\n"); } db_printf(" "); - lockmgr_printinfo(&bp->b_lock); + BUF_LOCKPRINTINFO(bp); } DB_SHOW_COMMAND(lockedbufs, lockedbufs) Modified: stable/8/sys/sys/buf.h ============================================================================== --- stable/8/sys/sys/buf.h Mon Sep 19 10:58:30 2011 (r225662) +++ stable/8/sys/sys/buf.h Mon Sep 19 11:08:31 2011 (r225663) @@ -311,6 +311,12 @@ extern const char *buf_wmesg; /* Defaul lockdestroy(&(bp)->b_lock) /* + * Print informations on a buffer lock. + */ +#define BUF_LOCKPRINTINFO(bp) \ + lockmgr_printinfo(&(bp)->b_lock) + +/* * Buffer lock assertions. */ #if defined(INVARIANTS) && defined(INVARIANT_SUPPORT) From owner-svn-src-all@FreeBSD.ORG Mon Sep 19 15:55:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E2D21065672; Mon, 19 Sep 2011 15:55:53 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7EA558FC08; Mon, 19 Sep 2011 15:55:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8JFtruG086398; Mon, 19 Sep 2011 15:55:53 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8JFtruR086396; Mon, 19 Sep 2011 15:55:53 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201109191555.p8JFtruR086396@svn.freebsd.org> From: Hiroki Sato Date: Mon, 19 Sep 2011 15:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225669 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2011 15:55:53 -0000 Author: hrs Date: Mon Sep 19 15:55:53 2011 New Revision: 225669 URL: http://svn.freebsd.org/changeset/base/225669 Log: Fix the script order to run rc.d/bridge after the initial network interface configuration and before running network daemons. Approved by: re (kib) Modified: head/etc/rc.d/bridge Modified: head/etc/rc.d/bridge ============================================================================== --- head/etc/rc.d/bridge Mon Sep 19 15:31:12 2011 (r225668) +++ head/etc/rc.d/bridge Mon Sep 19 15:55:53 2011 (r225669) @@ -26,7 +26,8 @@ # # PROVIDE: bridge -# REQUIRE: netif +# REQUIRE: netif faith ppp stf +# BEFORE: SERVERS # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-all@FreeBSD.ORG Mon Sep 19 15:56:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A31D31065670; Mon, 19 Sep 2011 15:56:50 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93B008FC14; Mon, 19 Sep 2011 15:56:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8JFuoVX086463; Mon, 19 Sep 2011 15:56:50 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8JFuoLf086461; Mon, 19 Sep 2011 15:56:50 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201109191556.p8JFuoLf086461@svn.freebsd.org> From: Hiroki Sato Date: Mon, 19 Sep 2011 15:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225670 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2011 15:56:50 -0000 Author: hrs Date: Mon Sep 19 15:56:50 2011 New Revision: 225670 URL: http://svn.freebsd.org/changeset/base/225670 Log: Use resolvconf(8) to create /etc/resolv.conf, not directly overwrite it. Approved by: re (kib) Modified: head/etc/rc.d/resolv Modified: head/etc/rc.d/resolv ============================================================================== --- head/etc/rc.d/resolv Mon Sep 19 15:55:53 2011 (r225669) +++ head/etc/rc.d/resolv Mon Sep 19 15:56:50 2011 (r225670) @@ -28,7 +28,7 @@ # # PROVIDE: resolv -# REQUIRE: netif +# REQUIRE: netif var # KEYWORD: nojail . /etc/rc.subr @@ -41,17 +41,17 @@ load_rc_config $name # if the info is available via dhcp/kenv # build the resolv.conf # -if [ ! -e /etc/resolv.conf -a \ - -n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; then - > /etc/resolv.conf - +if [ -n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; then + interface="`/bin/kenv boot.netif.name`" + ( if [ -n "`/bin/kenv dhcp.domain-name 2> /dev/null`" ]; then - echo domain `/bin/kenv dhcp.domain-name` > /etc/resolv.conf + echo domain `/bin/kenv dhcp.domain-name` fi set -- `/bin/kenv dhcp.domain-name-servers` for ns in `IFS=','; echo $*`; do - echo nameserver $ns >> /etc/resolv.conf; + echo nameserver $ns done + ) | /sbin/resolvconf -a ${interface}:dhcp4 fi From owner-svn-src-all@FreeBSD.ORG Mon Sep 19 16:00:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 474B5106566C; Mon, 19 Sep 2011 16:00:56 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36EC98FC12; Mon, 19 Sep 2011 16:00:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8JG0u9Q086642; Mon, 19 Sep 2011 16:00:56 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8JG0uK6086640; Mon, 19 Sep 2011 16:00:56 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201109191600.p8JG0uK6086640@svn.freebsd.org> From: Hiroki Sato Date: Mon, 19 Sep 2011 16:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225671 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2011 16:00:56 -0000 Author: hrs Date: Mon Sep 19 16:00:55 2011 New Revision: 225671 URL: http://svn.freebsd.org/changeset/base/225671 Log: - Document $ipv6_cpe_wanif. - Emphasize $ipv6_enable and $ipv6_prefer are deprecated. - Add more detail descriptions about $ipv6_activate_all_interfaces. - Add some more examples of $ifconfig_IF_ipv6. - rtsold(8) and rtadvd(8) can be used even when ipv6_gateway_enable=NO now. Approved by: re (kib) Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Mon Sep 19 15:56:50 2011 (r225670) +++ head/share/man/man5/rc.conf.5 Mon Sep 19 16:00:55 2011 (r225671) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 19, 2011 +.Dd September 13, 2011 .Dt RC.CONF 5 .Os .Sh NAME @@ -1282,6 +1282,13 @@ ifconfig_ed0_name="net0" ifconfig_net0="inet 192.0.2.1 netmask 0xffffff00" .Ed .It Va ipv6_enable +This variable is deprecated. +Use +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 +and +.Va ipv6_activate_all_interfaces +if necessary. +.Pp .Pq Vt bool If the variable is .Dq Li YES , @@ -1292,13 +1299,12 @@ and the .Va ipv6_activate_all_interfaces is defined as .Dq Li YES . -.Pp -This variable is deprecated. Use -.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 -and -.Va ipv6_activate_all_interfaces -if necessary. .It Va ipv6_prefer +This variable is deprecated. +Use +.Va ip6addrctl_policy +instead. +.Pp .Pq Vt bool If the variable is .Dq Li YES , @@ -1311,19 +1317,45 @@ If the variable is the default address selection policy table set by .Xr ip6addrctl 8 will be IPv4-preferred. -.Pp -This variable is deprecated. Use -.Va ip6addrctl_policy -instead. .It Va ipv6_activate_all_interfaces +.Pq Vt bool +This controls initial configuration on IPv6-capable +interfaces with no corresponding +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 +variable. +Note that it is not always necessary to set this variable to +.Dq YES +to use IPv6 functionality on +.Fx . +In most cases, just configuring +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 +variables works. +.Pp If the variable is .Dq Li NO , -all of interfaces which do not have the corrsponding +all interfaces which do not have a corresponding .Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 variable will be marked as .Dq Li IFDISABLED -for security reason. This means only IPv6 functionality on that interface -is completely disabled. For more details of +at creation. +This means that all of IPv6 functionality on that interface +is completely disabled to enforce a security policy. +If the variable is set to +.Dq YES , +the flag will be cleared on all of the interfaces. +.Pp +In most cases, just defining an +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 +for an IPv6-capable interface should be sufficient. +However, if an interface is added dynamically +.Pq by some tunneling protocols such as PPP, for example , +it is often difficult to define the variable in advance. +In such a case, configuring the +.Dq Li IFDISABLED +flag can be disabled by setting this variable to +.Dq YES . +.Pp +For more details of the .Dq Li IFDISABLED flag and keywords .Dq Li inet6 ifdisabled , @@ -1344,6 +1376,47 @@ This is the IPv6 equivalent of .Va network_interfaces . Normally manual configuration of this variable is not needed. .Pp +.It Va ipv6_cpe_wanif +.Pq Vt str +If the variable is set to an interface name, +the +.Xr ifconfig 8 +options +.Dq inet6 -no_radr accept_rtadv +will be added to the specified interface automatically before evaluating +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 , +and two +.Xr sysctl 8 +variables +.Va net.inet6.ip6.rfc6204w3 +and +.Va net.inet6.ip6.no_radr +will be set to 1. +.Pp +This means the specified interface will accept ICMPv6 Router +Advertisement messages on that link and add the discovered +routers into the Default Router List. +While the other interfaces can still accept RA messages if the +.Dq inet6 accept_rtadv +option is specified, adding +routes into the Default Router List will be disabled by +.Dq inet6 no_radr +option by default. +See +.Xr ifconfig 8 +for more details. +.Pp +Note that ICMPv6 Router Advertisement messages will be +accepted even when +.Va net.inet6.ip6.forwarding +is 1 +.Pq packet fowarding is enabled +when +.Va net.inet6.ip6.rfc6204w3 +is set to 1. +.Pp +Default is +.Dq Li NO . .It Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 .Pq Vt str IPv6 functionality on an interface should be configured by @@ -1360,16 +1433,37 @@ ifconfig_ed0_ipv6="inet6 2001:db8:1::1 p ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" .Ed .Pp +Note that a link-local address will be automatically configured in +addition to the configured global-scope addresses because the IPv6 +specifications require it on each link. +The address is calculated from the MAC address by using an algorithm +defined in +.Rs +.%T "RFC 4862" +.%O "Section 5.3" +.Re +.Pp +If only a link-local address is needed on the interface, +the following configuration can be used: +.Bd -literal +ifconfig_ed0_ipv6="inet6 auto_linklocal" +.Ed +.Pp +A link-local address can also be configured manually. +This is useful for the default router address of an IPv6 router +so that it does not change when the network interface +card is replaced. +For example: +.Bd -literal +ifconfig_ed0_ipv6="inet6 fe80::1 prefixlen 64" +.Ed +.Pp Interfaces that have an .Dq Li inet6 accept_rtadv keyword in .Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 setting will be automatically configured by .Xr rtsol 8 . -Note that this automatic configuration is disabled if the -.Va ipv6_gateway_enable -is set to -.Dq Li YES . .It Va ipv6_prefix_ Ns Aq Ar interface .Pq Vt str If one or more prefixes are defined in @@ -2628,16 +2722,12 @@ If set to run the .Xr rtadvd 8 daemon at boot time. -.Xr rtadvd 8 -will only run if -.Va ipv6_gateway_enable -is also set to -.Dq Li YES . The .Xr rtadvd 8 -utility sends router advertisement packets to the interfaces specified in -.Va rtadvd_interfaces -and should only be enabled with great care. +utility sends ICMPv6 Router Advertisement messages to +the interfaces specified in +.Va rtadvd_interfaces . +This should only be enabled with great care. You may want to fine-tune .Xr rtadvd.conf 5 . .It Va rtadvd_interfaces From owner-svn-src-all@FreeBSD.ORG Mon Sep 19 16:01:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21912106564A; Mon, 19 Sep 2011 16:01:54 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 120168FC0C; Mon, 19 Sep 2011 16:01:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8JG1rTW086707; Mon, 19 Sep 2011 16:01:53 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8JG1rdd086705; Mon, 19 Sep 2011 16:01:53 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201109191601.p8JG1rdd086705@svn.freebsd.org> From: Hiroki Sato Date: Mon, 19 Sep 2011 16:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225672 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2011 16:01:54 -0000 Author: hrs Date: Mon Sep 19 16:01:53 2011 New Revision: 225672 URL: http://svn.freebsd.org/changeset/base/225672 Log: - Document inet6 no_radr flag. - Add descriptions of sysctl(8) variables which can control the default configuration of the inet6 flags. Approved by: re (kib) Modified: head/sbin/ifconfig/ifconfig.8 Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Mon Sep 19 16:00:55 2011 (r225671) +++ head/sbin/ifconfig/ifconfig.8 Mon Sep 19 16:01:53 2011 (r225672) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd July 3, 2011 +.Dd September 13, 2011 .Dt IFCONFIG 8 .Os .Sh NAME @@ -626,12 +626,37 @@ is needed for them: .Bl -tag -width indent .It Cm accept_rtadv Set a flag to enable accepting ICMPv6 Router Advertisement messages. +The +.Xr sysctl 8 +variable +.Va net.inet6.ip6.accept_rtadv +controls whether this flag is set by default or not. .It Cm -accept_rtadv Clear a flag .Cm accept_rtadv . +.It Cm no_radr +Set a flag to control whether routers from which the system accepts +Router Advertisement messages will be added to the Default Router List +or not. +When the +.Cm accept_rtadv +flag is disabled, this flag has no effect. +The +.Xr sysctl 8 +variable +.Va net.inet6.ip6.no_radr +controls whether this flag is set by default or not. +.It Cm -no_radr +Clear a flag +.Cm no_radr . .It Cm auto_linklocal Set a flag to perform automatic link-local address configuration when the interface becomes available. +The +.Xr sysctl 8 +variable +.Va net.inet6.ip6.auto_linklocal +controls whether this flag is set by default or not. .It Cm -auto_linklocal Clear a flag .Cm auto_linklocal . From owner-svn-src-all@FreeBSD.ORG Mon Sep 19 16:10:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id E0B72106566B; Mon, 19 Sep 2011 16:10:30 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id A6F1A14DEC3; Mon, 19 Sep 2011 16:10:29 +0000 (UTC) Message-ID: <4E776973.9000409@FreeBSD.org> Date: Mon, 19 Sep 2011 09:10:27 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:6.0.2) Gecko/20110912 Thunderbird/6.0.2 MIME-Version: 1.0 To: Hiroki Sato References: <201109191555.p8JFtruR086396@svn.freebsd.org> In-Reply-To: <201109191555.p8JFtruR086396@svn.freebsd.org> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, re@FreeBSD.org, svn-src-all@freebsd.org, src-committers@freebsd.org, freebsd-rc@FreeBSD.org Subject: Re: svn commit: r225669 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2011 16:10:31 -0000 Please don't add new instances of BEFORE in base rc.d scripts. The proper way to do this is to add bridge to REQUIRE: in SERVERS. The BEFORE method is useful for local/ports rc.d scripts, but it makes debugging of dependency issues more difficult so ideally it should be avoided in the base if it's not absolutely necessary (which it is not here). Thanks, Doug On 09/19/2011 08:55, Hiroki Sato wrote: > Author: hrs > Date: Mon Sep 19 15:55:53 2011 > New Revision: 225669 > URL: http://svn.freebsd.org/changeset/base/225669 > > Log: > Fix the script order to run rc.d/bridge after the initial network > interface configuration and before running network daemons. > > Approved by: re (kib) > > Modified: > head/etc/rc.d/bridge > > Modified: head/etc/rc.d/bridge > ============================================================================== > --- head/etc/rc.d/bridge Mon Sep 19 15:31:12 2011 (r225668) > +++ head/etc/rc.d/bridge Mon Sep 19 15:55:53 2011 (r225669) > @@ -26,7 +26,8 @@ > # > > # PROVIDE: bridge > -# REQUIRE: netif > +# REQUIRE: netif faith ppp stf > +# BEFORE: SERVERS > # KEYWORD: nojail > > . /etc/rc.subr > -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Mon Sep 19 16:25:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAD6C106566B; Mon, 19 Sep 2011 16:25:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 550B08FC12; Mon, 19 Sep 2011 16:25:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8JGPb44087496; Mon, 19 Sep 2011 16:25:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8JGPbRD087493; Mon, 19 Sep 2011 16:25:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201109191625.p8JGPbRD087493@svn.freebsd.org> From: John Baldwin Date: Mon, 19 Sep 2011 16:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225673 - stable/8/usr.sbin/mfiutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2011 16:25:37 -0000 Author: jhb Date: Mon Sep 19 16:25:37 2011 New Revision: 225673 URL: http://svn.freebsd.org/changeset/base/225673 Log: MFC 225331: Move the logic to parse volume cache commands out into a separate function and use a loop so that multiple cache commands can be strung together on the command line into a single update to the volume's properties. Modified: stable/8/usr.sbin/mfiutil/mfi_volume.c stable/8/usr.sbin/mfiutil/mfiutil.8 Directory Properties: stable/8/usr.sbin/mfiutil/ (props changed) Modified: stable/8/usr.sbin/mfiutil/mfi_volume.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfi_volume.c Mon Sep 19 16:01:53 2011 (r225672) +++ stable/8/usr.sbin/mfiutil/mfi_volume.c Mon Sep 19 16:25:37 2011 (r225673) @@ -111,16 +111,16 @@ mfi_ld_set_props(int fd, struct mfi_ld_p } static int -update_cache_policy(int fd, struct mfi_ld_props *props, uint8_t new_policy, - uint8_t mask) +update_cache_policy(int fd, struct mfi_ld_props *old, struct mfi_ld_props *new) { int error; uint8_t changes, policy; - policy = (props->default_cache_policy & ~mask) | new_policy; - if (policy == props->default_cache_policy) + if (old->default_cache_policy == new->default_cache_policy && + old->disk_cache_policy == new->disk_cache_policy) return (0); - changes = policy ^ props->default_cache_policy; + policy = new->default_cache_policy; + changes = policy ^ old->default_cache_policy; if (changes & MR_LD_CACHE_ALLOW_WRITE_CACHE) printf("%s caching of I/O writes\n", policy & MR_LD_CACHE_ALLOW_WRITE_CACHE ? "Enabling" : @@ -142,9 +142,21 @@ update_cache_policy(int fd, struct mfi_l printf("%s write caching with bad BBU\n", policy & MR_LD_CACHE_WRITE_CACHE_BAD_BBU ? "Enabling" : "Disabling"); + if (old->disk_cache_policy != new->disk_cache_policy) { + switch (new->disk_cache_policy) { + case MR_PD_CACHE_ENABLE: + printf("Enabling write-cache on physical drives\n"); + break; + case MR_PD_CACHE_DISABLE: + printf("Disabling write-cache on physical drives\n"); + break; + case MR_PD_CACHE_UNCHANGED: + printf("Using default write-cache setting on physical drives\n"); + break; + } + } - props->default_cache_policy = policy; - if (mfi_ld_set_props(fd, props) < 0) { + if (mfi_ld_set_props(fd, new) < 0) { error = errno; warn("Failed to set volume properties"); return (error); @@ -152,12 +164,130 @@ update_cache_policy(int fd, struct mfi_l return (0); } +static void +stage_cache_setting(struct mfi_ld_props *props, uint8_t new_policy, + uint8_t mask) +{ + + props->default_cache_policy &= ~mask; + props->default_cache_policy |= new_policy; +} + +/* + * Parse a single cache directive modifying the passed in policy. + * Returns -1 on a parse error and the number of arguments consumed + * on success. + */ +static int +process_cache_command(int ac, char **av, struct mfi_ld_props *props) +{ + uint8_t policy; + + /* I/O cache settings. */ + if (strcmp(av[0], "all") == 0 || strcmp(av[0], "enable") == 0) { + stage_cache_setting(props, MR_LD_CACHE_ALLOW_READ_CACHE | + MR_LD_CACHE_ALLOW_WRITE_CACHE, + MR_LD_CACHE_ALLOW_READ_CACHE | + MR_LD_CACHE_ALLOW_WRITE_CACHE); + return (1); + } + if (strcmp(av[0], "none") == 0 || strcmp(av[0], "disable") == 0) { + stage_cache_setting(props, 0, MR_LD_CACHE_ALLOW_READ_CACHE | + MR_LD_CACHE_ALLOW_WRITE_CACHE); + return (1); + } + if (strcmp(av[0], "reads") == 0) { + stage_cache_setting(props, MR_LD_CACHE_ALLOW_READ_CACHE, + MR_LD_CACHE_ALLOW_READ_CACHE | + MR_LD_CACHE_ALLOW_WRITE_CACHE); + return (1); + } + if (strcmp(av[0], "writes") == 0) { + stage_cache_setting(props, MR_LD_CACHE_ALLOW_WRITE_CACHE, + MR_LD_CACHE_ALLOW_READ_CACHE | + MR_LD_CACHE_ALLOW_WRITE_CACHE); + return (1); + } + + /* Write cache behavior. */ + if (strcmp(av[0], "write-back") == 0) { + stage_cache_setting(props, MR_LD_CACHE_WRITE_BACK, + MR_LD_CACHE_WRITE_BACK); + return (1); + } + if (strcmp(av[0], "write-through") == 0) { + stage_cache_setting(props, 0, MR_LD_CACHE_WRITE_BACK); + return (1); + } + if (strcmp(av[0], "bad-bbu-write-cache") == 0) { + if (ac < 2) { + warnx("cache: bad BBU setting required"); + return (-1); + } + if (strcmp(av[1], "enable") == 0) + policy = MR_LD_CACHE_WRITE_CACHE_BAD_BBU; + else if (strcmp(av[1], "disable") == 0) + policy = 0; + else { + warnx("cache: invalid bad BBU setting"); + return (-1); + } + stage_cache_setting(props, policy, + MR_LD_CACHE_WRITE_CACHE_BAD_BBU); + return (2); + } + + /* Read cache behavior. */ + if (strcmp(av[0], "read-ahead") == 0) { + if (ac < 2) { + warnx("cache: read-ahead setting required"); + return (-1); + } + if (strcmp(av[1], "none") == 0) + policy = 0; + else if (strcmp(av[1], "always") == 0) + policy = MR_LD_CACHE_READ_AHEAD; + else if (strcmp(av[1], "adaptive") == 0) + policy = MR_LD_CACHE_READ_AHEAD | + MR_LD_CACHE_READ_ADAPTIVE; + else { + warnx("cache: invalid read-ahead setting"); + return (-1); + } + stage_cache_setting(props, policy, MR_LD_CACHE_READ_AHEAD | + MR_LD_CACHE_READ_ADAPTIVE); + return (2); + } + + /* Drive write-cache behavior. */ + if (strcmp(av[0], "write-cache") == 0) { + if (ac < 2) { + warnx("cache: write-cache setting required"); + return (-1); + } + if (strcmp(av[1], "enable") == 0) + props->disk_cache_policy = MR_PD_CACHE_ENABLE; + else if (strcmp(av[1], "disable") == 0) + props->disk_cache_policy = MR_PD_CACHE_DISABLE; + else if (strcmp(av[1], "default") == 0) + props->disk_cache_policy = MR_PD_CACHE_UNCHANGED; + else { + warnx("cache: invalid write-cache setting"); + return (-1); + } + return (2); + } + + warnx("cache: Invalid command"); + return (-1); +} + static int volume_cache(int ac, char **av) { - struct mfi_ld_props props; - int error, fd; - uint8_t target_id, policy; + struct mfi_ld_props props, new; + int error, fd, consumed; + uint8_t target_id; if (ac < 2) { warnx("cache: volume required"); @@ -235,113 +365,19 @@ volume_cache(int ac, char **av) printf("Cache Disabled Due to Dead Battery\n"); error = 0; } else { - if (strcmp(av[2], "all") == 0 || strcmp(av[2], "enable") == 0) - error = update_cache_policy(fd, &props, - MR_LD_CACHE_ALLOW_READ_CACHE | - MR_LD_CACHE_ALLOW_WRITE_CACHE, - MR_LD_CACHE_ALLOW_READ_CACHE | - MR_LD_CACHE_ALLOW_WRITE_CACHE); - else if (strcmp(av[2], "none") == 0 || - strcmp(av[2], "disable") == 0) - error = update_cache_policy(fd, &props, 0, - MR_LD_CACHE_ALLOW_READ_CACHE | - MR_LD_CACHE_ALLOW_WRITE_CACHE); - else if (strcmp(av[2], "reads") == 0) - error = update_cache_policy(fd, &props, - MR_LD_CACHE_ALLOW_READ_CACHE, - MR_LD_CACHE_ALLOW_READ_CACHE | - MR_LD_CACHE_ALLOW_WRITE_CACHE); - else if (strcmp(av[2], "writes") == 0) - error = update_cache_policy(fd, &props, - MR_LD_CACHE_ALLOW_WRITE_CACHE, - MR_LD_CACHE_ALLOW_READ_CACHE | - MR_LD_CACHE_ALLOW_WRITE_CACHE); - else if (strcmp(av[2], "write-back") == 0) - error = update_cache_policy(fd, &props, - MR_LD_CACHE_WRITE_BACK, - MR_LD_CACHE_WRITE_BACK); - else if (strcmp(av[2], "write-through") == 0) - error = update_cache_policy(fd, &props, 0, - MR_LD_CACHE_WRITE_BACK); - else if (strcmp(av[2], "read-ahead") == 0) { - if (ac < 4) { - warnx("cache: read-ahead setting required"); - close(fd); - return (EINVAL); - } - if (strcmp(av[3], "none") == 0) - policy = 0; - else if (strcmp(av[3], "always") == 0) - policy = MR_LD_CACHE_READ_AHEAD; - else if (strcmp(av[3], "adaptive") == 0) - policy = MR_LD_CACHE_READ_AHEAD | - MR_LD_CACHE_READ_ADAPTIVE; - else { - warnx("cache: invalid read-ahead setting"); - close(fd); - return (EINVAL); - } - error = update_cache_policy(fd, &props, policy, - MR_LD_CACHE_READ_AHEAD | - MR_LD_CACHE_READ_ADAPTIVE); - } else if (strcmp(av[2], "bad-bbu-write-cache") == 0) { - if (ac < 4) { - warnx("cache: bad BBU setting required"); + new = props; + av += 2; + ac -= 2; + while (ac > 0) { + consumed = process_cache_command(ac, av, &new); + if (consumed < 0) { close(fd); return (EINVAL); } - if (strcmp(av[3], "enable") == 0) - policy = MR_LD_CACHE_WRITE_CACHE_BAD_BBU; - else if (strcmp(av[3], "disable") == 0) - policy = 0; - else { - warnx("cache: invalid bad BBU setting"); - close(fd); - return (EINVAL); - } - error = update_cache_policy(fd, &props, policy, - MR_LD_CACHE_WRITE_CACHE_BAD_BBU); - } else if (strcmp(av[2], "write-cache") == 0) { - if (ac < 4) { - warnx("cache: write-cache setting required"); - close(fd); - return (EINVAL); - } - if (strcmp(av[3], "enable") == 0) - policy = MR_PD_CACHE_ENABLE; - else if (strcmp(av[3], "disable") == 0) - policy = MR_PD_CACHE_DISABLE; - else if (strcmp(av[3], "default") == 0) - policy = MR_PD_CACHE_UNCHANGED; - else { - warnx("cache: invalid write-cache setting"); - close(fd); - return (EINVAL); - } - error = 0; - if (policy != props.disk_cache_policy) { - switch (policy) { - case MR_PD_CACHE_ENABLE: - printf("Enabling write-cache on physical drives\n"); - break; - case MR_PD_CACHE_DISABLE: - printf("Disabling write-cache on physical drives\n"); - break; - case MR_PD_CACHE_UNCHANGED: - printf("Using default write-cache setting on physical drives\n"); - break; - } - props.disk_cache_policy = policy; - if (mfi_ld_set_props(fd, &props) < 0) { - error = errno; - warn("Failed to set volume properties"); - } - } - } else { - warnx("cache: Invalid command"); - close(fd); - return (EINVAL); + av += consumed; + ac -= consumed; } + error = update_cache_policy(fd, &props, &new); } close(fd); Modified: stable/8/usr.sbin/mfiutil/mfiutil.8 ============================================================================== --- stable/8/usr.sbin/mfiutil/mfiutil.8 Mon Sep 19 16:01:53 2011 (r225672) +++ stable/8/usr.sbin/mfiutil/mfiutil.8 Mon Sep 19 16:25:37 2011 (r225673) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 20, 2011 +.Dd September 2, 2011 .Dt MFIUTIL 8 .Os .Sh NAME @@ -103,7 +103,7 @@ .Cm locate Ar drive Brq "on | off" .Nm .Op Fl u Ar unit -.Cm cache Ar volume Op Ar setting Op Ar value +.Cm cache Ar volume Op Ar setting Oo Ar value Oc Op ... .Nm .Op Fl u Ar unit .Cm name Ar volume Ar name @@ -367,19 +367,23 @@ Change the state of the external LED ass .Pp The logical volume management commands include: .Bl -tag -width indent -.It Cm cache Ar volume Op Ar setting Op Ar value +.It Cm cache Ar volume Op Ar setting Oo Ar value Oc Op ... If no .Ar setting -argument is supplied, then the current cache policy for +arguments are supplied, then the current cache policy for .Ar volume is displayed; otherwise, the cache policy for .Ar volume is modified. -The optional +One or more .Ar setting -argument can be one of the following values: +arguments may be given. +Some settings take an additional +.Ar value +argument as noted below. +The valid settings are: .Bl -tag -width indent .It Cm enable Enable caching for both read and write I/O operations. From owner-svn-src-all@FreeBSD.ORG Mon Sep 19 16:28:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44275106566C; Mon, 19 Sep 2011 16:28:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33ABA8FC14; Mon, 19 Sep 2011 16:28:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8JGSbKU087628; Mon, 19 Sep 2011 16:28:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8JGSbDY087626; Mon, 19 Sep 2011 16:28:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201109191628.p8JGSbDY087626@svn.freebsd.org> From: John Baldwin Date: Mon, 19 Sep 2011 16:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225674 - stable/8/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2011 16:28:37 -0000 Author: jhb Date: Mon Sep 19 16:28:36 2011 New Revision: 225674 URL: http://svn.freebsd.org/changeset/base/225674 Log: MFC 225341: Clear the mountprog variable after each mountfs() call so that mountprog options don't leak over into subsequent mounts listed in /etc/fstab. While here, fix a memory leak in debug mode. Modified: stable/8/sbin/mount/mount.c Directory Properties: stable/8/sbin/mount/ (props changed) Modified: stable/8/sbin/mount/mount.c ============================================================================== --- stable/8/sbin/mount/mount.c Mon Sep 19 16:25:37 2011 (r225673) +++ stable/8/sbin/mount/mount.c Mon Sep 19 16:28:36 2011 (r225674) @@ -588,6 +588,9 @@ mountfs(const char *vfstype, const char for (i = 1; i < mnt_argv.c; i++) (void)printf(" %s", mnt_argv.a[i]); (void)printf("\n"); + free(optbuf); + free(mountprog); + mountprog = NULL; return (0); } @@ -598,6 +601,8 @@ mountfs(const char *vfstype, const char } free(optbuf); + free(mountprog); + mountprog = NULL; if (verbose) { if (statfs(name, &sf) < 0) { From owner-svn-src-all@FreeBSD.ORG Mon Sep 19 18:29:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84283106564A; Mon, 19 Sep 2011 18:29:15 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 730058FC12; Mon, 19 Sep 2011 18:29:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8JITFPJ091403; Mon, 19 Sep 2011 18:29:15 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8JITF0Y091400; Mon, 19 Sep 2011 18:29:15 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201109191829.p8JITF0Y091400@svn.freebsd.org> From: Attilio Rao Date: Mon, 19 Sep 2011 18:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225675 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2011 18:29:15 -0000 Author: attilio Date: Mon Sep 19 18:29:15 2011 New Revision: 225675 URL: http://svn.freebsd.org/changeset/base/225675 Log: It is safe to initialize locks even on early boot (and it is the same thing all the other architectures already do) thus just initialize kernel_pmap in pmap_bootstrap(). Reported by: alc Reviewed by: alc, marius Tested by: flo, marius Approved by: re (kib) MFC after: 1 week Modified: head/sys/sparc64/sparc64/machdep.c head/sys/sparc64/sparc64/pmap.c Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Mon Sep 19 16:28:36 2011 (r225674) +++ head/sys/sparc64/sparc64/machdep.c Mon Sep 19 18:29:15 2011 (r225675) @@ -597,11 +597,6 @@ sparc64_init(caddr_t mdp, u_long o1, u_l wrpr(pil, 0, 0); wrpr(pstate, 0, PSTATE_KERNEL); - /* - * Finish pmap initialization now that we're ready for mutexes. - */ - PMAP_LOCK_INIT(kernel_pmap); - OF_getprop(root, "name", sparc64_model, sizeof(sparc64_model) - 1); kdb_init(); Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Mon Sep 19 16:28:36 2011 (r225674) +++ head/sys/sparc64/sparc64/pmap.c Mon Sep 19 18:29:15 2011 (r225675) @@ -671,11 +671,9 @@ pmap_bootstrap(u_int cpu_impl) /* * Initialize the kernel pmap (which is statically allocated). - * NOTE: PMAP_LOCK_INIT() is needed as part of the initialization - * but sparc64 start up is not ready to initialize mutexes yet. - * It is called in machdep.c. */ pm = kernel_pmap; + PMAP_LOCK_INIT(pm); for (i = 0; i < MAXCPU; i++) pm->pm_context[i] = TLB_CTX_KERNEL; CPU_FILL(&pm->pm_active); From owner-svn-src-all@FreeBSD.ORG Mon Sep 19 21:47:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DC6C1065678; Mon, 19 Sep 2011 21:47:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CD608FC15; Mon, 19 Sep 2011 21:47:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8JLlLmt097402; Mon, 19 Sep 2011 21:47:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8JLlL0W097398; Mon, 19 Sep 2011 21:47:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201109192147.p8JLlL0W097398@svn.freebsd.org> From: Michael Tuexen Date: Mon, 19 Sep 2011 21:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225676 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2011 21:47:21 -0000 Author: tuexen Date: Mon Sep 19 21:47:20 2011 New Revision: 225676 URL: http://svn.freebsd.org/changeset/base/225676 Log: Cleanup the iterator code, remove code that is never executed. Approved by: re MFC after: 1 month. Modified: head/sys/netinet/sctp_bsd_addr.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_bsd_addr.c ============================================================================== --- head/sys/netinet/sctp_bsd_addr.c Mon Sep 19 18:29:15 2011 (r225675) +++ head/sys/netinet/sctp_bsd_addr.c Mon Sep 19 21:47:20 2011 (r225676) @@ -74,22 +74,6 @@ MALLOC_DEFINE(SCTP_M_MCORE, "sctp_mcore" /* Global NON-VNET structure that controls the iterator */ struct iterator_control sctp_it_ctl; -static int __sctp_thread_based_iterator_started = 0; - - -static void -sctp_cleanup_itqueue(void) -{ - struct sctp_iterator *it, *nit; - - TAILQ_FOREACH_SAFE(it, &sctp_it_ctl.iteratorhead, sctp_nxt_itr, nit) { - if (it->function_atend != NULL) { - (*it->function_atend) (it->pointer, it->val); - } - TAILQ_REMOVE(&sctp_it_ctl.iteratorhead, it, sctp_nxt_itr); - SCTP_FREE(it, SCTP_M_ITER); - } -} void @@ -102,17 +86,11 @@ static void sctp_iterator_thread(void *v) { SCTP_IPI_ITERATOR_WQ_LOCK(); + /* In FreeBSD this thread never terminates. */ while (1) { msleep(&sctp_it_ctl.iterator_running, &sctp_it_ctl.ipi_iterator_wq_mtx, 0, "waiting_for_work", 0); - if (sctp_it_ctl.iterator_flags & SCTP_ITERATOR_MUST_EXIT) { - SCTP_IPI_ITERATOR_WQ_DESTROY(); - SCTP_ITERATOR_LOCK_DESTROY(); - sctp_cleanup_itqueue(); - __sctp_thread_based_iterator_started = 0; - kthread_exit(); - } sctp_iterator_worker(); } } @@ -120,21 +98,21 @@ sctp_iterator_thread(void *v) void sctp_startup_iterator(void) { - if (__sctp_thread_based_iterator_started) { + static int called = 0; + int ret; + + if (called) { /* You only get one */ return; } /* init the iterator head */ - __sctp_thread_based_iterator_started = 1; + called = 1; sctp_it_ctl.iterator_running = 0; sctp_it_ctl.iterator_flags = 0; sctp_it_ctl.cur_it = NULL; SCTP_ITERATOR_LOCK_INIT(); SCTP_IPI_ITERATOR_WQ_INIT(); TAILQ_INIT(&sctp_it_ctl.iteratorhead); - - int ret; - ret = kproc_create(sctp_iterator_thread, (void *)NULL, &sctp_it_ctl.thread_proc, Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Mon Sep 19 18:29:15 2011 (r225675) +++ head/sys/netinet/sctp_structs.h Mon Sep 19 21:47:20 2011 (r225676) @@ -185,9 +185,8 @@ struct iterator_control { uint32_t iterator_flags; }; -#define SCTP_ITERATOR_MUST_EXIT 0x00000001 -#define SCTP_ITERATOR_STOP_CUR_IT 0x00000002 -#define SCTP_ITERATOR_STOP_CUR_INP 0x00000004 +#define SCTP_ITERATOR_STOP_CUR_IT 0x00000004 +#define SCTP_ITERATOR_STOP_CUR_INP 0x00000008 struct sctp_net_route { sctp_rtentry_t *ro_rt; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon Sep 19 18:29:15 2011 (r225675) +++ head/sys/netinet/sctputil.c Mon Sep 19 21:47:20 2011 (r225676) @@ -1293,10 +1293,6 @@ select_a_new_ep: SCTP_INP_DECR_REF(it->inp); atomic_add_int(&it->stcb->asoc.refcnt, -1); if (sctp_it_ctl.iterator_flags & - SCTP_ITERATOR_MUST_EXIT) { - goto done_with_iterator; - } - if (sctp_it_ctl.iterator_flags & SCTP_ITERATOR_STOP_CUR_IT) { sctp_it_ctl.iterator_flags &= ~SCTP_ITERATOR_STOP_CUR_IT; goto done_with_iterator; @@ -1372,9 +1368,6 @@ sctp_iterator_worker(void) sctp_it_ctl.cur_it = NULL; CURVNET_RESTORE(); SCTP_IPI_ITERATOR_WQ_LOCK(); - if (sctp_it_ctl.iterator_flags & SCTP_ITERATOR_MUST_EXIT) { - break; - } /* sa_ignore FREED_MEMORY */ } sctp_it_ctl.iterator_running = 0; From owner-svn-src-all@FreeBSD.ORG Mon Sep 19 22:35:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64895106566B; Mon, 19 Sep 2011 22:35:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52EF58FC0A; Mon, 19 Sep 2011 22:35:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8JMZsrH098942; Mon, 19 Sep 2011 22:35:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8JMZsop098940; Mon, 19 Sep 2011 22:35:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201109192235.p8JMZsop098940@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 19 Sep 2011 22:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225677 - head/contrib/tzcode/stdtime X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2011 22:35:54 -0000 Author: kib Date: Mon Sep 19 22:35:54 2011 New Revision: 225677 URL: http://svn.freebsd.org/changeset/base/225677 Log: Do not overallocate on the stack. Threaded code might use custom stack size. Reported by: many Tested by: Jeremie Le Hen (previous version) Reviewed by: jilles Approved by: re (bz) MFC after: 2 weeks Modified: head/contrib/tzcode/stdtime/localtime.c Modified: head/contrib/tzcode/stdtime/localtime.c ============================================================================== --- head/contrib/tzcode/stdtime/localtime.c Mon Sep 19 21:47:20 2011 (r225676) +++ head/contrib/tzcode/stdtime/localtime.c Mon Sep 19 22:35:54 2011 (r225677) @@ -380,13 +380,16 @@ register const int doextend; int fid; int stored; int nread; + int res; union { struct tzhead tzhead; char buf[2 * sizeof(struct tzhead) + 2 * sizeof *sp + 4 * TZ_MAX_TIMES]; - } u; + } *u; + u = NULL; + res = -1; sp->goback = sp->goahead = FALSE; /* XXX The following is from OpenBSD, and I'm not sure it is correct */ @@ -406,16 +409,24 @@ register const int doextend; ** to hold the longest file name string that the implementation ** guarantees can be opened." */ - char fullname[FILENAME_MAX + 1]; + char *fullname; + + fullname = malloc(FILENAME_MAX + 1); + if (fullname == NULL) + goto out; if (name[0] == ':') ++name; doaccess = name[0] == '/'; if (!doaccess) { - if ((p = TZDIR) == NULL) + if ((p = TZDIR) == NULL) { + free(fullname); return -1; - if ((strlen(p) + 1 + strlen(name) + 1) >= sizeof fullname) + } + if (strlen(p) + 1 + strlen(name) >= FILENAME_MAX) { + free(fullname); return -1; + } (void) strcpy(fullname, p); (void) strcat(fullname, "/"); (void) strcat(fullname, name); @@ -426,37 +437,45 @@ register const int doextend; doaccess = TRUE; name = fullname; } - if (doaccess && access(name, R_OK) != 0) + if (doaccess && access(name, R_OK) != 0) { + free(fullname); return -1; - if ((fid = _open(name, OPEN_MODE)) == -1) + } + if ((fid = _open(name, OPEN_MODE)) == -1) { + free(fullname); return -1; + } if ((_fstat(fid, &stab) < 0) || !S_ISREG(stab.st_mode)) { + free(fullname); _close(fid); return -1; } } - nread = _read(fid, u.buf, sizeof u.buf); + u = malloc(sizeof(*u)); + if (u == NULL) + goto out; + nread = _read(fid, u->buf, sizeof u->buf); if (_close(fid) < 0 || nread <= 0) - return -1; + goto out; for (stored = 4; stored <= 8; stored *= 2) { int ttisstdcnt; int ttisgmtcnt; - ttisstdcnt = (int) detzcode(u.tzhead.tzh_ttisstdcnt); - ttisgmtcnt = (int) detzcode(u.tzhead.tzh_ttisgmtcnt); - sp->leapcnt = (int) detzcode(u.tzhead.tzh_leapcnt); - sp->timecnt = (int) detzcode(u.tzhead.tzh_timecnt); - sp->typecnt = (int) detzcode(u.tzhead.tzh_typecnt); - sp->charcnt = (int) detzcode(u.tzhead.tzh_charcnt); - p = u.tzhead.tzh_charcnt + sizeof u.tzhead.tzh_charcnt; + ttisstdcnt = (int) detzcode(u->tzhead.tzh_ttisstdcnt); + ttisgmtcnt = (int) detzcode(u->tzhead.tzh_ttisgmtcnt); + sp->leapcnt = (int) detzcode(u->tzhead.tzh_leapcnt); + sp->timecnt = (int) detzcode(u->tzhead.tzh_timecnt); + sp->typecnt = (int) detzcode(u->tzhead.tzh_typecnt); + sp->charcnt = (int) detzcode(u->tzhead.tzh_charcnt); + p = u->tzhead.tzh_charcnt + sizeof u->tzhead.tzh_charcnt; if (sp->leapcnt < 0 || sp->leapcnt > TZ_MAX_LEAPS || sp->typecnt <= 0 || sp->typecnt > TZ_MAX_TYPES || sp->timecnt < 0 || sp->timecnt > TZ_MAX_TIMES || sp->charcnt < 0 || sp->charcnt > TZ_MAX_CHARS || (ttisstdcnt != sp->typecnt && ttisstdcnt != 0) || (ttisgmtcnt != sp->typecnt && ttisgmtcnt != 0)) - return -1; - if (nread - (p - u.buf) < + goto out; + if (nread - (p - u->buf) < sp->timecnt * stored + /* ats */ sp->timecnt + /* types */ sp->typecnt * 6 + /* ttinfos */ @@ -464,7 +483,7 @@ register const int doextend; sp->leapcnt * (stored + 4) + /* lsinfos */ ttisstdcnt + /* ttisstds */ ttisgmtcnt) /* ttisgmts */ - return -1; + goto out; for (i = 0; i < sp->timecnt; ++i) { sp->ats[i] = (stored == 4) ? detzcode(p) : detzcode64(p); @@ -473,7 +492,7 @@ register const int doextend; for (i = 0; i < sp->timecnt; ++i) { sp->types[i] = (unsigned char) *p++; if (sp->types[i] >= sp->typecnt) - return -1; + goto out; } for (i = 0; i < sp->typecnt; ++i) { struct ttinfo * ttisp; @@ -483,11 +502,11 @@ register const int doextend; p += 4; ttisp->tt_isdst = (unsigned char) *p++; if (ttisp->tt_isdst != 0 && ttisp->tt_isdst != 1) - return -1; + goto out; ttisp->tt_abbrind = (unsigned char) *p++; if (ttisp->tt_abbrind < 0 || ttisp->tt_abbrind > sp->charcnt) - return -1; + goto out; } for (i = 0; i < sp->charcnt; ++i) sp->chars[i] = *p++; @@ -512,7 +531,7 @@ register const int doextend; ttisp->tt_ttisstd = *p++; if (ttisp->tt_ttisstd != TRUE && ttisp->tt_ttisstd != FALSE) - return -1; + goto out; } } for (i = 0; i < sp->typecnt; ++i) { @@ -525,7 +544,7 @@ register const int doextend; ttisp->tt_ttisgmt = *p++; if (ttisp->tt_ttisgmt != TRUE && ttisp->tt_ttisgmt != FALSE) - return -1; + goto out; } } /* @@ -558,11 +577,11 @@ register const int doextend; /* ** If this is an old file, we're done. */ - if (u.tzhead.tzh_version[0] == '\0') + if (u->tzhead.tzh_version[0] == '\0') break; - nread -= p - u.buf; + nread -= p - u->buf; for (i = 0; i < nread; ++i) - u.buf[i] = p[i]; + u->buf[i] = p[i]; /* ** If this is a narrow integer time_t system, we're done. */ @@ -570,39 +589,43 @@ register const int doextend; break; } if (doextend && nread > 2 && - u.buf[0] == '\n' && u.buf[nread - 1] == '\n' && + u->buf[0] == '\n' && u->buf[nread - 1] == '\n' && sp->typecnt + 2 <= TZ_MAX_TYPES) { - struct state ts; + struct state *ts; register int result; - u.buf[nread - 1] = '\0'; - result = tzparse(&u.buf[1], &ts, FALSE); - if (result == 0 && ts.typecnt == 2 && - sp->charcnt + ts.charcnt <= TZ_MAX_CHARS) { + ts = malloc(sizeof(*ts)); + if (ts == NULL) + goto out; + u->buf[nread - 1] = '\0'; + result = tzparse(&u->buf[1], ts, FALSE); + if (result == 0 && ts->typecnt == 2 && + sp->charcnt + ts->charcnt <= TZ_MAX_CHARS) { for (i = 0; i < 2; ++i) - ts.ttis[i].tt_abbrind += + ts->ttis[i].tt_abbrind += sp->charcnt; - for (i = 0; i < ts.charcnt; ++i) + for (i = 0; i < ts->charcnt; ++i) sp->chars[sp->charcnt++] = - ts.chars[i]; + ts->chars[i]; i = 0; - while (i < ts.timecnt && - ts.ats[i] <= + while (i < ts->timecnt && + ts->ats[i] <= sp->ats[sp->timecnt - 1]) ++i; - while (i < ts.timecnt && + while (i < ts->timecnt && sp->timecnt < TZ_MAX_TIMES) { sp->ats[sp->timecnt] = - ts.ats[i]; + ts->ats[i]; sp->types[sp->timecnt] = sp->typecnt + - ts.types[i]; + ts->types[i]; ++sp->timecnt; ++i; } - sp->ttis[sp->typecnt++] = ts.ttis[0]; - sp->ttis[sp->typecnt++] = ts.ttis[1]; + sp->ttis[sp->typecnt++] = ts->ttis[0]; + sp->ttis[sp->typecnt++] = ts->ttis[1]; } + free(ts); } if (sp->timecnt > 1) { for (i = 1; i < sp->timecnt; ++i) @@ -620,7 +643,10 @@ register const int doextend; break; } } - return 0; + res = 0; +out: + free(u); + return (res); } static int From owner-svn-src-all@FreeBSD.ORG Mon Sep 19 22:49:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5905106566B; Mon, 19 Sep 2011 22:49:36 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4B5B8FC08; Mon, 19 Sep 2011 22:49:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8JMnaMQ099384; Mon, 19 Sep 2011 22:49:36 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8JMnasC099382; Mon, 19 Sep 2011 22:49:36 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201109192249.p8JMnasC099382@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 19 Sep 2011 22:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225678 - head/lib/libc/iconv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2011 22:49:36 -0000 Author: gabor Date: Mon Sep 19 22:49:36 2011 New Revision: 225678 URL: http://svn.freebsd.org/changeset/base/225678 Log: - Fix a trivial bug in iconv. When there is no space to perform the conversion, conversion must fail and errno must be set to E2BIG. PR: standards/160673 Submitted by: Henning Petersen Reviewed by: pluknet Approved by: re (kib), delphij (mentor) Modified: head/lib/libc/iconv/citrus_none.c Modified: head/lib/libc/iconv/citrus_none.c ============================================================================== --- head/lib/libc/iconv/citrus_none.c Mon Sep 19 22:35:54 2011 (r225677) +++ head/lib/libc/iconv/citrus_none.c Mon Sep 19 22:49:36 2011 (r225678) @@ -190,7 +190,6 @@ _citrus_NONE_stdenc_wctomb(struct _citru void * __restrict pspriv __unused, size_t * __restrict nresult, struct iconv_hooks *hooks __unused) { - int ret; if ((wc & ~0xFFU) != 0) { *nresult = (size_t)-1; @@ -198,7 +197,7 @@ _citrus_NONE_stdenc_wctomb(struct _citru } if (n == 0) { *nresult = (size_t)-1; - ret = E2BIG; + return (E2BIG); } *nresult = 1; From owner-svn-src-all@FreeBSD.ORG Tue Sep 20 00:29:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D1DD106564A; Tue, 20 Sep 2011 00:29:17 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CE648FC17; Tue, 20 Sep 2011 00:29:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8K0THiU002725; Tue, 20 Sep 2011 00:29:17 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8K0THgP002723; Tue, 20 Sep 2011 00:29:17 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201109200029.p8K0THgP002723@svn.freebsd.org> From: Hiroki Sato Date: Tue, 20 Sep 2011 00:29:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225682 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2011 00:29:17 -0000 Author: hrs Date: Tue Sep 20 00:29:17 2011 New Revision: 225682 URL: http://svn.freebsd.org/changeset/base/225682 Log: Copy ip6po_minmtu and ip6po_prefer_tempaddr in ip6_copypktopts(). This fixes inconsistency when options are specified by both setsockopt() and ancillary data types. PR: kern/158307 Approved by: re (bz) Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Tue Sep 20 00:23:59 2011 (r225681) +++ head/sys/netinet6/ip6_output.c Tue Sep 20 00:29:17 2011 (r225682) @@ -2367,6 +2367,8 @@ copypktopts(struct ip6_pktopts *dst, str dst->ip6po_hlim = src->ip6po_hlim; dst->ip6po_tclass = src->ip6po_tclass; dst->ip6po_flags = src->ip6po_flags; + dst->ip6po_minmtu = src->ip6po_minmtu; + dst->ip6po_prefer_tempaddr = src->ip6po_prefer_tempaddr; if (src->ip6po_pktinfo) { dst->ip6po_pktinfo = malloc(sizeof(*dst->ip6po_pktinfo), M_IP6OPT, canwait); From owner-svn-src-all@FreeBSD.ORG Tue Sep 20 00:32:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 834ED1065675; Tue, 20 Sep 2011 00:32:30 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72BB18FC08; Tue, 20 Sep 2011 00:32:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8K0WUVp002858; Tue, 20 Sep 2011 00:32:30 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8K0WUqk002856; Tue, 20 Sep 2011 00:32:30 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201109200032.p8K0WUqk002856@svn.freebsd.org> From: Hiroki Sato Date: Tue, 20 Sep 2011 00:32:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225683 - head/usr.sbin/rtadvd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2011 00:32:30 -0000 Author: hrs Date: Tue Sep 20 00:32:30 2011 New Revision: 225683 URL: http://svn.freebsd.org/changeset/base/225683 Log: Remove RA timer on an interface with !IFF_UP actively after starting to send clean-up RA messages for shutting down. The RA timers could prevent the rtadvd daemon from shutting down because ra_output() just ignored !IFF_UP interfaces and TRANSITIVE->UNCONFIGURED state transition never happened due to it. Spotted by: kib Approved by: re (bz) Modified: head/usr.sbin/rtadvd/rtadvd.c Modified: head/usr.sbin/rtadvd/rtadvd.c ============================================================================== --- head/usr.sbin/rtadvd/rtadvd.c Tue Sep 20 00:29:17 2011 (r225682) +++ head/usr.sbin/rtadvd/rtadvd.c Tue Sep 20 00:32:30 2011 (r225683) @@ -381,6 +381,21 @@ rtadvd_shutdown(void) "waiting expiration of the all RA timers."); TAILQ_FOREACH(ifi, &ifilist, ifi_next) { + /* + * Ignore !IFF_UP interfaces in waiting for shutdown. + */ + if (!(ifi->ifi_flags & IFF_UP) && + ifi->ifi_ra_timer != NULL) { + ifi->ifi_state = IFI_STATE_UNCONFIGURED; + rtadvd_remove_timer(ifi->ifi_ra_timer); + ifi->ifi_ra_timer = NULL; + syslog(LOG_DEBUG, "<%s> %s(idx=%d) is down. " + "Timer removed and marked as UNCONFIGURED.", + __func__, ifi->ifi_ifname, + ifi->ifi_ifindex); + } + } + TAILQ_FOREACH(ifi, &ifilist, ifi_next) { if (ifi->ifi_ra_timer != NULL) break; } From owner-svn-src-all@FreeBSD.ORG Tue Sep 20 00:37:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB0B11065686; Tue, 20 Sep 2011 00:37:35 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AC868FC19; Tue, 20 Sep 2011 00:37:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8K0bZGt003046; Tue, 20 Sep 2011 00:37:35 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8K0bZ0x003043; Tue, 20 Sep 2011 00:37:35 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201109200037.p8K0bZ0x003043@svn.freebsd.org> From: Hiroki Sato Date: Tue, 20 Sep 2011 00:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225684 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2011 00:37:35 -0000 Author: hrs Date: Tue Sep 20 00:37:35 2011 New Revision: 225684 URL: http://svn.freebsd.org/changeset/base/225684 Log: Use REQUIRE: line to reorder rc.d/bridge instead of BEFORE: line. Pointed out by: dougb Approved by: re (bz) Modified: head/etc/rc.d/NETWORKING head/etc/rc.d/bridge Modified: head/etc/rc.d/NETWORKING ============================================================================== --- head/etc/rc.d/NETWORKING Tue Sep 20 00:32:30 2011 (r225683) +++ head/etc/rc.d/NETWORKING Tue Sep 20 00:37:35 2011 (r225684) @@ -5,7 +5,7 @@ # PROVIDE: NETWORKING NETWORK # REQUIRE: netif netoptions routing ppp ipfw stf faith -# REQUIRE: defaultroute routed mrouted route6d mroute6d resolv +# REQUIRE: defaultroute routed mrouted route6d mroute6d resolv bridge # This is a dummy dependency, for services which require networking # to be operational before starting. Modified: head/etc/rc.d/bridge ============================================================================== --- head/etc/rc.d/bridge Tue Sep 20 00:32:30 2011 (r225683) +++ head/etc/rc.d/bridge Tue Sep 20 00:37:35 2011 (r225684) @@ -27,7 +27,6 @@ # PROVIDE: bridge # REQUIRE: netif faith ppp stf -# BEFORE: SERVERS # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-all@FreeBSD.ORG Tue Sep 20 04:30:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54862106566C; Tue, 20 Sep 2011 04:30:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 450C78FC13; Tue, 20 Sep 2011 04:30:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8K4UOBT010297; Tue, 20 Sep 2011 04:30:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8K4UOV3010295; Tue, 20 Sep 2011 04:30:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201109200430.p8K4UOV3010295@svn.freebsd.org> From: Adrian Chadd Date: Tue, 20 Sep 2011 04:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225686 - head/sys/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2011 04:30:24 -0000 Author: adrian Date: Tue Sep 20 04:30:23 2011 New Revision: 225686 URL: http://svn.freebsd.org/changeset/base/225686 Log: Manually set the channel when using monitor mode - the firmware doesn't select it automatically. Submitted by: nox Reviewed by: bschmidt Approved by: re PR: kern/160815 Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Tue Sep 20 04:20:55 2011 (r225685) +++ head/sys/dev/iwn/if_iwn.c Tue Sep 20 04:30:23 2011 (r225686) @@ -6952,12 +6952,24 @@ iwn_set_channel(struct ieee80211com *ic) const struct ieee80211_channel *c = ic->ic_curchan; struct ifnet *ifp = ic->ic_ifp; struct iwn_softc *sc = ifp->if_softc; + int error; IWN_LOCK(sc); sc->sc_rxtap.wr_chan_freq = htole16(c->ic_freq); sc->sc_rxtap.wr_chan_flags = htole16(c->ic_flags); sc->sc_txtap.wt_chan_freq = htole16(c->ic_freq); sc->sc_txtap.wt_chan_flags = htole16(c->ic_flags); + + /* + * Only need to set the channel in Monitor mode. AP scanning and auth + * are already taken care of by their respective firmware commands. + */ + if (ic->ic_opmode == IEEE80211_M_MONITOR) { + error = iwn_config(sc); + if (error != 0) + device_printf(sc->sc_dev, + "%s: error %d settting channel\n", __func__, error); + } IWN_UNLOCK(sc); } From owner-svn-src-all@FreeBSD.ORG Tue Sep 20 04:59:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DBB4106566C; Tue, 20 Sep 2011 04:59:35 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D3A98FC08; Tue, 20 Sep 2011 04:59:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8K4xZYt011271; Tue, 20 Sep 2011 04:59:35 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8K4xYd0011269; Tue, 20 Sep 2011 04:59:34 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201109200459.p8K4xYd0011269@svn.freebsd.org> From: Christian Brueffer Date: Tue, 20 Sep 2011 04:59:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225687 - stable/8/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2011 04:59:35 -0000 Author: brueffer Date: Tue Sep 20 04:59:34 2011 New Revision: 225687 URL: http://svn.freebsd.org/changeset/base/225687 Log: MFC: r225533 Improve the sleep_delay sysctl description by specifying which unit the number is in. Modified: stable/8/sys/dev/acpica/acpi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/acpica/acpi.c ============================================================================== --- stable/8/sys/dev/acpica/acpi.c Tue Sep 20 04:30:23 2011 (r225686) +++ stable/8/sys/dev/acpica/acpi.c Tue Sep 20 04:59:34 2011 (r225687) @@ -586,7 +586,7 @@ acpi_attach(device_t dev) &sc->acpi_suspend_sx, 0, acpi_sleep_state_sysctl, "A", ""); SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "sleep_delay", CTLFLAG_RW, &sc->acpi_sleep_delay, 0, - "sleep delay"); + "sleep delay in seconds"); SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "s4bios", CTLFLAG_RW, &sc->acpi_s4bios, 0, "S4BIOS mode"); SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), From owner-svn-src-all@FreeBSD.ORG Tue Sep 20 05:02:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A33B4106564A; Tue, 20 Sep 2011 05:02:48 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92C468FC0A; Tue, 20 Sep 2011 05:02:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8K52mfg011438; Tue, 20 Sep 2011 05:02:48 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8K52mUY011436; Tue, 20 Sep 2011 05:02:48 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201109200502.p8K52mUY011436@svn.freebsd.org> From: Christian Brueffer Date: Tue, 20 Sep 2011 05:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225688 - stable/7/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2011 05:02:48 -0000 Author: brueffer Date: Tue Sep 20 05:02:48 2011 New Revision: 225688 URL: http://svn.freebsd.org/changeset/base/225688 Log: MFC: r225533 Improve the sleep_delay sysctl description by specifying which unit the number is in. Modified: stable/7/sys/dev/acpica/acpi.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/acpica/acpi.c ============================================================================== --- stable/7/sys/dev/acpica/acpi.c Tue Sep 20 04:59:34 2011 (r225687) +++ stable/7/sys/dev/acpica/acpi.c Tue Sep 20 05:02:48 2011 (r225688) @@ -534,7 +534,7 @@ acpi_attach(device_t dev) &sc->acpi_suspend_sx, 0, acpi_sleep_state_sysctl, "A", ""); SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "sleep_delay", CTLFLAG_RW, &sc->acpi_sleep_delay, 0, - "sleep delay"); + "sleep delay in seconds"); SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "s4bios", CTLFLAG_RW, &sc->acpi_s4bios, 0, "S4BIOS mode"); SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), From owner-svn-src-all@FreeBSD.ORG Tue Sep 20 08:34:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88736106564A; Tue, 20 Sep 2011 08:34:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DD928FC1B; Tue, 20 Sep 2011 08:34:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8K8YFFB018222; Tue, 20 Sep 2011 08:34:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8K8YFaL018220; Tue, 20 Sep 2011 08:34:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201109200834.p8K8YFaL018220@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 20 Sep 2011 08:34:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225692 - stable/8/sbin/mdmfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2011 08:34:15 -0000 Author: kib Date: Tue Sep 20 08:34:15 2011 New Revision: 225692 URL: http://svn.freebsd.org/changeset/base/225692 Log: MFC r225534: Do not try to change the mode or ownership of the root of the mountpoint when newly established mdmfs mount is readonly. Modified: stable/8/sbin/mdmfs/mdmfs.c Directory Properties: stable/8/sbin/mdmfs/ (props changed) Modified: stable/8/sbin/mdmfs/mdmfs.c ============================================================================== --- stable/8/sbin/mdmfs/mdmfs.c Tue Sep 20 08:11:07 2011 (r225691) +++ stable/8/sbin/mdmfs/mdmfs.c Tue Sep 20 08:34:15 2011 (r225692) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -60,6 +61,7 @@ struct mtpt_info { bool mi_have_gid; mode_t mi_mode; bool mi_have_mode; + bool mi_forced_pw; }; static bool debug; /* Emit debugging information? */ @@ -204,6 +206,7 @@ main(int argc, char **argv) usage(); mi.mi_mode = getmode(set, S_IRWXU | S_IRWXG | S_IRWXO); mi.mi_have_mode = true; + mi.mi_forced_pw = true; free(set); break; case 'S': @@ -223,6 +226,7 @@ main(int argc, char **argv) break; case 'w': extract_ugid(optarg, &mi); + mi.mi_forced_pw = true; break; case 'X': debug = true; @@ -443,6 +447,29 @@ do_mount(const char *args, const char *m static void do_mtptsetup(const char *mtpoint, struct mtpt_info *mip) { + struct statfs sfs; + + if (!mip->mi_have_mode && !mip->mi_have_uid && !mip->mi_have_gid) + return; + + if (!norun) { + if (statfs(mtpoint, &sfs) == -1) { + warn("statfs: %s", mtpoint); + return; + } + if ((sfs.f_flags & MNT_RDONLY) != 0) { + if (mip->mi_forced_pw) { + warnx( + "Not changing mode/owner of %s since it is read-only", + mtpoint); + } else { + debugprintf( + "Not changing mode/owner of %s since it is read-only", + mtpoint); + } + return; + } + } if (mip->mi_have_mode) { debugprintf("changing mode of %s to %o.", mtpoint, From owner-svn-src-all@FreeBSD.ORG Tue Sep 20 14:17:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9894B1065675; Tue, 20 Sep 2011 14:17:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 887C88FC0A; Tue, 20 Sep 2011 14:17:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8KEHw57031972; Tue, 20 Sep 2011 14:17:58 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8KEHwvZ031970; Tue, 20 Sep 2011 14:17:58 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201109201417.p8KEHwvZ031970@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 20 Sep 2011 14:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225695 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2011 14:17:58 -0000 Author: hselasky Date: Tue Sep 20 14:17:58 2011 New Revision: 225695 URL: http://svn.freebsd.org/changeset/base/225695 Log: Avoid starting the USB transfer if an error is already pending. This change fixes a race in device side mode during clear-stall from host, which can cause data to be sent too early on the given endpoint. Approved by: re (kib) MFC after: 1 week Modified: head/sys/dev/usb/usb_transfer.c Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Tue Sep 20 13:04:52 2011 (r225694) +++ head/sys/dev/usb/usb_transfer.c Tue Sep 20 14:17:58 2011 (r225695) @@ -2417,8 +2417,9 @@ usbd_transfer_start_cb(void *arg) #if USB_HAVE_PF usbpf_xfertap(xfer, USBPF_XFERTAP_SUBMIT); #endif - /* start the transfer */ - (ep->methods->start) (xfer); + /* start USB transfer, if no error */ + if (xfer->error == 0) + (ep->methods->start) (xfer); xfer->flags_int.can_cancel_immed = 1; @@ -2597,8 +2598,9 @@ usbd_pipe_start(struct usb_xfer_queue *p #if USB_HAVE_PF usbpf_xfertap(xfer, USBPF_XFERTAP_SUBMIT); #endif - /* start USB transfer */ - (ep->methods->start) (xfer); + /* start USB transfer, if no error */ + if (xfer->error == 0) + (ep->methods->start) (xfer); xfer->flags_int.can_cancel_immed = 1; From owner-svn-src-all@FreeBSD.ORG Tue Sep 20 20:27:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89B941065672; Tue, 20 Sep 2011 20:27:26 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6070B8FC15; Tue, 20 Sep 2011 20:27:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8KKRQMW043404; Tue, 20 Sep 2011 20:27:26 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8KKRQfQ043399; Tue, 20 Sep 2011 20:27:26 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201109202027.p8KKRQfQ043399@svn.freebsd.org> From: Kip Macy Date: Tue, 20 Sep 2011 20:27:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225698 - in head/sys: net netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2011 20:27:26 -0000 Author: kmacy Date: Tue Sep 20 20:27:26 2011 New Revision: 225698 URL: http://svn.freebsd.org/changeset/base/225698 Log: Make KBI changes required for future MFCing of inpcb rtentry / llentry caching. Reviewed by: rwatson, bz Approved by: re (kib) Modified: head/sys/net/if_llatbl.h head/sys/net/radix.h head/sys/net/route.h head/sys/netinet6/in6.h Modified: head/sys/net/if_llatbl.h ============================================================================== --- head/sys/net/if_llatbl.h Tue Sep 20 19:07:56 2011 (r225697) +++ head/sys/net/if_llatbl.h Tue Sep 20 20:27:26 2011 (r225698) @@ -59,6 +59,7 @@ struct llentry { struct rwlock lle_lock; struct lltable *lle_tbl; struct llentries *lle_head; + void (*lle_free)(struct lltable *, struct llentry *); struct mbuf *la_hold; int la_numheld; /* # of packets currently held */ time_t la_expire; Modified: head/sys/net/radix.h ============================================================================== --- head/sys/net/radix.h Tue Sep 20 19:07:56 2011 (r225697) +++ head/sys/net/radix.h Tue Sep 20 20:27:26 2011 (r225698) @@ -105,6 +105,8 @@ typedef int walktree_f_t(struct radix_no struct radix_node_head { struct radix_node *rnh_treetop; + u_int rnh_gen; /* generation counter */ + int rnh_multipath; /* multipath capable ? */ int rnh_addrsize; /* permit, but not require fixed keys */ int rnh_pktsize; /* permit, but not require fixed keys */ struct radix_node *(*rnh_addaddr) /* add based on sockaddr */ @@ -131,8 +133,6 @@ struct radix_node_head { void (*rnh_close) /* do something when the last ref drops */ (struct radix_node *rn, struct radix_node_head *head); struct radix_node rnh_nodes[3]; /* empty tree for common case */ - int rnh_multipath; /* multipath capable ? */ - u_int rnh_spare; /* route caching */ #ifdef _KERNEL struct rwlock rnh_lock; /* locks entire radix tree */ #endif Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Tue Sep 20 19:07:56 2011 (r225697) +++ head/sys/net/route.h Tue Sep 20 20:27:26 2011 (r225698) @@ -49,9 +49,13 @@ struct route { struct rtentry *ro_rt; struct llentry *ro_lle; + struct in_ifaddr *ro_ia; + int ro_flags; struct sockaddr ro_dst; }; +#define RT_CACHING_CONTEXT 0x1 + /* * These numbers are used by reliable protocols for determining * retransmission behavior and are included in the routing structure. Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Tue Sep 20 19:07:56 2011 (r225697) +++ head/sys/netinet6/in6.h Tue Sep 20 20:27:26 2011 (r225698) @@ -376,6 +376,8 @@ extern const struct in6_addr in6addr_lin struct route_in6 { struct rtentry *ro_rt; struct llentry *ro_lle; + struct in6_addr *ro_ia6; + int ro_flags; struct sockaddr_in6 ro_dst; }; #endif From owner-svn-src-all@FreeBSD.ORG Tue Sep 20 21:49:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DC0B1065670; Tue, 20 Sep 2011 21:49:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E06F8FC13; Tue, 20 Sep 2011 21:49:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8KLnttf045998; Tue, 20 Sep 2011 21:49:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8KLnttg045996; Tue, 20 Sep 2011 21:49:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201109202149.p8KLnttg045996@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 20 Sep 2011 21:49:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225699 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2011 21:49:55 -0000 Author: kib Date: Tue Sep 20 21:49:54 2011 New Revision: 225699 URL: http://svn.freebsd.org/changeset/base/225699 Log: Restore the writing of the .bss sections of the dsos (not the main executable) after r190885. The whole region for the dso is mmaped with MAP_NOCORE flag, doing only mprotect(2) over .bss prevented it from writing .bss to core files. Revert the optimization of using mprotect(2) to establish .bss, overlap the section with mmap(2). Reported by: attilio Reviewed by: attilio, emaste Approved by: re (bz) MFC after: 2 weeks Modified: head/libexec/rtld-elf/map_object.c Modified: head/libexec/rtld-elf/map_object.c ============================================================================== --- head/libexec/rtld-elf/map_object.c Tue Sep 20 20:27:26 2011 (r225698) +++ head/libexec/rtld-elf/map_object.c Tue Sep 20 21:49:54 2011 (r225699) @@ -215,8 +215,9 @@ map_object(int fd, const char *path, con bss_vlimit = round_page(segs[i]->p_vaddr + segs[i]->p_memsz); bss_addr = mapbase + (bss_vaddr - base_vaddr); if (bss_vlimit > bss_vaddr) { /* There is something to do */ - if (mprotect(bss_addr, bss_vlimit - bss_vaddr, data_prot) == -1) { - _rtld_error("%s: mprotect of bss failed: %s", path, + if (mmap(bss_addr, bss_vlimit - bss_vaddr, data_prot, + data_flags | MAP_ANON, -1, 0) == (caddr_t)-1) { + _rtld_error("%s: mmap of bss failed: %s", path, strerror(errno)); return NULL; } From owner-svn-src-all@FreeBSD.ORG Tue Sep 20 21:53:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D39A1065673; Tue, 20 Sep 2011 21:53:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DA028FC14; Tue, 20 Sep 2011 21:53:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8KLrRZI046139; Tue, 20 Sep 2011 21:53:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8KLrRK3046137; Tue, 20 Sep 2011 21:53:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201109202153.p8KLrRK3046137@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 20 Sep 2011 21:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225700 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2011 21:53:27 -0000 Author: kib Date: Tue Sep 20 21:53:26 2011 New Revision: 225700 URL: http://svn.freebsd.org/changeset/base/225700 Log: Use nowait sync request for a vnode when doing softdep cleanup. We possibly own the unrelated vnode lock, doing waiting sync causes deadlocks. Reported and tested by: pho Approved by: re (bz) Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Tue Sep 20 21:49:54 2011 (r225699) +++ head/sys/ufs/ffs/ffs_softdep.c Tue Sep 20 21:53:26 2011 (r225700) @@ -12648,7 +12648,7 @@ retry: MNT_ILOCK(mp); continue; } - (void) ffs_syncvnode(lvp, MNT_WAIT); + (void) ffs_syncvnode(lvp, MNT_NOWAIT); vput(lvp); MNT_ILOCK(mp); } From owner-svn-src-all@FreeBSD.ORG Tue Sep 20 23:44:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BDD1106564A; Tue, 20 Sep 2011 23:44:35 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A33A8FC08; Tue, 20 Sep 2011 23:44:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8KNiZFW049838; Tue, 20 Sep 2011 23:44:35 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8KNiZ9O049832; Tue, 20 Sep 2011 23:44:35 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201109202344.p8KNiZ9O049832@svn.freebsd.org> From: "Justin T. Gibbs" Date: Tue, 20 Sep 2011 23:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225704 - in head/sys: dev/xen/control xen/xenbus xen/xenstore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2011 23:44:35 -0000 Author: gibbs Date: Tue Sep 20 23:44:34 2011 New Revision: 225704 URL: http://svn.freebsd.org/changeset/base/225704 Log: Properly handle suspend/resume events in the Xen device framework. Sponsored by: BQ Internet sys/xen/xenbus/xenbusb.c: o In xenbusb_resume(), publish the state transition of the resuming device into XenbusStateIntiailising so that the remote peer can see it. Recording the state locally is not sufficient to trigger a re-connect sequence. o In xenbusb_resume(), defer new-bus resume processing until after the remote peer's XenStore address has been updated. The drivers may need to refer to this information during resume processing. sys/xen/xenbus/xenbusb_back.c: sys/xen/xenbus/xenbusb_front.c: Register xenbusb_resume() rather than bus_generic_resume() as the handler for device_resume events. sys/xen/xenstore/xenstore.c: o Fix grammer in a comment. o In xs_suspend(), pass suspend events on to the child devices (e.g. xenbusb_front/back, that are attached to the XenStore. Approved by: re MFC after: 1 week Modified: head/sys/dev/xen/control/control.c head/sys/xen/xenbus/xenbusb.c head/sys/xen/xenbus/xenbusb_back.c head/sys/xen/xenbus/xenbusb_front.c head/sys/xen/xenstore/xenstore.c Modified: head/sys/dev/xen/control/control.c ============================================================================== --- head/sys/dev/xen/control/control.c Tue Sep 20 23:22:58 2011 (r225703) +++ head/sys/dev/xen/control/control.c Tue Sep 20 23:44:34 2011 (r225704) @@ -115,6 +115,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -201,6 +202,8 @@ xctrl_suspend() int i, j, k, fpp; unsigned long max_pfn, start_info_mfn; + EVENTHANDLER_INVOKE(power_suspend); + #ifdef SMP struct thread *td; cpuset_t map; @@ -221,7 +224,13 @@ xctrl_suspend() stop_cpus(map); #endif + /* + * Be sure to hold Giant across DEVICE_SUSPEND/RESUME since non-MPSAFE + * drivers need this. + */ + mtx_lock(&Giant); if (DEVICE_SUSPEND(root_bus) != 0) { + mtx_unlock(&Giant); printf("xen_suspend: device_suspend failed\n"); #ifdef SMP if (!CPU_EMPTY(&map)) @@ -229,6 +238,7 @@ xctrl_suspend() #endif return; } + mtx_unlock(&Giant); local_irq_disable(); @@ -283,11 +293,14 @@ xctrl_suspend() vcpu_prepare(i); #endif + /* * Only resume xenbus /after/ we've prepared our VCPUs; otherwise * the VCPU hotplug callback can race with our vcpu_prepare */ + mtx_lock(&Giant); DEVICE_RESUME(root_bus); + mtx_unlock(&Giant); #ifdef SMP thread_lock(curthread); @@ -296,6 +309,7 @@ xctrl_suspend() if (!CPU_EMPTY(&map)) restart_cpus(map); #endif + EVENTHANDLER_INVOKE(power_resume); } static void @@ -322,39 +336,47 @@ xctrl_suspend() { int suspend_cancelled; + EVENTHANDLER_INVOKE(power_suspend); + + /* + * Be sure to hold Giant across DEVICE_SUSPEND/RESUME since non-MPSAFE + * drivers need this. + */ + mtx_lock(&Giant); if (DEVICE_SUSPEND(root_bus)) { + mtx_unlock(&Giant); printf("xen_suspend: device_suspend failed\n"); return; } - - /* - * Make sure we don't change cpus or switch to some other - * thread. for the duration. - */ - critical_enter(); + mtx_unlock(&Giant); /* * Prevent any races with evtchn_interrupt() handler. */ - irq_suspend(); disable_intr(); + irq_suspend(); suspend_cancelled = HYPERVISOR_suspend(0); - if (!suspend_cancelled) + if (suspend_cancelled) + irq_resume(); + else xenpci_resume(); /* * Re-enable interrupts and put the scheduler back to normal. */ enable_intr(); - critical_exit(); /* * FreeBSD really needs to add DEVICE_SUSPEND_CANCEL or * similar. */ + mtx_lock(&Giant); if (!suspend_cancelled) DEVICE_RESUME(root_bus); + mtx_unlock(&Giant); + + EVENTHANDLER_INVOKE(power_resume); } #endif Modified: head/sys/xen/xenbus/xenbusb.c ============================================================================== --- head/sys/xen/xenbus/xenbusb.c Tue Sep 20 23:22:58 2011 (r225703) +++ head/sys/xen/xenbus/xenbusb.c Tue Sep 20 23:44:34 2011 (r225704) @@ -773,7 +773,7 @@ xenbusb_resume(device_t dev) ivars = device_get_ivars(kids[i]); xs_unregister_watch(&ivars->xd_otherend_watch); - ivars->xd_state = XenbusStateInitialising; + xenbus_set_state(kids[i], XenbusStateInitialising); /* * Find the new backend details and @@ -783,16 +783,16 @@ xenbusb_resume(device_t dev) if (error) return (error); - DEVICE_RESUME(kids[i]); - statepath = malloc(ivars->xd_otherend_path_len + strlen("/state") + 1, M_XENBUS, M_WAITOK); sprintf(statepath, "%s/state", ivars->xd_otherend_path); free(ivars->xd_otherend_watch.node, M_XENBUS); ivars->xd_otherend_watch.node = statepath; - xs_register_watch(&ivars->xd_otherend_watch); + DEVICE_RESUME(kids[i]); + + xs_register_watch(&ivars->xd_otherend_watch); #if 0 /* * Can't do this yet since we are running in Modified: head/sys/xen/xenbus/xenbusb_back.c ============================================================================== --- head/sys/xen/xenbus/xenbusb_back.c Tue Sep 20 23:22:58 2011 (r225703) +++ head/sys/xen/xenbus/xenbusb_back.c Tue Sep 20 23:44:34 2011 (r225704) @@ -292,7 +292,7 @@ static device_method_t xenbusb_back_meth DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_resume, xenbusb_resume), /* Bus Interface */ DEVMETHOD(bus_print_child, xenbusb_print_child), Modified: head/sys/xen/xenbus/xenbusb_front.c ============================================================================== --- head/sys/xen/xenbus/xenbusb_front.c Tue Sep 20 23:22:58 2011 (r225703) +++ head/sys/xen/xenbus/xenbusb_front.c Tue Sep 20 23:44:34 2011 (r225704) @@ -171,7 +171,7 @@ static device_method_t xenbusb_front_met DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_resume, xenbusb_resume), /* Bus Interface */ DEVMETHOD(bus_print_child, xenbusb_print_child), Modified: head/sys/xen/xenstore/xenstore.c ============================================================================== --- head/sys/xen/xenstore/xenstore.c Tue Sep 20 23:22:58 2011 (r225703) +++ head/sys/xen/xenstore/xenstore.c Tue Sep 20 23:44:34 2011 (r225704) @@ -721,8 +721,8 @@ xs_reply_filter(uint32_t request_msg_typ /* * The count of transactions drops if we attempted * to end a transaction (even if that attempt fails - * in error), we receive a transaction end acknowledgement - * or if our attempt to begin a transactionfails. + * in error), we receive a transaction end acknowledgement, + * or if our attempt to begin a transaction fails. */ if (request_msg_type == XS_TRANSACTION_END || (request_reply_error == 0 && reply_msg_type == XS_TRANSACTION_END) @@ -1194,8 +1194,14 @@ xs_attach(device_t dev) * all transactions and individual requests have completed. */ static int -xs_suspend(device_t dev __unused) +xs_suspend(device_t dev) { + int error; + + /* Suspend child Xen devices. */ + error = bus_generic_suspend(dev); + if (error != 0) + return (error); sx_xlock(&xs.suspend_mutex); sx_xlock(&xs.request_mutex); @@ -1227,6 +1233,9 @@ xs_resume(device_t dev __unused) sx_xunlock(&xs.suspend_mutex); + /* Resume child Xen devices. */ + bus_generic_resume(dev); + return (0); } From owner-svn-src-all@FreeBSD.ORG Wed Sep 21 00:02:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B6AC1065670; Wed, 21 Sep 2011 00:02:45 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49C5E8FC08; Wed, 21 Sep 2011 00:02:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8L02jtL050444; Wed, 21 Sep 2011 00:02:45 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8L02jEl050441; Wed, 21 Sep 2011 00:02:45 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201109210002.p8L02jEl050441@svn.freebsd.org> From: "Justin T. Gibbs" Date: Wed, 21 Sep 2011 00:02:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225705 - head/sys/dev/xen/blkfront X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2011 00:02:45 -0000 Author: gibbs Date: Wed Sep 21 00:02:44 2011 New Revision: 225705 URL: http://svn.freebsd.org/changeset/base/225705 Log: Add suspend/resume support to the Xen blkfront driver. Sponsored by: BQ Internet sys/dev/xen/blkfront/block.h: sys/dev/xen/blkfront/blkfront.c: Remove now unused blkif_vdev_t from the blkfront soft. sys/dev/xen/blkfront/blkfront.c: o In blkfront_suspend(), indicate the desire to suspend by changing the softc connected state to SUSPENDED, and then wait for any I/O pending on the remote peer to drain. Cancel suspend processing if I/O does not drain within 30 seconds. o Enable and update blkfront_resume(). Since I/O is drained prior to the suspension of the VM, the complicated recovery process performed by other Xen blkfront implementations is avoided. We simply tear down the connection to our old peer, and then re-connect. o In blkif_initialize(), fix a resource leak and botched return if we cannot allocate shadow memory for our requests. o In blkfront_backend_changed(), correct our response to the XenbusStateInitialised state. This state indicates that our backend peer has published sufficient data for blkfront to publish ring information and other XenStore data, not that a connection can occur. Blkfront now will only perform connection processing in response to the XenbusStateConnected state. This corrects an issue where blkfront connected before the backend was ready during resume processing. Approved by: re MFC after: 1 week Modified: head/sys/dev/xen/blkfront/blkfront.c head/sys/dev/xen/blkfront/block.h Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Tue Sep 20 23:44:34 2011 (r225704) +++ head/sys/dev/xen/blkfront/blkfront.c Wed Sep 21 00:02:44 2011 (r225705) @@ -77,11 +77,8 @@ static int blkfront_detach(device_t); static int setup_blkring(struct xb_softc *); static void blkif_int(void *); static void blkfront_initialize(struct xb_softc *); -#if 0 -static void blkif_recover(struct xb_softc *); -#endif static int blkif_completion(struct xb_command *); -static void blkif_free(struct xb_softc *, int); +static void blkif_free(struct xb_softc *); static void blkif_queue_cb(void *, bus_dma_segment_t *, int, int); MALLOC_DEFINE(M_XENBLOCKFRONT, "xbd", "Xen Block Front driver data"); @@ -452,9 +449,6 @@ blkfront_attach(device_t dev) sc->vdevice = vdevice; sc->connected = BLKIF_STATE_DISCONNECTED; - /* Front end dir is a number, which is used as the id. */ - sc->handle = strtoul(strrchr(xenbus_get_node(dev),'/')+1, NULL, 0); - /* Wait for backend device to publish its protocol capabilities. */ xenbus_set_state(dev, XenbusStateInitialising); @@ -465,29 +459,40 @@ static int blkfront_suspend(device_t dev) { struct xb_softc *sc = device_get_softc(dev); + int retval; + int saved_state; /* Prevent new requests being issued until we fix things up. */ mtx_lock(&sc->xb_io_lock); + saved_state = sc->connected; sc->connected = BLKIF_STATE_SUSPENDED; + + /* Wait for outstanding I/O to drain. */ + retval = 0; + while (TAILQ_EMPTY(&sc->cm_busy) == 0) { + if (msleep(&sc->cm_busy, &sc->xb_io_lock, + PRIBIO, "blkf_susp", 30 * hz) == EWOULDBLOCK) { + retval = EBUSY; + break; + } + } mtx_unlock(&sc->xb_io_lock); - return (0); + if (retval != 0) + sc->connected = saved_state; + + return (retval); } static int blkfront_resume(device_t dev) { -#if 0 struct xb_softc *sc = device_get_softc(dev); DPRINTK("blkfront_resume: %s\n", xenbus_get_node(dev)); -/* XXX This can't work!!! */ - blkif_free(sc, 1); + blkif_free(sc); blkfront_initialize(sc); - if (sc->connected == BLKIF_STATE_SUSPENDED) - blkif_recover(sc); -#endif return (0); } @@ -499,8 +504,10 @@ blkfront_initialize(struct xb_softc *sc) int error; int i; - if (xenbus_get_state(sc->xb_dev) != XenbusStateInitialising) - return; + if (xenbus_get_state(sc->xb_dev) != XenbusStateInitialising) { + /* Initialization has already been performed. */ + return; + } /* * Protocol defaults valid even if negotiation for a @@ -593,8 +600,10 @@ blkfront_initialize(struct xb_softc *sc) sc->shadow = malloc(sizeof(*sc->shadow) * sc->max_requests, M_XENBLOCKFRONT, M_NOWAIT|M_ZERO); if (sc->shadow == NULL) { + bus_dma_tag_destroy(sc->xb_io_dmat); xenbus_dev_fatal(sc->xb_dev, error, "Cannot allocate request structures\n"); + return; } for (i = 0; i < sc->max_requests; i++) { @@ -755,10 +764,10 @@ blkfront_backend_changed(device_t dev, X break; case XenbusStateInitWait: + case XenbusStateInitialised: blkfront_initialize(sc); break; - case XenbusStateInitialised: case XenbusStateConnected: blkfront_initialize(sc); blkfront_connect(sc); @@ -775,7 +784,7 @@ blkfront_backend_changed(device_t dev, X } /* -** Invoked when the backend is finally 'ready' (and has told produced +** Invoked when the backend is finally 'ready' (and has published ** the details about the physical device - #sectors, size, etc). */ static void @@ -809,13 +818,15 @@ blkfront_connect(struct xb_softc *sc) if (!err || feature_barrier) sc->xb_flags |= XB_BARRIER; - device_printf(dev, "%juMB <%s> at %s", - (uintmax_t) sectors / (1048576 / sector_size), - device_get_desc(dev), - xenbus_get_node(dev)); - bus_print_child_footer(device_get_parent(dev), dev); + if (sc->xb_disk == NULL) { + device_printf(dev, "%juMB <%s> at %s", + (uintmax_t) sectors / (1048576 / sector_size), + device_get_desc(dev), + xenbus_get_node(dev)); + bus_print_child_footer(device_get_parent(dev), dev); - xlvbd_add(sc, sectors, sc->vdevice, binfo, sector_size); + xlvbd_add(sc, sectors, sc->vdevice, binfo, sector_size); + } (void)xenbus_set_state(dev, XenbusStateConnected); @@ -825,7 +836,6 @@ blkfront_connect(struct xb_softc *sc) xb_startio(sc); sc->xb_flags |= XB_READY; mtx_unlock(&sc->xb_io_lock); - } /** @@ -859,7 +869,7 @@ blkfront_detach(device_t dev) DPRINTK("blkfront_remove: %s removed\n", xenbus_get_node(dev)); - blkif_free(sc, 0); + blkif_free(sc); mtx_destroy(&sc->xb_io_lock); return 0; @@ -1140,6 +1150,9 @@ xb_startio(struct xb_softc *sc) mtx_assert(&sc->xb_io_lock, MA_OWNED); + if (sc->connected != BLKIF_STATE_CONNECTED) + return; + while (RING_FREE_REQUESTS(&sc->ring) >= sc->max_request_blocks) { if (sc->xb_flags & XB_FROZEN) break; @@ -1174,7 +1187,7 @@ blkif_int(void *xsc) mtx_lock(&sc->xb_io_lock); - if (unlikely(sc->connected != BLKIF_STATE_CONNECTED)) { + if (unlikely(sc->connected == BLKIF_STATE_DISCONNECTED)) { mtx_unlock(&sc->xb_io_lock); return; } @@ -1232,19 +1245,21 @@ blkif_int(void *xsc) xb_startio(sc); + if (unlikely(sc->connected == BLKIF_STATE_SUSPENDED)) + wakeup(&sc->cm_busy); + mtx_unlock(&sc->xb_io_lock); } static void -blkif_free(struct xb_softc *sc, int suspend) +blkif_free(struct xb_softc *sc) { uint8_t *sring_page_ptr; int i; /* Prevent new requests being issued until we fix things up. */ mtx_lock(&sc->xb_io_lock); - sc->connected = suspend ? - BLKIF_STATE_SUSPENDED : BLKIF_STATE_DISCONNECTED; + sc->connected = BLKIF_STATE_DISCONNECTED; mtx_unlock(&sc->xb_io_lock); /* Free resources associated with old device channel. */ @@ -1276,6 +1291,12 @@ blkif_free(struct xb_softc *sc, int susp } free(sc->shadow, M_XENBLOCKFRONT); sc->shadow = NULL; + + bus_dma_tag_destroy(sc->xb_io_dmat); + + xb_initq_free(sc); + xb_initq_ready(sc); + xb_initq_complete(sc); } if (sc->irq) { @@ -1292,21 +1313,6 @@ blkif_completion(struct xb_command *s) return (BLKIF_SEGS_TO_BLOCKS(s->nseg)); } -#if 0 -static void -blkif_recover(struct xb_softc *sc) -{ - /* - * XXX The whole concept of not quiescing and completing all i/o - * during suspend, and then hoping to recover and replay the - * resulting abandoned I/O during resume, is laughable. At best, - * it invalidates the i/o ordering rules required by just about - * every filesystem, and at worst it'll corrupt data. The code - * has been removed until further notice. - */ -} -#endif - /* ** Driver registration ** */ static device_method_t blkfront_methods[] = { /* Device interface */ Modified: head/sys/dev/xen/blkfront/block.h ============================================================================== --- head/sys/dev/xen/blkfront/block.h Tue Sep 20 23:44:34 2011 (r225704) +++ head/sys/dev/xen/blkfront/block.h Wed Sep 21 00:02:44 2011 (r225705) @@ -142,7 +142,6 @@ struct xb_softc { #define XB_READY (1 << 2) /* Is ready */ #define XB_FROZEN (1 << 3) /* Waiting for resources */ int vdevice; - blkif_vdev_t handle; int connected; u_int ring_pages; uint32_t max_requests; From owner-svn-src-all@FreeBSD.ORG Wed Sep 21 00:06:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3924106568B; Wed, 21 Sep 2011 00:06:02 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A4FE8FC15; Wed, 21 Sep 2011 00:06:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8L0628t050574; Wed, 21 Sep 2011 00:06:02 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8L062eT050572; Wed, 21 Sep 2011 00:06:02 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201109210006.p8L062eT050572@svn.freebsd.org> From: "Justin T. Gibbs" Date: Wed, 21 Sep 2011 00:06:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225706 - head/sys/dev/xen/control X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2011 00:06:02 -0000 Author: gibbs Date: Wed Sep 21 00:06:02 2011 New Revision: 225706 URL: http://svn.freebsd.org/changeset/base/225706 Log: [ Forced commit. Actual changes accidentally included in r225704 ] sys/dev/xen/control/control.c: Fix locking violations in Xen HVM suspend processing and have it perform similar actions to those performed during an ACPI triggered suspend. Sponsored by: BQ Internet Approved by: re MFC after: 1 week Modified: head/sys/dev/xen/control/control.c Modified: head/sys/dev/xen/control/control.c ============================================================================== From owner-svn-src-all@FreeBSD.ORG Wed Sep 21 00:08:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA1191065673; Wed, 21 Sep 2011 00:08:25 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F00F8FC1A; Wed, 21 Sep 2011 00:08:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8L08PZR050674; Wed, 21 Sep 2011 00:08:25 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8L08PDq050672; Wed, 21 Sep 2011 00:08:25 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201109210008.p8L08PDq050672@svn.freebsd.org> From: "Justin T. Gibbs" Date: Wed, 21 Sep 2011 00:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225707 - head/sys/dev/xen/netfront X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2011 00:08:25 -0000 Author: gibbs Date: Wed Sep 21 00:08:25 2011 New Revision: 225707 URL: http://svn.freebsd.org/changeset/base/225707 Log: Correct suspend/resume support in the Netfront driver. Sponsored by: BQ Internet sys/dev/xen/netfront/netfront.c: o Implement netfront_suspend(), a specialized suspend handler for the netfront driver. This routine simply disables the carrier so the driver is idle during system suspend processing. o Fix a leak when re-initializing LRO during a link reset. o In netif_release_tx_bufs(), when cleaning up the grant references for our TX ring, use gnttab_end_foreign_access_ref instead of attempting to grant the page again. o In netif_release_tx_bufs(), we do not track mbufs associated with mbuf chains, but instead just free each mbuf directly. Use m_free(), not m_freem(), to avoid double frees of mbufs. o Refactor some code to enhance clarity. Approved by: re MFC after: 1 week Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Wed Sep 21 00:06:02 2011 (r225706) +++ head/sys/dev/xen/netfront/netfront.c Wed Sep 21 00:08:25 2011 (r225707) @@ -159,6 +159,7 @@ static int xn_ioctl(struct ifnet *, u_l static void xn_ifinit_locked(struct netfront_info *); static void xn_ifinit(void *); static void xn_stop(struct netfront_info *); +static int xn_configure_lro(struct netfront_info *np); #ifdef notyet static void xn_watchdog(struct ifnet *); #endif @@ -174,7 +175,7 @@ static int talk_to_backend(device_t dev, static int create_netdev(device_t dev); static void netif_disconnect_backend(struct netfront_info *info); static int setup_device(device_t dev, struct netfront_info *info); -static void end_access(int ref, void *page); +static void free_ring(int *ref, void *ring_ptr_ref); static int xn_ifmedia_upd(struct ifnet *ifp); static void xn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); @@ -463,6 +464,18 @@ netfront_attach(device_t dev) return 0; } +static int +netfront_suspend(device_t dev) +{ + struct netfront_info *info = device_get_softc(dev); + + XN_RX_LOCK(info); + XN_TX_LOCK(info); + netfront_carrier_off(info); + XN_TX_UNLOCK(info); + XN_RX_UNLOCK(info); + return (0); +} /** * We are reconnecting to the backend, due to a suspend/resume, or a backend @@ -749,10 +762,7 @@ netif_release_tx_bufs(struct netfront_in */ if (((uintptr_t)m) <= NET_TX_RING_SIZE) continue; - gnttab_grant_foreign_access_ref(np->grant_tx_ref[i], - xenbus_get_otherend_id(np->xbdev), - virt_to_mfn(mtod(m, vm_offset_t)), - GNTMAP_readonly); + gnttab_end_foreign_access_ref(np->grant_tx_ref[i]); gnttab_release_grant_reference(&np->gref_tx_head, np->grant_tx_ref[i]); np->grant_tx_ref[i] = GRANT_REF_INVALID; @@ -761,7 +771,7 @@ netif_release_tx_bufs(struct netfront_in if (np->xn_cdata.xn_tx_chain_cnt < 0) { panic("netif_release_tx_bufs: tx_chain_cnt must be >= 0"); } - m_freem(m); + m_free(m); } } @@ -1914,6 +1924,7 @@ network_connect(struct netfront_info *np netif_release_tx_bufs(np); /* Step 2: Rebuild the RX buffer freelist and the RX ring itself. */ + xn_configure_lro(np); for (requeue_idx = 0, i = 0; i < NET_RX_RING_SIZE; i++) { struct mbuf *m; u_long pfn; @@ -1978,6 +1989,30 @@ show_device(struct netfront_info *sc) #endif } +static int +xn_configure_lro(struct netfront_info *np) +{ + int err; + + err = 0; +#if __FreeBSD_version >= 700000 + if ((np->xn_ifp->if_capabilities & IFCAP_LRO) != 0) + tcp_lro_free(&np->xn_lro); + np->xn_ifp->if_capabilities &= ~IFCAP_LRO; + if (xn_enable_lro) { + err = tcp_lro_init(&np->xn_lro); + if (err) { + device_printf(np->xbdev, "LRO initialization failed\n"); + } else { + np->xn_lro.ifp = np->xn_ifp; + np->xn_ifp->if_capabilities |= IFCAP_LRO; + } + } + np->xn_ifp->if_capenable = np->xn_ifp->if_capabilities; +#endif + return (err); +} + /** Create a network device. * @param handle device handle */ @@ -2057,17 +2092,9 @@ create_netdev(device_t dev) ifp->if_capabilities = IFCAP_HWCSUM; #if __FreeBSD_version >= 700000 ifp->if_capabilities |= IFCAP_TSO4; - if (xn_enable_lro) { - int err = tcp_lro_init(&np->xn_lro); - if (err) { - device_printf(dev, "LRO initialization failed\n"); - goto exit; - } - np->xn_lro.ifp = ifp; - ifp->if_capabilities |= IFCAP_LRO; - } #endif ifp->if_capenable = ifp->if_capabilities; + xn_configure_lro(np); ether_ifattach(ifp, np->mac); callout_init(&np->xn_stat_ch, CALLOUT_MPSAFE); @@ -2133,12 +2160,8 @@ netif_disconnect_backend(struct netfront XN_TX_UNLOCK(info); XN_RX_UNLOCK(info); - end_access(info->tx_ring_ref, info->tx.sring); - end_access(info->rx_ring_ref, info->rx.sring); - info->tx_ring_ref = GRANT_REF_INVALID; - info->rx_ring_ref = GRANT_REF_INVALID; - info->tx.sring = NULL; - info->rx.sring = NULL; + free_ring(&info->tx_ring_ref, &info->tx.sring); + free_ring(&info->rx_ring_ref, &info->rx.sring); if (info->irq) unbind_from_irqhandler(info->irq); @@ -2146,12 +2169,17 @@ netif_disconnect_backend(struct netfront info->irq = 0; } - static void -end_access(int ref, void *page) +free_ring(int *ref, void *ring_ptr_ref) { - if (ref != GRANT_REF_INVALID) - gnttab_end_foreign_access(ref, page); + void **ring_ptr_ptr = ring_ptr_ref; + + if (*ref != GRANT_REF_INVALID) { + /* This API frees the associated storage. */ + gnttab_end_foreign_access(*ref, *ring_ptr_ptr); + *ref = GRANT_REF_INVALID; + } + *ring_ptr_ptr = NULL; } static int @@ -2174,7 +2202,7 @@ static device_method_t netfront_methods[ DEVMETHOD(device_attach, netfront_attach), DEVMETHOD(device_detach, netfront_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_suspend, netfront_suspend), DEVMETHOD(device_resume, netfront_resume), /* Xenbus interface */ From owner-svn-src-all@FreeBSD.ORG Wed Sep 21 00:13:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99842106566B; Wed, 21 Sep 2011 00:13:04 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7EE6F8FC0C; Wed, 21 Sep 2011 00:13:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8L0D4cE050851; Wed, 21 Sep 2011 00:13:04 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8L0D4hi050849; Wed, 21 Sep 2011 00:13:04 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201109210013.p8L0D4hi050849@svn.freebsd.org> From: "Justin T. Gibbs" Date: Wed, 21 Sep 2011 00:13:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225708 - head/sys/dev/xen/netfront X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2011 00:13:04 -0000 Author: gibbs Date: Wed Sep 21 00:13:04 2011 New Revision: 225708 URL: http://svn.freebsd.org/changeset/base/225708 Log: Modify the netfront driver so it can successfully attach to PV devices with the ioemu attribute set. sys/dev/xen/netfront/netfront.c: o If a mac address for the interface cannot be found in the front-side XenStore tree, look for an entry in the back-side tree. With ioemu devices, the emulator does not populate the front side tree and neither does Xend. o Return an error rather than panic when an attach attempt fails. Reported by: Janne Snabb (fix inspired by patch provided) PR: kern/154302 Approved by: re Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Wed Sep 21 00:08:25 2011 (r225707) +++ head/sys/dev/xen/netfront/netfront.c Wed Sep 21 00:13:04 2011 (r225708) @@ -406,11 +406,33 @@ xen_net_read_mac(device_t dev, uint8_t m { int error, i; char *s, *e, *macstr; + const char *path; - error = xs_read(XST_NIL, xenbus_get_node(dev), "mac", NULL, - (void **) &macstr); - if (error) + path = xenbus_get_node(dev); + error = xs_read(XST_NIL, path, "mac", NULL, (void **) &macstr); + if (error == ENOENT) { + /* + * Deal with missing mac XenStore nodes on devices with + * HVM emulation (the 'ioemu' configuration attribute) + * enabled. + * + * The HVM emulator may execute in a stub device model + * domain which lacks the permission, only given to Dom0, + * to update the guest's XenStore tree. For this reason, + * the HVM emulator doesn't even attempt to write the + * front-side mac node, even when operating in Dom0. + * However, there should always be a mac listed in the + * backend tree. Fallback to this version if our query + * of the front side XenStore location doesn't find + * anything. + */ + path = xenbus_get_otherend_path(dev); + error = xs_read(XST_NIL, path, "mac", NULL, (void **) &macstr); + } + if (error != 0) { + xenbus_dev_fatal(dev, error, "parsing %s/mac", path); return (error); + } s = macstr; for (i = 0; i < ETHER_ADDR_LEN; i++) { @@ -451,7 +473,7 @@ netfront_attach(device_t dev) err = create_netdev(dev); if (err) { xenbus_dev_fatal(dev, err, "creating netdev"); - return err; + return (err); } #if __FreeBSD_version >= 700000 @@ -461,7 +483,7 @@ netfront_attach(device_t dev) &xn_enable_lro, 0, "Large Receive Offload"); #endif - return 0; + return (0); } static int @@ -2067,11 +2089,8 @@ create_netdev(device_t dev) } err = xen_net_read_mac(dev, np->mac); - if (err) { - xenbus_dev_fatal(dev, err, "parsing %s/mac", - xenbus_get_node(dev)); + if (err) goto out; - } /* Set up ifnet structure */ ifp = np->xn_ifp = if_alloc(IFT_ETHER); @@ -2105,8 +2124,7 @@ create_netdev(device_t dev) exit: gnttab_free_grant_references(np->gref_tx_head); out: - panic("do something smart"); - + return (err); } /** From owner-svn-src-all@FreeBSD.ORG Wed Sep 21 00:15:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03E1A106567B; Wed, 21 Sep 2011 00:15:30 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E741E8FC2D; Wed, 21 Sep 2011 00:15:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8L0FTbO050964; Wed, 21 Sep 2011 00:15:29 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8L0FTIH050962; Wed, 21 Sep 2011 00:15:29 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201109210015.p8L0FTIH050962@svn.freebsd.org> From: "Justin T. Gibbs" Date: Wed, 21 Sep 2011 00:15:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225709 - head/sys/dev/xen/netfront X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2011 00:15:30 -0000 Author: gibbs Date: Wed Sep 21 00:15:29 2011 New Revision: 225709 URL: http://svn.freebsd.org/changeset/base/225709 Log: Update netfront so that it queries and honors published back-end features. sys/dev/xen/netfront/netfront.c: o Add xn_query_features() which reads the XenStore and records the TSO, LRO, and chained ring-request support of the backend. o Rename xn_configure_lro() to xn_configure_features() and use this routine to manage the setup of TSO, LRO, and checksum offload. o In create_netdev(), initialize if_capabilities and if_hwassist to the capabilities found on all backends. Delegate configuration of if_capenable and the TSO flag if if_hwassist to xn_configure_features(). Reported by: Hugo Silva (fix inspired by patch provided) Approved by: re MFC after: 1 week Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Wed Sep 21 00:13:04 2011 (r225708) +++ head/sys/dev/xen/netfront/netfront.c Wed Sep 21 00:15:29 2011 (r225709) @@ -92,7 +92,8 @@ __FBSDID("$FreeBSD$"); #include "xenbus_if.h" -#define XN_CSUM_FEATURES (CSUM_TCP | CSUM_UDP | CSUM_TSO) +/* Features supported by all backends. TSO and LRO can be negotiated */ +#define XN_CSUM_FEATURES (CSUM_TCP | CSUM_UDP) #define NET_TX_RING_SIZE __RING_SIZE((netif_tx_sring_t *)0, PAGE_SIZE) #define NET_RX_RING_SIZE __RING_SIZE((netif_rx_sring_t *)0, PAGE_SIZE) @@ -159,7 +160,8 @@ static int xn_ioctl(struct ifnet *, u_l static void xn_ifinit_locked(struct netfront_info *); static void xn_ifinit(void *); static void xn_stop(struct netfront_info *); -static int xn_configure_lro(struct netfront_info *np); +static void xn_query_features(struct netfront_info *np); +static int xn_configure_features(struct netfront_info *np); #ifdef notyet static void xn_watchdog(struct ifnet *); #endif @@ -262,6 +264,7 @@ struct netfront_info { u_int irq; u_int copying_receiver; u_int carrier; + u_int maxfrags; /* Receive-ring batched refills. */ #define RX_MIN_TARGET 32 @@ -1526,7 +1529,7 @@ xn_assemble_tx_request(struct netfront_i * deal with nfrags > MAX_TX_REQ_FRAGS, which is a quirk of * the Linux network stack. */ - if (nfrags > MAX_TX_REQ_FRAGS) { + if (nfrags > sc->maxfrags) { m = m_defrag(m_head, M_DONTWAIT); if (!m) { /* @@ -1943,10 +1946,11 @@ network_connect(struct netfront_info *np return (error); /* Step 1: Reinitialise variables. */ + xn_query_features(np); + xn_configure_features(np); netif_release_tx_bufs(np); /* Step 2: Rebuild the RX buffer freelist and the RX ring itself. */ - xn_configure_lro(np); for (requeue_idx = 0, i = 0; i < NET_RX_RING_SIZE; i++) { struct mbuf *m; u_long pfn; @@ -2011,26 +2015,63 @@ show_device(struct netfront_info *sc) #endif } +static void +xn_query_features(struct netfront_info *np) +{ + int val; + + device_printf(np->xbdev, "backend features:"); + + if (xs_scanf(XST_NIL, xenbus_get_otherend_path(np->xbdev), + "feature-sg", NULL, "%d", &val) < 0) + val = 0; + + np->maxfrags = 1; + if (val) { + np->maxfrags = MAX_TX_REQ_FRAGS; + printf(" feature-sg"); + } + + if (xs_scanf(XST_NIL, xenbus_get_otherend_path(np->xbdev), + "feature-gso-tcpv4", NULL, "%d", &val) < 0) + val = 0; + + np->xn_ifp->if_capabilities &= ~(IFCAP_TSO4|IFCAP_LRO); + if (val) { + np->xn_ifp->if_capabilities |= IFCAP_TSO4|IFCAP_LRO; + printf(" feature-gso-tcp4"); + } + + printf("\n"); +} + static int -xn_configure_lro(struct netfront_info *np) +xn_configure_features(struct netfront_info *np) { int err; err = 0; #if __FreeBSD_version >= 700000 - if ((np->xn_ifp->if_capabilities & IFCAP_LRO) != 0) + if ((np->xn_ifp->if_capenable & IFCAP_LRO) != 0) tcp_lro_free(&np->xn_lro); - np->xn_ifp->if_capabilities &= ~IFCAP_LRO; - if (xn_enable_lro) { +#endif + np->xn_ifp->if_capenable = + np->xn_ifp->if_capabilities & ~(IFCAP_LRO|IFCAP_TSO4); + np->xn_ifp->if_hwassist &= ~CSUM_TSO; +#if __FreeBSD_version >= 700000 + if (xn_enable_lro && (np->xn_ifp->if_capabilities & IFCAP_LRO) != 0) { err = tcp_lro_init(&np->xn_lro); if (err) { device_printf(np->xbdev, "LRO initialization failed\n"); } else { np->xn_lro.ifp = np->xn_ifp; - np->xn_ifp->if_capabilities |= IFCAP_LRO; + np->xn_ifp->if_capenable |= IFCAP_LRO; } } - np->xn_ifp->if_capenable = np->xn_ifp->if_capabilities; + if ((np->xn_ifp->if_capabilities & IFCAP_TSO4) != 0) { + np->xn_ifp->if_capenable |= IFCAP_TSO4; + np->xn_ifp->if_hwassist |= CSUM_TSO; + } #endif return (err); } @@ -2059,7 +2100,7 @@ create_netdev(device_t dev) np->rx_target = RX_MIN_TARGET; np->rx_min_target = RX_MIN_TARGET; np->rx_max_target = RX_MAX_TARGET; - + /* Initialise {tx,rx}_skbs to be a free chain containing every entry. */ for (i = 0; i <= NET_TX_RING_SIZE; i++) { np->tx_mbufs[i] = (void *) ((u_long) i+1); @@ -2109,11 +2150,6 @@ create_netdev(device_t dev) ifp->if_hwassist = XN_CSUM_FEATURES; ifp->if_capabilities = IFCAP_HWCSUM; -#if __FreeBSD_version >= 700000 - ifp->if_capabilities |= IFCAP_TSO4; -#endif - ifp->if_capenable = ifp->if_capabilities; - xn_configure_lro(np); ether_ifattach(ifp, np->mac); callout_init(&np->xn_stat_ch, CALLOUT_MPSAFE); From owner-svn-src-all@FreeBSD.ORG Wed Sep 21 07:31:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6955B106566B; Wed, 21 Sep 2011 07:31:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F08B8FC13; Wed, 21 Sep 2011 07:31:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8L7VHR2064393; Wed, 21 Sep 2011 07:31:17 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8L7VHrd064391; Wed, 21 Sep 2011 07:31:17 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201109210731.p8L7VHrd064391@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 21 Sep 2011 07:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225712 - stable/8/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2011 07:31:17 -0000 Author: hselasky Date: Wed Sep 21 07:31:16 2011 New Revision: 225712 URL: http://svn.freebsd.org/changeset/base/225712 Log: MFC r225556: Reduce USB memory usage during enumeration. Modified: stable/8/sys/dev/usb/usb_msctest.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/usb_msctest.c ============================================================================== --- stable/8/sys/dev/usb/usb_msctest.c Wed Sep 21 06:35:05 2011 (r225711) +++ stable/8/sys/dev/usb/usb_msctest.c Wed Sep 21 07:31:16 2011 (r225712) @@ -183,6 +183,7 @@ static const struct usb_config bbb_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = sizeof(struct bbb_cbw), + .flags = {.ext_buffer = 1,}, .callback = &bbb_command_callback, .timeout = 4 * USB_MS_HZ, /* 4 seconds */ }, @@ -192,7 +193,7 @@ static const struct usb_config bbb_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = BULK_SIZE, - .flags = {.proxy_buffer = 1,.short_xfer_ok = 1,}, + .flags = {.ext_buffer = 1,.proxy_buffer = 1,.short_xfer_ok = 1,}, .callback = &bbb_data_read_callback, .timeout = 4 * USB_MS_HZ, /* 4 seconds */ }, @@ -211,7 +212,7 @@ static const struct usb_config bbb_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = BULK_SIZE, - .flags = {.proxy_buffer = 1,}, + .flags = {.ext_buffer = 1,.proxy_buffer = 1,}, .callback = &bbb_data_write_callback, .timeout = 4 * USB_MS_HZ, /* 4 seconds */ }, @@ -230,7 +231,7 @@ static const struct usb_config bbb_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = sizeof(struct bbb_csw), - .flags = {.short_xfer_ok = 1,}, + .flags = {.ext_buffer = 1,.short_xfer_ok = 1,}, .callback = &bbb_status_callback, .timeout = 1 * USB_MS_HZ, /* 1 second */ }, From owner-svn-src-all@FreeBSD.ORG Thu Sep 22 01:13:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F60A106564A; Thu, 22 Sep 2011 01:13:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8D418FC18; Thu, 22 Sep 2011 01:13:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8M1De92099170; Thu, 22 Sep 2011 01:13:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8M1DeEi099168; Thu, 22 Sep 2011 01:13:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201109220113.p8M1DeEi099168@svn.freebsd.org> From: Xin LI Date: Thu, 22 Sep 2011 01:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225721 - in stable: 7/etc 8/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2011 01:13:41 -0000 Author: delphij Date: Thu Sep 22 01:13:40 2011 New Revision: 225721 URL: http://svn.freebsd.org/changeset/base/225721 Log: MFC r225452: Sync pf.os with OpenBSD: - Update OpenBSD fingerprints through OpenBSD 4.9 - Fix typos. Obtained from: OpenBSD Modified: stable/8/etc/pf.os Directory Properties: stable/8/etc/ (props changed) Changes in other areas also in this revision: Modified: stable/7/etc/pf.os Directory Properties: stable/7/etc/ (props changed) Modified: stable/8/etc/pf.os ============================================================================== --- stable/8/etc/pf.os Wed Sep 21 23:48:19 2011 (r225720) +++ stable/8/etc/pf.os Thu Sep 22 01:13:40 2011 (r225721) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $OpenBSD: pf.os,v 1.21 2006/07/28 21:51:12 david Exp $ +# $OpenBSD: pf.os,v 1.25 2010/10/18 15:55:27 deraadt Exp $ # passive OS fingerprinting # ------------------------- # @@ -299,13 +299,16 @@ S22:64:1:52:M*,N,N,S,N,W0: Linux:2.2:ts: # ----------------- OpenBSD ----------------- 16384:64:0:60:M*,N,W0,N,N,T: OpenBSD:2.6::NetBSD 1.3 (or OpenBSD 2.6) -16384:64:1:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.0-4.0::OpenBSD 3.0-4.0 -16384:64:0:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.0-4.0:no-df:OpenBSD 3.0-4.0 (scrub no-df) +16384:64:1:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.0-4.8::OpenBSD 3.0-4.8 +16384:64:0:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.0-4.8:no-df:OpenBSD 3.0-4.8 (scrub no-df) 57344:64:1:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.3-4.0::OpenBSD 3.3-4.0 57344:64:0:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.3-4.0:no-df:OpenBSD 3.3-4.0 (scrub no-df) 65535:64:1:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.0-4.0:opera:OpenBSD 3.0-4.0 (Opera) +16384:64:1:64:M*,N,N,S,N,W3,N,N,T: OpenBSD:4.9::OpenBSD 4.9 +16384:64:0:64:M*,N,N,S,N,W3,N,N,T: OpenBSD:4.9:no-df:OpenBSD 4.9 (scrub no-df) + # ----------------- Solaris ----------------- S17:64:1:64:N,W3,N,N,T0,N,N,S,M*: Solaris:8:RFC1323:Solaris 8 RFC1323 @@ -362,7 +365,7 @@ S34:64:1:52:M*,N,W0,N,N,S: Solaris:10:b # ----------------- Windows ----------------- # Windows TCP/IP stack is a mess. For most recent XP, 2000 and -# even 98, the pathlevel, not the actual OS version, is more +# even 98, the patchlevel, not the actual OS version, is more # relevant to the signature. They share the same code, so it would # seem. Luckily for us, almost all Windows 9x boxes have an # awkward MSS of 536, which I use to tell one from another From owner-svn-src-all@FreeBSD.ORG Thu Sep 22 01:13:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FDF0106566B; Thu, 22 Sep 2011 01:13:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0553F8FC19; Thu, 22 Sep 2011 01:13:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8M1DeiJ099176; Thu, 22 Sep 2011 01:13:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8M1DeeO099174; Thu, 22 Sep 2011 01:13:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201109220113.p8M1DeeO099174@svn.freebsd.org> From: Xin LI Date: Thu, 22 Sep 2011 01:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225721 - in stable: 7/etc 8/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2011 01:13:41 -0000 Author: delphij Date: Thu Sep 22 01:13:40 2011 New Revision: 225721 URL: http://svn.freebsd.org/changeset/base/225721 Log: MFC r225452: Sync pf.os with OpenBSD: - Update OpenBSD fingerprints through OpenBSD 4.9 - Fix typos. Obtained from: OpenBSD Modified: stable/7/etc/pf.os Directory Properties: stable/7/etc/ (props changed) Changes in other areas also in this revision: Modified: stable/8/etc/pf.os Directory Properties: stable/8/etc/ (props changed) Modified: stable/7/etc/pf.os ============================================================================== --- stable/7/etc/pf.os Wed Sep 21 23:48:19 2011 (r225720) +++ stable/7/etc/pf.os Thu Sep 22 01:13:40 2011 (r225721) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $OpenBSD: pf.os,v 1.21 2006/07/28 21:51:12 david Exp $ +# $OpenBSD: pf.os,v 1.25 2010/10/18 15:55:27 deraadt Exp $ # passive OS fingerprinting # ------------------------- # @@ -299,13 +299,16 @@ S22:64:1:52:M*,N,N,S,N,W0: Linux:2.2:ts: # ----------------- OpenBSD ----------------- 16384:64:0:60:M*,N,W0,N,N,T: OpenBSD:2.6::NetBSD 1.3 (or OpenBSD 2.6) -16384:64:1:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.0-4.0::OpenBSD 3.0-4.0 -16384:64:0:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.0-4.0:no-df:OpenBSD 3.0-4.0 (scrub no-df) +16384:64:1:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.0-4.8::OpenBSD 3.0-4.8 +16384:64:0:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.0-4.8:no-df:OpenBSD 3.0-4.8 (scrub no-df) 57344:64:1:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.3-4.0::OpenBSD 3.3-4.0 57344:64:0:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.3-4.0:no-df:OpenBSD 3.3-4.0 (scrub no-df) 65535:64:1:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.0-4.0:opera:OpenBSD 3.0-4.0 (Opera) +16384:64:1:64:M*,N,N,S,N,W3,N,N,T: OpenBSD:4.9::OpenBSD 4.9 +16384:64:0:64:M*,N,N,S,N,W3,N,N,T: OpenBSD:4.9:no-df:OpenBSD 4.9 (scrub no-df) + # ----------------- Solaris ----------------- S17:64:1:64:N,W3,N,N,T0,N,N,S,M*: Solaris:8:RFC1323:Solaris 8 RFC1323 @@ -362,7 +365,7 @@ S34:64:1:52:M*,N,W0,N,N,S: Solaris:10:b # ----------------- Windows ----------------- # Windows TCP/IP stack is a mess. For most recent XP, 2000 and -# even 98, the pathlevel, not the actual OS version, is more +# even 98, the patchlevel, not the actual OS version, is more # relevant to the signature. They share the same code, so it would # seem. Luckily for us, almost all Windows 9x boxes have an # awkward MSS of 536, which I use to tell one from another From owner-svn-src-all@FreeBSD.ORG Thu Sep 22 08:39:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDD52106566C; Thu, 22 Sep 2011 08:39:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB8468FC13; Thu, 22 Sep 2011 08:39:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8M8dKjM013219; Thu, 22 Sep 2011 08:39:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8M8dKv0013217; Thu, 22 Sep 2011 08:39:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201109220839.p8M8dKv0013217@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 22 Sep 2011 08:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225726 - stable/8/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2011 08:39:20 -0000 Author: kib Date: Thu Sep 22 08:39:20 2011 New Revision: 225726 URL: http://svn.freebsd.org/changeset/base/225726 Log: MFC r225582: Use the proper dynamic tls block to calculate the tls variable address in case tls data generation was updated. PR: misc/160721 Modified: stable/8/libexec/rtld-elf/rtld.c Directory Properties: stable/8/libexec/rtld-elf/ (props changed) Modified: stable/8/libexec/rtld-elf/rtld.c ============================================================================== --- stable/8/libexec/rtld-elf/rtld.c Thu Sep 22 08:24:33 2011 (r225725) +++ stable/8/libexec/rtld-elf/rtld.c Thu Sep 22 08:39:20 2011 (r225726) @@ -3126,7 +3126,7 @@ tls_get_addr_common(Elf_Addr** dtvp, int newdtv[1] = tls_max_index; free(dtv); wlock_release(rtld_bind_lock, lockstate); - *dtvp = newdtv; + dtv = *dtvp = newdtv; } /* Dynamically allocate module TLS if necessary */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 22 11:07:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3504F1065672; Thu, 22 Sep 2011 11:07:12 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 232718FC13; Thu, 22 Sep 2011 11:07:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8MB7C0s020095; Thu, 22 Sep 2011 11:07:12 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8MB7CTb020093; Thu, 22 Sep 2011 11:07:12 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201109221107.p8MB7CTb020093@svn.freebsd.org> From: Attilio Rao Date: Thu, 22 Sep 2011 11:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225728 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2011 11:07:12 -0000 Author: attilio Date: Thu Sep 22 11:07:11 2011 New Revision: 225728 URL: http://svn.freebsd.org/changeset/base/225728 Log: MFC r225516: Return ENOSPC rather than ENXIO when dump_write() cannot proceed in order to correctl deal with consumers. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/kern/kern_shutdown.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_shutdown.c ============================================================================== --- stable/8/sys/kern/kern_shutdown.c Thu Sep 22 10:52:14 2011 (r225727) +++ stable/8/sys/kern/kern_shutdown.c Thu Sep 22 11:07:11 2011 (r225728) @@ -712,8 +712,11 @@ dump_write(struct dumperinfo *di, void * if (length != 0 && (offset < di->mediaoffset || offset - di->mediaoffset + length > di->mediasize)) { - printf("Attempt to write outside dump device boundaries.\n"); - return (ENXIO); + printf("Attempt to write outside dump device boundaries.\n" + "offset(%jd), mediaoffset(%jd), length(%ju), mediasize(%jd).\n", + (intmax_t)offset, (intmax_t)di->mediaoffset, + (uintmax_t)length, (intmax_t)di->mediasize); + return (ENOSPC); } return (di->dumper(di->priv, virtual, physical, offset, length)); } From owner-svn-src-all@FreeBSD.ORG Thu Sep 22 17:51:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2CEA106566C; Thu, 22 Sep 2011 17:51:09 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F8C78FC14; Thu, 22 Sep 2011 17:51:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8MHp9qW032921; Thu, 22 Sep 2011 17:51:09 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8MHp9UC032919; Thu, 22 Sep 2011 17:51:09 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201109221751.p8MHp9UC032919@svn.freebsd.org> From: "Simon L. Nielsen" Date: Thu, 22 Sep 2011 17:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225730 - svnadmin/tools X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2011 17:51:10 -0000 Author: simon Date: Thu Sep 22 17:51:09 2011 New Revision: 225730 URL: http://svn.freebsd.org/changeset/base/225730 Log: - Add 9.0 (stable and releng) branches to svn2cvs mapping. [1] - Checkpoint current list of hacks mainly to handle support for 'Replaced' files. Requested by: kensmith Modified: svnadmin/tools/export.py Modified: svnadmin/tools/export.py ============================================================================== --- svnadmin/tools/export.py Thu Sep 22 12:53:27 2011 (r225729) +++ svnadmin/tools/export.py Thu Sep 22 17:51:09 2011 (r225730) @@ -175,6 +175,7 @@ maptable = [ ( 'stable/6/', 'RELENG_6' ), ( 'stable/7/', 'RELENG_7' ), ( 'stable/8/', 'RELENG_8' ), + ( 'stable/9/', 'RELENG_9' ), # errata / security / releng branches ( 'releng/ALPHA_2_0/','ALPHA_2_0' ), ( 'releng/BETA_2_0/', 'BETA_2_0' ), @@ -209,6 +210,7 @@ maptable = [ ( 'releng/8.1/', 'RELENG_8_1' ), ( 'releng/8.2/', 'RELENG_8_2' ), ( 'releng/8.3/', 'RELENG_8_3' ), + ( 'releng/9.0/', 'RELENG_9_0' ), ] def map2cvs(svnpath): @@ -336,6 +338,54 @@ def exportrev(pool, fs_ptr, rev, cvspath # continue #if p == 'stable/8/release/picobsd/floppy.tree/sbin' and k == 'D': # continue + #if p == 'head/contrib/llvm/tools/clang/www/demo/what is this directory.txt.' and k == 'A': + # continue + #if p == 'head/contrib/llvm/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp' and k == 'D' and rev == 210299: + # continue + #if p == 'head/contrib/llvm/lib/ExecutionEngine/JIT/JITDebugRegisterer.h' and k == 'D' and rev == 210299: + # continue + #if p == 'head/sys/contrib/octeon-sdk/cvmx-interrupt-handler.S' and k == 'D' and rev == 215990: + # continue + #if p == 'head/sys/contrib/octeon-sdk/cvmx-log-arc.S' and k == 'D' and rev == 215990: + # continue + #if p == 'head/contrib/binutils/ld/emultempl/mipself.em' and k == 'D' and rev == 218822: + # continue + #if p == 'head/contrib/binutils/libiberty/pexecute.c' and k == 'D' and rev == 218822: + # continue + #if p == 'head/sys/modules/cxgbe/Makefile' and k == 'D' and rev == 220231: + # continue + if p == 'head/share/man/man4/geom_map.4' and k == 'D' and rev == 222813: + continue + if p == 'head/sys/dev/iicbus/ad7417.c' and k == 'D' and rev == 222813: + continue + if p == 'head/sys/nfs/nfs_kdtrace.h' and k == 'D' and rev == 222813: + continue + if p == 'head/sys/sys/_stdint.h' and k == 'D' and rev == 222813: + continue + if p == 'head/tools/build/options/WITHOUT_GPIO' and k == 'D' and rev == 222813: + continue + if p == 'head/tools/build/options/WITH_OFED' and k == 'D' and rev == 222813: + continue + if p == 'head/tools/regression/bin/sh/builtins/set1.0' and k == 'D' and rev == 222813: + continue + if p == 'head/tools/regression/bin/sh/parser/dollar-quote1.0' and k == 'D' and rev == 222813: + continue + if p == 'head/tools/regression/bin/sh/parser/dollar-quote2.0' and k == 'D' and rev == 222813: + continue + if p == 'head/tools/regression/bin/sh/parser/dollar-quote3.0' and k == 'D' and rev == 222813: + continue + if p == 'head/tools/regression/bin/sh/parser/dollar-quote4.0' and k == 'D' and rev == 222813: + continue + if p == 'head/tools/regression/bin/sh/parser/dollar-quote5.0' and k == 'D' and rev == 222813: + continue + if p == 'head/tools/regression/bin/sh/parser/dollar-quote6.0' and k == 'D' and rev == 222813: + continue + if p == 'head/tools/regression/bin/sh/parser/dollar-quote7.0' and k == 'D' and rev == 222813: + continue + if p == 'head/tools/regression/bin/sh/parser/dollar-quote8.0' and k == 'D' and rev == 222813: + continue + if p == 'head/tools/regression/bin/sh/parser/dollar-quote9.0' and k == 'D' and rev == 222813: + continue makedirs(workpath, _dirname(path), 'src') # Now the directory for the files must exist, and branch tag will be sticky assert os.path.isdir(os.path.join(workpath, _dirname(path))) @@ -380,6 +430,7 @@ def export(pool, repos_path, cvspath): print '==========> export rev ' + rev exportrev(pool, fs_ptr, last_rev + 1, cvspath) fs.change_rev_prop(fs_ptr, 0, 'fbsd:lastexp', rev) + #return continue print "." time.sleep(15) From owner-svn-src-all@FreeBSD.ORG Thu Sep 22 17:59:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFF2B1065673; Thu, 22 Sep 2011 17:59:33 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF8E78FC1C; Thu, 22 Sep 2011 17:59:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8MHxXME033208; Thu, 22 Sep 2011 17:59:33 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8MHxX9h033206; Thu, 22 Sep 2011 17:59:33 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201109221759.p8MHxX9h033206@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 22 Sep 2011 17:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225731 - stable/8/etc/defaults X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2011 17:59:34 -0000 Author: jh Date: Thu Sep 22 17:59:33 2011 New Revision: 225731 URL: http://svn.freebsd.org/changeset/base/225731 Log: MFC r225587: Expose "log" in the default devfs rules. /etc/rc.d/jail creates /dev/log as a symbolic link. PR: conf/160711 Modified: stable/8/etc/defaults/devfs.rules Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/defaults/devfs.rules ============================================================================== --- stable/8/etc/defaults/devfs.rules Thu Sep 22 17:51:09 2011 (r225730) +++ stable/8/etc/defaults/devfs.rules Thu Sep 22 17:59:33 2011 (r225731) @@ -26,6 +26,7 @@ add hide # Requires: devfsrules_hide_all # [devfsrules_unhide_basic=2] +add path log unhide add path null unhide add path zero unhide add path crypto unhide From owner-svn-src-all@FreeBSD.ORG Thu Sep 22 18:21:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76105106566B; Thu, 22 Sep 2011 18:21:15 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 659288FC08; Thu, 22 Sep 2011 18:21:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8MILFiF033965; Thu, 22 Sep 2011 18:21:15 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8MILFjP033963; Thu, 22 Sep 2011 18:21:15 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201109221821.p8MILFjP033963@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 22 Sep 2011 18:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225732 - stable/7/etc/defaults X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2011 18:21:15 -0000 Author: jh Date: Thu Sep 22 18:21:15 2011 New Revision: 225732 URL: http://svn.freebsd.org/changeset/base/225732 Log: MFC r225587: Expose "log" in the default devfs rules. /etc/rc.d/jail creates /dev/log as a symbolic link. PR: conf/160711 Modified: stable/7/etc/defaults/devfs.rules Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/defaults/devfs.rules ============================================================================== --- stable/7/etc/defaults/devfs.rules Thu Sep 22 17:59:33 2011 (r225731) +++ stable/7/etc/defaults/devfs.rules Thu Sep 22 18:21:15 2011 (r225732) @@ -26,6 +26,7 @@ add hide # Requires: devfsrules_hide_all # [devfsrules_unhide_basic=2] +add path log unhide add path null unhide add path zero unhide add path crypto unhide From owner-svn-src-all@FreeBSD.ORG Thu Sep 22 22:08:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA42C106564A; Thu, 22 Sep 2011 22:08:09 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 905F88FC0A; Thu, 22 Sep 2011 22:08:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8MM89Tu040877; Thu, 22 Sep 2011 22:08:09 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8MM89FK040875; Thu, 22 Sep 2011 22:08:09 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201109222208.p8MM89FK040875@svn.freebsd.org> From: Gabor Kovesdan Date: Thu, 22 Sep 2011 22:08:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225733 - stable/8/lib/libc/nls X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2011 22:08:09 -0000 Author: gabor Date: Thu Sep 22 22:08:09 2011 New Revision: 225733 URL: http://svn.freebsd.org/changeset/base/225733 Log: MFC r202992: Cache failing and opened catalogs in catopen() and related functions. Continuous catopen() calls cause 4 failig stat(2) each, which means a lot of overhead. It is also a good idea to keep the opened catalogs in the memory to speed up further catopen() calls to the same catalog since these catalogs are not big at all. In this case, we count references and only free() the allocated space when the reference count reaches 0. The reads and writes to the cache are syncronized with an rwlock when these functions are called from a threaded program. MFC r202993, r203174, r203719, r204110: Small fixes and style nits for the above change. Approved by: delphij (mentor) Modified: stable/8/lib/libc/nls/msgcat.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/nls/msgcat.c ============================================================================== --- stable/8/lib/libc/nls/msgcat.c Thu Sep 22 18:21:15 2011 (r225732) +++ stable/8/lib/libc/nls/msgcat.c Thu Sep 22 22:08:09 2011 (r225733) @@ -1,5 +1,6 @@ /*********************************************************** Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts. +Copyright 2010, Gabor Kovesdan All Rights Reserved @@ -39,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* for ntohl() */ @@ -47,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -57,38 +60,109 @@ __FBSDID("$FreeBSD$"); #define _DEFAULT_NLS_PATH "/usr/share/nls/%L/%N.cat:/usr/share/nls/%N/%L:/usr/local/share/nls/%L/%N.cat:/usr/local/share/nls/%N/%L" +#define RLOCK(fail) { int ret; \ + if (__isthreaded && \ + ((ret = _pthread_rwlock_rdlock(&rwlock)) != 0)) { \ + errno = ret; \ + return (fail); \ + }} +#define WLOCK(fail) { int ret; \ + if (__isthreaded && \ + ((ret = _pthread_rwlock_wrlock(&rwlock)) != 0)) { \ + errno = ret; \ + return (fail); \ + }} +#define UNLOCK { if (__isthreaded) \ + _pthread_rwlock_unlock(&rwlock); } + #define NLERR ((nl_catd) -1) #define NLRETERR(errc) { errno = errc; return (NLERR); } +#define SAVEFAIL(n, l, e) { WLOCK(NLERR); \ + np = malloc(sizeof(struct catentry)); \ + if (np != NULL) { \ + np->name = strdup(n); \ + np->path = NULL; \ + np->lang = (l == NULL) ? NULL : \ + strdup(l); \ + np->caterrno = e; \ + SLIST_INSERT_HEAD(&cache, np, list); \ + } \ + UNLOCK; \ + errno = e; \ + } + +static nl_catd load_msgcat(const char *, const char *, const char *); -static nl_catd load_msgcat(const char *); +static pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER; + +struct catentry { + SLIST_ENTRY(catentry) list; + char *name; + char *path; + int caterrno; + nl_catd catd; + char *lang; + int refcount; +}; + +SLIST_HEAD(listhead, catentry) cache = + SLIST_HEAD_INITIALIZER(cache); nl_catd catopen(const char *name, int type) { - int spcleft, saverr; - char path[PATH_MAX]; - char *nlspath, *lang, *base, *cptr, *pathP, *tmpptr; - char *cptr1, *plang, *pter, *pcode; - struct stat sbuf; + struct stat sbuf; + struct catentry *np; + char *base, *cptr, *cptr1, *lang, *nlspath, *pathP, *pcode; + char *plang, *pter, *tmpptr; + int saverr, spcleft; + char path[PATH_MAX]; + /* sanity checking */ if (name == NULL || *name == '\0') NLRETERR(EINVAL); - /* is it absolute path ? if yes, load immediately */ if (strchr(name, '/') != NULL) - return (load_msgcat(name)); + /* have a pathname */ + lang = NULL; + else { + if (type == NL_CAT_LOCALE) + lang = setlocale(LC_MESSAGES, NULL); + else + lang = getenv("LANG"); + + if (lang == NULL || *lang == '\0' || strlen(lang) > ENCODING_LEN || + (lang[0] == '.' && + (lang[1] == '\0' || (lang[1] == '.' && lang[2] == '\0'))) || + strchr(lang, '/') != NULL) + lang = "C"; + } + + /* Try to get it from the cache first */ + RLOCK(NLERR); + SLIST_FOREACH(np, &cache, list) { + if ((strcmp(np->name, name) == 0) && + ((lang != NULL && np->lang != NULL && + strcmp(np->lang, lang) == 0) || (np->lang == lang))) { + if (np->caterrno != 0) { + /* Found cached failing entry */ + UNLOCK; + NLRETERR(np->caterrno); + } else { + /* Found cached successful entry */ + np->refcount++; + UNLOCK; + return (np->catd); + } + } + } + UNLOCK; - if (type == NL_CAT_LOCALE) - lang = setlocale(LC_MESSAGES, NULL); - else - lang = getenv("LANG"); - - if (lang == NULL || *lang == '\0' || strlen(lang) > ENCODING_LEN || - (lang[0] == '.' && - (lang[1] == '\0' || (lang[1] == '.' && lang[2] == '\0'))) || - strchr(lang, '/') != NULL) - lang = "C"; + /* is it absolute path ? if yes, load immediately */ + if (strchr(name, '/') != NULL) + return (load_msgcat(name, name, lang)); + /* sanity checking */ if ((plang = cptr1 = strdup(lang)) == NULL) return (NLERR); if ((cptr = strchr(cptr1, '@')) != NULL) @@ -136,7 +210,7 @@ catopen(const char *name, int type) break; case '%': ++nlspath; - /* fallthrough */ + /* FALLTHROUGH */ default: if (pathP - path >= sizeof(path) - 1) @@ -153,6 +227,7 @@ catopen(const char *name, int type) too_long: free(plang); free(base); + SAVEFAIL(name, lang, ENAMETOOLONG); NLRETERR(ENAMETOOLONG); } pathP += strlen(tmpptr); @@ -166,7 +241,7 @@ catopen(const char *name, int type) if (stat(path, &sbuf) == 0) { free(plang); free(base); - return (load_msgcat(path)); + return (load_msgcat(path, name, lang)); } } else { tmpptr = (char *)name; @@ -176,6 +251,7 @@ catopen(const char *name, int type) } free(plang); free(base); + SAVEFAIL(name, lang, ENOENT); NLRETERR(ENOENT); } @@ -183,19 +259,19 @@ char * catgets(nl_catd catd, int set_id, int msg_id, const char *s) { struct _nls_cat_hdr *cat_hdr; - struct _nls_set_hdr *set_hdr; struct _nls_msg_hdr *msg_hdr; - int l, u, i, r; + struct _nls_set_hdr *set_hdr; + int i, l, r, u; if (catd == NULL || catd == NLERR) { errno = EBADF; /* LINTED interface problem */ - return (char *) s; -} + return ((char *)s); + } - cat_hdr = (struct _nls_cat_hdr *)catd->__data; - set_hdr = (struct _nls_set_hdr *)(void *)((char *)catd->__data - + sizeof(struct _nls_cat_hdr)); + cat_hdr = (struct _nls_cat_hdr *)catd->__data; + set_hdr = (struct _nls_set_hdr *)(void *)((char *)catd->__data + + sizeof(struct _nls_cat_hdr)); /* binary search, see knuth algorithm b */ l = 0; @@ -228,7 +304,7 @@ catgets(nl_catd catd, int set_id, int ms } else { l = i + 1; } -} + } /* not found */ goto notfound; @@ -238,25 +314,44 @@ catgets(nl_catd catd, int set_id, int ms } else { l = i + 1; } -} + } notfound: /* not found */ errno = ENOMSG; /* LINTED interface problem */ - return (char *) s; + return ((char *)s); } int catclose(nl_catd catd) { + struct catentry *np; + + /* sanity checking */ if (catd == NULL || catd == NLERR) { errno = EBADF; return (-1); } - munmap(catd->__data, (size_t)catd->__size); - free(catd); + /* Remove from cache if not referenced any more */ + WLOCK(-1); + SLIST_FOREACH(np, &cache, list) { + if (catd == np->catd) { + np->refcount--; + if (np->refcount == 0) { + munmap(catd->__data, (size_t)catd->__size); + free(catd); + SLIST_REMOVE(&cache, np, catentry, list); + free(np->name); + free(np->path); + free(np->lang); + free(np); + } + break; + } + } + UNLOCK; return (0); } @@ -265,43 +360,88 @@ catclose(nl_catd catd) */ static nl_catd -load_msgcat(const char *path) +load_msgcat(const char *path, const char *name, const char *lang) { struct stat st; - nl_catd catd; + nl_catd catd; + struct catentry *np; void *data; int fd; - /* XXX: path != NULL? */ + /* path/name will never be NULL here */ - if ((fd = _open(path, O_RDONLY)) == -1) - return (NLERR); + /* + * One more try in cache; if it was not found by name, + * it might still be found by absolute path. + */ + RLOCK(NLERR); + SLIST_FOREACH(np, &cache, list) { + if ((np->path != NULL) && (strcmp(np->path, path) == 0)) { + np->refcount++; + UNLOCK; + return (np->catd); + } + } + UNLOCK; + + if ((fd = _open(path, O_RDONLY)) == -1) { + SAVEFAIL(name, lang, errno); + NLRETERR(errno); + } if (_fstat(fd, &st) != 0) { _close(fd); - return (NLERR); + SAVEFAIL(name, lang, EFTYPE); + NLRETERR(EFTYPE); } - data = mmap(0, (size_t)st.st_size, PROT_READ, MAP_FILE|MAP_SHARED, fd, - (off_t)0); - _close(fd); + /* + * If the file size cannot be held in size_t we cannot mmap() + * it to the memory. Probably, this will not be a problem given + * that catalog files are usually small. + */ + if (st.st_size > SIZE_T_MAX) { + _close(fd); + SAVEFAIL(name, lang, EFBIG); + NLRETERR(EFBIG); + } - if (data == MAP_FAILED) - return (NLERR); + if ((data = mmap(0, (size_t)st.st_size, PROT_READ, + MAP_FILE|MAP_SHARED, fd, (off_t)0)) == MAP_FAILED) { + int saved_errno = errno; + _close(fd); + SAVEFAIL(name, lang, saved_errno); + NLRETERR(saved_errno); + } + _close(fd); if (ntohl((u_int32_t)((struct _nls_cat_hdr *)data)->__magic) != _NLS_MAGIC) { munmap(data, (size_t)st.st_size); - NLRETERR(EINVAL); + SAVEFAIL(name, lang, EFTYPE); + NLRETERR(EFTYPE); } if ((catd = malloc(sizeof (*catd))) == NULL) { munmap(data, (size_t)st.st_size); - return (NLERR); + SAVEFAIL(name, lang, ENOMEM); + NLRETERR(ENOMEM); } catd->__data = data; catd->__size = (int)st.st_size; + + /* Caching opened catalog */ + WLOCK(NLERR); + if ((np = malloc(sizeof(struct catentry))) != NULL) { + np->name = strdup(name); + np->path = strdup(path); + np->catd = catd; + np->lang = (lang == NULL) ? NULL : strdup(lang); + np->refcount = 1; + np->caterrno = 0; + SLIST_INSERT_HEAD(&cache, np, list); + } + UNLOCK; return (catd); } - From owner-svn-src-all@FreeBSD.ORG Fri Sep 23 00:50:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D7201065672; Fri, 23 Sep 2011 00:50:37 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C86F8FC0A; Fri, 23 Sep 2011 00:50:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8N0obsL045923; Fri, 23 Sep 2011 00:50:37 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8N0obsJ045920; Fri, 23 Sep 2011 00:50:37 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201109230050.p8N0obsJ045920@svn.freebsd.org> From: Ken Smith Date: Fri, 23 Sep 2011 00:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225735 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2011 00:50:37 -0000 Author: kensmith Date: Fri Sep 23 00:50:36 2011 New Revision: 225735 URL: http://svn.freebsd.org/changeset/base/225735 Log: Add stable/9 to approvers and paths in preparation for creating stable/9 as part of the 9.0-RELEASE release cycle. Approved by: re (implicit) Modified: svnadmin/conf/approvers svnadmin/conf/paths Modified: svnadmin/conf/approvers ============================================================================== --- svnadmin/conf/approvers Thu Sep 22 22:52:24 2011 (r225734) +++ svnadmin/conf/approvers Fri Sep 23 00:50:36 2011 (r225735) @@ -17,6 +17,7 @@ # $FreeBSD$ # ^head/ re +^stable/8/ re #^stable/8/ re #^stable/7/ re ^releng/8.[0-2]/ (security-officer|so) Modified: svnadmin/conf/paths ============================================================================== --- svnadmin/conf/paths Thu Sep 22 22:52:24 2011 (r225734) +++ svnadmin/conf/paths Fri Sep 23 00:50:36 2011 (r225735) @@ -16,6 +16,7 @@ ^stable/6/ ^stable/7/ ^stable/8/ +^stable/9/ # Feature branches. Not open until we're certain we're not reverting to cvs. ^user/ From owner-svn-src-all@FreeBSD.ORG Fri Sep 23 00:51:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81A921065673; Fri, 23 Sep 2011 00:51:37 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56E528FC12; Fri, 23 Sep 2011 00:51:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8N0pbOG045996; Fri, 23 Sep 2011 00:51:37 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8N0pbV2045995; Fri, 23 Sep 2011 00:51:37 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201109230051.p8N0pbV2045995@svn.freebsd.org> From: Ken Smith Date: Fri, 23 Sep 2011 00:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-other@freebsd.org X-SVN-Group: stable-other MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225736 - stable/9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2011 00:51:37 -0000 Author: kensmith Date: Fri Sep 23 00:51:37 2011 New Revision: 225736 URL: http://svn.freebsd.org/changeset/base/225736 Log: Copy head to stable/9 as part of 9.0-RELEASE release cycle. Approved by: re (implicit) Added: - copied from r225735, head/ Directory Properties: stable/9/ (props changed) From owner-svn-src-all@FreeBSD.ORG Fri Sep 23 02:59:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EBCE106566C; Fri, 23 Sep 2011 02:59:00 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E3B48FC0A; Fri, 23 Sep 2011 02:59:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8N2x007051366; Fri, 23 Sep 2011 02:59:00 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8N2x0E7051364; Fri, 23 Sep 2011 02:59:00 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201109230259.p8N2x0E7051364@svn.freebsd.org> From: Ken Smith Date: Fri, 23 Sep 2011 02:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225737 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2011 02:59:00 -0000 Author: kensmith Date: Fri Sep 23 02:58:59 2011 New Revision: 225737 URL: http://svn.freebsd.org/changeset/base/225737 Log: Do the change from 8 to 9 that was supposed to follow copying the line. It's been one of those nights... Approved by: re (implicit) Modified: svnadmin/conf/approvers Modified: svnadmin/conf/approvers ============================================================================== --- svnadmin/conf/approvers Fri Sep 23 00:51:37 2011 (r225736) +++ svnadmin/conf/approvers Fri Sep 23 02:58:59 2011 (r225737) @@ -17,7 +17,7 @@ # $FreeBSD$ # ^head/ re -^stable/8/ re +^stable/9/ re #^stable/8/ re #^stable/7/ re ^releng/8.[0-2]/ (security-officer|so) From owner-svn-src-all@FreeBSD.ORG Fri Sep 23 05:28:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1E4E106564A; Fri, 23 Sep 2011 05:28:09 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE57D8FC15; Fri, 23 Sep 2011 05:28:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8N5S9hd056318; Fri, 23 Sep 2011 05:28:09 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8N5S90n056304; Fri, 23 Sep 2011 05:28:09 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201109230528.p8N5S90n056304@svn.freebsd.org> From: Lawrence Stewart Date: Fri, 23 Sep 2011 05:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225738 - in stable/8: . share/man/man4 share/man/man7 share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2011 05:28:10 -0000 Author: lstewart Date: Fri Sep 23 05:28:09 2011 New Revision: 225738 URL: http://svn.freebsd.org/changeset/base/225738 Log: MFC r225583: Rename the cc.4 and cc.9 modular congestion control related man pages to mod_cc.4 and mod_cc.9 respectively to avoid any possible confusion with the cc.1 gcc man page. Update references to these man pages where required. Requested by: Grenville Armitage Added: stable/8/share/man/man4/mod_cc.4 - copied unchanged from r225583, head/share/man/man4/mod_cc.4 stable/8/share/man/man9/mod_cc.9 - copied unchanged from r225583, head/share/man/man9/mod_cc.9 Deleted: stable/8/share/man/man4/cc.4 stable/8/share/man/man9/cc.9 Modified: stable/8/ObsoleteFiles.inc (contents, props changed) stable/8/share/man/man4/Makefile stable/8/share/man/man4/cc_chd.4 stable/8/share/man/man4/cc_cubic.4 stable/8/share/man/man4/cc_hd.4 stable/8/share/man/man4/cc_htcp.4 stable/8/share/man/man4/cc_newreno.4 stable/8/share/man/man4/cc_vegas.4 stable/8/share/man/man4/h_ertt.4 stable/8/share/man/man4/tcp.4 stable/8/share/man/man9/Makefile Directory Properties: stable/8/ (props changed) stable/8/COPYRIGHT (props changed) stable/8/LOCKS (props changed) stable/8/MAINTAINERS (props changed) stable/8/Makefile (props changed) stable/8/Makefile.inc1 (props changed) stable/8/README (props changed) stable/8/UPDATING (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man1/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man7/ports.7 (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Fri Sep 23 02:58:59 2011 (r225737) +++ stable/8/ObsoleteFiles.inc Fri Sep 23 05:28:09 2011 (r225738) @@ -14,6 +14,9 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20110915: rename congestion control manpages +OLD_FILES+=usr/share/man/man4/cc.4.gz +OLD_FILES+=usr/share/man/man9/cc.9.gz # 20101123: removed subblock.h from liblzma OLD_FILES+=usr/include/lzma/subblock.h # 20101114: Remove long-obsolete MAKEDEV.8 Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Fri Sep 23 02:58:59 2011 (r225737) +++ stable/8/share/man/man4/Makefile Fri Sep 23 05:28:09 2011 (r225738) @@ -67,7 +67,6 @@ MAN= aac.4 \ cardbus.4 \ carp.4 \ cas.4 \ - cc.4 \ cc_chd.4 \ cc_cubic.4 \ cc_hd.4 \ @@ -225,6 +224,8 @@ MAN= aac.4 \ mmc.4 \ mmcsd.4 \ mn.4 \ + mod_cc.4 \ + mos.4 \ mouse.4 \ mps.4 \ mpt.4 \ Modified: stable/8/share/man/man4/cc_chd.4 ============================================================================== --- stable/8/share/man/man4/cc_chd.4 Fri Sep 23 02:58:59 2011 (r225737) +++ stable/8/share/man/man4/cc_chd.4 Fri Sep 23 05:28:09 2011 (r225738) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2011 +.Dd September 15, 2011 .Dt CC_CHD 4 .Os .Sh NAME @@ -86,16 +86,16 @@ is used. Default is 1. .El .Sh SEE ALSO -.Xr cc 4 , .Xr cc_cubic 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , .Xr cc_vegas 4 , .Xr h_ertt 4 , +.Xr mod_cc 4 , .Xr tcp 4 , -.Xr cc 9 , -.Xr khelp 9 +.Xr khelp 9 , +.Xr mod_cc 9 .Rs .%A "D. A. Hayes" .%A "G. Armitage" Modified: stable/8/share/man/man4/cc_cubic.4 ============================================================================== --- stable/8/share/man/man4/cc_cubic.4 Fri Sep 23 02:58:59 2011 (r225737) +++ stable/8/share/man/man4/cc_cubic.4 Fri Sep 23 05:28:09 2011 (r225738) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2011 +.Dd September 15, 2011 .Dt CC_CUBIC 4 .Os .Sh NAME @@ -62,14 +62,14 @@ section below. .Sh MIB Variables There are currently no tunable MIB variables. .Sh SEE ALSO -.Xr cc 4 , .Xr cc_chd 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , .Xr cc_vegas 4 , +.Xr mod_cc 4 , .Xr tcp 4 , -.Xr cc 9 +.Xr mod_cc 9 .Rs .%A "Sangtae Ha" .%A "Injong Rhee" Modified: stable/8/share/man/man4/cc_hd.4 ============================================================================== --- stable/8/share/man/man4/cc_hd.4 Fri Sep 23 02:58:59 2011 (r225737) +++ stable/8/share/man/man4/cc_hd.4 Fri Sep 23 05:28:09 2011 (r225738) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2011 +.Dd September 15, 2011 .Dt CC_HD 4 .Os .Sh NAME @@ -69,16 +69,16 @@ Minimum queuing delay threshold (qmin) i Default is 5. .El .Sh SEE ALSO -.Xr cc 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , .Xr cc_vegas 4 , .Xr h_ertt 4 , +.Xr mod_cc 4 , .Xr tcp 4 , -.Xr cc 9 , -.Xr khelp 9 +.Xr khelp 9 , +.Xr mod_cc 9 .Rs .%A "L. Budzisz" .%A "R. Stanojevic" Modified: stable/8/share/man/man4/cc_htcp.4 ============================================================================== --- stable/8/share/man/man4/cc_htcp.4 Fri Sep 23 02:58:59 2011 (r225737) +++ stable/8/share/man/man4/cc_htcp.4 Fri Sep 23 05:28:09 2011 (r225738) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2011 +.Dd September 15, 2011 .Dt CC_HTCP 4 .Os .Sh NAME @@ -69,14 +69,14 @@ window increase during congestion avoida Default is 0 (disabled). .El .Sh SEE ALSO -.Xr cc 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , .Xr cc_hd 4 , .Xr cc_newreno 4 , .Xr cc_vegas 4 , +.Xr mod_cc 4 , .Xr tcp 4 , -.Xr cc 9 +.Xr mod_cc 9 .Rs .%A "D. Leith" .%A "R. Shorten" Modified: stable/8/share/man/man4/cc_newreno.4 ============================================================================== --- stable/8/share/man/man4/cc_newreno.4 Fri Sep 23 02:58:59 2011 (r225737) +++ stable/8/share/man/man4/cc_newreno.4 Fri Sep 23 05:28:09 2011 (r225738) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2011 +.Dd September 15, 2011 .Dt CC_NEWRENO 4 .Os .Sh NAME @@ -42,14 +42,14 @@ Details about the algorithm can be found .Sh MIB Variables There are currently no tunable MIB variables. .Sh SEE ALSO -.Xr cc 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_vegas 4 , +.Xr mod_cc 4 , .Xr tcp 4 , -.Xr cc 9 +.Xr mod_cc 9 .Sh ACKNOWLEDGEMENTS Development and testing of this software were made possible in part by grants from the FreeBSD Foundation and Cisco University Research Program Fund at Modified: stable/8/share/man/man4/cc_vegas.4 ============================================================================== --- stable/8/share/man/man4/cc_vegas.4 Fri Sep 23 02:58:59 2011 (r225737) +++ stable/8/share/man/man4/cc_vegas.4 Fri Sep 23 05:28:09 2011 (r225738) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2011 +.Dd September 15, 2011 .Dt CC_VEGAS 4 .Os .Sh NAME @@ -94,16 +94,16 @@ When setting beta, the value must satisf Default is 3. .El .Sh SEE ALSO -.Xr cc 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , .Xr h_ertt 4 , +.Xr mod_cc 4 , .Xr tcp 4 , -.Xr cc 9 , -.Xr khelp 9 +.Xr khelp 9 , +.Xr mod_cc 9 .Rs .%A "L. S. Brakmo" .%A "L. L. Peterson" Modified: stable/8/share/man/man4/h_ertt.4 ============================================================================== --- stable/8/share/man/man4/h_ertt.4 Fri Sep 23 02:58:59 2011 (r225737) +++ stable/8/share/man/man4/h_ertt.4 Fri Sep 23 05:28:09 2011 (r225738) @@ -108,10 +108,10 @@ consumers to unset the flag if they wish new measurements. .El .Sh SEE ALSO -.Xr cc 4 , .Xr cc_chd 4 , .Xr cc_hd 4 , .Xr cc_vegas 4 , +.Xr mod_cc 4 , .Xr hhook 9 , .Xr khelp 9 .Sh ACKNOWLEDGEMENTS Copied: stable/8/share/man/man4/mod_cc.4 (from r225583, head/share/man/man4/mod_cc.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/mod_cc.4 Fri Sep 23 05:28:09 2011 (r225738, copy of r225583, head/share/man/man4/mod_cc.4) @@ -0,0 +1,117 @@ +.\" +.\" Copyright (c) 2010-2011 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" This documentation was written at the Centre for Advanced Internet +.\" Architectures, Swinburne University of Technology, Melbourne, Australia by +.\" David Hayes and Lawrence Stewart under sponsorship from the FreeBSD +.\" Foundation. +.\" +.\" 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 AUTHOR 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 AUTHOR 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$ +.\" +.Dd September 15, 2011 +.Dt MOD_CC 4 +.Os +.Sh NAME +.Nm mod_cc +.Nd Modular congestion control +.Sh DESCRIPTION +The modular congestion control framework allows the TCP implementation to +dynamically change the congestion control algorithm used by new and existing +connections. +Algorithms are identified by a unique +.Xr ascii 7 +name. +Algorithm modules can be compiled into the kernel or loaded as kernel modules +using the +.Xr kld 4 +facility. +.Pp +The default algorithm is NewReno, and all connections use the default unless +explicitly overridden using the TCP_CONGESTION socket option (see +.Xr tcp 4 +for details). +The default can be changed using a +.Xr sysctl 3 +MIB variable detailed in the +.Sx MIB Variables +section below. +.Sh MIB Variables +The framework exposes the following variables in the +.Va net.inet.tcp.cc +branch of the +.Xr sysctl 3 +MIB: +.Bl -tag -width ".Va available" +.It Va available +Read-only list of currently available congestion control algorithms by name. +.It Va algorithm +Returns the current default congestion control algorithm when read, and changes +the default when set. +When attempting to change the default algorithm, this variable should be set to +one of the names listed by the +.Va net.inet.tcp.cc.available +MIB variable. +.El +.Sh SEE ALSO +.Xr cc_chd 4 , +.Xr cc_cubic 4 , +.Xr cc_hd 4 , +.Xr cc_htcp 4 , +.Xr cc_newreno 4 , +.Xr cc_vegas 4 , +.Xr tcp 4 , +.Xr mod_cc 9 +.Sh ACKNOWLEDGEMENTS +Development and testing of this software were made possible in part by grants +from the FreeBSD Foundation and Cisco University Research Program Fund at +Community Foundation Silicon Valley. +.Sh HISTORY +The +.Nm +modular congestion control framework first appeared in +.Fx 9.0 . +.Pp +The framework was first released in 2007 by James Healy and Lawrence Stewart +whilst working on the NewTCP research project at Swinburne University of +Technology's Centre for Advanced Internet Architectures, Melbourne, Australia, +which was made possible in part by a grant from the Cisco University Research +Program Fund at Community Foundation Silicon Valley. +More details are available at: +.Pp +http://caia.swin.edu.au/urp/newtcp/ +.Sh AUTHORS +.An -nosplit +The +.Nm +facility was written by +.An Lawrence Stewart Aq lstewart@FreeBSD.org , +.An James Healy Aq jimmy@deefa.com +and +.An David Hayes Aq david.hayes@ieee.org . +.Pp +This manual page was written by +.An David Hayes Aq david.hayes@ieee.org +and +.An Lawrence Stewart Aq lstewart@FreeBSD.org . Modified: stable/8/share/man/man4/tcp.4 ============================================================================== --- stable/8/share/man/man4/tcp.4 Fri Sep 23 02:58:59 2011 (r225737) +++ stable/8/share/man/man4/tcp.4 Fri Sep 23 05:28:09 2011 (r225738) @@ -38,7 +38,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd February 15, 2011 +.Dd September 15, 2011 .Dt TCP 4 .Os .Sh NAME @@ -144,7 +144,7 @@ bandwidth-controlled window space. Select or query the congestion control algorithm that TCP will use for the connection. See -.Xr cc 4 +.Xr mod_cc 4 for details. .It Dv TCP_NODELAY Under most circumstances, @@ -249,7 +249,7 @@ The default congestion control algorithm is .Xr cc_newreno 4 . Other congestion control algorithms can be made available using the -.Xr cc 4 +.Xr mod_cc 4 framework. .Ss MIB Variables The @@ -576,10 +576,10 @@ address. .Xr socket 2 , .Xr sysctl 3 , .Xr blackhole 4 , -.Xr cc 4 , .Xr inet 4 , .Xr intro 4 , .Xr ip 4 , +.Xr mod_cc 4 , .Xr syncache 4 , .Xr setkey 8 .Rs Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Fri Sep 23 02:58:59 2011 (r225737) +++ stable/8/share/man/man9/Makefile Fri Sep 23 05:28:09 2011 (r225738) @@ -44,7 +44,6 @@ MAN= accept_filter.9 \ BUS_SETUP_INTR.9 \ bus_space.9 \ byteorder.9 \ - cc.9 \ cd.9 \ condvar.9 \ config_intrhook.9 \ @@ -170,6 +169,7 @@ MAN= accept_filter.9 \ microtime.9 \ microuptime.9 \ mi_switch.9 \ + mod_cc.9 \ module.9 \ MODULE_DEPEND.9 \ MODULE_VERSION.9 \ Copied: stable/8/share/man/man9/mod_cc.9 (from r225583, head/share/man/man9/mod_cc.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man9/mod_cc.9 Fri Sep 23 05:28:09 2011 (r225738, copy of r225583, head/share/man/man9/mod_cc.9) @@ -0,0 +1,333 @@ +.\" +.\" Copyright (c) 2008-2009 Lawrence Stewart +.\" Copyright (c) 2010-2011 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" Portions of this documentation were written at the Centre for Advanced +.\" Internet Architectures, Swinburne University of Technology, Melbourne, +.\" Australia by David Hayes and Lawrence Stewart under sponsorship from the +.\" FreeBSD Foundation. +.\" +.\" 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 AUTHOR 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 AUTHOR 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$ +.\" +.Dd September 15, 2011 +.Dt MOD_CC 9 +.Os +.Sh NAME +.Nm mod_cc , +.Nm DECLARE_CC_MODULE , +.Nm CC_VAR +.Nd Modular Congestion Control +.Sh SYNOPSIS +.In netinet/cc.h +.In netinet/cc/cc_module.h +.Fn DECLARE_CC_MODULE "ccname" "ccalgo" +.Fn CC_VAR "ccv" "what" +.Sh DESCRIPTION +The +.Nm +framework allows congestion control algorithms to be implemented as dynamically +loadable kernel modules via the +.Xr kld 4 +facility. +Transport protocols can select from the list of available algorithms on a +connection-by-connection basis, or use the system default (see +.Xr mod_cc 4 +for more details). +.Pp +.Nm +modules are identified by an +.Xr ascii 7 +name and set of hook functions encapsulated in a +.Vt "struct cc_algo" , +which has the following members: +.Bd -literal -offset indent +struct cc_algo { + char name[TCP_CA_NAME_MAX]; + int (*mod_init) (void); + int (*mod_destroy) (void); + int (*cb_init) (struct cc_var *ccv); + void (*cb_destroy) (struct cc_var *ccv); + void (*conn_init) (struct cc_var *ccv); + void (*ack_received) (struct cc_var *ccv, uint16_t type); + void (*cong_signal) (struct cc_var *ccv, uint32_t type); + void (*post_recovery) (struct cc_var *ccv); + void (*after_idle) (struct cc_var *ccv); +}; +.Ed +.Pp +The +.Va name +field identifies the unique name of the algorithm, and should be no longer than +TCP_CA_NAME_MAX-1 characters in length (the TCP_CA_NAME_MAX define lives in +.In netinet/tcp.h +for compatibility reasons). +.Pp +The +.Va mod_init +function is called when a new module is loaded into the system but before the +registration process is complete. +It should be implemented if a module needs to set up some global state prior to +being available for use by new connections. +Returning a non-zero value from +.Va mod_init +will cause the loading of the module to fail. +.Pp +The +.Va mod_destroy +function is called prior to unloading an existing module from the kernel. +It should be implemented if a module needs to clean up any global state before +being removed from the kernel. +The return value is currently ignored. +.Pp +The +.Va cb_init +function is called when a TCP control block +.Vt struct tcpcb +is created. +It should be implemented if a module needs to allocate memory for storing +private per-connection state. +Returning a non-zero value from +.Va cb_init +will cause the connection set up to be aborted, terminating the connection as a +result. +.Pp +The +.Va cb_destroy +function is called when a TCP control block +.Vt struct tcpcb +is destroyed. +It should be implemented if a module needs to free memory allocated in +.Va cb_init . +.Pp +The +.Va conn_init +function is called when a new connection has been established and variables are +being initialised. +It should be implemented to initialise congestion control algorithm variables +for the newly established connection. +.Pp +The +.Va ack_received +function is called when a TCP acknowledgement (ACK) packet is received. +Modules use the +.Fa type +argument as an input to their congestion management algorithms. +The ACK types currently reported by the stack are CC_ACK and CC_DUPACK. +CC_ACK indicates the received ACK acknowledges previously unacknowledged data. +CC_DUPACK indicates the received ACK acknowledges data we have already received +an ACK for. +.Pp +The +.Va cong_signal +function is called when a congestion event is detected by the TCP stack. +Modules use the +.Fa type +argument as an input to their congestion management algorithms. +The congestion event types currently reported by the stack are CC_ECN, CC_RTO, +CC_RTO_ERR and CC_NDUPACK. +CC_ECN is reported when the TCP stack receives an explicit congestion notification +(RFC3168). +CC_RTO is reported when the retransmission time out timer fires. +CC_RTO_ERR is reported if the retransmission time out timer fired in error. +CC_NDUPACK is reported if N duplicate ACKs have been received back-to-back, +where N is the fast retransmit duplicate ack threshold (N=3 currently as per +RFC5681). +.Pp +The +.Va post_recovery +function is called after the TCP connection has recovered from a congestion event. +It should be implemented to adjust state as required. +.Pp +The +.Va after_idle +function is called when data transfer resumes after an idle period. +It should be implemented to adjust state as required. +.Pp +The +.Fn DECLARE_CC_MODULE +macro provides a convenient wrapper around the +.Xr DECLARE_MODULE 9 +macro, and is used to register a +.Nm +module with the +.Nm +framework. +The +.Fa ccname +argument specifies the module's name. +The +.Fa ccalgo +argument points to the module's +.Vt struct cc_algo . +.Pp +.Nm +modules must instantiate a +.Vt struct cc_algo , +but are only required to set the name field, and optionally any of the function +pointers. +The stack will skip calling any function pointer which is NULL, so there is no +requirement to implement any of the function pointers. +Using the C99 designated initialiser feature to set fields is encouraged. +.Pp +Each function pointer which deals with congestion control state is passed a +pointer to a +.Vt struct cc_var , +which has the following members: +.Bd -literal -offset indent +struct cc_var { + void *cc_data; + int bytes_this_ack; + tcp_seq curack; + uint32_t flags; + int type; + union ccv_container { + struct tcpcb *tcp; + struct sctp_nets *sctp; + } ccvc; +}; +.Ed +.Pp +.Vt struct cc_var +groups congestion control related variables into a single, embeddable structure +and adds a layer of indirection to accessing transport protocol control blocks. +The eventual goal is to allow a single set of +.Nm +modules to be shared between all congestion aware transport protocols, though +currently only +.Xr tcp 4 +is supported. +.Pp +To aid the eventual transition towards this goal, direct use of variables from +the transport protocol's data structures is strongly discouraged. +However, it is inevitable at the current time to require access to some of these +variables, and so the +.Fn CC_VAR +macro exists as a convenience accessor. +The +.Fa ccv +argument points to the +.Vt struct cc_var +passed into the function by the +.Nm +framework. +The +.Fa what +argument specifies the name of the variable to access. +.Pp +Apart from the +.Va type +and +.Va ccv_container +fields, the remaining fields in +.Vt struct cc_var +are for use by +.Nm +modules. +.Pp +The +.Va cc_data +field is available for algorithms requiring additional per-connection state to +attach a dynamic memory pointer to. +The memory should be allocated and attached in the module's +.Va cb_init +hook function. +.Pp +The +.Va bytes_this_ack +field specifies the number of new bytes acknowledged by the most recently +received ACK packet. +It is only valid in the +.Va ack_received +hook function. +.Pp +The +.Va curack +field specifies the sequence number of the most recently received ACK packet. +It is only valid in the +.Va ack_received , +.Va cong_signal +and +.Va post_recovery +hook functions. +.Pp +The +.Va flags +field is used to pass useful information from the stack to a +.Nm +module. +The CCF_ABC_SENTAWND flag is relevant in +.Va ack_received +and is set when appropriate byte counting (RFC3465) has counted a window's worth +of bytes has been sent. +It is the module's responsibility to clear the flag after it has processed the +signal. +The CCF_CWND_LIMITED flag is relevant in +.Va ack_received +and is set when the connection's ability to send data is currently constrained +by the value of the congestion window. +Algorithms should use the abscence of this flag being set to avoid accumulating +a large difference between the congestion window and send window. +.Sh SEE ALSO +.Xr cc_chd 4 , +.Xr cc_cubic 4 , +.Xr cc_hd 4 , +.Xr cc_htcp 4 , +.Xr cc_newreno 4 , +.Xr cc_vegas 4 , +.Xr mod_cc 4 , +.Xr tcp 4 +.Sh ACKNOWLEDGEMENTS +Development and testing of this software were made possible in part by grants +from the FreeBSD Foundation and Cisco University Research Program Fund at +Community Foundation Silicon Valley. +.Sh FUTURE WORK +Integrate with +.Xr sctp 4 . +.Sh HISTORY +The modular Congestion Control (CC) framework first appeared in +.Fx 9.0 . +.Pp +The framework was first released in 2007 by James Healy and Lawrence Stewart +whilst working on the NewTCP research project at Swinburne University of +Technology's Centre for Advanced Internet Architectures, Melbourne, Australia, +which was made possible in part by a grant from the Cisco University Research +Program Fund at Community Foundation Silicon Valley. +More details are available at: +.Pp +http://caia.swin.edu.au/urp/newtcp/ +.Sh AUTHORS +.An -nosplit +The +.Nm +framework was written by +.An Lawrence Stewart Aq lstewart@FreeBSD.org , +.An James Healy Aq jimmy@deefa.com +and +.An David Hayes Aq david.hayes@ieee.org . +.Pp +This manual page was written by +.An David Hayes Aq david.hayes@ieee.org +and +.An Lawrence Stewart Aq lstewart@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Fri Sep 23 05:35:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CACE1065670; Fri, 23 Sep 2011 05:35:24 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BF028FC08; Fri, 23 Sep 2011 05:35:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8N5ZOt4056583; Fri, 23 Sep 2011 05:35:24 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8N5ZOuc056581; Fri, 23 Sep 2011 05:35:24 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201109230535.p8N5ZOuc056581@svn.freebsd.org> From: Lawrence Stewart Date: Fri, 23 Sep 2011 05:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225739 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2011 05:35:24 -0000 Author: lstewart Date: Fri Sep 23 05:35:24 2011 New Revision: 225739 URL: http://svn.freebsd.org/changeset/base/225739 Log: Follow up to r225738 to fix the mismerge of share/man/man4/Makefile. This is an intentional direct commit to the 8-STABLE branch. Modified: stable/8/share/man/man4/Makefile Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Fri Sep 23 05:28:09 2011 (r225738) +++ stable/8/share/man/man4/Makefile Fri Sep 23 05:35:24 2011 (r225739) @@ -225,7 +225,6 @@ MAN= aac.4 \ mmcsd.4 \ mn.4 \ mod_cc.4 \ - mos.4 \ mouse.4 \ mps.4 \ mpt.4 \ From owner-svn-src-all@FreeBSD.ORG Fri Sep 23 15:43:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D446106567A for ; Fri, 23 Sep 2011 15:43:38 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id 1CA208FC0A for ; Fri, 23 Sep 2011 15:43:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.4/8.14.4) with ESMTP id p8NFhWHA007121; Fri, 23 Sep 2011 19:43:32 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Fri, 23 Sep 2011 19:43:32 +0400 (MSD) From: Dmitry Morozovsky To: "Simon L. Nielsen" In-Reply-To: <201109221751.p8MHp9UC032919@svn.freebsd.org> Message-ID: References: <201109221751.p8MHp9UC032919@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (woozle.rinet.ru [0.0.0.0]); Fri, 23 Sep 2011 19:43:32 +0400 (MSD) Cc: svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-svnadmin@freebsd.org Subject: Re: svn commit: r225730 - svnadmin/tools X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2011 15:43:38 -0000 Dear Simon/colleagues, it seems CVS exporter has missed quite a bit of files when creating fictious RELENG_9: > head /FreeBSD/ncvs/src/Makefile,v head 1.392; access; symbols RELENG_7_4_0_RELEASE:1.341.2.8.2.1 RELENG_8_2_0_RELEASE:1.358.2.3.4.1 RELENG_7_4:1.341.2.8.0.2 RELENG_7_4_BP:1.341.2.8 RELENG_8_2:1.358.2.3.0.4 RELENG_8_2_BP:1.358.2.3 RELENG_8_1_0_RELEASE:1.358.2.3.2.1 And, naturally, at the root level of RELENG_9 CVS checkout, there is only Makefile.mips, no Makefile and Makefile.inc1 On Thu, 22 Sep 2011, Simon L. Nielsen wrote: > Author: simon > Date: Thu Sep 22 17:51:09 2011 > New Revision: 225730 > URL: http://svn.freebsd.org/changeset/base/225730 > > Log: > - Add 9.0 (stable and releng) branches to svn2cvs mapping. [1] > - Checkpoint current list of hacks mainly to handle support for > 'Replaced' files. > > Requested by: kensmith > > Modified: > svnadmin/tools/export.py > > Modified: svnadmin/tools/export.py > ============================================================================== > --- svnadmin/tools/export.py Thu Sep 22 12:53:27 2011 (r225729) > +++ svnadmin/tools/export.py Thu Sep 22 17:51:09 2011 (r225730) > @@ -175,6 +175,7 @@ maptable = [ > ( 'stable/6/', 'RELENG_6' ), > ( 'stable/7/', 'RELENG_7' ), > ( 'stable/8/', 'RELENG_8' ), > + ( 'stable/9/', 'RELENG_9' ), > # errata / security / releng branches > ( 'releng/ALPHA_2_0/','ALPHA_2_0' ), > ( 'releng/BETA_2_0/', 'BETA_2_0' ), > @@ -209,6 +210,7 @@ maptable = [ > ( 'releng/8.1/', 'RELENG_8_1' ), > ( 'releng/8.2/', 'RELENG_8_2' ), > ( 'releng/8.3/', 'RELENG_8_3' ), > + ( 'releng/9.0/', 'RELENG_9_0' ), > ] > > def map2cvs(svnpath): > @@ -336,6 +338,54 @@ def exportrev(pool, fs_ptr, rev, cvspath > # continue > #if p == 'stable/8/release/picobsd/floppy.tree/sbin' and k == 'D': > # continue > + #if p == 'head/contrib/llvm/tools/clang/www/demo/what is this directory.txt.' and k == 'A': > + # continue > + #if p == 'head/contrib/llvm/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp' and k == 'D' and rev == 210299: > + # continue > + #if p == 'head/contrib/llvm/lib/ExecutionEngine/JIT/JITDebugRegisterer.h' and k == 'D' and rev == 210299: > + # continue > + #if p == 'head/sys/contrib/octeon-sdk/cvmx-interrupt-handler.S' and k == 'D' and rev == 215990: > + # continue > + #if p == 'head/sys/contrib/octeon-sdk/cvmx-log-arc.S' and k == 'D' and rev == 215990: > + # continue > + #if p == 'head/contrib/binutils/ld/emultempl/mipself.em' and k == 'D' and rev == 218822: > + # continue > + #if p == 'head/contrib/binutils/libiberty/pexecute.c' and k == 'D' and rev == 218822: > + # continue > + #if p == 'head/sys/modules/cxgbe/Makefile' and k == 'D' and rev == 220231: > + # continue > + if p == 'head/share/man/man4/geom_map.4' and k == 'D' and rev == 222813: > + continue > + if p == 'head/sys/dev/iicbus/ad7417.c' and k == 'D' and rev == 222813: > + continue > + if p == 'head/sys/nfs/nfs_kdtrace.h' and k == 'D' and rev == 222813: > + continue > + if p == 'head/sys/sys/_stdint.h' and k == 'D' and rev == 222813: > + continue > + if p == 'head/tools/build/options/WITHOUT_GPIO' and k == 'D' and rev == 222813: > + continue > + if p == 'head/tools/build/options/WITH_OFED' and k == 'D' and rev == 222813: > + continue > + if p == 'head/tools/regression/bin/sh/builtins/set1.0' and k == 'D' and rev == 222813: > + continue > + if p == 'head/tools/regression/bin/sh/parser/dollar-quote1.0' and k == 'D' and rev == 222813: > + continue > + if p == 'head/tools/regression/bin/sh/parser/dollar-quote2.0' and k == 'D' and rev == 222813: > + continue > + if p == 'head/tools/regression/bin/sh/parser/dollar-quote3.0' and k == 'D' and rev == 222813: > + continue > + if p == 'head/tools/regression/bin/sh/parser/dollar-quote4.0' and k == 'D' and rev == 222813: > + continue > + if p == 'head/tools/regression/bin/sh/parser/dollar-quote5.0' and k == 'D' and rev == 222813: > + continue > + if p == 'head/tools/regression/bin/sh/parser/dollar-quote6.0' and k == 'D' and rev == 222813: > + continue > + if p == 'head/tools/regression/bin/sh/parser/dollar-quote7.0' and k == 'D' and rev == 222813: > + continue > + if p == 'head/tools/regression/bin/sh/parser/dollar-quote8.0' and k == 'D' and rev == 222813: > + continue > + if p == 'head/tools/regression/bin/sh/parser/dollar-quote9.0' and k == 'D' and rev == 222813: > + continue > makedirs(workpath, _dirname(path), 'src') > # Now the directory for the files must exist, and branch tag will be sticky > assert os.path.isdir(os.path.join(workpath, _dirname(path))) > @@ -380,6 +430,7 @@ def export(pool, repos_path, cvspath): > print '==========> export rev ' + rev > exportrev(pool, fs_ptr, last_rev + 1, cvspath) > fs.change_rev_prop(fs_ptr, 0, 'fbsd:lastexp', rev) > + #return > continue > print "." > time.sleep(15) > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Fri Sep 23 16:33:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B35D1106564A; Fri, 23 Sep 2011 16:33:44 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id EFA7B8FC0C; Fri, 23 Sep 2011 16:33:43 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id A916725D386D; Fri, 23 Sep 2011 16:33:42 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id BECF8BD3C3D; Fri, 23 Sep 2011 16:33:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id vyRfPqo3xF0I; Fri, 23 Sep 2011 16:33:39 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 75B12BD3C21; Fri, 23 Sep 2011 16:33:38 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: Date: Fri, 23 Sep 2011 16:33:37 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201109221751.p8MHp9UC032919@svn.freebsd.org> To: Dmitry Morozovsky X-Mailer: Apple Mail (2.1084) Cc: svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-svnadmin@freebsd.org, "Simon L. Nielsen" Subject: Re: svn commit: r225730 - svnadmin/tools X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2011 16:33:44 -0000 On Sep 23, 2011, at 3:43 PM, Dmitry Morozovsky wrote: > Dear Simon/colleagues, >=20 > it seems CVS exporter has missed quite a bit of files when creating = fictious=20 > RELENG_9: I guess you cvsup or similar isn't up-to-date yet which usually happens = on branching as it's taking quite a while to populate. I can tell you = that the master copy has: > more Makefile,v=20 head 1.392; access; symbols RELENG_9:1.392.0.2 RELENG_9_BP:1.392 RELENG_7_4_0_RELEASE:1.341.2.8.2.1 RELENG_8_2_0_RELEASE:1.358.2.3.4.1 RELENG_7_4:1.341.2.8.0.2 RELENG_7_4_BP:1.341.2.8 RELENG_8_2:1.358.2.3.0.4 RELENG_8_2_BP:1.358.2.3 RELENG_8_1_0_RELEASE:1.358.2.3.2.1 >> head /FreeBSD/ncvs/src/Makefile,v > head 1.392; > access; > symbols > RELENG_7_4_0_RELEASE:1.341.2.8.2.1 > RELENG_8_2_0_RELEASE:1.358.2.3.4.1 > RELENG_7_4:1.341.2.8.0.2 > RELENG_7_4_BP:1.341.2.8 > RELENG_8_2:1.358.2.3.0.4 > RELENG_8_2_BP:1.358.2.3 > RELENG_8_1_0_RELEASE:1.358.2.3.2.1 >=20 > And, naturally, at the root level of RELENG_9 CVS checkout, there is = only=20 > Makefile.mips, no Makefile and Makefile.inc1 >=20 >=20 > On Thu, 22 Sep 2011, Simon L. Nielsen wrote: >=20 >> Author: simon >> Date: Thu Sep 22 17:51:09 2011 >> New Revision: 225730 >> URL: http://svn.freebsd.org/changeset/base/225730 >>=20 >> Log: >> - Add 9.0 (stable and releng) branches to svn2cvs mapping. [1] >> - Checkpoint current list of hacks mainly to handle support for >> 'Replaced' files. >>=20 >> Requested by: kensmith >>=20 >> Modified: >> svnadmin/tools/export.py >>=20 >> Modified: svnadmin/tools/export.py >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- svnadmin/tools/export.py Thu Sep 22 12:53:27 2011 = (r225729) >> +++ svnadmin/tools/export.py Thu Sep 22 17:51:09 2011 = (r225730) >> @@ -175,6 +175,7 @@ maptable =3D [ >> ( 'stable/6/', 'RELENG_6' ), >> ( 'stable/7/', 'RELENG_7' ), >> ( 'stable/8/', 'RELENG_8' ), >> + ( 'stable/9/', 'RELENG_9' ), >> # errata / security / releng branches >> ( 'releng/ALPHA_2_0/','ALPHA_2_0' ), >> ( 'releng/BETA_2_0/', 'BETA_2_0' ), >> @@ -209,6 +210,7 @@ maptable =3D [ >> ( 'releng/8.1/', 'RELENG_8_1' ), >> ( 'releng/8.2/', 'RELENG_8_2' ), >> ( 'releng/8.3/', 'RELENG_8_3' ), >> + ( 'releng/9.0/', 'RELENG_9_0' ), >> ] >>=20 >> def map2cvs(svnpath): >> @@ -336,6 +338,54 @@ def exportrev(pool, fs_ptr, rev, cvspath >> # continue >> #if p =3D=3D 'stable/8/release/picobsd/floppy.tree/sbin' and k =3D=3D= 'D': >> # continue >> + #if p =3D=3D 'head/contrib/llvm/tools/clang/www/demo/what is = this directory.txt.' and k =3D=3D 'A': >> + # continue >> + #if p =3D=3D = 'head/contrib/llvm/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp' and k = =3D=3D 'D' and rev =3D=3D 210299: >> + # continue >> + #if p =3D=3D = 'head/contrib/llvm/lib/ExecutionEngine/JIT/JITDebugRegisterer.h' and k = =3D=3D 'D' and rev =3D=3D 210299: >> + # continue >> + #if p =3D=3D = 'head/sys/contrib/octeon-sdk/cvmx-interrupt-handler.S' and k =3D=3D 'D' = and rev =3D=3D 215990: >> + # continue >> + #if p =3D=3D 'head/sys/contrib/octeon-sdk/cvmx-log-arc.S' and k = =3D=3D 'D' and rev =3D=3D 215990: >> + # continue >> + #if p =3D=3D 'head/contrib/binutils/ld/emultempl/mipself.em' and = k =3D=3D 'D' and rev =3D=3D 218822: >> + # continue >> + #if p =3D=3D 'head/contrib/binutils/libiberty/pexecute.c' and k = =3D=3D 'D' and rev =3D=3D 218822: >> + # continue >> + #if p =3D=3D 'head/sys/modules/cxgbe/Makefile' and k =3D=3D 'D' = and rev =3D=3D 220231: >> + # continue >> + if p =3D=3D 'head/share/man/man4/geom_map.4' and k =3D=3D 'D' = and rev =3D=3D 222813: >> + continue >> + if p =3D=3D 'head/sys/dev/iicbus/ad7417.c' and k =3D=3D 'D' and = rev =3D=3D 222813: >> + continue >> + if p =3D=3D 'head/sys/nfs/nfs_kdtrace.h' and k =3D=3D 'D' and = rev =3D=3D 222813: >> + continue >> + if p =3D=3D 'head/sys/sys/_stdint.h' and k =3D=3D 'D' and rev =3D=3D= 222813: >> + continue >> + if p =3D=3D 'head/tools/build/options/WITHOUT_GPIO' and k =3D=3D = 'D' and rev =3D=3D 222813: >> + continue >> + if p =3D=3D 'head/tools/build/options/WITH_OFED' and k =3D=3D = 'D' and rev =3D=3D 222813: >> + continue >> + if p =3D=3D 'head/tools/regression/bin/sh/builtins/set1.0' and k = =3D=3D 'D' and rev =3D=3D 222813: >> + continue >> + if p =3D=3D = 'head/tools/regression/bin/sh/parser/dollar-quote1.0' and k =3D=3D 'D' = and rev =3D=3D 222813: >> + continue >> + if p =3D=3D = 'head/tools/regression/bin/sh/parser/dollar-quote2.0' and k =3D=3D 'D' = and rev =3D=3D 222813: >> + continue >> + if p =3D=3D = 'head/tools/regression/bin/sh/parser/dollar-quote3.0' and k =3D=3D 'D' = and rev =3D=3D 222813: >> + continue >> + if p =3D=3D = 'head/tools/regression/bin/sh/parser/dollar-quote4.0' and k =3D=3D 'D' = and rev =3D=3D 222813: >> + continue >> + if p =3D=3D = 'head/tools/regression/bin/sh/parser/dollar-quote5.0' and k =3D=3D 'D' = and rev =3D=3D 222813: >> + continue >> + if p =3D=3D = 'head/tools/regression/bin/sh/parser/dollar-quote6.0' and k =3D=3D 'D' = and rev =3D=3D 222813: >> + continue >> + if p =3D=3D = 'head/tools/regression/bin/sh/parser/dollar-quote7.0' and k =3D=3D 'D' = and rev =3D=3D 222813: >> + continue >> + if p =3D=3D = 'head/tools/regression/bin/sh/parser/dollar-quote8.0' and k =3D=3D 'D' = and rev =3D=3D 222813: >> + continue >> + if p =3D=3D = 'head/tools/regression/bin/sh/parser/dollar-quote9.0' and k =3D=3D 'D' = and rev =3D=3D 222813: >> + continue >> makedirs(workpath, _dirname(path), 'src') >> # Now the directory for the files must exist, and branch tag will = be sticky >> assert os.path.isdir(os.path.join(workpath, _dirname(path))) >> @@ -380,6 +430,7 @@ def export(pool, repos_path, cvspath): >> print '=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> export rev ' + rev >> exportrev(pool, fs_ptr, last_rev + 1, cvspath) >> fs.change_rev_prop(fs_ptr, 0, 'fbsd:lastexp', rev) >> + #return >> continue >> print "." >> time.sleep(15) >> _______________________________________________ >> svn-src-all@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/svn-src-all >> To unsubscribe, send any mail to = "svn-src-all-unsubscribe@freebsd.org" >>=20 >=20 > --=20 > Sincerely, > D.Marck [DM5020, MCK-RIPE, = DM3-RIPN] > [ FreeBSD committer: marck@FreeBSD.org = ] > = ------------------------------------------------------------------------ > *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru = *** > = ------------------------------------------------------------------------ --=20 Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-all@FreeBSD.ORG Fri Sep 23 16:37:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0132C106564A; Fri, 23 Sep 2011 16:37:29 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4EE78FC0A; Fri, 23 Sep 2011 16:37:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8NGbSQp079917; Fri, 23 Sep 2011 16:37:28 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8NGbSbl079915; Fri, 23 Sep 2011 16:37:28 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201109231637.p8NGbSbl079915@svn.freebsd.org> From: Ken Smith Date: Fri, 23 Sep 2011 16:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-other@freebsd.org X-SVN-Group: stable-other MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225744 - stable/9/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2011 16:37:29 -0000 Author: kensmith Date: Fri Sep 23 16:37:28 2011 New Revision: 225744 URL: http://svn.freebsd.org/changeset/base/225744 Log: Ready for BETA3. Approved by: re (implicit) Modified: stable/9/sys/conf/newvers.sh Modified: stable/9/sys/conf/newvers.sh ============================================================================== --- stable/9/sys/conf/newvers.sh Fri Sep 23 15:36:52 2011 (r225743) +++ stable/9/sys/conf/newvers.sh Fri Sep 23 16:37:28 2011 (r225744) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.0" -BRANCH="BETA2" +BRANCH="BETA3" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Fri Sep 23 18:20:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84BAA1065691 for ; Fri, 23 Sep 2011 18:20:47 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smtp-out1.tiscali.nl (smtp-out1.tiscali.nl [195.241.79.176]) by mx1.freebsd.org (Postfix) with ESMTP id F01338FC2B for ; Fri, 23 Sep 2011 18:20:46 +0000 (UTC) Received: from [212.182.167.131] (helo=sjakie.klop.ws) by smtp-out1.tiscali.nl with esmtp (Exim) (envelope-from ) id 1R7A81-00068p-1l for svn-src-all@freebsd.org; Fri, 23 Sep 2011 20:05:37 +0200 Received: from 212-182-167-131.ip.telfort.nl (localhost [127.0.0.1]) by sjakie.klop.ws (Postfix) with ESMTP id 737C6A901 for ; Fri, 23 Sep 2011 20:05:33 +0200 (CEST) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Cc: svn-src-all@freebsd.org References: <201109221751.p8MHp9UC032919@svn.freebsd.org> Date: Fri, 23 Sep 2011 20:05:33 +0200 MIME-Version: 1.0 From: "Ronald Klop" Message-ID: In-Reply-To: User-Agent: Opera Mail/11.51 (FreeBSD) Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r225730 - svnadmin/tools X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2011 18:20:47 -0000 I'm not authoritative in this. But why does the freebsd project not end =20 cvs support? It is not that the world stopped after cvs and it only takes= =20 time from other tasks IMHO. Ronald. On Fri, 23 Sep 2011 17:43:32 +0200, Dmitry Morozovsky =20 wrote: > Dear Simon/colleagues, > > it seems CVS exporter has missed quite a bit of files when creating =20 > fictious > RELENG_9: > >> head /FreeBSD/ncvs/src/Makefile,v > head 1.392; > access; > symbols > RELENG_7_4_0_RELEASE:1.341.2.8.2.1 > RELENG_8_2_0_RELEASE:1.358.2.3.4.1 > RELENG_7_4:1.341.2.8.0.2 > RELENG_7_4_BP:1.341.2.8 > RELENG_8_2:1.358.2.3.0.4 > RELENG_8_2_BP:1.358.2.3 > RELENG_8_1_0_RELEASE:1.358.2.3.2.1 > > And, naturally, at the root level of RELENG_9 CVS checkout, there is on= ly > Makefile.mips, no Makefile and Makefile.inc1 > > > On Thu, 22 Sep 2011, Simon L. Nielsen wrote: > >> Author: simon >> Date: Thu Sep 22 17:51:09 2011 >> New Revision: 225730 >> URL: http://svn.freebsd.org/changeset/base/225730 >> >> Log: >> - Add 9.0 (stable and releng) branches to svn2cvs mapping. [1] >> - Checkpoint current list of hacks mainly to handle support for >> 'Replaced' files. >> >> Requested by: kensmith >> >> Modified: >> svnadmin/tools/export.py >> >> Modified: svnadmin/tools/export.py >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- svnadmin/tools/export.py Thu Sep 22 12:53:27 2011 (r225729) >> +++ svnadmin/tools/export.py Thu Sep 22 17:51:09 2011 (r225730) >> @@ -175,6 +175,7 @@ maptable =3D [ >> ( 'stable/6/', 'RELENG_6' ), >> ( 'stable/7/', 'RELENG_7' ), >> ( 'stable/8/', 'RELENG_8' ), >> + ( 'stable/9/', 'RELENG_9' ), >> # errata / security / releng branches >> ( 'releng/ALPHA_2_0/','ALPHA_2_0' ), >> ( 'releng/BETA_2_0/', 'BETA_2_0' ), >> @@ -209,6 +210,7 @@ maptable =3D [ >> ( 'releng/8.1/', 'RELENG_8_1' ), >> ( 'releng/8.2/', 'RELENG_8_2' ), >> ( 'releng/8.3/', 'RELENG_8_3' ), >> + ( 'releng/9.0/', 'RELENG_9_0' ), >> ] >> >> def map2cvs(svnpath): >> @@ -336,6 +338,54 @@ def exportrev(pool, fs_ptr, rev, cvspath >> # continue >> #if p =3D=3D 'stable/8/release/picobsd/floppy.tree/sbin' and k =3D= =3D 'D': >> # continue >> + #if p =3D=3D 'head/contrib/llvm/tools/clang/www/demo/what is this= =20 >> directory.txt.' and k =3D=3D 'A': >> + # continue >> + #if p =3D=3D =20 >> 'head/contrib/llvm/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp' and= =20 >> k =3D=3D 'D' and rev =3D=3D 210299: >> + # continue >> + #if p =3D=3D =20 >> 'head/contrib/llvm/lib/ExecutionEngine/JIT/JITDebugRegisterer.h' and k= =20 >> =3D=3D 'D' and rev =3D=3D 210299: >> + # continue >> + #if p =3D=3D 'head/sys/contrib/octeon-sdk/cvmx-interrupt-handler.= S' =20 >> and k =3D=3D 'D' and rev =3D=3D 215990: >> + # continue >> + #if p =3D=3D 'head/sys/contrib/octeon-sdk/cvmx-log-arc.S' and k =3D= =3D 'D' =20 >> and rev =3D=3D 215990: >> + # continue >> + #if p =3D=3D 'head/contrib/binutils/ld/emultempl/mipself.em' and = k =3D=3D =20 >> 'D' and rev =3D=3D 218822: >> + # continue >> + #if p =3D=3D 'head/contrib/binutils/libiberty/pexecute.c' and k =3D= =3D 'D' =20 >> and rev =3D=3D 218822: >> + # continue >> + #if p =3D=3D 'head/sys/modules/cxgbe/Makefile' and k =3D=3D 'D' a= nd rev =3D=3D =20 >> 220231: >> + # continue >> + if p =3D=3D 'head/share/man/man4/geom_map.4' and k =3D=3D 'D' and= rev =3D=3D =20 >> 222813: >> + continue >> + if p =3D=3D 'head/sys/dev/iicbus/ad7417.c' and k =3D=3D 'D' and r= ev =3D=3D =20 >> 222813: >> + continue >> + if p =3D=3D 'head/sys/nfs/nfs_kdtrace.h' and k =3D=3D 'D' and rev= =3D=3D =20 >> 222813: >> + continue >> + if p =3D=3D 'head/sys/sys/_stdint.h' and k =3D=3D 'D' and rev =3D= =3D 222813: >> + continue >> + if p =3D=3D 'head/tools/build/options/WITHOUT_GPIO' and k =3D=3D = 'D' and =20 >> rev =3D=3D 222813: >> + continue >> + if p =3D=3D 'head/tools/build/options/WITH_OFED' and k =3D=3D 'D'= and rev =20 >> =3D=3D 222813: >> + continue >> + if p =3D=3D 'head/tools/regression/bin/sh/builtins/set1.0' and k = =3D=3D =20 >> 'D' and rev =3D=3D 222813: >> + continue >> + if p =3D=3D 'head/tools/regression/bin/sh/parser/dollar-quote1.0'= and =20 >> k =3D=3D 'D' and rev =3D=3D 222813: >> + continue >> + if p =3D=3D 'head/tools/regression/bin/sh/parser/dollar-quote2.0'= and =20 >> k =3D=3D 'D' and rev =3D=3D 222813: >> + continue >> + if p =3D=3D 'head/tools/regression/bin/sh/parser/dollar-quote3.0'= and =20 >> k =3D=3D 'D' and rev =3D=3D 222813: >> + continue >> + if p =3D=3D 'head/tools/regression/bin/sh/parser/dollar-quote4.0'= and =20 >> k =3D=3D 'D' and rev =3D=3D 222813: >> + continue >> + if p =3D=3D 'head/tools/regression/bin/sh/parser/dollar-quote5.0'= and =20 >> k =3D=3D 'D' and rev =3D=3D 222813: >> + continue >> + if p =3D=3D 'head/tools/regression/bin/sh/parser/dollar-quote6.0'= and =20 >> k =3D=3D 'D' and rev =3D=3D 222813: >> + continue >> + if p =3D=3D 'head/tools/regression/bin/sh/parser/dollar-quote7.0'= and =20 >> k =3D=3D 'D' and rev =3D=3D 222813: >> + continue >> + if p =3D=3D 'head/tools/regression/bin/sh/parser/dollar-quote8.0'= and =20 >> k =3D=3D 'D' and rev =3D=3D 222813: >> + continue >> + if p =3D=3D 'head/tools/regression/bin/sh/parser/dollar-quote9.0'= and =20 >> k =3D=3D 'D' and rev =3D=3D 222813: >> + continue >> makedirs(workpath, _dirname(path), 'src') >> # Now the directory for the files must exist, and branch tag will= =20 >> be sticky >> assert os.path.isdir(os.path.join(workpath, _dirname(path))) >> @@ -380,6 +430,7 @@ def export(pool, repos_path, cvspath): >> print '=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> export rev ' + rev >> exportrev(pool, fs_ptr, last_rev + 1, cvspath) >> fs.change_rev_prop(fs_ptr, 0, 'fbsd:lastexp', rev) >> + #return >> continue >> print "." >> time.sleep(15) >> _______________________________________________ >> svn-src-all@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/svn-src-all >> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" >> From owner-svn-src-all@FreeBSD.ORG Fri Sep 23 21:10:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 903B91065674 for ; Fri, 23 Sep 2011 21:10:22 +0000 (UTC) (envelope-from niclas.zeising@gmail.com) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id 1917F8FC0A for ; Fri, 23 Sep 2011 21:10:22 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id BC8524001A for ; Fri, 23 Sep 2011 23:10:20 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id B1B4B4000E; Fri, 23 Sep 2011 23:10:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL,FREEMAIL_FROM autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (h-45-105.a163.priv.bahnhof.se [94.254.45.105]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 43CE04000A; Fri, 23 Sep 2011 23:10:19 +0200 (CEST) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2001:470:dca9:0:1::4]) by mx.daemonic.se (Postfix) with ESMTPS id A90A7119C04; Fri, 23 Sep 2011 23:09:48 +0200 (CEST) Received: from [IPv6:2001:470:dca9:1::4] (vivi.daemonic.se [IPv6:2001:470:dca9:1::4]) by mail.daemonic.se (Postfix) with ESMTPSA id 77DC612B0A0; Fri, 23 Sep 2011 23:09:46 +0200 (CEST) Message-ID: <4E7CF594.8050703@gmail.com> Date: Fri, 23 Sep 2011 23:09:40 +0200 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Ronald Klop References: <201109221751.p8MHp9UC032919@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r225730 - svnadmin/tools X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2011 21:10:22 -0000 On 2011-09-23 20:05, Ronald Klop wrote: > I'm not authoritative in this. But why does the freebsd project not end > cvs support? It is not that the world stopped after cvs and it only > takes time from other tasks IMHO. > > Ronald. > >From my understanding of things, cvsup only works with cvs repos, and it is the way we distribute source code. Regards! -- Niclas