From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 7 09:22:04 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8DFA9E9E; Sun, 7 Jul 2013 09:22:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8090A1C1A; Sun, 7 Jul 2013 09:22:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r679M4Ab025738; Sun, 7 Jul 2013 09:22:04 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r679M4st025737; Sun, 7 Jul 2013 09:22:04 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201307070922.r679M4st025737@svn.freebsd.org> From: Martin Matuska Date: Sun, 7 Jul 2013 09:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252921 - stable/8/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 09:22:04 -0000 Author: mm Date: Sun Jul 7 09:22:03 2013 New Revision: 252921 URL: http://svnweb.freebsd.org/changeset/base/252921 Log: MFC r252732: Fix misleading or remove irrelevant illumos messages and manpage references in the zfs command. PR: bin/178996 Submitted by: Peter Schaefer Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zfs/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun Jul 7 09:21:39 2013 (r252920) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun Jul 7 09:22:03 2013 (r252921) @@ -5590,8 +5590,8 @@ share_mount_one(zfs_handle_t *zhp, int o (void) fprintf(stderr, gettext("cannot share '%s': " "legacy share\n"), zfs_get_name(zhp)); - (void) fprintf(stderr, gettext("use share(1M) to " - "share this filesystem, or set " + (void) fprintf(stderr, gettext("to " + "share this filesystem set " "sharenfs property on\n")); return (1); } @@ -5607,7 +5607,7 @@ share_mount_one(zfs_handle_t *zhp, int o (void) fprintf(stderr, gettext("cannot %s '%s': " "legacy mountpoint\n"), cmdname, zfs_get_name(zhp)); - (void) fprintf(stderr, gettext("use %s(1M) to " + (void) fprintf(stderr, gettext("use %s(8) to " "%s this filesystem\n"), cmdname, cmdname); return (1); } @@ -6045,8 +6045,10 @@ unshare_unmount_path(int op, char *path, strcmp(smbshare_prop, "off") == 0) { (void) fprintf(stderr, gettext("cannot unshare " "'%s': legacy share\n"), path); +#ifdef illumos (void) fprintf(stderr, gettext("use " "unshare(1M) to unshare this filesystem\n")); +#endif } else if (!zfs_is_shared(zhp)) { (void) fprintf(stderr, gettext("cannot unshare '%s': " "not currently shared\n"), path); @@ -6065,7 +6067,7 @@ unshare_unmount_path(int op, char *path, (void) fprintf(stderr, gettext("cannot unmount " "'%s': legacy mountpoint\n"), zfs_get_name(zhp)); - (void) fprintf(stderr, gettext("use umount(1M) " + (void) fprintf(stderr, gettext("use umount(8) " "to unmount this filesystem\n")); } else { ret = zfs_unmountall(zhp, flags); @@ -6287,9 +6289,11 @@ unshare_unmount(int op, int argc, char * (void) fprintf(stderr, gettext("cannot " "unshare '%s': legacy share\n"), zfs_get_name(zhp)); +#ifdef illumos (void) fprintf(stderr, gettext("use " "unshare(1M) to unshare this " "filesystem\n")); +#endif ret = 1; } else if (!zfs_is_shared(zhp)) { (void) fprintf(stderr, gettext("cannot " @@ -6307,7 +6311,7 @@ unshare_unmount(int op, int argc, char * "unmount '%s': legacy " "mountpoint\n"), zfs_get_name(zhp)); (void) fprintf(stderr, gettext("use " - "umount(1M) to unmount this " + "umount(8) to unmount this " "filesystem\n")); ret = 1; } else if (!zfs_is_mounted(zhp, NULL)) { @@ -6493,12 +6497,12 @@ manual_mount(int argc, char **argv) } } else { (void) fprintf(stderr, gettext("filesystem '%s' cannot be " - "mounted using 'mount -F zfs'\n"), dataset); + "mounted using 'mount -t zfs'\n"), dataset); (void) fprintf(stderr, gettext("Use 'zfs set mountpoint=%s' " "instead.\n"), path); - (void) fprintf(stderr, gettext("If you must use 'mount -F zfs' " - "or /etc/vfstab, use 'zfs set mountpoint=legacy'.\n")); - (void) fprintf(stderr, gettext("See zfs(1M) for more " + (void) fprintf(stderr, gettext("If you must use 'mount -t zfs' " + "or /etc/fstab, use 'zfs set mountpoint=legacy'.\n")); + (void) fprintf(stderr, gettext("See zfs(8) for more " "information.\n")); ret = 1; } From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 7 14:20:01 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DE828BD1; Sun, 7 Jul 2013 14:20:01 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CEE721720; Sun, 7 Jul 2013 14:20:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67EK1Yd013986; Sun, 7 Jul 2013 14:20:01 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67EK1HX013981; Sun, 7 Jul 2013 14:20:01 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307071420.r67EK1HX013981@svn.freebsd.org> From: Lawrence Stewart Date: Sun, 7 Jul 2013 14:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252952 - in stable/8: share/man/man4 sys/modules/cc sys/modules/cc/cc_cdg sys/netinet/cc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 14:20:02 -0000 Author: lstewart Date: Sun Jul 7 14:20:00 2013 New Revision: 252952 URL: http://svnweb.freebsd.org/changeset/base/252952 Log: MFC r252504: Import an implementation of the CAIA Delay-Gradient (CDG) congestion control algorithm, which is based on the 2011 v0.1 patch release and described in the paper "Revisiting TCP Congestion Control using Delay Gradients" by David Hayes and Grenville Armitage. It is implemented as a kernel module compatible with the modular congestion control framework. CDG is a hybrid congestion control algorithm which reacts to both packet loss and inferred queuing delay. It attempts to operate as a delay-based algorithm where possible, but utilises heuristics to detect loss-based TCP cross traffic and will compete effectively as required. CDG is therefore incrementally deployable and suitable for use on shared networks. In collaboration with: David Hayes and Grenville Armitage Sponsored by: Cisco University Research Program and FreeBSD Foundation Added: stable/8/share/man/man4/cc_cdg.4 - copied unchanged from r252504, head/share/man/man4/cc_cdg.4 stable/8/sys/modules/cc/cc_cdg/ - copied from r252504, head/sys/modules/cc/cc_cdg/ stable/8/sys/netinet/cc/cc_cdg.c - copied unchanged from r252504, head/sys/netinet/cc/cc_cdg.c Modified: stable/8/share/man/man4/Makefile stable/8/sys/modules/cc/Makefile Directory Properties: stable/8/share/man/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/modules/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Sun Jul 7 14:14:44 2013 (r252951) +++ stable/8/share/man/man4/Makefile Sun Jul 7 14:20:00 2013 (r252952) @@ -67,6 +67,7 @@ MAN= aac.4 \ cardbus.4 \ carp.4 \ cas.4 \ + cc_cdg.4 \ cc_chd.4 \ cc_cubic.4 \ cc_hd.4 \ Copied: stable/8/share/man/man4/cc_cdg.4 (from r252504, head/share/man/man4/cc_cdg.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/cc_cdg.4 Sun Jul 7 14:20:00 2013 (r252952, copy of r252504, head/share/man/man4/cc_cdg.4) @@ -0,0 +1,155 @@ +.\" +.\" Copyright (c) 2013 Swinburne University of Technology, Melbourne, Australia +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE 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 July 2, 2013 +.Dt CC_CDG 4 +.Os +.Sh NAME +.Nm cc_cdg +.Nd CDG Congestion Control Algorithm +.Sh DESCRIPTION +CAIA-Delay Gradient (CDG) is a hybrid congestion control algorithm which reacts +to both packet loss and inferred queuing delay. +It attempts to operate as a delay-based algorithm where possible, but utilises +heuristics to detect loss-based TCP cross traffic and will compete effectively +as required. +CDG is therefore incrementally deployable and suitable for use on shared +networks. +.Pp +During delay-based operation, CDG uses a delay-gradient based probabilistic +backoff mechanism, and will also try to infer non congestion related +packet losses and avoid backing off when they occur. +During loss-based operation, CDG essentially reverts to +.Xr cc_newreno 4 Ns - Ns like +behaviour. +.Pp +CDG switches to loss-based operation when it detects that a configurable number +of consecutive delay-based backoffs have had no measurable effect. +It periodically attempts to return to delay-based operation, but will keep +switching back to loss-based operation as required. +.Sh MIB Variables +The algorithm exposes the following variables in the +.Va net.inet.tcp.cc.cdg +branch of the +.Xr sysctl 3 +MIB: +.Bl -tag -width ".Va exp_backoff_scale" +.It Va version +Current algorithm/implementation version number. +.It Va beta_delay +Delay-based window decrease factor as a percentage (on delay-based backoff, w = +w * beta_delay / 100). +Default is 70. +.It Va beta_loss +Loss-based window decrease factor as a percentage (on loss-based backoff, w = +w * beta_loss / 100). +Default is 50. +.It Va exp_backoff_scale +Scaling parameter for the probabilistic exponential backoff. +Default is 2. +.It Va smoothing_factor +Number of samples used for moving average smoothing (0 means no smoothing). +Default is 8. +.It Va loss_compete_consec_cong +Number of consecutive delay-gradient based congestion episodes which will +trigger loss-based CC compatibility. +Default is 5. +.It Va loss_compete_hold_backoff +Number of consecutive delay-gradient based congestion episodes to hold the +window backoff for loss-based CC compatibility. +Default is 5. +.It Va alpha_inc +If non-zero, this enables an experimental mode where CDG's window increase +factor (alpha) is increased by 1 MSS every +.Va alpha_inc +RTTs during congestion avoidance mode. +(Setting +.Va alpha_inc +to 1 results in the most aggressive growth of the window increase factor over +time. +Use higher +.Va alpha_inc +values for slower growth.) +Default is 0. +.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 h_ertt 4 , +.Xr mod_cc 4 , +.Xr tcp 4 , +.Xr khelp 9 , +.Xr mod_cc 9 +.Rs +.%A "D. A. Hayes" +.%A "G. Armitage" +.%T "Revisiting TCP Congestion Control using Delay Gradients" +.%J "Networking 2011 Proceedings, Part II" +.%D "May 2011" +.%P "328-341" +.Re +.Rs +.%A "N. Khademi" +.%A "G. Armitage" +.%T "Minimising RTT across homogeneous 802.11 WLANs with CAIA Delay-Gradient TCP (v0.1)" +.%R "CAIA Technical Report 121113A" +.%D "November 2012" +.%U "http://caia.swin.edu.au/reports/121113A/CAIA-TR-121113A.pdf" +.Re +.Sh ACKNOWLEDGEMENTS +Development and testing of this software were made possible in part by grants +from the FreeBSD Foundation and The Cisco University Research Program Fund, a +corporate advised fund of Silicon Valley Community Foundation. +.Sh HISTORY +The +.Nm +congestion control module first appeared in +.Fx 9.2 . +.Pp +The module was first released in 2011 by David Hayes whilst working on the +NewTCP research project at Swinburne University of Technology's Centre for +Advanced Internet Architectures, Melbourne, Australia. +More details are available at: +.Pp +http://caia.swin.edu.au/urp/newtcp/ +.Sh AUTHORS +.An -nosplit +The +.Nm +congestion control module was written by +.An David Hayes Aq david.hayes@ieee.org . +This manual page was written by +.An Lawrence Stewart Aq lstewart@FreeBSD.org +and +.An Grenville Armitage Aq garmitage@swin.edu.au . +.Sh BUGS +The underlying algorithm and parameter values are still a work in progress and +may not be optimal for some network scenarios. Modified: stable/8/sys/modules/cc/Makefile ============================================================================== --- stable/8/sys/modules/cc/Makefile Sun Jul 7 14:14:44 2013 (r252951) +++ stable/8/sys/modules/cc/Makefile Sun Jul 7 14:20:00 2013 (r252952) @@ -1,6 +1,7 @@ # $FreeBSD$ -SUBDIR= cc_chd \ +SUBDIR= cc_cdg \ + cc_chd \ cc_cubic \ cc_hd \ cc_htcp \ Copied: stable/8/sys/netinet/cc/cc_cdg.c (from r252504, head/sys/netinet/cc/cc_cdg.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/netinet/cc/cc_cdg.c Sun Jul 7 14:20:00 2013 (r252952, copy of r252504, head/sys/netinet/cc/cc_cdg.c) @@ -0,0 +1,695 @@ +/*- + * Copyright (c) 2009-2013 + * Swinburne University of Technology, Melbourne, Australia + * All rights reserved. + * + * This software was developed at the Centre for Advanced Internet + * Architectures, Swinburne University of Technology, by David Hayes, made + * possible in part by a gift from The Cisco University Research Program Fund, + * a corporate advised fund of Silicon Valley Community Foundation. Development + * and testing were further assisted by a grant 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. + */ + +/* + * CAIA Delay-Gradient (CDG) congestion control algorithm + * + * An implemention of the delay-gradient congestion control algorithm proposed + * in the following paper: + * + * D. A. Hayes and G. Armitage, "Revisiting TCP Congestion Control using Delay + * Gradients", in IFIP Networking, Valencia, Spain, 9-13 May 2011. + * + * Developed as part of the NewTCP research project at Swinburne University of + * Technology's Centre for Advanced Internet Architectures, Melbourne, + * Australia. More details are available at: + * http://caia.swin.edu.au/urp/newtcp/ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include + +#include + +#define CDG_VERSION "0.1" + +#define CAST_PTR_INT(X) (*((int*)(X))) + +#ifndef VIMAGE +#define vnet_sysctl_handle_uint(oidp, arg1, arg2, req) \ + sysctl_handle_int(oidp, arg1, arg2, req) +#endif + +/* Private delay-gradient induced congestion control signal. */ +#define CC_CDG_DELAY 0x01000000 + +/* NewReno window deflation factor on loss (as a percentage). */ +#define RENO_BETA 50 + +/* Queue states. */ +#define CDG_Q_EMPTY 1 +#define CDG_Q_RISING 2 +#define CDG_Q_FALLING 3 +#define CDG_Q_FULL 4 +#define CDG_Q_UNKNOWN 9999 + +/* Number of bit shifts used in probexp lookup table. */ +#define EXP_PREC 15 + +/* Largest gradient represented in probexp lookup table. */ +#define MAXGRAD 5 + +/* + * Delay Precision Enhance - number of bit shifts used for qtrend related + * integer arithmetic precision. + */ +#define D_P_E 7 + +struct qdiff_sample { + long qdiff; + STAILQ_ENTRY(qdiff_sample) qdiff_lnk; +}; + +struct cdg { + long max_qtrend; + long min_qtrend; + STAILQ_HEAD(minrtts_head, qdiff_sample) qdiffmin_q; + STAILQ_HEAD(maxrtts_head, qdiff_sample) qdiffmax_q; + long window_incr; + /* rttcount for window increase when in congestion avoidance */ + long rtt_count; + /* maximum measured rtt within an rtt period */ + int maxrtt_in_rtt; + /* maximum measured rtt within prev rtt period */ + int maxrtt_in_prevrtt; + /* minimum measured rtt within an rtt period */ + int minrtt_in_rtt; + /* minimum measured rtt within prev rtt period */ + int minrtt_in_prevrtt; + /* consecutive congestion episode counter */ + uint32_t consec_cong_cnt; + /* when tracking a new reno type loss window */ + uint32_t shadow_w; + /* maximum number of samples in the moving average queue */ + int sample_q_size; + /* number of samples in the moving average queue */ + int num_samples; + /* estimate of the queue state of the path */ + int queue_state; +}; + +/* + * Lookup table for: + * (1 - exp(-x)) << EXP_PREC, where x = [0,MAXGRAD] in 2^-7 increments + * + * Note: probexp[0] is set to 10 (not 0) as a safety for very low increase + * gradients. + */ +static const int probexp[641] = { + 10,255,508,759,1008,1255,1501,1744,1985,2225,2463,2698,2932,3165,3395,3624, + 3850,4075,4299,4520,4740,4958,5175,5389,5602,5814,6024,6232,6438,6643,6846, + 7048,7248,7447,7644,7839,8033,8226,8417,8606,8794,8981,9166,9350,9532,9713, + 9892,10070,10247,10422,10596,10769,10940,11110,11278,11445,11611,11776,11939, + 12101,12262,12422,12580,12737,12893,13048,13201,13354,13505,13655,13803,13951, + 14097,14243,14387,14530,14672,14813,14952,15091,15229,15365,15500,15635,15768, + 15900,16032,16162,16291,16419,16547,16673,16798,16922,17046,17168,17289,17410, + 17529,17648,17766,17882,17998,18113,18227,18340,18453,18564,18675,18784,18893, + 19001,19108,19215,19320,19425,19529,19632,19734,19835,19936,20036,20135,20233, + 20331,20427,20523,20619,20713,20807,20900,20993,21084,21175,21265,21355,21444, + 21532,21619,21706,21792,21878,21962,22046,22130,22213,22295,22376,22457,22537, + 22617,22696,22774,22852,22929,23006,23082,23157,23232,23306,23380,23453,23525, + 23597,23669,23739,23810,23879,23949,24017,24085,24153,24220,24286,24352,24418, + 24483,24547,24611,24675,24738,24800,24862,24924,24985,25045,25106,25165,25224, + 25283,25341,25399,25456,25513,25570,25626,25681,25737,25791,25846,25899,25953, + 26006,26059,26111,26163,26214,26265,26316,26366,26416,26465,26514,26563,26611, + 26659,26707,26754,26801,26847,26893,26939,26984,27029,27074,27118,27162,27206, + 27249,27292,27335,27377,27419,27460,27502,27543,27583,27624,27664,27703,27743, + 27782,27821,27859,27897,27935,27973,28010,28047,28084,28121,28157,28193,28228, + 28263,28299,28333,28368,28402,28436,28470,28503,28536,28569,28602,28634,28667, + 28699,28730,28762,28793,28824,28854,28885,28915,28945,28975,29004,29034,29063, + 29092,29120,29149,29177,29205,29232,29260,29287,29314,29341,29368,29394,29421, + 29447,29472,29498,29524,29549,29574,29599,29623,29648,29672,29696,29720,29744, + 29767,29791,29814,29837,29860,29882,29905,29927,29949,29971,29993,30014,30036, + 30057,30078,30099,30120,30141,30161,30181,30201,30221,30241,30261,30280,30300, + 30319,30338,30357,30376,30394,30413,30431,30449,30467,30485,30503,30521,30538, + 30555,30573,30590,30607,30624,30640,30657,30673,30690,30706,30722,30738,30753, + 30769,30785,30800,30815,30831,30846,30861,30876,30890,30905,30919,30934,30948, + 30962,30976,30990,31004,31018,31031,31045,31058,31072,31085,31098,31111,31124, + 31137,31149,31162,31174,31187,31199,31211,31223,31235,31247,31259,31271,31283, + 31294,31306,31317,31328,31339,31351,31362,31373,31383,31394,31405,31416,31426, + 31436,31447,31457,31467,31477,31487,31497,31507,31517,31527,31537,31546,31556, + 31565,31574,31584,31593,31602,31611,31620,31629,31638,31647,31655,31664,31673, + 31681,31690,31698,31706,31715,31723,31731,31739,31747,31755,31763,31771,31778, + 31786,31794,31801,31809,31816,31824,31831,31838,31846,31853,31860,31867,31874, + 31881,31888,31895,31902,31908,31915,31922,31928,31935,31941,31948,31954,31960, + 31967,31973,31979,31985,31991,31997,32003,32009,32015,32021,32027,32033,32038, + 32044,32050,32055,32061,32066,32072,32077,32083,32088,32093,32098,32104,32109, + 32114,32119,32124,32129,32134,32139,32144,32149,32154,32158,32163,32168,32173, + 32177,32182,32186,32191,32195,32200,32204,32209,32213,32217,32222,32226,32230, + 32234,32238,32242,32247,32251,32255,32259,32263,32267,32270,32274,32278,32282, + 32286,32290,32293,32297,32301,32304,32308,32311,32315,32318,32322,32325,32329, + 32332,32336,32339,32342,32346,32349,32352,32356,32359,32362,32365,32368,32371, + 32374,32377,32381,32384,32387,32389,32392,32395,32398,32401,32404,32407,32410, + 32412,32415,32418,32421,32423,32426,32429,32431,32434,32437,32439,32442,32444, + 32447,32449,32452,32454,32457,32459,32461,32464,32466,32469,32471,32473,32476, + 32478,32480,32482,32485,32487,32489,32491,32493,32495,32497,32500,32502,32504, + 32506,32508,32510,32512,32514,32516,32518,32520,32522,32524,32526,32527,32529, + 32531,32533,32535,32537,32538,32540,32542,32544,32545,32547}; + +static uma_zone_t qdiffsample_zone; + +static MALLOC_DEFINE(M_CDG, "cdg data", + "Per connection data required for the CDG congestion control algorithm"); + +static int ertt_id; + +static VNET_DEFINE(uint32_t, cdg_alpha_inc); +static VNET_DEFINE(uint32_t, cdg_beta_delay); +static VNET_DEFINE(uint32_t, cdg_beta_loss); +static VNET_DEFINE(uint32_t, cdg_smoothing_factor); +static VNET_DEFINE(uint32_t, cdg_exp_backoff_scale); +static VNET_DEFINE(uint32_t, cdg_consec_cong); +static VNET_DEFINE(uint32_t, cdg_hold_backoff); +#define V_cdg_alpha_inc VNET(cdg_alpha_inc) +#define V_cdg_beta_delay VNET(cdg_beta_delay) +#define V_cdg_beta_loss VNET(cdg_beta_loss) +#define V_cdg_smoothing_factor VNET(cdg_smoothing_factor) +#define V_cdg_exp_backoff_scale VNET(cdg_exp_backoff_scale) +#define V_cdg_consec_cong VNET(cdg_consec_cong) +#define V_cdg_hold_backoff VNET(cdg_hold_backoff) + +/* Function prototypes. */ +static int cdg_mod_init(void); +static void cdg_conn_init(struct cc_var *ccv); +static int cdg_cb_init(struct cc_var *ccv); +static void cdg_cb_destroy(struct cc_var *ccv); +static void cdg_cong_signal(struct cc_var *ccv, uint32_t signal_type); +static void cdg_ack_received(struct cc_var *ccv, uint16_t ack_type); + +struct cc_algo cdg_cc_algo = { + .name = "cdg", + .mod_init = cdg_mod_init, + .ack_received = cdg_ack_received, + .cb_destroy = cdg_cb_destroy, + .cb_init = cdg_cb_init, + .conn_init = cdg_conn_init, + .cong_signal = cdg_cong_signal +}; + +/* Vnet created and being initialised. */ +static void +cdg_init_vnet(const void *unused __unused) +{ + + V_cdg_alpha_inc = 0; + V_cdg_beta_delay = 70; + V_cdg_beta_loss = 50; + V_cdg_smoothing_factor = 8; + V_cdg_exp_backoff_scale = 3; + V_cdg_consec_cong = 5; + V_cdg_hold_backoff = 5; +} + +static int +cdg_mod_init(void) +{ + VNET_ITERATOR_DECL(v); + + ertt_id = khelp_get_id("ertt"); + if (ertt_id <= 0) + return (EINVAL); + + qdiffsample_zone = uma_zcreate("cdg_qdiffsample", + sizeof(struct qdiff_sample), NULL, NULL, NULL, NULL, 0, 0); + + VNET_LIST_RLOCK(); + VNET_FOREACH(v) { + CURVNET_SET(v); + cdg_init_vnet(NULL); + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK(); + + cdg_cc_algo.post_recovery = newreno_cc_algo.post_recovery; + cdg_cc_algo.after_idle = newreno_cc_algo.after_idle; + + return (0); +} + +static int +cdg_cb_init(struct cc_var *ccv) +{ + struct cdg *cdg_data; + + cdg_data = malloc(sizeof(struct cdg), M_CDG, M_NOWAIT); + if (cdg_data == NULL) + return (ENOMEM); + + cdg_data->shadow_w = 0; + cdg_data->max_qtrend = 0; + cdg_data->min_qtrend = 0; + cdg_data->queue_state = CDG_Q_UNKNOWN; + cdg_data->maxrtt_in_rtt = 0; + cdg_data->maxrtt_in_prevrtt = 0; + cdg_data->minrtt_in_rtt = INT_MAX; + cdg_data->minrtt_in_prevrtt = 0; + cdg_data->window_incr = 0; + cdg_data->rtt_count = 0; + cdg_data->consec_cong_cnt = 0; + cdg_data->sample_q_size = V_cdg_smoothing_factor; + cdg_data->num_samples = 0; + STAILQ_INIT(&cdg_data->qdiffmin_q); + STAILQ_INIT(&cdg_data->qdiffmax_q); + + ccv->cc_data = cdg_data; + + return (0); +} + +static void +cdg_conn_init(struct cc_var *ccv) +{ + struct cdg *cdg_data = ccv->cc_data; + + /* + * Initialise the shadow_cwnd in case we are competing with loss based + * flows from the start + */ + cdg_data->shadow_w = CCV(ccv, snd_cwnd); +} + +static void +cdg_cb_destroy(struct cc_var *ccv) +{ + struct cdg *cdg_data; + struct qdiff_sample *qds, *qds_n; + + cdg_data = ccv->cc_data; + + qds = STAILQ_FIRST(&cdg_data->qdiffmin_q); + while (qds != NULL) { + qds_n = STAILQ_NEXT(qds, qdiff_lnk); + uma_zfree(qdiffsample_zone,qds); + qds = qds_n; + } + + qds = STAILQ_FIRST(&cdg_data->qdiffmax_q); + while (qds != NULL) { + qds_n = STAILQ_NEXT(qds, qdiff_lnk); + uma_zfree(qdiffsample_zone,qds); + qds = qds_n; + } + + free(ccv->cc_data, M_CDG); +} + +static int +cdg_beta_handler(SYSCTL_HANDLER_ARGS) +{ + + if (req->newptr != NULL && + (CAST_PTR_INT(req->newptr) == 0 || CAST_PTR_INT(req->newptr) > 100)) + return (EINVAL); + + return (vnet_sysctl_handle_uint(oidp, arg1, arg2, req)); +} + +static int +cdg_exp_backoff_scale_handler(SYSCTL_HANDLER_ARGS) +{ + + if (req->newptr != NULL && CAST_PTR_INT(req->newptr) < 1) + return (EINVAL); + + return (vnet_sysctl_handle_uint(oidp, arg1, arg2, req)); +} + +static inline unsigned long +cdg_window_decrease(struct cc_var *ccv, unsigned long owin, unsigned int beta) +{ + + return ((ulmin(CCV(ccv, snd_wnd), owin) * beta) / 100); +} + +/* + * Window increase function + * This window increase function is independent of the initial window size + * to ensure small window flows are not discriminated against (i.e. fairness). + * It increases at 1pkt/rtt like Reno for alpha_inc rtts, and then 2pkts/rtt for + * the next alpha_inc rtts, etc. + */ +static void +cdg_window_increase(struct cc_var *ccv, int new_measurement) +{ + struct cdg *cdg_data; + int incr, s_w_incr; + + cdg_data = ccv->cc_data; + incr = s_w_incr = 0; + + if (CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh)) { + /* Slow start. */ + incr = CCV(ccv, t_maxseg); + s_w_incr = incr; + cdg_data->window_incr = cdg_data->rtt_count = 0; + } else { + /* Congestion avoidance. */ + if (new_measurement) { + s_w_incr = CCV(ccv, t_maxseg); + if (V_cdg_alpha_inc == 0) { + incr = CCV(ccv, t_maxseg); + } else { + if (++cdg_data->rtt_count >= V_cdg_alpha_inc) { + cdg_data->window_incr++; + cdg_data->rtt_count = 0; + } + incr = CCV(ccv, t_maxseg) * + cdg_data->window_incr; + } + } + } + + if (cdg_data->shadow_w > 0) + cdg_data->shadow_w = ulmin(cdg_data->shadow_w + s_w_incr, + TCP_MAXWIN << CCV(ccv, snd_scale)); + + CCV(ccv, snd_cwnd) = ulmin(CCV(ccv, snd_cwnd) + incr, + TCP_MAXWIN << CCV(ccv, snd_scale)); +} + +static void +cdg_cong_signal(struct cc_var *ccv, uint32_t signal_type) +{ + struct cdg *cdg_data = ccv->cc_data; + + switch(signal_type) { + case CC_CDG_DELAY: + CCV(ccv, snd_ssthresh) = cdg_window_decrease(ccv, + CCV(ccv, snd_cwnd), V_cdg_beta_delay); + CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); + CCV(ccv, snd_recover) = CCV(ccv, snd_max); + cdg_data->window_incr = cdg_data->rtt_count = 0; + ENTER_CONGRECOVERY(CCV(ccv, t_flags)); + break; + case CC_NDUPACK: + /* + * If already responding to congestion OR we have guessed no + * queue in the path is full. + */ + if (IN_CONGRECOVERY(CCV(ccv, t_flags)) || + cdg_data->queue_state < CDG_Q_FULL) { + CCV(ccv, snd_ssthresh) = CCV(ccv, snd_cwnd); + CCV(ccv, snd_recover) = CCV(ccv, snd_max); + } else { + /* + * Loss is likely to be congestion related. We have + * inferred a queue full state, so have shadow window + * react to loss as NewReno would. + */ + if (cdg_data->shadow_w > 0) + cdg_data->shadow_w = cdg_window_decrease(ccv, + cdg_data->shadow_w, RENO_BETA); + + CCV(ccv, snd_ssthresh) = ulmax(cdg_data->shadow_w, + cdg_window_decrease(ccv, CCV(ccv, snd_cwnd), + V_cdg_beta_loss)); + + cdg_data->window_incr = cdg_data->rtt_count = 0; + } + ENTER_RECOVERY(CCV(ccv, t_flags)); + break; + default: + newreno_cc_algo.cong_signal(ccv, signal_type); + break; + } +} + +/* + * Using a negative exponential probabilistic backoff so that sources with + * varying RTTs which share the same link will, on average, have the same + * probability of backoff over time. + * + * Prob_backoff = 1 - exp(-qtrend / V_cdg_exp_backoff_scale), where + * V_cdg_exp_backoff_scale is the average qtrend for the exponential backoff. + */ +static inline int +prob_backoff(long qtrend) +{ + int backoff, idx, p; + + backoff = (qtrend > ((MAXGRAD * V_cdg_exp_backoff_scale) << D_P_E)); + + if (!backoff) { + if (V_cdg_exp_backoff_scale > 1) + idx = (qtrend + V_cdg_exp_backoff_scale / 2) / + V_cdg_exp_backoff_scale; + else + idx = qtrend; + + /* Backoff probability proportional to rate of queue growth. */ + p = (INT_MAX / (1 << EXP_PREC)) * probexp[idx]; + backoff = (random() < p); + } + + return (backoff); +} + +static inline void +calc_moving_average(struct cdg *cdg_data, long qdiff_max, long qdiff_min) +{ + struct qdiff_sample *qds; + + ++cdg_data->num_samples; + if (cdg_data->num_samples > cdg_data->sample_q_size) { + /* Minimum RTT. */ + qds = STAILQ_FIRST(&cdg_data->qdiffmin_q); + cdg_data->min_qtrend = cdg_data->min_qtrend + + (qdiff_min - qds->qdiff) / cdg_data->sample_q_size; + STAILQ_REMOVE_HEAD(&cdg_data->qdiffmin_q, qdiff_lnk); + qds->qdiff = qdiff_min; + STAILQ_INSERT_TAIL(&cdg_data->qdiffmin_q, qds, qdiff_lnk); + + /* Maximum RTT. */ + qds = STAILQ_FIRST(&cdg_data->qdiffmax_q); + cdg_data->max_qtrend = cdg_data->max_qtrend + + (qdiff_max - qds->qdiff) / cdg_data->sample_q_size; + STAILQ_REMOVE_HEAD(&cdg_data->qdiffmax_q, qdiff_lnk); + qds->qdiff = qdiff_max; + STAILQ_INSERT_TAIL(&cdg_data->qdiffmax_q, qds, qdiff_lnk); + --cdg_data->num_samples; + } else { + qds = uma_zalloc(qdiffsample_zone, M_NOWAIT); + if (qds != NULL) { + cdg_data->min_qtrend = cdg_data->min_qtrend + + qdiff_min / cdg_data->sample_q_size; + qds->qdiff = qdiff_min; + STAILQ_INSERT_TAIL(&cdg_data->qdiffmin_q, qds, + qdiff_lnk); + } + + qds = uma_zalloc(qdiffsample_zone, M_NOWAIT); + if (qds) { + cdg_data->max_qtrend = cdg_data->max_qtrend + + qdiff_max / cdg_data->sample_q_size; + qds->qdiff = qdiff_max; + STAILQ_INSERT_TAIL(&cdg_data->qdiffmax_q, qds, + qdiff_lnk); + } + } +} + +static void +cdg_ack_received(struct cc_var *ccv, uint16_t ack_type) +{ + struct cdg *cdg_data; + struct ertt *e_t; + long qdiff_max, qdiff_min; + int congestion, new_measurement, slowstart; + + cdg_data = ccv->cc_data; + e_t = (struct ertt *)khelp_get_osd(CCV(ccv, osd), ertt_id); + new_measurement = e_t->flags & ERTT_NEW_MEASUREMENT; + congestion = 0; + cdg_data->maxrtt_in_rtt = imax(e_t->rtt, cdg_data->maxrtt_in_rtt); + cdg_data->minrtt_in_rtt = imin(e_t->rtt, cdg_data->minrtt_in_rtt); + + if (new_measurement) { + slowstart = (CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh)); + /* + * Update smoothed gradient measurements. Since we are only + * using one measurement per RTT, use max or min rtt_in_rtt. + * This is also less noisy than a sample RTT measurement. Max + * RTT measurements can have trouble due to OS issues. + */ + if (cdg_data->maxrtt_in_prevrtt) { + qdiff_max = ((long)(cdg_data->maxrtt_in_rtt - + cdg_data->maxrtt_in_prevrtt) << D_P_E ); + qdiff_min = ((long)(cdg_data->minrtt_in_rtt - + cdg_data->minrtt_in_prevrtt) << D_P_E ); + + calc_moving_average(cdg_data, qdiff_max, qdiff_min); + + /* Probabilistic backoff with respect to gradient. */ + if (slowstart && qdiff_min > 0) + congestion = prob_backoff(qdiff_min); + else if (cdg_data->min_qtrend > 0) + congestion = prob_backoff(cdg_data->min_qtrend); + else if (slowstart && qdiff_max > 0) + congestion = prob_backoff(qdiff_max); + else if (cdg_data->max_qtrend > 0) + congestion = prob_backoff(cdg_data->max_qtrend); + + /* Update estimate of queue state. */ + if (cdg_data->min_qtrend > 0 && + cdg_data->max_qtrend <= 0) { + cdg_data->queue_state = CDG_Q_FULL; + } else if (cdg_data->min_qtrend >= 0 && + cdg_data->max_qtrend < 0) { + cdg_data->queue_state = CDG_Q_EMPTY; + cdg_data->shadow_w = 0; + } else if (cdg_data->min_qtrend > 0 && + cdg_data->max_qtrend > 0) { + cdg_data->queue_state = CDG_Q_RISING; + } else if (cdg_data->min_qtrend < 0 && + cdg_data->max_qtrend < 0) { + cdg_data->queue_state = CDG_Q_FALLING; + } + + if (cdg_data->min_qtrend < 0 || + cdg_data->max_qtrend < 0) + cdg_data->consec_cong_cnt = 0; + } + + cdg_data->minrtt_in_prevrtt = cdg_data->minrtt_in_rtt; + cdg_data->minrtt_in_rtt = INT_MAX; + cdg_data->maxrtt_in_prevrtt = cdg_data->maxrtt_in_rtt; + cdg_data->maxrtt_in_rtt = 0; + e_t->flags &= ~ERTT_NEW_MEASUREMENT; + } + + if (congestion) { + cdg_data->consec_cong_cnt++; + if (!IN_RECOVERY(CCV(ccv, t_flags))) { + if (cdg_data->consec_cong_cnt <= V_cdg_consec_cong) + cdg_cong_signal(ccv, CC_CDG_DELAY); + else + /* + * We have been backing off but the queue is not + * falling. Assume we are competing with + * loss-based flows and don't back off for the + * next V_cdg_hold_backoff RTT periods. + */ + if (cdg_data->consec_cong_cnt >= + V_cdg_consec_cong + V_cdg_hold_backoff) + cdg_data->consec_cong_cnt = 0; + + /* Won't see effect until 2nd RTT. */ + cdg_data->maxrtt_in_prevrtt = 0; + /* + * Resync shadow window in case we are competing with a + * loss based flow + */ + cdg_data->shadow_w = ulmax(CCV(ccv, snd_cwnd), + cdg_data->shadow_w); + } + } else if (ack_type == CC_ACK) + cdg_window_increase(ccv, new_measurement); +} + +/* When a vnet is created and being initialised, init the per-stack CDG vars. */ +VNET_SYSINIT(cdg_init_vnet, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, + cdg_init_vnet, NULL); + +SYSCTL_DECL(_net_inet_tcp_cc_cdg); +SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, cdg, CTLFLAG_RW, NULL, + "CAIA delay-gradient congestion control related settings"); + +SYSCTL_STRING(_net_inet_tcp_cc_cdg, OID_AUTO, version, + CTLFLAG_RD, CDG_VERSION, sizeof(CDG_VERSION) - 1, + "Current algorithm/implementation version number"); + +SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, alpha_inc, + CTLFLAG_RW, &VNET_NAME(cdg_alpha_inc), 0, + "Increment the window increase factor alpha by 1 MSS segment every " + "alpha_inc RTTs during congestion avoidance mode."); + +SYSCTL_VNET_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, beta_delay, + CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(cdg_beta_delay), 70, + &cdg_beta_handler, "IU", + "Delay-based window decrease factor as a percentage " + "(on delay-based backoff, w = w * beta_delay / 100)"); + +SYSCTL_VNET_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, beta_loss, + CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(cdg_beta_loss), 50, + &cdg_beta_handler, "IU", + "Loss-based window decrease factor as a percentage " + "(on loss-based backoff, w = w * beta_loss / 100)"); + +SYSCTL_VNET_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, exp_backoff_scale, + CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(cdg_exp_backoff_scale), 2, + &cdg_exp_backoff_scale_handler, "IU", + "Scaling parameter for the probabilistic exponential backoff"); + +SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, smoothing_factor, + CTLFLAG_RW, &VNET_NAME(cdg_smoothing_factor), 8, + "Number of samples used for moving average smoothing (0 = no smoothing)"); + +SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, loss_compete_consec_cong, + CTLFLAG_RW, &VNET_NAME(cdg_consec_cong), 5, + "Number of consecutive delay-gradient based congestion episodes which will " + "trigger loss based CC compatibility"); + +SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, loss_compete_hold_backoff, + CTLFLAG_RW, &VNET_NAME(cdg_hold_backoff), 5, + "Number of consecutive delay-gradient based congestion episodes to hold " + "the window backoff for loss based CC compatibility"); + +DECLARE_CC_MODULE(cdg, &cdg_cc_algo); + +MODULE_DEPEND(cdg, ertt, 1, 1, 1); From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 7 18:31:03 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5E1A35F5; Sun, 7 Jul 2013 18:31:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5015D1F2A; Sun, 7 Jul 2013 18:31:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67IV2jl091539; Sun, 7 Jul 2013 18:31:02 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67IV2TH091537; Sun, 7 Jul 2013 18:31:02 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071831.r67IV2TH091537@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 18:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252981 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 18:31:03 -0000 Author: tuexen Date: Sun Jul 7 18:31:02 2013 New Revision: 252981 URL: http://svnweb.freebsd.org/changeset/base/252981 Log: MFC r248172 (partially): Return an error if sctp_peeloff() fails because a socket can't be allocated. Modified: stable/8/sys/kern/uipc_syscalls.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/uipc_syscalls.c ============================================================================== --- stable/8/sys/kern/uipc_syscalls.c Sun Jul 7 18:21:30 2013 (r252980) +++ stable/8/sys/kern/uipc_syscalls.c Sun Jul 7 18:31:02 2013 (r252981) @@ -2320,8 +2320,10 @@ sctp_peeloff(td, uap) CURVNET_SET(head->so_vnet); so = sonewconn(head, SS_ISCONNECTED); - if (so == NULL) + if (so == NULL) { + error = ENOMEM; goto noconnection; + } /* * Before changing the flags on the socket, we have to bump the * reference count. Otherwise, if the protocol calls sofree(), From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 7 18:41:26 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6E770AED; Sun, 7 Jul 2013 18:41:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 606F81FBA; Sun, 7 Jul 2013 18:41:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67IfQjF094460; Sun, 7 Jul 2013 18:41:26 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67IfQgm094459; Sun, 7 Jul 2013 18:41:26 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071841.r67IfQgm094459@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 18:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252983 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 18:41:26 -0000 Author: tuexen Date: Sun Jul 7 18:41:25 2013 New Revision: 252983 URL: http://svnweb.freebsd.org/changeset/base/252983 Log: MFC r248953: Add a macro for checking for IPv4 link local addresses. Modified: stable/8/sys/netinet/sctp_constants.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Sun Jul 7 18:34:36 2013 (r252982) +++ stable/8/sys/netinet/sctp_constants.h Sun Jul 7 18:41:25 2013 (r252983) @@ -997,6 +997,10 @@ __FBSDID("$FreeBSD$"); (((uint8_t *)&(a)->s_addr)[2] == 0) && \ (((uint8_t *)&(a)->s_addr)[3] == 1)) +#define IN4_ISLINKLOCAL_ADDRESS(a) \ + ((((uint8_t *)&(a)->s_addr)[0] == 169) && \ + (((uint8_t *)&(a)->s_addr)[1] == 254)) + #if defined(_KERNEL) #define SCTP_GETTIME_TIMEVAL(x) (getmicrouptime(x)) From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 7 18:43:49 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3F36ACD0; Sun, 7 Jul 2013 18:43:49 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1FFA71FE2; Sun, 7 Jul 2013 18:43:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67IhnYP094751; Sun, 7 Jul 2013 18:43:49 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67Ihn1Z094750; Sun, 7 Jul 2013 18:43:49 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071843.r67Ihn1Z094750@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 18:43:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252984 - stable/8/lib/libc/net X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 18:43:49 -0000 Author: tuexen Date: Sun Jul 7 18:43:48 2013 New Revision: 252984 URL: http://svnweb.freebsd.org/changeset/base/252984 Log: MFC r249333: Remove the number of addresses restriction from sctp_connectx(). Remove unused code. While there, do some cleanup of the code. Modified: stable/8/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/8/lib/ (props changed) stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Sun Jul 7 18:41:25 2013 (r252983) +++ stable/8/lib/libc/net/sctp_sys_calls.c Sun Jul 7 18:43:48 2013 (r252984) @@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #ifndef IN6_IS_ADDR_V4MAPPED #define IN6_IS_ADDR_V4MAPPED(a) \ ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ @@ -57,77 +55,8 @@ __FBSDID("$FreeBSD$"); (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) #endif - -#define SCTP_CONTROL_VEC_SIZE_SND 8192 #define SCTP_CONTROL_VEC_SIZE_RCV 16384 -#define SCTP_STACK_BUF_SIZE 2048 - -#ifdef SCTP_DEBUG_PRINT_ADDRESS - -#define SCTP_STRING_BUF_SZ 256 - -static void -SCTPPrintAnAddress(struct sockaddr *a) -{ - char stringToPrint[SCTP_STRING_BUF_SZ]; - u_short prt; - char *srcaddr, *txt; - - if (a == NULL) { - printf("NULL\n"); - return; - } - if (a->sa_family == AF_INET) { - srcaddr = (char *)&((struct sockaddr_in *)a)->sin_addr; - txt = "IPv4 Address: "; - prt = ntohs(((struct sockaddr_in *)a)->sin_port); - } else if (a->sa_family == AF_INET6) { - srcaddr = (char *)&((struct sockaddr_in6 *)a)->sin6_addr; - prt = ntohs(((struct sockaddr_in6 *)a)->sin6_port); - txt = "IPv6 Address: "; - } else if (a->sa_family == AF_LINK) { - int i; - char tbuf[SCTP_STRING_BUF_SZ]; - u_char adbuf[SCTP_STRING_BUF_SZ]; - struct sockaddr_dl *dl; - - dl = (struct sockaddr_dl *)a; - strncpy(tbuf, dl->sdl_data, dl->sdl_nlen); - tbuf[dl->sdl_nlen] = 0; - printf("Intf:%s (len:%d)Interface index:%d type:%x(%d) ll-len:%d ", - tbuf, - dl->sdl_nlen, - dl->sdl_index, - dl->sdl_type, - dl->sdl_type, - dl->sdl_alen - ); - memcpy(adbuf, LLADDR(dl), dl->sdl_alen); - for (i = 0; i < dl->sdl_alen; i++) { - printf("%2.2x", adbuf[i]); - if (i < (dl->sdl_alen - 1)) - printf(":"); - } - printf("\n"); - return; - } else { - return; - } - if (inet_ntop(a->sa_family, srcaddr, stringToPrint, sizeof(stringToPrint))) { - if (a->sa_family == AF_INET6) { - printf("%s%s:%d scope:%d\n", - txt, stringToPrint, prt, - ((struct sockaddr_in6 *)a)->sin6_scope_id); - } else { - printf("%s%s:%d\n", txt, stringToPrint, prt); - } - - } else { - printf("%s unprintable?\n", txt); - } -} -#endif /* SCTP_DEBUG_PRINT_ADDRESS */ static void in6_sin6_2_sin(struct sockaddr_in *sin, struct sockaddr_in6 *sin6) @@ -171,11 +100,10 @@ int sctp_connectx(int sd, const struct sockaddr *addrs, int addrcnt, sctp_assoc_t * id) { - char buf[SCTP_STACK_BUF_SIZE]; + char *buf; int i, ret, cnt, *aa; char *cpto; const struct sockaddr *at; - sctp_assoc_t *p_id; size_t len = sizeof(int); /* validate the address count and list */ @@ -183,24 +111,29 @@ sctp_connectx(int sd, const struct socka errno = EINVAL; return (-1); } + if ((buf = malloc(sizeof(int) + (size_t)addrcnt * sizeof(struct sockaddr_in6))) == NULL) { + errno = E2BIG; + return (-1); + } at = addrs; cnt = 0; - cpto = ((caddr_t)buf + sizeof(int)); + cpto = buf + sizeof(int); /* validate all the addresses and get the size */ for (i = 0; i < addrcnt; i++) { switch (at->sa_family) { case AF_INET: if (at->sa_len != sizeof(struct sockaddr_in)) { + free(buf); errno = EINVAL; return (-1); } memcpy(cpto, at, sizeof(struct sockaddr_in)); cpto = ((caddr_t)cpto + sizeof(struct sockaddr_in)); len += sizeof(struct sockaddr_in); - at = (struct sockaddr *)((caddr_t)at + sizeof(struct sockaddr_in)); break; case AF_INET6: if (at->sa_len != sizeof(struct sockaddr_in6)) { + free(buf); errno = EINVAL; return (-1); } @@ -213,31 +146,20 @@ sctp_connectx(int sd, const struct socka cpto = ((caddr_t)cpto + sizeof(struct sockaddr_in6)); len += sizeof(struct sockaddr_in6); } - at = (struct sockaddr *)((caddr_t)at + sizeof(struct sockaddr_in6)); break; default: + free(buf); errno = EINVAL; return (-1); } - if (len > (sizeof(buf) - sizeof(int))) { - /* Never enough memory */ - errno = E2BIG; - return (-1); - } - cnt++; - } - /* do we have any? */ - if (cnt == 0) { - errno = EINVAL; - return (-1); + at = (struct sockaddr *)((caddr_t)at + at->sa_len); } aa = (int *)buf; - *aa = cnt; + *aa = addrcnt; ret = setsockopt(sd, IPPROTO_SCTP, SCTP_CONNECT_X, (void *)buf, (socklen_t) len); - if ((ret == 0) && id) { - p_id = (sctp_assoc_t *) buf; - *id = *p_id; + if ((ret == 0) && (id != NULL)) { + *id = *(sctp_assoc_t *) buf; } return (ret); } @@ -345,7 +267,6 @@ sctp_bindx(int sd, struct sockaddr *addr return (0); } - int sctp_opt_info(int sd, sctp_assoc_t id, int opt, void *arg, socklen_t * size) { @@ -468,9 +389,9 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, void sctp_freepaddrs(struct sockaddr *addrs) { - /* Take away the hidden association id */ void *fr_addr; + /* Take away the hidden association id */ fr_addr = (void *)((caddr_t)addrs - sizeof(sctp_assoc_t)); /* Now free it */ free(fr_addr); @@ -531,15 +452,14 @@ sctp_getladdrs(int sd, sctp_assoc_t id, void sctp_freeladdrs(struct sockaddr *addrs) { - /* Take away the hidden association id */ void *fr_addr; + /* Take away the hidden association id */ fr_addr = (void *)((caddr_t)addrs - sizeof(sctp_assoc_t)); /* Now free it */ free(fr_addr); } - ssize_t sctp_sendmsg(int s, const void *data, @@ -565,11 +485,10 @@ sctp_sendmsg(int s, return (syscall(SYS_sctp_generic_sendmsg, s, data, len, to, tolen, &sinfo, 0)); #else - ssize_t sz; struct msghdr msg; - struct sctp_sndrcvinfo *s_info; + struct sctp_sndrcvinfo *sinfo; struct iovec iov; - char controlVector[SCTP_CONTROL_VEC_SIZE_RCV]; + char cmsgbuf[CMSG_SPACE(sizeof(struct sctp_sndrcvinfo))]; struct cmsghdr *cmsg; struct sockaddr *who = NULL; union { @@ -582,8 +501,9 @@ sctp_sendmsg(int s, errno = EINVAL; return (-1); } - if (to && (tolen > 0)) { - if (to->sa_family == AF_INET) { + if ((to != NULL) && (tolen > 0)) { + switch (to->sa_family) { + case AF_INET: if (tolen != sizeof(struct sockaddr_in)) { errno = EINVAL; return (-1); @@ -595,7 +515,8 @@ sctp_sendmsg(int s, } memcpy(&addr, to, sizeof(struct sockaddr_in)); addr.in.sin_len = sizeof(struct sockaddr_in); - } else if (to->sa_family == AF_INET6) { + break; + case AF_INET6: if (tolen != sizeof(struct sockaddr_in6)) { errno = EINVAL; return (-1); @@ -607,7 +528,8 @@ sctp_sendmsg(int s, } memcpy(&addr, to, sizeof(struct sockaddr_in6)); addr.in6.sin6_len = sizeof(struct sockaddr_in6); - } else { + break; + default: errno = EAFNOSUPPORT; return (-1); } @@ -625,26 +547,21 @@ sctp_sendmsg(int s, } msg.msg_iov = &iov; msg.msg_iovlen = 1; - msg.msg_control = (caddr_t)controlVector; - - cmsg = (struct cmsghdr *)controlVector; - + msg.msg_control = cmsgbuf; + msg.msg_controllen = CMSG_SPACE(sizeof(struct sctp_sndrcvinfo)); + cmsg = (struct cmsghdr *)cmsgbuf; cmsg->cmsg_level = IPPROTO_SCTP; cmsg->cmsg_type = SCTP_SNDRCV; cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_sndrcvinfo)); - s_info = (struct sctp_sndrcvinfo *)CMSG_DATA(cmsg); - - s_info->sinfo_stream = stream_no; - s_info->sinfo_ssn = 0; - s_info->sinfo_flags = flags; - s_info->sinfo_ppid = ppid; - s_info->sinfo_context = context; - s_info->sinfo_assoc_id = 0; - s_info->sinfo_timetolive = timetolive; - errno = 0; - msg.msg_controllen = cmsg->cmsg_len; - sz = sendmsg(s, &msg, 0); - return (sz); + sinfo = (struct sctp_sndrcvinfo *)CMSG_DATA(cmsg); + sinfo->sinfo_stream = stream_no; + sinfo->sinfo_ssn = 0; + sinfo->sinfo_flags = flags; + sinfo->sinfo_ppid = ppid; + sinfo->sinfo_context = context; + sinfo->sinfo_assoc_id = 0; + sinfo->sinfo_timetolive = timetolive; + return (sendmsg(s, &msg, 0)); #endif } @@ -659,12 +576,11 @@ sctp_getassocid(int sd, struct sockaddr siz = sizeof(sp); memset(&sp, 0, sizeof(sp)); memcpy((caddr_t)&sp.spinfo_address, sa, sa->sa_len); - errno = 0; if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_PEER_ADDR_INFO, &sp, &siz) != 0) { + /* We depend on the fact that 0 can never be returned */ return ((sctp_assoc_t) 0); } - /* We depend on the fact that 0 can never be returned */ return (sp.spinfo_assoc_id); } @@ -680,11 +596,9 @@ sctp_send(int sd, const void *data, size return (syscall(SYS_sctp_generic_sendmsg, sd, data, len, to, 0, sinfo, flags)); #else - ssize_t sz; struct msghdr msg; struct iovec iov; - struct sctp_sndrcvinfo *s_info; - char controlVector[SCTP_CONTROL_VEC_SIZE_SND]; + char cmsgbuf[CMSG_SPACE(sizeof(struct sctp_sndrcvinfo))]; struct cmsghdr *cmsg; if (sinfo == NULL) { @@ -694,24 +608,18 @@ sctp_send(int sd, const void *data, size iov.iov_base = (char *)data; iov.iov_len = len; - msg.msg_name = 0; + msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_iov = &iov; msg.msg_iovlen = 1; - msg.msg_control = (caddr_t)controlVector; - - cmsg = (struct cmsghdr *)controlVector; - + msg.msg_control = cmsgbuf; + msg.msg_controllen = CMSG_SPACE(sizeof(struct sctp_sndrcvinfo)); + cmsg = (struct cmsghdr *)cmsgbuf; cmsg->cmsg_level = IPPROTO_SCTP; cmsg->cmsg_type = SCTP_SNDRCV; cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_sndrcvinfo)); - s_info = (struct sctp_sndrcvinfo *)CMSG_DATA(cmsg); - /* copy in the data */ - *s_info = *sinfo; - errno = 0; - msg.msg_controllen = cmsg->cmsg_len; - sz = sendmsg(sd, &msg, flags); - return (sz); + memcpy(CMSG_DATA(cmsg), sinfo, sizeof(struct sctp_sndrcvinfo)); + return (sendmsg(sd, &msg, flags)); #endif } @@ -853,11 +761,10 @@ sctp_recvmsg(int s, return (syscall(SYS_sctp_generic_recvmsg, s, &iov, 1, from, fromlen, sinfo, msg_flags)); #else - struct sctp_sndrcvinfo *s_info; ssize_t sz; struct msghdr msg; struct iovec iov; - char controlVector[SCTP_CONTROL_VEC_SIZE_RCV]; + char cmsgbuf[SCTP_CONTROL_VEC_SIZE_RCV]; struct cmsghdr *cmsg; if (msg_flags == NULL) { @@ -874,52 +781,38 @@ sctp_recvmsg(int s, msg.msg_namelen = *fromlen; msg.msg_iov = &iov; msg.msg_iovlen = 1; - msg.msg_control = (caddr_t)controlVector; - msg.msg_controllen = sizeof(controlVector); - errno = 0; + msg.msg_control = cmsgbuf; + msg.msg_controllen = sizeof(cmsgbuf); sz = recvmsg(s, &msg, *msg_flags); *msg_flags = msg.msg_flags; if (sz <= 0) { return (sz); } - s_info = NULL; if (sinfo) { sinfo->sinfo_assoc_id = 0; } - if ((msg.msg_controllen) && sinfo) { + if ((msg.msg_controllen > 0) && (sinfo != NULL)) { /* * parse through and see if we find the sctp_sndrcvinfo (if * the user wants it). */ - cmsg = (struct cmsghdr *)controlVector; - while (cmsg) { - if ((cmsg->cmsg_len == 0) || (cmsg->cmsg_len > msg.msg_controllen)) { + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_level != IPPROTO_SCTP) { + continue; + } + if (cmsg->cmsg_type == SCTP_SNDRCV) { + memcpy(sinfo, CMSG_DATA(cmsg), sizeof(struct sctp_sndrcvinfo)); break; } - if (cmsg->cmsg_level == IPPROTO_SCTP) { - if (cmsg->cmsg_type == SCTP_SNDRCV) { - /* Got it */ - s_info = (struct sctp_sndrcvinfo *)CMSG_DATA(cmsg); - /* Copy it to the user */ - if (sinfo) - *sinfo = *s_info; - break; - } else if (cmsg->cmsg_type == SCTP_EXTRCV) { - /* - * Got it, presumably the user has - * asked for this extra info, so the - * structure holds more room :-D - */ - s_info = (struct sctp_sndrcvinfo *)CMSG_DATA(cmsg); - /* Copy it to the user */ - if (sinfo) { - memcpy(sinfo, s_info, sizeof(struct sctp_extrcvinfo)); - } - break; - - } + if (cmsg->cmsg_type == SCTP_EXTRCV) { + /* + * Let's hope that the user provided enough + * enough memory. At least he asked for more + * information. + */ + memcpy(sinfo, CMSG_DATA(cmsg), sizeof(struct sctp_extrcvinfo)); + break; } - cmsg = CMSG_NXTHDR(&msg, cmsg); } } return (sz); @@ -937,10 +830,10 @@ sctp_recvv(int sd, unsigned int *infotype, int *flags) { - char ctlbuf[SCTP_CONTROL_VEC_SIZE_RCV]; + char cmsgbuf[SCTP_CONTROL_VEC_SIZE_RCV]; struct msghdr msg; struct cmsghdr *cmsg; - ssize_t n; + ssize_t ret; struct sctp_rcvinfo *rcvinfo; struct sctp_nxtinfo *nxtinfo; @@ -961,12 +854,11 @@ sctp_recvv(int sd, } msg.msg_iov = (struct iovec *)iov; msg.msg_iovlen = iovlen; - msg.msg_control = ctlbuf; - msg.msg_controllen = sizeof(ctlbuf); - errno = 0; - n = recvmsg(sd, &msg, *flags); + msg.msg_control = cmsgbuf; + msg.msg_controllen = sizeof(cmsgbuf); + ret = recvmsg(sd, &msg, *flags); *flags = msg.msg_flags; - if ((n > 0) && + if ((ret > 0) && (msg.msg_controllen > 0) && (infotype != NULL) && (infolen != NULL) && @@ -979,41 +871,44 @@ sctp_recvv(int sd, } if (cmsg->cmsg_type == SCTP_RCVINFO) { rcvinfo = (struct sctp_rcvinfo *)CMSG_DATA(cmsg); + if (nxtinfo != NULL) { + break; + } else { + continue; + } } if (cmsg->cmsg_type == SCTP_NXTINFO) { nxtinfo = (struct sctp_nxtinfo *)CMSG_DATA(cmsg); - } - if (rcvinfo && nxtinfo) { - break; + if (rcvinfo != NULL) { + break; + } else { + continue; + } } } - if (rcvinfo) { - if (nxtinfo) { - if (*infolen >= sizeof(struct sctp_recvv_rn)) { - struct sctp_recvv_rn *rn_info; - - rn_info = (struct sctp_recvv_rn *)info; - rn_info->recvv_rcvinfo = *rcvinfo; - rn_info->recvv_nxtinfo = *nxtinfo; - *infolen = (socklen_t) sizeof(struct sctp_recvv_rn); - *infotype = SCTP_RECVV_RN; - } - } else { - if (*infolen >= sizeof(struct sctp_rcvinfo)) { - memcpy(info, rcvinfo, sizeof(struct sctp_rcvinfo)); - *infolen = (socklen_t) sizeof(struct sctp_rcvinfo); - *infotype = SCTP_RECVV_RCVINFO; - } + if (rcvinfo != NULL) { + if ((nxtinfo != NULL) && (*infolen >= sizeof(struct sctp_recvv_rn))) { + struct sctp_recvv_rn *rn_info; + + rn_info = (struct sctp_recvv_rn *)info; + rn_info->recvv_rcvinfo = *rcvinfo; + rn_info->recvv_nxtinfo = *nxtinfo; + *infolen = (socklen_t) sizeof(struct sctp_recvv_rn); + *infotype = SCTP_RECVV_RN; + } else if (*infolen >= sizeof(struct sctp_rcvinfo)) { + memcpy(info, rcvinfo, sizeof(struct sctp_rcvinfo)); + *infolen = (socklen_t) sizeof(struct sctp_rcvinfo); + *infotype = SCTP_RECVV_RCVINFO; } - } else if (nxtinfo) { - if (*infolen >= sizeof(struct sctp_rcvinfo)) { + } else if (nxtinfo != NULL) { + if (*infolen >= sizeof(struct sctp_nxtinfo)) { memcpy(info, nxtinfo, sizeof(struct sctp_nxtinfo)); *infolen = (socklen_t) sizeof(struct sctp_nxtinfo); *infotype = SCTP_RECVV_NXTINFO; } } } - return (n); + return (ret); } ssize_t @@ -1238,7 +1133,4 @@ sctp_peeloff(int sd, sctp_assoc_t assoc_ #endif - -#undef SCTP_CONTROL_VEC_SIZE_SND #undef SCTP_CONTROL_VEC_SIZE_RCV -#undef SCTP_STACK_BUF_SIZE From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 7 18:48:21 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DBB0DECB; Sun, 7 Jul 2013 18:48:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B380E1011; Sun, 7 Jul 2013 18:48:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67ImLgU095439; Sun, 7 Jul 2013 18:48:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67ImLXT095437; Sun, 7 Jul 2013 18:48:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071848.r67ImLXT095437@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 18:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252985 - in stable/8/sys: netinet netinet6 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 18:48:21 -0000 Author: tuexen Date: Sun Jul 7 18:48:21 2013 New Revision: 252985 URL: http://svnweb.freebsd.org/changeset/base/252985 Log: MFC r250466: Honor the net.inet6.ip6.v6only sysctl variable and the IPV6_V6ONLY socket option for SCTP sockets in the same way as for UDP or TCP sockets. Modified: stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Sun Jul 7 18:43:48 2013 (r252984) +++ stable/8/sys/netinet/sctp_pcb.c Sun Jul 7 18:48:21 2013 (r252985) @@ -2376,8 +2376,13 @@ sctp_inpcb_alloc(struct socket *so, uint inp->sctp_socket = so; inp->ip_inp.inp.inp_socket = so; #ifdef INET6 - if (MODULE_GLOBAL(ip6_auto_flowlabel)) { - inp->ip_inp.inp.inp_flags |= IN6P_AUTOFLOWLABEL; + if (INP_SOCKAF(so) == AF_INET6) { + if (MODULE_GLOBAL(ip6_auto_flowlabel)) { + inp->ip_inp.inp.inp_flags |= IN6P_AUTOFLOWLABEL; + } + if (MODULE_GLOBAL(ip6_v6only)) { + inp->ip_inp.inp.inp_flags |= IN6P_IPV6_V6ONLY; + } } #endif inp->sctp_associd_counter = 1; Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Sun Jul 7 18:43:48 2013 (r252984) +++ stable/8/sys/netinet6/sctp6_usrreq.c Sun Jul 7 18:48:21 2013 (r252985) @@ -787,18 +787,11 @@ sctp6_send(struct socket *so, int flags, } } if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { - if (!MODULE_GLOBAL(ip6_v6only)) { - struct sockaddr_in sin; + struct sockaddr_in sin; - /* convert v4-mapped into v4 addr and send */ - in6_sin6_2_sin(&sin, sin6); - return (sctp_sendm(so, flags, m, (struct sockaddr *)&sin, - control, p)); - } else { - /* mapped addresses aren't enabled */ - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL); - return (EINVAL); - } + /* convert v4-mapped into v4 addr and send */ + in6_sin6_2_sin(&sin, sin6); + return (sctp_sendm(so, flags, m, (struct sockaddr *)&sin, control, p)); } #endif /* INET */ connected_type: @@ -932,17 +925,9 @@ sctp6_connect(struct socket *so, struct } } if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { - if (!MODULE_GLOBAL(ip6_v6only)) { - /* convert v4-mapped into v4 addr */ - in6_sin6_2_sin((struct sockaddr_in *)&ss, sin6); - addr = (struct sockaddr *)&ss; - } else { - /* mapped addresses aren't enabled */ - SCTP_INP_RUNLOCK(inp); - SCTP_ASOC_CREATE_UNLOCK(inp); - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL); - return (EINVAL); - } + /* convert v4-mapped into v4 addr */ + in6_sin6_2_sin((struct sockaddr_in *)&ss, sin6); + addr = (struct sockaddr *)&ss; } #endif /* INET */ /* Now do we connect? */ From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 7 18:50:26 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B0B7A7B; Sun, 7 Jul 2013 18:50:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A32B31029; Sun, 7 Jul 2013 18:50:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67IoQF3097251; Sun, 7 Jul 2013 18:50:26 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67IoQRq097250; Sun, 7 Jul 2013 18:50:26 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071850.r67IoQRq097250@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 18:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252986 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 18:50:26 -0000 Author: tuexen Date: Sun Jul 7 18:50:26 2013 New Revision: 252986 URL: http://svnweb.freebsd.org/changeset/base/252986 Log: MFC r250754: Don't send an ABORT chunk with verification 0. Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Sun Jul 7 18:48:21 2013 (r252985) +++ stable/8/sys/netinet/sctp_output.c Sun Jul 7 18:50:26 2013 (r252986) @@ -10673,6 +10673,7 @@ sctp_send_abort_tcb(struct sctp_tcb *stc struct sctp_abort_chunk *abort; struct sctp_auth_chunk *auth = NULL; struct sctp_nets *net; + uint32_t vtag; uint32_t auth_offset = 0; uint16_t cause_len, chunk_len, padding_len; @@ -10728,7 +10729,14 @@ sctp_send_abort_tcb(struct sctp_tcb *stc /* Fill in the ABORT chunk header. */ abort = mtod(m_abort, struct sctp_abort_chunk *); abort->ch.chunk_type = SCTP_ABORT_ASSOCIATION; - abort->ch.chunk_flags = 0; + if (stcb->asoc.peer_vtag == 0) { + /* This happens iff the assoc is in COOKIE-WAIT state. */ + vtag = stcb->asoc.my_vtag; + abort->ch.chunk_flags = SCTP_HAD_NO_TCB; + } else { + vtag = stcb->asoc.peer_vtag; + abort->ch.chunk_flags = 0; + } abort->ch.chunk_length = htons(chunk_len); /* Add padding, if necessary. */ if (padding_len > 0) { @@ -10740,7 +10748,7 @@ sctp_send_abort_tcb(struct sctp_tcb *stc (void)sctp_lowlevel_chunk_output(stcb->sctp_ep, stcb, net, (struct sockaddr *)&net->ro._l_addr, m_out, auth_offset, auth, stcb->asoc.authinfo.active_keyid, 1, 0, 0, - stcb->sctp_ep->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), + stcb->sctp_ep->sctp_lport, stcb->rport, htonl(vtag), stcb->asoc.primary_destination->port, NULL, 0, 0, so_locked); From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 7 18:53:44 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3D93A4F1; Sun, 7 Jul 2013 18:53:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2DE7A1060; Sun, 7 Jul 2013 18:53:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67IriZ9097903; Sun, 7 Jul 2013 18:53:44 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67IriJ4097902; Sun, 7 Jul 2013 18:53:44 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071853.r67IriJ4097902@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 18:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252988 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 18:53:44 -0000 Author: tuexen Date: Sun Jul 7 18:53:43 2013 New Revision: 252988 URL: http://svnweb.freebsd.org/changeset/base/252988 Log: MFC r250756: Set errno to ETIMEDOUT if an SCTP association times out during setup. Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Sun Jul 7 18:51:44 2013 (r252987) +++ stable/8/sys/netinet/sctputil.c Sun Jul 7 18:53:43 2013 (r252988) @@ -2688,8 +2688,14 @@ set_error: stcb->sctp_socket->so_error = ECONNRESET; } } else { - SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNABORTED); - stcb->sctp_socket->so_error = ECONNABORTED; + if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ETIMEDOUT); + stcb->sctp_socket->so_error = ETIMEDOUT; + } else { + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNABORTED); + stcb->sctp_socket->so_error = ECONNABORTED; + } } } /* Wake ANY sleepers */ From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 7 18:56:44 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 84F376D0; Sun, 7 Jul 2013 18:56:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D2DA107F; Sun, 7 Jul 2013 18:56:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67IuiuE098337; Sun, 7 Jul 2013 18:56:44 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67IuiqH098336; Sun, 7 Jul 2013 18:56:44 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071856.r67IuiqH098336@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 18:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252989 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 18:56:44 -0000 Author: tuexen Date: Sun Jul 7 18:56:43 2013 New Revision: 252989 URL: http://svnweb.freebsd.org/changeset/base/252989 Log: MFC r251054: Remove redundant checks. Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Sun Jul 7 18:53:43 2013 (r252988) +++ stable/8/sys/netinet/sctputil.c Sun Jul 7 18:56:43 2013 (r252989) @@ -3536,8 +3536,8 @@ sctp_ulp_notify(uint32_t notification, s if (stcb->sctp_socket->so_rcv.sb_state & SBS_CANTRCVMORE) { return; } - if (stcb && ((stcb->asoc.state & SCTP_STATE_COOKIE_WAIT) || - (stcb->asoc.state & SCTP_STATE_COOKIE_ECHOED))) { + if ((stcb->asoc.state & SCTP_STATE_COOKIE_WAIT) || + (stcb->asoc.state & SCTP_STATE_COOKIE_ECHOED)) { if ((notification == SCTP_NOTIFY_INTERFACE_DOWN) || (notification == SCTP_NOTIFY_INTERFACE_UP) || (notification == SCTP_NOTIFY_INTERFACE_CONFIRMED)) { @@ -3611,16 +3611,16 @@ sctp_ulp_notify(uint32_t notification, s break; } case SCTP_NOTIFY_ASSOC_LOC_ABORTED: - if ((stcb) && (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || - ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED))) { + if (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || + ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED)) { sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, 0, so_locked); } else { sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, 0, so_locked); } break; case SCTP_NOTIFY_ASSOC_REM_ABORTED: - if ((stcb) && (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || - ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED))) { + if (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || + ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED)) { sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, 1, so_locked); } else { sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, 1, so_locked); From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 7 18:58:50 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 852F98EB; Sun, 7 Jul 2013 18:58:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 75D901094; Sun, 7 Jul 2013 18:58:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67Iwopq098614; Sun, 7 Jul 2013 18:58:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67IwoeU098613; Sun, 7 Jul 2013 18:58:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071858.r67IwoeU098613@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 18:58:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252990 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 18:58:50 -0000 Author: tuexen Date: Sun Jul 7 18:58:49 2013 New Revision: 252990 URL: http://svnweb.freebsd.org/changeset/base/252990 Log: MFC r251248: Use LIST_EMPTY when appropriate. Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Sun Jul 7 18:56:43 2013 (r252989) +++ stable/8/sys/netinet/sctputil.c Sun Jul 7 18:58:49 2013 (r252990) @@ -3973,7 +3973,7 @@ sctp_abort_an_association(struct sctp_in if (stcb == NULL) { /* Got to have a TCB */ if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - if (LIST_FIRST(&inp->sctp_asoc_list) == NULL) { + if (LIST_EMPTY(&inp->sctp_asoc_list)) { sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT, SCTP_CALLED_DIRECTLY_NOCMPSET); } @@ -4028,7 +4028,7 @@ sctp_handle_ootb(struct mbuf *m, int iph SCTP_STAT_INCR_COUNTER32(sctps_outoftheblue); /* Generate a TO address for future reference */ if (inp && (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) { - if (LIST_FIRST(&inp->sctp_asoc_list) == NULL) { + if (LIST_EMPTY(&inp->sctp_asoc_list)) { sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT, SCTP_CALLED_DIRECTLY_NOCMPSET); } From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 7 19:01:35 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DB71BA6B; Sun, 7 Jul 2013 19:01:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CBDA510AA; Sun, 7 Jul 2013 19:01:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67J1ZeK000907; Sun, 7 Jul 2013 19:01:35 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67J1Zop000903; Sun, 7 Jul 2013 19:01:35 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071901.r67J1Zop000903@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 19:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252991 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 19:01:35 -0000 Author: tuexen Date: Sun Jul 7 19:01:34 2013 New Revision: 252991 URL: http://svnweb.freebsd.org/changeset/base/252991 Log: MFC r252585: Code cleanups. Modified: stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_indata.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Sun Jul 7 18:58:49 2013 (r252990) +++ stable/8/sys/netinet/sctp_indata.c Sun Jul 7 19:01:34 2013 (r252991) @@ -1729,7 +1729,6 @@ sctp_process_a_data_chunk(struct sctp_tc sctp_alloc_a_readq(stcb, control); sctp_build_readq_entry_mac(control, stcb, asoc->context, net, tsn, protocol_id, - stcb->asoc.context, strmno, strmseq, chunk_flags, dmbuf); @@ -1857,7 +1856,6 @@ failed_pdapi_express_del: sctp_alloc_a_readq(stcb, control); sctp_build_readq_entry_mac(control, stcb, asoc->context, net, tsn, protocol_id, - stcb->asoc.context, strmno, strmseq, chunk_flags, dmbuf); Modified: stable/8/sys/netinet/sctp_indata.h ============================================================================== --- stable/8/sys/netinet/sctp_indata.h Sun Jul 7 18:58:49 2013 (r252990) +++ stable/8/sys/netinet/sctp_indata.h Sun Jul 7 19:01:34 2013 (r252991) @@ -47,14 +47,14 @@ sctp_build_readq_entry(struct sctp_tcb * struct mbuf *dm); -#define sctp_build_readq_entry_mac(_ctl, in_it, a, net, tsn, ppid, context, stream_no, stream_seq, flags, dm) do { \ +#define sctp_build_readq_entry_mac(_ctl, in_it, context, net, tsn, ppid, stream_no, stream_seq, flags, dm) do { \ if (_ctl) { \ atomic_add_int(&((net)->ref_count), 1); \ (_ctl)->sinfo_stream = stream_no; \ (_ctl)->sinfo_ssn = stream_seq; \ (_ctl)->sinfo_flags = (flags << 8); \ (_ctl)->sinfo_ppid = ppid; \ - (_ctl)->sinfo_context = a; \ + (_ctl)->sinfo_context = context; \ (_ctl)->sinfo_timetolive = 0; \ (_ctl)->sinfo_tsn = tsn; \ (_ctl)->sinfo_cumtsn = tsn; \ Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sun Jul 7 18:58:49 2013 (r252990) +++ stable/8/sys/netinet/sctp_input.c Sun Jul 7 19:01:34 2013 (r252991) @@ -1028,12 +1028,13 @@ sctp_handle_shutdown_ack(struct sctp_shu SCTP_SOCKET_UNLOCK(so, 1); #endif } - /* are the queues empty? */ +#ifdef INVARIANTS if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { - sctp_report_all_outbound(stcb, 0, 0, SCTP_SO_NOT_LOCKED); + panic("Queues are not empty when handling SHUTDOWN-ACK"); } +#endif /* stop the timer */ sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_9); /* send SHUTDOWN-COMPLETE */ @@ -1875,9 +1876,14 @@ sctp_process_cookie_existing(struct mbuf cookie->tie_tag_peer_vtag != 0) { struct sctpasochead *head; +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + struct socket *so; + +#endif + if (asoc->peer_supports_nat) { /* - * This is a gross gross hack. just call the + * This is a gross gross hack. Just call the * cookie_new code since we are allowing a duplicate * association. I hope this works... */ @@ -1939,6 +1945,10 @@ sctp_process_cookie_existing(struct mbuf asoc->mapping_array_size); } SCTP_TCB_UNLOCK(stcb); +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + so = SCTP_INP_SO(stcb->sctp_ep); + SCTP_SOCKET_LOCK(so, 1); +#endif SCTP_INP_INFO_WLOCK(); SCTP_INP_WLOCK(stcb->sctp_ep); SCTP_TCB_LOCK(stcb); @@ -1946,7 +1956,7 @@ sctp_process_cookie_existing(struct mbuf /* send up all the data */ SCTP_TCB_SEND_LOCK(stcb); - sctp_report_all_outbound(stcb, 0, 1, SCTP_SO_NOT_LOCKED); + sctp_report_all_outbound(stcb, 0, 1, SCTP_SO_LOCKED); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { stcb->asoc.strmout[i].chunks_on_queues = 0; stcb->asoc.strmout[i].stream_no = i; @@ -1968,11 +1978,15 @@ sctp_process_cookie_existing(struct mbuf */ LIST_INSERT_HEAD(head, stcb, sctp_asocs); - /* process the INIT info (peer's info) */ SCTP_TCB_SEND_UNLOCK(stcb); SCTP_INP_WUNLOCK(stcb->sctp_ep); SCTP_INP_INFO_WUNLOCK(); - +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + SCTP_SOCKET_UNLOCK(so, 1); +#endif + asoc->total_flight = 0; + asoc->total_flight_count = 0; + /* process the INIT info (peer's info) */ retval = sctp_process_init(init_cp, stcb); if (retval < 0) { if (how_indx < sizeof(asoc->cookie_how)) @@ -3196,13 +3210,14 @@ sctp_handle_shutdown_complete(struct sct /* notify upper layer protocol */ if (stcb->sctp_socket) { sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); - /* are the queues empty? they should be */ - if (!TAILQ_EMPTY(&asoc->send_queue) || - !TAILQ_EMPTY(&asoc->sent_queue) || - !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { - sctp_report_all_outbound(stcb, 0, 0, SCTP_SO_NOT_LOCKED); - } } +#ifdef INVARIANTS + if (!TAILQ_EMPTY(&asoc->send_queue) || + !TAILQ_EMPTY(&asoc->sent_queue) || + !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { + panic("Queues are not empty when handling SHUTDOWN-COMPLETE"); + } +#endif /* stop the timer */ sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_22); SCTP_STAT_INCR_COUNTER32(sctps_shutdown); @@ -3491,18 +3506,13 @@ sctp_reset_in_stream(struct sctp_tcb *st } static void -sctp_reset_out_streams(struct sctp_tcb *stcb, int number_entries, uint16_t * list) +sctp_reset_out_streams(struct sctp_tcb *stcb, uint32_t number_entries, uint16_t * list) { - int i; + uint32_t i; + uint16_t temp; - if (number_entries == 0) { - for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - stcb->asoc.strmout[i].next_sequence_send = 0; - } - } else if (number_entries) { + if (number_entries > 0) { for (i = 0; i < number_entries; i++) { - uint16_t temp; - temp = ntohs(list[i]); if (temp >= stcb->asoc.streamoutcnt) { /* no such stream */ @@ -3510,6 +3520,10 @@ sctp_reset_out_streams(struct sctp_tcb * } stcb->asoc.strmout[temp].next_sequence_send = 0; } + } else { + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + stcb->asoc.strmout[i].next_sequence_send = 0; + } } sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_SEND, stcb, number_entries, (void *)list, SCTP_SO_NOT_LOCKED); } @@ -3596,7 +3610,7 @@ sctp_handle_stream_reset_response(struct struct sctp_association *asoc = &stcb->asoc; struct sctp_tmit_chunk *chk; struct sctp_stream_reset_out_request *srparam; - int number_entries; + uint32_t number_entries; if (asoc->stream_reset_outstanding == 0) { /* duplicate */ Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Sun Jul 7 18:58:49 2013 (r252990) +++ stable/8/sys/netinet/sctp_pcb.c Sun Jul 7 19:01:34 2013 (r252991) @@ -4451,23 +4451,21 @@ sctp_delete_from_timewait(uint32_t tag, int i; chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; - if (!LIST_EMPTY(chain)) { - LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { - for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if ((twait_block->vtag_block[i].v_tag == tag) && - (twait_block->vtag_block[i].lport == lport) && - (twait_block->vtag_block[i].rport == rport)) { - twait_block->vtag_block[i].tv_sec_at_expire = 0; - twait_block->vtag_block[i].v_tag = 0; - twait_block->vtag_block[i].lport = 0; - twait_block->vtag_block[i].rport = 0; - found = 1; - break; - } - } - if (found) + LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { + for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { + if ((twait_block->vtag_block[i].v_tag == tag) && + (twait_block->vtag_block[i].lport == lport) && + (twait_block->vtag_block[i].rport == rport)) { + twait_block->vtag_block[i].tv_sec_at_expire = 0; + twait_block->vtag_block[i].v_tag = 0; + twait_block->vtag_block[i].lport = 0; + twait_block->vtag_block[i].rport = 0; + found = 1; break; + } } + if (found) + break; } } @@ -4481,19 +4479,17 @@ sctp_is_in_timewait(uint32_t tag, uint16 SCTP_INP_INFO_WLOCK(); chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; - if (!LIST_EMPTY(chain)) { - LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { - for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if ((twait_block->vtag_block[i].v_tag == tag) && - (twait_block->vtag_block[i].lport == lport) && - (twait_block->vtag_block[i].rport == rport)) { - found = 1; - break; - } - } - if (found) + LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { + for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { + if ((twait_block->vtag_block[i].v_tag == tag) && + (twait_block->vtag_block[i].lport == lport) && + (twait_block->vtag_block[i].rport == rport)) { + found = 1; break; + } } + if (found) + break; } SCTP_INP_INFO_WUNLOCK(); return (found); @@ -4515,42 +4511,40 @@ sctp_add_vtag_to_timewait(uint32_t tag, (void)SCTP_GETTIME_TIMEVAL(&now); chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; set = 0; - if (!LIST_EMPTY(chain)) { + LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { /* Block(s) present, lets find space, and expire on the fly */ - LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { - for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if ((twait_block->vtag_block[i].v_tag == 0) && - !set) { - twait_block->vtag_block[i].tv_sec_at_expire = - now.tv_sec + time; + for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { + if ((twait_block->vtag_block[i].v_tag == 0) && + !set) { + twait_block->vtag_block[i].tv_sec_at_expire = + now.tv_sec + time; + twait_block->vtag_block[i].v_tag = tag; + twait_block->vtag_block[i].lport = lport; + twait_block->vtag_block[i].rport = rport; + set = 1; + } else if ((twait_block->vtag_block[i].v_tag) && + ((long)twait_block->vtag_block[i].tv_sec_at_expire < now.tv_sec)) { + /* Audit expires this guy */ + twait_block->vtag_block[i].tv_sec_at_expire = 0; + twait_block->vtag_block[i].v_tag = 0; + twait_block->vtag_block[i].lport = 0; + twait_block->vtag_block[i].rport = 0; + if (set == 0) { + /* Reuse it for my new tag */ + twait_block->vtag_block[i].tv_sec_at_expire = now.tv_sec + time; twait_block->vtag_block[i].v_tag = tag; twait_block->vtag_block[i].lport = lport; twait_block->vtag_block[i].rport = rport; set = 1; - } else if ((twait_block->vtag_block[i].v_tag) && - ((long)twait_block->vtag_block[i].tv_sec_at_expire < now.tv_sec)) { - /* Audit expires this guy */ - twait_block->vtag_block[i].tv_sec_at_expire = 0; - twait_block->vtag_block[i].v_tag = 0; - twait_block->vtag_block[i].lport = 0; - twait_block->vtag_block[i].rport = 0; - if (set == 0) { - /* Reuse it for my new tag */ - twait_block->vtag_block[i].tv_sec_at_expire = now.tv_sec + time; - twait_block->vtag_block[i].v_tag = tag; - twait_block->vtag_block[i].lport = lport; - twait_block->vtag_block[i].rport = rport; - set = 1; - } } } - if (set) { - /* - * We only do up to the block where we can - * place our tag for audits - */ - break; - } + } + if (set) { + /* + * We only do up to the block where we can place our + * tag for audits + */ + break; } } /* Need to add a new block to chain */ @@ -6700,30 +6694,28 @@ skip_vtag_check: chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; /* Now what about timed wait ? */ - if (!LIST_EMPTY(chain)) { + LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { /* * Block(s) are present, lets see if we have this tag in the * list */ - LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { - for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if (twait_block->vtag_block[i].v_tag == 0) { - /* not used */ - continue; - } else if ((long)twait_block->vtag_block[i].tv_sec_at_expire < - now->tv_sec) { - /* Audit expires this guy */ - twait_block->vtag_block[i].tv_sec_at_expire = 0; - twait_block->vtag_block[i].v_tag = 0; - twait_block->vtag_block[i].lport = 0; - twait_block->vtag_block[i].rport = 0; - } else if ((twait_block->vtag_block[i].v_tag == tag) && - (twait_block->vtag_block[i].lport == lport) && - (twait_block->vtag_block[i].rport == rport)) { - /* Bad tag, sorry :< */ - SCTP_INP_INFO_RUNLOCK(); - return (0); - } + for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { + if (twait_block->vtag_block[i].v_tag == 0) { + /* not used */ + continue; + } else if ((long)twait_block->vtag_block[i].tv_sec_at_expire < + now->tv_sec) { + /* Audit expires this guy */ + twait_block->vtag_block[i].tv_sec_at_expire = 0; + twait_block->vtag_block[i].v_tag = 0; + twait_block->vtag_block[i].lport = 0; + twait_block->vtag_block[i].rport = 0; + } else if ((twait_block->vtag_block[i].v_tag == tag) && + (twait_block->vtag_block[i].lport == lport) && + (twait_block->vtag_block[i].rport == rport)) { + /* Bad tag, sorry :< */ + SCTP_INP_INFO_RUNLOCK(); + return (0); } } } From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 7 19:04:10 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D352EB9B; Sun, 7 Jul 2013 19:04:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C424510B4; Sun, 7 Jul 2013 19:04:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67J4AO2001370; Sun, 7 Jul 2013 19:04:10 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67J4AOt001369; Sun, 7 Jul 2013 19:04:10 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071904.r67J4AOt001369@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 19:04:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252992 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 19:04:10 -0000 Author: tuexen Date: Sun Jul 7 19:04:10 2013 New Revision: 252992 URL: http://svnweb.freebsd.org/changeset/base/252992 Log: MFC r252718: When processing an incoming ABORT, SHUTDOWN_COMPLETE or ERROR (NAT related) chunk, take always the T-bit into account, when checking the verification tag. Modified: stable/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sun Jul 7 19:01:34 2013 (r252991) +++ stable/8/sys/netinet/sctp_input.c Sun Jul 7 19:04:10 2013 (r252992) @@ -4568,8 +4568,10 @@ __attribute__((noinline)) if ((ch->chunk_type == SCTP_ABORT_ASSOCIATION) || (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) || (ch->chunk_type == SCTP_PACKET_DROPPED)) { - if ((vtag_in == asoc->my_vtag) || - ((ch->chunk_flags & SCTP_HAD_NO_TCB) && + /* Take the T-bit always into account. */ + if ((((ch->chunk_flags & SCTP_HAD_NO_TCB) == 0) && + (vtag_in == asoc->my_vtag)) || + (((ch->chunk_flags & SCTP_HAD_NO_TCB) == SCTP_HAD_NO_TCB) && (vtag_in == asoc->peer_vtag))) { /* this is valid */ } else { From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 7 19:07:02 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 56ABBE1A; Sun, 7 Jul 2013 19:07:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48A0E10D5; Sun, 7 Jul 2013 19:07:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67J72g1001988; Sun, 7 Jul 2013 19:07:02 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67J71L7001978; Sun, 7 Jul 2013 19:07:01 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071907.r67J71L7001978@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 19:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252994 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 19:07:02 -0000 Author: tuexen Date: Sun Jul 7 19:07:00 2013 New Revision: 252994 URL: http://svnweb.freebsd.org/changeset/base/252994 Log: MFC r252779: Fix a bug were only 2048 streams where usable even though more than 2048 streams were negotiated on the wire. While there, remove the hard coded limit of 2048 streams. Modified: stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Sun Jul 7 19:05:35 2013 (r252993) +++ stable/8/sys/netinet/sctp_constants.h Sun Jul 7 19:07:00 2013 (r252994) @@ -521,9 +521,6 @@ __FBSDID("$FreeBSD$"); /* How long a cookie lives in milli-seconds */ #define SCTP_DEFAULT_COOKIE_LIFE 60000 -/* resource limit of streams */ -#define MAX_SCTP_STREAMS 2048 - /* Maximum the mapping array will grow to (TSN mapping array) */ #define SCTP_MAPPING_ARRAY 512 @@ -658,6 +655,7 @@ __FBSDID("$FreeBSD$"); /* How many streams I request initally by default */ #define SCTP_OSTREAM_INITIAL 10 +#define SCTP_ISTREAM_INITIAL 2048 /* * How many smallest_mtu's need to increase before a window update sack is Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sun Jul 7 19:05:35 2013 (r252993) +++ stable/8/sys/netinet/sctp_input.c Sun Jul 7 19:07:00 2013 (r252994) @@ -389,9 +389,10 @@ sctp_process_init(struct sctp_init_chunk } SCTP_FREE(asoc->strmin, SCTP_M_STRMI); } - asoc->streamincnt = ntohs(init->num_outbound_streams); - if (asoc->streamincnt > MAX_SCTP_STREAMS) { - asoc->streamincnt = MAX_SCTP_STREAMS; + if (asoc->max_inbound_streams > ntohs(init->num_outbound_streams)) { + asoc->streamincnt = ntohs(init->num_outbound_streams); + } else { + asoc->streamincnt = asoc->max_inbound_streams; } SCTP_MALLOC(asoc->strmin, struct sctp_stream_in *, asoc->streamincnt * sizeof(struct sctp_stream_in), SCTP_M_STRMI); @@ -403,11 +404,6 @@ sctp_process_init(struct sctp_init_chunk for (i = 0; i < asoc->streamincnt; i++) { asoc->strmin[i].stream_no = i; asoc->strmin[i].last_sequence_delivered = 0xffff; - /* - * U-stream ranges will be set when the cookie is unpacked. - * Or for the INIT sender they are un set (if pr-sctp not - * supported) when the INIT-ACK arrives. - */ TAILQ_INIT(&asoc->strmin[i].inqueue); asoc->strmin[i].delivery_started = 0; } Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Sun Jul 7 19:05:35 2013 (r252993) +++ stable/8/sys/netinet/sctp_pcb.c Sun Jul 7 19:07:00 2013 (r252994) @@ -2503,9 +2503,6 @@ sctp_inpcb_alloc(struct socket *so, uint m->initial_rto = SCTP_BASE_SYSCTL(sctp_rto_initial_default); m->initial_init_rto_max = SCTP_BASE_SYSCTL(sctp_init_rto_max_default); m->sctp_sack_freq = SCTP_BASE_SYSCTL(sctp_sack_freq_default); - - m->max_open_streams_intome = MAX_SCTP_STREAMS; - m->max_init_times = SCTP_BASE_SYSCTL(sctp_init_rtx_max_default); m->max_send_times = SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default); m->def_net_failure = SCTP_BASE_SYSCTL(sctp_path_rtx_max_default); @@ -2517,6 +2514,7 @@ sctp_inpcb_alloc(struct socket *so, uint m->sctp_default_cc_module = SCTP_BASE_SYSCTL(sctp_default_cc_module); m->sctp_default_ss_module = SCTP_BASE_SYSCTL(sctp_default_ss_module); + m->max_open_streams_intome = SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default); /* number of streams to pre-open on a association */ m->pre_open_stream_count = SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default); Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Sun Jul 7 19:05:35 2013 (r252993) +++ stable/8/sys/netinet/sctp_sysctl.c Sun Jul 7 19:07:00 2013 (r252994) @@ -81,6 +81,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_path_rtx_max_default) = SCTPCTL_PATH_RTX_MAX_DEFAULT; SCTP_BASE_SYSCTL(sctp_path_pf_threshold) = SCTPCTL_PATH_PF_THRESHOLD_DEFAULT; SCTP_BASE_SYSCTL(sctp_add_more_threshold) = SCTPCTL_ADD_MORE_ON_OUTPUT_DEFAULT; + SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default) = SCTPCTL_INCOMING_STREAMS_DEFAULT; SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default) = SCTPCTL_OUTGOING_STREAMS_DEFAULT; SCTP_BASE_SYSCTL(sctp_cmt_on_off) = SCTPCTL_CMT_ON_OFF_DEFAULT; /* EY */ @@ -623,6 +624,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_path_rtx_max_default), SCTPCTL_PATH_RTX_MAX_MIN, SCTPCTL_PATH_RTX_MAX_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_path_pf_threshold), SCTPCTL_PATH_PF_THRESHOLD_MIN, SCTPCTL_PATH_PF_THRESHOLD_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_add_more_threshold), SCTPCTL_ADD_MORE_ON_OUTPUT_MIN, SCTPCTL_ADD_MORE_ON_OUTPUT_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default), SCTPCTL_INCOMING_STREAMS_MIN, SCTPCTL_INCOMING_STREAMS_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), SCTPCTL_OUTGOING_STREAMS_MIN, SCTPCTL_OUTGOING_STREAMS_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_cmt_on_off), SCTPCTL_CMT_ON_OFF_MIN, SCTPCTL_CMT_ON_OFF_MAX); /* EY */ @@ -965,6 +967,10 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_add_more_threshold), 0, sysctl_sctp_check, "IU", SCTPCTL_ADD_MORE_ON_OUTPUT_DESC); +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, incoming_streams, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default), 0, sysctl_sctp_check, "IU", + SCTPCTL_INCOMING_STREAMS_DESC); + SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTGOING_STREAMS_DESC); Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Sun Jul 7 19:05:35 2013 (r252993) +++ stable/8/sys/netinet/sctp_sysctl.h Sun Jul 7 19:07:00 2013 (r252994) @@ -72,6 +72,7 @@ struct sctp_sysctl { uint32_t sctp_path_rtx_max_default; uint32_t sctp_path_pf_threshold; uint32_t sctp_add_more_threshold; + uint32_t sctp_nr_incoming_streams_default; uint32_t sctp_nr_outgoing_streams_default; uint32_t sctp_cmt_on_off; uint32_t sctp_cmt_use_dac; @@ -322,6 +323,12 @@ struct sctp_sysctl { #define SCTPCTL_ADD_MORE_ON_OUTPUT_MAX 0xFFFFFFFF #define SCTPCTL_ADD_MORE_ON_OUTPUT_DEFAULT SCTP_DEFAULT_ADD_MORE +/* incoming_streams: Default number of incoming streams */ +#define SCTPCTL_INCOMING_STREAMS_DESC "Default number of incoming streams" +#define SCTPCTL_INCOMING_STREAMS_MIN 1 +#define SCTPCTL_INCOMING_STREAMS_MAX 65535 +#define SCTPCTL_INCOMING_STREAMS_DEFAULT SCTP_ISTREAM_INITIAL + /* outgoing_streams: Default number of outgoing streams */ #define SCTPCTL_OUTGOING_STREAMS_DESC "Default number of outgoing streams" #define SCTPCTL_OUTGOING_STREAMS_MIN 1 From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 7 22:27:49 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A7CF32A3; Sun, 7 Jul 2013 22:27:49 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0B29A199A; Sun, 7 Jul 2013 22:27:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67MRmA1061277; Sun, 7 Jul 2013 22:27:48 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67MRlNM061251; Sun, 7 Jul 2013 22:27:47 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201307072227.r67MRlNM061251@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 7 Jul 2013 22:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r253011 - stable/8/share/zoneinfo X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 22:27:49 -0000 Author: edwin Date: Sun Jul 7 22:27:47 2013 New Revision: 253011 URL: http://svnweb.freebsd.org/changeset/base/253011 Log: MFC of tzdata2013d, 253009 - Morocco: announced that the year's Ramadan daylight-savings transitions would be 2013-07-07 and 2013-08-10. - Israel: As of 2013, DST starts at 02:00 on the Friday before the last Sunday in March. DST ends at 02:00 on the first Sunday after October 1, unless it occurs on the second day of the Jewish Rosh Hashana holiday, in which case DST ends a day later (i.e. at 02:00 the first Monday after October 2). [Rosh Hashana holidays are factored in until 2100.] Modified: stable/8/share/zoneinfo/africa stable/8/share/zoneinfo/asia stable/8/share/zoneinfo/australasia stable/8/share/zoneinfo/europe stable/8/share/zoneinfo/southamerica stable/8/share/zoneinfo/zone.tab Directory Properties: stable/8/share/zoneinfo/ (props changed) Modified: stable/8/share/zoneinfo/africa ============================================================================== --- stable/8/share/zoneinfo/africa Sun Jul 7 22:27:36 2013 (r253010) +++ stable/8/share/zoneinfo/africa Sun Jul 7 22:27:47 2013 (r253011) @@ -852,12 +852,18 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # announced that year's Ramadan daylight-saving transitions would be # 2012-07-20 and 2012-08-20; see # . -# + +# From Andrew Paprocki (2013-07-02): +# Morocco announced that the year's Ramadan daylight-savings +# transitions would be 2013-07-07 and 2013-08-10; see: +# http://www.maroc.ma/en/news/morocco-suspends-daylight-saving-time-july-7-aug10 + +# From Paul Eggert (2013-07-03): # To estimate what the Moroccan government will do in future years, -# transition dates for 2013 through 2021 were determined by running +# transition dates for 2014 through 2021 were determined by running # the following program under GNU Emacs 24.3: # -# (let ((islamic-year 1434)) +# (let ((islamic-year 1435)) # (while (< islamic-year 1444) # (let ((a # (calendar-gregorian-from-absolute @@ -910,8 +916,8 @@ Rule Morocco 2012 2019 - Apr lastSun 2: Rule Morocco 2012 max - Sep lastSun 3:00 0 - Rule Morocco 2012 only - Jul 20 3:00 0 - Rule Morocco 2012 only - Aug 20 2:00 1:00 S -Rule Morocco 2013 only - Jul 9 3:00 0 - -Rule Morocco 2013 only - Aug 8 2:00 1:00 S +Rule Morocco 2013 only - Jul 7 3:00 0 - +Rule Morocco 2013 only - Aug 10 2:00 1:00 S Rule Morocco 2014 only - Jun 29 3:00 0 - Rule Morocco 2014 only - Jul 29 2:00 1:00 S Rule Morocco 2015 only - Jun 18 3:00 0 - Modified: stable/8/share/zoneinfo/asia ============================================================================== --- stable/8/share/zoneinfo/asia Sun Jul 7 22:27:36 2013 (r253010) +++ stable/8/share/zoneinfo/asia Sun Jul 7 22:27:47 2013 (r253011) @@ -1212,39 +1212,21 @@ Rule Zion 2011 only - Oct 2 2:00 0 S Rule Zion 2012 only - Mar Fri>=26 2:00 1:00 D Rule Zion 2012 only - Sep 23 2:00 0 S -# From Ephraim Silverberg (2012-10-18): -# Yesterday, the Interior Ministry Committee, after more than a year -# past, approved sending the proposed June 2011 changes to the Time -# Decree Law back to the Knesset for second and third (final) votes -# before the upcoming elections on Jan. 22, 2013. Hence, although the -# changes are not yet law, they are expected to be so before February 2013. -# -# As of 2013, DST starts at 02:00 on the Friday before the last Sunday in March. -# DST ends at 02:00 on the first Sunday after October 1, unless it occurs on the -# second day of the Jewish Rosh Hashana holiday, in which case DST ends a day -# later (i.e. at 02:00 the first Monday after October 2). -# [Rosh Hashana holidays are factored in until 2100.] - -# From Ephraim Silverberg (2012-11-05): -# The Knesset passed today (in second and final readings) the amendment to the -# Time Decree Law making the changes ... law. +# From Ephraim Silverberg (2013-06-27): +# On June 23, 2013, the Israeli government approved changes to the +# Time Decree Law. The next day, the changes passed the First Reading +# in the Knesset. The law is expected to pass the Second and Third +# (final) Readings by the beginning of September 2013. +# +# As of 2013, DST starts at 02:00 on the Friday before the last Sunday +# in March. DST ends at 02:00 on the last Sunday of October. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Zion 2013 max - Mar Fri>=23 2:00 1:00 D -Rule Zion 2013 2026 - Oct Sun>=2 2:00 0 S -Rule Zion 2027 only - Oct Mon>=3 2:00 0 S -Rule Zion 2028 max - Oct Sun>=2 2:00 0 S -# The following rules are commented out for now, as they break older -# versions of zic that support only signed 32-bit timestamps, i.e., -# through 2038-01-19 03:14:07 UTC. -#Rule Zion 2028 2053 - Oct Sun>=2 2:00 0 S -#Rule Zion 2054 only - Oct Mon>=3 2:00 0 S -#Rule Zion 2055 2080 - Oct Sun>=2 2:00 0 S -#Rule Zion 2081 only - Oct Mon>=3 2:00 0 S -#Rule Zion 2082 max - Oct Sun>=2 2:00 0 S +Rule Zion 2013 max - Oct lastSun 2:00 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Jerusalem 2:20:56 - LMT 1880 +Zone Asia/Jerusalem 2:20:54 - LMT 1880 2:20:40 - JMT 1918 # Jerusalem Mean Time? 2:00 Zion I%sT @@ -2547,8 +2529,8 @@ Rule Syria 2006 only - Sep 22 0:00 0 - Rule Syria 2007 only - Mar lastFri 0:00 1:00 S # From Jesper Norgard (2007-10-27): # The sister center ICARDA of my work CIMMYT is confirming that Syria DST will -# not take place 1.st November at 0:00 o'clock but 1.st November at 24:00 or -# rather Midnight between Thursday and Friday. This does make more sence than +# not take place 1st November at 0:00 o'clock but 1st November at 24:00 or +# rather Midnight between Thursday and Friday. This does make more sense than # having it between Wednesday and Thursday (two workdays in Syria) since the # weekend in Syria is not Saturday and Sunday, but Friday and Saturday. So now # it is implemented at midnight of the last workday before weekend... Modified: stable/8/share/zoneinfo/australasia ============================================================================== --- stable/8/share/zoneinfo/australasia Sun Jul 7 22:27:36 2013 (r253010) +++ stable/8/share/zoneinfo/australasia Sun Jul 7 22:27:47 2013 (r253011) @@ -230,10 +230,16 @@ Zone Australia/Lord_Howe 10:36:20 - LMT # - Macquarie Island will stay on UTC+11 for winter and therefore not # switch back from daylight savings time when other parts of Australia do # on 4 April. +# +# From Arthur David Olson (2013-05-23): +# The 1919 transition is overspecified below so pre-2013 zics +# will produce a binary file with an EST-type as the first 32-bit type; +# this is required for correct handling of times before 1916 by +# pre-2013 versions of localtime. Zone Antarctica/Macquarie 0 - zzz 1899 Nov 10:00 - EST 1916 Oct 1 2:00 10:00 1:00 EST 1917 Feb - 10:00 Aus EST 1919 Apr + 10:00 Aus EST 1919 Apr 1 0:00s 0 - zzz 1948 Mar 25 10:00 Aus EST 1967 10:00 AT EST 2010 Apr 4 3:00 @@ -1475,12 +1481,12 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # From Paul Eggert (2000-01-08): # IATA SSIM (1999-09) says DST ends 0100 local time. Go with McDow. -# From the BBC World Service (1998-10-31 11:32 UTC): +# From the BBC World Service in +# http://news.bbc.co.uk/2/hi/asia-pacific/205226.stm (1998-10-31 16:03 UTC): # The Fijiian government says the main reasons for the time change is to -# improve productivity and reduce road accidents. But correspondents say it -# also hopes the move will boost Fiji's ability to compete with other pacific -# islands in the effort to attract tourists to witness the dawning of the new -# millenium. +# improve productivity and reduce road accidents.... [T]he move is also +# intended to boost Fiji's ability to attract tourists to witness the dawning +# of the new millennium. # http://www.fiji.gov.fj/press/2000_09/2000_09_13-05.shtml (2000-09-13) # reports that Fiji has discontinued DST. @@ -1625,7 +1631,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # Shanks & Pottenger say the transition was on 1968-10-01; go with Mundell. # From Eric Ulevik (1999-05-03): -# Tonga's director of tourism, who is also secretary of the National Millenium +# Tonga's director of tourism, who is also secretary of the National Millennium # Committee, has a plan to get Tonga back in front. # He has proposed a one-off move to tropical daylight saving for Tonga from # October to March, which has won approval in principle from the Tongan Modified: stable/8/share/zoneinfo/europe ============================================================================== --- stable/8/share/zoneinfo/europe Sun Jul 7 22:27:36 2013 (r253010) +++ stable/8/share/zoneinfo/europe Sun Jul 7 22:27:47 2013 (r253011) @@ -523,7 +523,7 @@ Rule C-Eur 1944 only - Oct 2 2:00s 0 - # It seems that Paris, Monaco, Rule France, Rule Belgium all agree on # 2:00 standard time, e.g. 3:00 local time. However there are no # countries that use C-Eur rules in September 1945, so the only items -# affected are apparently these ficticious zones that translates acronyms +# affected are apparently these fictitious zones that translate acronyms # CET and MET: # # Zone CET 1:00 C-Eur CE%sT @@ -2779,9 +2779,9 @@ Link Europe/Istanbul Asia/Istanbul # Ist # Ukraine # -# From Igor Karpov, who works for the Ukranian Ministry of Justice, +# From Igor Karpov, who works for the Ukrainian Ministry of Justice, # via Garrett Wollman (2003-01-27): -# BTW, I've found the official document on this matter. It's goverment +# BTW, I've found the official document on this matter. It's government # regulations number 509, May 13, 1996. In my poor translation it says: # "Time in Ukraine is set to second timezone (Kiev time). Each last Sunday # of March at 3am the time is changing to 4am and each last Sunday of @@ -2815,7 +2815,7 @@ Link Europe/Istanbul Asia/Istanbul # Ist # time this year after all. # # From Udo Schwedt (2011-10-18): -# As far as I understand, the recent change to the Ukranian time zone +# As far as I understand, the recent change to the Ukrainian time zone # (Europe/Kiev) to introduce permanent daylight saving time (similar # to Russia) was reverted today: # Modified: stable/8/share/zoneinfo/southamerica ============================================================================== --- stable/8/share/zoneinfo/southamerica Sun Jul 7 22:27:36 2013 (r253010) +++ stable/8/share/zoneinfo/southamerica Sun Jul 7 22:27:47 2013 (r253011) @@ -971,7 +971,7 @@ Rule Brazil 2007 only - Feb 25 0:00 0 - # adopted by the same states as before. Rule Brazil 2007 only - Oct Sun>=8 0:00 1:00 S # From Frederico A. C. Neves (2008-09-10): -# Acording to this decree +# According to this decree # # http://www.planalto.gov.br/ccivil_03/_Ato2007-2010/2008/Decreto/D6558.htm # @@ -1203,7 +1203,7 @@ Zone America/Rio_Branco -4:31:12 - LMT 1 # http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651 # # -# This is not yet reflected in the offical "cambio de hora" site, but +# This is not yet reflected in the official "cambio de hora" site, but # probably will be soon: # # http://www.horaoficial.cl/cambio.htm Modified: stable/8/share/zoneinfo/zone.tab ============================================================================== --- stable/8/share/zoneinfo/zone.tab Sun Jul 7 22:27:36 2013 (r253010) +++ stable/8/share/zoneinfo/zone.tab Sun Jul 7 22:27:47 2013 (r253011) @@ -1,18 +1,21 @@ -#
+# TZ zone descriptions
+#
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
-# TZ zone descriptions
-#
-# From Paul Eggert (1996-08-05):
+# From Paul Eggert (2013-05-27):
 #
 # This file contains a table with the following columns:
 # 1.  ISO 3166 2-character country code.  See /usr/share/misc/iso3166.
