From owner-svn-src-stable-7@FreeBSD.ORG Mon Nov 15 23:57:07 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D71D1065675; Mon, 15 Nov 2010 23:57:07 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B2FE8FC14; Mon, 15 Nov 2010 23:57:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAFNv6S4032753; Mon, 15 Nov 2010 23:57:06 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAFNv6CQ032751; Mon, 15 Nov 2010 23:57:06 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201011152357.oAFNv6CQ032751@svn.freebsd.org> From: Lawrence Stewart Date: Mon, 15 Nov 2010 23:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215357 - stable/7/sys/netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2010 23:57:07 -0000 Author: lstewart Date: Mon Nov 15 23:57:06 2010 New Revision: 215357 URL: http://svn.freebsd.org/changeset/base/215357 Log: MFC r215152: The university does not require that its CRICOS number be included in source code. Remove all references from the tree. Modified: stable/7/sys/netinet/siftr.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/siftr.c ============================================================================== --- stable/7/sys/netinet/siftr.c Mon Nov 15 23:51:11 2010 (r215356) +++ stable/7/sys/netinet/siftr.c Mon Nov 15 23:57:06 2010 (r215357) @@ -1,7 +1,6 @@ /*- * Copyright (c) 2007-2009, Centre for Advanced Internet Architectures - * Swinburne University of Technology, Melbourne, Australia - * (CRICOS number 00111D). + * Swinburne University of Technology, Melbourne, Australia. * Copyright (c) 2009-2010, The FreeBSD Foundation * All rights reserved. * From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 16 00:00:32 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4891B1065673; Tue, 16 Nov 2010 00:00:32 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 366348FC1D; Tue, 16 Nov 2010 00:00:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAG00WqQ032916; Tue, 16 Nov 2010 00:00:32 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAG00Wb0032914; Tue, 16 Nov 2010 00:00:32 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201011160000.oAG00Wb0032914@svn.freebsd.org> From: Lawrence Stewart Date: Tue, 16 Nov 2010 00:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215358 - stable/7/sys/netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 00:00:32 -0000 Author: lstewart Date: Tue Nov 16 00:00:31 2010 New Revision: 215358 URL: http://svn.freebsd.org/changeset/base/215358 Log: MFC r215153: Standardise all Swinburne related copyright/licence statements throughout the tree in preparation for another large code import. Swinburne University is the legal entity that owns copyright and the 2-clause BSD licence is acceptable. Modified: stable/7/sys/netinet/siftr.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/siftr.c ============================================================================== --- stable/7/sys/netinet/siftr.c Mon Nov 15 23:57:06 2010 (r215357) +++ stable/7/sys/netinet/siftr.c Tue Nov 16 00:00:31 2010 (r215358) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2007-2009, Centre for Advanced Internet Architectures - * Swinburne University of Technology, Melbourne, Australia. + * Copyright (c) 2007-2009 + * Swinburne University of Technology, Melbourne, Australia. * Copyright (c) 2009-2010, The FreeBSD Foundation * All rights reserved. * From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 16 00:06:20 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F7F2106566B; Tue, 16 Nov 2010 00:06:20 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D0FB8FC08; Tue, 16 Nov 2010 00:06:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAG06Kku033166; Tue, 16 Nov 2010 00:06:20 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAG06Knt033164; Tue, 16 Nov 2010 00:06:20 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201011160006.oAG06Knt033164@svn.freebsd.org> From: Lawrence Stewart Date: Tue, 16 Nov 2010 00:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215360 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 00:06:20 -0000 Author: lstewart Date: Tue Nov 16 00:06:19 2010 New Revision: 215360 URL: http://svn.freebsd.org/changeset/base/215360 Log: MFC r215154: The first releases SIFTR will ship in will be 7.4 and 8.2. Modified: stable/7/share/man/man4/siftr.4 Directory Properties: stable/7/share/man/ (props changed) stable/7/share/man/man1/ (props changed) stable/7/share/man/man3/ (props changed) stable/7/share/man/man4/ (props changed) stable/7/share/man/man5/ (props changed) stable/7/share/man/man7/ (props changed) stable/7/share/man/man8/ (props changed) stable/7/share/man/man9/ (props changed) Modified: stable/7/share/man/man4/siftr.4 ============================================================================== --- stable/7/share/man/man4/siftr.4 Tue Nov 16 00:01:44 2010 (r215359) +++ stable/7/share/man/man4/siftr.4 Tue Nov 16 00:06:19 2010 (r215360) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 25, 2010 +.Dd November 12, 2010 .Dt SIFTR 4 .Os .Sh NAME @@ -610,7 +610,9 @@ and the FreeBSD Foundation. .Sh HISTORY .Nm first appeared in -.Fx 9.0 . +.Fx 7.4 +and +.Fx 8.2 . .Pp .Nm was first released in 2007 by Lawrence Stewart and James Healy whilst working on From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 16 00:32:45 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A84A1065674; Tue, 16 Nov 2010 00:32:45 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DC9E8FC16; Tue, 16 Nov 2010 00:32:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAG0WjFs033800; Tue, 16 Nov 2010 00:32:45 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAG0WjmT033798; Tue, 16 Nov 2010 00:32:45 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011160032.oAG0WjmT033798@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 16 Nov 2010 00:32:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215363 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 00:32:45 -0000 Author: yongari Date: Tue Nov 16 00:32:45 2010 New Revision: 215363 URL: http://svn.freebsd.org/changeset/base/215363 Log: MFC r214968: Use shorten model name instead of showing all controller model numbers. bge(4) supports too many models such that it's unreasonable to list all these controllers in one line description of name. While I'm here mention that BCM590x/BCM5779x is Fast Ethernet controller. bge(4) still lacks support for some controllers but supporting these controllers should be easy now and adding new controllers do not require touching .Nd any more. Obtained from: OpenBSD Modified: stable/7/share/man/man4/bge.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/bge.4 ============================================================================== --- stable/7/share/man/man4/bge.4 Tue Nov 16 00:32:17 2010 (r215362) +++ stable/7/share/man/man4/bge.4 Tue Nov 16 00:32:45 2010 (r215363) @@ -31,12 +31,12 @@ .\" .\" $FreeBSD$ .\" -.Dd August 21, 2010 +.Dd November 7, 2010 .Dt BGE 4 .Os .Sh NAME .Nm bge -.Nd "Broadcom BCM570x/5714/5721/5722/5750/5751/5752/5761/5784/5789/57780 PCI Gigabit Ethernet adapter driver" +.Nd "Broadcom BCM57xx/BCM590x Gigabit/Fast Ethernet driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -56,8 +56,8 @@ if_bge_load="YES" The .Nm driver provides support for various NICs based on the Broadcom BCM570x, -5714, 5721, 5722, 5750, 5751, 5752, 5761, 5784, 5789 and 57780 families -of Gigabit Ethernet controller chips. +571x, 572x, 575x, 576x, 578x, 5776x and 5778x Gigabit Ethernet controller +chips and the 590x and 5779x Fast Ethernet controller chips. .Pp All of these NICs are capable of 10, 100 and 1000Mbps speeds over CAT5 copper cable, except for the SysKonnect SK-9D41 which supports only @@ -82,7 +82,7 @@ copper gigabit transceivers, which support autonegotiation of 10, 100 and 1000Mbps modes in full or half duplex. .Pp -The BCM5700, BCM5701, BCM5702, BCM5703 and BCM5704 also support +The BCM5700, BCM5701, BCM5702, BCM5703, BCM5704 and BCM5717 also support jumbo frames, which can be configured via the interface MTU setting. Selecting an MTU larger than 1500 bytes with the From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 16 03:20:57 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C6C8106566B; Tue, 16 Nov 2010 03:20:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A7348FC12; Tue, 16 Nov 2010 03:20:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAG3KvlN037723; Tue, 16 Nov 2010 03:20:57 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAG3KvXY037721; Tue, 16 Nov 2010 03:20:57 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201011160320.oAG3KvXY037721@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 16 Nov 2010 03:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215366 - stable/7/sys/netipsec X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 03:20:57 -0000 Author: bz Date: Tue Nov 16 03:20:57 2010 New Revision: 215366 URL: http://svn.freebsd.org/changeset/base/215366 Log: MFC r214565: Announce IPsec if available for feature_present(3) checks. Modified: stable/7/sys/netipsec/ipsec.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netipsec/ipsec.c ============================================================================== --- stable/7/sys/netipsec/ipsec.c Tue Nov 16 02:01:12 2010 (r215365) +++ stable/7/sys/netipsec/ipsec.c Tue Nov 16 03:20:57 2010 (r215366) @@ -122,6 +122,8 @@ int ip4_esp_randpad = -1; */ int crypto_support = CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE; +FEATURE(ipsec, "Internet Protocol Security (IPsec)"); + SYSCTL_DECL(_net_inet_ipsec); /* net.inet.ipsec */ From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 16 04:40:05 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E942106564A; Tue, 16 Nov 2010 04:40:05 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E1AB8FC18; Tue, 16 Nov 2010 04:40:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAG4e5fP039492; Tue, 16 Nov 2010 04:40:05 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAG4e3YU039413; Tue, 16 Nov 2010 04:40:03 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201011160440.oAG4e3YU039413@svn.freebsd.org> From: Maxim Sobolev Date: Tue, 16 Nov 2010 04:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215368 - in stable/7/sys: arm/at91 arm/xscale/ixp425 contrib/dev/oltr dev/ae dev/an dev/ar dev/arl dev/ath dev/awi dev/ce dev/cm dev/cnw dev/cp dev/cs dev/ctau dev/cx dev/cxgb dev/ed d... X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 04:40:05 -0000 Author: sobomax Date: Tue Nov 16 04:40:03 2010 New Revision: 215368 URL: http://svn.freebsd.org/changeset/base/215368 Log: MFC r207554: Add new tunable 'net.link.ifqmaxlen' to set default send interface queue length. The default value for this parameter is 50, which is quite low for many of today's uses and the only way to modify this parameter right now is to edit if_var.h file. Also add read-only sysctl with the same name, so that it's possible to retrieve the current value. Modified: stable/7/sys/arm/at91/if_ate.c stable/7/sys/arm/xscale/ixp425/if_npe.c stable/7/sys/contrib/dev/oltr/if_oltr.c stable/7/sys/dev/ae/if_ae.c stable/7/sys/dev/an/if_an.c stable/7/sys/dev/ar/if_ar.c stable/7/sys/dev/arl/if_arl.c stable/7/sys/dev/ath/if_ath.c stable/7/sys/dev/awi/awi.c stable/7/sys/dev/ce/if_ce.c stable/7/sys/dev/cm/smc90cx6.c stable/7/sys/dev/cnw/if_cnw.c stable/7/sys/dev/cp/if_cp.c stable/7/sys/dev/cs/if_cs.c stable/7/sys/dev/ctau/if_ct.c stable/7/sys/dev/cx/if_cx.c stable/7/sys/dev/cxgb/cxgb_main.c stable/7/sys/dev/ed/if_ed.c stable/7/sys/dev/ep/if_ep.c stable/7/sys/dev/ex/if_ex.c stable/7/sys/dev/ie/if_ie.c stable/7/sys/dev/iicbus/if_ic.c stable/7/sys/dev/ipw/if_ipw.c stable/7/sys/dev/iwi/if_iwi.c stable/7/sys/dev/le/lance.c stable/7/sys/dev/malo/if_malo.c stable/7/sys/dev/my/if_my.c stable/7/sys/dev/nxge/if_nxge.c stable/7/sys/dev/pdq/pdq_ifsubr.c stable/7/sys/dev/ppbus/if_plip.c stable/7/sys/dev/ral/rt2560.c stable/7/sys/dev/ral/rt2661.c stable/7/sys/dev/ray/if_ray.c stable/7/sys/dev/sbni/if_sbni.c stable/7/sys/dev/sbsh/if_sbsh.c stable/7/sys/dev/sn/if_sn.c stable/7/sys/dev/snc/dp83932.c stable/7/sys/dev/sr/if_sr.c stable/7/sys/dev/usb/if_aue.c stable/7/sys/dev/usb/if_axe.c stable/7/sys/dev/usb/if_cdce.c stable/7/sys/dev/usb/if_cue.c stable/7/sys/dev/usb/if_kue.c stable/7/sys/dev/usb/if_rue.c stable/7/sys/dev/usb/if_rum.c stable/7/sys/dev/usb/if_udav.c stable/7/sys/dev/usb/if_ural.c stable/7/sys/dev/usb/if_zyd.c stable/7/sys/dev/usb/udbp.c stable/7/sys/dev/vx/if_vx.c stable/7/sys/dev/wi/if_wi.c stable/7/sys/dev/wl/if_wl.c stable/7/sys/dev/wpi/if_wpi.c stable/7/sys/dev/xe/if_xe.c stable/7/sys/i4b/capi/capi_l4if.c stable/7/sys/i4b/driver/i4b_ing.c stable/7/sys/i4b/driver/i4b_isppp.c stable/7/sys/i4b/driver/i4b_trace.c stable/7/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c stable/7/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c stable/7/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c stable/7/sys/i4b/layer1/ihfc/i4b_ihfc_drv.c stable/7/sys/i4b/layer1/isic/i4b_bchan.c stable/7/sys/i4b/layer1/itjc/i4b_itjc_pci.c stable/7/sys/i4b/layer1/iwic/i4b_iwic_bchan.c stable/7/sys/i4b/layer4/i4b_i4bdrv.c stable/7/sys/net/if.c stable/7/sys/net/if_ef.c stable/7/sys/net/if_gif.c stable/7/sys/net/if_gre.c stable/7/sys/net/if_ppp.c stable/7/sys/net/if_stf.c stable/7/sys/netatalk/ddp_usrreq.c stable/7/sys/netgraph/ng_eiface.c stable/7/sys/netgraph/ng_fec.c stable/7/sys/netgraph/ng_iface.c stable/7/sys/netgraph/ng_tty.c stable/7/sys/netinet/ip_input.c stable/7/sys/netinet6/ip6_input.c stable/7/sys/netipx/ipx_input.c stable/7/sys/pci/if_rl.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/arm/at91/if_ate.c ============================================================================== --- stable/7/sys/arm/at91/if_ate.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/arm/at91/if_ate.c Tue Nov 16 04:40:03 2010 (r215368) @@ -231,8 +231,8 @@ ate_attach(device_t dev) ifp->if_ioctl = ateioctl; ifp->if_init = ateinit; ifp->if_baudrate = 10000000; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ifp->if_timer = 0; ifp->if_linkmib = &sc->mibdata; Modified: stable/7/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- stable/7/sys/arm/xscale/ixp425/if_npe.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/arm/xscale/ixp425/if_npe.c Tue Nov 16 04:40:03 2010 (r215368) @@ -335,7 +335,7 @@ npe_attach(device_t dev) ifp->if_ioctl = npeioctl; ifp->if_init = npeinit; IFQ_SET_MAXLEN(&ifp->if_snd, sc->txdma.nbuf - 1); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ifp->if_linkmib = &sc->mibdata; ifp->if_linkmiblen = sizeof(sc->mibdata); Modified: stable/7/sys/contrib/dev/oltr/if_oltr.c ============================================================================== --- stable/7/sys/contrib/dev/oltr/if_oltr.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/contrib/dev/oltr/if_oltr.c Tue Nov 16 04:40:03 2010 (r215368) @@ -171,7 +171,7 @@ oltr_attach(device_t dev) ifp->if_start = oltr_start; ifp->if_ioctl = oltr_ioctl; ifp->if_flags = IFF_BROADCAST | IFF_NEEDSGIANT; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; /* * Do ifmedia setup. Modified: stable/7/sys/dev/ae/if_ae.c ============================================================================== --- stable/7/sys/dev/ae/if_ae.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/ae/if_ae.c Tue Nov 16 04:40:03 2010 (r215368) @@ -375,7 +375,7 @@ ae_attach(device_t dev) ifp->if_init = ae_init; ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING; ifp->if_hwassist = 0; - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); if (pci_find_extcap(dev, PCIY_PMG, &pmc) == 0) { Modified: stable/7/sys/dev/an/if_an.c ============================================================================== --- stable/7/sys/dev/an/if_an.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/an/if_an.c Tue Nov 16 04:40:03 2010 (r215368) @@ -742,8 +742,8 @@ an_attach(struct an_softc *sc, int unit, ifp->if_watchdog = an_watchdog; ifp->if_init = an_init; ifp->if_baudrate = 10000000; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); bzero(sc->an_config.an_nodename, sizeof(sc->an_config.an_nodename)); Modified: stable/7/sys/dev/ar/if_ar.c ============================================================================== --- stable/7/sys/dev/ar/if_ar.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/ar/if_ar.c Tue Nov 16 04:40:03 2010 (r215368) @@ -333,8 +333,8 @@ ar_attach(device_t device) } NG_NODE_SET_PRIVATE(sc->node, sc); callout_handle_init(&sc->handle); - sc->xmitq.ifq_maxlen = IFQ_MAXLEN; - sc->xmitq_hipri.ifq_maxlen = IFQ_MAXLEN; + sc->xmitq.ifq_maxlen = ifqmaxlen; + sc->xmitq_hipri.ifq_maxlen = ifqmaxlen; mtx_init(&sc->xmitq.ifq_mtx, "ar_xmitq", NULL, MTX_DEF); mtx_init(&sc->xmitq_hipri.ifq_mtx, "ar_xmitq_hipri", NULL, MTX_DEF); Modified: stable/7/sys/dev/arl/if_arl.c ============================================================================== --- stable/7/sys/dev/arl/if_arl.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/arl/if_arl.c Tue Nov 16 04:40:03 2010 (r215368) @@ -227,7 +227,7 @@ arl_attach(dev) ifp->if_ioctl = arl_ioctl; ifp->if_watchdog = arl_watchdog; ifp->if_init = arl_init; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_baudrate = 2000000; ifp->if_timer = 0; Modified: stable/7/sys/dev/ath/if_ath.c ============================================================================== --- stable/7/sys/dev/ath/if_ath.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/ath/if_ath.c Tue Nov 16 04:40:03 2010 (r215368) @@ -495,8 +495,8 @@ ath_attach(u_int16_t devid, struct ath_s ifp->if_watchdog = ath_watchdog; ifp->if_ioctl = ath_ioctl; ifp->if_init = ath_init; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic->ic_ifp = ifp; Modified: stable/7/sys/dev/awi/awi.c ============================================================================== --- stable/7/sys/dev/awi/awi.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/awi/awi.c Tue Nov 16 04:40:03 2010 (r215368) @@ -295,7 +295,7 @@ awi_attach(struct awi_softc *sc) #endif #ifdef __FreeBSD__ ifp->if_init = awi_init0; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; if_initname(ifp, device_get_name(sc->sc_dev), device_get_unit(sc->sc_dev)); #endif Modified: stable/7/sys/dev/ce/if_ce.c ============================================================================== --- stable/7/sys/dev/ce/if_ce.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/ce/if_ce.c Tue Nov 16 04:40:03 2010 (r215368) @@ -727,9 +727,9 @@ static int ce_attach (device_t dev) #endif continue; } - d->queue.ifq_maxlen = IFQ_MAXLEN; - d->hi_queue.ifq_maxlen = IFQ_MAXLEN; - d->rqueue.ifq_maxlen = IFQ_MAXLEN; + d->queue.ifq_maxlen = ifqmaxlen; + d->hi_queue.ifq_maxlen = ifqmaxlen; + d->rqueue.ifq_maxlen = ifqmaxlen; #if __FreeBSD_version >= 500000 mtx_init (&d->queue.ifq_mtx, "ce_queue", NULL, MTX_DEF); mtx_init (&d->hi_queue.ifq_mtx, "ce_queue_hi", NULL, MTX_DEF); @@ -763,7 +763,7 @@ static int ce_attach (device_t dev) d->ifp->if_start = ce_ifstart; d->ifp->if_watchdog = ce_ifwatchdog; d->ifp->if_init = ce_initialize; - d->rqueue.ifq_maxlen = IFQ_MAXLEN; + d->rqueue.ifq_maxlen = ifqmaxlen; #if __FreeBSD_version >= 500000 mtx_init (&d->rqueue.ifq_mtx, "ce_rqueue", NULL, MTX_DEF); #endif Modified: stable/7/sys/dev/cm/smc90cx6.c ============================================================================== --- stable/7/sys/dev/cm/smc90cx6.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/cm/smc90cx6.c Tue Nov 16 04:40:03 2010 (r215368) @@ -197,7 +197,7 @@ cm_attach(dev) ifp->if_watchdog = cm_watchdog; ifp->if_init = cm_init; /* XXX IFQ_SET_READY(&ifp->if_snd); */ - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_timer = 0; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX; Modified: stable/7/sys/dev/cnw/if_cnw.c ============================================================================== --- stable/7/sys/dev/cnw/if_cnw.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/cnw/if_cnw.c Tue Nov 16 04:40:03 2010 (r215368) @@ -1666,7 +1666,7 @@ static int cnw_pccard_attach(device_t de ifp->if_watchdog = cnw_watchdog; ifp->if_init = cnw_freebsd_init; ifp->if_baudrate = 1 * 1000* 1000; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; cnw_freebsd_init(sc); cnw_stop(sc); Modified: stable/7/sys/dev/cp/if_cp.c ============================================================================== --- stable/7/sys/dev/cp/if_cp.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/cp/if_cp.c Tue Nov 16 04:40:03 2010 (r215368) @@ -521,8 +521,8 @@ static int cp_attach (device_t dev) NG_NODE_UNREF (d->node); continue; } - d->queue.ifq_maxlen = IFQ_MAXLEN; - d->hi_queue.ifq_maxlen = IFQ_MAXLEN; + d->queue.ifq_maxlen = ifqmaxlen; + d->hi_queue.ifq_maxlen = ifqmaxlen; mtx_init (&d->queue.ifq_mtx, "cp_queue", NULL, MTX_DEF); mtx_init (&d->hi_queue.ifq_mtx, "cp_queue_hi", NULL, MTX_DEF); callout_init (&d->timeout_handle, Modified: stable/7/sys/dev/cs/if_cs.c ============================================================================== --- stable/7/sys/dev/cs/if_cs.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/cs/if_cs.c Tue Nov 16 04:40:03 2010 (r215368) @@ -602,7 +602,7 @@ cs_attach(device_t dev) ifp->if_ioctl=cs_ioctl; ifp->if_watchdog=cs_watchdog; ifp->if_init=cs_init; - ifp->if_snd.ifq_maxlen= IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen= ifqmaxlen; /* * MIB DATA */ Modified: stable/7/sys/dev/ctau/if_ct.c ============================================================================== --- stable/7/sys/dev/ctau/if_ct.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/ctau/if_ct.c Tue Nov 16 04:40:03 2010 (r215368) @@ -737,8 +737,8 @@ static int ct_attach (device_t dev) ct_bus_dma_mem_free (&d->dmamem); continue; } - d->queue.ifq_maxlen = IFQ_MAXLEN; - d->hi_queue.ifq_maxlen = IFQ_MAXLEN; + d->queue.ifq_maxlen = ifqmaxlen; + d->hi_queue.ifq_maxlen = ifqmaxlen; mtx_init (&d->queue.ifq_mtx, "ct_queue", NULL, MTX_DEF); mtx_init (&d->hi_queue.ifq_mtx, "ct_queue_hi", NULL, MTX_DEF); callout_init (&d->timeout_handle, Modified: stable/7/sys/dev/cx/if_cx.c ============================================================================== --- stable/7/sys/dev/cx/if_cx.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/cx/if_cx.c Tue Nov 16 04:40:03 2010 (r215368) @@ -845,8 +845,8 @@ static int cx_attach (device_t dev) cx_bus_dma_mem_free (&d->dmamem); continue; } - d->lo_queue.ifq_maxlen = IFQ_MAXLEN; - d->hi_queue.ifq_maxlen = IFQ_MAXLEN; + d->lo_queue.ifq_maxlen = ifqmaxlen; + d->hi_queue.ifq_maxlen = ifqmaxlen; mtx_init (&d->lo_queue.ifq_mtx, "cx_queue_lo", NULL, MTX_DEF); mtx_init (&d->hi_queue.ifq_mtx, "cx_queue_hi", NULL, MTX_DEF); callout_init (&d->timeout_handle, Modified: stable/7/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/7/sys/dev/cxgb/cxgb_main.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/cxgb/cxgb_main.c Tue Nov 16 04:40:03 2010 (r215368) @@ -1075,7 +1075,7 @@ cxgb_port_attach(device_t dev) ifp->if_timer = 0; /* Disable ifnet watchdog */ ifp->if_watchdog = NULL; - ifp->if_snd.ifq_drv_maxlen = cxgb_snd_queue_len; + ifp->if_snd.ifq_drv_maxlen = max(cxgb_snd_queue_len, ifqmaxlen); IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); Modified: stable/7/sys/dev/ed/if_ed.c ============================================================================== --- stable/7/sys/dev/ed/if_ed.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/ed/if_ed.c Tue Nov 16 04:40:03 2010 (r215368) @@ -289,8 +289,8 @@ ed_attach(device_t dev) ifp->if_ioctl = ed_ioctl; ifp->if_watchdog = ed_watchdog; ifp->if_init = ed_init; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ifp->if_linkmib = &sc->mibdata; ifp->if_linkmiblen = sizeof sc->mibdata; Modified: stable/7/sys/dev/ep/if_ep.c ============================================================================== --- stable/7/sys/dev/ep/if_ep.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/ep/if_ep.c Tue Nov 16 04:40:03 2010 (r215368) @@ -304,8 +304,8 @@ ep_attach(struct ep_softc *sc) ifp->if_ioctl = epioctl; ifp->if_watchdog = epwatchdog; ifp->if_init = epinit; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); if (!sc->epb.mii_trans) { Modified: stable/7/sys/dev/ex/if_ex.c ============================================================================== --- stable/7/sys/dev/ex/if_ex.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/ex/if_ex.c Tue Nov 16 04:40:03 2010 (r215368) @@ -238,7 +238,7 @@ ex_attach(device_t dev) ifp->if_ioctl = ex_ioctl; ifp->if_watchdog = ex_watchdog; ifp->if_init = ex_init; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; ifmedia_init(&sc->ifmedia, 0, ex_ifmedia_upd, ex_ifmedia_sts); Modified: stable/7/sys/dev/ie/if_ie.c ============================================================================== --- stable/7/sys/dev/ie/if_ie.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/ie/if_ie.c Tue Nov 16 04:40:03 2010 (r215368) @@ -319,7 +319,7 @@ ie_attach(device_t dev) ifp->if_start = iestart; ifp->if_ioctl = ieioctl; ifp->if_init = ieinit; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; if (sc->hard_type == IE_EE16) EVENTHANDLER_REGISTER(shutdown_post_sync, ee16_shutdown, Modified: stable/7/sys/dev/iicbus/if_ic.c ============================================================================== --- stable/7/sys/dev/iicbus/if_ic.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/iicbus/if_ic.c Tue Nov 16 04:40:03 2010 (r215368) @@ -146,7 +146,7 @@ icattach(device_t dev) ifp->if_output = icoutput; ifp->if_hdrlen = 0; ifp->if_addrlen = 0; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; if_attach(ifp); Modified: stable/7/sys/dev/ipw/if_ipw.c ============================================================================== --- stable/7/sys/dev/ipw/if_ipw.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/ipw/if_ipw.c Tue Nov 16 04:40:03 2010 (r215368) @@ -287,8 +287,8 @@ ipw_attach(device_t dev) ifp->if_init = ipw_init; ifp->if_ioctl = ipw_ioctl; ifp->if_start = ipw_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic->ic_ifp = ifp; Modified: stable/7/sys/dev/iwi/if_iwi.c ============================================================================== --- stable/7/sys/dev/iwi/if_iwi.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/iwi/if_iwi.c Tue Nov 16 04:40:03 2010 (r215368) @@ -368,8 +368,8 @@ iwi_attach(device_t dev) ifp->if_init = iwi_init; ifp->if_ioctl = iwi_ioctl; ifp->if_start = iwi_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic->ic_wme.wme_update = iwi_wme_update; Modified: stable/7/sys/dev/le/lance.c ============================================================================== --- stable/7/sys/dev/le/lance.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/le/lance.c Tue Nov 16 04:40:03 2010 (r215368) @@ -133,8 +133,8 @@ lance_config(struct lance_softc *sc, con ifp->if_flags &= ~IFF_MULTICAST; #endif ifp->if_baudrate = IF_Mbps(10); - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); /* Initialize ifmedia structures. */ Modified: stable/7/sys/dev/malo/if_malo.c ============================================================================== --- stable/7/sys/dev/malo/if_malo.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/malo/if_malo.c Tue Nov 16 04:40:03 2010 (r215368) @@ -243,8 +243,8 @@ malo_attach(uint16_t devid, struct malo_ ifp->if_watchdog = malo_watchdog; ifp->if_ioctl = malo_ioctl; ifp->if_init = malo_init; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); /* NB: firmware looks that it does not export regdomain info API. */ Modified: stable/7/sys/dev/my/if_my.c ============================================================================== --- stable/7/sys/dev/my/if_my.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/my/if_my.c Tue Nov 16 04:40:03 2010 (r215368) @@ -889,8 +889,8 @@ my_attach(device_t dev) ifp->if_watchdog = my_watchdog; ifp->if_init = my_init; ifp->if_baudrate = 10000000; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); if (sc->my_info->my_did == MTD803ID) Modified: stable/7/sys/dev/nxge/if_nxge.c ============================================================================== --- stable/7/sys/dev/nxge/if_nxge.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/nxge/if_nxge.c Tue Nov 16 04:40:03 2010 (r215368) @@ -1190,7 +1190,7 @@ xge_interface_setup(device_t dev) ifnetp->if_start = xge_send; /* TODO: Check and assign optimal value */ - ifnetp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifnetp->if_snd.ifq_maxlen = ifqmaxlen; ifnetp->if_capabilities = IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM; Modified: stable/7/sys/dev/pdq/pdq_ifsubr.c ============================================================================== --- stable/7/sys/dev/pdq/pdq_ifsubr.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/pdq/pdq_ifsubr.c Tue Nov 16 04:40:03 2010 (r215368) @@ -423,7 +423,7 @@ pdq_ifattach(pdq_softc_t *sc, const pdq_ ifp->if_softc = sc; ifp->if_init = (if_init_f_t *)pdq_ifinit; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_flags = IFF_BROADCAST|IFF_SIMPLEX|IFF_NOTRAILERS|IFF_MULTICAST; ifp->if_watchdog = pdq_ifwatchdog; Modified: stable/7/sys/dev/ppbus/if_plip.c ============================================================================== --- stable/7/sys/dev/ppbus/if_plip.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/ppbus/if_plip.c Tue Nov 16 04:40:03 2010 (r215368) @@ -248,7 +248,7 @@ lp_attach (device_t dev) ifp->if_output = lpoutput; ifp->if_hdrlen = 0; ifp->if_addrlen = 0; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(u_int32_t)); Modified: stable/7/sys/dev/ral/rt2560.c ============================================================================== --- stable/7/sys/dev/ral/rt2560.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/ral/rt2560.c Tue Nov 16 04:40:03 2010 (r215368) @@ -261,8 +261,8 @@ rt2560_attach(device_t dev, int id) ifp->if_init = rt2560_init; ifp->if_ioctl = rt2560_ioctl; ifp->if_start = rt2560_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic->ic_ifp = ifp; Modified: stable/7/sys/dev/ral/rt2661.c ============================================================================== --- stable/7/sys/dev/ral/rt2661.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/ral/rt2661.c Tue Nov 16 04:40:03 2010 (r215368) @@ -285,8 +285,8 @@ rt2661_attach(device_t dev, int id) ifp->if_init = rt2661_init; ifp->if_ioctl = rt2661_ioctl; ifp->if_start = rt2661_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic->ic_ifp = ifp; Modified: stable/7/sys/dev/ray/if_ray.c ============================================================================== --- stable/7/sys/dev/ray/if_ray.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/ray/if_ray.c Tue Nov 16 04:40:03 2010 (r215368) @@ -534,7 +534,7 @@ ray_attach(device_t dev) ifp->if_ioctl = ray_ioctl; ifp->if_watchdog = ray_watchdog; ifp->if_init = ray_init; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; ether_ifattach(ifp, ep->e_station_addr); Modified: stable/7/sys/dev/sbni/if_sbni.c ============================================================================== --- stable/7/sys/dev/sbni/if_sbni.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/sbni/if_sbni.c Tue Nov 16 04:40:03 2010 (r215368) @@ -235,7 +235,7 @@ sbni_attach(struct sbni_softc *sc, int u ifp->if_start = sbni_start; ifp->if_ioctl = sbni_ioctl; ifp->if_watchdog = sbni_watchdog; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; /* report real baud rate */ csr0 = sbni_inb(sc, CSR0); Modified: stable/7/sys/dev/sbsh/if_sbsh.c ============================================================================== --- stable/7/sys/dev/sbsh/if_sbsh.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/sbsh/if_sbsh.c Tue Nov 16 04:40:03 2010 (r215368) @@ -288,7 +288,7 @@ sbsh_attach(device_t dev) ifp->if_watchdog = sbsh_watchdog; ifp->if_init = sbsh_init; ifp->if_baudrate = 4600000; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; ether_ifattach(ifp, eaddr); Modified: stable/7/sys/dev/sn/if_sn.c ============================================================================== --- stable/7/sys/dev/sn/if_sn.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/sn/if_sn.c Tue Nov 16 04:40:03 2010 (r215368) @@ -205,8 +205,8 @@ sn_attach(device_t dev) ifp->if_watchdog = snwatchdog; ifp->if_init = sninit; ifp->if_baudrate = 10000000; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ifp->if_timer = 0; Modified: stable/7/sys/dev/snc/dp83932.c ============================================================================== --- stable/7/sys/dev/snc/dp83932.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/snc/dp83932.c Tue Nov 16 04:40:03 2010 (r215368) @@ -186,7 +186,7 @@ sncconfig(sc, media, nmedia, defmedia, m ifp->if_watchdog = sncwatchdog; ifp->if_init = sncinit; ifp->if_mtu = ETHERMTU; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; /* Initialize media goo. */ ifmedia_init(&sc->sc_media, 0, snc_mediachange, Modified: stable/7/sys/dev/sr/if_sr.c ============================================================================== --- stable/7/sys/dev/sr/if_sr.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/sr/if_sr.c Tue Nov 16 04:40:03 2010 (r215368) @@ -440,8 +440,8 @@ sr_attach(device_t device) } NG_NODE_SET_PRIVATE(sc->node, sc); callout_handle_init(&sc->handle); - sc->xmitq.ifq_maxlen = IFQ_MAXLEN; - sc->xmitq_hipri.ifq_maxlen = IFQ_MAXLEN; + sc->xmitq.ifq_maxlen = ifqmaxlen; + sc->xmitq_hipri.ifq_maxlen = ifqmaxlen; mtx_init(&sc->xmitq.ifq_mtx, "sr_xmitq", NULL, MTX_DEF); mtx_init(&sc->xmitq_hipri.ifq_mtx, "sr_xmitq_hipri", NULL, MTX_DEF); Modified: stable/7/sys/dev/usb/if_aue.c ============================================================================== --- stable/7/sys/dev/usb/if_aue.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/usb/if_aue.c Tue Nov 16 04:40:03 2010 (r215368) @@ -724,8 +724,8 @@ aue_attach(device_t self) ifp->if_ioctl = aue_ioctl; ifp->if_start = aue_start; ifp->if_init = aue_init; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); /* Modified: stable/7/sys/dev/usb/if_axe.c ============================================================================== --- stable/7/sys/dev/usb/if_axe.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/usb/if_axe.c Tue Nov 16 04:40:03 2010 (r215368) @@ -653,8 +653,8 @@ device_printf(sc->axe_dev, "%s, bufsz %d ifp->if_start = axe_start; ifp->if_watchdog = axe_watchdog; ifp->if_init = axe_init; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); error = mii_attach(self, &sc->axe_miibus, ifp, axe_ifmedia_upd, Modified: stable/7/sys/dev/usb/if_cdce.c ============================================================================== --- stable/7/sys/dev/usb/if_cdce.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/usb/if_cdce.c Tue Nov 16 04:40:03 2010 (r215368) @@ -322,7 +322,7 @@ cdce_attach(device_t self) ifp->if_start = cdce_start; ifp->if_init = cdce_init; ifp->if_baudrate = 11000000; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; sc->q.ifp = ifp; sc->q.if_rxstart = cdce_rxstart; Modified: stable/7/sys/dev/usb/if_cue.c ============================================================================== --- stable/7/sys/dev/usb/if_cue.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/usb/if_cue.c Tue Nov 16 04:40:03 2010 (r215368) @@ -501,7 +501,7 @@ cue_attach(device_t self) ifp->if_watchdog = cue_watchdog; ifp->if_init = cue_init; ifp->if_baudrate = 10000000; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; sc->cue_qdat.ifp = ifp; sc->cue_qdat.if_rxstart = cue_rxstart; Modified: stable/7/sys/dev/usb/if_kue.c ============================================================================== --- stable/7/sys/dev/usb/if_kue.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/usb/if_kue.c Tue Nov 16 04:40:03 2010 (r215368) @@ -488,7 +488,7 @@ kue_attach(device_t self) ifp->if_watchdog = kue_watchdog; ifp->if_init = kue_init; ifp->if_baudrate = 10000000; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; sc->kue_qdat.ifp = ifp; sc->kue_qdat.if_rxstart = kue_rxstart; Modified: stable/7/sys/dev/usb/if_rue.c ============================================================================== --- stable/7/sys/dev/usb/if_rue.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/usb/if_rue.c Tue Nov 16 04:40:03 2010 (r215368) @@ -664,7 +664,7 @@ rue_attach(device_t self) ifp->if_start = rue_start; ifp->if_watchdog = rue_watchdog; ifp->if_init = rue_init; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; /* * MII setup Modified: stable/7/sys/dev/usb/if_rum.c ============================================================================== --- stable/7/sys/dev/usb/if_rum.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/usb/if_rum.c Tue Nov 16 04:40:03 2010 (r215368) @@ -482,8 +482,8 @@ rum_attach(device_t self) ifp->if_init = rum_init; ifp->if_ioctl = rum_ioctl; ifp->if_start = rum_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic->ic_ifp = ifp; Modified: stable/7/sys/dev/usb/if_udav.c ============================================================================== --- stable/7/sys/dev/usb/if_udav.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/usb/if_udav.c Tue Nov 16 04:40:03 2010 (r215368) @@ -417,7 +417,7 @@ udav_attach(device_t self) ifp->if_stop = udav_stop; #endif #if defined(__FreeBSD__) - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; #endif #if defined(__NetBSD__) IFQ_SET_READY(&ifp->if_snd); Modified: stable/7/sys/dev/usb/if_ural.c ============================================================================== --- stable/7/sys/dev/usb/if_ural.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/usb/if_ural.c Tue Nov 16 04:40:03 2010 (r215368) @@ -470,8 +470,8 @@ ural_attach(device_t self) ifp->if_init = ural_init; ifp->if_ioctl = ural_ioctl; ifp->if_start = ural_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic->ic_ifp = ifp; Modified: stable/7/sys/dev/usb/if_zyd.c ============================================================================== --- stable/7/sys/dev/usb/if_zyd.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/usb/if_zyd.c Tue Nov 16 04:40:03 2010 (r215368) @@ -307,7 +307,7 @@ zyd_attach(device_t dev) ifp->if_init = zyd_init; ifp->if_ioctl = zyd_ioctl; ifp->if_start = zyd_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); IFQ_SET_READY(&ifp->if_snd); STAILQ_INIT(&sc->sc_rqh); Modified: stable/7/sys/dev/usb/udbp.c ============================================================================== --- stable/7/sys/dev/usb/udbp.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/usb/udbp.c Tue Nov 16 04:40:03 2010 (r215368) @@ -387,8 +387,8 @@ udbp_attach(device_t self) goto bad; } else { NG_NODE_SET_PRIVATE(sc->node, sc); - sc->xmitq.ifq_maxlen = IFQ_MAXLEN; - sc->xmitq_hipri.ifq_maxlen = IFQ_MAXLEN; + sc->xmitq.ifq_maxlen = ifqmaxlen; + sc->xmitq_hipri.ifq_maxlen = ifqmaxlen; mtx_init(&sc->xmitq.ifq_mtx, "usb_xmitq", NULL, MTX_DEF); mtx_init(&sc->xmitq_hipri.ifq_mtx, Modified: stable/7/sys/dev/vx/if_vx.c ============================================================================== --- stable/7/sys/dev/vx/if_vx.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/vx/if_vx.c Tue Nov 16 04:40:03 2010 (r215368) @@ -188,7 +188,7 @@ vx_attach(device_t dev) } ifp->if_mtu = ETHERMTU; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_start = vx_start; ifp->if_ioctl = vx_ioctl; Modified: stable/7/sys/dev/wi/if_wi.c ============================================================================== --- stable/7/sys/dev/wi/if_wi.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/wi/if_wi.c Tue Nov 16 04:40:03 2010 (r215368) @@ -328,8 +328,8 @@ wi_attach(device_t dev) ifp->if_ioctl = wi_ioctl; ifp->if_start = wi_start; ifp->if_init = wi_init; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ic->ic_ifp = ifp; Modified: stable/7/sys/dev/wl/if_wl.c ============================================================================== --- stable/7/sys/dev/wl/if_wl.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/wl/if_wl.c Tue Nov 16 04:40:03 2010 (r215368) @@ -560,7 +560,7 @@ wlattach(device_t device) ifp->if_start = wlstart; ifp->if_ioctl = wlioctl; ifp->if_timer = 0; /* paranoia */ - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; /* no entries ifp->if_watchdog ifp->if_done Modified: stable/7/sys/dev/wpi/if_wpi.c ============================================================================== --- stable/7/sys/dev/wpi/if_wpi.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/wpi/if_wpi.c Tue Nov 16 04:40:03 2010 (r215368) @@ -660,8 +660,8 @@ wpi_attach(device_t dev) ifp->if_init = wpi_init; ifp->if_ioctl = wpi_ioctl; ifp->if_start = wpi_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); ieee80211_ifattach(ic); Modified: stable/7/sys/dev/xe/if_xe.c ============================================================================== --- stable/7/sys/dev/xe/if_xe.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/dev/xe/if_xe.c Tue Nov 16 04:40:03 2010 (r215368) @@ -245,7 +245,7 @@ xe_attach (device_t dev) scp->ifp->if_watchdog = xe_watchdog; scp->ifp->if_init = xe_init; scp->ifp->if_baudrate = 100000000; - scp->ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + scp->ifp->if_snd.ifq_maxlen = ifqmaxlen; /* Initialise the ifmedia structure */ ifmedia_init(scp->ifm, 0, xe_media_change, xe_media_status); Modified: stable/7/sys/i4b/capi/capi_l4if.c ============================================================================== --- stable/7/sys/i4b/capi/capi_l4if.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/i4b/capi/capi_l4if.c Tue Nov 16 04:40:03 2010 (r215368) @@ -93,13 +93,13 @@ i4b_capi_bch_config(int unit, int chan, capi_softc_t *sc = capi_sc[unit]; i4b_Bcleanifq(&sc->sc_bchan[chan].tx_queue); - sc->sc_bchan[chan].tx_queue.ifq_maxlen = IFQ_MAXLEN; + sc->sc_bchan[chan].tx_queue.ifq_maxlen = ifqmaxlen; sc->sc_bchan[chan].txcount = 0; /* The telephony drivers use rx_queue for receive. */ i4b_Bcleanifq(&sc->sc_bchan[chan].rx_queue); - sc->sc_bchan[chan].rx_queue.ifq_maxlen = IFQ_MAXLEN; + sc->sc_bchan[chan].rx_queue.ifq_maxlen = ifqmaxlen; sc->sc_bchan[chan].rxcount = 0; /* HDLC frames are put to in_mbuf */ @@ -235,8 +235,8 @@ capi_ll_attach(capi_softc_t *sc) memset(&sc->sc_bchan[i].tx_queue, 0, sizeof(struct ifqueue)); memset(&sc->sc_bchan[i].rx_queue, 0, sizeof(struct ifqueue)); - sc->sc_bchan[i].tx_queue.ifq_maxlen = IFQ_MAXLEN; - sc->sc_bchan[i].rx_queue.ifq_maxlen = IFQ_MAXLEN; + sc->sc_bchan[i].tx_queue.ifq_maxlen = ifqmaxlen; + sc->sc_bchan[i].rx_queue.ifq_maxlen = ifqmaxlen; if(!mtx_initialized(&sc->sc_bchan[i].tx_queue.ifq_mtx)) mtx_init(&sc->sc_bchan[i].tx_queue.ifq_mtx, "i4b_capi_tx", NULL, MTX_DEF); Modified: stable/7/sys/i4b/driver/i4b_ing.c ============================================================================== --- stable/7/sys/i4b/driver/i4b_ing.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/i4b/driver/i4b_ing.c Tue Nov 16 04:40:03 2010 (r215368) @@ -281,8 +281,8 @@ i4bingattach(void *dummy) NG_NODE_SET_PRIVATE(sc->node, sc); - sc->xmitq.ifq_maxlen = IFQ_MAXLEN; - sc->xmitq_hipri.ifq_maxlen = IFQ_MAXLEN; + sc->xmitq.ifq_maxlen = ifqmaxlen; + sc->xmitq_hipri.ifq_maxlen = ifqmaxlen; if(!mtx_initialized(&sc->xmitq.ifq_mtx)) mtx_init(&sc->xmitq.ifq_mtx, "i4b_ing_xmitq", NULL, MTX_DEF); if(!mtx_initialized(&sc->xmitq_hipri.ifq_mtx)) Modified: stable/7/sys/i4b/driver/i4b_isppp.c ============================================================================== --- stable/7/sys/i4b/driver/i4b_isppp.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/i4b/driver/i4b_isppp.c Tue Nov 16 04:40:03 2010 (r215368) @@ -187,7 +187,7 @@ i4bispppattach(void *dummy) ifp->if_hdrlen = 0; ifp->if_addrlen = 0; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_ipackets = 0; ifp->if_ierrors = 0; Modified: stable/7/sys/i4b/driver/i4b_trace.c ============================================================================== --- stable/7/sys/i4b/driver/i4b_trace.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/i4b/driver/i4b_trace.c Tue Nov 16 04:40:03 2010 (r215368) @@ -105,7 +105,7 @@ i4btrcattach(void *dummy) { make_dev(&i4btrc_cdevsw, i, UID_ROOT, GID_WHEEL, 0600, "i4btrc%d", i); - trace_queue[i].ifq_maxlen = IFQ_MAXLEN; + trace_queue[i].ifq_maxlen = ifqmaxlen; if(!mtx_initialized(&trace_queue[i].ifq_mtx)) mtx_init(&trace_queue[i].ifq_mtx, "i4b_trace", NULL, MTX_DEF); Modified: stable/7/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c ============================================================================== --- stable/7/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c Tue Nov 16 04:40:03 2010 (r215368) @@ -1137,7 +1137,7 @@ avma1pp_bchannel_setup(int unit, int h_c /* receiver part */ - chan->rx_queue.ifq_maxlen = IFQ_MAXLEN; + chan->rx_queue.ifq_maxlen = ifqmaxlen; i4b_Bcleanifq(&chan->rx_queue); /* clean rx queue */ @@ -1151,7 +1151,7 @@ avma1pp_bchannel_setup(int unit, int h_c /* transmitter part */ - chan->tx_queue.ifq_maxlen = IFQ_MAXLEN; + chan->tx_queue.ifq_maxlen = ifqmaxlen; i4b_Bcleanifq(&chan->tx_queue); /* clean tx queue */ Modified: stable/7/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c ============================================================================== --- stable/7/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c Tue Nov 16 04:40:03 2010 (r215368) @@ -1084,7 +1084,7 @@ avma1pp2_bchannel_setup(int unit, int h_ /* receiver part */ - chan->rx_queue.ifq_maxlen = IFQ_MAXLEN; + chan->rx_queue.ifq_maxlen = ifqmaxlen; i4b_Bcleanifq(&chan->rx_queue); /* clean rx queue */ @@ -1098,7 +1098,7 @@ avma1pp2_bchannel_setup(int unit, int h_ /* transmitter part */ - chan->tx_queue.ifq_maxlen = IFQ_MAXLEN; + chan->tx_queue.ifq_maxlen = ifqmaxlen; i4b_Bcleanifq(&chan->tx_queue); /* clean tx queue */ Modified: stable/7/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c ============================================================================== --- stable/7/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c Tue Nov 16 04:40:03 2010 (r215368) @@ -1047,7 +1047,7 @@ avm_pnp_bchannel_setup(int unit, int h_c /* receiver part */ - chan->rx_queue.ifq_maxlen = IFQ_MAXLEN; + chan->rx_queue.ifq_maxlen = ifqmaxlen; #if defined (__FreeBSD__) && __FreeBSD__ > 4 if(!mtx_initialized(&chan->rx_queue.ifq_mtx)) @@ -1066,7 +1066,7 @@ avm_pnp_bchannel_setup(int unit, int h_c /* transmitter part */ - chan->tx_queue.ifq_maxlen = IFQ_MAXLEN; + chan->tx_queue.ifq_maxlen = ifqmaxlen; #if defined (__FreeBSD__) && __FreeBSD__ > 4 if(!mtx_initialized(&chan->tx_queue.ifq_mtx)) Modified: stable/7/sys/i4b/layer1/ihfc/i4b_ihfc_drv.c ============================================================================== --- stable/7/sys/i4b/layer1/ihfc/i4b_ihfc_drv.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/i4b/layer1/ihfc/i4b_ihfc_drv.c Tue Nov 16 04:40:03 2010 (r215368) @@ -354,7 +354,7 @@ ihfc_init (ihfc_sc_t *sc, u_char chan, i RESET_SOFT_CHAN(sc, chan); - S_IFQUEUE.ifq_maxlen = IFQ_MAXLEN; + S_IFQUEUE.ifq_maxlen = ifqmaxlen; #if defined (__FreeBSD__) && __FreeBSD__ > 4 if(!mtx_initialized(&S_IFQUEUE.ifq_mtx)) @@ -380,7 +380,7 @@ ihfc_init (ihfc_sc_t *sc, u_char chan, i RESET_SOFT_CHAN(sc, chan); - S_IFQUEUE.ifq_maxlen = IFQ_MAXLEN; + S_IFQUEUE.ifq_maxlen = ifqmaxlen; #if defined (__FreeBSD__) && __FreeBSD__ > 4 if(!mtx_initialized(&S_IFQUEUE.ifq_mtx)) Modified: stable/7/sys/i4b/layer1/isic/i4b_bchan.c ============================================================================== --- stable/7/sys/i4b/layer1/isic/i4b_bchan.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/i4b/layer1/isic/i4b_bchan.c Tue Nov 16 04:40:03 2010 (r215368) @@ -84,7 +84,7 @@ isic_bchannel_setup(int unit, int h_chan /* receiver part */ - chan->rx_queue.ifq_maxlen = IFQ_MAXLEN; + chan->rx_queue.ifq_maxlen = ifqmaxlen; if(!mtx_initialized(&chan->rx_queue.ifq_mtx)) mtx_init(&chan->rx_queue.ifq_mtx, "i4b_isic_rx", NULL, MTX_DEF); @@ -101,7 +101,7 @@ isic_bchannel_setup(int unit, int h_chan /* transmitter part */ - chan->tx_queue.ifq_maxlen = IFQ_MAXLEN; + chan->tx_queue.ifq_maxlen = ifqmaxlen; if(!mtx_initialized(&chan->tx_queue.ifq_mtx)) mtx_init(&chan->tx_queue.ifq_mtx, "i4b_isic_tx", NULL, MTX_DEF); Modified: stable/7/sys/i4b/layer1/itjc/i4b_itjc_pci.c ============================================================================== --- stable/7/sys/i4b/layer1/itjc/i4b_itjc_pci.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/i4b/layer1/itjc/i4b_itjc_pci.c Tue Nov 16 04:40:03 2010 (r215368) @@ -1858,7 +1858,7 @@ itjc_bchannel_setup(int unit, int h_chan i4b_Bcleanifq(&chan->rx_queue); /* clean rx queue */ - chan->rx_queue.ifq_maxlen = IFQ_MAXLEN; + chan->rx_queue.ifq_maxlen = ifqmaxlen; chan->rxcount = 0; /* reset rx counter */ @@ -1872,7 +1872,7 @@ itjc_bchannel_setup(int unit, int h_chan i4b_Bcleanifq(&chan->tx_queue); /* clean tx queue */ - chan->tx_queue.ifq_maxlen = IFQ_MAXLEN; + chan->tx_queue.ifq_maxlen = ifqmaxlen; chan->txcount = 0; /* reset tx counter */ Modified: stable/7/sys/i4b/layer1/iwic/i4b_iwic_bchan.c ============================================================================== --- stable/7/sys/i4b/layer1/iwic/i4b_iwic_bchan.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/i4b/layer1/iwic/i4b_iwic_bchan.c Tue Nov 16 04:40:03 2010 (r215368) @@ -428,7 +428,7 @@ iwic_bchannel_setup(int unit, int chan_n /* receiver part */ - chan->rx_queue.ifq_maxlen = IFQ_MAXLEN; + chan->rx_queue.ifq_maxlen = ifqmaxlen; #if defined (__FreeBSD__) && __FreeBSD__ > 4 if(!mtx_initialized(&chan->rx_queue.ifq_mtx)) @@ -447,7 +447,7 @@ iwic_bchannel_setup(int unit, int chan_n /* transmitter part */ - chan->tx_queue.ifq_maxlen = IFQ_MAXLEN; + chan->tx_queue.ifq_maxlen = ifqmaxlen; #if defined (__FreeBSD__) && __FreeBSD__ > 4 if(!mtx_initialized(&chan->tx_queue.ifq_mtx)) Modified: stable/7/sys/i4b/layer4/i4b_i4bdrv.c ============================================================================== --- stable/7/sys/i4b/layer4/i4b_i4bdrv.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/i4b/layer4/i4b_i4bdrv.c Tue Nov 16 04:40:03 2010 (r215368) @@ -96,7 +96,7 @@ i4battach(void *dummy) { printf("i4b: ISDN call control device attached\n"); - i4b_rdqueue.ifq_maxlen = IFQ_MAXLEN; + i4b_rdqueue.ifq_maxlen = ifqmaxlen; if(!mtx_initialized(&i4b_rdqueue.ifq_mtx)) mtx_init(&i4b_rdqueue.ifq_mtx, "i4b_rdqueue", NULL, MTX_DEF); Modified: stable/7/sys/net/if.c ============================================================================== --- stable/7/sys/net/if.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/net/if.c Tue Nov 16 04:40:03 2010 (r215368) @@ -89,6 +89,10 @@ static int slowtimo_started; SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers"); SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management"); +TUNABLE_INT("net.link.ifqmaxlen", &ifqmaxlen); +SYSCTL_UINT(_net_link, OID_AUTO, ifqmaxlen, CTLFLAG_RDTUN, + &ifqmaxlen, 0, "max send queue size"); + /* Log link state change events */ static int log_link_state_change = 1; Modified: stable/7/sys/net/if_ef.c ============================================================================== --- stable/7/sys/net/if_ef.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/net/if_ef.c Tue Nov 16 04:40:03 2010 (r215368) @@ -130,7 +130,7 @@ ef_attach(struct efnet *sc) ifp->if_start = ef_start; ifp->if_watchdog = NULL; ifp->if_init = ef_init; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); /* * Attach the interface Modified: stable/7/sys/net/if_gif.c ============================================================================== --- stable/7/sys/net/if_gif.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/net/if_gif.c Tue Nov 16 04:40:03 2010 (r215368) @@ -182,7 +182,7 @@ gif_clone_create(ifc, unit, params) GIF2IFP(sc)->if_ioctl = gif_ioctl; GIF2IFP(sc)->if_start = gif_start; GIF2IFP(sc)->if_output = gif_output; - GIF2IFP(sc)->if_snd.ifq_maxlen = IFQ_MAXLEN; + GIF2IFP(sc)->if_snd.ifq_maxlen = ifqmaxlen; if_attach(GIF2IFP(sc)); bpfattach(GIF2IFP(sc), DLT_NULL, sizeof(u_int32_t)); if (ng_gif_attach_p != NULL) Modified: stable/7/sys/net/if_gre.c ============================================================================== --- stable/7/sys/net/if_gre.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/net/if_gre.c Tue Nov 16 04:40:03 2010 (r215368) @@ -190,7 +190,7 @@ gre_clone_create(ifc, unit, params) GRE2IFP(sc)->if_softc = sc; if_initname(GRE2IFP(sc), ifc->ifc_name, unit); - GRE2IFP(sc)->if_snd.ifq_maxlen = IFQ_MAXLEN; + GRE2IFP(sc)->if_snd.ifq_maxlen = ifqmaxlen; GRE2IFP(sc)->if_addrlen = 0; GRE2IFP(sc)->if_hdrlen = 24; /* IP + GRE */ GRE2IFP(sc)->if_mtu = GREMTU; Modified: stable/7/sys/net/if_ppp.c ============================================================================== --- stable/7/sys/net/if_ppp.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/net/if_ppp.c Tue Nov 16 04:40:03 2010 (r215368) @@ -228,10 +228,10 @@ ppp_clone_create(struct if_clone *ifc, i ifp->if_hdrlen = PPP_HDRLEN; ifp->if_ioctl = pppsioctl; ifp->if_output = pppoutput; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; - sc->sc_inq.ifq_maxlen = IFQ_MAXLEN; - sc->sc_fastq.ifq_maxlen = IFQ_MAXLEN; - sc->sc_rawq.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; + sc->sc_inq.ifq_maxlen = ifqmaxlen; + sc->sc_fastq.ifq_maxlen = ifqmaxlen; + sc->sc_rawq.ifq_maxlen = ifqmaxlen; mtx_init(&sc->sc_inq.ifq_mtx, "ppp_inq", NULL, MTX_DEF); mtx_init(&sc->sc_fastq.ifq_mtx, "ppp_fastq", NULL, MTX_DEF); mtx_init(&sc->sc_rawq.ifq_mtx, "ppp_rawq", NULL, MTX_DEF); Modified: stable/7/sys/net/if_stf.c ============================================================================== --- stable/7/sys/net/if_stf.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/net/if_stf.c Tue Nov 16 04:40:03 2010 (r215368) @@ -252,7 +252,7 @@ stf_clone_create(struct if_clone *ifc, c ifp->if_mtu = IPV6_MMTU; ifp->if_ioctl = stf_ioctl; ifp->if_output = stf_output; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(u_int32_t)); return (0); Modified: stable/7/sys/netatalk/ddp_usrreq.c ============================================================================== --- stable/7/sys/netatalk/ddp_usrreq.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/netatalk/ddp_usrreq.c Tue Nov 16 04:40:03 2010 (r215368) @@ -256,9 +256,9 @@ void ddp_init(void) { - atintrq1.ifq_maxlen = IFQ_MAXLEN; - atintrq2.ifq_maxlen = IFQ_MAXLEN; - aarpintrq.ifq_maxlen = IFQ_MAXLEN; + atintrq1.ifq_maxlen = ifqmaxlen; + atintrq2.ifq_maxlen = ifqmaxlen; + aarpintrq.ifq_maxlen = ifqmaxlen; mtx_init(&atintrq1.ifq_mtx, "at1_inq", NULL, MTX_DEF); mtx_init(&atintrq2.ifq_mtx, "at2_inq", NULL, MTX_DEF); mtx_init(&aarpintrq.ifq_mtx, "aarp_inq", NULL, MTX_DEF); Modified: stable/7/sys/netgraph/ng_eiface.c ============================================================================== --- stable/7/sys/netgraph/ng_eiface.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/netgraph/ng_eiface.c Tue Nov 16 04:40:03 2010 (r215368) @@ -364,7 +364,7 @@ ng_eiface_constructor(node_p node) ifp->if_start = ng_eiface_start; ifp->if_ioctl = ng_eiface_ioctl; ifp->if_watchdog = NULL; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_flags = (IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST); #if 0 Modified: stable/7/sys/netgraph/ng_fec.c ============================================================================== --- stable/7/sys/netgraph/ng_fec.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/netgraph/ng_fec.c Tue Nov 16 04:40:03 2010 (r215368) @@ -1227,7 +1227,7 @@ ng_fec_constructor(node_p node) ifp->if_ioctl = ng_fec_ioctl; ifp->if_init = ng_fec_init; ifp->if_watchdog = NULL; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_mtu = NG_FEC_MTU_DEFAULT; ifp->if_flags = (IFF_SIMPLEX|IFF_BROADCAST|IFF_MULTICAST); ifp->if_addrlen = 0; /* XXX */ Modified: stable/7/sys/netgraph/ng_iface.c ============================================================================== --- stable/7/sys/netgraph/ng_iface.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/netgraph/ng_iface.c Tue Nov 16 04:40:03 2010 (r215368) @@ -560,8 +560,8 @@ ng_iface_constructor(node_p node) ifp->if_addrlen = 0; /* XXX */ ifp->if_hdrlen = 0; /* XXX */ ifp->if_baudrate = 64000; /* XXX */ - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); /* Give this node the same name as the interface (if possible) */ Modified: stable/7/sys/netgraph/ng_tty.c ============================================================================== --- stable/7/sys/netgraph/ng_tty.c Tue Nov 16 03:43:06 2010 (r215367) +++ stable/7/sys/netgraph/ng_tty.c Tue Nov 16 04:40:03 2010 (r215368) @@ -202,7 +202,7 @@ ngt_open(struct cdev *dev, struct tty *t sc->tp = tp; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 16 04:51:07 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4879106566B; Tue, 16 Nov 2010 04:51:07 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 934E48FC08; Tue, 16 Nov 2010 04:51:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAG4p7r7039858; Tue, 16 Nov 2010 04:51:07 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAG4p7d8039856; Tue, 16 Nov 2010 04:51:07 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201011160451.oAG4p7d8039856@svn.freebsd.org> From: Alan Cox Date: Tue, 16 Nov 2010 04:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215370 - stable/7/sys/vm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 04:51:07 -0000 Author: alc Date: Tue Nov 16 04:51:07 2010 New Revision: 215370 URL: http://svn.freebsd.org/changeset/base/215370 Log: MFC r214953 In case the stack size reaches its limit and its growth must be restricted, ensure that grow_amount is a multiple of the page size. Otherwise, the kernel may crash in swap_reserve_by_uid() on HEAD and FreeBSD 8.x, and produce a core file with a missing stack on FreeBSD 7.x. Modified: stable/7/sys/vm/vm_map.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/vm/vm_map.c ============================================================================== --- stable/7/sys/vm/vm_map.c Tue Nov 16 04:40:27 2010 (r215369) +++ stable/7/sys/vm/vm_map.c Tue Nov 16 04:51:07 2010 (r215370) @@ -2927,7 +2927,8 @@ Retry: if (grow_amount > stack_entry->avail_ssize) grow_amount = stack_entry->avail_ssize; if (is_procstack && (ctob(vm->vm_ssize) + grow_amount > stacklim)) { - grow_amount = stacklim - ctob(vm->vm_ssize); + grow_amount = trunc_page((vm_size_t)stacklim) - + ctob(vm->vm_ssize); } /* If we would blow our VMEM resource limit, no go */ From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 16 05:01:28 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29CD3106564A; Tue, 16 Nov 2010 05:01:28 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1F558FC0C; Tue, 16 Nov 2010 05:01:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAG51RGl040125; Tue, 16 Nov 2010 05:01:27 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAG51Re5040123; Tue, 16 Nov 2010 05:01:27 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201011160501.oAG51Re5040123@svn.freebsd.org> From: Alan Cox Date: Tue, 16 Nov 2010 05:01:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215371 - stable/7/sys/i386/i386 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 05:01:28 -0000 Author: alc Date: Tue Nov 16 05:01:27 2010 New Revision: 215371 URL: http://svn.freebsd.org/changeset/base/215371 Log: MFC r214938 Eliminate a possible race between pmap_pinit() and pmap_kenter_pde() on superpage promotion or demotion. Micro-optimize pmap_kenter_pde(). Modified: stable/7/sys/i386/i386/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/i386/i386/pmap.c ============================================================================== --- stable/7/sys/i386/i386/pmap.c Tue Nov 16 04:51:07 2010 (r215370) +++ stable/7/sys/i386/i386/pmap.c Tue Nov 16 05:01:27 2010 (r215371) @@ -1639,11 +1639,19 @@ pmap_unuse_pt(pmap_t pmap, vm_offset_t v return pmap_unwire_pte_hold(pmap, mpte, free); } +/* + * Initialize the pmap for the swapper process. + */ void pmap_pinit0(pmap_t pmap) { PMAP_LOCK_INIT(pmap); + /* + * Since the page table directory is shared with the kernel pmap, + * which is already included in the list "allpmaps", this pmap does + * not need to be inserted into that list. + */ pmap->pm_pdir = (pd_entry_t *)(KERNBASE + (vm_offset_t)IdlePTD); #ifdef PAE pmap->pm_pdpt = (pdpt_entry_t *)(KERNBASE + (vm_offset_t)IdlePDPT); @@ -1653,9 +1661,6 @@ pmap_pinit0(pmap_t pmap) PCPU_SET(curpmap, pmap); TAILQ_INIT(&pmap->pm_pvchunk); bzero(&pmap->pm_stats, sizeof pmap->pm_stats); - mtx_lock_spin(&allpmaps_lock); - LIST_INSERT_HEAD(&allpmaps, pmap, pm_list); - mtx_unlock_spin(&allpmaps_lock); } /* @@ -1720,9 +1725,9 @@ pmap_pinit(pmap_t pmap) mtx_lock_spin(&allpmaps_lock); LIST_INSERT_HEAD(&allpmaps, pmap, pm_list); - mtx_unlock_spin(&allpmaps_lock); - /* Wire in kernel global address entries. */ + /* Copy the kernel page table directory entries. */ bcopy(PTD + KPTDI, pmap->pm_pdir + KPTDI, nkpt * sizeof(pd_entry_t)); + mtx_unlock_spin(&allpmaps_lock); /* install self-referential address mapping entry(s) */ for (i = 0; i < NPGPTD; i++) { From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 16 06:20:12 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7431A106564A; Tue, 16 Nov 2010 06:20:12 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61DBB8FC19; Tue, 16 Nov 2010 06:20:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAG6KCPC041934; Tue, 16 Nov 2010 06:20:12 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAG6KC5R041930; Tue, 16 Nov 2010 06:20:12 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201011160620.oAG6KC5R041930@svn.freebsd.org> From: Alan Cox Date: Tue, 16 Nov 2010 06:20:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215374 - in stable/7/sys/i386: i386 include X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 06:20:12 -0000 Author: alc Date: Tue Nov 16 06:20:12 2010 New Revision: 215374 URL: http://svn.freebsd.org/changeset/base/215374 Log: MFC r213455 Initialize KPTmap in locore so that vm86.c can call vtophys() (or really pmap_kextract()) before pmap_bootstrap() is called. Document the set of pmap functions that may be called before pmap_bootstrap() is called. Modified: stable/7/sys/i386/i386/locore.s stable/7/sys/i386/i386/pmap.c stable/7/sys/i386/include/pmap.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/i386/i386/locore.s ============================================================================== --- stable/7/sys/i386/i386/locore.s Tue Nov 16 05:46:35 2010 (r215373) +++ stable/7/sys/i386/i386/locore.s Tue Nov 16 06:20:12 2010 (r215374) @@ -104,6 +104,9 @@ IdlePTD: .long 0 /* phys addr of kernel IdlePDPT: .long 0 /* phys addr of kernel PDPT */ #endif + .globl KPTmap +KPTmap: .long 0 /* address of kernel page tables */ + .globl KPTphys KPTphys: .long 0 /* phys addr of kernel page tables */ @@ -717,6 +720,8 @@ no_kernend: /* Allocate Kernel Page Tables */ ALLOCPAGES(NKPT) movl %esi,R(KPTphys) + addl $(KERNBASE-(KPTDI<<(PDRSHIFT-PAGE_SHIFT+PTESHIFT))),%esi + movl %esi,R(KPTmap) /* Allocate Page Table Directory */ #ifdef PAE @@ -780,6 +785,11 @@ no_kernend: shrl $PAGE_SHIFT,%ecx fillkptphys($PG_RW) +/* Map page table pages. */ + movl R(KPTphys),%eax + movl $NKPT,%ecx + fillkptphys($PG_RW) + /* Map page directory. */ #ifdef PAE movl R(IdlePDPT), %eax Modified: stable/7/sys/i386/i386/pmap.c ============================================================================== --- stable/7/sys/i386/i386/pmap.c Tue Nov 16 05:46:35 2010 (r215373) +++ stable/7/sys/i386/i386/pmap.c Tue Nov 16 06:20:12 2010 (r215374) @@ -241,7 +241,7 @@ struct sysmaps { caddr_t CADDR2; }; static struct sysmaps sysmaps_pcpu[MAXCPU]; -pt_entry_t *CMAP1 = 0, *KPTmap; +pt_entry_t *CMAP1 = 0; static pt_entry_t *CMAP3; static pd_entry_t *KPTD; caddr_t CADDR1 = 0, ptvmmap = 0; @@ -372,12 +372,11 @@ pmap_bootstrap(vm_paddr_t firstaddr) int i; /* - * XXX The calculation of virtual_avail is wrong. It's NKPT*PAGE_SIZE too - * large. It should instead be correctly calculated in locore.s and - * not based on 'first' (which is a physical address, not a virtual - * address, for the start of unused physical memory). The kernel - * page tables are NOT double mapped and thus should not be included - * in this calculation. + * Initialize the first available kernel virtual address. However, + * using "firstaddr" may waste a few pages of the kernel virtual + * address space, because locore may not have mapped every physical + * page that it allocated. Preferably, locore would provide a first + * unused virtual address in addition to "firstaddr". */ virtual_avail = (vm_offset_t) KERNBASE + firstaddr; virtual_avail = pmap_kmem_choose(virtual_avail); @@ -449,6 +448,10 @@ pmap_bootstrap(vm_paddr_t firstaddr) /* * KPTmap is used by pmap_kextract(). + * + * KPTmap is first initialized by locore. However, that initial + * KPTmap can only support NKPT page table pages. Here, a larger + * KPTmap is created that can support KVA_PAGES page table pages. */ SYSMAP(pt_entry_t *, KPTD, KPTmap, KVA_PAGES) @@ -1357,6 +1360,8 @@ pmap_extract_and_hold(pmap_t pmap, vm_of /* * Add a wired page to the kva. * Note: not SMP coherent. + * + * This function may be used before pmap_bootstrap() is called. */ PMAP_INLINE void pmap_kenter(vm_offset_t va, vm_paddr_t pa) @@ -1379,6 +1384,8 @@ pmap_kenter_attr(vm_offset_t va, vm_padd /* * Remove a page from the kernel pagetables. * Note: not SMP coherent. + * + * This function may be used before pmap_bootstrap() is called. */ PMAP_INLINE void pmap_kremove(vm_offset_t va) Modified: stable/7/sys/i386/include/pmap.h ============================================================================== --- stable/7/sys/i386/include/pmap.h Tue Nov 16 05:46:35 2010 (r215373) +++ stable/7/sys/i386/include/pmap.h Tue Nov 16 06:20:12 2010 (r215374) @@ -193,12 +193,21 @@ extern pd_entry_t *IdlePTD; /* physical #ifdef _KERNEL /* - * virtual address to page table entry and - * to physical address. - * Note: these work recursively, thus vtopte of a pte will give - * the corresponding pde that in turn maps it. + * Translate a virtual address to the kernel virtual address of its page table + * entry (PTE). This can be used recursively. If the address of a PTE as + * previously returned by this macro is itself given as the argument, then the + * address of the page directory entry (PDE) that maps the PTE will be + * returned. + * + * This macro may be used before pmap_bootstrap() is called. */ #define vtopte(va) (PTmap + i386_btop(va)) + +/* + * Translate a virtual address to its physical address. + * + * This macro may be used before pmap_bootstrap() is called. + */ #define vtophys(va) pmap_kextract((vm_offset_t)(va)) @@ -208,14 +217,18 @@ extern pd_entry_t *IdlePTD; /* physical * table pages, and not user page table pages, and (2) it provides access to * a kernel page table page after the corresponding virtual addresses have * been promoted to a 2/4MB page mapping. + * + * KPTmap is first initialized by locore to support just NPKT page table + * pages. Later, it is reinitialized by pmap_bootstrap() to allow for + * expansion of the kernel page table. */ extern pt_entry_t *KPTmap; /* - * Routine: pmap_kextract - * Function: - * Extract the physical page address associated - * kernel virtual address. + * Extract from the kernel page table the physical address that is mapped by + * the given virtual address "va". + * + * This function may be used before pmap_bootstrap() is called. */ static __inline vm_paddr_t pmap_kextract(vm_offset_t va) @@ -431,6 +444,11 @@ extern vm_offset_t virtual_end; #define pmap_page_get_memattr(m) ((vm_memattr_t)(m)->md.pat_mode) #define pmap_unmapbios(va, sz) pmap_unmapdev((va), (sz)) +/* + * Only the following functions or macros may be used before pmap_bootstrap() + * is called: pmap_kenter(), pmap_kextract(), pmap_kremove(), vtophys(), and + * vtopte(). + */ void pmap_bootstrap(vm_paddr_t); int pmap_cache_bits(int mode, boolean_t is_pde); int pmap_change_attr(vm_offset_t, vm_size_t, int); From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 16 07:19:06 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E7EB106567A; Tue, 16 Nov 2010 07:19:06 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CB478FC18; Tue, 16 Nov 2010 07:19:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAG7J6f5043323; Tue, 16 Nov 2010 07:19:06 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAG7J6v6043321; Tue, 16 Nov 2010 07:19:06 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201011160719.oAG7J6v6043321@svn.freebsd.org> From: Bruce Cran Date: Tue, 16 Nov 2010 07:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215379 - stable/7/usr.sbin/sysinstall X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 07:19:06 -0000 Author: brucec Date: Tue Nov 16 07:19:05 2010 New Revision: 215379 URL: http://svn.freebsd.org/changeset/base/215379 Log: MFC r215263: Add ftp4.se.freebsd.org to the set of mirrors. PR: bin/150552 Submitted by: Niclas Zeising Modified: stable/7/usr.sbin/sysinstall/menus.c Directory Properties: stable/7/usr.sbin/sysinstall/ (props changed) Modified: stable/7/usr.sbin/sysinstall/menus.c ============================================================================== --- stable/7/usr.sbin/sysinstall/menus.c Tue Nov 16 07:16:40 2010 (r215378) +++ stable/7/usr.sbin/sysinstall/menus.c Tue Nov 16 07:19:05 2010 (r215379) @@ -740,6 +740,8 @@ DMenu MenuMediaFTP = { VAR_FTP_PATH "=ftp://ftp2.se.freebsd.org" }, { " Sweden #3", "ftp3.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.se.freebsd.org" }, + { " Sweden #4", "ftp4.se.freebsd.org", NULL, dmenuSetVariable, NULL, + VAR_FTP_PATH "=ftp://ftp4.se.freebsd.org" }, { " Sweden #5", "ftp5.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.se.freebsd.org" }, From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 16 07:26:49 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 927DB10657E4; Tue, 16 Nov 2010 07:26:49 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 666528FC16; Tue, 16 Nov 2010 07:26:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAG7QnBg043624; Tue, 16 Nov 2010 07:26:49 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAG7Qn1O043622; Tue, 16 Nov 2010 07:26:49 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201011160726.oAG7Qn1O043622@svn.freebsd.org> From: Bruce Cran Date: Tue, 16 Nov 2010 07:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215381 - stable/7/usr.bin/top X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 07:26:49 -0000 Author: brucec Date: Tue Nov 16 07:26:49 2010 New Revision: 215381 URL: http://svn.freebsd.org/changeset/base/215381 Log: MFC r215239: Memory stats are reported in bytes, not pages. PR: docs/151283 Submitted by: Bas Smeelen Modified: stable/7/usr.bin/top/top.local.1 Directory Properties: stable/7/usr.bin/top/ (props changed) Modified: stable/7/usr.bin/top/top.local.1 ============================================================================== --- stable/7/usr.bin/top/top.local.1 Tue Nov 16 07:24:17 2010 (r215380) +++ stable/7/usr.bin/top/top.local.1 Tue Nov 16 07:26:49 2010 (r215381) @@ -6,8 +6,8 @@ The '-H' option will toggle the display At runtime the 'H' key will toggle this mode. The default is OFF. .SH DESCRIPTION OF MEMORY -Mem: 9220K Active, 1032K Inact, 3284K Wired, 1MB Cache, 2M Buf, 1320K Free -Swap: 91M Total, 79M Free, 13% Inuse, 80K In, 104 K Out +Mem: 9220K Active, 1032K Inact, 3284K Wired, 1M Cache, 2M Buf, 1320K Free +Swap: 91M Total, 79M Free, 13% Inuse, 80K In, 104K Out .B K: Kilobyte @@ -19,23 +19,23 @@ Megabyte 1/100 .TP .B Active: -number of pages active +number of bytes active .TP .B Inact: -number of pages inactive +number of bytes inactive .TP .B Wired: -number of pages wired down, including cached file data pages +number of bytes wired down, including cached file data pages .TP .B Cache: -number of clean pages caching data that are available for +number of clean bytes caching data that are available for immediate reallocation .TP .B Buf: -number of pages used for BIO-level disk caching +number of bytes used for BIO-level disk caching .TP .B Free: -number of pages free +number of bytes free .TP .B Total: total available swap usage @@ -47,7 +47,7 @@ total free swap usage swap usage .TP .B In: -pages paged in from swap devices (last interval) +bytes paged in from swap devices (last interval) .TP .B Out: -pages paged out to swap devices (last interval) +bytes paged out to swap devices (last interval) From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 16 07:35:30 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39BCC1065679; Tue, 16 Nov 2010 07:35:30 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 282478FC19; Tue, 16 Nov 2010 07:35:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAG7ZUBB043964; Tue, 16 Nov 2010 07:35:30 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAG7ZUH5043962; Tue, 16 Nov 2010 07:35:30 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201011160735.oAG7ZUH5043962@svn.freebsd.org> From: Bruce Cran Date: Tue, 16 Nov 2010 07:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215384 - stable/7/usr.sbin/sysinstall X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 07:35:30 -0000 Author: brucec Date: Tue Nov 16 07:35:29 2010 New Revision: 215384 URL: http://svn.freebsd.org/changeset/base/215384 Log: MFC r213763: Use the RFC2606 domain example.com in examples. Modified: stable/7/usr.sbin/sysinstall/tcpip.c Directory Properties: stable/7/usr.sbin/sysinstall/ (props changed) Modified: stable/7/usr.sbin/sysinstall/tcpip.c ============================================================================== --- stable/7/usr.sbin/sysinstall/tcpip.c Tue Nov 16 07:33:53 2010 (r215383) +++ stable/7/usr.sbin/sysinstall/tcpip.c Tue Nov 16 07:35:29 2010 (r215384) @@ -65,12 +65,12 @@ static char ipv6addr[INET6_ADDRSTRLEN]; static Layout layout[] = { #define LAYOUT_HOSTNAME 0 { 1, 2, 25, HOSTNAME_FIELD_LEN - 1, - "Host:", "Your fully-qualified hostname, e.g. foo.bar.com", + "Host:", "Your fully-qualified hostname, e.g. foo.example.com", hostname, STRINGOBJ, NULL }, #define LAYOUT_DOMAINNAME 1 { 1, 35, 20, HOSTNAME_FIELD_LEN - 1, "Domain:", - "The name of the domain that your machine is in, e.g. bar.com", + "The name of the domain that your machine is in, e.g. example.com", domainname, STRINGOBJ, NULL }, #define LAYOUT_GATEWAY 2 { 5, 2, 18, IPADDR_FIELD_LEN - 1, From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 16 07:39:52 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77C9F106566B; Tue, 16 Nov 2010 07:39:52 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 663AA8FC1C; Tue, 16 Nov 2010 07:39:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAG7dq6e044135; Tue, 16 Nov 2010 07:39:52 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAG7dqF3044133; Tue, 16 Nov 2010 07:39:52 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201011160739.oAG7dqF3044133@svn.freebsd.org> From: Bruce Cran Date: Tue, 16 Nov 2010 07:39:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215386 - stable/7/sys/dev/firewire X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 07:39:52 -0000 Author: brucec Date: Tue Nov 16 07:39:52 2010 New Revision: 215386 URL: http://svn.freebsd.org/changeset/base/215386 Log: MFC r214021: Fix grammar. Modified: stable/7/sys/dev/firewire/fwohci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/firewire/fwohci.c ============================================================================== --- stable/7/sys/dev/firewire/fwohci.c Tue Nov 16 07:38:26 2010 (r215385) +++ stable/7/sys/dev/firewire/fwohci.c Tue Nov 16 07:39:52 2010 (r215386) @@ -1969,8 +1969,8 @@ fwohci_intr_dma(struct fwohci_softc *sc, OWRITE(sc, OHCI_LNKCTLCLR, OHCI_CNTL_CYCTIMER); #endif OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_CYC_LOST); - device_printf(fc->dev, "too many cycle lost, " - "no cycle master presents?\n"); + device_printf(fc->dev, "too many cycles lost, " + "no cycle master present?\n"); } } if (stat & OHCI_INT_DMA_ATRQ) { From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 16 13:26:58 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 686EE10656A4; Tue, 16 Nov 2010 13:26:58 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 12E028FC17; Tue, 16 Nov 2010 13:26:57 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 1D02F1FFC33; Tue, 16 Nov 2010 13:11:23 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id ECCCB84571; Tue, 16 Nov 2010 14:11:22 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Maxim Sobolev References: <201011160440.oAG4e3YU039413@svn.freebsd.org> Date: Tue, 16 Nov 2010 14:11:22 +0100 In-Reply-To: <201011160440.oAG4e3YU039413@svn.freebsd.org> (Maxim Sobolev's message of "Tue, 16 Nov 2010 04:40:03 +0000 (UTC)") Message-ID: <86k4kd8lc5.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r215368 - in stable/7/sys: arm/at91 arm/xscale/ixp425 contrib/dev/oltr dev/ae dev/an dev/ar dev/arl dev/ath dev/awi dev/ce dev/cm dev/cnw dev/cp dev/cs dev/ctau dev/cx dev/cxgb dev/ed d... X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 13:26:58 -0000 Maxim Sobolev writes: > Index: freebsd/base/stable/7/sys/netipx/ipx_input.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- freebsd/base/stable/7/sys/netipx/ipx_input.c (revision > 215367) > +++ freebsd/base/stable/7/sys/netipx/ipx_input.c (revision > 215368) > @@ -119,7 +119,7 @@ > struct ipxpcbhead ipxpcb_list; > struct ipxpcbhead ipxrawpcb_list; >=20=20 > -static int ipxqmaxlen =3D IFQ_MAXLEN; > +static int ipxqmaxlen =3D ifqmaxlen; > static struct ifqueue ipxintrq; >=20=20 > long ipx_pexseq; /* Locked with ipxpcb_list_mtx. */ That's not going to fly. cc -c -O2 -pipe -fno-strict-aliasing -std=3Dc99 -Wall -Wredundant-decls -= Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -= Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdin= c -I. -I/src/sys -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HE= ADERS -include opt_global.h -fno-common -finline-limit=3D15000 --param inli= ne-unit-growth=3D100 --param large-function-growth=3D1000 -fno-builtin -mcm= odel=3Dmedany -msoft-float -ffreestanding -Werror /src/sys/netipx/ipx_inpu= t.c /src/sys/netipx/ipx_input.c:122: error: initializer element is not constant *** Error code 1 DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 16 15:02:53 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1939106566C; Tue, 16 Nov 2010 15:02:53 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF9A88FC08; Tue, 16 Nov 2010 15:02:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAGF2r7r058302; Tue, 16 Nov 2010 15:02:53 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAGF2rfr058300; Tue, 16 Nov 2010 15:02:53 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201011161502.oAGF2rfr058300@svn.freebsd.org> From: Maxim Sobolev Date: Tue, 16 Nov 2010 15:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215400 - stable/7/sys/netipx X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 15:02:54 -0000 Author: sobomax Date: Tue Nov 16 15:02:53 2010 New Revision: 215400 URL: http://svn.freebsd.org/changeset/base/215400 Log: Fix build problem introduced in r215368 MFC when IPX is enabled. Submitted by: des Modified: stable/7/sys/netipx/ipx_input.c Modified: stable/7/sys/netipx/ipx_input.c ============================================================================== --- stable/7/sys/netipx/ipx_input.c Tue Nov 16 14:08:21 2010 (r215399) +++ stable/7/sys/netipx/ipx_input.c Tue Nov 16 15:02:53 2010 (r215400) @@ -119,7 +119,6 @@ struct mtx ipxpcb_list_mtx; struct ipxpcbhead ipxpcb_list; struct ipxpcbhead ipxrawpcb_list; -static int ipxqmaxlen = ifqmaxlen; static struct ifqueue ipxintrq; long ipx_pexseq; /* Locked with ipxpcb_list_mtx. */ @@ -151,7 +150,7 @@ ipx_init(void) ipx_hostmask.sipx_addr.x_net = ipx_broadnet; ipx_hostmask.sipx_addr.x_host = ipx_broadhost; - ipxintrq.ifq_maxlen = ipxqmaxlen; + ipxintrq.ifq_maxlen = ifqmaxlen; mtx_init(&ipxintrq.ifq_mtx, "ipx_inq", NULL, MTX_DEF); netisr_register(NETISR_IPX, ipxintr, &ipxintrq, NETISR_MPSAFE); } From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 16 15:31:16 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F17A81065672; Tue, 16 Nov 2010 15:31:16 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail.sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id B35258FC0C; Tue, 16 Nov 2010 15:31:16 +0000 (UTC) Received: from s0106005004e13421.vs.shawcable.net ([70.71.175.212] helo=[192.168.1.79]) by mail.sippysoft.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.72 (FreeBSD)) (envelope-from ) id 1PIN4E-0001j3-HZ; Tue, 16 Nov 2010 07:03:33 -0800 Message-ID: <4CE29D3C.5040809@sippysoft.com> Date: Tue, 16 Nov 2010 07:03:24 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101027 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <201011160440.oAG4e3YU039413@svn.freebsd.org> <86k4kd8lc5.fsf@ds4.des.no> In-Reply-To: <86k4kd8lc5.fsf@ds4.des.no> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam_report: Spam detection software, running on the system "mail.sippysoft.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: On 11/16/2010 5:11 AM, Dag-Erling Smørgrav wrote: > That's not going to fly. Should be fixed in r215400. Sorry about that. Regards, -- Maksym Sobolyev Sippy Software, Inc. Internet Telephony (VoIP) Experts T/F: +1-646-651-1110 Web: http://www.sippysoft.com MSN: sales@sippysoft.com Skype: SippySoft [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r215368 - in stable/7/sys: arm/at91 arm/xscale/ixp425 contrib/dev/oltr dev/ae dev/an dev/ar dev/arl dev/ath dev/awi dev/ce dev/cm dev/cnw dev/cp dev/cs dev/ctau dev/cx dev/cxgb dev/ed d... X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 15:31:17 -0000 On 11/16/2010 5:11 AM, Dag-Erling Smørgrav wrote: > That's not going to fly. Should be fixed in r215400. Sorry about that. Regards, -- Maksym Sobolyev Sippy Software, Inc. Internet Telephony (VoIP) Experts T/F: +1-646-651-1110 Web: http://www.sippysoft.com MSN: sales@sippysoft.com Skype: SippySoft From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 16 18:25:01 2010 Return-Path: Delivered-To: svn-src-stable-7@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40A1C1065670; Tue, 16 Nov 2010 18:25:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx10.syd.optusnet.com.au (fallbackmx10.syd.optusnet.com.au [211.29.132.251]) by mx1.freebsd.org (Postfix) with ESMTP id C94258FC0A; Tue, 16 Nov 2010 18:25:00 +0000 (UTC) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by fallbackmx10.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oAGGCTd8013288; Wed, 17 Nov 2010 03:12:29 +1100 Received: from c122-106-146-145.carlnfd1.nsw.optusnet.com.au (c122-106-146-145.carlnfd1.nsw.optusnet.com.au [122.106.146.145]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oAGGCPq9008655 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 17 Nov 2010 03:12:26 +1100 Date: Wed, 17 Nov 2010 03:12:25 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Maxim Sobolev In-Reply-To: <201011160440.oAG4e3YU039413@svn.freebsd.org> Message-ID: <20101117030118.X1203@besplex.bde.org> References: <201011160440.oAG4e3YU039413@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-7@FreeBSD.org Subject: Re: svn commit: r215368 - in stable/7/sys: arm/at91 arm/xscale/ixp425 contrib/dev/oltr dev/ae dev/an dev/ar dev/arl dev/ath dev/awi dev/ce dev/cm dev/cnw dev/cp dev/cs dev/ctau dev/cx dev/cxgb dev/ed d... X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 18:25:01 -0000 On Tue, 16 Nov 2010, Maxim Sobolev wrote: > Log: > MFC r207554: > > Add new tunable 'net.link.ifqmaxlen' to set default send interface > queue length. The default value for this parameter is 50, which is > quite low for many of today's uses and the only way to modify this > parameter right now is to edit if_var.h file. Also add read-only > sysctl with the same name, so that it's possible to retrieve the > current value. This was quite low for yestdeay's uses (starting in about 1995), but today it is little missed since only yesterday's low-end hardware uses it. Most of today's interfaces are 1Gbps, and for this it is almost essential for the hardware to have a ring buffer with > 50 entries, so most of today's drivers ignore ifqmaxlen and set the queue length to the almost equally bogus value of the ring buffer size (-1). I set it to about 10000 instead in bge and em (10000 is too large, but fixes streaming under certain loads when hz is small). > Modified: > stable/7/sys/arm/at91/if_ate.c > stable/7/sys/arm/xscale/ixp425/if_npe.c > stable/7/sys/contrib/dev/oltr/if_oltr.c > stable/7/sys/dev/ae/if_ae.c > stable/7/sys/dev/an/if_an.c > stable/7/sys/dev/ar/if_ar.c > stable/7/sys/dev/arl/if_arl.c > stable/7/sys/dev/ath/if_ath.c > stable/7/sys/dev/awi/awi.c > stable/7/sys/dev/ce/if_ce.c > stable/7/sys/dev/cm/smc90cx6.c > stable/7/sys/dev/cnw/if_cnw.c > stable/7/sys/dev/cp/if_cp.c > stable/7/sys/dev/cs/if_cs.c > stable/7/sys/dev/ctau/if_ct.c > stable/7/sys/dev/cx/if_cx.c > stable/7/sys/dev/cxgb/cxgb_main.c > stable/7/sys/dev/ed/if_ed.c > stable/7/sys/dev/ep/if_ep.c > stable/7/sys/dev/ex/if_ex.c > stable/7/sys/dev/ie/if_ie.c > stable/7/sys/dev/iicbus/if_ic.c > stable/7/sys/dev/ipw/if_ipw.c > stable/7/sys/dev/iwi/if_iwi.c > stable/7/sys/dev/le/lance.c > stable/7/sys/dev/malo/if_malo.c > stable/7/sys/dev/my/if_my.c > stable/7/sys/dev/nxge/if_nxge.c > stable/7/sys/dev/pdq/pdq_ifsubr.c > stable/7/sys/dev/ppbus/if_plip.c > stable/7/sys/dev/ral/rt2560.c > stable/7/sys/dev/ral/rt2661.c > stable/7/sys/dev/ray/if_ray.c > stable/7/sys/dev/sbni/if_sbni.c > stable/7/sys/dev/sbsh/if_sbsh.c > stable/7/sys/dev/sn/if_sn.c > stable/7/sys/dev/snc/dp83932.c > stable/7/sys/dev/sr/if_sr.c > stable/7/sys/dev/usb/if_aue.c > stable/7/sys/dev/usb/if_axe.c > stable/7/sys/dev/usb/if_cdce.c > stable/7/sys/dev/usb/if_cue.c > stable/7/sys/dev/usb/if_kue.c > stable/7/sys/dev/usb/if_rue.c > stable/7/sys/dev/usb/if_rum.c > stable/7/sys/dev/usb/if_udav.c > stable/7/sys/dev/usb/if_ural.c > stable/7/sys/dev/usb/if_zyd.c > stable/7/sys/dev/usb/udbp.c > stable/7/sys/dev/vx/if_vx.c > stable/7/sys/dev/wi/if_wi.c > stable/7/sys/dev/wl/if_wl.c > stable/7/sys/dev/wpi/if_wpi.c > stable/7/sys/dev/xe/if_xe.c > stable/7/sys/i4b/capi/capi_l4if.c > stable/7/sys/i4b/driver/i4b_ing.c > stable/7/sys/i4b/driver/i4b_isppp.c > stable/7/sys/i4b/driver/i4b_trace.c > stable/7/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c > stable/7/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c > stable/7/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c > stable/7/sys/i4b/layer1/ihfc/i4b_ihfc_drv.c > stable/7/sys/i4b/layer1/isic/i4b_bchan.c > stable/7/sys/i4b/layer1/itjc/i4b_itjc_pci.c > stable/7/sys/i4b/layer1/iwic/i4b_iwic_bchan.c > stable/7/sys/i4b/layer4/i4b_i4bdrv.c Note that there is only yeterday's hardware in this list. The queue length should be per-interface and configured only by a sysctl, or better, drivers dynamically configure it to a good value. Bruce From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 16 20:27:02 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EE571065675; Tue, 16 Nov 2010 20:27:02 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 123C48FC08; Tue, 16 Nov 2010 20:27:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAGKR105066368; Tue, 16 Nov 2010 20:27:01 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAGKR1dJ066366; Tue, 16 Nov 2010 20:27:01 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011162027.oAGKR1dJ066366@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 16 Nov 2010 20:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215404 - stable/7/sys/dev/re X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 20:27:02 -0000 Author: yongari Date: Tue Nov 16 20:27:01 2010 New Revision: 215404 URL: http://svn.freebsd.org/changeset/base/215404 Log: MFC r214992: Reduce spin wait time consumed in GMII register access routine. There were a couple of attempts in the past to reduce it since it took more than 1ms. Because mii_tick() periodically polls link status, waiting more than 1ms for each GMII register access was overkill. Unfortunately all previous attempts were failed with various ways on different controllers. This time, add additional 20us dealy at the end of GMII register access which seems to requirement of all RealTek controllers to issue next GMII register access request. This is the same way what Linux does. Modified: stable/7/sys/dev/re/if_re.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Tue Nov 16 20:21:53 2010 (r215403) +++ stable/7/sys/dev/re/if_re.c Tue Nov 16 20:27:01 2010 (r215404) @@ -424,13 +424,12 @@ re_gmii_readreg(device_t dev, int phy, i } CSR_WRITE_4(sc, RL_PHYAR, reg << 16); - DELAY(1000); for (i = 0; i < RL_PHY_TIMEOUT; i++) { rval = CSR_READ_4(sc, RL_PHYAR); if (rval & RL_PHYAR_BUSY) break; - DELAY(100); + DELAY(25); } if (i == RL_PHY_TIMEOUT) { @@ -438,6 +437,11 @@ re_gmii_readreg(device_t dev, int phy, i return (0); } + /* + * Controller requires a 20us delay to process next MDIO request. + */ + DELAY(20); + return (rval & RL_PHYAR_PHYDATA); } @@ -452,13 +456,12 @@ re_gmii_writereg(device_t dev, int phy, CSR_WRITE_4(sc, RL_PHYAR, (reg << 16) | (data & RL_PHYAR_PHYDATA) | RL_PHYAR_BUSY); - DELAY(1000); for (i = 0; i < RL_PHY_TIMEOUT; i++) { rval = CSR_READ_4(sc, RL_PHYAR); if (!(rval & RL_PHYAR_BUSY)) break; - DELAY(100); + DELAY(25); } if (i == RL_PHY_TIMEOUT) { @@ -466,6 +469,11 @@ re_gmii_writereg(device_t dev, int phy, return (0); } + /* + * Controller requires a 20us delay to process next MDIO request. + */ + DELAY(20); + return (0); } From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 16 20:34:01 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17FB81065673; Tue, 16 Nov 2010 20:34:01 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF1008FC25; Tue, 16 Nov 2010 20:34:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAGKY0fR066649; Tue, 16 Nov 2010 20:34:00 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAGKY020066646; Tue, 16 Nov 2010 20:34:00 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011162034.oAGKY020066646@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 16 Nov 2010 20:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215406 - in stable/7/sys: dev/re pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 20:34:01 -0000 Author: yongari Date: Tue Nov 16 20:34:00 2010 New Revision: 215406 URL: http://svn.freebsd.org/changeset/base/215406 Log: MFC r215017,215025: Follow the lead of vendor's interrupt moderation mechanism. It seems RTL8169/RTL8168/RTL810xE has a kind of interrupt moderation mechanism but it is not documented at all. The magic value dramatically reduced number of interrupts without noticeable performance drops so apply it to all RTL8169/RTL8169 controllers. Vendor's FreeBSD driver also applies it to RTL810xE controllers but their Linux driver explicitly cleared the register, so do not enable interrupt moderation for RTL810xE controllers. While I'm here sort 8169 specific registers. Obtained from: RealTek FreeBSD driver MFC r215025: Only moderate TX completion interrupts. Relying on taskqueue to suppress RX interrupts seems to give better RX performance than RX interrupt moderation. Modified: stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Tue Nov 16 20:32:09 2010 (r215405) +++ stable/7/sys/dev/re/if_re.c Tue Nov 16 20:34:00 2010 (r215406) @@ -2709,6 +2709,24 @@ re_init_locked(struct rl_softc *sc) */ re_set_rxmode(sc); + /* Configure interrupt moderation. */ + if (sc->rl_type == RL_8169) { + switch (sc->rl_hwrev) { + case RL_HWREV_8100E: + case RL_HWREV_8101E: + case RL_HWREV_8102E: + case RL_HWREV_8102EL: + case RL_HWREV_8102EL_SPIN1: + case RL_HWREV_8103E: + CSR_WRITE_2(sc, RL_INTRMOD, 0); + break; + default: + /* Magic from vendor. */ + CSR_WRITE_2(sc, RL_INTRMOD, 0x5100); + break; + } + } + #ifdef DEVICE_POLLING /* * Disable interrupts if we are polling. Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Tue Nov 16 20:32:09 2010 (r215405) +++ stable/7/sys/pci/if_rlreg.h Tue Nov 16 20:34:00 2010 (r215406) @@ -125,6 +125,7 @@ /* * Registers specific to the 8169 gigE chip */ +#define RL_GTXSTART 0x0038 /* 8 bits */ #define RL_TIMERINT_8169 0x0058 /* different offset than 8139 */ #define RL_PHYAR 0x0060 #define RL_TBICSR 0x0064 @@ -135,7 +136,7 @@ #define RL_GPIO 0x006E /* 8 bits, 8168C SPIN2 only */ #define RL_PMCH 0x006F /* 8 bits */ #define RL_MAXRXPKTLEN 0x00DA /* 16 bits, chip multiplies by 8 */ -#define RL_GTXSTART 0x0038 /* 8 bits */ +#define RL_INTRMOD 0x00E2 /* 16 bits */ /* * TX config register bits From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 16 20:38:42 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 008E6106566C; Tue, 16 Nov 2010 20:38:42 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1D388FC17; Tue, 16 Nov 2010 20:38:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAGKcf0K066920; Tue, 16 Nov 2010 20:38:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAGKcf5R066918; Tue, 16 Nov 2010 20:38:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011162038.oAGKcf5R066918@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 16 Nov 2010 20:38:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215408 - stable/7/sys/pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 20:38:42 -0000 Author: yongari Date: Tue Nov 16 20:38:41 2010 New Revision: 215408 URL: http://svn.freebsd.org/changeset/base/215408 Log: MFC r215018-215020: r215018: Consistently use tab character instead of using space character. No functional changes. r215019: Remove trailing white spaces. r215020: Remove standard PCI configuration space register definitions. Modified: stable/7/sys/pci/if_rlreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Tue Nov 16 20:36:52 2010 (r215407) +++ stable/7/sys/pci/if_rlreg.h Tue Nov 16 20:38:41 2010 (r215408) @@ -36,211 +36,211 @@ * RealTek 8129/8139 register offsets */ #define RL_IDR0 0x0000 /* ID register 0 (station addr) */ -#define RL_IDR1 0x0001 /* Must use 32-bit accesses (?) */ -#define RL_IDR2 0x0002 -#define RL_IDR3 0x0003 -#define RL_IDR4 0x0004 -#define RL_IDR5 0x0005 +#define RL_IDR1 0x0001 /* Must use 32-bit accesses (?) */ +#define RL_IDR2 0x0002 +#define RL_IDR3 0x0003 +#define RL_IDR4 0x0004 +#define RL_IDR5 0x0005 /* 0006-0007 reserved */ -#define RL_MAR0 0x0008 /* Multicast hash table */ -#define RL_MAR1 0x0009 -#define RL_MAR2 0x000A -#define RL_MAR3 0x000B -#define RL_MAR4 0x000C -#define RL_MAR5 0x000D -#define RL_MAR6 0x000E -#define RL_MAR7 0x000F - -#define RL_TXSTAT0 0x0010 /* status of TX descriptor 0 */ -#define RL_TXSTAT1 0x0014 /* status of TX descriptor 1 */ -#define RL_TXSTAT2 0x0018 /* status of TX descriptor 2 */ -#define RL_TXSTAT3 0x001C /* status of TX descriptor 3 */ - -#define RL_TXADDR0 0x0020 /* address of TX descriptor 0 */ -#define RL_TXADDR1 0x0024 /* address of TX descriptor 1 */ -#define RL_TXADDR2 0x0028 /* address of TX descriptor 2 */ -#define RL_TXADDR3 0x002C /* address of TX descriptor 3 */ - -#define RL_RXADDR 0x0030 /* RX ring start address */ -#define RL_RX_EARLY_BYTES 0x0034 /* RX early byte count */ -#define RL_RX_EARLY_STAT 0x0036 /* RX early status */ -#define RL_COMMAND 0x0037 /* command register */ -#define RL_CURRXADDR 0x0038 /* current address of packet read */ -#define RL_CURRXBUF 0x003A /* current RX buffer address */ -#define RL_IMR 0x003C /* interrupt mask register */ -#define RL_ISR 0x003E /* interrupt status register */ -#define RL_TXCFG 0x0040 /* transmit config */ -#define RL_RXCFG 0x0044 /* receive config */ -#define RL_TIMERCNT 0x0048 /* timer count register */ -#define RL_MISSEDPKT 0x004C /* missed packet counter */ -#define RL_EECMD 0x0050 /* EEPROM command register */ -#define RL_CFG0 0x0051 /* config register #0 */ -#define RL_CFG1 0x0052 /* config register #1 */ +#define RL_MAR0 0x0008 /* Multicast hash table */ +#define RL_MAR1 0x0009 +#define RL_MAR2 0x000A +#define RL_MAR3 0x000B +#define RL_MAR4 0x000C +#define RL_MAR5 0x000D +#define RL_MAR6 0x000E +#define RL_MAR7 0x000F + +#define RL_TXSTAT0 0x0010 /* status of TX descriptor 0 */ +#define RL_TXSTAT1 0x0014 /* status of TX descriptor 1 */ +#define RL_TXSTAT2 0x0018 /* status of TX descriptor 2 */ +#define RL_TXSTAT3 0x001C /* status of TX descriptor 3 */ + +#define RL_TXADDR0 0x0020 /* address of TX descriptor 0 */ +#define RL_TXADDR1 0x0024 /* address of TX descriptor 1 */ +#define RL_TXADDR2 0x0028 /* address of TX descriptor 2 */ +#define RL_TXADDR3 0x002C /* address of TX descriptor 3 */ + +#define RL_RXADDR 0x0030 /* RX ring start address */ +#define RL_RX_EARLY_BYTES 0x0034 /* RX early byte count */ +#define RL_RX_EARLY_STAT 0x0036 /* RX early status */ +#define RL_COMMAND 0x0037 /* command register */ +#define RL_CURRXADDR 0x0038 /* current address of packet read */ +#define RL_CURRXBUF 0x003A /* current RX buffer address */ +#define RL_IMR 0x003C /* interrupt mask register */ +#define RL_ISR 0x003E /* interrupt status register */ +#define RL_TXCFG 0x0040 /* transmit config */ +#define RL_RXCFG 0x0044 /* receive config */ +#define RL_TIMERCNT 0x0048 /* timer count register */ +#define RL_MISSEDPKT 0x004C /* missed packet counter */ +#define RL_EECMD 0x0050 /* EEPROM command register */ +#define RL_CFG0 0x0051 /* config register #0 */ +#define RL_CFG1 0x0052 /* config register #1 */ #define RL_CFG2 0x0053 /* config register #2 */ #define RL_CFG3 0x0054 /* config register #3 */ #define RL_CFG4 0x0055 /* config register #4 */ #define RL_CFG5 0x0056 /* config register #5 */ /* 0057 reserved */ -#define RL_MEDIASTAT 0x0058 /* media status register (8139) */ +#define RL_MEDIASTAT 0x0058 /* media status register (8139) */ /* 0059-005A reserved */ -#define RL_MII 0x005A /* 8129 chip only */ -#define RL_HALTCLK 0x005B -#define RL_MULTIINTR 0x005C /* multiple interrupt */ -#define RL_PCIREV 0x005E /* PCI revision value */ +#define RL_MII 0x005A /* 8129 chip only */ +#define RL_HALTCLK 0x005B +#define RL_MULTIINTR 0x005C /* multiple interrupt */ +#define RL_PCIREV 0x005E /* PCI revision value */ /* 005F reserved */ -#define RL_TXSTAT_ALL 0x0060 /* TX status of all descriptors */ +#define RL_TXSTAT_ALL 0x0060 /* TX status of all descriptors */ /* Direct PHY access registers only available on 8139 */ -#define RL_BMCR 0x0062 /* PHY basic mode control */ -#define RL_BMSR 0x0064 /* PHY basic mode status */ -#define RL_ANAR 0x0066 /* PHY autoneg advert */ -#define RL_LPAR 0x0068 /* PHY link partner ability */ -#define RL_ANER 0x006A /* PHY autoneg expansion */ - -#define RL_DISCCNT 0x006C /* disconnect counter */ -#define RL_FALSECAR 0x006E /* false carrier counter */ -#define RL_NWAYTST 0x0070 /* NWAY test register */ -#define RL_RX_ER 0x0072 /* RX_ER counter */ -#define RL_CSCFG 0x0074 /* CS configuration register */ +#define RL_BMCR 0x0062 /* PHY basic mode control */ +#define RL_BMSR 0x0064 /* PHY basic mode status */ +#define RL_ANAR 0x0066 /* PHY autoneg advert */ +#define RL_LPAR 0x0068 /* PHY link partner ability */ +#define RL_ANER 0x006A /* PHY autoneg expansion */ + +#define RL_DISCCNT 0x006C /* disconnect counter */ +#define RL_FALSECAR 0x006E /* false carrier counter */ +#define RL_NWAYTST 0x0070 /* NWAY test register */ +#define RL_RX_ER 0x0072 /* RX_ER counter */ +#define RL_CSCFG 0x0074 /* CS configuration register */ /* * When operating in special C+ mode, some of the registers in an * 8139C+ chip have different definitions. These are also used for * the 8169 gigE chip. */ -#define RL_DUMPSTATS_LO 0x0010 /* counter dump command register */ -#define RL_DUMPSTATS_HI 0x0014 /* counter dump command register */ -#define RL_TXLIST_ADDR_LO 0x0020 /* 64 bits, 256 byte alignment */ -#define RL_TXLIST_ADDR_HI 0x0024 /* 64 bits, 256 byte alignment */ -#define RL_TXLIST_ADDR_HPRIO_LO 0x0028 /* 64 bits, 256 byte alignment */ -#define RL_TXLIST_ADDR_HPRIO_HI 0x002C /* 64 bits, 256 byte alignment */ -#define RL_CFG2 0x0053 -#define RL_TIMERINT 0x0054 /* interrupt on timer expire */ -#define RL_TXSTART 0x00D9 /* 8 bits */ -#define RL_CPLUS_CMD 0x00E0 /* 16 bits */ -#define RL_RXLIST_ADDR_LO 0x00E4 /* 64 bits, 256 byte alignment */ -#define RL_RXLIST_ADDR_HI 0x00E8 /* 64 bits, 256 byte alignment */ -#define RL_EARLY_TX_THRESH 0x00EC /* 8 bits */ +#define RL_DUMPSTATS_LO 0x0010 /* counter dump command register */ +#define RL_DUMPSTATS_HI 0x0014 /* counter dump command register */ +#define RL_TXLIST_ADDR_LO 0x0020 /* 64 bits, 256 byte alignment */ +#define RL_TXLIST_ADDR_HI 0x0024 /* 64 bits, 256 byte alignment */ +#define RL_TXLIST_ADDR_HPRIO_LO 0x0028 /* 64 bits, 256 byte alignment */ +#define RL_TXLIST_ADDR_HPRIO_HI 0x002C /* 64 bits, 256 byte alignment */ +#define RL_CFG2 0x0053 +#define RL_TIMERINT 0x0054 /* interrupt on timer expire */ +#define RL_TXSTART 0x00D9 /* 8 bits */ +#define RL_CPLUS_CMD 0x00E0 /* 16 bits */ +#define RL_RXLIST_ADDR_LO 0x00E4 /* 64 bits, 256 byte alignment */ +#define RL_RXLIST_ADDR_HI 0x00E8 /* 64 bits, 256 byte alignment */ +#define RL_EARLY_TX_THRESH 0x00EC /* 8 bits */ /* * Registers specific to the 8169 gigE chip */ -#define RL_GTXSTART 0x0038 /* 8 bits */ -#define RL_TIMERINT_8169 0x0058 /* different offset than 8139 */ -#define RL_PHYAR 0x0060 -#define RL_TBICSR 0x0064 -#define RL_TBI_ANAR 0x0068 -#define RL_TBI_LPAR 0x006A -#define RL_GMEDIASTAT 0x006C /* 8 bits */ -#define RL_MACDBG 0x006D /* 8 bits, 8168C SPIN2 only */ -#define RL_GPIO 0x006E /* 8 bits, 8168C SPIN2 only */ -#define RL_PMCH 0x006F /* 8 bits */ -#define RL_MAXRXPKTLEN 0x00DA /* 16 bits, chip multiplies by 8 */ -#define RL_INTRMOD 0x00E2 /* 16 bits */ +#define RL_GTXSTART 0x0038 /* 8 bits */ +#define RL_TIMERINT_8169 0x0058 /* different offset than 8139 */ +#define RL_PHYAR 0x0060 +#define RL_TBICSR 0x0064 +#define RL_TBI_ANAR 0x0068 +#define RL_TBI_LPAR 0x006A +#define RL_GMEDIASTAT 0x006C /* 8 bits */ +#define RL_MACDBG 0x006D /* 8 bits, 8168C SPIN2 only */ +#define RL_GPIO 0x006E /* 8 bits, 8168C SPIN2 only */ +#define RL_PMCH 0x006F /* 8 bits */ +#define RL_MAXRXPKTLEN 0x00DA /* 16 bits, chip multiplies by 8 */ +#define RL_INTRMOD 0x00E2 /* 16 bits */ /* * TX config register bits */ -#define RL_TXCFG_CLRABRT 0x00000001 /* retransmit aborted pkt */ -#define RL_TXCFG_MAXDMA 0x00000700 /* max DMA burst size */ -#define RL_TXCFG_CRCAPPEND 0x00010000 /* CRC append (0 = yes) */ -#define RL_TXCFG_LOOPBKTST 0x00060000 /* loopback test */ -#define RL_TXCFG_IFG2 0x00080000 /* 8169 only */ -#define RL_TXCFG_IFG 0x03000000 /* interframe gap */ -#define RL_TXCFG_HWREV 0x7CC00000 - -#define RL_LOOPTEST_OFF 0x00000000 -#define RL_LOOPTEST_ON 0x00020000 -#define RL_LOOPTEST_ON_CPLUS 0x00060000 +#define RL_TXCFG_CLRABRT 0x00000001 /* retransmit aborted pkt */ +#define RL_TXCFG_MAXDMA 0x00000700 /* max DMA burst size */ +#define RL_TXCFG_CRCAPPEND 0x00010000 /* CRC append (0 = yes) */ +#define RL_TXCFG_LOOPBKTST 0x00060000 /* loopback test */ +#define RL_TXCFG_IFG2 0x00080000 /* 8169 only */ +#define RL_TXCFG_IFG 0x03000000 /* interframe gap */ +#define RL_TXCFG_HWREV 0x7CC00000 + +#define RL_LOOPTEST_OFF 0x00000000 +#define RL_LOOPTEST_ON 0x00020000 +#define RL_LOOPTEST_ON_CPLUS 0x00060000 /* Known revision codes. */ -#define RL_HWREV_8169 0x00000000 -#define RL_HWREV_8169S 0x00800000 -#define RL_HWREV_8110S 0x04000000 -#define RL_HWREV_8169_8110SB 0x10000000 -#define RL_HWREV_8169_8110SC 0x18000000 -#define RL_HWREV_8102EL 0x24800000 -#define RL_HWREV_8102EL_SPIN1 0x24C00000 -#define RL_HWREV_8168D 0x28000000 -#define RL_HWREV_8168DP 0x28800000 -#define RL_HWREV_8168E 0x2C000000 -#define RL_HWREV_8168_SPIN1 0x30000000 -#define RL_HWREV_8100E 0x30800000 -#define RL_HWREV_8101E 0x34000000 -#define RL_HWREV_8102E 0x34800000 -#define RL_HWREV_8103E 0x34C00000 -#define RL_HWREV_8168_SPIN2 0x38000000 -#define RL_HWREV_8168_SPIN3 0x38400000 -#define RL_HWREV_8168C 0x3C000000 -#define RL_HWREV_8168C_SPIN2 0x3C400000 -#define RL_HWREV_8168CP 0x3C800000 -#define RL_HWREV_8139 0x60000000 -#define RL_HWREV_8139A 0x70000000 -#define RL_HWREV_8139AG 0x70800000 -#define RL_HWREV_8139B 0x78000000 -#define RL_HWREV_8130 0x7C000000 -#define RL_HWREV_8139C 0x74000000 -#define RL_HWREV_8139D 0x74400000 -#define RL_HWREV_8139CPLUS 0x74800000 -#define RL_HWREV_8101 0x74C00000 -#define RL_HWREV_8100 0x78800000 -#define RL_HWREV_8169_8110SBL 0x7CC00000 -#define RL_HWREV_8169_8110SCE 0x98000000 - -#define RL_TXDMA_16BYTES 0x00000000 -#define RL_TXDMA_32BYTES 0x00000100 -#define RL_TXDMA_64BYTES 0x00000200 -#define RL_TXDMA_128BYTES 0x00000300 -#define RL_TXDMA_256BYTES 0x00000400 -#define RL_TXDMA_512BYTES 0x00000500 -#define RL_TXDMA_1024BYTES 0x00000600 -#define RL_TXDMA_2048BYTES 0x00000700 +#define RL_HWREV_8169 0x00000000 +#define RL_HWREV_8169S 0x00800000 +#define RL_HWREV_8110S 0x04000000 +#define RL_HWREV_8169_8110SB 0x10000000 +#define RL_HWREV_8169_8110SC 0x18000000 +#define RL_HWREV_8102EL 0x24800000 +#define RL_HWREV_8102EL_SPIN1 0x24C00000 +#define RL_HWREV_8168D 0x28000000 +#define RL_HWREV_8168DP 0x28800000 +#define RL_HWREV_8168E 0x2C000000 +#define RL_HWREV_8168_SPIN1 0x30000000 +#define RL_HWREV_8100E 0x30800000 +#define RL_HWREV_8101E 0x34000000 +#define RL_HWREV_8102E 0x34800000 +#define RL_HWREV_8103E 0x34C00000 +#define RL_HWREV_8168_SPIN2 0x38000000 +#define RL_HWREV_8168_SPIN3 0x38400000 +#define RL_HWREV_8168C 0x3C000000 +#define RL_HWREV_8168C_SPIN2 0x3C400000 +#define RL_HWREV_8168CP 0x3C800000 +#define RL_HWREV_8139 0x60000000 +#define RL_HWREV_8139A 0x70000000 +#define RL_HWREV_8139AG 0x70800000 +#define RL_HWREV_8139B 0x78000000 +#define RL_HWREV_8130 0x7C000000 +#define RL_HWREV_8139C 0x74000000 +#define RL_HWREV_8139D 0x74400000 +#define RL_HWREV_8139CPLUS 0x74800000 +#define RL_HWREV_8101 0x74C00000 +#define RL_HWREV_8100 0x78800000 +#define RL_HWREV_8169_8110SBL 0x7CC00000 +#define RL_HWREV_8169_8110SCE 0x98000000 + +#define RL_TXDMA_16BYTES 0x00000000 +#define RL_TXDMA_32BYTES 0x00000100 +#define RL_TXDMA_64BYTES 0x00000200 +#define RL_TXDMA_128BYTES 0x00000300 +#define RL_TXDMA_256BYTES 0x00000400 +#define RL_TXDMA_512BYTES 0x00000500 +#define RL_TXDMA_1024BYTES 0x00000600 +#define RL_TXDMA_2048BYTES 0x00000700 /* * Transmit descriptor status register bits. */ -#define RL_TXSTAT_LENMASK 0x00001FFF -#define RL_TXSTAT_OWN 0x00002000 -#define RL_TXSTAT_TX_UNDERRUN 0x00004000 -#define RL_TXSTAT_TX_OK 0x00008000 -#define RL_TXSTAT_EARLY_THRESH 0x003F0000 -#define RL_TXSTAT_COLLCNT 0x0F000000 -#define RL_TXSTAT_CARR_HBEAT 0x10000000 -#define RL_TXSTAT_OUTOFWIN 0x20000000 -#define RL_TXSTAT_TXABRT 0x40000000 -#define RL_TXSTAT_CARRLOSS 0x80000000 +#define RL_TXSTAT_LENMASK 0x00001FFF +#define RL_TXSTAT_OWN 0x00002000 +#define RL_TXSTAT_TX_UNDERRUN 0x00004000 +#define RL_TXSTAT_TX_OK 0x00008000 +#define RL_TXSTAT_EARLY_THRESH 0x003F0000 +#define RL_TXSTAT_COLLCNT 0x0F000000 +#define RL_TXSTAT_CARR_HBEAT 0x10000000 +#define RL_TXSTAT_OUTOFWIN 0x20000000 +#define RL_TXSTAT_TXABRT 0x40000000 +#define RL_TXSTAT_CARRLOSS 0x80000000 /* * Interrupt status register bits. */ -#define RL_ISR_RX_OK 0x0001 -#define RL_ISR_RX_ERR 0x0002 -#define RL_ISR_TX_OK 0x0004 -#define RL_ISR_TX_ERR 0x0008 -#define RL_ISR_RX_OVERRUN 0x0010 -#define RL_ISR_PKT_UNDERRUN 0x0020 -#define RL_ISR_LINKCHG 0x0020 /* 8169 only */ -#define RL_ISR_FIFO_OFLOW 0x0040 /* 8139 only */ -#define RL_ISR_TX_DESC_UNAVAIL 0x0080 /* C+ only */ -#define RL_ISR_SWI 0x0100 /* C+ only */ -#define RL_ISR_CABLE_LEN_CHGD 0x2000 -#define RL_ISR_PCS_TIMEOUT 0x4000 /* 8129 only */ -#define RL_ISR_TIMEOUT_EXPIRED 0x4000 -#define RL_ISR_SYSTEM_ERR 0x8000 +#define RL_ISR_RX_OK 0x0001 +#define RL_ISR_RX_ERR 0x0002 +#define RL_ISR_TX_OK 0x0004 +#define RL_ISR_TX_ERR 0x0008 +#define RL_ISR_RX_OVERRUN 0x0010 +#define RL_ISR_PKT_UNDERRUN 0x0020 +#define RL_ISR_LINKCHG 0x0020 /* 8169 only */ +#define RL_ISR_FIFO_OFLOW 0x0040 /* 8139 only */ +#define RL_ISR_TX_DESC_UNAVAIL 0x0080 /* C+ only */ +#define RL_ISR_SWI 0x0100 /* C+ only */ +#define RL_ISR_CABLE_LEN_CHGD 0x2000 +#define RL_ISR_PCS_TIMEOUT 0x4000 /* 8129 only */ +#define RL_ISR_TIMEOUT_EXPIRED 0x4000 +#define RL_ISR_SYSTEM_ERR 0x8000 -#define RL_INTRS \ +#define RL_INTRS \ (RL_ISR_TX_OK|RL_ISR_RX_OK|RL_ISR_RX_ERR|RL_ISR_TX_ERR| \ RL_ISR_RX_OVERRUN|RL_ISR_PKT_UNDERRUN|RL_ISR_FIFO_OFLOW| \ RL_ISR_PCS_TIMEOUT|RL_ISR_SYSTEM_ERR) #ifdef RE_TX_MODERATION -#define RL_INTRS_CPLUS \ +#define RL_INTRS_CPLUS \ (RL_ISR_RX_OK|RL_ISR_RX_ERR|RL_ISR_TX_ERR| \ RL_ISR_RX_OVERRUN|RL_ISR_PKT_UNDERRUN|RL_ISR_FIFO_OFLOW| \ RL_ISR_PCS_TIMEOUT|RL_ISR_SYSTEM_ERR|RL_ISR_TIMEOUT_EXPIRED) #else -#define RL_INTRS_CPLUS \ +#define RL_INTRS_CPLUS \ (RL_ISR_RX_OK|RL_ISR_RX_ERR|RL_ISR_TX_ERR|RL_ISR_TX_OK| \ RL_ISR_RX_OVERRUN|RL_ISR_PKT_UNDERRUN|RL_ISR_FIFO_OFLOW| \ RL_ISR_PCS_TIMEOUT|RL_ISR_SYSTEM_ERR|RL_ISR_TIMEOUT_EXPIRED) @@ -249,169 +249,169 @@ /* * Media status register. (8139 only) */ -#define RL_MEDIASTAT_RXPAUSE 0x01 -#define RL_MEDIASTAT_TXPAUSE 0x02 -#define RL_MEDIASTAT_LINK 0x04 -#define RL_MEDIASTAT_SPEED10 0x08 -#define RL_MEDIASTAT_RXFLOWCTL 0x40 /* duplex mode */ -#define RL_MEDIASTAT_TXFLOWCTL 0x80 /* duplex mode */ +#define RL_MEDIASTAT_RXPAUSE 0x01 +#define RL_MEDIASTAT_TXPAUSE 0x02 +#define RL_MEDIASTAT_LINK 0x04 +#define RL_MEDIASTAT_SPEED10 0x08 +#define RL_MEDIASTAT_RXFLOWCTL 0x40 /* duplex mode */ +#define RL_MEDIASTAT_TXFLOWCTL 0x80 /* duplex mode */ /* * Receive config register. */ -#define RL_RXCFG_RX_ALLPHYS 0x00000001 /* accept all nodes */ -#define RL_RXCFG_RX_INDIV 0x00000002 /* match filter */ -#define RL_RXCFG_RX_MULTI 0x00000004 /* accept all multicast */ -#define RL_RXCFG_RX_BROAD 0x00000008 /* accept all broadcast */ -#define RL_RXCFG_RX_RUNT 0x00000010 -#define RL_RXCFG_RX_ERRPKT 0x00000020 -#define RL_RXCFG_WRAP 0x00000080 -#define RL_RXCFG_MAXDMA 0x00000700 -#define RL_RXCFG_BUFSZ 0x00001800 -#define RL_RXCFG_FIFOTHRESH 0x0000E000 -#define RL_RXCFG_EARLYTHRESH 0x07000000 - -#define RL_RXDMA_16BYTES 0x00000000 -#define RL_RXDMA_32BYTES 0x00000100 -#define RL_RXDMA_64BYTES 0x00000200 -#define RL_RXDMA_128BYTES 0x00000300 -#define RL_RXDMA_256BYTES 0x00000400 -#define RL_RXDMA_512BYTES 0x00000500 -#define RL_RXDMA_1024BYTES 0x00000600 -#define RL_RXDMA_UNLIMITED 0x00000700 - -#define RL_RXBUF_8 0x00000000 -#define RL_RXBUF_16 0x00000800 -#define RL_RXBUF_32 0x00001000 -#define RL_RXBUF_64 0x00001800 - -#define RL_RXFIFO_16BYTES 0x00000000 -#define RL_RXFIFO_32BYTES 0x00002000 -#define RL_RXFIFO_64BYTES 0x00004000 -#define RL_RXFIFO_128BYTES 0x00006000 -#define RL_RXFIFO_256BYTES 0x00008000 -#define RL_RXFIFO_512BYTES 0x0000A000 -#define RL_RXFIFO_1024BYTES 0x0000C000 -#define RL_RXFIFO_NOTHRESH 0x0000E000 +#define RL_RXCFG_RX_ALLPHYS 0x00000001 /* accept all nodes */ +#define RL_RXCFG_RX_INDIV 0x00000002 /* match filter */ +#define RL_RXCFG_RX_MULTI 0x00000004 /* accept all multicast */ +#define RL_RXCFG_RX_BROAD 0x00000008 /* accept all broadcast */ +#define RL_RXCFG_RX_RUNT 0x00000010 +#define RL_RXCFG_RX_ERRPKT 0x00000020 +#define RL_RXCFG_WRAP 0x00000080 +#define RL_RXCFG_MAXDMA 0x00000700 +#define RL_RXCFG_BUFSZ 0x00001800 +#define RL_RXCFG_FIFOTHRESH 0x0000E000 +#define RL_RXCFG_EARLYTHRESH 0x07000000 + +#define RL_RXDMA_16BYTES 0x00000000 +#define RL_RXDMA_32BYTES 0x00000100 +#define RL_RXDMA_64BYTES 0x00000200 +#define RL_RXDMA_128BYTES 0x00000300 +#define RL_RXDMA_256BYTES 0x00000400 +#define RL_RXDMA_512BYTES 0x00000500 +#define RL_RXDMA_1024BYTES 0x00000600 +#define RL_RXDMA_UNLIMITED 0x00000700 + +#define RL_RXBUF_8 0x00000000 +#define RL_RXBUF_16 0x00000800 +#define RL_RXBUF_32 0x00001000 +#define RL_RXBUF_64 0x00001800 + +#define RL_RXFIFO_16BYTES 0x00000000 +#define RL_RXFIFO_32BYTES 0x00002000 +#define RL_RXFIFO_64BYTES 0x00004000 +#define RL_RXFIFO_128BYTES 0x00006000 +#define RL_RXFIFO_256BYTES 0x00008000 +#define RL_RXFIFO_512BYTES 0x0000A000 +#define RL_RXFIFO_1024BYTES 0x0000C000 +#define RL_RXFIFO_NOTHRESH 0x0000E000 /* * Bits in RX status header (included with RX'ed packet * in ring buffer). */ -#define RL_RXSTAT_RXOK 0x00000001 -#define RL_RXSTAT_ALIGNERR 0x00000002 -#define RL_RXSTAT_CRCERR 0x00000004 -#define RL_RXSTAT_GIANT 0x00000008 -#define RL_RXSTAT_RUNT 0x00000010 -#define RL_RXSTAT_BADSYM 0x00000020 -#define RL_RXSTAT_BROAD 0x00002000 -#define RL_RXSTAT_INDIV 0x00004000 -#define RL_RXSTAT_MULTI 0x00008000 -#define RL_RXSTAT_LENMASK 0xFFFF0000 +#define RL_RXSTAT_RXOK 0x00000001 +#define RL_RXSTAT_ALIGNERR 0x00000002 +#define RL_RXSTAT_CRCERR 0x00000004 +#define RL_RXSTAT_GIANT 0x00000008 +#define RL_RXSTAT_RUNT 0x00000010 +#define RL_RXSTAT_BADSYM 0x00000020 +#define RL_RXSTAT_BROAD 0x00002000 +#define RL_RXSTAT_INDIV 0x00004000 +#define RL_RXSTAT_MULTI 0x00008000 +#define RL_RXSTAT_LENMASK 0xFFFF0000 -#define RL_RXSTAT_UNFINISHED 0xFFF0 /* DMA still in progress */ +#define RL_RXSTAT_UNFINISHED 0xFFF0 /* DMA still in progress */ /* * Command register. */ -#define RL_CMD_EMPTY_RXBUF 0x0001 -#define RL_CMD_TX_ENB 0x0004 -#define RL_CMD_RX_ENB 0x0008 -#define RL_CMD_RESET 0x0010 -#define RL_CMD_STOPREQ 0x0080 +#define RL_CMD_EMPTY_RXBUF 0x0001 +#define RL_CMD_TX_ENB 0x0004 +#define RL_CMD_RX_ENB 0x0008 +#define RL_CMD_RESET 0x0010 +#define RL_CMD_STOPREQ 0x0080 /* * Twister register values. These are completely undocumented and derived * from public sources. */ -#define RL_CSCFG_LINK_OK 0x0400 -#define RL_CSCFG_CHANGE 0x0800 -#define RL_CSCFG_STATUS 0xf000 -#define RL_CSCFG_ROW3 0x7000 -#define RL_CSCFG_ROW2 0x3000 -#define RL_CSCFG_ROW1 0x1000 -#define RL_CSCFG_LINK_DOWN_OFF_CMD 0x03c0 -#define RL_CSCFG_LINK_DOWN_CMD 0xf3c0 - -#define RL_NWAYTST_RESET 0 -#define RL_NWAYTST_CBL_TEST 0x20 - -#define RL_PARA78 0x78 -#define RL_PARA78_DEF 0x78fa8388 -#define RL_PARA7C 0x7C -#define RL_PARA7C_DEF 0xcb38de43 -#define RL_PARA7C_RETUNE 0xfb38de03 +#define RL_CSCFG_LINK_OK 0x0400 +#define RL_CSCFG_CHANGE 0x0800 +#define RL_CSCFG_STATUS 0xf000 +#define RL_CSCFG_ROW3 0x7000 +#define RL_CSCFG_ROW2 0x3000 +#define RL_CSCFG_ROW1 0x1000 +#define RL_CSCFG_LINK_DOWN_OFF_CMD 0x03c0 +#define RL_CSCFG_LINK_DOWN_CMD 0xf3c0 + +#define RL_NWAYTST_RESET 0 +#define RL_NWAYTST_CBL_TEST 0x20 + +#define RL_PARA78 0x78 +#define RL_PARA78_DEF 0x78fa8388 +#define RL_PARA7C 0x7C +#define RL_PARA7C_DEF 0xcb38de43 +#define RL_PARA7C_RETUNE 0xfb38de03 /* * EEPROM control register */ -#define RL_EE_DATAOUT 0x01 /* Data out */ -#define RL_EE_DATAIN 0x02 /* Data in */ -#define RL_EE_CLK 0x04 /* clock */ -#define RL_EE_SEL 0x08 /* chip select */ -#define RL_EE_MODE (0x40|0x80) - -#define RL_EEMODE_OFF 0x00 -#define RL_EEMODE_AUTOLOAD 0x40 -#define RL_EEMODE_PROGRAM 0x80 -#define RL_EEMODE_WRITECFG (0x80|0x40) +#define RL_EE_DATAOUT 0x01 /* Data out */ +#define RL_EE_DATAIN 0x02 /* Data in */ +#define RL_EE_CLK 0x04 /* clock */ +#define RL_EE_SEL 0x08 /* chip select */ +#define RL_EE_MODE (0x40|0x80) + +#define RL_EEMODE_OFF 0x00 +#define RL_EEMODE_AUTOLOAD 0x40 +#define RL_EEMODE_PROGRAM 0x80 +#define RL_EEMODE_WRITECFG (0x80|0x40) /* 9346 EEPROM commands */ -#define RL_9346_ADDR_LEN 6 /* 93C46 1K: 128x16 */ -#define RL_9356_ADDR_LEN 8 /* 93C56 2K: 256x16 */ +#define RL_9346_ADDR_LEN 6 /* 93C46 1K: 128x16 */ +#define RL_9356_ADDR_LEN 8 /* 93C56 2K: 256x16 */ -#define RL_9346_WRITE 0x5 -#define RL_9346_READ 0x6 -#define RL_9346_ERASE 0x7 -#define RL_9346_EWEN 0x4 -#define RL_9346_EWEN_ADDR 0x30 -#define RL_9456_EWDS 0x4 -#define RL_9346_EWDS_ADDR 0x00 - -#define RL_EECMD_WRITE 0x140 -#define RL_EECMD_READ_6BIT 0x180 -#define RL_EECMD_READ_8BIT 0x600 -#define RL_EECMD_ERASE 0x1c0 - -#define RL_EE_ID 0x00 -#define RL_EE_PCI_VID 0x01 -#define RL_EE_PCI_DID 0x02 +#define RL_9346_WRITE 0x5 +#define RL_9346_READ 0x6 +#define RL_9346_ERASE 0x7 +#define RL_9346_EWEN 0x4 +#define RL_9346_EWEN_ADDR 0x30 +#define RL_9456_EWDS 0x4 +#define RL_9346_EWDS_ADDR 0x00 + +#define RL_EECMD_WRITE 0x140 +#define RL_EECMD_READ_6BIT 0x180 +#define RL_EECMD_READ_8BIT 0x600 +#define RL_EECMD_ERASE 0x1c0 + +#define RL_EE_ID 0x00 +#define RL_EE_PCI_VID 0x01 +#define RL_EE_PCI_DID 0x02 /* Location of station address inside EEPROM */ -#define RL_EE_EADDR 0x07 +#define RL_EE_EADDR 0x07 /* * MII register (8129 only) */ -#define RL_MII_CLK 0x01 -#define RL_MII_DATAIN 0x02 -#define RL_MII_DATAOUT 0x04 -#define RL_MII_DIR 0x80 /* 0 == input, 1 == output */ +#define RL_MII_CLK 0x01 +#define RL_MII_DATAIN 0x02 +#define RL_MII_DATAOUT 0x04 +#define RL_MII_DIR 0x80 /* 0 == input, 1 == output */ /* * Config 0 register */ -#define RL_CFG0_ROM0 0x01 -#define RL_CFG0_ROM1 0x02 -#define RL_CFG0_ROM2 0x04 -#define RL_CFG0_PL0 0x08 -#define RL_CFG0_PL1 0x10 -#define RL_CFG0_10MBPS 0x20 /* 10 Mbps internal mode */ -#define RL_CFG0_PCS 0x40 -#define RL_CFG0_SCR 0x80 +#define RL_CFG0_ROM0 0x01 +#define RL_CFG0_ROM1 0x02 +#define RL_CFG0_ROM2 0x04 +#define RL_CFG0_PL0 0x08 +#define RL_CFG0_PL1 0x10 +#define RL_CFG0_10MBPS 0x20 /* 10 Mbps internal mode */ +#define RL_CFG0_PCS 0x40 +#define RL_CFG0_SCR 0x80 /* * Config 1 register */ -#define RL_CFG1_PWRDWN 0x01 -#define RL_CFG1_PME 0x01 -#define RL_CFG1_SLEEP 0x02 -#define RL_CFG1_VPDEN 0x02 -#define RL_CFG1_IOMAP 0x04 -#define RL_CFG1_MEMMAP 0x08 -#define RL_CFG1_RSVD 0x10 +#define RL_CFG1_PWRDWN 0x01 +#define RL_CFG1_PME 0x01 +#define RL_CFG1_SLEEP 0x02 +#define RL_CFG1_VPDEN 0x02 +#define RL_CFG1_IOMAP 0x04 +#define RL_CFG1_MEMMAP 0x08 +#define RL_CFG1_RSVD 0x10 #define RL_CFG1_LWACT 0x10 -#define RL_CFG1_DRVLOAD 0x20 -#define RL_CFG1_LED0 0x40 -#define RL_CFG1_FULLDUPLEX 0x40 /* 8129 only */ -#define RL_CFG1_LED1 0x80 +#define RL_CFG1_DRVLOAD 0x20 +#define RL_CFG1_LED0 0x40 +#define RL_CFG1_FULLDUPLEX 0x40 /* 8129 only */ +#define RL_CFG1_LED1 0x80 /* * Config 2 register @@ -451,35 +451,35 @@ /* RL_DUMPSTATS_LO register */ -#define RL_DUMPSTATS_START 0x00000008 +#define RL_DUMPSTATS_START 0x00000008 /* Transmit start register */ -#define RL_TXSTART_SWI 0x01 /* generate TX interrupt */ -#define RL_TXSTART_START 0x40 /* start normal queue transmit */ -#define RL_TXSTART_HPRIO_START 0x80 /* start hi prio queue transmit */ +#define RL_TXSTART_SWI 0x01 /* generate TX interrupt */ +#define RL_TXSTART_START 0x40 /* start normal queue transmit */ +#define RL_TXSTART_HPRIO_START 0x80 /* start hi prio queue transmit */ /* * Config 2 register, 8139C+/8169/8169S/8110S only */ -#define RL_CFG2_BUSFREQ 0x07 -#define RL_CFG2_BUSWIDTH 0x08 -#define RL_CFG2_AUXPWRSTS 0x10 - -#define RL_BUSFREQ_33MHZ 0x00 -#define RL_BUSFREQ_66MHZ 0x01 - -#define RL_BUSWIDTH_32BITS 0x00 -#define RL_BUSWIDTH_64BITS 0x08 +#define RL_CFG2_BUSFREQ 0x07 +#define RL_CFG2_BUSWIDTH 0x08 +#define RL_CFG2_AUXPWRSTS 0x10 + +#define RL_BUSFREQ_33MHZ 0x00 +#define RL_BUSFREQ_66MHZ 0x01 + +#define RL_BUSWIDTH_32BITS 0x00 +#define RL_BUSWIDTH_64BITS 0x08 /* C+ mode command register */ -#define RL_CPLUSCMD_TXENB 0x0001 /* enable C+ transmit mode */ -#define RL_CPLUSCMD_RXENB 0x0002 /* enable C+ receive mode */ -#define RL_CPLUSCMD_PCI_MRW 0x0008 /* enable PCI multi-read/write */ -#define RL_CPLUSCMD_PCI_DAC 0x0010 /* PCI dual-address cycle only */ -#define RL_CPLUSCMD_RXCSUM_ENB 0x0020 /* enable RX checksum offload */ -#define RL_CPLUSCMD_VLANSTRIP 0x0040 /* enable VLAN tag stripping */ +#define RL_CPLUSCMD_TXENB 0x0001 /* enable C+ transmit mode */ +#define RL_CPLUSCMD_RXENB 0x0002 /* enable C+ receive mode */ +#define RL_CPLUSCMD_PCI_MRW 0x0008 /* enable PCI multi-read/write */ +#define RL_CPLUSCMD_PCI_DAC 0x0010 /* PCI dual-address cycle only */ +#define RL_CPLUSCMD_RXCSUM_ENB 0x0020 /* enable RX checksum offload */ +#define RL_CPLUSCMD_VLANSTRIP 0x0040 /* enable VLAN tag stripping */ #define RL_CPLUSCMD_MACSTAT_DIS 0x0080 /* 8168B/C/CP */ #define RL_CPLUSCMD_ASF 0x0100 /* 8168C/CP */ #define RL_CPLUSCMD_DBG_SEL 0x0200 /* 8168C/CP */ @@ -492,27 +492,27 @@ /* C+ early transmit threshold */ -#define RL_EARLYTXTHRESH_CNT 0x003F /* byte count times 8 */ +#define RL_EARLYTXTHRESH_CNT 0x003F /* byte count times 8 */ /* * Gigabit PHY access register (8169 only) */ -#define RL_PHYAR_PHYDATA 0x0000FFFF -#define RL_PHYAR_PHYREG 0x001F0000 -#define RL_PHYAR_BUSY 0x80000000 +#define RL_PHYAR_PHYDATA 0x0000FFFF +#define RL_PHYAR_PHYREG 0x001F0000 +#define RL_PHYAR_BUSY 0x80000000 /* * Gigabit media status (8169 only) */ -#define RL_GMEDIASTAT_FDX 0x01 /* full duplex */ -#define RL_GMEDIASTAT_LINK 0x02 /* link up */ -#define RL_GMEDIASTAT_10MBPS 0x04 /* 10mps link */ -#define RL_GMEDIASTAT_100MBPS 0x08 /* 100mbps link */ -#define RL_GMEDIASTAT_1000MBPS 0x10 /* gigE link */ -#define RL_GMEDIASTAT_RXFLOW 0x20 /* RX flow control on */ -#define RL_GMEDIASTAT_TXFLOW 0x40 /* TX flow control on */ -#define RL_GMEDIASTAT_TBI 0x80 /* TBI enabled */ +#define RL_GMEDIASTAT_FDX 0x01 /* full duplex */ +#define RL_GMEDIASTAT_LINK 0x02 /* link up */ +#define RL_GMEDIASTAT_10MBPS 0x04 /* 10mps link */ +#define RL_GMEDIASTAT_100MBPS 0x08 /* 100mbps link */ +#define RL_GMEDIASTAT_1000MBPS 0x10 /* gigE link */ +#define RL_GMEDIASTAT_RXFLOW 0x20 /* RX flow control on */ +#define RL_GMEDIASTAT_TXFLOW 0x40 /* TX flow control on */ +#define RL_GMEDIASTAT_TBI 0x80 /* TBI enabled */ /* * The RealTek doesn't use a fragment-based descriptor mechanism. @@ -529,25 +529,25 @@ * all received packets. */ -#define RL_RX_BUF_SZ RL_RXBUF_64 -#define RL_RXBUFLEN (1 << ((RL_RX_BUF_SZ >> 11) + 13)) -#define RL_TX_LIST_CNT 4 -#define RL_MIN_FRAMELEN 60 +#define RL_RX_BUF_SZ RL_RXBUF_64 +#define RL_RXBUFLEN (1 << ((RL_RX_BUF_SZ >> 11) + 13)) +#define RL_TX_LIST_CNT 4 +#define RL_MIN_FRAMELEN 60 #define RL_TX_8139_BUF_ALIGN 4 #define RL_RX_8139_BUF_ALIGN 8 #define RL_RX_8139_BUF_RESERVE sizeof(int64_t) #define RL_RX_8139_BUF_GUARD_SZ \ - (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN + RL_RX_8139_BUF_RESERVE) -#define RL_TXTHRESH(x) ((x) << 11) -#define RL_TX_THRESH_INIT 96 -#define RL_RX_FIFOTHRESH RL_RXFIFO_NOTHRESH -#define RL_RX_MAXDMA RL_RXDMA_UNLIMITED -#define RL_TX_MAXDMA RL_TXDMA_2048BYTES + (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN + RL_RX_8139_BUF_RESERVE) +#define RL_TXTHRESH(x) ((x) << 11) +#define RL_TX_THRESH_INIT 96 +#define RL_RX_FIFOTHRESH RL_RXFIFO_NOTHRESH +#define RL_RX_MAXDMA RL_RXDMA_UNLIMITED +#define RL_TX_MAXDMA RL_TXDMA_2048BYTES -#define RL_RXCFG_CONFIG (RL_RX_FIFOTHRESH|RL_RX_MAXDMA|RL_RX_BUF_SZ) -#define RL_TXCFG_CONFIG (RL_TXCFG_IFG|RL_TX_MAXDMA) +#define RL_RXCFG_CONFIG (RL_RX_FIFOTHRESH|RL_RX_MAXDMA|RL_RX_BUF_SZ) +#define RL_TXCFG_CONFIG (RL_TXCFG_IFG|RL_TX_MAXDMA) -#define RL_ETHER_ALIGN 2 +#define RL_ETHER_ALIGN 2 /* * re(4) hardware ip4csum-tx could be mangled with 28 bytes or less IP packets. @@ -570,15 +570,15 @@ struct rl_chain_data { uint8_t cur_tx; }; -#define RL_INC(x) (x = (x + 1) % RL_TX_LIST_CNT) -#define RL_CUR_TXADDR(x) ((x->rl_cdata.cur_tx * 4) + RL_TXADDR0) -#define RL_CUR_TXSTAT(x) ((x->rl_cdata.cur_tx * 4) + RL_TXSTAT0) -#define RL_CUR_TXMBUF(x) (x->rl_cdata.rl_tx_chain[x->rl_cdata.cur_tx]) -#define RL_CUR_DMAMAP(x) (x->rl_cdata.rl_tx_dmamap[x->rl_cdata.cur_tx]) -#define RL_LAST_TXADDR(x) ((x->rl_cdata.last_tx * 4) + RL_TXADDR0) -#define RL_LAST_TXSTAT(x) ((x->rl_cdata.last_tx * 4) + RL_TXSTAT0) -#define RL_LAST_TXMBUF(x) (x->rl_cdata.rl_tx_chain[x->rl_cdata.last_tx]) -#define RL_LAST_DMAMAP(x) (x->rl_cdata.rl_tx_dmamap[x->rl_cdata.last_tx]) +#define RL_INC(x) (x = (x + 1) % RL_TX_LIST_CNT) +#define RL_CUR_TXADDR(x) ((x->rl_cdata.cur_tx * 4) + RL_TXADDR0) +#define RL_CUR_TXSTAT(x) ((x->rl_cdata.cur_tx * 4) + RL_TXSTAT0) +#define RL_CUR_TXMBUF(x) (x->rl_cdata.rl_tx_chain[x->rl_cdata.cur_tx]) +#define RL_CUR_DMAMAP(x) (x->rl_cdata.rl_tx_dmamap[x->rl_cdata.cur_tx]) +#define RL_LAST_TXADDR(x) ((x->rl_cdata.last_tx * 4) + RL_TXADDR0) +#define RL_LAST_TXSTAT(x) ((x->rl_cdata.last_tx * 4) + RL_TXSTAT0) +#define RL_LAST_TXMBUF(x) (x->rl_cdata.rl_tx_chain[x->rl_cdata.last_tx]) +#define RL_LAST_DMAMAP(x) (x->rl_cdata.rl_tx_dmamap[x->rl_cdata.last_tx]) struct rl_type { uint16_t rl_vid; @@ -605,17 +605,17 @@ struct rl_mii_frame { /* * MII constants */ -#define RL_MII_STARTDELIM 0x01 -#define RL_MII_READOP 0x02 -#define RL_MII_WRITEOP 0x01 -#define RL_MII_TURNAROUND 0x02 - -#define RL_8129 1 -#define RL_8139 2 -#define RL_8139CPLUS 3 -#define RL_8169 4 +#define RL_MII_STARTDELIM 0x01 +#define RL_MII_READOP 0x02 +#define RL_MII_WRITEOP 0x01 +#define RL_MII_TURNAROUND 0x02 + +#define RL_8129 1 +#define RL_8139 2 +#define RL_8139CPLUS 3 +#define RL_8169 4 -#define RL_ISCPLUS(x) ((x)->rl_type == RL_8139CPLUS || \ +#define RL_ISCPLUS(x) ((x)->rl_type == RL_8139CPLUS || \ (x)->rl_type == RL_8169) /* @@ -639,85 +639,85 @@ struct rl_desc { uint32_t rl_bufaddr_hi; }; -#define RL_TDESC_CMD_FRAGLEN 0x0000FFFF -#define RL_TDESC_CMD_TCPCSUM 0x00010000 /* TCP checksum enable */ -#define RL_TDESC_CMD_UDPCSUM 0x00020000 /* UDP checksum enable */ -#define RL_TDESC_CMD_IPCSUM 0x00040000 /* IP header checksum enable */ -#define RL_TDESC_CMD_MSSVAL 0x07FF0000 /* Large send MSS value */ -#define RL_TDESC_CMD_MSSVAL_SHIFT 16 /* Large send MSS value shift */ -#define RL_TDESC_CMD_LGSEND 0x08000000 /* TCP large send enb */ -#define RL_TDESC_CMD_EOF 0x10000000 /* end of frame marker */ -#define RL_TDESC_CMD_SOF 0x20000000 /* start of frame marker */ -#define RL_TDESC_CMD_EOR 0x40000000 /* end of ring marker */ -#define RL_TDESC_CMD_OWN 0x80000000 /* chip owns descriptor */ +#define RL_TDESC_CMD_FRAGLEN 0x0000FFFF +#define RL_TDESC_CMD_TCPCSUM 0x00010000 /* TCP checksum enable */ +#define RL_TDESC_CMD_UDPCSUM 0x00020000 /* UDP checksum enable */ +#define RL_TDESC_CMD_IPCSUM 0x00040000 /* IP header checksum enable */ +#define RL_TDESC_CMD_MSSVAL 0x07FF0000 /* Large send MSS value */ +#define RL_TDESC_CMD_MSSVAL_SHIFT 16 /* Large send MSS value shift */ +#define RL_TDESC_CMD_LGSEND 0x08000000 /* TCP large send enb */ +#define RL_TDESC_CMD_EOF 0x10000000 /* end of frame marker */ +#define RL_TDESC_CMD_SOF 0x20000000 /* start of frame marker */ +#define RL_TDESC_CMD_EOR 0x40000000 /* end of ring marker */ +#define RL_TDESC_CMD_OWN 0x80000000 /* chip owns descriptor */ -#define RL_TDESC_VLANCTL_TAG 0x00020000 /* Insert VLAN tag */ -#define RL_TDESC_VLANCTL_DATA 0x0000FFFF /* TAG data */ +#define RL_TDESC_VLANCTL_TAG 0x00020000 /* Insert VLAN tag */ +#define RL_TDESC_VLANCTL_DATA 0x0000FFFF /* TAG data */ /* RTL8168C/RTL8168CP/RTL8111C/RTL8111CP */ #define RL_TDESC_CMD_UDPCSUMV2 0x80000000 -#define RL_TDESC_CMD_TCPCSUMV2 0x40000000 -#define RL_TDESC_CMD_IPCSUMV2 0x20000000 +#define RL_TDESC_CMD_TCPCSUMV2 0x40000000 +#define RL_TDESC_CMD_IPCSUMV2 0x20000000 /* * Error bits are valid only on the last descriptor of a frame * (i.e. RL_TDESC_CMD_EOF == 1) */ -#define RL_TDESC_STAT_COLCNT 0x000F0000 /* collision count */ -#define RL_TDESC_STAT_EXCESSCOL 0x00100000 /* excessive collisions */ -#define RL_TDESC_STAT_LINKFAIL 0x00200000 /* link faulure */ -#define RL_TDESC_STAT_OWINCOL 0x00400000 /* out-of-window collision */ -#define RL_TDESC_STAT_TXERRSUM 0x00800000 /* transmit error summary */ -#define RL_TDESC_STAT_UNDERRUN 0x02000000 /* TX underrun occured */ -#define RL_TDESC_STAT_OWN 0x80000000 +#define RL_TDESC_STAT_COLCNT 0x000F0000 /* collision count */ +#define RL_TDESC_STAT_EXCESSCOL 0x00100000 /* excessive collisions */ +#define RL_TDESC_STAT_LINKFAIL 0x00200000 /* link faulure */ +#define RL_TDESC_STAT_OWINCOL 0x00400000 /* out-of-window collision */ +#define RL_TDESC_STAT_TXERRSUM 0x00800000 /* transmit error summary */ +#define RL_TDESC_STAT_UNDERRUN 0x02000000 /* TX underrun occured */ +#define RL_TDESC_STAT_OWN 0x80000000 /* * RX descriptor cmd/vlan definitions */ -#define RL_RDESC_CMD_EOR 0x40000000 -#define RL_RDESC_CMD_OWN 0x80000000 -#define RL_RDESC_CMD_BUFLEN 0x00001FFF - -#define RL_RDESC_STAT_OWN 0x80000000 -#define RL_RDESC_STAT_EOR 0x40000000 -#define RL_RDESC_STAT_SOF 0x20000000 -#define RL_RDESC_STAT_EOF 0x10000000 -#define RL_RDESC_STAT_FRALIGN 0x08000000 /* frame alignment error */ -#define RL_RDESC_STAT_MCAST 0x04000000 /* multicast pkt received */ -#define RL_RDESC_STAT_UCAST 0x02000000 /* unicast pkt received */ -#define RL_RDESC_STAT_BCAST 0x01000000 /* broadcast pkt received */ -#define RL_RDESC_STAT_BUFOFLOW 0x00800000 /* out of buffer space */ -#define RL_RDESC_STAT_FIFOOFLOW 0x00400000 /* FIFO overrun */ -#define RL_RDESC_STAT_GIANT 0x00200000 /* pkt > 4096 bytes */ -#define RL_RDESC_STAT_RXERRSUM 0x00100000 /* RX error summary */ -#define RL_RDESC_STAT_RUNT 0x00080000 /* runt packet received */ -#define RL_RDESC_STAT_CRCERR 0x00040000 /* CRC error */ -#define RL_RDESC_STAT_PROTOID 0x00030000 /* Protocol type */ +#define RL_RDESC_CMD_EOR 0x40000000 +#define RL_RDESC_CMD_OWN 0x80000000 +#define RL_RDESC_CMD_BUFLEN 0x00001FFF + +#define RL_RDESC_STAT_OWN 0x80000000 +#define RL_RDESC_STAT_EOR 0x40000000 +#define RL_RDESC_STAT_SOF 0x20000000 +#define RL_RDESC_STAT_EOF 0x10000000 +#define RL_RDESC_STAT_FRALIGN 0x08000000 /* frame alignment error */ +#define RL_RDESC_STAT_MCAST 0x04000000 /* multicast pkt received */ +#define RL_RDESC_STAT_UCAST 0x02000000 /* unicast pkt received */ +#define RL_RDESC_STAT_BCAST 0x01000000 /* broadcast pkt received */ +#define RL_RDESC_STAT_BUFOFLOW 0x00800000 /* out of buffer space */ +#define RL_RDESC_STAT_FIFOOFLOW 0x00400000 /* FIFO overrun */ +#define RL_RDESC_STAT_GIANT 0x00200000 /* pkt > 4096 bytes */ +#define RL_RDESC_STAT_RXERRSUM 0x00100000 /* RX error summary */ +#define RL_RDESC_STAT_RUNT 0x00080000 /* runt packet received */ +#define RL_RDESC_STAT_CRCERR 0x00040000 /* CRC error */ +#define RL_RDESC_STAT_PROTOID 0x00030000 /* Protocol type */ #define RL_RDESC_STAT_UDP 0x00020000 /* UDP, 8168C/CP, 8111C/CP */ #define RL_RDESC_STAT_TCP 0x00010000 /* TCP, 8168C/CP, 8111C/CP */ -#define RL_RDESC_STAT_IPSUMBAD 0x00008000 /* IP header checksum bad */ -#define RL_RDESC_STAT_UDPSUMBAD 0x00004000 /* UDP checksum bad */ -#define RL_RDESC_STAT_TCPSUMBAD 0x00002000 /* TCP checksum bad */ -#define RL_RDESC_STAT_FRAGLEN 0x00001FFF /* RX'ed frame/frag len */ -#define RL_RDESC_STAT_GFRAGLEN 0x00003FFF /* RX'ed frame/frag len */ -#define RL_RDESC_STAT_ERRS (RL_RDESC_STAT_GIANT|RL_RDESC_STAT_RUNT| \ +#define RL_RDESC_STAT_IPSUMBAD 0x00008000 /* IP header checksum bad */ +#define RL_RDESC_STAT_UDPSUMBAD 0x00004000 /* UDP checksum bad */ +#define RL_RDESC_STAT_TCPSUMBAD 0x00002000 /* TCP checksum bad */ +#define RL_RDESC_STAT_FRAGLEN 0x00001FFF /* RX'ed frame/frag len */ +#define RL_RDESC_STAT_GFRAGLEN 0x00003FFF /* RX'ed frame/frag len */ +#define RL_RDESC_STAT_ERRS (RL_RDESC_STAT_GIANT|RL_RDESC_STAT_RUNT| \ RL_RDESC_STAT_CRCERR) -#define RL_RDESC_VLANCTL_TAG 0x00010000 /* VLAN tag available +#define RL_RDESC_VLANCTL_TAG 0x00010000 /* VLAN tag available (rl_vlandata valid)*/ -#define RL_RDESC_VLANCTL_DATA 0x0000FFFF /* TAG data */ +#define RL_RDESC_VLANCTL_DATA 0x0000FFFF /* TAG data */ /* RTL8168C/RTL8168CP/RTL8111C/RTL8111CP */ #define RL_RDESC_IPV6 0x80000000 #define RL_RDESC_IPV4 0x40000000 -#define RL_PROTOID_NONIP 0x00000000 -#define RL_PROTOID_TCPIP 0x00010000 -#define RL_PROTOID_UDPIP 0x00020000 -#define RL_PROTOID_IP 0x00030000 -#define RL_TCPPKT(x) (((x) & RL_RDESC_STAT_PROTOID) == \ +#define RL_PROTOID_NONIP 0x00000000 +#define RL_PROTOID_TCPIP 0x00010000 +#define RL_PROTOID_UDPIP 0x00020000 +#define RL_PROTOID_IP 0x00030000 +#define RL_TCPPKT(x) (((x) & RL_RDESC_STAT_PROTOID) == \ RL_PROTOID_TCPIP) -#define RL_UDPPKT(x) (((x) & RL_RDESC_STAT_PROTOID) == \ +#define RL_UDPPKT(x) (((x) & RL_RDESC_STAT_PROTOID) == \ RL_PROTOID_UDPIP) /* @@ -747,7 +747,7 @@ struct rl_stats { * Descriptor alignment : 256 bytes * Tx buffer : At least 4 bytes in length. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Wed Nov 17 09:49:51 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E83C106566B; Wed, 17 Nov 2010 09:49:51 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BD9A8FC16; Wed, 17 Nov 2010 09:49:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAH9npda085315; Wed, 17 Nov 2010 09:49:51 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAH9npSa085313; Wed, 17 Nov 2010 09:49:51 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201011170949.oAH9npSa085313@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 17 Nov 2010 09:49:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215422 - stable/7/contrib/top X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Nov 2010 09:49:51 -0000 Author: pluknet Date: Wed Nov 17 09:49:51 2010 New Revision: 215422 URL: http://svn.freebsd.org/changeset/base/215422 Log: MFC r215186: Add 'jid' as a possible sort order to the help screen. PR: bin/150992 Submitted by: Frederic Culot Approved by: avg (mentor) Modified: stable/7/contrib/top/commands.c Directory Properties: stable/7/contrib/top/ (props changed) Modified: stable/7/contrib/top/commands.c ============================================================================== --- stable/7/contrib/top/commands.c Wed Nov 17 09:48:18 2010 (r215421) +++ stable/7/contrib/top/commands.c Wed Nov 17 09:49:51 2010 (r215422) @@ -80,10 +80,12 @@ n or # - change number of processes to #ifdef ORDER if (displaymode == DISP_CPU) fputs("\ -o - specify sort order (pri, size, res, cpu, time, threads)\n", stdout); +o - specify sort order (pri, size, res, cpu, time, threads, jid)\n", + stdout); else fputs("\ -o - specify sort order (vcsw, ivcsw, read, write, fault, total)\n", stdout); +o - specify sort order (vcsw, ivcsw, read, write, fault, total, jid)\n", + stdout); #endif fputs("\ r - renice a process\n\ From owner-svn-src-stable-7@FreeBSD.ORG Wed Nov 17 13:59:26 2010 Return-Path: Delivered-To: svn-src-stable-7@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 268B81065695; Wed, 17 Nov 2010 13:59:26 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail.sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id D55418FC17; Wed, 17 Nov 2010 13:59:25 +0000 (UTC) Received: from s0106005004e13421.vs.shawcable.net ([70.71.175.212] helo=[192.168.1.79]) by mail.sippysoft.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.72 (FreeBSD)) (envelope-from ) id 1PIiXi-0005K3-1B; Wed, 17 Nov 2010 05:59:24 -0800 Message-ID: <4CE3DFB3.4060809@sippysoft.com> Date: Wed, 17 Nov 2010 05:59:15 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101027 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Bruce Evans References: <201011160440.oAG4e3YU039413@svn.freebsd.org> <20101117030118.X1203@besplex.bde.org> In-Reply-To: <20101117030118.X1203@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam_report: Spam detection software, running on the system "mail.sippysoft.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: On 11/16/2010 8:12 AM, Bruce Evans wrote: > This was quite low for yestdeay's uses (starting in about 1995), but today > it is little missed since only yesterday's low-end hardware uses it. Most > of today's interfaces are 1Gbps, and for this it is almost essential for > the hardware to have a ring buffer with > 50 entries, so most of today's > drivers ignore ifqmaxlen and set the queue length to the almost equally > bogus value of the ring buffer size (-1). I set it to about 10000 instead > in bge and em (10000 is too large, but fixes streaming under certain loads > when hz is small). [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-7@FreeBSD.org Subject: Re: svn commit: r215368 - in stable/7/sys: arm/at91 arm/xscale/ixp425 contrib/dev/oltr dev/ae dev/an dev/ar dev/arl dev/ath dev/awi dev/ce dev/cm dev/cnw dev/cp dev/cs dev/ctau dev/cx dev/cxgb dev/ed d... X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Nov 2010 13:59:26 -0000 On 11/16/2010 8:12 AM, Bruce Evans wrote: > This was quite low for yestdeay's uses (starting in about 1995), but today > it is little missed since only yesterday's low-end hardware uses it. Most > of today's interfaces are 1Gbps, and for this it is almost essential for > the hardware to have a ring buffer with > 50 entries, so most of today's > drivers ignore ifqmaxlen and set the queue length to the almost equally > bogus value of the ring buffer size (-1). I set it to about 10000 instead > in bge and em (10000 is too large, but fixes streaming under certain loads > when hz is small). One of those interfaces is if_rl, which is still quite popular these days and supports speeds up to 1gbps (which I believe triggered this change). But in general I agree, unfortunately FreeBSD network subsystem is tuned for yesteday's speeds. We are seeing lot of lookups and other issues under high PPS. I wish somebody could stand and pick up the task of cleaning it up and re-tuning eventually for 2010. We could probably even sponsor in part such a work (anyone). Apart from interface tuning for Gbps speeds, another area that needs more work is splitting up memory pool for the IPC from the memory pool for the other networking. Today's software is highly distributed and rock-solid IPC is a must for the FreeBSD being a solid server application platform. That's OK when under the load we drop some packets, but it's not OK when extreme network activity can bring down communications between application and database system within the host itself. And that's exactly what can happen in FreeBSD. Regards, -- Maksym Sobolyev Sippy Software, Inc. Internet Telephony (VoIP) Experts T/F: +1-646-651-1110 Web: http://www.sippysoft.com MSN: sales@sippysoft.com Skype: SippySoft From owner-svn-src-stable-7@FreeBSD.ORG Wed Nov 17 18:21:30 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22EDB1065670; Wed, 17 Nov 2010 18:21:30 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1145B8FC08; Wed, 17 Nov 2010 18:21:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAHILTAK000242; Wed, 17 Nov 2010 18:21:29 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAHILTIO000236; Wed, 17 Nov 2010 18:21:29 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201011171821.oAHILTIO000236@svn.freebsd.org> From: Alan Cox Date: Wed, 17 Nov 2010 18:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215433 - in stable/7/sys: kern vm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Nov 2010 18:21:30 -0000 Author: alc Date: Wed Nov 17 18:21:29 2010 New Revision: 215433 URL: http://svn.freebsd.org/changeset/base/215433 Log: MFC r209407, r209648, r209650 Introduce and use vm_page_next() and vm_page_prev(). They provide both a simpler and faster interface for iterating over the pages of an object. Modified: stable/7/sys/kern/kern_exec.c stable/7/sys/vm/vm_fault.c stable/7/sys/vm/vm_page.c stable/7/sys/vm/vm_page.h stable/7/sys/vm/vm_pageout.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_exec.c ============================================================================== --- stable/7/sys/kern/kern_exec.c Wed Nov 17 18:09:02 2010 (r215432) +++ stable/7/sys/kern/kern_exec.c Wed Nov 17 18:21:29 2010 (r215433) @@ -884,7 +884,7 @@ exec_map_first_page(imgp) if (initial_pagein > object->size) initial_pagein = object->size; for (i = 1; i < initial_pagein; i++) { - if ((ma[i] = vm_page_lookup(object, i)) != NULL) { + if ((ma[i] = vm_page_next(ma[i - 1])) != NULL) { if (ma[i]->valid) break; if ((ma[i]->oflags & VPO_BUSY) || ma[i]->busy) Modified: stable/7/sys/vm/vm_fault.c ============================================================================== --- stable/7/sys/vm/vm_fault.c Wed Nov 17 18:09:02 2010 (r215432) +++ stable/7/sys/vm/vm_fault.c Wed Nov 17 18:21:29 2010 (r215433) @@ -214,7 +214,7 @@ vm_fault(vm_map_t map, vm_offset_t vaddr boolean_t growstack, wired; int map_generation; vm_object_t next_object; - vm_page_t marray[VM_FAULT_READ]; + vm_page_t marray[VM_FAULT_READ], mt, mt_prev; int hardfault; int faultcount; struct faultstate fs; @@ -487,12 +487,18 @@ readrest: fs.first_object->type != OBJT_DEVICE && fs.first_object->type != OBJT_PHYS && fs.first_object->type != OBJT_SG) { - vm_pindex_t firstpindex, tmppindex; + vm_pindex_t firstpindex; if (fs.first_pindex < 2 * VM_FAULT_READ) firstpindex = 0; else firstpindex = fs.first_pindex - 2 * VM_FAULT_READ; + mt = fs.first_object != fs.object ? + fs.first_m : fs.m; + KASSERT(mt != NULL, ("vm_fault: missing mt")); + KASSERT((mt->oflags & VPO_BUSY) != 0, + ("vm_fault: mt %p not busy", mt)); + mt_prev = vm_page_prev(mt); vm_page_lock_queues(); /* @@ -500,14 +506,10 @@ readrest: * included in the lookahead - NFS piecemeal * writes will barf on it badly. */ - for (tmppindex = fs.first_pindex - 1; - tmppindex >= firstpindex; - --tmppindex) { - vm_page_t mt; - - mt = vm_page_lookup(fs.first_object, tmppindex); - if (mt == NULL || (mt->valid != VM_PAGE_BITS_ALL)) - break; + while ((mt = mt_prev) != NULL && + mt->pindex >= firstpindex && + mt->valid == VM_PAGE_BITS_ALL) { + mt_prev = vm_page_prev(mt); if (mt->busy || (mt->oflags & VPO_BUSY) || mt->hold_count || Modified: stable/7/sys/vm/vm_page.c ============================================================================== --- stable/7/sys/vm/vm_page.c Wed Nov 17 18:09:02 2010 (r215432) +++ stable/7/sys/vm/vm_page.c Wed Nov 17 18:21:29 2010 (r215433) @@ -772,6 +772,42 @@ vm_page_lookup(vm_object_t object, vm_pi } /* + * Returns the given page's successor (by pindex) within the object if it is + * resident; if none is found, NULL is returned. + * + * The object must be locked. + */ +vm_page_t +vm_page_next(vm_page_t m) +{ + vm_page_t next; + + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + if ((next = TAILQ_NEXT(m, listq)) != NULL && + next->pindex != m->pindex + 1) + next = NULL; + return (next); +} + +/* + * Returns the given page's predecessor (by pindex) within the object if it is + * resident; if none is found, NULL is returned. + * + * The object must be locked. + */ +vm_page_t +vm_page_prev(vm_page_t m) +{ + vm_page_t prev; + + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + if ((prev = TAILQ_PREV(m, pglist, listq)) != NULL && + prev->pindex != m->pindex - 1) + prev = NULL; + return (prev); +} + +/* * vm_page_rename: * * Move the given memory entry from its Modified: stable/7/sys/vm/vm_page.h ============================================================================== --- stable/7/sys/vm/vm_page.h Wed Nov 17 18:09:02 2010 (r215432) +++ stable/7/sys/vm/vm_page.h Wed Nov 17 18:21:29 2010 (r215433) @@ -325,6 +325,8 @@ void vm_page_dontneed (register vm_page_ void vm_page_deactivate (vm_page_t); void vm_page_insert (vm_page_t, vm_object_t, vm_pindex_t); vm_page_t vm_page_lookup (vm_object_t, vm_pindex_t); +vm_page_t vm_page_next(vm_page_t m); +vm_page_t vm_page_prev(vm_page_t m); void vm_page_remove (vm_page_t); void vm_page_rename (vm_page_t, vm_object_t, vm_pindex_t); void vm_page_requeue(vm_page_t m); Modified: stable/7/sys/vm/vm_pageout.c ============================================================================== --- stable/7/sys/vm/vm_pageout.c Wed Nov 17 18:09:02 2010 (r215432) +++ stable/7/sys/vm/vm_pageout.c Wed Nov 17 18:21:29 2010 (r215433) @@ -281,7 +281,7 @@ vm_pageout_clean(m) vm_page_t m; { vm_object_t object; - vm_page_t mc[2*vm_pageout_page_count]; + vm_page_t mc[2*vm_pageout_page_count], pb, ps; int pageout_count; int ib, is, page_base; vm_pindex_t pindex = m->pindex; @@ -306,7 +306,7 @@ vm_pageout_clean(m) return 0; } - mc[vm_pageout_page_count] = m; + mc[vm_pageout_page_count] = pb = ps = m; pageout_count = 1; page_base = vm_pageout_page_count; ib = 1; @@ -341,11 +341,8 @@ more: break; } - if ((p = vm_page_lookup(object, pindex - ib)) == NULL) { - ib = 0; - break; - } - if ((p->oflags & VPO_BUSY) || p->busy) { + if ((p = vm_page_prev(pb)) == NULL || + (p->oflags & VPO_BUSY) != 0 || p->busy != 0) { ib = 0; break; } @@ -357,7 +354,7 @@ more: ib = 0; break; } - mc[--page_base] = p; + mc[--page_base] = pb = p; ++pageout_count; ++ib; /* @@ -372,11 +369,9 @@ more: pindex + is < object->size) { vm_page_t p; - if ((p = vm_page_lookup(object, pindex + is)) == NULL) + if ((p = vm_page_next(ps)) == NULL || + (p->oflags & VPO_BUSY) != 0 || p->busy != 0) break; - if ((p->oflags & VPO_BUSY) || p->busy) { - break; - } vm_page_test_dirty(p); if ((p->dirty & p->valid) == 0 || p->queue != PQ_INACTIVE || @@ -384,7 +379,7 @@ more: p->hold_count != 0) { /* may be undergoing I/O */ break; } - mc[page_base + pageout_count] = p; + mc[page_base + pageout_count] = ps = p; ++pageout_count; ++is; } From owner-svn-src-stable-7@FreeBSD.ORG Wed Nov 17 18:54:19 2010 Return-Path: Delivered-To: svn-src-stable-7@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74D10106564A; Wed, 17 Nov 2010 18:54:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 0C4A38FC17; Wed, 17 Nov 2010 18:54:18 +0000 (UTC) Received: from c122-106-146-145.carlnfd1.nsw.optusnet.com.au (c122-106-146-145.carlnfd1.nsw.optusnet.com.au [122.106.146.145]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oAHIsEEG004106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Nov 2010 05:54:15 +1100 Date: Thu, 18 Nov 2010 05:54:14 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Maxim Sobolev In-Reply-To: <4CE3DFB3.4060809@sippysoft.com> Message-ID: <20101118053830.K1202@besplex.bde.org> References: <201011160440.oAG4e3YU039413@svn.freebsd.org> <20101117030118.X1203@besplex.bde.org> <4CE3DFB3.4060809@sippysoft.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-stable-7@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r215368 - in stable/7/sys: arm/at91 arm/xscale/ixp425 contrib/dev/oltr dev/ae dev/an dev/ar dev/arl dev/ath dev/awi dev/ce dev/cm dev/cnw dev/cp dev/cs dev/ctau dev/cx dev/cxgb dev/ed d... X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Nov 2010 18:54:19 -0000 On Wed, 17 Nov 2010, Maxim Sobolev wrote: > On 11/16/2010 8:12 AM, Bruce Evans wrote: >> This was quite low for yestdeay's uses (starting in about 1995), but today >> it is little missed since only yesterday's low-end hardware uses it. Most >> of today's interfaces are 1Gbps, and for this it is almost essential for >> the hardware to have a ring buffer with > 50 entries, so most of today's >> drivers ignore ifqmaxlen and set the queue length to the almost equally >> bogus value of the ring buffer size (-1). I set it to about 10000 instead >> in bge and em (10000 is too large, but fixes streaming under certain loads >> when hz is small). > > One of those interfaces is if_rl, which is still quite popular these days and > supports speeds up to 1gbps (which I believe triggered this change). But in It is the only one on the list that I used. Maybe it should be handled specially. Just bump up its queue lengths to maybe 128 for 100 Mbps and 512 for 1 Gbps in all cases, or tune this depending on the amount of memory? > general I agree, unfortunately FreeBSD network subsystem is tuned for > yesteday's speeds. We are seeing lot of lookups and other issues under high > PPS. I wish somebody could stand and pick up the task of cleaning it up and > re-tuning eventually for 2010. We could probably even sponsor in part such a > work (anyone). I haven't seen any lockups, but just the maximum pps on fixed hardware decreasing with every increase in the FreeBSD version number (about 30% since FreeBSD-5). My hardware CPU and bus are saturated by low-end em 1 Gbps and medium-end bge 1 Gbps, so bloat in the stack translates into lower pps. I tuned bge a lot to make it fast under the version of FreeBSD-5 that I usually run, but barely touched upper layers. > Apart from interface tuning for Gbps speeds, another area that needs more > work is splitting up memory pool for the IPC from the memory pool for the > other networking. Today's software is highly distributed and rock-solid IPC > is a must for the FreeBSD being a solid server application platform. That's > OK when under the load we drop some packets, but it's not OK when extreme > network activity can bring down communications between application and > database system within the host itself. And that's exactly what can happen in > FreeBSD. Does flow control help here? I think it should prevent most dropped packets, but be actively harmful if it stops the flow when IPC packets are queued behind non-IPC ones. Large queue lengths are also bad for latency. Bruce From owner-svn-src-stable-7@FreeBSD.ORG Wed Nov 17 20:21:11 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F37E41065670; Wed, 17 Nov 2010 20:21:10 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E194B8FC1F; Wed, 17 Nov 2010 20:21:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAHKLA0X003236; Wed, 17 Nov 2010 20:21:10 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAHKLAdR003234; Wed, 17 Nov 2010 20:21:10 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011172021.oAHKLAdR003234@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 17 Nov 2010 20:21:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215440 - stable/7/tools/regression/lib/libc/gen X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Nov 2010 20:21:11 -0000 Author: jilles Date: Wed Nov 17 20:21:10 2010 New Revision: 215440 URL: http://svn.freebsd.org/changeset/base/215440 Log: MFC r174692: Fix wordexp() testsuite. Original commit by das. Modified: stable/7/tools/regression/lib/libc/gen/test-wordexp.c Directory Properties: stable/7/tools/regression/lib/libc/ (props changed) Modified: stable/7/tools/regression/lib/libc/gen/test-wordexp.c ============================================================================== --- stable/7/tools/regression/lib/libc/gen/test-wordexp.c Wed Nov 17 19:54:01 2010 (r215439) +++ stable/7/tools/regression/lib/libc/gen/test-wordexp.c Wed Nov 17 20:21:10 2010 (r215440) @@ -45,7 +45,7 @@ main(int argc, char *argv[]) int r; /* Test that the macros are there. */ - (void)(WRDE_APPEND + WRDE_DOOFS + WRDE_NOCMD + WRDE_REUSE + + (void)(WRDE_APPEND + WRDE_DOOFFS + WRDE_NOCMD + WRDE_REUSE + WRDE_SHOWERR + WRDE_UNDEF); (void)(WRDE_BADCHAR + WRDE_BADVAL + WRDE_CMDSUB + WRDE_NOSPACE + WRDE_SYNTAX); @@ -59,9 +59,9 @@ main(int argc, char *argv[]) assert(we.we_wordv[2] == NULL); wordfree(&we); - /* WRDE_DOOFS */ + /* WRDE_DOOFFS */ we.we_offs = 3; - r = wordexp("hello world", &we, WRDE_DOOFS); + r = wordexp("hello world", &we, WRDE_DOOFFS); assert(r == 0); assert(we.we_wordc == 2); assert(we.we_wordv[0] == NULL); @@ -95,13 +95,13 @@ main(int argc, char *argv[]) assert(we.we_wordv[4] == NULL); wordfree(&we); - /* WRDE_DOOFS + WRDE_APPEND */ + /* WRDE_DOOFFS + WRDE_APPEND */ we.we_offs = 2; - r = wordexp("this is", &we, WRDE_DOOFS); + r = wordexp("this is", &we, WRDE_DOOFFS); assert(r == 0); - r = wordexp("a test", &we, WRDE_APPEND|WRDE_DOOFS); + r = wordexp("a test", &we, WRDE_APPEND|WRDE_DOOFFS); assert(r == 0); - r = wordexp("of wordexp", &we, WRDE_APPEND|WRDE_DOOFS); + r = wordexp("of wordexp", &we, WRDE_APPEND|WRDE_DOOFFS); assert(r == 0); assert(we.we_wordc == 6); assert(we.we_wordv[0] == NULL); From owner-svn-src-stable-7@FreeBSD.ORG Wed Nov 17 21:45:11 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C5531065672; Wed, 17 Nov 2010 21:45:11 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68BC08FC14; Wed, 17 Nov 2010 21:45:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAHLjBHf005155; Wed, 17 Nov 2010 21:45:11 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAHLjBhE005152; Wed, 17 Nov 2010 21:45:11 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011172145.oAHLjBhE005152@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 17 Nov 2010 21:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215442 - in stable/7: lib/libc/gen tools/regression/lib/libc/gen X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Nov 2010 21:45:11 -0000 Author: jilles Date: Wed Nov 17 21:45:11 2010 New Revision: 215442 URL: http://svn.freebsd.org/changeset/base/215442 Log: MFC r198406: wordexp(3): fix some bugs with signals and long outputs * retry various system calls on EINTR * retry the rest after a short read (common if there is more than about 1K of output) * block SIGCHLD like system(3) does (note that this does not and cannot work fully in threaded programs, they will need to be careful with wait functions) PR: 90580 Modified: stable/7/lib/libc/gen/wordexp.c stable/7/tools/regression/lib/libc/gen/test-wordexp.c Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) stable/7/tools/regression/lib/libc/ (props changed) Modified: stable/7/lib/libc/gen/wordexp.c ============================================================================== --- stable/7/lib/libc/gen/wordexp.c Wed Nov 17 20:37:16 2010 (r215441) +++ stable/7/lib/libc/gen/wordexp.c Wed Nov 17 21:45:11 2010 (r215442) @@ -28,8 +28,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -73,6 +75,24 @@ wordexp(const char * __restrict words, w return (0); } +static size_t +we_read_fully(int fd, char *buffer, size_t len) +{ + size_t done; + ssize_t nread; + + done = 0; + do { + nread = _read(fd, buffer + done, len - done); + if (nread == -1 && errno == EINTR) + continue; + if (nread <= 0) + break; + done += nread; + } while (done != len); + return done; +} + /* * we_askshell -- * Use the `wordexp' /bin/sh builtin function to do most of the work @@ -90,20 +110,31 @@ we_askshell(const char *words, wordexp_t size_t sofs; /* Offset into we->we_strings */ size_t vofs; /* Offset into we->we_wordv */ pid_t pid; /* Process ID of child */ + pid_t wpid; /* waitpid return value */ int status; /* Child exit status */ + int error; /* Our return value */ + int serrno; /* errno to return */ char *ifs; /* IFS env. var. */ char *np, *p; /* Handy pointers */ char *nstrings; /* Temporary for realloc() */ char **nwv; /* Temporary for realloc() */ + sigset_t newsigblock, oldsigblock; + serrno = errno; if ((ifs = getenv("IFS")) == NULL) ifs = " \t\n"; if (pipe(pdes) < 0) return (WRDE_NOSPACE); /* XXX */ + (void)sigemptyset(&newsigblock); + (void)sigaddset(&newsigblock, SIGCHLD); + (void)_sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock); if ((pid = fork()) < 0) { + serrno = errno; _close(pdes[0]); _close(pdes[1]); + (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + errno = serrno; return (WRDE_NOSPACE); /* XXX */ } else if (pid == 0) { @@ -114,6 +145,7 @@ we_askshell(const char *words, wordexp_t int devnull; char *cmd; + (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); _close(pdes[0]); if (_dup2(pdes[1], STDOUT_FILENO) < 0) _exit(1); @@ -139,10 +171,11 @@ we_askshell(const char *words, wordexp_t * the expanded words separated by nulls. */ _close(pdes[1]); - if (_read(pdes[0], wbuf, 8) != 8 || _read(pdes[0], bbuf, 8) != 8) { - _close(pdes[0]); - _waitpid(pid, &status, 0); - return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX); + if (we_read_fully(pdes[0], wbuf, 8) != 8 || + we_read_fully(pdes[0], bbuf, 8) != 8) { + error = flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX; + serrno = errno; + goto cleanup; } wbuf[8] = bbuf[8] = '\0'; nwords = strtol(wbuf, NULL, 16); @@ -162,33 +195,38 @@ we_askshell(const char *words, wordexp_t if ((nwv = realloc(we->we_wordv, (we->we_wordc + 1 + (flags & WRDE_DOOFFS ? we->we_offs : 0)) * sizeof(char *))) == NULL) { - _close(pdes[0]); - _waitpid(pid, &status, 0); - return (WRDE_NOSPACE); + error = WRDE_NOSPACE; + goto cleanup; } we->we_wordv = nwv; if ((nstrings = realloc(we->we_strings, we->we_nbytes)) == NULL) { - _close(pdes[0]); - _waitpid(pid, &status, 0); - return (WRDE_NOSPACE); + error = WRDE_NOSPACE; + goto cleanup; } for (i = 0; i < vofs; i++) if (we->we_wordv[i] != NULL) we->we_wordv[i] += nstrings - we->we_strings; we->we_strings = nstrings; - if (_read(pdes[0], we->we_strings + sofs, nbytes) != nbytes) { - _close(pdes[0]); - _waitpid(pid, &status, 0); - return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX); + if (we_read_fully(pdes[0], we->we_strings + sofs, nbytes) != nbytes) { + error = flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX; + serrno = errno; + goto cleanup; } - if (_waitpid(pid, &status, 0) < 0 || !WIFEXITED(status) || - WEXITSTATUS(status) != 0) { - _close(pdes[0]); - return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX); - } + error = 0; +cleanup: _close(pdes[0]); + do + wpid = _waitpid(pid, &status, 0); + while (wpid < 0 && errno == EINTR); + (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + if (error != 0) { + errno = serrno; + return (error); + } + if (wpid < 0 || !WIFEXITED(status) || WEXITSTATUS(status) != 0) + return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX); /* * Break the null-terminated expanded word strings out into Modified: stable/7/tools/regression/lib/libc/gen/test-wordexp.c ============================================================================== --- stable/7/tools/regression/lib/libc/gen/test-wordexp.c Wed Nov 17 20:37:16 2010 (r215441) +++ stable/7/tools/regression/lib/libc/gen/test-wordexp.c Wed Nov 17 21:45:11 2010 (r215442) @@ -32,17 +32,36 @@ #include __FBSDID("$FreeBSD$"); +#include + #include +#include +#include #include #include #include #include +static void +chld_handler(int x) +{ + int status, serrno; + + (void)x; + serrno = errno; + while (waitpid(-1, &status, WNOHANG) > 0) + ; + errno = serrno; +} + int main(int argc, char *argv[]) { + struct sigaction sa; wordexp_t we; int r; + int i; + char longdata[6 * 10000 + 1]; /* Test that the macros are there. */ (void)(WRDE_APPEND + WRDE_DOOFFS + WRDE_NOCMD + WRDE_REUSE + @@ -59,6 +78,15 @@ main(int argc, char *argv[]) assert(we.we_wordv[2] == NULL); wordfree(&we); + /* Long output. */ + for (i = 0; i < 10000; i++) + snprintf(longdata + 6 * i, 7, "%05d ", i); + r = wordexp(longdata, &we, 0); + assert(r == 0); + assert(we.we_wordc == 10000); + assert(we.we_wordv[10000] == NULL); + wordfree(&we); + /* WRDE_DOOFFS */ we.we_offs = 3; r = wordexp("hello world", &we, WRDE_DOOFFS); @@ -167,6 +195,20 @@ main(int argc, char *argv[]) r = wordexp("test } test", &we, 0); assert(r == WRDE_BADCHAR); + /* With a SIGCHLD handler that reaps all zombies. */ + sa.sa_flags = 0; + sigemptyset(&sa.sa_mask); + sa.sa_handler = chld_handler; + r = sigaction(SIGCHLD, &sa, NULL); + assert(r == 0); + r = wordexp("hello world", &we, 0); + assert(r == 0); + assert(we.we_wordc == 2); + assert(strcmp(we.we_wordv[0], "hello") == 0); + assert(strcmp(we.we_wordv[1], "world") == 0); + assert(we.we_wordv[2] == NULL); + wordfree(&we); + printf("PASS wordexp()\n"); printf("PASS wordfree()\n"); From owner-svn-src-stable-7@FreeBSD.ORG Thu Nov 18 01:21:56 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10525106566C; Thu, 18 Nov 2010 01:21:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0BF48FC0C; Thu, 18 Nov 2010 01:21:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAI1Lt0a010096; Thu, 18 Nov 2010 01:21:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAI1Lt1b010092; Thu, 18 Nov 2010 01:21:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201011180121.oAI1Lt1b010092@svn.freebsd.org> From: Xin LI Date: Thu, 18 Nov 2010 01:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215446 - stable/7/contrib/netcat X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 01:21:56 -0000 Author: delphij Date: Thu Nov 18 01:21:55 2010 New Revision: 215446 URL: http://svn.freebsd.org/changeset/base/215446 Log: MFC through r214047: nc from OpenBSD 4.8. Modified: stable/7/contrib/netcat/nc.1 stable/7/contrib/netcat/netcat.c stable/7/contrib/netcat/socks.c Directory Properties: stable/7/contrib/netcat/ (props changed) Modified: stable/7/contrib/netcat/nc.1 ============================================================================== --- stable/7/contrib/netcat/nc.1 Thu Nov 18 01:14:18 2010 (r215445) +++ stable/7/contrib/netcat/nc.1 Thu Nov 18 01:21:55 2010 (r215446) @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.50 2009/06/05 06:47:12 jmc Exp $ +.\" $OpenBSD: nc.1,v 1.55 2010/07/25 07:51:39 guenther Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 5 2009 +.Dd July 25, 2010 .Dt NC 1 .Os .Sh NAME @@ -36,7 +36,7 @@ .Sh SYNOPSIS .Nm nc .Bk -words -.Op Fl 46DdEhklnorStUuvz +.Op Fl 46DdEhklnrStUuvz .Op Fl e Ar IPsec_policy .Op Fl I Ar length .Op Fl i Ar interval @@ -46,13 +46,13 @@ .Op Fl p Ar source_port .Op Fl s Ar source_ip_address .Op Fl T Ar ToS -.Op Fl V Ar fib +.Op Fl V Ar rtable .Op Fl w Ar timeout .Op Fl X Ar proxy_protocol .Oo Xo .Fl x Ar proxy_address Ns Oo : Ns -.Ar port Oc Oc -.Xc +.Ar port Oc +.Xc Oc .Op Ar hostname .Op Ar port .Ek @@ -158,16 +158,6 @@ TCP_NOOPT socket option. .It Fl O Ar length Specifies the size of the TCP send buffer. -When -.It Fl o -.Dq Once-only mode . -By default, -.Nm -does not terminate on EOF condition on input, -but continues until the network side has been closed down. -Specifying -.Fl o -will make it terminate on EOF as well. .It Fl P Ar proxy_username Specifies a username to present to a proxy server that requires authentication. If no username is specified then authentication will not be attempted. @@ -206,11 +196,15 @@ This makes it possible to use .Nm to script telnet sessions. .It Fl U -Specifies to use Unix Domain Sockets. +Specifies to use +.Ux Ns -domain +sockets. .It Fl u Use UDP instead of the default option of TCP. -.It Fl V Ar fib -Set the routing table (FIB). +.It Fl V Ar rtable +Set the routing table +.Pq Dq FIB +to be used. The default is 0. .It Fl v Have @@ -347,7 +341,7 @@ when it might be necessary to verify wha in response to commands issued by the client. For example, to retrieve the home page of a web site: .Bd -literal -offset indent -$ echo -n "GET / HTTP/1.0\er\en\er\en" | nc host.example.com 80 +$ printf "GET / HTTP/1.0\er\en\er\en" | nc host.example.com 80 .Ed .Pp Note that this also displays the headers sent by the web server. @@ -428,7 +422,9 @@ outgoing traffic only. .Pp .Dl $ nc -e 'out ipsec esp/transport//require' host.example.com 42 .Pp -Create and listen on a Unix Domain Socket: +Create and listen on a +.Ux Ns -domain +socket: .Pp .Dl $ nc -lU /var/tmp/dsocket .Pp Modified: stable/7/contrib/netcat/netcat.c ============================================================================== --- stable/7/contrib/netcat/netcat.c Thu Nov 18 01:14:18 2010 (r215445) +++ stable/7/contrib/netcat/netcat.c Thu Nov 18 01:21:55 2010 (r215446) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.93 2009/06/05 00:18:10 claudio Exp $ */ +/* $OpenBSD: netcat.c,v 1.98 2010/07/03 04:44:51 guenther Exp $ */ /* * Copyright (c) 2001 Eric Jackson * @@ -72,14 +72,12 @@ #define PORT_MAX_LEN 6 /* Command Line Options */ -int Eflag; /* Use IPsec ESP */ int dflag; /* detached, no stdin */ unsigned int iflag; /* Interval Flag */ int jflag; /* use jumbo frames if we can */ int kflag; /* More than one connect */ int lflag; /* Bind to local port */ int nflag; /* Don't do name look up */ -int oflag; /* Once only: stop on EOF */ int FreeBSD_Oflag; /* Do not use TCP options */ char *Pflag; /* Proxy username */ char *pflag; /* Localport flag */ @@ -95,7 +93,7 @@ int Iflag; /* TCP receive buffer siz int Oflag; /* TCP send buffer size */ int Sflag; /* TCP MD5 signature option */ int Tflag = -1; /* IP Type of Service */ -u_int rdomain; +u_int rtableid; int timeout = -1; int family = AF_UNSPEC; @@ -141,7 +139,6 @@ main(int argc, char *argv[]) { NULL, 0, NULL, 0 } }; - rdomain = 0; ret = 1; ipsec_count = 0; s = 0; @@ -151,7 +148,7 @@ main(int argc, char *argv[]) sv = NULL; while ((ch = getopt_long(argc, argv, - "46DdEe:hI:i:jklnO:oP:p:rSs:tT:UuV:vw:X:x:z", + "46DdEe:hI:i:jklnoO:P:p:rSs:tT:UuV:vw:X:x:z", longopts, NULL)) != -1) { switch (ch) { case '4': @@ -214,7 +211,7 @@ main(int argc, char *argv[]) nflag = 1; break; case 'o': - oflag = 1; + fprintf(stderr, "option -o is deprecated.\n"); break; case 'P': Pflag = optarg; @@ -237,10 +234,10 @@ main(int argc, char *argv[]) case 'V': if (sysctlbyname("net.fibs", &numfibs, &intsize, NULL, 0) == -1) errx(1, "Multiple FIBS not supported"); - rdomain = (unsigned int)strtonum(optarg, 0, + rtableid = (unsigned int)strtonum(optarg, 0, numfibs - 1, &errstr); if (errstr) - errx(1, "FIB %s: %s", errstr, optarg); + errx(1, "rtable %s: %s", errstr, optarg); break; case 'v': vflag = 1; @@ -282,8 +279,6 @@ main(int argc, char *argv[]) case 'T': Tflag = parse_iptos(optarg); break; - case 0: - break; default: usage(1); } @@ -375,11 +370,11 @@ main(int argc, char *argv[]) */ if (uflag) { int rv, plen; - char buf[8192]; + char buf[16384]; struct sockaddr_storage z; len = sizeof(z); - plen = jflag ? 8192 : 1024; + plen = jflag ? 16384 : 2048; rv = recvfrom(s, buf, plen, MSG_PEEK, (struct sockaddr *)&z, &len); if (rv < 0) @@ -455,8 +450,10 @@ main(int argc, char *argv[]) uflag ? "udp" : "tcp"); } - printf("Connection to %s %s port [%s/%s] succeeded!\n", - host, portlist[i], uflag ? "udp" : "tcp", + fprintf(stderr, + "Connection to %s %s port [%s/%s] " + "succeeded!\n", host, portlist[i], + uflag ? "udp" : "tcp", sv ? sv->s_name : "*"); } if (!zflag) @@ -563,8 +560,8 @@ remote_connect(const char *host, const c add_ipsec_policy(s, ipsec_policy[1]); #endif - if (rdomain) { - if (setfib(rdomain) == -1) + if (rtableid) { + if (setfib(rtableid) == -1) err(1, "setfib"); } @@ -572,10 +569,8 @@ remote_connect(const char *host, const c if (sflag || pflag) { struct addrinfo ahints, *ares; -#ifdef SO_BINDANY - /* try SO_BINDANY, but don't insist */ - setsockopt(s, SOL_SOCKET, SO_BINDANY, &on, sizeof(on)); -#endif + /* try IP_BINDANY, but don't insist */ + setsockopt(s, IPPROTO_IP, IP_BINDANY, &on, sizeof(on)); memset(&ahints, 0, sizeof(struct addrinfo)); ahints.ai_family = res0->ai_family; ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; @@ -638,8 +633,8 @@ local_listen(char *host, char *port, str res0->ai_protocol)) < 0) continue; - if (rdomain) { - if (setfib(rdomain) == -1) + if (rtableid) { + if (setfib(rtableid) == -1) err(1, "setfib"); } @@ -684,12 +679,12 @@ void readwrite(int nfd) { struct pollfd pfd[2]; - unsigned char buf[8192]; + unsigned char buf[16384]; int n, wfd = fileno(stdin); int lfd = fileno(stdout); int plen; - plen = jflag ? 8192 : 1024; + plen = jflag ? 16384 : 2048; /* Setup Network FD */ pfd[0].fd = nfd; @@ -727,10 +722,9 @@ readwrite(int nfd) } if (!dflag && pfd[1].revents & POLLIN) { - if ((n = read(wfd, buf, plen)) < 0 || - (oflag && n == 0)) { + if ((n = read(wfd, buf, plen)) < 0) return; - } else if (n == 0) { + else if (n == 0) { shutdown(nfd, SHUT_WR); pfd[1].fd = -1; pfd[1].events = 0; @@ -749,27 +743,27 @@ atelnet(int nfd, unsigned char *buf, uns unsigned char *p, *end; unsigned char obuf[4]; - end = buf + size; - obuf[0] = '\0'; + if (size < 3) + return; + end = buf + size - 2; for (p = buf; p < end; p++) { if (*p != IAC) - break; + continue; obuf[0] = IAC; p++; if ((*p == WILL) || (*p == WONT)) obuf[1] = DONT; - if ((*p == DO) || (*p == DONT)) + else if ((*p == DO) || (*p == DONT)) obuf[1] = WONT; - if (obuf) { - p++; - obuf[2] = *p; - obuf[3] = '\0'; - if (atomicio(vwrite, nfd, obuf, 3) != 3) - warn("Write Error!"); - obuf[0] = '\0'; - } + else + continue; + + p++; + obuf[2] = *p; + if (atomicio(vwrite, nfd, obuf, 3) != 3) + warn("Write Error!"); } } @@ -832,10 +826,9 @@ build_ports(char *p) hi = strtonum(p, 1, PORT_MAX, &errstr); if (errstr) errx(1, "port number %s: %s", errstr, p); - portlist[0] = calloc(1, PORT_MAX_LEN); + portlist[0] = strdup(p); if (portlist[0] == NULL) err(1, NULL); - portlist[0] = p; } } @@ -943,7 +936,6 @@ help(void) \t-n Suppress name/port resolutions\n\ \t--no-tcpopt Disable TCP options\n\ \t-O length TCP send buffer length\n\ - \t-o Terminate on EOF on input\n\ \t-P proxyuser\tUsername for proxy authentication\n\ \t-p port\t Specify local port for remote connects\n\ \t-r Randomize remote ports\n\ @@ -953,7 +945,7 @@ help(void) \t-t Answer TELNET negotiation\n\ \t-U Use UNIX domain socket\n\ \t-u UDP mode\n\ - \t-V fib Specify alternate routing table (FIB)\n\ + \t-V rtable Specify alternate routing table\n\ \t-v Verbose\n\ \t-w secs\t Timeout for connects and final net reads\n\ \t-X proto Proxy protocol: \"4\", \"5\" (SOCKS) or \"connect\"\n\ @@ -993,12 +985,12 @@ usage(int ret) { fprintf(stderr, #ifdef IPSEC - "usage: nc [-46DdEhklnorStUuvz] [-e policy] [-I length] [-i interval] [-O length]\n" + "usage: nc [-46DdEhklnrStUuvz] [-e policy] [-I length] [-i interval] [-O length]\n" #else - "usage: nc [-46DdhklnorStUuvz] [-I length] [-i interval] [-O length]\n" + "usage: nc [-46DdhklnrStUuvz] [-I length] [-i interval] [-O length]\n" #endif "\t [-P proxy_username] [-p source_port] [-s source_ip_address] [-T ToS]\n" - "\t [-V fib] [-w timeout] [-X proxy_protocol]\n" + "\t [-V rtable] [-w timeout] [-X proxy_protocol]\n" "\t [-x proxy_address[:port]] [hostname] [port]\n"); if (ret) exit(1); Modified: stable/7/contrib/netcat/socks.c ============================================================================== --- stable/7/contrib/netcat/socks.c Thu Nov 18 01:14:18 2010 (r215445) +++ stable/7/contrib/netcat/socks.c Thu Nov 18 01:21:55 2010 (r215446) @@ -1,4 +1,4 @@ -/* $OpenBSD: socks.c,v 1.17 2006/09/25 04:51:20 ray Exp $ */ +/* $OpenBSD: socks.c,v 1.18 2010/04/20 07:26:35 nicm Exp $ */ /* * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. @@ -167,11 +167,11 @@ socks_connect(const char *host, const ch buf[2] = SOCKS_NOAUTH; cnt = atomicio(vwrite, proxyfd, buf, 3); if (cnt != 3) - err(1, "write failed (%d/3)", cnt); + err(1, "write failed (%zu/3)", cnt); cnt = atomicio(read, proxyfd, buf, 2); if (cnt != 2) - err(1, "read failed (%d/3)", cnt); + err(1, "read failed (%zu/3)", cnt); if (buf[1] == SOCKS_NOMETHOD) errx(1, "authentication method negotiation failed"); @@ -220,11 +220,11 @@ socks_connect(const char *host, const ch cnt = atomicio(vwrite, proxyfd, buf, wlen); if (cnt != wlen) - err(1, "write failed (%d/%d)", cnt, wlen); + err(1, "write failed (%zu/%zu)", cnt, wlen); cnt = atomicio(read, proxyfd, buf, 10); if (cnt != 10) - err(1, "read failed (%d/10)", cnt); + err(1, "read failed (%zu/10)", cnt); if (buf[1] != 0) errx(1, "connection failed, SOCKS error %d", buf[1]); } else if (socksv == 4) { @@ -242,11 +242,11 @@ socks_connect(const char *host, const ch cnt = atomicio(vwrite, proxyfd, buf, wlen); if (cnt != wlen) - err(1, "write failed (%d/%d)", cnt, wlen); + err(1, "write failed (%zu/%zu)", cnt, wlen); cnt = atomicio(read, proxyfd, buf, 8); if (cnt != 8) - err(1, "read failed (%d/8)", cnt); + err(1, "read failed (%zu/8)", cnt); if (buf[1] != 90) errx(1, "connection failed, SOCKS error %d", buf[1]); } else if (socksv == -1) { @@ -272,7 +272,7 @@ socks_connect(const char *host, const ch cnt = atomicio(vwrite, proxyfd, buf, r); if (cnt != r) - err(1, "write failed (%d/%d)", cnt, r); + err(1, "write failed (%zu/%d)", cnt, r); if (authretry > 1) { char resp[1024]; @@ -290,7 +290,7 @@ socks_connect(const char *host, const ch errx(1, "Proxy auth response too long"); r = strlen(buf); if ((cnt = atomicio(vwrite, proxyfd, buf, r)) != r) - err(1, "write failed (%d/%d)", cnt, r); + err(1, "write failed (%zu/%d)", cnt, r); } /* Terminate headers */ From owner-svn-src-stable-7@FreeBSD.ORG Thu Nov 18 17:49:24 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9988106564A; Thu, 18 Nov 2010 17:49:24 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B90FD8FC0A; Thu, 18 Nov 2010 17:49:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAIHnOHx039815; Thu, 18 Nov 2010 17:49:24 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAIHnOCj039811; Thu, 18 Nov 2010 17:49:24 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011181749.oAIHnOCj039811@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 18 Nov 2010 17:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215457 - stable/7/sys/dev/nfe X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 17:49:24 -0000 Author: yongari Date: Thu Nov 18 17:49:24 2010 New Revision: 215457 URL: http://svn.freebsd.org/changeset/base/215457 Log: MFC r215132,215194: r215132: Add basic WOL support for MCP ethernet controllers. It seems the controller does not perform automatic switching from 1000Mbps link to 10/100Mbps link when WOL is activated. Implement establishing 10/100Mps link with auto-negotiation in driver. Link status change handler was modified to remove taskqueue based approach since driver now needs synchronous handling for link establishment. Submitted by: Yamagi Burmeister (lists <> yamagi.org ) (initial version) Tested by: Yamagi Burmeister (lists <> yamagi.org ) r215194: Fix regression introduced in r215132. Caller always holds a driver lock before accessing mii, so locking is not needed here. Reported by: Rob Farmer (rfarmer <> predatorlabs dot net) Modified: stable/7/sys/dev/nfe/if_nfe.c stable/7/sys/dev/nfe/if_nfereg.h stable/7/sys/dev/nfe/if_nfevar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/nfe/if_nfe.c ============================================================================== --- stable/7/sys/dev/nfe/if_nfe.c Thu Nov 18 17:44:02 2010 (r215456) +++ stable/7/sys/dev/nfe/if_nfe.c Thu Nov 18 17:49:24 2010 (r215457) @@ -81,7 +81,7 @@ static void nfe_power(struct nfe_softc * static int nfe_miibus_readreg(device_t, int, int); static int nfe_miibus_writereg(device_t, int, int, int); static void nfe_miibus_statchg(device_t); -static void nfe_link_task(void *, int); +static void nfe_mac_config(struct nfe_softc *, struct mii_data *); static void nfe_set_intr(struct nfe_softc *); static __inline void nfe_enable_intr(struct nfe_softc *); static __inline void nfe_disable_intr(struct nfe_softc *); @@ -125,6 +125,8 @@ static int sysctl_hw_nfe_proc_limit(SYSC static void nfe_sysctl_node(struct nfe_softc *); static void nfe_stats_clear(struct nfe_softc *); static void nfe_stats_update(struct nfe_softc *); +static void nfe_set_linkspeed(struct nfe_softc *); +static void nfe_set_wol(struct nfe_softc *); #ifdef NFE_DEBUG static int nfedebug = 0; @@ -348,7 +350,6 @@ nfe_attach(device_t dev) mtx_init(&sc->nfe_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); callout_init_mtx(&sc->nfe_stat_ch, &sc->nfe_mtx, 0); - TASK_INIT(&sc->nfe_link_task, 0, nfe_link_task, sc); pci_enable_busmaster(dev); @@ -587,6 +588,9 @@ nfe_attach(device_t dev) if ((ifp->if_capabilities & IFCAP_HWCSUM) != 0) ifp->if_capabilities |= IFCAP_VLAN_HWCSUM; } + + if (pci_find_extcap(dev, PCIY_PMG, ®) == 0) + ifp->if_capabilities |= IFCAP_WOL_MAGIC; ifp->if_capenable = ifp->if_capabilities; /* @@ -667,7 +671,6 @@ nfe_detach(device_t dev) NFE_UNLOCK(sc); callout_drain(&sc->nfe_stat_ch); taskqueue_drain(taskqueue_fast, &sc->nfe_tx_task); - taskqueue_drain(taskqueue_swi, &sc->nfe_link_task); ether_ifdetach(ifp); } @@ -753,6 +756,7 @@ nfe_suspend(device_t dev) NFE_LOCK(sc); nfe_stop(sc->nfe_ifp); + nfe_set_wol(sc); sc->nfe_suspended = 1; NFE_UNLOCK(sc); @@ -769,6 +773,7 @@ nfe_resume(device_t dev) sc = device_get_softc(dev); NFE_LOCK(sc); + nfe_power(sc); ifp = sc->nfe_ifp; if (ifp->if_flags & IFF_UP) nfe_init_locked(sc); @@ -807,37 +812,51 @@ static void nfe_miibus_statchg(device_t dev) { struct nfe_softc *sc; - - sc = device_get_softc(dev); - taskqueue_enqueue(taskqueue_swi, &sc->nfe_link_task); -} - - -static void -nfe_link_task(void *arg, int pending) -{ - struct nfe_softc *sc; struct mii_data *mii; struct ifnet *ifp; - uint32_t phy, seed, misc = NFE_MISC1_MAGIC, link = NFE_MEDIA_SET; - uint32_t gmask, rxctl, txctl, val; + uint32_t rxctl, txctl; - sc = (struct nfe_softc *)arg; - - NFE_LOCK(sc); + sc = device_get_softc(dev); mii = device_get_softc(sc->nfe_miibus); ifp = sc->nfe_ifp; - if (mii == NULL || ifp == NULL) { - NFE_UNLOCK(sc); - return; - } - if (mii->mii_media_status & IFM_ACTIVE) { - if (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) + sc->nfe_link = 0; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + case IFM_1000_T: sc->nfe_link = 1; - } else - sc->nfe_link = 0; + break; + default: + break; + } + } + + nfe_mac_config(sc, mii); + txctl = NFE_READ(sc, NFE_TX_CTL); + rxctl = NFE_READ(sc, NFE_RX_CTL); + if (sc->nfe_link != 0 && (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + txctl |= NFE_TX_START; + rxctl |= NFE_RX_START; + } else { + txctl &= ~NFE_TX_START; + rxctl &= ~NFE_RX_START; + } + NFE_WRITE(sc, NFE_TX_CTL, txctl); + NFE_WRITE(sc, NFE_RX_CTL, rxctl); +} + + +static void +nfe_mac_config(struct nfe_softc *sc, struct mii_data *mii) +{ + uint32_t link, misc, phy, seed; + uint32_t val; + + NFE_LOCK_ASSERT(sc); phy = NFE_READ(sc, NFE_PHY_IFACE); phy &= ~(NFE_PHY_HDX | NFE_PHY_100TX | NFE_PHY_1000T); @@ -845,7 +864,10 @@ nfe_link_task(void *arg, int pending) seed = NFE_READ(sc, NFE_RNDSEED); seed &= ~NFE_SEED_MASK; - if (((mii->mii_media_active & IFM_GMASK) & IFM_FDX) == 0) { + misc = NFE_MISC1_MAGIC; + link = NFE_MEDIA_SET; + + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) == 0) { phy |= NFE_PHY_HDX; /* half-duplex */ misc |= NFE_MISC1_HDX; } @@ -882,18 +904,18 @@ nfe_link_task(void *arg, int pending) NFE_WRITE(sc, NFE_MISC1, misc); NFE_WRITE(sc, NFE_LINKSPEED, link); - gmask = mii->mii_media_active & IFM_GMASK; - if ((gmask & IFM_FDX) != 0) { + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { /* It seems all hardwares supports Rx pause frames. */ val = NFE_READ(sc, NFE_RXFILTER); - if ((gmask & IFM_FLAG0) != 0) + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FLAG0) != 0) val |= NFE_PFF_RX_PAUSE; else val &= ~NFE_PFF_RX_PAUSE; NFE_WRITE(sc, NFE_RXFILTER, val); if ((sc->nfe_flags & NFE_TX_FLOW_CTRL) != 0) { val = NFE_READ(sc, NFE_MISC1); - if ((gmask & IFM_FLAG1) != 0) { + if ((IFM_OPTIONS(mii->mii_media_active) & + IFM_FLAG1) != 0) { NFE_WRITE(sc, NFE_TX_PAUSE_FRAME, NFE_TX_PAUSE_FRAME_ENABLE); val |= NFE_MISC1_TX_PAUSE; @@ -917,20 +939,6 @@ nfe_link_task(void *arg, int pending) NFE_WRITE(sc, NFE_MISC1, val); } } - - txctl = NFE_READ(sc, NFE_TX_CTL); - rxctl = NFE_READ(sc, NFE_RX_CTL); - if (sc->nfe_link != 0 && (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { - txctl |= NFE_TX_START; - rxctl |= NFE_RX_START; - } else { - txctl &= ~NFE_TX_START; - rxctl &= ~NFE_RX_START; - } - NFE_WRITE(sc, NFE_TX_CTL, txctl); - NFE_WRITE(sc, NFE_RX_CTL, rxctl); - - NFE_UNLOCK(sc); } @@ -1713,6 +1721,10 @@ nfe_ioctl(struct ifnet *ifp, u_long cmd, } } #endif /* DEVICE_POLLING */ + if ((mask & IFCAP_WOL_MAGIC) != 0 && + (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0) + ifp->if_capenable ^= IFCAP_WOL_MAGIC; + if ((sc->nfe_flags & NFE_HW_CSUM) != 0 && (mask & IFCAP_HWCSUM) != 0) { ifp->if_capenable ^= IFCAP_HWCSUM; @@ -2737,7 +2749,8 @@ nfe_init_locked(void *xsc) NFE_WRITE(sc, NFE_STATUS, sc->mii_phyaddr << 24 | NFE_STATUS_MAGIC); NFE_WRITE(sc, NFE_SETUP_R4, NFE_R4_MAGIC); - NFE_WRITE(sc, NFE_WOL_CTL, NFE_WOL_MAGIC); + /* Disable WOL. */ + NFE_WRITE(sc, NFE_WOL_CTL, 0); sc->rxtxctl &= ~NFE_RXTX_BIT2; NFE_WRITE(sc, NFE_RXTX_CTL, sc->rxtxctl); @@ -2908,18 +2921,8 @@ nfe_tick(void *xsc) static int nfe_shutdown(device_t dev) { - struct nfe_softc *sc; - struct ifnet *ifp; - - sc = device_get_softc(dev); - NFE_LOCK(sc); - ifp = sc->nfe_ifp; - nfe_stop(ifp); - /* nfe_reset(sc); */ - NFE_UNLOCK(sc); - - return (0); + return (nfe_suspend(dev)); } @@ -3203,3 +3206,115 @@ nfe_stats_update(struct nfe_softc *sc) stats->rx_broadcast += NFE_READ(sc, NFE_TX_BROADCAST); } } + + +static void +nfe_set_linkspeed(struct nfe_softc *sc) +{ + struct mii_softc *miisc; + struct mii_data *mii; + int aneg, i, phyno; + + NFE_LOCK_ASSERT(sc); + + mii = device_get_softc(sc->nfe_miibus); + mii_pollstat(mii); + aneg = 0; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch IFM_SUBTYPE(mii->mii_media_active) { + case IFM_10_T: + case IFM_100_TX: + return; + case IFM_1000_T: + aneg++; + break; + default: + break; + } + } + phyno = 0; + if (mii->mii_instance) { + miisc = LIST_FIRST(&mii->mii_phys); + phyno = miisc->mii_phy; + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) + mii_phy_reset(miisc); + } else + return; + nfe_miibus_writereg(sc->nfe_dev, phyno, MII_100T2CR, 0); + nfe_miibus_writereg(sc->nfe_dev, phyno, + MII_ANAR, ANAR_TX_FD | ANAR_TX | ANAR_10_FD | ANAR_10 | ANAR_CSMA); + nfe_miibus_writereg(sc->nfe_dev, phyno, + MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG); + DELAY(1000); + if (aneg != 0) { + /* + * Poll link state until nfe(4) get a 10/100Mbps link. + */ + for (i = 0; i < MII_ANEGTICKS_GIGE; i++) { + mii_pollstat(mii); + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) + == (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + nfe_mac_config(sc, mii); + return; + default: + break; + } + } + NFE_UNLOCK(sc); + pause("nfelnk", hz); + NFE_LOCK(sc); + } + if (i == MII_ANEGTICKS_GIGE) + device_printf(sc->nfe_dev, + "establishing a link failed, WOL may not work!"); + } + /* + * No link, force MAC to have 100Mbps, full-duplex link. + * This is the last resort and may/may not work. + */ + mii->mii_media_status = IFM_AVALID | IFM_ACTIVE; + mii->mii_media_active = IFM_ETHER | IFM_100_TX | IFM_FDX; + nfe_mac_config(sc, mii); +} + + +static void +nfe_set_wol(struct nfe_softc *sc) +{ + struct ifnet *ifp; + uint32_t wolctl; + int pmc; + uint16_t pmstat; + + NFE_LOCK_ASSERT(sc); + + if (pci_find_extcap(sc->nfe_dev, PCIY_PMG, &pmc) != 0) + return; + ifp = sc->nfe_ifp; + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + wolctl = NFE_WOL_MAGIC; + else + wolctl = 0; + NFE_WRITE(sc, NFE_WOL_CTL, wolctl); + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) { + nfe_set_linkspeed(sc); + if ((sc->nfe_flags & NFE_PWR_MGMT) != 0) + NFE_WRITE(sc, NFE_PWR2_CTL, + NFE_READ(sc, NFE_PWR2_CTL) & ~NFE_PWR2_GATE_CLOCKS); + /* Enable RX. */ + NFE_WRITE(sc, NFE_RX_RING_ADDR_HI, 0); + NFE_WRITE(sc, NFE_RX_RING_ADDR_LO, 0); + NFE_WRITE(sc, NFE_RX_CTL, NFE_READ(sc, NFE_RX_CTL) | + NFE_RX_START); + } + /* Request PME if WOL is requested. */ + pmstat = pci_read_config(sc->nfe_dev, pmc + PCIR_POWER_STATUS, 2); + pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); + if ((ifp->if_capenable & IFCAP_WOL) != 0) + pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->nfe_dev, pmc + PCIR_POWER_STATUS, pmstat, 2); +} Modified: stable/7/sys/dev/nfe/if_nfereg.h ============================================================================== --- stable/7/sys/dev/nfe/if_nfereg.h Thu Nov 18 17:44:02 2010 (r215456) +++ stable/7/sys/dev/nfe/if_nfereg.h Thu Nov 18 17:49:24 2010 (r215457) @@ -190,6 +190,7 @@ #define NFE_PWR2_WAKEUP_MASK 0x0f11 #define NFE_PWR2_REVA3 (1 << 0) +#define NFE_PWR2_GATE_CLOCKS 0x0f00 #define NFE_MEDIA_SET 0x10000 #define NFE_MEDIA_1000T 0x00032 Modified: stable/7/sys/dev/nfe/if_nfevar.h ============================================================================== --- stable/7/sys/dev/nfe/if_nfevar.h Thu Nov 18 17:44:02 2010 (r215456) +++ stable/7/sys/dev/nfe/if_nfevar.h Thu Nov 18 17:49:24 2010 (r215457) @@ -140,7 +140,6 @@ struct nfe_softc { struct taskqueue *nfe_tq; struct task nfe_int_task; struct task nfe_tx_task; - struct task nfe_link_task; int nfe_link; int nfe_suspended; int nfe_framesize; From owner-svn-src-stable-7@FreeBSD.ORG Thu Nov 18 18:05:59 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1F0F106566B; Thu, 18 Nov 2010 18:05:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E29B48FC0A; Thu, 18 Nov 2010 18:05:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAII5xSD040444; Thu, 18 Nov 2010 18:05:59 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAII5xGI040442; Thu, 18 Nov 2010 18:05:59 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011181805.oAII5xGI040442@svn.freebsd.org> From: Marius Strobl Date: Thu, 18 Nov 2010 18:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215461 - stable/7/sys/dev/mii X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 18:06:00 -0000 Author: marius Date: Thu Nov 18 18:05:59 2010 New Revision: 215461 URL: http://svn.freebsd.org/changeset/base/215461 Log: MFC: r215348 Return from mii_attach() after calling bus_generic_attach(9) on the device_t of the MAC driver in order to attach miibus(4) on the first pass instead of falling through to also calling it on the device_t of miibus(4). The latter code flow was intended to attach the PHY drivers the same way regardless of whether it's the first or a repeated pass, modulo the bus_generic_attach() call in miibus_attach() which shouldn't be there. However, it turned out that these variants cause miibus(4) to be attached twice under certain conditions when using MAC drivers as modules. Submitted by: yongari Modified: stable/7/sys/dev/mii/mii.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/mii.c ============================================================================== --- stable/7/sys/dev/mii/mii.c Thu Nov 18 18:03:52 2010 (r215460) +++ stable/7/sys/dev/mii/mii.c Thu Nov 18 18:05:59 2010 (r215461) @@ -447,6 +447,9 @@ mii_attach(device_t dev, device_t *miibu rv = bus_generic_attach(dev); if (rv != 0) goto fail; + + /* Attaching of the PHY drivers is done in miibus_attach(). */ + return (0); } rv = bus_generic_attach(*miibus); if (rv != 0) From owner-svn-src-stable-7@FreeBSD.ORG Thu Nov 18 19:08:57 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 453111065672; Thu, 18 Nov 2010 19:08:57 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 368838FC15; Thu, 18 Nov 2010 19:08:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAIJ8vJE042215; Thu, 18 Nov 2010 19:08:57 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAIJ8v8g042213; Thu, 18 Nov 2010 19:08:57 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201011181908.oAIJ8v8g042213@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 18 Nov 2010 19:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215467 - stable/7/usr.bin/truss X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 19:08:57 -0000 Author: jh Date: Thu Nov 18 19:08:56 2010 New Revision: 215467 URL: http://svn.freebsd.org/changeset/base/215467 Log: MFC r215235: Set FD_CLOEXEC for the output file only when the file has been specified with the -o option. Setting the flag for stderr (the default) could cause the traced process to redirect stderr to a random file. PR: bin/152151 Modified: stable/7/usr.bin/truss/main.c Directory Properties: stable/7/usr.bin/truss/ (props changed) Modified: stable/7/usr.bin/truss/main.c ============================================================================== --- stable/7/usr.bin/truss/main.c Thu Nov 18 19:06:56 2010 (r215466) +++ stable/7/usr.bin/truss/main.c Thu Nov 18 19:08:56 2010 (r215467) @@ -230,13 +230,14 @@ main(int ac, char **av) if (fname != NULL) { /* Use output file */ if ((trussinfo->outfile = fopen(fname, "w")) == NULL) errx(1, "cannot open %s", fname); + /* + * Set FD_CLOEXEC, so that the output file is not shared with + * the traced process. + */ + if (fcntl(fileno(trussinfo->outfile), F_SETFD, FD_CLOEXEC) == + -1) + warn("fcntl()"); } - /* - * Set FD_CLOEXEC, so that the output file is not shared with - * the traced process. - */ - if (fcntl(fileno(trussinfo->outfile), F_SETFD, FD_CLOEXEC) == -1) - warn("fcntl()"); /* * If truss starts the process itself, it will ignore some signals -- From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 19 09:59:42 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37DEC106566B; Fri, 19 Nov 2010 09:59:42 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 267488FC1A; Fri, 19 Nov 2010 09:59:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAJ9xglR067686; Fri, 19 Nov 2010 09:59:42 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAJ9xg8x067684; Fri, 19 Nov 2010 09:59:42 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201011190959.oAJ9xg8x067684@svn.freebsd.org> From: Xin LI Date: Fri, 19 Nov 2010 09:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215514 - stable/7/contrib/netcat X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2010 09:59:42 -0000 Author: delphij Date: Fri Nov 19 09:59:41 2010 New Revision: 215514 URL: http://svn.freebsd.org/changeset/base/215514 Log: RELENG_7 does not have IP_BINDANY yet so hide it under ifdef. Reported by: tinderbox Modified: stable/7/contrib/netcat/netcat.c Modified: stable/7/contrib/netcat/netcat.c ============================================================================== --- stable/7/contrib/netcat/netcat.c Fri Nov 19 09:49:14 2010 (r215513) +++ stable/7/contrib/netcat/netcat.c Fri Nov 19 09:59:41 2010 (r215514) @@ -569,8 +569,10 @@ remote_connect(const char *host, const c if (sflag || pflag) { struct addrinfo ahints, *ares; +#ifdef IP_BINDANY /* try IP_BINDANY, but don't insist */ setsockopt(s, IPPROTO_IP, IP_BINDANY, &on, sizeof(on)); +#endif memset(&ahints, 0, sizeof(struct addrinfo)); ahints.ai_family = res0->ai_family; ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 19 16:26:51 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B690F1065672; Fri, 19 Nov 2010 16:26:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C0BD8FC19; Fri, 19 Nov 2010 16:26:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAJGQpGq080294; Fri, 19 Nov 2010 16:26:51 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAJGQpUI080291; Fri, 19 Nov 2010 16:26:51 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011191626.oAJGQpUI080291@svn.freebsd.org> From: John Baldwin Date: Fri, 19 Nov 2010 16:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215528 - in stable/7/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2010 16:26:51 -0000 Author: jhb Date: Fri Nov 19 16:26:51 2010 New Revision: 215528 URL: http://svn.freebsd.org/changeset/base/215528 Log: MFC 215001: Only dump the values of the PMC and CMCI local vector table entries on a local APIC if those LVT entries are valid. This quiets spurious illegal register local APIC errors during boot on a CPU that doesn't support those vectors. Modified: stable/7/sys/amd64/amd64/local_apic.c stable/7/sys/i386/i386/local_apic.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/local_apic.c ============================================================================== --- stable/7/sys/amd64/amd64/local_apic.c Fri Nov 19 16:24:12 2010 (r215527) +++ stable/7/sys/amd64/amd64/local_apic.c Fri Nov 19 16:26:51 2010 (r215528) @@ -272,16 +272,21 @@ lapic_create(u_int apic_id, int boot_cpu void lapic_dump(const char* str) { + uint32_t maxlvt; + maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; printf("cpu%d %s:\n", PCPU_GET(cpuid), str); printf(" ID: 0x%08x VER: 0x%08x LDR: 0x%08x DFR: 0x%08x\n", lapic->id, lapic->version, lapic->ldr, lapic->dfr); printf(" lint0: 0x%08x lint1: 0x%08x TPR: 0x%08x SVR: 0x%08x\n", lapic->lvt_lint0, lapic->lvt_lint1, lapic->tpr, lapic->svr); - printf(" timer: 0x%08x therm: 0x%08x err: 0x%08x pmc: 0x%08x\n", - lapic->lvt_timer, lapic->lvt_thermal, lapic->lvt_error, - lapic->lvt_pcint); - printf(" cmci: 0x%08x\n", lapic->lvt_cmci); + printf(" timer: 0x%08x therm: 0x%08x err: 0x%08x", + lapic->lvt_timer, lapic->lvt_thermal, lapic->lvt_error); + if (maxlvt >= LVT_PMC) + printf(" pmc: 0x%08x", lapic->lvt_pcint); + printf("\n"); + if (maxlvt >= LVT_CMCI) + printf(" cmci: 0x%08x\n", lapic->lvt_cmci); } void Modified: stable/7/sys/i386/i386/local_apic.c ============================================================================== --- stable/7/sys/i386/i386/local_apic.c Fri Nov 19 16:24:12 2010 (r215527) +++ stable/7/sys/i386/i386/local_apic.c Fri Nov 19 16:26:51 2010 (r215528) @@ -276,16 +276,21 @@ lapic_create(u_int apic_id, int boot_cpu void lapic_dump(const char* str) { + uint32_t maxlvt; + maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; printf("cpu%d %s:\n", PCPU_GET(cpuid), str); printf(" ID: 0x%08x VER: 0x%08x LDR: 0x%08x DFR: 0x%08x\n", lapic->id, lapic->version, lapic->ldr, lapic->dfr); printf(" lint0: 0x%08x lint1: 0x%08x TPR: 0x%08x SVR: 0x%08x\n", lapic->lvt_lint0, lapic->lvt_lint1, lapic->tpr, lapic->svr); - printf(" timer: 0x%08x therm: 0x%08x err: 0x%08x pmc: 0x%08x\n", - lapic->lvt_timer, lapic->lvt_thermal, lapic->lvt_error, - lapic->lvt_pcint); - printf(" cmci: 0x%08x\n", lapic->lvt_cmci); + printf(" timer: 0x%08x therm: 0x%08x err: 0x%08x", + lapic->lvt_timer, lapic->lvt_thermal, lapic->lvt_error); + if (maxlvt >= LVT_PMC) + printf(" pmc: 0x%08x", lapic->lvt_pcint); + printf("\n"); + if (maxlvt >= LVT_CMCI) + printf(" cmci: 0x%08x\n", lapic->lvt_cmci); } void From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 19 17:04:59 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 980141065747; Fri, 19 Nov 2010 17:04:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07B6E8FC16; Fri, 19 Nov 2010 17:04:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAJH4vIT081640; Fri, 19 Nov 2010 17:04:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAJH4v30081638; Fri, 19 Nov 2010 17:04:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011191704.oAJH4v30081638@svn.freebsd.org> From: Marius Strobl Date: Fri, 19 Nov 2010 17:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215531 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2010 17:04:59 -0000 Author: marius Date: Fri Nov 19 17:04:57 2010 New Revision: 215531 URL: http://svn.freebsd.org/changeset/base/215531 Log: MFC: r214879 Implement pmap_is_prefaultable(). Reviewed by: alc (with bugfix) Modified: stable/7/sys/sparc64/sparc64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Fri Nov 19 17:04:55 2010 (r215530) +++ stable/7/sys/sparc64/sparc64/pmap.c Fri Nov 19 17:04:57 2010 (r215531) @@ -1903,8 +1903,12 @@ pmap_is_modified(vm_page_t m) boolean_t pmap_is_prefaultable(pmap_t pmap, vm_offset_t addr) { + boolean_t rv; - return (FALSE); + PMAP_LOCK(pmap); + rv = tsb_tte_lookup(pmap, addr) == NULL; + PMAP_UNLOCK(pmap); + return (rv); } void From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 19 17:07:33 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B32B81065670; Fri, 19 Nov 2010 17:07:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A25CC8FC1A; Fri, 19 Nov 2010 17:07:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAJH7XqA081823; Fri, 19 Nov 2010 17:07:33 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAJH7XpS081821; Fri, 19 Nov 2010 17:07:33 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011191707.oAJH7XpS081821@svn.freebsd.org> From: Marius Strobl Date: Fri, 19 Nov 2010 17:07:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215533 - stable/7/sys/dev/mii X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2010 17:07:33 -0000 Author: marius Date: Fri Nov 19 17:07:33 2010 New Revision: 215533 URL: http://svn.freebsd.org/changeset/base/215533 Log: MFC: r215300 Remove redundant cases and a style(9) bug. Modified: stable/7/sys/dev/mii/xmphy.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/xmphy.c ============================================================================== --- stable/7/sys/dev/mii/xmphy.c Fri Nov 19 17:07:32 2010 (r215532) +++ stable/7/sys/dev/mii/xmphy.c Fri Nov 19 17:07:33 2010 (r215533) @@ -167,7 +167,7 @@ xmphy_service(struct mii_softc *sc, stru if (PHY_READ(sc, XMPHY_MII_BMCR) & XMPHY_BMCR_AUTOEN) return (0); #endif - (void) xmphy_mii_phy_auto(sc); + (void)xmphy_mii_phy_auto(sc); break; case IFM_1000_SX: mii_phy_reset(sc); @@ -179,9 +179,6 @@ xmphy_service(struct mii_softc *sc, stru PHY_WRITE(sc, XMPHY_MII_BMCR, 0); } break; - case IFM_100_T4: - case IFM_100_TX: - case IFM_10_T: default: return (EINVAL); } From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 19 17:08:29 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D50E106566B; Fri, 19 Nov 2010 17:08:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B1788FC1D; Fri, 19 Nov 2010 17:08:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAJH8THF081942; Fri, 19 Nov 2010 17:08:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAJH8TYS081934; Fri, 19 Nov 2010 17:08:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011191708.oAJH8TYS081934@svn.freebsd.org> From: John Baldwin Date: Fri, 19 Nov 2010 17:08:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215535 - stable/7/usr.sbin/mptutil X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2010 17:08:29 -0000 Author: jhb Date: Fri Nov 19 17:08:29 2010 New Revision: 215535 URL: http://svn.freebsd.org/changeset/base/215535 Log: MFC 204352, 208028, 209266, 209399, 210723, 213672, 215046: - Fixed static linkage. - Document that mptutil/mpt do not support RAID volumes in excess of 2TB. - Report subcommand handler errors so that tools that invoke mptutil can robustly report errors. - Save errno values before calling warn(3) so that errors are correctly reported. - Check for malloc() failures. Modified: stable/7/usr.sbin/mptutil/Makefile stable/7/usr.sbin/mptutil/mpt_cam.c stable/7/usr.sbin/mptutil/mpt_cmd.c stable/7/usr.sbin/mptutil/mpt_config.c stable/7/usr.sbin/mptutil/mpt_drive.c stable/7/usr.sbin/mptutil/mpt_evt.c stable/7/usr.sbin/mptutil/mpt_show.c stable/7/usr.sbin/mptutil/mpt_volume.c stable/7/usr.sbin/mptutil/mptutil.8 stable/7/usr.sbin/mptutil/mptutil.c Directory Properties: stable/7/usr.sbin/mptutil/ (props changed) Modified: stable/7/usr.sbin/mptutil/Makefile ============================================================================== --- stable/7/usr.sbin/mptutil/Makefile Fri Nov 19 17:08:15 2010 (r215534) +++ stable/7/usr.sbin/mptutil/Makefile Fri Nov 19 17:08:29 2010 (r215535) @@ -8,8 +8,8 @@ MAN= mptutil.8 WARNS?= 3 -DPADD+= ${LIBCAM} ${LIBUTIL} -LDADD+= -lcam -lutil +DPADD= ${LIBCAM} ${LIBSBUF} ${LIBUTIL} +LDADD= -lcam -lsbuf -lutil # Here be dragons .ifdef DEBUG Modified: stable/7/usr.sbin/mptutil/mpt_cam.c ============================================================================== --- stable/7/usr.sbin/mptutil/mpt_cam.c Fri Nov 19 17:08:15 2010 (r215534) +++ stable/7/usr.sbin/mptutil/mpt_cam.c Fri Nov 19 17:08:29 2010 (r215535) @@ -63,6 +63,7 @@ fetch_path_id(path_id_t *path_id) struct bus_match_pattern *b; union ccb ccb; size_t bufsize; + int error; if (xpt_open() < 0) return (ENXIO); @@ -91,9 +92,10 @@ fetch_path_id(path_id_t *path_id) b->flags = BUS_MATCH_NAME | BUS_MATCH_UNIT | BUS_MATCH_BUS_ID; if (ioctl(xptfd, CAMIOCOMMAND, &ccb) < 0) { + error = errno; free(ccb.cdm.matches); free(ccb.cdm.patterns); - return (errno); + return (error); } free(ccb.cdm.patterns); @@ -124,7 +126,7 @@ mpt_query_disk(U8 VolumeBus, U8 VolumeID union ccb ccb; path_id_t path_id; size_t bufsize; - int error, i; + int error; /* mpt(4) only handles devices on bus 0. */ if (VolumeBus != 0) @@ -164,10 +166,10 @@ mpt_query_disk(U8 VolumeBus, U8 VolumeID p->flags = PERIPH_MATCH_PATH | PERIPH_MATCH_NAME | PERIPH_MATCH_TARGET; if (ioctl(xptfd, CAMIOCOMMAND, &ccb) < 0) { - i = errno; + error = errno; free(ccb.cdm.matches); free(ccb.cdm.patterns); - return (i); + return (error); } free(ccb.cdm.patterns); @@ -397,8 +399,8 @@ mpt_fetch_disks(int fd, int *ndisks, str union ccb ccb; path_id_t path_id; size_t bufsize; - u_int i; int count, error; + uint32_t i; if (xpt_open() < 0) return (ENXIO); @@ -431,10 +433,10 @@ mpt_fetch_disks(int fd, int *ndisks, str p->flags = PERIPH_MATCH_PATH | PERIPH_MATCH_NAME; if (ioctl(xptfd, CAMIOCOMMAND, &ccb) < 0) { - i = errno; + error = errno; free(ccb.cdm.matches); free(ccb.cdm.patterns); - return (i); + return (error); } free(ccb.cdm.patterns); @@ -481,6 +483,8 @@ mpt_fetch_disks(int fd, int *ndisks, str * exclude them from the list. */ ioc2 = mpt_read_ioc_page(fd, 2, NULL); + if (ioc2 == NULL) + return (errno); disks = calloc(ccb.cdm.num_matches, sizeof(*disks)); count = 0; for (i = 0; i < ccb.cdm.num_matches; i++) { Modified: stable/7/usr.sbin/mptutil/mpt_cmd.c ============================================================================== --- stable/7/usr.sbin/mptutil/mpt_cmd.c Fri Nov 19 17:08:15 2010 (r215534) +++ stable/7/usr.sbin/mptutil/mpt_cmd.c Fri Nov 19 17:08:29 2010 (r215535) @@ -310,18 +310,15 @@ mpt_lookup_volume(int fd, const char *na id = strtol(cp + 1, &cp, 0); if (*cp == '\0') { if (bus < 0 || bus > 0xff || id < 0 || id > 0xff) { - errno = EINVAL; - return (-1); + return (EINVAL); } *VolumeBus = bus; *VolumeID = id; return (0); } } else if (*cp == '\0') { - if (bus < 0 || bus > 0xff) { - errno = EINVAL; - return (-1); - } + if (bus < 0 || bus > 0xff) + return (EINVAL); *VolumeBus = 0; *VolumeID = bus; return (0); @@ -329,7 +326,7 @@ mpt_lookup_volume(int fd, const char *na ioc2 = mpt_read_ioc_page(fd, 2, NULL); if (ioc2 == NULL) - return (-1); + return (errno); vol = ioc2->RaidVolume; for (i = 0; i < ioc2->NumActiveVolumes; vol++, i++) { @@ -343,8 +340,7 @@ mpt_lookup_volume(int fd, const char *na } } free(ioc2); - errno = EINVAL; - return (-1); + return (EINVAL); } int @@ -360,15 +356,14 @@ mpt_read_config_page_header(int fd, U8 P req.header.PageNumber = PageNumber; req.page_address = PageAddress; if (ioctl(fd, MPTIO_READ_CFG_HEADER, &req) < 0) - return (-1); + return (errno); if (!IOC_STATUS_SUCCESS(req.ioc_status)) { if (IOCStatus != NULL) *IOCStatus = req.ioc_status; else warnx("Reading config page header failed: %s", mpt_ioc_status(req.ioc_status)); - errno = EIO; - return (-1); + return (EIO); } *header = req.header; return (0); @@ -380,7 +375,7 @@ mpt_read_config_page(int fd, U8 PageType { struct mpt_cfg_page_req req; void *buf; - int save_errno; + int error; if (IOCStatus != NULL) *IOCStatus = MPI_IOCSTATUS_SUCCESS; @@ -404,9 +399,9 @@ mpt_read_config_page(int fd, U8 PageType req.buf = buf; bcopy(&req.header, buf, sizeof(req.header)); if (ioctl(fd, MPTIO_READ_CFG_PAGE, &req) < 0) { - save_errno = errno; + error = errno; free(buf); - errno = save_errno; + errno = error; return (NULL); } if (!IOC_STATUS_SUCCESS(req.ioc_status)) { @@ -428,7 +423,7 @@ mpt_read_extended_config_page(int fd, U8 { struct mpt_ext_cfg_page_req req; void *buf; - int save_errno; + int error; if (IOCStatus != NULL) *IOCStatus = MPI_IOCSTATUS_SUCCESS; @@ -453,9 +448,9 @@ mpt_read_extended_config_page(int fd, U8 req.buf = buf; bcopy(&req.header, buf, sizeof(req.header)); if (ioctl(fd, MPTIO_READ_EXT_CFG_PAGE, &req) < 0) { - save_errno = errno; + error = errno; free(buf); - errno = save_errno; + errno = error; return (NULL); } if (!IOC_STATUS_SUCCESS(req.ioc_status)) { @@ -484,7 +479,7 @@ mpt_write_config_page(int fd, void *buf, hdr = buf; req.len = hdr->PageLength * 4; if (ioctl(fd, MPTIO_WRITE_CFG_PAGE, &req) < 0) - return (-1); + return (errno); if (!IOC_STATUS_SUCCESS(req.ioc_status)) { if (IOCStatus != NULL) { *IOCStatus = req.ioc_status; @@ -492,8 +487,7 @@ mpt_write_config_page(int fd, void *buf, } warnx("Writing config page failed: %s", mpt_ioc_status(req.ioc_status)); - errno = EIO; - return (-1); + return (EIO); } return (0); } @@ -507,10 +501,8 @@ mpt_raid_action(int fd, U8 Action, U8 Vo if (IOCStatus != NULL) *IOCStatus = MPI_IOCSTATUS_SUCCESS; - if (datalen < 0 || (unsigned)datalen > sizeof(raid_act.action_data)) { - errno = EINVAL; - return (-1); - } + if (datalen < 0 || (unsigned)datalen > sizeof(raid_act.action_data)) + return (EINVAL); bzero(&raid_act, sizeof(raid_act)); raid_act.action = Action; raid_act.volume_bus = VolumeBus; @@ -524,7 +516,7 @@ mpt_raid_action(int fd, U8 Action, U8 Vo } if (ioctl(fd, MPTIO_RAID_ACTION, &raid_act) < 0) - return (-1); + return (errno); if (!IOC_STATUS_SUCCESS(raid_act.ioc_status)) { if (IOCStatus != NULL) { @@ -533,8 +525,7 @@ mpt_raid_action(int fd, U8 Action, U8 Vo } warnx("RAID action failed: %s", mpt_ioc_status(raid_act.ioc_status)); - errno = EIO; - return (-1); + return (EIO); } if (ActionStatus != NULL) @@ -544,8 +535,7 @@ mpt_raid_action(int fd, U8 Action, U8 Vo return (0); warnx("RAID action failed: %s", mpt_raid_status(raid_act.action_status)); - errno = EIO; - return (-1); + return (EIO); } if (VolumeStatus != NULL) Modified: stable/7/usr.sbin/mptutil/mpt_config.c ============================================================================== --- stable/7/usr.sbin/mptutil/mpt_config.c Fri Nov 19 17:08:15 2010 (r215534) +++ stable/7/usr.sbin/mptutil/mpt_config.c Fri Nov 19 17:08:29 2010 (r215535) @@ -102,15 +102,15 @@ mpt_lock_volume(U8 VolumeBus, U8 VolumeI */ return (0); if (error) { - errno = error; - warn("Unable to lookup volume device name"); - return (-1); + warnc(error, "Unable to lookup volume device name"); + return (error); } snprintf(path, sizeof(path), "%s%s", _PATH_DEV, qd.devname); vfd = open(path, O_RDWR); if (vfd < 0) { + error = errno; warn("Unable to lock volume %s", qd.devname); - return (-1); + return (error); } return (0); } @@ -119,13 +119,14 @@ static int mpt_lock_physdisk(struct mpt_standalone_disk *disk) { char path[MAXPATHLEN]; - int dfd; + int dfd, error; snprintf(path, sizeof(path), "%s%s", _PATH_DEV, disk->devname); dfd = open(path, O_RDWR); if (dfd < 0) { + error = errno; warn("Unable to lock disk %s", disk->devname); - return (-1); + return (error); } return (0); } @@ -144,8 +145,7 @@ mpt_lookup_standalone_disk(const char *n id = strtol(cp + 1, &cp, 0); if (*cp == '\0') { if (bus < 0 || bus > 0xff || id < 0 || id > 0xff) { - errno = EINVAL; - return (-1); + return (EINVAL); } for (i = 0; i < ndisks; i++) { if (disks[i].bus == (U8)bus && @@ -154,8 +154,7 @@ mpt_lookup_standalone_disk(const char *n return (0); } } - errno = ENOENT; - return (-1); + return (ENOENT); } } @@ -166,12 +165,10 @@ mpt_lookup_standalone_disk(const char *n return (0); } } - errno = ENOENT; - return (-1); + return (ENOENT); } - errno = EINVAL; - return (-1); + return (EINVAL); } /* @@ -182,16 +179,17 @@ mpt_create_physdisk(int fd, struct mpt_s { CONFIG_PAGE_HEADER header; CONFIG_PAGE_RAID_PHYS_DISK_0 *config_page; + int error; U32 ActionData; - if (mpt_read_config_page_header(fd, MPI_CONFIG_PAGETYPE_RAID_PHYSDISK, - 0, 0, &header, NULL) < 0) - return (-1); + error = mpt_read_config_page_header(fd, MPI_CONFIG_PAGETYPE_RAID_PHYSDISK, + 0, 0, &header, NULL); + if (error) + return (error); if (header.PageVersion > MPI_RAIDPHYSDISKPAGE0_PAGEVERSION) { warnx("Unsupported RAID physdisk page 0 version %d", header.PageVersion); - errno = EOPNOTSUPP; - return (-1); + return (EOPNOTSUPP); } config_page = calloc(1, sizeof(CONFIG_PAGE_RAID_PHYS_DISK_0)); config_page->Header.PageType = MPI_CONFIG_PAGETYPE_RAID_PHYSDISK; @@ -203,10 +201,11 @@ mpt_create_physdisk(int fd, struct mpt_s config_page->PhysDiskID = disk->target; /* XXX: Enclosure info for PhysDiskSettings? */ - if (mpt_raid_action(fd, MPI_RAID_ACTION_CREATE_PHYSDISK, 0, 0, 0, 0, + error = mpt_raid_action(fd, MPI_RAID_ACTION_CREATE_PHYSDISK, 0, 0, 0, 0, config_page, sizeof(CONFIG_PAGE_RAID_PHYS_DISK_0), NULL, - &ActionData, sizeof(ActionData), NULL, NULL, 1) < 0) - return (-1); + &ActionData, sizeof(ActionData), NULL, NULL, 1); + if (error) + return (error); *PhysDiskNum = ActionData & 0xff; return (0); } @@ -232,18 +231,20 @@ clear_config(int ac, char **av) IOC_3_PHYS_DISK *disk; CONFIG_PAGE_IOC_5 *ioc5; IOC_5_HOT_SPARE *spare; - int ch, fd, i; + int ch, error, fd, i; fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } ioc2 = mpt_read_ioc_page(fd, 2, NULL); if (ioc2 == NULL) { + error = errno; warn("Failed to fetch volume list"); - return (errno); + return (error); } /* Lock all the volumes first. */ @@ -267,14 +268,16 @@ clear_config(int ac, char **av) /* Delete all the volumes. */ vol = ioc2->RaidVolume; - for (i = 0; i < ioc2->NumActiveVolumes; vol++, i++) - if (mpt_raid_action(fd, MPI_RAID_ACTION_DELETE_VOLUME, + for (i = 0; i < ioc2->NumActiveVolumes; vol++, i++) { + error = mpt_raid_action(fd, MPI_RAID_ACTION_DELETE_VOLUME, vol->VolumeBus, vol->VolumeID, 0, MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS | MPI_RAID_ACTION_ADATA_ZERO_LBA0, NULL, 0, NULL, NULL, 0, - NULL, NULL, 0) < 0) - warn("Failed to delete volume %s", + NULL, NULL, 0); + if (error) + warnc(error, "Failed to delete volume %s", mpt_volume_name(vol->VolumeBus, vol->VolumeID)); + } free(ioc2); /* Delete all the spares. */ @@ -411,8 +414,9 @@ parse_volume(int fd, int raid_type, stru /* See if it is a standalone disk. */ if (mpt_lookup_standalone_disk(cp, state->sdisks, state->nsdisks, &i) < 0) { + error = errno; warn("Unable to lookup drive %s", cp); - return (errno); + return (error); } dinfo->sdisk = &state->sdisks[i]; @@ -433,17 +437,18 @@ add_drives(int fd, struct volume_info *i { struct drive_info *dinfo; U8 PhysDiskNum; - int i; + int error, i; for (i = 0, dinfo = info->drives; i < info->drive_count; i++, dinfo++) { if (dinfo->info == NULL) { if (mpt_create_physdisk(fd, dinfo->sdisk, &PhysDiskNum) < 0) { + error = errno; warn( "Failed to create physical disk page for %s", dinfo->sdisk->devname); - return (errno); + return (error); } if (verbose) printf("Added drive %s with PhysDiskNum %u\n", @@ -500,11 +505,14 @@ build_volume(int fd, struct volume_info U32 MinLBA; uint64_t MaxLBA; size_t page_size; - int i; + int error, i; - if (mpt_read_config_page_header(fd, MPI_CONFIG_PAGETYPE_RAID_VOLUME, - 0, 0, &header, NULL) < 0) + error = mpt_read_config_page_header(fd, MPI_CONFIG_PAGETYPE_RAID_VOLUME, + 0, 0, &header, NULL); + if (error) { + errno = error; return (NULL); + } if (header.PageVersion > MPI_RAIDVOLPAGE0_PAGEVERSION) { warnx("Unsupported RAID volume page 0 version %d", header.PageVersion); @@ -514,6 +522,8 @@ build_volume(int fd, struct volume_info page_size = sizeof(CONFIG_PAGE_RAID_VOL_0) + sizeof(RAID_VOL0_PHYS_DISK) * (info->drive_count - 1); vol = calloc(1, page_size); + if (vol == NULL) + return (NULL); /* Header */ vol->Header.PageType = MPI_CONFIG_PAGETYPE_RAID_VOLUME; @@ -607,8 +617,8 @@ create_volume(int ac, char **av) CONFIG_PAGE_RAID_VOL_0 *vol; struct config_id_state state; struct volume_info *info; - int ch, error, fd, i, raid_type, verbose, quick; long stripe_size; + int ch, error, fd, i, quick, raid_type, verbose; #ifdef DEBUG int dump; #endif @@ -620,8 +630,9 @@ create_volume(int ac, char **av) fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } /* Lookup the RAID type first. */ @@ -677,8 +688,9 @@ create_volume(int ac, char **av) /* Fetch existing config data. */ state.ioc2 = mpt_read_ioc_page(fd, 2, NULL); if (state.ioc2 == NULL) { + error = errno; warn("Failed to read volume list"); - return (errno); + return (error); } state.list = mpt_pd_list(fd); if (state.list == NULL) @@ -696,6 +708,8 @@ create_volume(int ac, char **av) return (EINVAL); } info = calloc(1, sizeof(*info)); + if (info == NULL) + return (ENOMEM); error = parse_volume(fd, raid_type, &state, av[0], info); if (error) return (error); @@ -707,6 +721,8 @@ create_volume(int ac, char **av) /* Build the volume. */ vol = build_volume(fd, info, raid_type, stripe_size, &state, verbose); + if (vol == NULL) + return (errno); #ifdef DEBUG if (dump) { @@ -716,12 +732,13 @@ create_volume(int ac, char **av) #endif /* Send the new volume to the controller. */ - if (mpt_raid_action(fd, MPI_RAID_ACTION_CREATE_VOLUME, vol->VolumeBus, + error = mpt_raid_action(fd, MPI_RAID_ACTION_CREATE_VOLUME, vol->VolumeBus, vol->VolumeID, 0, quick ? MPI_RAID_ACTION_ADATA_DO_NOT_SYNC : 0, - vol, vol->Header.PageLength * 4, NULL, NULL, 0, NULL, NULL, 1) < - 0) { + vol, vol->Header.PageLength * 4, NULL, NULL, 0, NULL, NULL, 1); + if (error) { + errno = error; warn("Failed to add volume"); - return (errno); + return (error); } #ifdef DEBUG @@ -745,7 +762,7 @@ static int delete_volume(int ac, char **av) { U8 VolumeBus, VolumeID; - int fd; + int error, fd; if (ac != 2) { warnx("delete: volume required"); @@ -754,24 +771,27 @@ delete_volume(int ac, char **av) fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } - if (mpt_lookup_volume(fd, av[1], &VolumeBus, &VolumeID) < 0) { - warn("Invalid volume %s", av[1]); - return (errno); + error = mpt_lookup_volume(fd, av[1], &VolumeBus, &VolumeID); + if (error) { + warnc(error, "Invalid volume %s", av[1]); + return (error); } if (mpt_lock_volume(VolumeBus, VolumeID) < 0) return (errno); - if (mpt_raid_action(fd, MPI_RAID_ACTION_DELETE_VOLUME, VolumeBus, + error = mpt_raid_action(fd, MPI_RAID_ACTION_DELETE_VOLUME, VolumeBus, VolumeID, 0, MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS | MPI_RAID_ACTION_ADATA_ZERO_LBA0, NULL, 0, NULL, NULL, 0, NULL, - NULL, 0) < 0) { - warn("Failed to delete volume"); - return (errno); + NULL, 0); + if (error) { + warnc(error, "Failed to delete volume"); + return (error); } mpt_rescan_bus(-1, -1); @@ -788,16 +808,17 @@ find_volume_spare_pool(int fd, const cha CONFIG_PAGE_IOC_2 *ioc2; CONFIG_PAGE_IOC_2_RAID_VOL *vol; U8 VolumeBus, VolumeID; - int i, j, new_pool, pool_count[7]; + int error, i, j, new_pool, pool_count[7]; - if (mpt_lookup_volume(fd, name, &VolumeBus, &VolumeID) < 0) { - warn("Invalid volume %s", name); - return (-1); + error = mpt_lookup_volume(fd, name, &VolumeBus, &VolumeID); + if (error) { + warnc(error, "Invalid volume %s", name); + return (error); } info = mpt_vol_info(fd, VolumeBus, VolumeID, NULL); if (info == NULL) - return (-1); + return (errno); /* * Check for an existing pool other than pool 0 (used for @@ -817,15 +838,16 @@ find_volume_spare_pool(int fd, const cha */ ioc2 = mpt_read_ioc_page(fd, 2, NULL); if (ioc2 == NULL) { + error = errno; warn("Failed to fetch volume list"); - return (-1); + return (error); } bzero(pool_count, sizeof(pool_count)); vol = ioc2->RaidVolume; for (i = 0; i < ioc2->NumActiveVolumes; vol++, i++) { info = mpt_vol_info(fd, vol->VolumeBus, vol->VolumeID, NULL); if (info == NULL) - return (-1); + return (errno); for (j = 0; j < 7; j++) if (info->VolumeSettings.HotSparePool & (1 << (j + 1))) pool_count[j]++; @@ -843,14 +865,15 @@ find_volume_spare_pool(int fd, const cha /* Add this pool to the volume. */ info = mpt_vol_info(fd, VolumeBus, VolumeID, NULL); if (info == NULL) - return (-1); + return (error); info->VolumeSettings.HotSparePool |= (1 << new_pool); - if (mpt_raid_action(fd, MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS, + error = mpt_raid_action(fd, MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS, VolumeBus, VolumeID, 0, *(U32 *)&info->VolumeSettings, NULL, 0, - NULL, NULL, 0, NULL, NULL, 0) < 0) { + NULL, NULL, 0, NULL, NULL, 0); + if (error) { warnx("Failed to add spare pool %d to %s", new_pool, mpt_volume_name(VolumeBus, VolumeID)); - return (-1); + return (error); } free(info); @@ -878,13 +901,15 @@ add_spare(int ac, char **av) fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } if (ac == 3) { - if (find_volume_spare_pool(fd, av[2], &pool) < 0) - return (errno); + error = find_volume_spare_pool(fd, av[2], &pool); + if (error) + return (error); } else pool = MPI_RAID_HOT_SPARE_POOL_0; @@ -902,16 +927,18 @@ add_spare(int ac, char **av) if (mpt_lookup_standalone_disk(av[1], sdisks, nsdisks, &i) < 0) { + error = errno; warn("Unable to lookup drive %s", av[1]); - return (errno); + return (error); } if (mpt_lock_physdisk(&sdisks[i]) < 0) return (errno); if (mpt_create_physdisk(fd, &sdisks[i], &PhysDiskNum) < 0) { + error = errno; warn("Failed to create physical disk page"); - return (errno); + return (error); } free(sdisks); } @@ -919,8 +946,9 @@ add_spare(int ac, char **av) info = mpt_pd_info(fd, PhysDiskNum, NULL); if (info == NULL) { + error = errno; warn("Failed to fetch drive info"); - return (errno); + return (error); } info->PhysDiskSettings.HotSparePool = pool; @@ -928,8 +956,8 @@ add_spare(int ac, char **av) 0, PhysDiskNum, *(U32 *)&info->PhysDiskSettings, NULL, 0, NULL, NULL, 0, NULL, NULL, 0); if (error) { - warn("Failed to assign spare"); - return (errno); + warnc(error, "Failed to assign spare"); + return (error); } free(info); @@ -954,8 +982,9 @@ remove_spare(int ac, char **av) fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } list = mpt_pd_list(fd); @@ -972,8 +1001,9 @@ remove_spare(int ac, char **av) info = mpt_pd_info(fd, PhysDiskNum, NULL); if (info == NULL) { + error = errno; warn("Failed to fetch drive info"); - return (errno); + return (error); } if (info->PhysDiskSettings.HotSparePool == 0) { @@ -982,8 +1012,9 @@ remove_spare(int ac, char **av) } if (mpt_delete_physdisk(fd, PhysDiskNum) < 0) { + error = errno; warn("Failed to delete physical disk page"); - return (errno); + return (error); } mpt_rescan_bus(info->PhysDiskBus, info->PhysDiskID); @@ -1011,8 +1042,9 @@ pd_create(int ac, char **av) fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } error = mpt_fetch_disks(fd, &ndisks, &disks); @@ -1022,16 +1054,18 @@ pd_create(int ac, char **av) } if (mpt_lookup_standalone_disk(av[1], disks, ndisks, &i) < 0) { + error = errno; warn("Unable to lookup drive"); - return (errno); + return (error); } if (mpt_lock_physdisk(&disks[i]) < 0) return (errno); if (mpt_create_physdisk(fd, &disks[i], &PhysDiskNum) < 0) { + error = errno; warn("Failed to create physical disk page"); - return (errno); + return (error); } free(disks); @@ -1048,7 +1082,7 @@ pd_delete(int ac, char **av) { CONFIG_PAGE_RAID_PHYS_DISK_0 *info; struct mpt_drive_list *list; - int fd; + int error, fd; U8 PhysDiskNum; if (ac != 2) { @@ -1058,8 +1092,9 @@ pd_delete(int ac, char **av) fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } list = mpt_pd_list(fd); @@ -1067,20 +1102,23 @@ pd_delete(int ac, char **av) return (errno); if (mpt_lookup_drive(list, av[1], &PhysDiskNum) < 0) { + error = errno; warn("Failed to find drive %s", av[1]); - return (errno); + return (error); } mpt_free_pd_list(list); info = mpt_pd_info(fd, PhysDiskNum, NULL); if (info == NULL) { + error = errno; warn("Failed to fetch drive info"); - return (errno); + return (error); } if (mpt_delete_physdisk(fd, PhysDiskNum) < 0) { + error = errno; warn("Failed to delete physical disk page"); - return (errno); + return (error); } mpt_rescan_bus(info->PhysDiskBus, info->PhysDiskID); @@ -1126,7 +1164,7 @@ debug_config(int ac, char **av) { CONFIG_PAGE_RAID_VOL_0 *vol; U8 VolumeBus, VolumeID; - int fd; + int error, fd; if (ac != 2) { warnx("debug: volume required"); @@ -1135,19 +1173,22 @@ debug_config(int ac, char **av) fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } - if (mpt_lookup_volume(fd, av[1], &VolumeBus, &VolumeID) < 0) { - warn("Invalid volume: %s", av[1]); - return (errno); + error = mpt_lookup_volume(fd, av[1], &VolumeBus, &VolumeID); + if (error) { + warnc(error, "Invalid volume: %s", av[1]); + return (error); } vol = mpt_vol_info(fd, VolumeBus, VolumeID, NULL); if (vol == NULL) { + error = errno; warn("Failed to get volume info"); - return (errno); + return (error); } dump_config(vol); Modified: stable/7/usr.sbin/mptutil/mpt_drive.c ============================================================================== --- stable/7/usr.sbin/mptutil/mpt_drive.c Fri Nov 19 17:08:15 2010 (r215534) +++ stable/7/usr.sbin/mptutil/mpt_drive.c Fri Nov 19 17:08:29 2010 (r215535) @@ -129,7 +129,7 @@ mpt_pd_insert(int fd, struct mpt_drive_l list->drives[j + 1] = list->drives[j]; list->drives[i] = mpt_pd_info(fd, PhysDiskNum, NULL); if (list->drives[i] == NULL) - return (-1); + return (errno); list->ndrives++; return (0); } @@ -146,26 +146,32 @@ mpt_pd_list(int fd) CONFIG_PAGE_IOC_5 *ioc5; IOC_5_HOT_SPARE *spare; struct mpt_drive_list *list; - int count, i, j; + int count, error, i, j; ioc2 = mpt_read_ioc_page(fd, 2, NULL); if (ioc2 == NULL) { + error = errno; warn("Failed to fetch volume list"); + errno = error; return (NULL); } ioc3 = mpt_read_ioc_page(fd, 3, NULL); if (ioc3 == NULL) { + error = errno; warn("Failed to fetch drive list"); free(ioc2); + errno = error; return (NULL); } ioc5 = mpt_read_ioc_page(fd, 5, NULL); if (ioc5 == NULL) { + error = errno; warn("Failed to fetch spare list"); free(ioc3); free(ioc2); + errno = error; return (NULL); } @@ -180,7 +186,9 @@ mpt_pd_list(int fd) volumes[i] = mpt_vol_info(fd, vol->VolumeBus, vol->VolumeID, NULL); if (volumes[i] == NULL) { + error = errno; warn("Failed to read volume info"); + errno = error; return (NULL); } count += volumes[i]->NumPhysDisks; @@ -264,13 +272,11 @@ mpt_lookup_drive(struct mpt_drive_list * return (0); } } - errno = ENOENT; - return (-1); + return (ENOENT); } bad: - errno = EINVAL; - return (-1); + return (EINVAL); } /* Borrowed heavily from scsi_all.c:scsi_print_inquiry(). */ @@ -306,12 +312,13 @@ drive_set_state(char *drive, U8 Action, CONFIG_PAGE_RAID_PHYS_DISK_0 *info; struct mpt_drive_list *list; U8 PhysDiskNum; - int fd; + int error, fd; fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } list = mpt_pd_list(fd); @@ -319,16 +326,18 @@ drive_set_state(char *drive, U8 Action, return (errno); if (mpt_lookup_drive(list, drive, &PhysDiskNum) < 0) { + error = errno; warn("Failed to find drive %s", drive); - return (errno); + return (error); } mpt_free_pd_list(list); /* Get the info for this drive. */ info = mpt_pd_info(fd, PhysDiskNum, NULL); if (info == NULL) { + error = errno; warn("Failed to fetch info for drive %u", PhysDiskNum); - return (errno); + return (error); } /* Try to change the state. */ @@ -337,10 +346,11 @@ drive_set_state(char *drive, U8 Action, return (EINVAL); } - if (mpt_raid_action(fd, Action, 0, 0, PhysDiskNum, 0, NULL, 0, NULL, - NULL, 0, NULL, NULL, 0) < 0) { - warn("Failed to set drive %u to %s", PhysDiskNum, name); - return (errno); + error = mpt_raid_action(fd, Action, 0, 0, PhysDiskNum, 0, NULL, 0, NULL, + NULL, 0, NULL, NULL, 0); + if (error) { + warnc(error, "Failed to set drive %u to %s", PhysDiskNum, name); + return (error); } free(info); Modified: stable/7/usr.sbin/mptutil/mpt_evt.c ============================================================================== --- stable/7/usr.sbin/mptutil/mpt_evt.c Fri Nov 19 17:08:15 2010 (r215534) +++ stable/7/usr.sbin/mptutil/mpt_evt.c Fri Nov 19 17:08:29 2010 (r215535) @@ -94,18 +94,20 @@ show_events(int ac, char **av) { CONFIG_PAGE_LOG_0 *log; MPI_LOG_0_ENTRY **entries; - int ch, fd, i, num_events, verbose; + int ch, error, fd, i, num_events, verbose; fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } log = mpt_get_events(fd, NULL); if (log == NULL) { + error = errno; warn("Failed to get event log info"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 19 17:24:04 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08CB2106566B; Fri, 19 Nov 2010 17:24:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D16C48FC15; Fri, 19 Nov 2010 17:24:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAJHO3Dd082516; Fri, 19 Nov 2010 17:24:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAJHO3C4082513; Fri, 19 Nov 2010 17:24:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011191724.oAJHO3C4082513@svn.freebsd.org> From: Marius Strobl Date: Fri, 19 Nov 2010 17:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215537 - in stable/7/sys: kern sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2010 17:24:04 -0000 Author: marius Date: Fri Nov 19 17:24:03 2010 New Revision: 215537 URL: http://svn.freebsd.org/changeset/base/215537 Log: MFC: r176965 Any driver that relies on its parent to set the devclass has no way to know if has siblings that need an actual probe. Introduce a specail return value called BUS_PROBE_NOOWILDCARD. If the driver returns this, the probe is only successful for devices that have had a specific devclass set for them. Reviewed by: current@, jhb@, grehan@ Modified: stable/7/sys/kern/subr_bus.c stable/7/sys/sys/bus.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/subr_bus.c ============================================================================== --- stable/7/sys/kern/subr_bus.c Fri Nov 19 17:11:12 2010 (r215536) +++ stable/7/sys/kern/subr_bus.c Fri Nov 19 17:24:03 2010 (r215537) @@ -1788,6 +1788,14 @@ device_probe_child(device_t dev, device_ * of pri for the first match. */ if (best == NULL || result > pri) { + /* + * Probes that return BUS_PROBE_NOWILDCARD + * or lower only match when they are set + * in stone by the parent bus. + */ + if (result <= BUS_PROBE_NOWILDCARD && + child->flags & DF_WILDCARD) + continue; best = dl; pri = result; continue; Modified: stable/7/sys/sys/bus.h ============================================================================== --- stable/7/sys/sys/bus.h Fri Nov 19 17:11:12 2010 (r215536) +++ stable/7/sys/sys/bus.h Fri Nov 19 17:24:03 2010 (r215537) @@ -503,7 +503,10 @@ void bus_data_generation_update(void); * is for drivers that wish to have a generic form and a specialized form, * like is done with the pci bus and the acpi pci bus. BUS_PROBE_HOOVER is * for those busses that implement a generic device place-holder for devices on - * the bus that have no more specific driver for them (aka ugen). + * the bus that have no more specific river for them (aka ugen). + * BUS_PROBE_NOWILDCARD or lower means that the device isn't really bidding + * for a device node, but accepts only devices that its parent has told it + * use this driver. */ #define BUS_PROBE_SPECIFIC 0 /* Only I can use this device */ #define BUS_PROBE_VENDOR (-10) /* Vendor supplied driver */ @@ -511,6 +514,7 @@ void bus_data_generation_update(void); #define BUS_PROBE_LOW_PRIORITY (-40) /* Older, less desirable drivers */ #define BUS_PROBE_GENERIC (-100) /* generic driver for dev */ #define BUS_PROBE_HOOVER (-500) /* Generic dev for all devs on bus */ +#define BUS_PROBE_NOWILDCARD (-2000000000) /* No wildcard device matches */ /** * Shorthand for constructing method tables. From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 19 18:59:35 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F144B1065670; Fri, 19 Nov 2010 18:59:35 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E067A8FC13; Fri, 19 Nov 2010 18:59:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAJIxZPb086050; Fri, 19 Nov 2010 18:59:35 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAJIxZ18086048; Fri, 19 Nov 2010 18:59:35 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201011191859.oAJIxZ18086048@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 19 Nov 2010 18:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215543 - stable/7/sys/net80211 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2010 18:59:36 -0000 Author: bschmidt Date: Fri Nov 19 18:59:35 2010 New Revision: 215543 URL: http://svn.freebsd.org/changeset/base/215543 Log: MFC r203673: Ensure that tkip_mixing_phase1() is called after a rekeying event when using plain s/w crypto. Modified: stable/7/sys/net80211/ieee80211_crypto_tkip.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/net80211/ieee80211_crypto_tkip.c ============================================================================== --- stable/7/sys/net80211/ieee80211_crypto_tkip.c Fri Nov 19 18:32:08 2010 (r215542) +++ stable/7/sys/net80211/ieee80211_crypto_tkip.c Fri Nov 19 18:59:35 2010 (r215543) @@ -143,6 +143,7 @@ tkip_setkey(struct ieee80211_key *k) return 0; } k->wk_keytsc = 1; /* TSC starts at 1 */ + ctx->rx_phase1_done = 0; return 1; } From owner-svn-src-stable-7@FreeBSD.ORG Sat Nov 20 13:30:48 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 796A9106564A; Sat, 20 Nov 2010 13:30:48 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67B988FC16; Sat, 20 Nov 2010 13:30:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAKDUm5T013593; Sat, 20 Nov 2010 13:30:48 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAKDUmHX013591; Sat, 20 Nov 2010 13:30:48 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201011201330.oAKDUmHX013591@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 20 Nov 2010 13:30:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215566 - stable/7/sys/net80211 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Nov 2010 13:30:48 -0000 Author: bschmidt Date: Sat Nov 20 13:30:48 2010 New Revision: 215566 URL: http://svn.freebsd.org/changeset/base/215566 Log: MFC r201793: Fix #ifdefs so that GCC 4.4 doesn't complain about it. Committed by: trasz Modified: stable/7/sys/net80211/ieee80211_var.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/net80211/ieee80211_var.h ============================================================================== --- stable/7/sys/net80211/ieee80211_var.h Sat Nov 20 13:28:32 2010 (r215565) +++ stable/7/sys/net80211/ieee80211_var.h Sat Nov 20 13:30:48 2010 (r215566) @@ -35,11 +35,11 @@ #undef IEEE80211_DEBUG_REFCNT /* node refcnt stuff */ /* NB: portability glue must go first */ -#ifdef __NetBSD__ +#if defined(__NetBSD__) #include -#elif __FreeBSD__ +#elif defined(__FreeBSD__) #include -#elif __linux__ +#elif defined(__linux__) #include #else #error "No support for your operating system!" From owner-svn-src-stable-7@FreeBSD.ORG Sat Nov 20 16:56:39 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBB8E106566C; Sat, 20 Nov 2010 16:56:39 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B975C8FC16; Sat, 20 Nov 2010 16:56:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAKGud1m019441; Sat, 20 Nov 2010 16:56:39 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAKGudSQ019439; Sat, 20 Nov 2010 16:56:39 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011201656.oAKGudSQ019439@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 20 Nov 2010 16:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215573 - in stable/7: bin/test tools/regression/bin tools/regression/bin/test X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Nov 2010 16:56:39 -0000 Author: jilles Date: Sat Nov 20 16:56:39 2010 New Revision: 215573 URL: http://svn.freebsd.org/changeset/base/215573 Log: MFC r215022: test: Move tests to tools/regression/bin/test. Convert the tests to the perl prove format. Remove obsolete TEST.README (results of an old TEST.sh for some old Unices) and TEST.csh (old tests without correct values, far less complete than TEST.sh). Added: stable/7/tools/regression/bin/test/ - copied from r215022, head/tools/regression/bin/test/ Deleted: stable/7/bin/test/TEST.README stable/7/bin/test/TEST.csh stable/7/bin/test/TEST.sh Modified: stable/7/tools/regression/bin/Makefile Directory Properties: stable/7/bin/test/ (props changed) stable/7/tools/regression/bin/ (props changed) stable/7/tools/regression/bin/sh/ (props changed) Modified: stable/7/tools/regression/bin/Makefile ============================================================================== --- stable/7/tools/regression/bin/Makefile Sat Nov 20 16:46:16 2010 (r215572) +++ stable/7/tools/regression/bin/Makefile Sat Nov 20 16:56:39 2010 (r215573) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= date mv pax sh +SUBDIR= date mv pax sh test .include