+#     This identifies a country that overlaps the zone.  The country may
+#     overlap other zones and the zone may overlap other countries.
 # 2.  Latitude and longitude of the zone's principal location
 #     in ISO 6709 sign-degrees-minutes-seconds format,
 #     either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,
 #     first latitude (+ is north), then longitude (+ is east).
+#     This location need not lie within the column-1 country.
 # 3.  Zone name used in value of TZ environment variable.
+#     Please see the 'Theory' file for how zone names are chosen.
 # 4.  Comments; present if and only if the country has multiple rows.
 #
 # Columns are separated by a single tab.
@@ -22,6 +25,10 @@
 #
 # Lines beginning with `#' are comments.
 #
+# This table is intended as an aid for users, to help them select time
+# zone data appropriate for their practical needs.  It is not intended
+# to take or endorse any position on legal or territorial claims.
+#
 #country-
 #code	coordinates	TZ			comments
 AD	+4230+00131	Europe/Andorra
@@ -216,7 +223,7 @@ ID	-0002+10920	Asia/Pontianak	west & cen
 ID	-0507+11924	Asia/Makassar	east & south Borneo, Sulawesi (Celebes), Bali, Nusa Tengarra, west Timor
 ID	-0232+14042	Asia/Jayapura	west New Guinea (Irian Jaya) & Malukus (Moluccas)
 IE	+5320-00615	Europe/Dublin
-IL	+3146+03514	Asia/Jerusalem
+IL	+314650+0351326	Asia/Jerusalem
 IM	+5409-00428	Europe/Isle_of_Man
 IN	+2232+08822	Asia/Kolkata
 IO	-0720+07225	Indian/Chagos

From owner-svn-src-stable-8@FreeBSD.ORG  Mon Jul  8 12:17:10 2013
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 745C25C0;
 Mon,  8 Jul 2013 12:17:10 +0000 (UTC)
 (envelope-from achim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 5654C1D1A;
 Mon,  8 Jul 2013 12:17:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r68CHAim059937;
 Mon, 8 Jul 2013 12:17:10 GMT (envelope-from achim@svn.freebsd.org)
Received: (from achim@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r68CH7Rl059920;
 Mon, 8 Jul 2013 12:17:07 GMT (envelope-from achim@svn.freebsd.org)
Message-Id: <201307081217.r68CH7Rl059920@svn.freebsd.org>
From: Achim Leubner 
Date: Mon, 8 Jul 2013 12:17:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253033 - in stable/8: share/man/man4 sys sys/amd64/amd64
 sys/amd64/conf sys/conf sys/dev/aacraid sys/dev/sound sys/i386/conf
 sys/i386/i386 sys/ia64/conf sys/modules sys/modules/aacraid...
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
X-List-Received-Date: Mon, 08 Jul 2013 12:17:10 -0000

Author: achim
Date: Mon Jul  8 12:17:06 2013
New Revision: 253033
URL: http://svnweb.freebsd.org/changeset/base/253033

Log:
  MFC r250963, r251013, r251056: Driver 'aacraid' added to support Adaptec by PMC RAID controller families Series 6, 7, 8 and upcoming products.
  
  Approved by:	emaste (co-mentor)

Added:
  stable/8/share/man/man4/aacraid.4
     - copied, changed from r250963, head/share/man/man4/aacraid.4
  stable/8/sys/dev/aacraid/
     - copied from r250963, head/sys/dev/aacraid/
  stable/8/sys/modules/aacraid/
     - copied from r250963, head/sys/modules/aacraid/
Modified:
  stable/8/share/man/man4/Makefile
  stable/8/sys/amd64/conf/GENERIC
  stable/8/sys/amd64/conf/NOTES
  stable/8/sys/conf/files
  stable/8/sys/conf/options
  stable/8/sys/dev/aacraid/aacraid.c
  stable/8/sys/i386/conf/GENERIC
  stable/8/sys/i386/conf/NOTES
  stable/8/sys/ia64/conf/GENERIC
  stable/8/sys/modules/Makefile
  stable/8/sys/modules/aacraid/Makefile
  stable/8/sys/sys/aac_ioctl.h
Directory Properties:
  stable/8/share/man/man4/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/Makefile   (props changed)
  stable/8/sys/amd64/   (props changed)
  stable/8/sys/amd64/amd64/intr_machdep.c   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/arm/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/bsm/   (props changed)
  stable/8/sys/cam/   (props changed)
  stable/8/sys/cddl/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/compat/   (props changed)
  stable/8/sys/conf/   (props changed)
  stable/8/sys/contrib/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/crypto/   (props changed)
  stable/8/sys/ddb/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/aac/   (props changed)
  stable/8/sys/dev/acpi_support/   (props changed)
  stable/8/sys/dev/acpica/   (props changed)
  stable/8/sys/dev/adb/   (props changed)
  stable/8/sys/dev/adlink/   (props changed)
  stable/8/sys/dev/advansys/   (props changed)
  stable/8/sys/dev/ae/   (props changed)
  stable/8/sys/dev/age/   (props changed)
  stable/8/sys/dev/agp/   (props changed)
  stable/8/sys/dev/aha/   (props changed)
  stable/8/sys/dev/ahb/   (props changed)
  stable/8/sys/dev/ahci/   (props changed)
  stable/8/sys/dev/aic/   (props changed)
  stable/8/sys/dev/aic7xxx/   (props changed)
  stable/8/sys/dev/alc/   (props changed)
  stable/8/sys/dev/ale/   (props changed)
  stable/8/sys/dev/amd/   (props changed)
  stable/8/sys/dev/amdsbwd/   (props changed)
  stable/8/sys/dev/amdtemp/   (props changed)
  stable/8/sys/dev/amr/   (props changed)
  stable/8/sys/dev/an/   (props changed)
  stable/8/sys/dev/arcmsr/   (props changed)
  stable/8/sys/dev/asmc/   (props changed)
  stable/8/sys/dev/asr/   (props changed)
  stable/8/sys/dev/ata/   (props changed)
  stable/8/sys/dev/ath/   (props changed)
  stable/8/sys/dev/atkbdc/   (props changed)
  stable/8/sys/dev/auxio/   (props changed)
  stable/8/sys/dev/bce/   (props changed)
  stable/8/sys/dev/bfe/   (props changed)
  stable/8/sys/dev/bge/   (props changed)
  stable/8/sys/dev/bktr/   (props changed)
  stable/8/sys/dev/bm/   (props changed)
  stable/8/sys/dev/buslogic/   (props changed)
  stable/8/sys/dev/bwi/   (props changed)
  stable/8/sys/dev/bwn/   (props changed)
  stable/8/sys/dev/cardbus/   (props changed)
  stable/8/sys/dev/cas/   (props changed)
  stable/8/sys/dev/ce/   (props changed)
  stable/8/sys/dev/cfe/   (props changed)
  stable/8/sys/dev/cfi/   (props changed)
  stable/8/sys/dev/ciss/   (props changed)
  stable/8/sys/dev/cm/   (props changed)
  stable/8/sys/dev/cmx/   (props changed)
  stable/8/sys/dev/coretemp/   (props changed)
  stable/8/sys/dev/cp/   (props changed)
  stable/8/sys/dev/cpuctl/   (props changed)
  stable/8/sys/dev/cpufreq/   (props changed)
  stable/8/sys/dev/cs/   (props changed)
  stable/8/sys/dev/ct/   (props changed)
  stable/8/sys/dev/ctau/   (props changed)
  stable/8/sys/dev/cx/   (props changed)
  stable/8/sys/dev/cxgb/   (props changed)
  stable/8/sys/dev/cxgbe/   (props changed)
  stable/8/sys/dev/cy/   (props changed)
  stable/8/sys/dev/dc/   (props changed)
  stable/8/sys/dev/dcons/   (props changed)
  stable/8/sys/dev/de/   (props changed)
  stable/8/sys/dev/digi/   (props changed)
  stable/8/sys/dev/dpms/   (props changed)
  stable/8/sys/dev/dpt/   (props changed)
  stable/8/sys/dev/drm/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)
  stable/8/sys/dev/ed/   (props changed)
  stable/8/sys/dev/eisa/   (props changed)
  stable/8/sys/dev/en/   (props changed)
  stable/8/sys/dev/ep/   (props changed)
  stable/8/sys/dev/esp/   (props changed)
  stable/8/sys/dev/et/   (props changed)
  stable/8/sys/dev/ex/   (props changed)
  stable/8/sys/dev/exca/   (props changed)
  stable/8/sys/dev/fatm/   (props changed)
  stable/8/sys/dev/fb/   (props changed)
  stable/8/sys/dev/fdc/   (props changed)
  stable/8/sys/dev/fe/   (props changed)
  stable/8/sys/dev/firewire/   (props changed)
  stable/8/sys/dev/flash/   (props changed)
  stable/8/sys/dev/fxp/   (props changed)
  stable/8/sys/dev/gem/   (props changed)
  stable/8/sys/dev/glxsb/   (props changed)
  stable/8/sys/dev/hatm/   (props changed)
  stable/8/sys/dev/hifn/   (props changed)
  stable/8/sys/dev/hme/   (props changed)
  stable/8/sys/dev/hpt27xx/   (props changed)
  stable/8/sys/dev/hptiop/   (props changed)
  stable/8/sys/dev/hptmv/   (props changed)
  stable/8/sys/dev/hptrr/   (props changed)
  stable/8/sys/dev/hwpmc/   (props changed)
  stable/8/sys/dev/ic/   (props changed)
  stable/8/sys/dev/ichsmb/   (props changed)
  stable/8/sys/dev/ichwd/   (props changed)
  stable/8/sys/dev/ida/   (props changed)
  stable/8/sys/dev/ie/   (props changed)
  stable/8/sys/dev/ieee488/   (props changed)
  stable/8/sys/dev/if_ndis/   (props changed)
  stable/8/sys/dev/iicbus/   (props changed)
  stable/8/sys/dev/iir/   (props changed)
  stable/8/sys/dev/io/   (props changed)
  stable/8/sys/dev/ipmi/   (props changed)
  stable/8/sys/dev/ips/   (props changed)
  stable/8/sys/dev/ipw/   (props changed)
  stable/8/sys/dev/isci/   (props changed)
  stable/8/sys/dev/iscsi/   (props changed)
  stable/8/sys/dev/isp/   (props changed)
  stable/8/sys/dev/ispfw/   (props changed)
  stable/8/sys/dev/iwi/   (props changed)
  stable/8/sys/dev/iwn/   (props changed)
  stable/8/sys/dev/ixgb/   (props changed)
  stable/8/sys/dev/ixgbe/   (props changed)
  stable/8/sys/dev/jme/   (props changed)
  stable/8/sys/dev/joy/   (props changed)
  stable/8/sys/dev/kbd/   (props changed)
  stable/8/sys/dev/kbdmux/   (props changed)
  stable/8/sys/dev/ksyms/   (props changed)
  stable/8/sys/dev/le/   (props changed)
  stable/8/sys/dev/led/   (props changed)
  stable/8/sys/dev/lge/   (props changed)
  stable/8/sys/dev/lindev/   (props changed)
  stable/8/sys/dev/lmc/   (props changed)
  stable/8/sys/dev/malo/   (props changed)
  stable/8/sys/dev/mc146818/   (props changed)
  stable/8/sys/dev/mca/   (props changed)
  stable/8/sys/dev/mcd/   (props changed)
  stable/8/sys/dev/md/   (props changed)
  stable/8/sys/dev/mem/   (props changed)
  stable/8/sys/dev/mfi/   (props changed)
  stable/8/sys/dev/mge/   (props changed)
  stable/8/sys/dev/mii/   (props changed)
  stable/8/sys/dev/mk48txx/   (props changed)
  stable/8/sys/dev/mlx/   (props changed)
  stable/8/sys/dev/mly/   (props changed)
  stable/8/sys/dev/mmc/   (props changed)
  stable/8/sys/dev/mn/   (props changed)
  stable/8/sys/dev/mps/   (props changed)
  stable/8/sys/dev/mpt/   (props changed)
  stable/8/sys/dev/mse/   (props changed)
  stable/8/sys/dev/msk/   (props changed)
  stable/8/sys/dev/mvs/   (props changed)
  stable/8/sys/dev/mwl/   (props changed)
  stable/8/sys/dev/mxge/   (props changed)
  stable/8/sys/dev/my/   (props changed)
  stable/8/sys/dev/ncv/   (props changed)
  stable/8/sys/dev/netmap/   (props changed)
  stable/8/sys/dev/nfe/   (props changed)
  stable/8/sys/dev/nge/   (props changed)
  stable/8/sys/dev/nmdm/   (props changed)
  stable/8/sys/dev/nsp/   (props changed)
  stable/8/sys/dev/null/   (props changed)
  stable/8/sys/dev/nve/   (props changed)
  stable/8/sys/dev/nvram/   (props changed)
  stable/8/sys/dev/nxge/   (props changed)
  stable/8/sys/dev/oce/   (props changed)
  stable/8/sys/dev/ofw/   (props changed)
  stable/8/sys/dev/patm/   (props changed)
  stable/8/sys/dev/pbio/   (props changed)
  stable/8/sys/dev/pccard/   (props changed)
  stable/8/sys/dev/pccbb/   (props changed)
  stable/8/sys/dev/pcf/   (props changed)
  stable/8/sys/dev/pci/   (props changed)
  stable/8/sys/dev/pcn/   (props changed)
  stable/8/sys/dev/pdq/   (props changed)
  stable/8/sys/dev/powermac_nvram/   (props changed)
  stable/8/sys/dev/ppbus/   (props changed)
  stable/8/sys/dev/ppc/   (props changed)
  stable/8/sys/dev/pst/   (props changed)
  stable/8/sys/dev/puc/   (props changed)
  stable/8/sys/dev/quicc/   (props changed)
  stable/8/sys/dev/ral/   (props changed)
  stable/8/sys/dev/random/   (props changed)
  stable/8/sys/dev/rc/   (props changed)
  stable/8/sys/dev/re/   (props changed)
  stable/8/sys/dev/rndtest/   (props changed)
  stable/8/sys/dev/rp/   (props changed)
  stable/8/sys/dev/safe/   (props changed)
  stable/8/sys/dev/sbni/   (props changed)
  stable/8/sys/dev/scc/   (props changed)
  stable/8/sys/dev/scd/   (props changed)
  stable/8/sys/dev/sdhci/   (props changed)
  stable/8/sys/dev/sec/   (props changed)
  stable/8/sys/dev/sf/   (props changed)
  stable/8/sys/dev/sge/   (props changed)
  stable/8/sys/dev/si/   (props changed)
  stable/8/sys/dev/siba/   (props changed)
  stable/8/sys/dev/siis/   (props changed)
  stable/8/sys/dev/sio/   (props changed)
  stable/8/sys/dev/sis/   (props changed)
  stable/8/sys/dev/sk/   (props changed)
  stable/8/sys/dev/smbus/   (props changed)
  stable/8/sys/dev/smc/   (props changed)
  stable/8/sys/dev/sn/   (props changed)
  stable/8/sys/dev/snc/   (props changed)
  stable/8/sys/dev/snp/   (props changed)
  stable/8/sys/dev/sound/   (props changed)
  stable/8/sys/dev/sound/chip.h   (props changed)
  stable/8/sys/dev/sound/clone.c   (props changed)
  stable/8/sys/dev/sound/clone.h   (props changed)
  stable/8/sys/dev/sound/driver.c   (props changed)
  stable/8/sys/dev/sound/isa/   (props changed)
  stable/8/sys/dev/sound/macio/   (props changed)
  stable/8/sys/dev/sound/midi/   (props changed)
  stable/8/sys/dev/sound/pci/   (props changed)
  stable/8/sys/dev/sound/pcm/   (props changed)
  stable/8/sys/dev/sound/sbus/   (props changed)
  stable/8/sys/dev/sound/unit.c   (props changed)
  stable/8/sys/dev/sound/unit.h   (props changed)
  stable/8/sys/dev/sound/usb/   (props changed)
  stable/8/sys/dev/sound/version.h   (props changed)
  stable/8/sys/dev/speaker/   (props changed)
  stable/8/sys/dev/spibus/   (props changed)
  stable/8/sys/dev/ste/   (props changed)
  stable/8/sys/dev/stg/   (props changed)
  stable/8/sys/dev/stge/   (props changed)
  stable/8/sys/dev/streams/   (props changed)
  stable/8/sys/dev/sym/   (props changed)
  stable/8/sys/dev/syscons/   (props changed)
  stable/8/sys/dev/tdfx/   (props changed)
  stable/8/sys/dev/ti/   (props changed)
  stable/8/sys/dev/tl/   (props changed)
  stable/8/sys/dev/tpm/   (props changed)
  stable/8/sys/dev/trm/   (props changed)
  stable/8/sys/dev/tsec/   (props changed)
  stable/8/sys/dev/twa/   (props changed)
  stable/8/sys/dev/twe/   (props changed)
  stable/8/sys/dev/tws/   (props changed)
  stable/8/sys/dev/tx/   (props changed)
  stable/8/sys/dev/txp/   (props changed)
  stable/8/sys/dev/uart/   (props changed)
  stable/8/sys/dev/ubsec/   (props changed)
  stable/8/sys/dev/usb/   (props changed)
  stable/8/sys/dev/utopia/   (props changed)
  stable/8/sys/dev/vge/   (props changed)
  stable/8/sys/dev/viawd/   (props changed)
  stable/8/sys/dev/virtio/   (props changed)
  stable/8/sys/dev/vkbd/   (props changed)
  stable/8/sys/dev/vr/   (props changed)
  stable/8/sys/dev/vte/   (props changed)
  stable/8/sys/dev/vx/   (props changed)
  stable/8/sys/dev/watchdog/   (props changed)
  stable/8/sys/dev/wb/   (props changed)
  stable/8/sys/dev/wbwd/   (props changed)
  stable/8/sys/dev/wds/   (props changed)
  stable/8/sys/dev/wi/   (props changed)
  stable/8/sys/dev/wl/   (props changed)
  stable/8/sys/dev/wpi/   (props changed)
  stable/8/sys/dev/xe/   (props changed)
  stable/8/sys/dev/xen/   (props changed)
  stable/8/sys/dev/xl/   (props changed)
  stable/8/sys/fs/   (props changed)
  stable/8/sys/gdb/   (props changed)
  stable/8/sys/geom/   (props changed)
  stable/8/sys/gnu/   (props changed)
  stable/8/sys/i386/   (props changed)
  stable/8/sys/i386/i386/intr_machdep.c   (props changed)
  stable/8/sys/ia64/   (props changed)
  stable/8/sys/isa/   (props changed)
  stable/8/sys/kern/   (props changed)
  stable/8/sys/kgssapi/   (props changed)
  stable/8/sys/libkern/   (props changed)
  stable/8/sys/mips/   (props changed)
  stable/8/sys/modules/   (props changed)
  stable/8/sys/net/   (props changed)
  stable/8/sys/net80211/   (props changed)
  stable/8/sys/netatalk/   (props changed)
  stable/8/sys/netgraph/   (props changed)
  stable/8/sys/netinet/   (props changed)
  stable/8/sys/netinet6/   (props changed)
  stable/8/sys/netipsec/   (props changed)
  stable/8/sys/netipx/   (props changed)
  stable/8/sys/netnatm/   (props changed)
  stable/8/sys/netncp/   (props changed)
  stable/8/sys/netsmb/   (props changed)
  stable/8/sys/nfs/   (props changed)
  stable/8/sys/nfsclient/   (props changed)
  stable/8/sys/nfsserver/   (props changed)
  stable/8/sys/nlm/   (props changed)
  stable/8/sys/opencrypto/   (props changed)
  stable/8/sys/pc98/   (props changed)
  stable/8/sys/pci/   (props changed)
  stable/8/sys/powerpc/   (props changed)
  stable/8/sys/rpc/   (props changed)
  stable/8/sys/security/   (props changed)
  stable/8/sys/sparc64/   (props changed)
  stable/8/sys/sun4v/   (props changed)
  stable/8/sys/sys/   (props changed)
  stable/8/sys/tools/   (props changed)
  stable/8/sys/ufs/   (props changed)
  stable/8/sys/vm/   (props changed)
  stable/8/sys/x86/   (props changed)
  stable/8/sys/xdr/   (props changed)
  stable/8/sys/xen/   (props changed)

Modified: stable/8/share/man/man4/Makefile
==============================================================================
--- stable/8/share/man/man4/Makefile	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/share/man/man4/Makefile	Mon Jul  8 12:17:06 2013	(r253033)
@@ -2,6 +2,7 @@
 # $FreeBSD$
 
 MAN=	aac.4 \
+	aacraid.4 \
 	acpi.4 \
 	${_acpi_aiboost.4} \
 	${_acpi_asus.4} \

Copied and modified: stable/8/share/man/man4/aacraid.4 (from r250963, head/share/man/man4/aacraid.4)
==============================================================================
--- head/share/man/man4/aacraid.4	Fri May 24 09:22:43 2013	(r250963, copy source)
+++ stable/8/share/man/man4/aacraid.4	Mon Jul  8 12:17:06 2013	(r253033)
@@ -53,10 +53,10 @@ The
 driver provides support for the Adaptec by PMC RAID controllers,
 including Series 6/7/8 and upcoming families.
 .Pp
-The RAID containers are handled via the 
+The RAID containers are handled via the
 .Nm aacraidp0
 bus.
-The physical buses are represented by the 
+The physical buses are represented by the
 .Nm aacraidp?
 devices (beginning with aacraidp1). These devices enable the
 SCSI pass-thru interface and allows devices connected
@@ -135,5 +135,4 @@ and are also queued for retrieval by a m
 .An Scott Long
 .Aq scottl@FreeBSD.org
 .Sh BUGS
-.Pp
 The controller is not actually paused on suspend/resume.

Modified: stable/8/sys/amd64/conf/GENERIC
==============================================================================
--- stable/8/sys/amd64/conf/GENERIC	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/sys/amd64/conf/GENERIC	Mon Jul  8 12:17:06 2013	(r253033)
@@ -151,6 +151,7 @@ device		twa		# 3ware 9000 series PATA/SA
 # RAID controllers
 device		aac		# Adaptec FSA RAID
 device		aacp		# SCSI passthrough for aac (requires CAM)
+device		aacraid		# Adaptec by PMC RAID
 device		ida		# Compaq Smart RAID
 device		mfi		# LSI MegaRAID SAS
 device		mlx		# Mylex DAC960 family

Modified: stable/8/sys/amd64/conf/NOTES
==============================================================================
--- stable/8/sys/amd64/conf/NOTES	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/sys/amd64/conf/NOTES	Mon Jul  8 12:17:06 2013	(r253033)
@@ -389,6 +389,10 @@ device		aac
 device		aacp	# SCSI Passthrough interface (optional, CAM required)
 
 #
+# Adaptec by PMC RAID controllers, Series 6/7/8 and upcoming families
+device		aacraid		# Container interface, CAM required
+
+#
 # Highpoint RocketRAID 27xx.
 device		hpt27xx
 

Modified: stable/8/sys/conf/files
==============================================================================
--- stable/8/sys/conf/files	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/sys/conf/files	Mon Jul  8 12:17:06 2013	(r253033)
@@ -397,6 +397,11 @@ dev/aac/aac_debug.c		optional aac
 dev/aac/aac_disk.c		optional aac
 dev/aac/aac_linux.c		optional aac compat_linux
 dev/aac/aac_pci.c		optional aac pci
+dev/aacraid/aacraid.c		optional aacraid
+dev/aacraid/aacraid_cam.c	optional aacraid scbus
+dev/aacraid/aacraid_debug.c	optional aacraid
+dev/aacraid/aacraid_linux.c	optional aacraid compat_linux
+dev/aacraid/aacraid_pci.c	optional aacraid pci
 dev/acpi_support/acpi_wmi.c	optional acpi_wmi acpi
 dev/acpi_support/acpi_aiboost.c	optional acpi_aiboost acpi
 dev/acpi_support/acpi_asus.c	optional acpi_asus acpi

Modified: stable/8/sys/conf/options
==============================================================================
--- stable/8/sys/conf/options	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/sys/conf/options	Mon Jul  8 12:17:06 2013	(r253033)
@@ -31,6 +31,7 @@
 # opt_.h
 
 AAC_DEBUG		opt_aac.h
+AACRAID_DEBUG		opt_aacraid.h
 AHC_ALLOW_MEMIO		opt_aic7xxx.h
 AHC_TMODE_ENABLE	opt_aic7xxx.h
 AHC_DUMP_EEPROM		opt_aic7xxx.h

Modified: stable/8/sys/dev/aacraid/aacraid.c
==============================================================================
--- head/sys/dev/aacraid/aacraid.c	Fri May 24 09:22:43 2013	(r250963)
+++ stable/8/sys/dev/aacraid/aacraid.c	Mon Jul  8 12:17:06 2013	(r253033)
@@ -2522,7 +2522,7 @@ aac_ioctl_send_raw_srb(struct aac_softc 
 		srb_sg_address = (u_int64_t)sgp->SgAddress;
 	} else if (fibsize == (sizeof(struct aac_srb) + 
 		srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry64))) {
-#ifdef __amd64__
+#ifdef __LP64__
 		struct aac_sg_entry64 *sgp = 
 			(struct aac_sg_entry64 *)srbcmd->sg_map.SgEntry;
 		srb_sg_bytecount = sgp->SgByteCount;
@@ -2576,12 +2576,7 @@ aac_ioctl_send_raw_srb(struct aac_softc 
 			cm->cm_flags |= AAC_CMD_DATAOUT;
 
 		if (srbcmd->flags & AAC_SRB_FLAGS_DATA_OUT) {
-			if ((error = copyin(
-#ifdef __amd64__
-				(void *)srb_sg_address,
-#else
-				(void *)(u_int32_t)srb_sg_address,
-#endif
+			if ((error = copyin((void *)(uintptr_t)srb_sg_address,
 				cm->cm_data, cm->cm_datalen)) != 0)
 				goto out;
 			/* sync required for bus_dmamem_alloc() alloc. mem.? */
@@ -2624,12 +2619,8 @@ aac_ioctl_send_raw_srb(struct aac_softc 
 
 	/* copy data */
 	if (transfer_data && (srbcmd->flags & AAC_SRB_FLAGS_DATA_IN)) {
-		if ((error = copyout(cm->cm_data, 
-#ifdef __amd64__
-			(void *)srb_sg_address,
-#else
-			(void *)(u_int32_t)srb_sg_address,
-#endif
+		if ((error = copyout(cm->cm_data,
+			(void *)(uintptr_t)srb_sg_address,
 			cm->cm_datalen)) != 0)
 			goto out;
 		/* sync required for bus_dmamem_alloc() allocated mem.? */

Modified: stable/8/sys/i386/conf/GENERIC
==============================================================================
--- stable/8/sys/i386/conf/GENERIC	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/sys/i386/conf/GENERIC	Mon Jul  8 12:17:06 2013	(r253033)
@@ -158,6 +158,7 @@ device		tws		# LSI 3ware 9750 SATA+SAS 6
 # RAID controllers
 device		aac		# Adaptec FSA RAID
 device		aacp		# SCSI passthrough for aac (requires CAM)
+device		aacraid		# Adaptec by PMC RAID
 device		ida		# Compaq Smart RAID
 device		mfi		# LSI MegaRAID SAS
 device		mlx		# Mylex DAC960 family

Modified: stable/8/sys/i386/conf/NOTES
==============================================================================
--- stable/8/sys/i386/conf/NOTES	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/sys/i386/conf/NOTES	Mon Jul  8 12:17:06 2013	(r253033)
@@ -718,6 +718,10 @@ hint.stg.0.port="11"
 device		aac
 device		aacp	# SCSI Passthrough interface (optional, CAM required)
 
+#
+# Adaptec by PMC RAID controllers, Series 6/7/8 and upcoming families
+device		aacraid		# Container interface, CAM required
+
 # The 'asr' driver provides support for current DPT/Adaptec SCSI RAID
 # controllers (SmartRAID V and VI and later).
 # These controllers require the CAM infrastructure.

Modified: stable/8/sys/ia64/conf/GENERIC
==============================================================================
--- stable/8/sys/ia64/conf/GENERIC	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/sys/ia64/conf/GENERIC	Mon Jul  8 12:17:06 2013	(r253033)
@@ -110,6 +110,7 @@ device		ses		# Environmental Services (a
 # RAID controllers
 device		aac		# Adaptec FSA RAID
 device		aacp		# SCSI passthrough for aac (requires CAM)
+device		aacraid		# Adaptec by PMC RAID
 device		ida		# Compaq Smart RAID
 device		mlx		# Mylex DAC960 family
 

Modified: stable/8/sys/modules/Makefile
==============================================================================
--- stable/8/sys/modules/Makefile	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/sys/modules/Makefile	Mon Jul  8 12:17:06 2013	(r253033)
@@ -6,6 +6,7 @@ SUBDIR=	\
 	${_3dfx} \
 	${_3dfx_linux} \
 	${_aac} \
+	${_aacraid} \
 	accf_data \
 	accf_dns \
 	accf_http \
@@ -477,6 +478,7 @@ _zfs=		zfs
 .endif
 .if ${MACHINE} == "i386"
 _aac=		aac
+_aacraid=	aacraid
 _acpi=		acpi
 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
 _aesni=		aesni
@@ -540,6 +542,7 @@ _snc=		snc
 
 .if ${MACHINE_ARCH} == "amd64"
 _aac=		aac
+_aacraid=	aacraid
 _acpi=		acpi
 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
 _aesni=		aesni
@@ -636,6 +639,7 @@ _zfs=		zfs
 
 .if ${MACHINE_ARCH} == "ia64"
 _aac=		aac
+_aacraid=	aacraid
 _aic=		aic
 _an=		an
 _arcnet=	arcnet

Modified: stable/8/sys/modules/aacraid/Makefile
==============================================================================
--- head/sys/modules/aacraid/Makefile	Fri May 24 09:22:43 2013	(r250963)
+++ stable/8/sys/modules/aacraid/Makefile	Mon Jul  8 12:17:06 2013	(r253033)
@@ -2,7 +2,7 @@
 
 .PATH: ${.CURDIR}/../../dev/aacraid
 
-.if ${MACHINE_CPUARCH} == "i386"
+.if ${MACHINE_ARCH} == "i386"
 SUBDIR= aacraid_linux
 .endif
 

Modified: stable/8/sys/sys/aac_ioctl.h
==============================================================================
--- stable/8/sys/sys/aac_ioctl.h	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/sys/sys/aac_ioctl.h	Mon Jul  8 12:17:06 2013	(r253033)
@@ -192,7 +192,10 @@ struct aac_query_disk {
 typedef union {
 	struct {
 		u_int32_t largeLBA  : 1;	/* disk support greater 2TB */
-		u_int32_t fReserved : 31;
+		u_int32_t IoctlBuf  : 1;	/* ARCIOCTL call support */
+		u_int32_t AIFSupport: 1;	/* AIF support */
+		u_int32_t JBODSupport:1;	/* fw + driver support JBOD */
+		u_int32_t fReserved : 28;
 	} fBits;
 	u_int32_t fValue;
 } featuresState;

From owner-svn-src-stable-8@FreeBSD.ORG  Mon Jul  8 13:22:59 2013
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 1B0605AB;
 Mon,  8 Jul 2013 13:22:59 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 0BC4110D0;
 Mon,  8 Jul 2013 13:22:59 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r68DMwc2079636;
 Mon, 8 Jul 2013 13:22:58 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r68DMwWF079635;
 Mon, 8 Jul 2013 13:22:58 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201307081322.r68DMwWF079635@svn.freebsd.org>
From: Michael Tuexen 
Date: Mon, 8 Jul 2013 13:22:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253034 - stable/8/sys/netinet
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
X-List-Received-Date: Mon, 08 Jul 2013 13:22:59 -0000

Author: tuexen
Date: Mon Jul  8 13:22:58 2013
New Revision: 253034
URL: http://svnweb.freebsd.org/changeset/base/253034

Log:
  Don't keep a pointer to freed memory.
  This is a direct commit, since this code is gone in head.

Modified:
  stable/8/sys/netinet/sctp_output.c

Modified: stable/8/sys/netinet/sctp_output.c
==============================================================================
--- stable/8/sys/netinet/sctp_output.c	Mon Jul  8 12:17:06 2013	(r253033)
+++ stable/8/sys/netinet/sctp_output.c	Mon Jul  8 13:22:58 2013	(r253034)
@@ -4487,6 +4487,7 @@ sctp_lowlevel_chunk_output(struct sctp_i
 				/* Now if we had a temp route free it */
 				if (ro->ro_rt) {
 					RTFREE(ro->ro_rt);
+					ro->ro_rt = NULL;
 				}
 			} else {
 				/*

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Jul  9 09:18:54 2013
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 4AC5E748;
 Tue,  9 Jul 2013 09:18:54 +0000 (UTC)
 (envelope-from bsd-lists@1command.com)
Received: from udns.ultimateDNS.NET (ultimatedns.net [209.180.214.225])
 by mx1.freebsd.org (Postfix) with ESMTP id 1E24612A3;
 Tue,  9 Jul 2013 09:18:53 +0000 (UTC)
Received: from udns.ultimateDNS.NET (localhost [127.0.0.1])
 by udns.ultimateDNS.NET (8.14.5/8.14.5) with ESMTP id r699Ig1V067198;
 Tue, 9 Jul 2013 02:18:48 -0700 (PDT)
 (envelope-from bsd-lists@1command.com)
Received: (from www@localhost)
 by udns.ultimateDNS.NET (8.14.5/8.14.5/Submit) id r699IbPG067197;
 Tue, 9 Jul 2013 02:18:37 -0700 (PDT)
 (envelope-from bsd-lists@1command.com)
Received: from udns.ultimatedns.net ([209.180.214.225])
 (UDNSMS authenticated user chrish) by ultimatedns.net with HTTP;
 Tue, 9 Jul 2013 02:18:37 -0700 (PDT)
Message-ID: 
Date: Tue, 9 Jul 2013 02:18:37 -0700 (PDT)
Subject: perl upgrade woes -- how to best reconcile?
From: "Chris H" 
To: "freebsd-stable" ,
 "svn-src-stable-8" 
User-Agent: UDNSMS/2.0.3
MIME-Version: 1.0
Content-Type: text/plain;charset=utf-8
Content-Transfer-Encoding: 8bit
X-Priority: 3 (Normal)
Importance: Normal
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
X-List-Received-Date: Tue, 09 Jul 2013 09:18:54 -0000

Greetings,
 As my upgrade also required the change to subversion, it's been quite a challenge.
I've nearly sorted out all the loose ends. But have a real issue with the
path change for Perl. Yes, I've read UPDATING.
For the most part, I upgraded all the ports via portmaster(8). But apparently
that doesn't get it. While Perl seems to work, I receive a few errors, and have nearly
no access to the (info|man)pages. An example error:
perlinfo Date::Manip::Offset
Subroutine path redefined at /usr/local/lib/perl5/5.12/BSDPAN/BSDPAN.pm line 29.
Subroutine canonical_path redefined at /usr/local/lib/perl5/5.12/BSDPAN/BSDPAN.pm line 33.
Subroutine perl_version redefined at /usr/local/lib/perl5/5.12/BSDPAN/BSDPAN.pm line 42.
Subroutine perl_arch redefined at /usr/local/lib/perl5/5.12/BSDPAN/BSDPAN.pm line 47.
Subroutine builds_port redefined at /usr/local/lib/perl5/5.12/BSDPAN/BSDPAN.pm line 51.
Subroutine builds_standalone redefined at /usr/local/lib/perl5/5.12/BSDPAN/BSDPAN.pm line 66.

How do I best sort this all out. I _really_ miss the perl_after_upgrade script, that
used to accompany this process.

Thank you for all your time, and consideration.

--chris


From owner-svn-src-stable-8@FreeBSD.ORG  Tue Jul  9 11:57:58 2013
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id C3117FFE;
 Tue,  9 Jul 2013 11:57:58 +0000 (UTC) (envelope-from feld@feld.me)
Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com
 [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 9661C1B1C;
 Tue,  9 Jul 2013 11:57:58 +0000 (UTC)
Received: from compute5.internal (compute5.nyi.mail.srv.osa [10.202.2.45])
 by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 2116E2084E;
 Tue,  9 Jul 2013 07:57:58 -0400 (EDT)
Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160])
 by compute5.internal (MEProxy); Tue, 09 Jul 2013 07:57:58 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=feld.me; h=
 content-type:to:subject:references:date:mime-version
 :content-transfer-encoding:from:message-id:in-reply-to; s=
 mesmtp; bh=ri7njp94sW0h629TJcLKoMCb26Q=; b=mgdrt+VL0HV5MKXDqGVV/
 x9Lu5+DF2H47RxkZIux5G2O1Qk1wwI6hCYj20k/lZFx3OY0TGUGUpOrysjgzTVHz
 0EmNnGG5G3S8uJszt50F+0cLuupEKQQ4uq1Bv6CXB7qgz3+C4eXsfx/O05cGeE1C
 TUSOKeMjvPLc1oW7hp/bJA=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
 messagingengine.com; h=content-type:to:subject:references:date
 :mime-version:content-transfer-encoding:from:message-id
 :in-reply-to; s=smtpout; bh=ri7njp94sW0h629TJcLKoMCb26Q=; b=NUS5
 zgolJXviS5wc++zEyT3p1aI91JeY52bpPgiqJyEayMyyedivrU7plD+B8lzJZdE0
 0+UwMFHpNb/4s/fSKQotxn6CgM6Tm5gvJ8wbvs0SfoPXyk9g7JqsX5wXhWN342sK
 MG5tRzdyds7N526hBVQY7rt1YT0U79xFmM11VrA=
X-Sasl-enc: 0TnlxEr1SLem33eOgzxuxhholiPyzMVJquhxAjnTY1cH 1373371077
Received: from markf.office.supranet.net (unknown [66.170.8.18])
 by mail.messagingengine.com (Postfix) with ESMTPA id D0A6BC00E7F;
 Tue,  9 Jul 2013 07:57:57 -0400 (EDT)
Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes
To: freebsd-stable , svn-src-stable-8
 , "Chris H" 
Subject: Re: perl upgrade woes -- how to best reconcile?
References: 
Date: Tue, 09 Jul 2013 06:57:57 -0500
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: "Mark Felder" 
Message-ID: 
In-Reply-To: 
User-Agent: Opera Mail/12.15 (FreeBSD)
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
X-List-Received-Date: Tue, 09 Jul 2013 11:57:58 -0000

On Tue, 09 Jul 2013 04:18:37 -0500, Chris H  wrote:

> How do I best sort this all out. I _really_ miss the perl_after_upgrade  
> script, that
> used to accompany this process.

I've had zero problems with upgrades to Perl, etc after I stopped  
compiling my packages in the host OS and started building the packages via  
poudriere and using pkgng (sysutils/pkg). pkg can detect when a perl  
upgrade is happening and is intelligent enough to reinstall all programs  
that require perl; poudriere is smart enough to rebuild and repackage them  
all. It's a match made in heaven and dead simple to use.

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Jul 10 01:27:06 2013
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 1791C728;
 Wed, 10 Jul 2013 01:27:06 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 09DF81A8D;
 Wed, 10 Jul 2013 01:27:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6A1R5QV022499;
 Wed, 10 Jul 2013 01:27:05 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6A1R5Xk022498;
 Wed, 10 Jul 2013 01:27:05 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307100127.r6A1R5Xk022498@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 10 Jul 2013 01:27:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253127 - stable/8/sys/dev/bge
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
X-List-Received-Date: Wed, 10 Jul 2013 01:27:06 -0000

Author: yongari
Date: Wed Jul 10 01:27:05 2013
New Revision: 253127
URL: http://svnweb.freebsd.org/changeset/base/253127

Log:
  MFC r252227:
    Don't blidly clear GPIOs configuration. Just use firmware configured
    one.  This change also fixes non-working traffic LED on BCM57780.

Modified:
  stable/8/sys/dev/bge/if_bge.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/bge/   (props changed)

Modified: stable/8/sys/dev/bge/if_bge.c
==============================================================================
--- stable/8/sys/dev/bge/if_bge.c	Wed Jul 10 01:26:22 2013	(r253126)
+++ stable/8/sys/dev/bge/if_bge.c	Wed Jul 10 01:27:05 2013	(r253127)
@@ -2400,7 +2400,7 @@ bge_blockinit(struct bge_softc *sc)
 	DELAY(40);
 
 	/* Set misc. local control, enable interrupts on attentions */
-	CSR_WRITE_4(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_ONATTN);
+	BGE_SETBIT(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_ONATTN);
 
 #ifdef notdef
 	/* Assert GPIO pins for PHY reset */

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Jul 10 01:30:36 2013
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 6ABA5AA7;
 Wed, 10 Jul 2013 01:30:36 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 5D6FC1AB3;
 Wed, 10 Jul 2013 01:30:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6A1UaTJ023120;
 Wed, 10 Jul 2013 01:30:36 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6A1Uap3023118;
 Wed, 10 Jul 2013 01:30:36 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307100130.r6A1Uap3023118@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 10 Jul 2013 01:30:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253129 - stable/8/sys/dev/bce
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
X-List-Received-Date: Wed, 10 Jul 2013 01:30:36 -0000

Author: yongari
Date: Wed Jul 10 01:30:35 2013
New Revision: 253129
URL: http://svnweb.freebsd.org/changeset/base/253129

Log:
  MFC r252402:
    Fix triggering false watchdog timeout when controller is in PAUSE
    state.  Previously it used to check if controller has sent a
    PAUSE frame to the remote peer.

Modified:
  stable/8/sys/dev/bce/if_bce.c
  stable/8/sys/dev/bce/if_bcereg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/bce/   (props changed)

Modified: stable/8/sys/dev/bce/if_bce.c
==============================================================================
--- stable/8/sys/dev/bce/if_bce.c	Wed Jul 10 01:29:51 2013	(r253128)
+++ stable/8/sys/dev/bce/if_bce.c	Wed Jul 10 01:30:35 2013	(r253129)
@@ -2097,10 +2097,12 @@ bce_miibus_statchg(device_t dev)
 		DBPRINT(sc, BCE_INFO_PHY,
 		    "%s(): Enabling RX flow control.\n", __FUNCTION__);
 		BCE_SETBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN);
+		sc->bce_flags |= BCE_USING_RX_FLOW_CONTROL;
 	} else {
 		DBPRINT(sc, BCE_INFO_PHY,
 		    "%s(): Disabling RX flow control.\n", __FUNCTION__);
 		BCE_CLRBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN);
+		sc->bce_flags &= ~BCE_USING_RX_FLOW_CONTROL;
 	}
 
 	if ((IFM_OPTIONS(media_active) & IFM_ETH_TXPAUSE) != 0) {
@@ -7889,18 +7891,42 @@ bce_ioctl(struct ifnet *ifp, u_long comm
 static void
 bce_watchdog(struct bce_softc *sc)
 {
+	uint32_t status;
+
 	DBENTER(BCE_EXTREME_SEND);
 
 	BCE_LOCK_ASSERT(sc);
 
+	status = 0;
 	/* If the watchdog timer hasn't expired then just exit. */
 	if (sc->watchdog_timer == 0 || --sc->watchdog_timer)
 		goto bce_watchdog_exit;
 
+	status = REG_RD(sc, BCE_EMAC_RX_STATUS);
 	/* If pause frames are active then don't reset the hardware. */
-	/* ToDo: Should we reset the timer here? */
-	if (REG_RD(sc, BCE_EMAC_TX_STATUS) & BCE_EMAC_TX_STATUS_XOFFED)
-		goto bce_watchdog_exit;
+	if ((sc->bce_flags & BCE_USING_RX_FLOW_CONTROL) != 0) {
+		if ((status & BCE_EMAC_RX_STATUS_FFED) != 0) {
+			/*
+			 * If link partner has us in XOFF state then wait for
+			 * the condition to clear.
+			 */
+			sc->watchdog_timer = BCE_TX_TIMEOUT;
+			goto bce_watchdog_exit;
+		} else if ((status & BCE_EMAC_RX_STATUS_FF_RECEIVED) != 0 &&
+			(status & BCE_EMAC_RX_STATUS_N_RECEIVED) != 0) {
+			/*
+			 * If we're not currently XOFF'ed but have recently
+			 * been XOFF'd/XON'd then assume that's delaying TX
+			 * this time around.
+			 */
+			sc->watchdog_timer = BCE_TX_TIMEOUT;
+			goto bce_watchdog_exit;
+		}
+		/*
+		 * Any other condition is unexpected and the controller
+		 * should be reset.
+		 */
+	}
 
 	BCE_PRINTF("%s(%d): Watchdog timeout occurred, resetting!\n",
 	    __FILE__, __LINE__);
@@ -7924,6 +7950,7 @@ bce_watchdog(struct bce_softc *sc)
 	sc->bce_ifp->if_oerrors++;
 
 bce_watchdog_exit:
+	REG_WR(sc, BCE_EMAC_RX_STATUS, status);
 	DBEXIT(BCE_EXTREME_SEND);
 }
 

Modified: stable/8/sys/dev/bce/if_bcereg.h
==============================================================================
--- stable/8/sys/dev/bce/if_bcereg.h	Wed Jul 10 01:29:51 2013	(r253128)
+++ stable/8/sys/dev/bce/if_bcereg.h	Wed Jul 10 01:30:35 2013	(r253129)
@@ -6470,6 +6470,7 @@ struct bce_softc
 #define BCE_USING_MSIX_FLAG			0x00000100
 #define BCE_PCIE_FLAG				0x00000200
 #define BCE_USING_TX_FLOW_CONTROL		0x00000400
+#define BCE_USING_RX_FLOW_CONTROL		0x00000800
 
 	/* Controller capability flags. */
 	u32			bce_cap_flags;

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Jul 10 01:33:50 2013
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 17A4EF11;
 Wed, 10 Jul 2013 01:33:50 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id E3DD51AE9;
 Wed, 10 Jul 2013 01:33:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6A1Xn5a025295;
 Wed, 10 Jul 2013 01:33:49 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6A1Xnkc025293;
 Wed, 10 Jul 2013 01:33:49 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307100133.r6A1Xnkc025293@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 10 Jul 2013 01:33:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253131 - stable/8/sys/dev/bge
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
X-List-Received-Date: Wed, 10 Jul 2013 01:33:50 -0000

Author: yongari
Date: Wed Jul 10 01:33:49 2013
New Revision: 253131
URL: http://svnweb.freebsd.org/changeset/base/253131

Log:
  MFC r252404:
    Fix triggering false watchdog timeout as done in bce(4) when
    controller is in PAUSE state.

Modified:
  stable/8/sys/dev/bge/if_bge.c
  stable/8/sys/dev/bge/if_bgereg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/bge/   (props changed)

Modified: stable/8/sys/dev/bge/if_bge.c
==============================================================================
--- stable/8/sys/dev/bge/if_bge.c	Wed Jul 10 01:32:58 2013	(r253130)
+++ stable/8/sys/dev/bge/if_bge.c	Wed Jul 10 01:33:49 2013	(r253131)
@@ -5309,7 +5309,7 @@ bge_start_locked(struct ifnet *ifp)
 		/*
 		 * Set a timeout in case the chip goes out to lunch.
 		 */
-		sc->bge_timer = 5;
+		sc->bge_timer = BGE_TX_TIMEOUT;
 	}
 }
 
@@ -5814,12 +5814,40 @@ static void
 bge_watchdog(struct bge_softc *sc)
 {
 	struct ifnet *ifp;
+	uint32_t status;
 
 	BGE_LOCK_ASSERT(sc);
 
 	if (sc->bge_timer == 0 || --sc->bge_timer)
 		return;
 
+	/* If pause frames are active then don't reset the hardware. */
+	if ((CSR_READ_4(sc, BGE_RX_MODE) & BGE_RXMODE_FLOWCTL_ENABLE) != 0) {
+		status = CSR_READ_4(sc, BGE_RX_STS);
+		if ((status & BGE_RXSTAT_REMOTE_XOFFED) != 0) {
+			/*
+			 * If link partner has us in XOFF state then wait for
+			 * the condition to clear.
+			 */
+			CSR_WRITE_4(sc, BGE_RX_STS, status);
+			sc->bge_timer = BGE_TX_TIMEOUT;
+			return;
+		} else if ((status & BGE_RXSTAT_RCVD_XOFF) != 0 &&
+		    (status & BGE_RXSTAT_RCVD_XON) != 0) {
+			/*
+			 * If link partner has us in XOFF state then wait for
+			 * the condition to clear.
+			 */
+			CSR_WRITE_4(sc, BGE_RX_STS, status);
+			sc->bge_timer = BGE_TX_TIMEOUT;
+			return;
+		}
+		/*
+		 * Any other condition is unexpected and the controller
+		 * should be reset.
+		 */
+	}
+
 	ifp = sc->bge_ifp;
 
 	if_printf(ifp, "watchdog timeout -- resetting\n");

Modified: stable/8/sys/dev/bge/if_bgereg.h
==============================================================================
--- stable/8/sys/dev/bge/if_bgereg.h	Wed Jul 10 01:32:58 2013	(r253130)
+++ stable/8/sys/dev/bge/if_bgereg.h	Wed Jul 10 01:33:49 2013	(r253131)
@@ -2928,6 +2928,7 @@ struct bge_dmamap_arg {
 #define	BGE_HWREV_TIGON_II	0x02
 #define	BGE_TIMEOUT		100000
 #define	BGE_TXCONS_UNSET		0xFFFF	/* impossible value */
+#define	BGE_TX_TIMEOUT		5
 
 struct bge_bcom_hack {
 	int			reg;

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Jul 11 08:18:46 2013
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 9B5B8FB7;
 Thu, 11 Jul 2013 08:18:46 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 8DDA61A2D;
 Thu, 11 Jul 2013 08:18:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B8IkH0087889;
 Thu, 11 Jul 2013 08:18:46 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B8Ikvu087888;
 Thu, 11 Jul 2013 08:18:46 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307110818.r6B8Ikvu087888@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Thu, 11 Jul 2013 08:18:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253196 - stable/8/sys/dev/bge
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
X-List-Received-Date: Thu, 11 Jul 2013 08:18:46 -0000

Author: yongari
Date: Thu Jul 11 08:18:46 2013
New Revision: 253196
URL: http://svnweb.freebsd.org/changeset/base/253196

Log:
  MFC r245870:
    bge_attach() can fail before attaching mii(4). So make sure to check
    bge_miibus before detaching mii(4).

Modified:
  stable/8/sys/dev/bge/if_bge.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/bge/   (props changed)

Modified: stable/8/sys/dev/bge/if_bge.c
==============================================================================
--- stable/8/sys/dev/bge/if_bge.c	Thu Jul 11 08:18:00 2013	(r253195)
+++ stable/8/sys/dev/bge/if_bge.c	Thu Jul 11 08:18:46 2013	(r253196)
@@ -3924,9 +3924,9 @@ bge_detach(device_t dev)
 	if (sc->bge_tq)
 		taskqueue_drain(sc->bge_tq, &sc->bge_intr_task);
 
-	if (sc->bge_flags & BGE_FLAG_TBI) {
+	if (sc->bge_flags & BGE_FLAG_TBI)
 		ifmedia_removeall(&sc->bge_ifmedia);
-	} else {
+	else if (sc->bge_miibus != NULL) {
 		bus_generic_detach(dev);
 		device_delete_child(dev, sc->bge_miibus);
 	}

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Jul 11 08:42:18 2013
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id F35F2911;
 Thu, 11 Jul 2013 08:42:17 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id E55681B1E;
 Thu, 11 Jul 2013 08:42:17 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B8gHX9096665;
 Thu, 11 Jul 2013 08:42:17 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B8gH1V096664;
 Thu, 11 Jul 2013 08:42:17 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307110842.r6B8gH1V096664@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Thu, 11 Jul 2013 08:42:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253198 - stable/8/sys/dev/bge
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
X-List-Received-Date: Thu, 11 Jul 2013 08:42:18 -0000

Author: yongari
Date: Thu Jul 11 08:42:17 2013
New Revision: 253198
URL: http://svnweb.freebsd.org/changeset/base/253198

Log:
  MFC r245867:
    For 57765 class controllers, set low watermark max receive frames to 1.

Modified:
  stable/8/sys/dev/bge/if_bge.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/bge/   (props changed)

Modified: stable/8/sys/dev/bge/if_bge.c
==============================================================================
--- stable/8/sys/dev/bge/if_bge.c	Thu Jul 11 08:41:45 2013	(r253197)
+++ stable/8/sys/dev/bge/if_bge.c	Thu Jul 11 08:42:17 2013	(r253198)
@@ -5466,7 +5466,7 @@ bge_init_locked(struct bge_softc *sc)
 	 * this number of frames, it will drop subsequent incoming
 	 * frames until the MBUF High Watermark is reached.
 	 */
-	if (sc->bge_asicrev == BGE_ASICREV_BCM57765)
+	if (BGE_IS_57765_PLUS(sc))
 		CSR_WRITE_4(sc, BGE_MAX_RX_FRAME_LOWAT, 1);
 	else
 		CSR_WRITE_4(sc, BGE_MAX_RX_FRAME_LOWAT, 2);

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Jul 11 08:50:31 2013
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 07ACBCD9;
 Thu, 11 Jul 2013 08:50:31 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id ED21F1BA7;
 Thu, 11 Jul 2013 08:50:30 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B8oUdG099291;
 Thu, 11 Jul 2013 08:50:30 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B8oUQP099290;
 Thu, 11 Jul 2013 08:50:30 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307110850.r6B8oUQP099290@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Thu, 11 Jul 2013 08:50:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253199 - stable/8/sys/dev/bge
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
X-List-Received-Date: Thu, 11 Jul 2013 08:50:31 -0000

Author: yongari
Date: Thu Jul 11 08:50:30 2013
New Revision: 253199
URL: http://svnweb.freebsd.org/changeset/base/253199

Log:
  MFC r245926, r245931
    - Improve some comments.
    - Make bge_lookup_{rev,vendor}() static.
    - Factor out chip identification rather than duplicating the code.
    - Sanitize bge_probe() a bit (don't hardcode buffer sizes, allow
      bge_lookup_vendor() to return NULL so the excessive panic() can
      be removed there, etc.) and return BUS_PROBE_DEFAULT rather than
      hardcoding 0.
    - According to the Linux tg3 driver, BCM57791 and BCM57795 aren't
      capable of Gigabit Ethernet.
    - Check the return value of taskqueue_start_threads().
    - Mention NetLink controllers in the fallback description, too.

Modified:
  stable/8/sys/dev/bge/if_bge.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/bge/   (props changed)

Modified: stable/8/sys/dev/bge/if_bge.c
==============================================================================
--- stable/8/sys/dev/bge/if_bge.c	Thu Jul 11 08:42:17 2013	(r253198)
+++ stable/8/sys/dev/bge/if_bge.c	Thu Jul 11 08:50:30 2013	(r253199)
@@ -35,10 +35,10 @@
 __FBSDID("$FreeBSD$");
 
 /*
- * Broadcom BCM570x family gigabit ethernet driver for FreeBSD.
+ * Broadcom BCM57xx(x)/BCM590x NetXtreme and NetLink family Ethernet driver
  *
  * The Broadcom BCM5700 is based on technology originally developed by
- * Alteon Networks as part of the Tigon I and Tigon II gigabit ethernet
+ * Alteon Networks as part of the Tigon I and Tigon II Gigabit Ethernet
  * MAC chips. The BCM5700, sometimes referred to as the Tigon III, has
  * two on-board MIPS R4000 CPUs and can have as much as 16MB of external
  * SSRAM. The BCM5700 supports TCP, UDP and IP checksum offload, jumbo
@@ -367,8 +367,9 @@ static const struct bge_revision bge_maj
 #define	BGE_IS_5717_PLUS(sc)		((sc)->bge_flags & BGE_FLAG_5717_PLUS)
 #define	BGE_IS_57765_PLUS(sc)		((sc)->bge_flags & BGE_FLAG_57765_PLUS)
 
-const struct bge_revision * bge_lookup_rev(uint32_t);
-const struct bge_vendor * bge_lookup_vendor(uint16_t);
+static uint32_t bge_chipid(device_t);
+static const struct bge_vendor * bge_lookup_vendor(uint16_t);
+static const struct bge_revision * bge_lookup_rev(uint32_t);
 
 typedef int	(*bge_eaddr_fcn_t)(struct bge_softc *, uint8_t[]);
 
@@ -1916,7 +1917,7 @@ bge_chipinit(struct bge_softc *sc)
 	PCI_CLRBIT(sc->bge_dev, BGE_PCI_CMD,
 	    PCIM_CMD_INTxDIS | PCIM_CMD_MWIEN, 4);
 
-	/* Set the timer prescaler (always 66Mhz) */
+	/* Set the timer prescaler (always 66 MHz). */
 	CSR_WRITE_4(sc, BGE_MISC_CFG, BGE_32BITTIME_66MHZ);
 
 	/* XXX: The Linux tg3 driver does this at the start of brgphy_reset. */
@@ -2586,7 +2587,7 @@ bge_blockinit(struct bge_softc *sc)
 	return (0);
 }
 
-const struct bge_revision *
+static const struct bge_revision *
 bge_lookup_rev(uint32_t chipid)
 {
 	const struct bge_revision *br;
@@ -2604,7 +2605,7 @@ bge_lookup_rev(uint32_t chipid)
 	return (NULL);
 }
 
-const struct bge_vendor *
+static const struct bge_vendor *
 bge_lookup_vendor(uint16_t vid)
 {
 	const struct bge_vendor *v;
@@ -2613,10 +2614,47 @@ bge_lookup_vendor(uint16_t vid)
 		if (v->v_id == vid)
 			return (v);
 
-	panic("%s: unknown vendor %d", __func__, vid);
 	return (NULL);
 }
 
+static uint32_t
+bge_chipid(device_t dev)
+{
+	uint32_t id;
+
+	id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >>
+	    BGE_PCIMISCCTL_ASICREV_SHIFT;
+	if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) {
+		/*
+		 * Find the ASCI revision.  Different chips use different
+		 * registers.
+		 */
+		switch (pci_get_device(dev)) {
+		case BCOM_DEVICEID_BCM5717:
+		case BCOM_DEVICEID_BCM5718:
+		case BCOM_DEVICEID_BCM5719:
+		case BCOM_DEVICEID_BCM5720:
+			id = pci_read_config(dev,
+			    BGE_PCI_GEN2_PRODID_ASICREV, 4);
+			break;
+		case BCOM_DEVICEID_BCM57761:
+		case BCOM_DEVICEID_BCM57762:
+		case BCOM_DEVICEID_BCM57765:
+		case BCOM_DEVICEID_BCM57766:
+		case BCOM_DEVICEID_BCM57781:
+		case BCOM_DEVICEID_BCM57785:
+		case BCOM_DEVICEID_BCM57791:
+		case BCOM_DEVICEID_BCM57795:
+			id = pci_read_config(dev,
+			    BGE_PCI_GEN15_PRODID_ASICREV, 4);
+			break;
+		default:
+			id = pci_read_config(dev, BGE_PCI_PRODID_ASICREV, 4);
+		}
+	}
+	return (id);
+}
+
 /*
  * Probe for a Broadcom chip. Check the PCI vendor and device IDs
  * against our list and return its name if we find a match.
@@ -2634,61 +2672,34 @@ bge_probe(device_t dev)
 	char model[64];
 	const struct bge_revision *br;
 	const char *pname;
-	struct bge_softc *sc = device_get_softc(dev);
+	struct bge_softc *sc;
 	const struct bge_type *t = bge_devs;
 	const struct bge_vendor *v;
 	uint32_t id;
 	uint16_t did, vid;
 
+	sc = device_get_softc(dev);
 	sc->bge_dev = dev;
 	vid = pci_get_vendor(dev);
 	did = pci_get_device(dev);
 	while(t->bge_vid != 0) {
 		if ((vid == t->bge_vid) && (did == t->bge_did)) {
-			id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >>
-			    BGE_PCIMISCCTL_ASICREV_SHIFT;
-			if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) {
-				/*
-				 * Find the ASCI revision.  Different chips
-				 * use different registers.
-				 */
-				switch (pci_get_device(dev)) {
-				case BCOM_DEVICEID_BCM5717:
-				case BCOM_DEVICEID_BCM5718:
-				case BCOM_DEVICEID_BCM5719:
-				case BCOM_DEVICEID_BCM5720:
-					id = pci_read_config(dev,
-					    BGE_PCI_GEN2_PRODID_ASICREV, 4);
-					break;
-				case BCOM_DEVICEID_BCM57761:
-				case BCOM_DEVICEID_BCM57762:
-				case BCOM_DEVICEID_BCM57765:
-				case BCOM_DEVICEID_BCM57766:
-				case BCOM_DEVICEID_BCM57781:
-				case BCOM_DEVICEID_BCM57785:
-				case BCOM_DEVICEID_BCM57791:
-				case BCOM_DEVICEID_BCM57795:
-					id = pci_read_config(dev,
-					    BGE_PCI_GEN15_PRODID_ASICREV, 4);
-					break;
-				default:
-					id = pci_read_config(dev,
-					    BGE_PCI_PRODID_ASICREV, 4);
-				}
-			}
+			id = bge_chipid(dev);
 			br = bge_lookup_rev(id);
-			v = bge_lookup_vendor(vid);
 			if (bge_has_eaddr(sc) &&
 			    pci_get_vpd_ident(dev, &pname) == 0)
-				snprintf(model, 64, "%s", pname);
-			else
-				snprintf(model, 64, "%s %s", v->v_name,
+				snprintf(model, sizeof(model), "%s", pname);
+			else {
+				v = bge_lookup_vendor(vid);
+				snprintf(model, sizeof(model), "%s %s",
+				    v != NULL ? v->v_name : "Unknown",
 				    br != NULL ? br->br_name :
-				    "NetXtreme Ethernet Controller");
-			snprintf(buf, 96, "%s, %sASIC rev. %#08x", model,
-			    br != NULL ? "" : "unknown ", id);
+				    "NetXtreme/NetLink Ethernet Controller");
+			}
+			snprintf(buf, sizeof(buf), "%s, %sASIC rev. %#08x",
+			    model, br != NULL ? "" : "unknown ", id);
 			device_set_desc_copy(dev, buf);
-			return (0);
+			return (BUS_PROBE_DEFAULT);
 		}
 		t++;
 	}
@@ -3272,38 +3283,7 @@ bge_attach(device_t dev)
 
 	/* Save various chip information. */
 	sc->bge_func_addr = pci_get_function(dev);
-	sc->bge_chipid =
-	    pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >>
-	    BGE_PCIMISCCTL_ASICREV_SHIFT;
-	if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_USE_PRODID_REG) {
-		/*
-		 * Find the ASCI revision.  Different chips use different
-		 * registers.
-		 */
-		switch (pci_get_device(dev)) {
-		case BCOM_DEVICEID_BCM5717:
-		case BCOM_DEVICEID_BCM5718:
-		case BCOM_DEVICEID_BCM5719:
-		case BCOM_DEVICEID_BCM5720:
-			sc->bge_chipid = pci_read_config(dev,
-			    BGE_PCI_GEN2_PRODID_ASICREV, 4);
-			break;
-		case BCOM_DEVICEID_BCM57761:
-		case BCOM_DEVICEID_BCM57762:
-		case BCOM_DEVICEID_BCM57765:
-		case BCOM_DEVICEID_BCM57766:
-		case BCOM_DEVICEID_BCM57781:
-		case BCOM_DEVICEID_BCM57785:
-		case BCOM_DEVICEID_BCM57791:
-		case BCOM_DEVICEID_BCM57795:
-			sc->bge_chipid = pci_read_config(dev,
-			    BGE_PCI_GEN15_PRODID_ASICREV, 4);
-			break;
-		default:
-			sc->bge_chipid = pci_read_config(dev,
-			    BGE_PCI_PRODID_ASICREV, 4);
-		}
-	}
+	sc->bge_chipid = bge_chipid(dev);
 	sc->bge_asicrev = BGE_ASICREV(sc->bge_chipid);
 	sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid);
 
@@ -3493,6 +3473,8 @@ bge_attach(device_t dev)
 	    pci_get_device(dev) == BCOM_DEVICEID_BCM5753F ||
 	    pci_get_device(dev) == BCOM_DEVICEID_BCM5787F)) ||
 	    pci_get_device(dev) == BCOM_DEVICEID_BCM57790 ||
+	    pci_get_device(dev) == BCOM_DEVICEID_BCM57791 ||
+	    pci_get_device(dev) == BCOM_DEVICEID_BCM57795 ||
 	    sc->bge_asicrev == BGE_ASICREV_BCM5906) {
 		/* These chips are 10/100 only. */
 		capmask &= ~BMSR_EXTSTAT;
@@ -3504,8 +3486,8 @@ bge_attach(device_t dev)
 	 * TSO. But the firmware is not available to FreeBSD and Linux
 	 * claims that the TSO performed by the firmware is slower than
 	 * hardware based TSO. Moreover the firmware based TSO has one
-	 * known bug which can't handle TSO if ethernet header + IP/TCP
-	 * header is greater than 80 bytes. The workaround for the TSO
+	 * known bug which can't handle TSO if Ethernet header + IP/TCP
+	 * header is greater than 80 bytes. A workaround for the TSO
 	 * bug exist but it seems it's too expensive than not using
 	 * TSO at all. Some hardwares also have the TSO bug so limit
 	 * the TSO to the controllers that are not affected TSO issues
@@ -3878,8 +3860,13 @@ again:
 			error = ENOMEM;
 			goto fail;
 		}
-		taskqueue_start_threads(&sc->bge_tq, 1, PI_NET, "%s taskq",
-		    device_get_nameunit(sc->bge_dev));
+		error = taskqueue_start_threads(&sc->bge_tq, 1, PI_NET,
+		    "%s taskq", device_get_nameunit(sc->bge_dev));
+		if (error != 0) {
+			device_printf(dev, "could not start threads.\n");
+			ether_ifdetach(ifp);
+			goto fail;
+		}
 		error = bus_setup_intr(dev, sc->bge_irq,
 		    INTR_TYPE_NET | INTR_MPSAFE, bge_msi_intr, NULL, sc,
 		    &sc->bge_intrhand);

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Jul 11 09:13:06 2013
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 988144E0;
 Thu, 11 Jul 2013 09:13:06 +0000 (UTC) (envelope-from smh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 8A6841CC8;
 Thu, 11 Jul 2013 09:13:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B9D6I7006062;
 Thu, 11 Jul 2013 09:13:06 GMT (envelope-from smh@svn.freebsd.org)
Received: (from smh@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B9D6nE006059;
 Thu, 11 Jul 2013 09:13:06 GMT (envelope-from smh@svn.freebsd.org)
Message-Id: <201307110913.r6B9D6nE006059@svn.freebsd.org>
From: Steven Hartland 
Date: Thu, 11 Jul 2013 09:13:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253201 - in stable/8/sys/cam: ata scsi
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
X-List-Received-Date: Thu, 11 Jul 2013 09:13:06 -0000

Author: smh
Date: Thu Jul 11 09:13:05 2013
New Revision: 253201
URL: http://svnweb.freebsd.org/changeset/base/253201

Log:
  MFC r253091:
  Added 4K QUIRK for OCZ Vertex 4 SSDs

Modified:
  stable/8/sys/cam/ata/ata_da.c
  stable/8/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/cam/   (props changed)

Modified: stable/8/sys/cam/ata/ata_da.c
==============================================================================
--- stable/8/sys/cam/ata/ata_da.c	Thu Jul 11 09:10:17 2013	(r253200)
+++ stable/8/sys/cam/ata/ata_da.c	Thu Jul 11 09:13:05 2013	(r253201)
@@ -396,6 +396,14 @@ static struct ada_quirk_entry ada_quirk_
 	},
 	{
 		/*
+		 * OCZ Vertex 4 SSDs
+		 * 4k optimised & trim only works in 4k requests + 4k aligned
+		 */
+		{ T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-VERTEX4*", "*" },
+		/*quirks*/ADA_Q_4K
+	},
+	{
+		/*
 		 * Samsung 830 Series SSDs
 		 * 4k optimised
 		 */

Modified: stable/8/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/8/sys/cam/scsi/scsi_da.c	Thu Jul 11 09:10:17 2013	(r253200)
+++ stable/8/sys/cam/scsi/scsi_da.c	Thu Jul 11 09:13:05 2013	(r253201)
@@ -1020,6 +1020,14 @@ static struct da_quirk_entry da_quirk_ta
 	},
 	{
 		/*
+		 * OCZ Vertex 4 SSDs
+		 * 4k optimised & trim only works in 4k requests + 4k aligned
+		 */
+		{ T_DIRECT, SIP_MEDIA_FIXED, "ATA", "OCZ-VERTEX4*", "*" },
+		/*quirks*/DA_Q_4K
+	},
+	{
+		/*
 		 * Samsung 830 Series SSDs
 		 * 4k optimised & trim only works in 4k requests + 4k aligned
 		 */

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Jul 12 00:59:04 2013
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 0D3E7715;
 Fri, 12 Jul 2013 00:59:04 +0000 (UTC)
 (envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id D9F3B1FF6;
 Fri, 12 Jul 2013 00:59:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C0x302088327;
 Fri, 12 Jul 2013 00:59:03 GMT
 (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C0x39m088326;
 Fri, 12 Jul 2013 00:59:03 GMT
 (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201307120059.r6C0x39m088326@svn.freebsd.org>
From: Rick Macklem 
Date: Fri, 12 Jul 2013 00:59:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253229 - stable/8/sys/nfsclient
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
X-List-Received-Date: Fri, 12 Jul 2013 00:59:04 -0000

Author: rmacklem
Date: Fri Jul 12 00:59:03 2013
New Revision: 253229
URL: http://svnweb.freebsd.org/changeset/base/253229

Log:
  MFC: r252673
  A problem with the old NFS client where large writes to large files
  would sometimes result in a corrupted file was reported via email.
  This problem appears to have been caused by r251719 (reverting
  r251719 fixed the problem). Although I have not been able to
  reproduce this problem, I suspect it is caused by another thread
  increasing np->n_size after the mtx_unlock(&np->n_mtx) but before
  the vnode_pager_setsize() call. Since the np->n_mtx mutex serializes
  updates to np->n_size, doing the vnode_pager_setsize() with the
  mutex locked appears to avoid the problem.
  Unfortunately, vnode_pager_setsize() where the new size is smaller,
  cannot be called with a mutex held.
  This patch returns the semantics to be close to pre-r251719 such that the
  call to the vnode_pager_setsize() is only delayed until after the mutex is
  unlocked when np->n_size is shrinking. Since the file is growing
  when being written, I believe this will fix the corruption.
  
  Tested by:	remy.nonnenmacher@activnetworks.com

Modified:
  stable/8/sys/nfsclient/nfs_subs.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/nfsclient/   (props changed)

Modified: stable/8/sys/nfsclient/nfs_subs.c
==============================================================================
--- stable/8/sys/nfsclient/nfs_subs.c	Fri Jul 12 00:50:25 2013	(r253228)
+++ stable/8/sys/nfsclient/nfs_subs.c	Fri Jul 12 00:59:03 2013	(r253229)
@@ -595,6 +595,7 @@ nfs_loadattrcache(struct vnode **vpp, st
 				vap->va_size = np->n_size;
 				np->n_attrstamp = 0;
 				KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
+				vnode_pager_setsize(vp, np->n_size);
 			} else if (np->n_flag & NMODIFIED) {
 				/*
 				 * We've modified the file: Use the larger
@@ -606,12 +607,22 @@ nfs_loadattrcache(struct vnode **vpp, st
 					np->n_size = vap->va_size;
 					np->n_flag |= NSIZECHANGED;
 				}
+				vnode_pager_setsize(vp, np->n_size);
+			} else if (vap->va_size < np->n_size) {
+				/*
+				 * When shrinking the size, the call to
+				 * vnode_pager_setsize() cannot be done
+				 * with the mutex held, so delay it until
+				 * after the mtx_unlock call.
+				 */
+				nsize = np->n_size = vap->va_size;
+				np->n_flag |= NSIZECHANGED;
+				setnsize = 1;
 			} else {
 				np->n_size = vap->va_size;
 				np->n_flag |= NSIZECHANGED;
+				vnode_pager_setsize(vp, np->n_size);
 			}
-			setnsize = 1;
-			nsize = vap->va_size;
 		} else {
 			np->n_size = vap->va_size;
 		}

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Jul 12 02:28:36 2013
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 3996A48A;
 Fri, 12 Jul 2013 02:28:36 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 2BF191291;
 Fri, 12 Jul 2013 02:28:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C2SaTj016402;
 Fri, 12 Jul 2013 02:28:36 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C2SaO5016401;
 Fri, 12 Jul 2013 02:28:36 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307120228.r6C2SaO5016401@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 12 Jul 2013 02:28:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253246 - stable/8/sys/dev/hme
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
X-List-Received-Date: Fri, 12 Jul 2013 02:28:36 -0000

Author: yongari
Date: Fri Jul 12 02:28:35 2013
New Revision: 253246
URL: http://svnweb.freebsd.org/changeset/base/253246

Log:
  MFC r253134:
    Avoid controller reinitialization which could be triggered by
    dhclient(8) or alias addresses are added.

Modified:
  stable/8/sys/dev/hme/if_hme.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/hme/   (props changed)

Modified: stable/8/sys/dev/hme/if_hme.c
==============================================================================
--- stable/8/sys/dev/hme/if_hme.c	Fri Jul 12 02:28:01 2013	(r253245)
+++ stable/8/sys/dev/hme/if_hme.c	Fri Jul 12 02:28:35 2013	(r253246)
@@ -742,6 +742,10 @@ hme_init_locked(struct hme_softc *sc)
 	u_int32_t n, v;
 
 	HME_LOCK_ASSERT(sc, MA_OWNED);
+
+	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+		return;
+
 	/*
 	 * Initialization sequence. The numbered steps below correspond
 	 * to the sequence outlined in section 6.3.5.1 in the Ethernet
@@ -1324,6 +1328,7 @@ hme_eint(struct hme_softc *sc, u_int sta
 	/* check for fatal errors that needs reset to unfreeze DMA engine */
 	if ((status & HME_SEB_STAT_FATAL_ERRORS) != 0) {
 		HME_WHINE(sc->sc_dev, "error signaled, status=%#x\n", status);
+		sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 		hme_init_locked(sc);
 	}
 }
@@ -1370,6 +1375,7 @@ hme_watchdog(struct hme_softc *sc)
 		device_printf(sc->sc_dev, "device timeout (no link)\n");
 	++ifp->if_oerrors;
 
+	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 	hme_init_locked(sc);
 	hme_start_locked(ifp);
 	return (EJUSTRETURN);

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Jul 12 13:51:20 2013
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 59065B13;
 Fri, 12 Jul 2013 13:51:20 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 4AF0717AF;
 Fri, 12 Jul 2013 13:51:20 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CDpKtx018321;
 Fri, 12 Jul 2013 13:51:20 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CDpKjA018320;
 Fri, 12 Jul 2013 13:51:20 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201307121351.r6CDpKjA018320@svn.freebsd.org>
From: Michael Tuexen 
Date: Fri, 12 Jul 2013 13:51:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253264 - stable/8/lib/libc/net
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
X-List-Received-Date: Fri, 12 Jul 2013 13:51:20 -0000

Author: tuexen
Date: Fri Jul 12 13:51:19 2013
New Revision: 253264
URL: http://svnweb.freebsd.org/changeset/base/253264

Log:
  MFC r253104:
  Fix a bug where SCTP_ENABLE_STREAM_RESET is not handled by
  sctp_opt_info().

Modified:
  stable/8/lib/libc/net/sctp_sys_calls.c
Directory Properties:
  stable/8/lib/   (props changed)
  stable/8/lib/libc/   (props changed)

Modified: stable/8/lib/libc/net/sctp_sys_calls.c
==============================================================================
--- stable/8/lib/libc/net/sctp_sys_calls.c	Fri Jul 12 12:40:21 2013	(r253263)
+++ stable/8/lib/libc/net/sctp_sys_calls.c	Fri Jul 12 13:51:19 2013	(r253264)
@@ -335,6 +335,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i
 	case SCTP_REMOTE_UDP_ENCAPS_PORT:
 		((struct sctp_udpencaps *)arg)->sue_assoc_id = id;
 		break;
+	case SCTP_ENABLE_STREAM_RESET:
+		((struct sctp_assoc_value *)arg)->assoc_id = id;
+		break;
 	default:
 		break;
 	}

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Jul 12 13:52:27 2013
Return-Path: 
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 93454C47;
 Fri, 12 Jul 2013 13:52:27 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 8589217B9;
 Fri, 12 Jul 2013 13:52:27 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CDqRiM018501;
 Fri, 12 Jul 2013 13:52:27 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CDqRjV018500;
 Fri, 12 Jul 2013 13:52:27 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201307121352.r6CDqRjV018500@svn.freebsd.org>
From: Michael Tuexen 
Date: Fri, 12 Jul 2013 13:52:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253265 - stable/8/lib/libc/net
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
X-List-Received-Date: Fri, 12 Jul 2013 13:52:27 -0000

Author: tuexen
Date: Fri Jul 12 13:52:27 2013
New Revision: 253265
URL: http://svnweb.freebsd.org/changeset/base/253265

Log:
  MFC r253105:
  Fix the handling of SCTP_CURRENT_ASSOC and SCTP_ALL_ASSOC in
  sctp_opt_info().

Modified:
  stable/8/lib/libc/net/sctp_sys_calls.c
Directory Properties:
  stable/8/lib/   (props changed)
  stable/8/lib/libc/   (props changed)

Modified: stable/8/lib/libc/net/sctp_sys_calls.c
==============================================================================
--- stable/8/lib/libc/net/sctp_sys_calls.c	Fri Jul 12 13:51:19 2013	(r253264)
+++ stable/8/lib/libc/net/sctp_sys_calls.c	Fri Jul 12 13:52:27 2013	(r253265)
@@ -274,6 +274,11 @@ sctp_opt_info(int sd, sctp_assoc_t id, i
 		errno = EINVAL;
 		return (-1);
 	}
+	if ((id == SCTP_CURRENT_ASSOC) ||
+	    (id == SCTP_ALL_ASSOC)) {
+		errno = EINVAL;
+		return (-1);
+	}
 	switch (opt) {
 	case SCTP_RTOINFO:
 		((struct sctp_rtoinfo *)arg)->srto_assoc_id = id;