From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 22 00:11: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 3AEEF106566B; Mon, 22 Mar 2010 00:11:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A1678FC26; Mon, 22 Mar 2010 00:11: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 o2M0BWiE056678; Mon, 22 Mar 2010 00:11:32 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2M0BWYE056676; Mon, 22 Mar 2010 00:11:32 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201003220011.o2M0BWYE056676@svn.freebsd.org> From: Michael Tuexen Date: Mon, 22 Mar 2010 00:11: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: r205430 - stable/7/sys/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: Mon, 22 Mar 2010 00:11:32 -0000 Author: tuexen Date: Mon Mar 22 00:11:31 2010 New Revision: 205430 URL: http://svn.freebsd.org/changeset/base/205430 Log: MFC 186815 Adds flag for SCTP checksum offloading. Requested by Pyun YongHyeon. Reviewed by: rrs Modified: stable/7/sys/sys/mbuf.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/sys/mbuf.h ============================================================================== --- stable/7/sys/sys/mbuf.h Sun Mar 21 22:39:11 2010 (r205429) +++ stable/7/sys/sys/mbuf.h Mon Mar 22 00:11:31 2010 (r205430) @@ -237,11 +237,13 @@ struct mbuf { #define CSUM_IP_FRAGS 0x0008 /* will csum IP fragments */ #define CSUM_FRAGMENT 0x0010 /* will do IP fragmentation */ #define CSUM_TSO 0x0020 /* will do TSO */ +#define CSUM_SCTP 0x0040 /* will csum SCTP */ #define CSUM_IP_CHECKED 0x0100 /* did csum IP */ #define CSUM_IP_VALID 0x0200 /* ... the csum is valid */ #define CSUM_DATA_VALID 0x0400 /* csum_data field is valid */ #define CSUM_PSEUDO_HDR 0x0800 /* csum_data has pseudo hdr */ +#define CSUM_SCTP_VALID 0x1000 /* SCTP checksum is valid */ #define CSUM_DELAY_DATA (CSUM_TCP | CSUM_UDP) #define CSUM_DELAY_IP (CSUM_IP) /* XXX add ipv6 here too? */ From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 22 13:20:25 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 E76961065677; Mon, 22 Mar 2010 13:20:25 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D70A98FC1E; Mon, 22 Mar 2010 13:20:25 +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 o2MDKPsW032301; Mon, 22 Mar 2010 13:20:25 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MDKPb3032299; Mon, 22 Mar 2010 13:20:25 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201003221320.o2MDKPb3032299@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 22 Mar 2010 13:20:25 +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: r205445 - stable/7/sys/dev/mxge 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, 22 Mar 2010 13:20:26 -0000 Author: gallatin Date: Mon Mar 22 13:20:25 2010 New Revision: 205445 URL: http://svn.freebsd.org/changeset/base/205445 Log: MFC 205255: Fix 2 bugs in mxge_attach() Modified: stable/7/sys/dev/mxge/if_mxge.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/mxge/if_mxge.c ============================================================================== --- stable/7/sys/dev/mxge/if_mxge.c Mon Mar 22 11:52:53 2010 (r205444) +++ stable/7/sys/dev/mxge/if_mxge.c Mon Mar 22 13:20:25 2010 (r205445) @@ -4330,8 +4330,6 @@ mxge_attach(device_t dev) err = ENOMEM; goto abort_with_nothing; } - taskqueue_start_threads(&sc->tq, 1, PI_NET, "%s taskq", - device_get_nameunit(sc->dev)); err = bus_dma_tag_create(NULL, /* parent */ 1, /* alignment */ @@ -4437,7 +4435,7 @@ mxge_attach(device_t dev) err = mxge_alloc_rings(sc); if (err != 0) { device_printf(sc->dev, "failed to allocate rings\n"); - goto abort_with_dmabench; + goto abort_with_slices; } err = mxge_add_irq(sc); @@ -4483,6 +4481,8 @@ mxge_attach(device_t dev) mxge_change_mtu(sc, mxge_initial_mtu); mxge_add_sysctls(sc); + taskqueue_start_threads(&sc->tq, 1, PI_NET, "%s taskq", + device_get_nameunit(sc->dev)); callout_reset(&sc->co_hdl, mxge_ticks, mxge_tick, sc); return 0; From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 22 15:54: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 E2C8C106566B; Mon, 22 Mar 2010 15:54:56 +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 CF18E8FC0C; Mon, 22 Mar 2010 15:54:56 +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 o2MFsuE0066951; Mon, 22 Mar 2010 15:54:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MFsu6v066942; Mon, 22 Mar 2010 15:54:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201003221554.o2MFsu6v066942@svn.freebsd.org> From: John Baldwin Date: Mon, 22 Mar 2010 15:54:56 +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: r205450 - stable/7/lib/libc/rpc 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, 22 Mar 2010 15:54:57 -0000 Author: jhb Date: Mon Mar 22 15:54:56 2010 New Revision: 205450 URL: http://svn.freebsd.org/changeset/base/205450 Log: MFC 204950,205020: Use thr_once() with once_t controls to initialize various thread_key_t objects used to provide per-thread storage in the RPC code. Almost all of these used double-checking with a dedicated mutex (tsd_lock) to do this before. However, that is not always safe with more relaxed memory orders. There were also other bugs, such as one in __rpc_createrr() that caused a new key to be allocated each time __rpc_createrr() was invoked. Modified: stable/7/lib/libc/rpc/Symbol.map stable/7/lib/libc/rpc/clnt_simple.c stable/7/lib/libc/rpc/getnetconfig.c stable/7/lib/libc/rpc/key_call.c stable/7/lib/libc/rpc/mt_misc.c stable/7/lib/libc/rpc/mt_misc.h stable/7/lib/libc/rpc/rpc_generic.c stable/7/lib/libc/rpc/rpc_soc.c Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/rpc/Symbol.map ============================================================================== --- stable/7/lib/libc/rpc/Symbol.map Mon Mar 22 15:52:26 2010 (r205449) +++ stable/7/lib/libc/rpc/Symbol.map Mon Mar 22 15:54:56 2010 (r205450) @@ -239,9 +239,5 @@ FBSDprivate_1.0 { __key_encryptsession_pk_LOCAL; __key_decryptsession_pk_LOCAL; __key_gendes_LOCAL; - __tsd_lock; /* - * Why does usr.bin/rpcinfo/Makefile need rpc_generic.c? - * Remove this hack if rpcinfo stops building with it. - */ __svc_clean_idle; }; Modified: stable/7/lib/libc/rpc/clnt_simple.c ============================================================================== --- stable/7/lib/libc/rpc/clnt_simple.c Mon Mar 22 15:52:26 2010 (r205449) +++ stable/7/lib/libc/rpc/clnt_simple.c Mon Mar 22 15:54:56 2010 (r205450) @@ -76,7 +76,11 @@ struct rpc_call_private { char nettype[NETIDLEN]; /* Network type */ }; static struct rpc_call_private *rpc_call_private_main; +static thread_key_t rpc_call_key; +static once_t rpc_call_once = ONCE_INITIALIZER; +static int rpc_call_key_error; +static void rpc_call_key_init(void); static void rpc_call_destroy(void *); static void @@ -91,6 +95,13 @@ rpc_call_destroy(void *vp) } } +static void +rpc_call_key_init(void) +{ + + rpc_call_key_error = thr_keycreate(&rpc_call_key, rpc_call_destroy); +} + /* * This is the simplified interface to the client rpc layer. * The client handle is not destroyed here and is reused for @@ -112,17 +123,16 @@ rpc_call(host, prognum, versnum, procnum struct rpc_call_private *rcp = (struct rpc_call_private *) 0; enum clnt_stat clnt_stat; struct timeval timeout, tottimeout; - static thread_key_t rpc_call_key; int main_thread = 1; if ((main_thread = thr_main())) { rcp = rpc_call_private_main; } else { - if (rpc_call_key == 0) { - mutex_lock(&tsd_lock); - if (rpc_call_key == 0) - thr_keycreate(&rpc_call_key, rpc_call_destroy); - mutex_unlock(&tsd_lock); + if (thr_once(&rpc_call_once, rpc_call_key_init) != 0 || + rpc_call_key_error != 0) { + rpc_createerr.cf_stat = RPC_SYSTEMERROR; + rpc_createerr.cf_error.re_errno = rpc_call_key_error; + return (rpc_createerr.cf_stat); } rcp = (struct rpc_call_private *)thr_getspecific(rpc_call_key); } Modified: stable/7/lib/libc/rpc/getnetconfig.c ============================================================================== --- stable/7/lib/libc/rpc/getnetconfig.c Mon Mar 22 15:52:26 2010 (r205449) +++ stable/7/lib/libc/rpc/getnetconfig.c Mon Mar 22 15:54:56 2010 (r205450) @@ -130,21 +130,29 @@ static struct netconfig *dup_ncp(struct static FILE *nc_file; /* for netconfig db */ -static pthread_mutex_t nc_file_lock = PTHREAD_MUTEX_INITIALIZER; +static mutex_t nc_file_lock = MUTEX_INITIALIZER; static struct netconfig_info ni = { 0, 0, NULL, NULL}; -static pthread_mutex_t ni_lock = PTHREAD_MUTEX_INITIALIZER; +static mutex_t ni_lock = MUTEX_INITIALIZER; +static thread_key_t nc_key; +static once_t nc_once = ONCE_INITIALIZER; +static int nc_key_error; + +static void +nc_key_init(void) +{ + + nc_key_error = thr_keycreate(&nc_key, free); +} #define MAXNETCONFIGLINE 1000 static int * __nc_error() { - static pthread_mutex_t nc_lock = PTHREAD_MUTEX_INITIALIZER; - static thread_key_t nc_key = 0; static int nc_error = 0; - int error, *nc_addr; + int *nc_addr; /* * Use the static `nc_error' if we are the main thread @@ -153,15 +161,8 @@ __nc_error() */ if (thr_main()) return (&nc_error); - if (nc_key == 0) { - error = 0; - mutex_lock(&nc_lock); - if (nc_key == 0) - error = thr_keycreate(&nc_key, free); - mutex_unlock(&nc_lock); - if (error) - return (&nc_error); - } + if (thr_once(&nc_once, nc_key_init) != 0 || nc_key_error != 0) + return (&nc_error); if ((nc_addr = (int *)thr_getspecific(nc_key)) == NULL) { nc_addr = (int *)malloc(sizeof (int)); if (thr_setspecific(nc_key, (void *) nc_addr) != 0) { Modified: stable/7/lib/libc/rpc/key_call.c ============================================================================== --- stable/7/lib/libc/rpc/key_call.c Mon Mar 22 15:52:26 2010 (r205449) +++ stable/7/lib/libc/rpc/key_call.c Mon Mar 22 15:54:56 2010 (r205450) @@ -279,6 +279,9 @@ struct key_call_private { uid_t uid; /* user-id at last authorization */ }; static struct key_call_private *key_call_private_main = NULL; +static thread_key_t key_call_key; +static once_t key_call_once = ONCE_INITIALIZER; +static int key_call_key_error; static void key_call_destroy(void *vp) @@ -292,6 +295,13 @@ key_call_destroy(void *vp) } } +static void +key_call_init(void) +{ + + key_call_key_error = thr_keycreate(&key_call_key, key_call_destroy); +} + /* * Keep the handle cached. This call may be made quite often. */ @@ -307,7 +317,6 @@ int vers; struct utsname u; int main_thread; int fd; - static thread_key_t key_call_key; #define TOTAL_TIMEOUT 30 /* total timeout talking to keyserver */ #define TOTAL_TRIES 5 /* Number of tries */ @@ -315,12 +324,9 @@ int vers; if ((main_thread = thr_main())) { kcp = key_call_private_main; } else { - if (key_call_key == 0) { - mutex_lock(&tsd_lock); - if (key_call_key == 0) - thr_keycreate(&key_call_key, key_call_destroy); - mutex_unlock(&tsd_lock); - } + if (thr_once(&key_call_once, key_call_init) != 0 || + key_call_key_error != 0) + return ((CLIENT *) NULL); kcp = (struct key_call_private *)thr_getspecific(key_call_key); } if (kcp == (struct key_call_private *)NULL) { Modified: stable/7/lib/libc/rpc/mt_misc.c ============================================================================== --- stable/7/lib/libc/rpc/mt_misc.c Mon Mar 22 15:52:26 2010 (r205449) +++ stable/7/lib/libc/rpc/mt_misc.c Mon Mar 22 15:54:56 2010 (r205450) @@ -28,7 +28,6 @@ __FBSDID("$FreeBSD$"); #define proglst_lock __proglst_lock #define rpcsoc_lock __rpcsoc_lock #define svcraw_lock __svcraw_lock -#define tsd_lock __tsd_lock #define xprtlist_lock __xprtlist_lock /* protects the services list (svc.c) */ @@ -76,33 +75,33 @@ pthread_mutex_t rpcsoc_lock = PTHREAD_MU /* svc_raw.c serialization */ pthread_mutex_t svcraw_lock = PTHREAD_MUTEX_INITIALIZER; -/* protects TSD key creation */ -pthread_mutex_t tsd_lock = PTHREAD_MUTEX_INITIALIZER; - /* xprtlist (svc_generic.c) */ pthread_mutex_t xprtlist_lock = PTHREAD_MUTEX_INITIALIZER; #undef rpc_createerr struct rpc_createerr rpc_createerr; +static thread_key_t rce_key; +static once_t rce_once = ONCE_INITIALIZER; +static int rce_key_error; + +static void +rce_key_init(void) +{ + + rce_key_error = thr_keycreate(&rce_key, free); +} struct rpc_createerr * __rpc_createerr() { - static thread_key_t rce_key = 0; struct rpc_createerr *rce_addr = 0; if (thr_main()) return (&rpc_createerr); - if ((rce_addr = - (struct rpc_createerr *)thr_getspecific(rce_key)) != 0) { - mutex_lock(&tsd_lock); - if (thr_keycreate(&rce_key, free) != 0) { - mutex_unlock(&tsd_lock); - return (&rpc_createerr); - } - mutex_unlock(&tsd_lock); - } + if (thr_once(&rce_once, rce_key_init) != 0 || rce_key_error != 0) + return (&rpc_createerr); + rce_addr = (struct rpc_createerr *)thr_getspecific(rce_key); if (!rce_addr) { rce_addr = (struct rpc_createerr *) malloc(sizeof (struct rpc_createerr)); Modified: stable/7/lib/libc/rpc/mt_misc.h ============================================================================== --- stable/7/lib/libc/rpc/mt_misc.h Mon Mar 22 15:52:26 2010 (r205449) +++ stable/7/lib/libc/rpc/mt_misc.h Mon Mar 22 15:54:56 2010 (r205450) @@ -42,7 +42,6 @@ #define proglst_lock __proglst_lock #define rpcsoc_lock __rpcsoc_lock #define svcraw_lock __svcraw_lock -#define tsd_lock __tsd_lock #define xprtlist_lock __xprtlist_lock extern pthread_rwlock_t svc_lock; Modified: stable/7/lib/libc/rpc/rpc_generic.c ============================================================================== --- stable/7/lib/libc/rpc/rpc_generic.c Mon Mar 22 15:52:26 2010 (r205449) +++ stable/7/lib/libc/rpc/rpc_generic.c Mon Mar 22 15:54:56 2010 (r205450) @@ -221,6 +221,18 @@ getnettype(nettype) return (_rpctypelist[i].type); } +static thread_key_t tcp_key, udp_key; +static once_t keys_once = ONCE_INITIALIZER; +static int tcp_key_error, udp_key_error; + +static void +keys_init(void) +{ + + tcp_key_error = thr_keycreate(&tcp_key, free); + udp_key_error = thr_keycreate(&udp_key, free); +} + /* * For the given nettype (tcp or udp only), return the first structure found. * This should be freed by calling freenetconfigent() @@ -236,25 +248,15 @@ __rpc_getconfip(nettype) static char *netid_udp_main; struct netconfig *dummy; int main_thread; - static thread_key_t tcp_key, udp_key; if ((main_thread = thr_main())) { netid_udp = netid_udp_main; netid_tcp = netid_tcp_main; } else { - if (tcp_key == 0) { - mutex_lock(&tsd_lock); - if (tcp_key == 0) - thr_keycreate(&tcp_key, free); - mutex_unlock(&tsd_lock); - } + if (thr_once(&keys_once, keys_init) != 0 || + tcp_key_error != 0 || udp_key_error != 0) + return (NULL); netid_tcp = (char *)thr_getspecific(tcp_key); - if (udp_key == 0) { - mutex_lock(&tsd_lock); - if (udp_key == 0) - thr_keycreate(&udp_key, free); - mutex_unlock(&tsd_lock); - } netid_udp = (char *)thr_getspecific(udp_key); } if (!netid_udp && !netid_tcp) { Modified: stable/7/lib/libc/rpc/rpc_soc.c ============================================================================== --- stable/7/lib/libc/rpc/rpc_soc.c Mon Mar 22 15:52:26 2010 (r205449) +++ stable/7/lib/libc/rpc/rpc_soc.c Mon Mar 22 15:54:56 2010 (r205450) @@ -360,6 +360,14 @@ registerrpc(prognum, versnum, procnum, p */ static thread_key_t clnt_broadcast_key; static resultproc_t clnt_broadcast_result_main; +static once_t clnt_broadcast_once = ONCE_INITIALIZER; + +static void +clnt_broadcast_key_init(void) +{ + + thr_keycreate(&clnt_broadcast_key, free); +} /* * Need to translate the netbuf address into sockaddr_in address. @@ -402,12 +410,7 @@ clnt_broadcast(prog, vers, proc, xargs, if (thr_main()) clnt_broadcast_result_main = eachresult; else { - if (clnt_broadcast_key == 0) { - mutex_lock(&tsd_lock); - if (clnt_broadcast_key == 0) - thr_keycreate(&clnt_broadcast_key, free); - mutex_unlock(&tsd_lock); - } + thr_once(&clnt_broadcast_once, clnt_broadcast_key_init); thr_setspecific(clnt_broadcast_key, (void *) eachresult); } return rpc_broadcast((rpcprog_t)prog, (rpcvers_t)vers, From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 22 19:04: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 CBCEC106564A; Mon, 22 Mar 2010 19:04: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 A03718FC13; Mon, 22 Mar 2010 19:04: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 o2MJ42cq012149; Mon, 22 Mar 2010 19:04:02 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MJ42h0012146; Mon, 22 Mar 2010 19:04:02 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201003221904.o2MJ42h0012146@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 22 Mar 2010 19:04:02 +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: r205458 - stable/7/sys/net 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, 22 Mar 2010 19:04:02 -0000 Author: yongari Date: Mon Mar 22 19:04:02 2010 New Revision: 205458 URL: http://svn.freebsd.org/changeset/base/205458 Log: MFC r204149: Add TSO support on VLANs. Intentionally separated IFCAP_VLAN_HWTSO from IFCAP_VLAN_HWTAGGING. I think some hardwares may be able to TSO over VLAN without VLAN hardware tagging. Driver changes and userland support will follow. Modified: stable/7/sys/net/if.h stable/7/sys/net/if_vlan.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/net/if.h ============================================================================== --- stable/7/sys/net/if.h Mon Mar 22 18:51:56 2010 (r205457) +++ stable/7/sys/net/if.h Mon Mar 22 19:04:02 2010 (r205458) @@ -217,6 +217,7 @@ struct if_data { #define IFCAP_TOE4 0x04000 /* interface can offload TCP */ #define IFCAP_TOE6 0x08000 /* interface can offload TCP6 */ #define IFCAP_VLAN_HWFILTER 0x10000 /* interface hw can filter vlan tag */ +#define IFCAP_VLAN_HWTSO 0x40000 /* can do IFCAP_TSO on VLANs */ #define IFCAP_HWCSUM (IFCAP_RXCSUM | IFCAP_TXCSUM) #define IFCAP_TSO (IFCAP_TSO4 | IFCAP_TSO6) Modified: stable/7/sys/net/if_vlan.c ============================================================================== --- stable/7/sys/net/if_vlan.c Mon Mar 22 18:51:56 2010 (r205457) +++ stable/7/sys/net/if_vlan.c Mon Mar 22 19:04:02 2010 (r205458) @@ -1271,11 +1271,26 @@ vlan_capabilities(struct ifvlan *ifv) if (p->if_capenable & IFCAP_VLAN_HWCSUM && p->if_capenable & IFCAP_VLAN_HWTAGGING) { ifp->if_capenable = p->if_capenable & IFCAP_HWCSUM; - ifp->if_hwassist = p->if_hwassist; + ifp->if_hwassist = p->if_hwassist & (CSUM_IP | CSUM_TCP | + CSUM_UDP | CSUM_SCTP | CSUM_IP_FRAGS | CSUM_FRAGMENT); } else { ifp->if_capenable = 0; ifp->if_hwassist = 0; } + /* + * If the parent interface can do TSO on VLANs then + * propagate the hardware-assisted flag. TSO on VLANs + * does not necessarily require hardware VLAN tagging. + */ + if (p->if_capabilities & IFCAP_VLAN_HWTSO) + ifp->if_capabilities |= p->if_capabilities & IFCAP_TSO; + if (p->if_capenable & IFCAP_VLAN_HWTSO) { + ifp->if_capenable |= p->if_capenable & IFCAP_TSO; + ifp->if_hwassist |= p->if_hwassist & CSUM_TSO; + } else { + ifp->if_capenable &= ~(p->if_capenable & IFCAP_TSO); + ifp->if_hwassist &= ~(p->if_hwassist & CSUM_TSO); + } } static void From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 22 19:36: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 5ED75106566B; Mon, 22 Mar 2010 19:36:48 +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 333A78FC19; Mon, 22 Mar 2010 19:36: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 o2MJam3j019393; Mon, 22 Mar 2010 19:36:48 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MJamFh019389; Mon, 22 Mar 2010 19:36:48 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201003221936.o2MJamFh019389@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 22 Mar 2010 19:36: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: r205459 - stable/7/sbin/ifconfig 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, 22 Mar 2010 19:36:48 -0000 Author: yongari Date: Mon Mar 22 19:36:47 2010 New Revision: 205459 URL: http://svn.freebsd.org/changeset/base/205459 Log: MFC r182414: Add support in ifconfig to control the vlan hardware filter feature. Modified: stable/7/sbin/ifconfig/ifconfig.8 stable/7/sbin/ifconfig/ifconfig.c stable/7/sbin/ifconfig/ifvlan.c Directory Properties: stable/7/sbin/ifconfig/ (props changed) Modified: stable/7/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/7/sbin/ifconfig/ifconfig.8 Mon Mar 22 19:04:02 2010 (r205458) +++ stable/7/sbin/ifconfig/ifconfig.8 Mon Mar 22 19:36:47 2010 (r205459) @@ -402,18 +402,20 @@ they support in their capabilities. is a synonym for enabling all available WOL mechanisms. To disable WOL use .Fl wol . -.It Cm vlanmtu , vlanhwtag +.It Cm vlanmtu , vlanhwtag, vlanhwfilter If the driver offers user-configurable VLAN support, enable -reception of extended frames or tag processing in hardware, +reception of extended frames, tag processing in hardware, or +frame filtering in hardware, respectively. Note that this must be issued on a physical interface associated with .Xr vlan 4 , not on a .Xr vlan 4 interface itself. -.It Fl vlanmtu , vlanhwtag +.It Fl vlanmtu , vlanhwtag, vlanhwfilter If the driver offers user-configurable VLAN support, disable -reception of extended frames or tag processing in hardware, +reception of extended frames, tag processing in hardware, or +frame filtering in hardware, respectively. .It Cm polling Turn on Modified: stable/7/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/7/sbin/ifconfig/ifconfig.c Mon Mar 22 19:04:02 2010 (r205458) +++ stable/7/sbin/ifconfig/ifconfig.c Mon Mar 22 19:36:47 2010 (r205459) @@ -777,7 +777,8 @@ setifname(const char *val, int dummy __u #define IFCAPBITS \ "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ -"\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" +"\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ +"\21VLAN_HWFILTER" /* * Print the status of the interface. If an address family was Modified: stable/7/sbin/ifconfig/ifvlan.c ============================================================================== --- stable/7/sbin/ifconfig/ifvlan.c Mon Mar 22 19:04:02 2010 (r205458) +++ stable/7/sbin/ifconfig/ifvlan.c Mon Mar 22 19:36:47 2010 (r205459) @@ -180,6 +180,8 @@ static struct cmd vlan_cmds[] = { DEF_CMD("-vlanmtu", -IFCAP_VLAN_MTU, setifcap), DEF_CMD("vlanhwtag", IFCAP_VLAN_HWTAGGING, setifcap), DEF_CMD("-vlanhwtag", -IFCAP_VLAN_HWTAGGING, setifcap), + DEF_CMD("vlanhwfilter", IFCAP_VLAN_HWFILTER, setifcap), + DEF_CMD("-vlanhwfilter", -IFCAP_VLAN_HWFILTER, setifcap), }; static struct afswtch af_vlan = { .af_name = "af_vlan", From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 22 19:50:34 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 22394106566C; Mon, 22 Mar 2010 19:50:34 +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 066ED8FC15; Mon, 22 Mar 2010 19:50:34 +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 o2MJoXuJ022560; Mon, 22 Mar 2010 19:50:33 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MJoXOU022556; Mon, 22 Mar 2010 19:50:33 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201003221950.o2MJoXOU022556@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 22 Mar 2010 19:50: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: r205460 - stable/7/sbin/ifconfig 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, 22 Mar 2010 19:50:34 -0000 Author: yongari Date: Mon Mar 22 19:50:33 2010 New Revision: 205460 URL: http://svn.freebsd.org/changeset/base/205460 Log: MFC r204150: Add TSO support on VLAN in fconfig(8). Modified: stable/7/sbin/ifconfig/ifconfig.8 stable/7/sbin/ifconfig/ifconfig.c stable/7/sbin/ifconfig/ifvlan.c Directory Properties: stable/7/sbin/ifconfig/ (props changed) Modified: stable/7/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/7/sbin/ifconfig/ifconfig.8 Mon Mar 22 19:36:47 2010 (r205459) +++ stable/7/sbin/ifconfig/ifconfig.8 Mon Mar 22 19:50:33 2010 (r205460) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd October 19, 2008 +.Dd February 20, 2010 .Dt IFCONFIG 8 .Os .Sh NAME @@ -402,20 +402,20 @@ they support in their capabilities. is a synonym for enabling all available WOL mechanisms. To disable WOL use .Fl wol . -.It Cm vlanmtu , vlanhwtag, vlanhwfilter +.It Cm vlanmtu , vlanhwtag, vlanhwfilter, vlanhwtso If the driver offers user-configurable VLAN support, enable -reception of extended frames, tag processing in hardware, or -frame filtering in hardware, +reception of extended frames, tag processing in hardware, +frame filtering in hardware, or TSO on VLAN, respectively. Note that this must be issued on a physical interface associated with .Xr vlan 4 , not on a .Xr vlan 4 interface itself. -.It Fl vlanmtu , vlanhwtag, vlanhwfilter +.It Fl vlanmtu , vlanhwtag, vlanhwfilter, vlanhwtso If the driver offers user-configurable VLAN support, disable -reception of extended frames, tag processing in hardware, or -frame filtering in hardware, +reception of extended frames, tag processing in hardware, +frame filtering in hardware, or TSO on VLAN, respectively. .It Cm polling Turn on Modified: stable/7/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/7/sbin/ifconfig/ifconfig.c Mon Mar 22 19:36:47 2010 (r205459) +++ stable/7/sbin/ifconfig/ifconfig.c Mon Mar 22 19:50:33 2010 (r205460) @@ -778,7 +778,7 @@ setifname(const char *val, int dummy __u #define IFCAPBITS \ "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ -"\21VLAN_HWFILTER" +"\21VLAN_HWFILTER\23VLAN_HWTSO" /* * Print the status of the interface. If an address family was Modified: stable/7/sbin/ifconfig/ifvlan.c ============================================================================== --- stable/7/sbin/ifconfig/ifvlan.c Mon Mar 22 19:36:47 2010 (r205459) +++ stable/7/sbin/ifconfig/ifvlan.c Mon Mar 22 19:50:33 2010 (r205460) @@ -182,6 +182,8 @@ static struct cmd vlan_cmds[] = { DEF_CMD("-vlanhwtag", -IFCAP_VLAN_HWTAGGING, setifcap), DEF_CMD("vlanhwfilter", IFCAP_VLAN_HWFILTER, setifcap), DEF_CMD("-vlanhwfilter", -IFCAP_VLAN_HWFILTER, setifcap), + DEF_CMD("-vlanhwtso", -IFCAP_VLAN_HWTSO, setifcap), + DEF_CMD("vlanhwtso", IFCAP_VLAN_HWTSO, setifcap), }; static struct afswtch af_vlan = { .af_name = "af_vlan", From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 22 19:52: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 B19691065673; Mon, 22 Mar 2010 19:52:06 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A145E8FC14; Mon, 22 Mar 2010 19:52: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 o2MJq6Hw022982; Mon, 22 Mar 2010 19:52:06 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MJq6mS022980; Mon, 22 Mar 2010 19:52:06 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201003221952.o2MJq6mS022980@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 22 Mar 2010 19:52: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: r205462 - stable/7/etc/ppp 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, 22 Mar 2010 19:52:06 -0000 Author: jkim Date: Mon Mar 22 19:52:06 2010 New Revision: 205462 URL: http://svn.freebsd.org/changeset/base/205462 Log: MFC: r203943 Remove COMPILATIONDATE from the default section. This string is no longer being substituted since r162063. Modified: stable/7/etc/ppp/ppp.conf Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/ppp/ppp.conf ============================================================================== --- stable/7/etc/ppp/ppp.conf Mon Mar 22 19:50:57 2010 (r205461) +++ stable/7/etc/ppp/ppp.conf Mon Mar 22 19:52:06 2010 (r205462) @@ -10,7 +10,7 @@ default: set log Phase Chat LCP IPCP CCP tun command - ident user-ppp VERSION (built COMPILATIONDATE) + ident user-ppp VERSION # Ensure that "device" references the correct serial port # for your modem. (cuad0 = COM1, cuad1 = COM2) From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 22 20:12:10 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 CF9281065674; Mon, 22 Mar 2010 20:12:10 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BECF28FC29; Mon, 22 Mar 2010 20:12: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 o2MKCAHT027544; Mon, 22 Mar 2010 20:12:10 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MKCA5H027542; Mon, 22 Mar 2010 20:12:10 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201003222012.o2MKCA5H027542@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 22 Mar 2010 20:12: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: r205464 - stable/7/sys/net 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, 22 Mar 2010 20:12:10 -0000 Author: jkim Date: Mon Mar 22 20:12:10 2010 New Revision: 205464 URL: http://svn.freebsd.org/changeset/base/205464 Log: MFC: r205092 Tidy up callout for select(2) and read timeout. - Add a missing callout_drain(9) before the descriptor deallocation.[1] - Prefer callout_init_mtx(9) over callout_init(9) and let the callout subsystem handle the mutex for callout function. PR: kern/144453 Submitted by: Alexander Sack (asack at niksun dot com)[1] Modified: stable/7/sys/net/bpf.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/net/bpf.c ============================================================================== --- stable/7/sys/net/bpf.c Mon Mar 22 19:59:00 2010 (r205463) +++ stable/7/sys/net/bpf.c Mon Mar 22 20:12:10 2010 (r205464) @@ -424,7 +424,7 @@ bpfopen(struct cdev *dev, int flags, int mac_create_bpfdesc(td->td_ucred, d); #endif mtx_init(&d->bd_mtx, devtoname(dev), "bpf cdev lock", MTX_DEF); - callout_init(&d->bd_callout, CALLOUT_MPSAFE); + callout_init_mtx(&d->bd_callout, &d->bd_mtx, 0); knlist_init_mtx(&d->bd_sel.si_note, &d->bd_mtx); return (0); @@ -455,6 +455,7 @@ bpfclose(struct cdev *dev, int flags, in mac_destroy_bpfdesc(d); #endif /* MAC */ knlist_destroy(&d->bd_sel.si_note); + callout_drain(&d->bd_callout); bpf_freed(d); dev->si_drv1 = NULL; free(d, M_BPF); @@ -615,13 +616,15 @@ bpf_timed_out(void *arg) { struct bpf_d *d = (struct bpf_d *)arg; - BPFD_LOCK(d); + BPFD_LOCK_ASSERT(d); + + if (callout_pending(&d->bd_callout) || !callout_active(&d->bd_callout)) + return; if (d->bd_state == BPF_WAITING) { d->bd_state = BPF_TIMED_OUT; if (d->bd_slen != 0) bpf_wakeup(d); } - BPFD_UNLOCK(d); } static int From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 22 20:41: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 488FE106567D; Mon, 22 Mar 2010 20:41:45 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D6A38FC1D; Mon, 22 Mar 2010 20:41: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 o2MKfjVY034455; Mon, 22 Mar 2010 20:41:45 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MKfjZ9034453; Mon, 22 Mar 2010 20:41:45 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201003222041.o2MKfjZ9034453@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 22 Mar 2010 20:41:44 +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: r205469 - stable/7/sys/fs/fdescfs 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, 22 Mar 2010 20:41:45 -0000 Author: jkim Date: Mon Mar 22 20:41:44 2010 New Revision: 205469 URL: http://svn.freebsd.org/changeset/base/205469 Log: MFC: r205223 Fix a long standing regression of readdir(3) in fdescfs(5) introduced in r1.48. We were stopping at the first null pointer when multiple file descriptors were opened and one in the middle was closed. This restores traditional behaviour of fdescfs. Modified: stable/7/sys/fs/fdescfs/fdesc_vnops.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/fs/fdescfs/fdesc_vnops.c ============================================================================== --- stable/7/sys/fs/fdescfs/fdesc_vnops.c Mon Mar 22 20:36:35 2010 (r205468) +++ stable/7/sys/fs/fdescfs/fdesc_vnops.c Mon Mar 22 20:41:44 2010 (r205469) @@ -568,11 +568,10 @@ fdesc_readdir(ap) FILEDESC_SLOCK(fdp); while (i < fdp->fd_nfiles + 2 && uio->uio_resid >= UIO_MX) { + bzero((caddr_t)dp, UIO_MX); switch (i) { case 0: /* `.' */ case 1: /* `..' */ - bzero((caddr_t)dp, UIO_MX); - dp->d_fileno = i + FD_ROOT; dp->d_namlen = i + 1; dp->d_reclen = UIO_MX; @@ -581,26 +580,24 @@ fdesc_readdir(ap) dp->d_type = DT_DIR; break; default: - if (fdp->fd_ofiles[fcnt] == NULL) { - FILEDESC_SUNLOCK(fdp); - goto done; - } - - bzero((caddr_t) dp, UIO_MX); + if (fdp->fd_ofiles[fcnt] == NULL) + break; dp->d_namlen = sprintf(dp->d_name, "%d", fcnt); dp->d_reclen = UIO_MX; dp->d_type = DT_UNKNOWN; dp->d_fileno = i + FD_DESC; break; } - /* - * And ship to userland - */ - FILEDESC_SUNLOCK(fdp); - error = uiomove(dp, UIO_MX, uio); - if (error) - goto done; - FILEDESC_SLOCK(fdp); + if (dp->d_namlen != 0) { + /* + * And ship to userland + */ + FILEDESC_SUNLOCK(fdp); + error = uiomove(dp, UIO_MX, uio); + if (error) + goto done; + FILEDESC_SLOCK(fdp); + } i++; fcnt++; } From owner-svn-src-stable-7@FreeBSD.ORG Mon Mar 22 21:35: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 B6F2B106566B; Mon, 22 Mar 2010 21:35:56 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A58AC8FC1B; Mon, 22 Mar 2010 21:35:56 +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 o2MLZusl046907; Mon, 22 Mar 2010 21:35:56 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MLZuYw046902; Mon, 22 Mar 2010 21:35:56 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201003222135.o2MLZuYw046902@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 22 Mar 2010 21:35:56 +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: r205477 - stable/7/share/zoneinfo 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, 22 Mar 2010 21:35:56 -0000 Author: edwin Date: Mon Mar 22 21:35:56 2010 New Revision: 205477 URL: http://svn.freebsd.org/changeset/base/205477 Log: MFC of r205475, tzdata2010f: The Australian Antartic Division: - Macquarie Island will stay on UTC+11 for winter and not switch back from DST. - Casey station reverted to its normal time of UTC+8 on 5 March 2010. - Davis station will revert to its normal time of UTC+7 at 10 March 2010 - Mawson station stays on UTC+5. Syria will start DST on Thursday 1 April 2010 at midnight. Correct Samao DST start date (26 Sep vs 24 Oct) Modified: stable/7/share/zoneinfo/antarctica stable/7/share/zoneinfo/asia stable/7/share/zoneinfo/australasia stable/7/share/zoneinfo/zone.tab Directory Properties: stable/7/share/zoneinfo/ (props changed) Modified: stable/7/share/zoneinfo/antarctica ============================================================================== --- stable/7/share/zoneinfo/antarctica Mon Mar 22 21:35:54 2010 (r205476) +++ stable/7/share/zoneinfo/antarctica Mon Mar 22 21:35:56 2010 (r205477) @@ -1,5 +1,5 @@ #
-# @(#)antarctica	8.7
+# @(#)antarctica	8.8
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -57,6 +57,33 @@ Rule	ChileAQ	1999	only	-	Apr	 4	3:00u	0	
 Rule	ChileAQ	1999	max	-	Oct	Sun>=9	4:00u	1:00	S
 Rule	ChileAQ	2000	max	-	Mar	Sun>=9	3:00u	0	-
 
+# These rules are stolen from the `australasia' file.
+Rule	AusAQ	1917	only	-	Jan	 1	0:01	1:00	-
+Rule	AusAQ	1917	only	-	Mar	25	2:00	0	-
+Rule	AusAQ	1942	only	-	Jan	 1	2:00	1:00	-
+Rule	AusAQ	1942	only	-	Mar	29	2:00	0	-
+Rule	AusAQ	1942	only	-	Sep	27	2:00	1:00	-
+Rule	AusAQ	1943	1944	-	Mar	lastSun	2:00	0	-
+Rule	AusAQ	1943	only	-	Oct	 3	2:00	1:00	-
+Rule	ATAQ	1967	only	-	Oct	Sun>=1	2:00s	1:00	-
+Rule	ATAQ	1968	only	-	Mar	lastSun	2:00s	0	-
+Rule	ATAQ	1968	1985	-	Oct	lastSun	2:00s	1:00	-
+Rule	ATAQ	1969	1971	-	Mar	Sun>=8	2:00s	0	-
+Rule	ATAQ	1972	only	-	Feb	lastSun	2:00s	0	-
+Rule	ATAQ	1973	1981	-	Mar	Sun>=1	2:00s	0	-
+Rule	ATAQ	1982	1983	-	Mar	lastSun	2:00s	0	-
+Rule	ATAQ	1984	1986	-	Mar	Sun>=1	2:00s	0	-
+Rule	ATAQ	1986	only	-	Oct	Sun>=15	2:00s	1:00	-
+Rule	ATAQ	1987	1990	-	Mar	Sun>=15	2:00s	0	-
+Rule	ATAQ	1987	only	-	Oct	Sun>=22	2:00s	1:00	-
+Rule	ATAQ	1988	1990	-	Oct	lastSun	2:00s	1:00	-
+Rule	ATAQ	1991	1999	-	Oct	Sun>=1	2:00s	1:00	-
+Rule	ATAQ	1991	2005	-	Mar	lastSun	2:00s	0	-
+Rule	ATAQ	2000	only	-	Aug	lastSun	2:00s	1:00	-
+Rule	ATAQ	2001	max	-	Oct	Sun>=1	2:00s	1:00	-
+Rule	ATAQ	2006	only	-	Apr	Sun>=1	2:00s	0	-
+Rule	ATAQ	2007	only	-	Mar	lastSun	2:00s	0	-
+Rule	ATAQ	2008	max	-	Apr	Sun>=1	2:00s	0	-
 
 # Argentina - year-round bases
 # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
@@ -98,20 +125,52 @@ Rule	ChileAQ	2000	max	-	Mar	Sun>=9	3:00u
 # http://www.timeanddate.com/news/time/antarctica-new-times.html
 # 
 
+# From Steffen Thorsen (2010-03-10):
+# We got these changes from the Australian Antarctic Division:
+# - Macquarie Island will stay on UTC+11 for winter and therefore not
+# switch back from daylight savings time when other parts of Australia do
+# on 4 April.
+#
+# - Casey station reverted to its normal time of UTC+8 on 5 March 2010.
+# The change to UTC+11 is being considered as a regular summer thing but
+# has not been decided yet.
+#
+# - Davis station will revert to its normal time of UTC+7 at 10 March 2010
+# 20:00 UTC.
+#
+# - Mawson station stays on UTC+5.
+#
+# In addition to the Rule changes for Casey/Davis, it means that Macquarie
+# will no longer be like Hobart and will have to have its own Zone created.
+#
+# Background:
+# 
+# http://www.timeanddate.com/news/time/antartica-time-changes-2010.html
+# 
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Antarctica/Casey	0	-	zzz	1969
 			8:00	-	WST	2009 Oct 18 2:00
 						# Western (Aus) Standard Time
-			11:00	-	CAST	# Casey Time
+			11:00	-	CAST	2010 Mar 5 2:00
+						# Casey Time
+			8:00	-	WST
 Zone Antarctica/Davis	0	-	zzz	1957 Jan 13
 			7:00	-	DAVT	1964 Nov # Davis Time
 			0	-	zzz	1969 Feb
 			7:00	-	DAVT	2009 Oct 18 2:00
-			5:00	-	DAVT
+			5:00	-	DAVT	2010 Mar 10 20:00u
+			7:00	-	DAVT
 Zone Antarctica/Mawson	0	-	zzz	1954 Feb 13
 			6:00	-	MAWT	2009 Oct 18 2:00
 						# Mawson Time
 			5:00	-	MAWT
+Zone Antarctica/Macquarie 0	-	zzz	1911
+			10:00	-	EST	1916 Oct 1 2:00
+			10:00	1:00	EST	1917 Feb
+			10:00	AusAQ	EST	1967
+			10:00	ATAQ	EST	2010 Apr 4 3:00
+			11:00	-	MIST	# Macquarie Island Time
 # References:
 # 
 # Casey Weather (1998-02-26)

Modified: stable/7/share/zoneinfo/asia
==============================================================================
--- stable/7/share/zoneinfo/asia	Mon Mar 22 21:35:54 2010	(r205476)
+++ stable/7/share/zoneinfo/asia	Mon Mar 22 21:35:56 2010	(r205477)
@@ -1,4 +1,4 @@
-# @(#)asia	8.55
+# @(#)asia	8.56
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2438,9 +2438,18 @@ Rule	Syria	2007	only	-	Nov	 Fri>=1	0:00	
 # Thursday of the month or the start of the last Friday of the month or
 # something else. For now, use the start of the last Friday.
 
+# From Steffen Thorsen (2010-03-17):
+# The "Syrian News Station" reported on 2010-03-16 that the Council of
+# Ministers has decided that Syria will start DST on midnight Thursday
+# 2010-04-01: (midnight between Thursday and Friday):
+# 
+# http://sns.sy/sns/?path=news/read/11421 (Arabic)
+# 
+
 Rule	Syria	2008	only	-	Apr	Fri>=1	0:00	1:00	S
 Rule	Syria	2008	only	-	Nov	1	0:00	0	-
-Rule	Syria	2009	max	-	Mar	lastFri	0:00	1:00	S
+Rule	Syria	2009	only	-	Mar	lastFri	0:00	1:00	S
+Rule	Syria	2010	max	-	Apr	Fri>=1	0:00	1:00	S
 Rule	Syria	2009	max	-	Oct	lastFri	0:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]

Modified: stable/7/share/zoneinfo/australasia
==============================================================================
--- stable/7/share/zoneinfo/australasia	Mon Mar 22 21:35:54 2010	(r205476)
+++ stable/7/share/zoneinfo/australasia	Mon Mar 22 21:35:56 2010	(r205477)
@@ -1,5 +1,5 @@
 # 
-# @(#)australasia	8.16
+# @(#)australasia	8.17
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -490,7 +490,7 @@ Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1
 Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
 			-11:26:56 -	LMT	1911
 			-11:30	-	SAMT	1950		# Samoa Time
-			-11:00	-	WST	2010 Oct 24
+			-11:00	-	WST	2010 Sep 26
 			-11:00	1:00	WSDT	2011 Apr 3
 			-11:00	-	WST
 

Modified: stable/7/share/zoneinfo/zone.tab
==============================================================================
--- stable/7/share/zoneinfo/zone.tab	Mon Mar 22 21:35:54 2010	(r205476)
+++ stable/7/share/zoneinfo/zone.tab	Mon Mar 22 21:35:56 2010	(r205477)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.33
+# @(#)zone.tab	8.34
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -44,6 +44,7 @@ AQ	-6617+11031	Antarctica/Casey	Casey St
 AQ	-7824+10654	Antarctica/Vostok	Vostok Station, S Magnetic Pole
 AQ	-6640+14001	Antarctica/DumontDUrville	Dumont-d'Urville Station, Terre Adelie
 AQ	-690022+0393524	Antarctica/Syowa	Syowa Station, E Ongul I
+AQ	-5430+15857	Antarctica/Macquarie	Macquarie Island Station, Macquarie Island
 AR	-3436-05827	America/Argentina/Buenos_Aires	Buenos Aires (BA, CF)
 AR	-3124-06411	America/Argentina/Cordoba	most locations (CB, CC, CN, ER, FM, MN, SE, SF)
 AR	-2447-06525	America/Argentina/Salta	(SA, LP, NQ, RN)

From owner-svn-src-stable-7@FreeBSD.ORG  Mon Mar 22 23:15: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 32F0D106566B;
	Mon, 22 Mar 2010 23:15:20 +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 074BA8FC15;
	Mon, 22 Mar 2010 23:15: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 o2MNFJxU069476;
	Mon, 22 Mar 2010 23:15:19 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MNFJVk069473;
	Mon, 22 Mar 2010 23:15:19 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201003222315.o2MNFJVk069473@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Mon, 22 Mar 2010 23:15:19 +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: r205489 - stable/7/sys/dev/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: Mon, 22 Mar 2010 23:15:20 -0000

Author: yongari
Date: Mon Mar 22 23:15:19 2010
New Revision: 205489
URL: http://svn.freebsd.org/changeset/base/205489

Log:
  MFC r203528:
    Add pci_get|set_max_read_req() helper functions to control maximum PCIe
    read request size.

Modified:
  stable/7/sys/dev/pci/pci.c
  stable/7/sys/dev/pci/pcivar.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/pci/pci.c
==============================================================================
--- stable/7/sys/dev/pci/pci.c	Mon Mar 22 23:04:12 2010	(r205488)
+++ stable/7/sys/dev/pci/pci.c	Mon Mar 22 23:15:19 2010	(r205489)
@@ -1564,6 +1564,40 @@ pci_ht_map_msi(device_t dev, uint64_t ad
 	}
 }
 
+int
+pci_get_max_read_req(device_t dev)
+{
+	int cap;
+	uint16_t val;
+
+	if (pci_find_extcap(dev, PCIY_EXPRESS, &cap) != 0)
+		return (0);
+	val = pci_read_config(dev, cap + PCIR_EXPRESS_DEVICE_CTL, 2);
+	val &= PCIM_EXP_CTL_MAX_READ_REQUEST;
+	val >>= 12;
+	return (1 << (val + 7));
+}
+
+int
+pci_set_max_read_req(device_t dev, int size)
+{
+	int cap;
+	uint16_t val;
+
+	if (pci_find_extcap(dev, PCIY_EXPRESS, &cap) != 0)
+		return (0);
+	if (size < 128)
+		size = 128;
+	if (size > 4096)
+		size = 4096;
+	size = (1 << (fls(size) - 1));
+	val = pci_read_config(dev, cap + PCIR_EXPRESS_DEVICE_CTL, 2);
+	val &= ~PCIM_EXP_CTL_MAX_READ_REQUEST;
+	val |= (fls(size) - 8) << 12;
+	pci_write_config(dev, cap + PCIR_EXPRESS_DEVICE_CTL, val, 2);
+	return (size);
+}
+
 /*
  * Support for MSI message signalled interrupts.
  */

Modified: stable/7/sys/dev/pci/pcivar.h
==============================================================================
--- stable/7/sys/dev/pci/pcivar.h	Mon Mar 22 23:04:12 2010	(r205488)
+++ stable/7/sys/dev/pci/pcivar.h	Mon Mar 22 23:15:19 2010	(r205489)
@@ -465,6 +465,9 @@ int	pci_msi_device_blacklisted(device_t 
 
 void	pci_ht_map_msi(device_t dev, uint64_t addr);
 
+int	pci_get_max_read_req(device_t dev);
+int	pci_set_max_read_req(device_t dev, int size);
+
 #endif	/* _SYS_BUS_H_ */
 
 /*

From owner-svn-src-stable-7@FreeBSD.ORG  Mon Mar 22 23:27:08 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 8C893106566B;
	Mon, 22 Mar 2010 23:27:08 +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 7B8108FC0A;
	Mon, 22 Mar 2010 23:27:08 +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 o2MNR88v072182;
	Mon, 22 Mar 2010 23:27:08 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2MNR8NW072180;
	Mon, 22 Mar 2010 23:27:08 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201003222327.o2MNR8NW072180@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Mon, 22 Mar 2010 23:27:08 +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: r205491 - stable/7/sys/net
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, 22 Mar 2010 23:27:08 -0000

Author: yongari
Date: Mon Mar 22 23:27:08 2010
New Revision: 205491
URL: http://svn.freebsd.org/changeset/base/205491

Log:
  MFC r204156:
    Add __FBSDID.

Modified:
  stable/7/sys/net/if_vlan.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/net/if_vlan.c
==============================================================================
--- stable/7/sys/net/if_vlan.c	Mon Mar 22 23:23:47 2010	(r205490)
+++ stable/7/sys/net/if_vlan.c	Mon Mar 22 23:27:08 2010	(r205491)
@@ -25,8 +25,6 @@
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $FreeBSD$
  */
 
 /*
@@ -41,6 +39,9 @@
  * and ask it to send them.
  */
 
+#include 
+__FBSDID("$FreeBSD$");
+
 #include "opt_vlan.h"
 
 #include 

From owner-svn-src-stable-7@FreeBSD.ORG  Tue Mar 23 18:36:46 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 2658C106566C;
	Tue, 23 Mar 2010 18:36:46 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 134318FC1E;
	Tue, 23 Mar 2010 18:36:46 +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 o2NIajgS053773;
	Tue, 23 Mar 2010 18:36:45 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NIajsQ053772;
	Tue, 23 Mar 2010 18:36:45 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201003231836.o2NIajsQ053772@svn.freebsd.org>
From: Hiroki Sato 
Date: Tue, 23 Mar 2010 18:36: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: r205521 - in stable/7/release/doc:
	en_US.ISO8859-1/errata share/sgml
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, 23 Mar 2010 18:36:46 -0000

Author: hrs
Date: Tue Mar 23 18:36:45 2010
New Revision: 205521
URL: http://svn.freebsd.org/changeset/base/205521

Log:
  Trim old items and add an errata item for 7.3R.

Modified:
  stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml
  stable/7/release/doc/share/sgml/release.ent

Modified: stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml
==============================================================================
--- stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml	Tue Mar 23 18:00:50 2010	(r205520)
+++ stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml	Tue Mar 23 18:36:45 2010	(r205521)
@@ -16,7 +16,7 @@
 
 
 %release;
-
+
 ]>
 
 
@@ -40,8 +40,7 @@ $FreeBSD$ - 2008 - 2009 + 2010 The &os; Documentation Project @@ -126,7 +125,7 @@ Security Advisories - No advisories. + No advisory. - + - + - + - + @@ -36,10 +36,10 @@ - - + + - + From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 23 19:11:25 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 B40F7106564A; Tue, 23 Mar 2010 19:11:25 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2E228FC20; Tue, 23 Mar 2010 19:11:25 +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 o2NJBP03061412; Tue, 23 Mar 2010 19:11:25 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NJBPmE061410; Tue, 23 Mar 2010 19:11:25 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201003231911.o2NJBPmE061410@svn.freebsd.org> From: Ken Smith Date: Tue, 23 Mar 2010 19:11:25 +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: r205522 - stable/7/sys/conf 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, 23 Mar 2010 19:11:25 -0000 Author: kensmith Date: Tue Mar 23 19:11:25 2010 New Revision: 205522 URL: http://svn.freebsd.org/changeset/base/205522 Log: 7.3-RELEASE is out so shift from PRERELEASE to STABLE. Modified: stable/7/sys/conf/newvers.sh Modified: stable/7/sys/conf/newvers.sh ============================================================================== --- stable/7/sys/conf/newvers.sh Tue Mar 23 18:36:45 2010 (r205521) +++ stable/7/sys/conf/newvers.sh Tue Mar 23 19:11:25 2010 (r205522) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="7.3" -BRANCH="PRERELEASE" +BRANCH="STABLE" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 23 19:24:17 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 D3263106564A; Tue, 23 Mar 2010 19:24:17 +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 C19BE8FC08; Tue, 23 Mar 2010 19:24:17 +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 o2NJOHeb064396; Tue, 23 Mar 2010 19:24:17 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NJOHYI064394; Tue, 23 Mar 2010 19:24:17 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201003231924.o2NJOHYI064394@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 23 Mar 2010 19:24:17 +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: r205524 - stable/7/sys/dev/bge 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, 23 Mar 2010 19:24:18 -0000 Author: yongari Date: Tue Mar 23 19:24:17 2010 New Revision: 205524 URL: http://svn.freebsd.org/changeset/base/205524 Log: MFC r204151,204223: r204151: Add TSO support on VLAN. Controller requires VLAN hardware tagging to make TSO work on VLAN. So if VLAN hardware tagging is disabled explicitly clear TSO on VLAN. While I'm here remove duplicated VLAN_CAPABILITIES call. r204223: Remove Tx mbuf parsing code for VLAN in TSO path. Controller does not support TSO over VLAN if VLAN hardware tagging is disabled so there is no need to check VLAN here. While I'm here make sure to pullup IP/TCP headers in the first buffer. Modified: stable/7/sys/dev/bge/if_bge.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/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Tue Mar 23 19:16:35 2010 (r205523) +++ stable/7/sys/dev/bge/if_bge.c Tue Mar 23 19:24:17 2010 (r205524) @@ -2816,7 +2816,7 @@ bge_attach(device_t dev) IFCAP_VLAN_MTU; if ((sc->bge_flags & BGE_FLAG_TSO) != 0) { ifp->if_hwassist |= CSUM_TSO; - ifp->if_capabilities |= IFCAP_TSO4; + ifp->if_capabilities |= IFCAP_TSO4 | IFCAP_VLAN_HWTSO; } #ifdef IFCAP_VLAN_HWCSUM ifp->if_capabilities |= IFCAP_VLAN_HWCSUM; @@ -3831,12 +3831,11 @@ bge_cksum_pad(struct mbuf *m) static struct mbuf * bge_setup_tso(struct bge_softc *sc, struct mbuf *m, uint16_t *mss) { - struct ether_header *eh; struct ip *ip; struct tcphdr *tcp; struct mbuf *n; uint16_t hlen; - uint32_t ip_off, poff; + uint32_t poff; if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ @@ -3846,28 +3845,16 @@ bge_setup_tso(struct bge_softc *sc, stru return (NULL); m = n; } - ip_off = sizeof(struct ether_header); - m = m_pullup(m, ip_off); + m = m_pullup(m, sizeof(struct ether_header) + sizeof(struct ip)); if (m == NULL) return (NULL); - eh = mtod(m, struct ether_header *); - /* Check the existence of VLAN tag. */ - if (eh->ether_type == htons(ETHERTYPE_VLAN)) { - ip_off = sizeof(struct ether_vlan_header); - m = m_pullup(m, ip_off); - if (m == NULL) - return (NULL); - } - m = m_pullup(m, ip_off + sizeof(struct ip)); - if (m == NULL) - return (NULL); - ip = (struct ip *)(mtod(m, char *) + ip_off); - poff = ip_off + (ip->ip_hl << 2); + ip = (struct ip *)(mtod(m, char *) + sizeof(struct ether_header)); + poff = sizeof(struct ether_header) + (ip->ip_hl << 2); m = m_pullup(m, poff + sizeof(struct tcphdr)); if (m == NULL) return (NULL); tcp = (struct tcphdr *)(mtod(m, char *) + poff); - m = m_pullup(m, poff + sizeof(struct tcphdr) + tcp->th_off); + m = m_pullup(m, poff + (tcp->th_off << 2)); if (m == NULL) return (NULL); /* @@ -4522,9 +4509,6 @@ bge_ioctl(struct ifnet *ifp, u_long comm ifp->if_hwassist |= BGE_CSUM_FEATURES; else ifp->if_hwassist &= ~BGE_CSUM_FEATURES; -#ifdef VLAN_CAPABILITIES - VLAN_CAPABILITIES(ifp); -#endif } if ((mask & IFCAP_TSO4) != 0 && @@ -4542,16 +4526,21 @@ bge_ioctl(struct ifnet *ifp, u_long comm bge_init(sc); } - if (mask & IFCAP_VLAN_HWTAGGING) { + if ((mask & IFCAP_VLAN_HWTSO) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) + ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; BGE_LOCK(sc); bge_setvlan(sc); BGE_UNLOCK(sc); + } #ifdef VLAN_CAPABILITIES - VLAN_CAPABILITIES(ifp); + VLAN_CAPABILITIES(ifp); #endif - } - break; default: error = ether_ioctl(ifp, command, data); From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 23 19:34: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 3B374106566C; Tue, 23 Mar 2010 19:34:35 +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 29DD68FC2A; Tue, 23 Mar 2010 19:34: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 o2NJYZIq066824; Tue, 23 Mar 2010 19:34:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NJYZuf066822; Tue, 23 Mar 2010 19:34:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201003231934.o2NJYZuf066822@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 23 Mar 2010 19:34: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: r205528 - 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, 23 Mar 2010 19:34:35 -0000 Author: yongari Date: Tue Mar 23 19:34:34 2010 New Revision: 205528 URL: http://svn.freebsd.org/changeset/base/205528 Log: MFC r204155,204219: r204155: Increase PCIe maximuim read request size to 2048. Because re(4) uses Tx DMA burst size 2048, I beleive PCIe maximum read request size also should match to the value of Tx DMA burst size. With this change I can get more than 800Mbps for TCP bulk transfers. Previously I was not able to get more than 700Mbps. If I enable TSO it now shows 927Mbps. r204219: Add TSO on VLANs. Because re(4) has a TSO limitation for jumbo frame, make sure to update VLAN capabilities whenever jumbo frame is configured. While I'm here rearrange interface capabilities configuration. The controller requires VLAN hardware tagging to make TSO work on VLANs so explicitly check this requirement. 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 Mar 23 19:30:56 2010 (r205527) +++ stable/7/sys/dev/re/if_re.c Tue Mar 23 19:34:34 2010 (r205528) @@ -1163,6 +1163,9 @@ re_attach(device_t dev) msic = 0; if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) { sc->rl_flags |= RL_FLAG_PCIE; + /* Set PCIe maximum read request size to 2048. */ + if (pci_get_max_read_req(dev) < 2048) + pci_set_max_read_req(dev, 2048); msic = pci_msi_count(dev); if (bootverbose) device_printf(dev, "MSI count : %d\n", msic); @@ -1427,7 +1430,7 @@ re_attach(device_t dev) */ if ((sc->rl_flags & RL_FLAG_DESCV2) == 0) { ifp->if_hwassist |= CSUM_TSO; - ifp->if_capabilities |= IFCAP_TSO4; + ifp->if_capabilities |= IFCAP_TSO4 | IFCAP_VLAN_HWTSO; } /* @@ -1449,7 +1452,7 @@ re_attach(device_t dev) * packets in TSO size. */ ifp->if_hwassist &= ~CSUM_TSO; - ifp->if_capenable &= ~IFCAP_TSO4; + ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO); #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; #endif @@ -2780,6 +2783,7 @@ re_ioctl(struct ifnet *ifp, u_long comma (ifp->if_capenable & IFCAP_TSO4) != 0) { ifp->if_capenable &= ~IFCAP_TSO4; ifp->if_hwassist &= ~CSUM_TSO; + VLAN_CAPABILITIES(ifp); } RL_UNLOCK(sc); break; @@ -2846,14 +2850,10 @@ re_ioctl(struct ifnet *ifp, u_long comma ifp->if_hwassist &= ~RE_CSUM_FEATURES; reinit = 1; } - if (mask & IFCAP_VLAN_HWTAGGING) { - ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; - reinit = 1; - } - if (mask & IFCAP_TSO4) { + if ((mask & IFCAP_TSO4) != 0 && + (ifp->if_capabilities & IFCAP_TSO) != 0) { ifp->if_capenable ^= IFCAP_TSO4; - if ((IFCAP_TSO4 & ifp->if_capenable) && - (IFCAP_TSO4 & ifp->if_capabilities)) + if ((IFCAP_TSO4 & ifp->if_capenable) != 0) ifp->if_hwassist |= CSUM_TSO; else ifp->if_hwassist &= ~CSUM_TSO; @@ -2863,6 +2863,17 @@ re_ioctl(struct ifnet *ifp, u_long comma ifp->if_hwassist &= ~CSUM_TSO; } } + if ((mask & IFCAP_VLAN_HWTSO) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) { + ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + /* TSO over VLAN requires VLAN hardware tagging. */ + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) + ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; + reinit = 1; + } if ((mask & IFCAP_WOL) != 0 && (ifp->if_capabilities & IFCAP_WOL) != 0) { if ((mask & IFCAP_WOL_UCAST) != 0) From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 23 19:38: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 79AF0106566B; Tue, 23 Mar 2010 19:38: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 68BE98FC15; Tue, 23 Mar 2010 19:38: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 o2NJcjRt067836; Tue, 23 Mar 2010 19:38:45 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NJcjvQ067834; Tue, 23 Mar 2010 19:38:45 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201003231938.o2NJcjvQ067834@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 23 Mar 2010 19:38: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: r205530 - stable/7/sys/dev/jme 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, 23 Mar 2010 19:38:45 -0000 Author: yongari Date: Tue Mar 23 19:38:45 2010 New Revision: 205530 URL: http://svn.freebsd.org/changeset/base/205530 Log: MFC r204225: Add TSO support on VLANs. jme(4) controllers do not require VLAN hardware tagging to make TSO work over VLANs. Modified: stable/7/sys/dev/jme/if_jme.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/jme/if_jme.c ============================================================================== --- stable/7/sys/dev/jme/if_jme.c Tue Mar 23 19:37:15 2010 (r205529) +++ stable/7/sys/dev/jme/if_jme.c Tue Mar 23 19:38:45 2010 (r205530) @@ -783,7 +783,7 @@ jme_attach(device_t dev) /* VLAN capability setup */ ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | - IFCAP_VLAN_HWCSUM; + IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO; ifp->if_capenable = ifp->if_capabilities; /* Tell the upper layer(s) we support long frames. */ @@ -2000,6 +2000,9 @@ jme_ioctl(struct ifnet *ifp, u_long cmd, if ((mask & IFCAP_VLAN_HWCSUM) != 0 && (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; + if ((mask & IFCAP_VLAN_HWTSO) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && (IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 23 19:45:00 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 22EE2106564A; Tue, 23 Mar 2010 19:45:00 +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 114978FC16; Tue, 23 Mar 2010 19:45: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 o2NJixgM069303; Tue, 23 Mar 2010 19:44:59 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NJixj3069301; Tue, 23 Mar 2010 19:44:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201003231944.o2NJixj3069301@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 23 Mar 2010 19:44: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: r205532 - stable/7/sys/dev/alc 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, 23 Mar 2010 19:45:00 -0000 Author: yongari Date: Tue Mar 23 19:44:59 2010 New Revision: 205532 URL: http://svn.freebsd.org/changeset/base/205532 Log: MFC r204228,204230: r204228: Add TSO support on VLANs. Also make sure to update TSO capability whenever jumbo frame is configured. While I'm here remove unnecessary check of VLAN hardware checksum offloading. vlan(4) already takes care of this. r204230: Remove Tx mbuf parsing code for VLAN in TSO path. Controller does not support TSO over VLAN if VLAN hardware tagging is disabled so there is no need to check VLAN here. Modified: stable/7/sys/dev/alc/if_alc.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/alc/if_alc.c ============================================================================== --- stable/7/sys/dev/alc/if_alc.c Tue Mar 23 19:41:43 2010 (r205531) +++ stable/7/sys/dev/alc/if_alc.c Tue Mar 23 19:44:59 2010 (r205532) @@ -84,9 +84,6 @@ __FBSDID("$FreeBSD$"); #else #define ALC_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) #endif -#ifndef IFCAP_VLAN_HWTSO -#define IFCAP_VLAN_HWTSO 0 -#endif MODULE_DEPEND(alc, pci, 1, 1, 1); MODULE_DEPEND(alc, ether, 1, 1, 1); @@ -756,8 +753,8 @@ alc_attach(device_t dev) ether_ifattach(ifp, sc->alc_eaddr); /* VLAN capability setup. */ - ifp->if_capabilities |= IFCAP_VLAN_MTU; - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM; + ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | + IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO; ifp->if_capenable = ifp->if_capabilities; /* * XXX @@ -1791,7 +1788,7 @@ alc_encap(struct alc_softc *sc, struct m struct tcphdr *tcp; bus_dma_segment_t txsegs[ALC_MAXTXSEGS]; bus_dmamap_t map; - uint32_t cflags, hdrlen, ip_off, poff, vtag; + uint32_t cflags, hdrlen, poff, vtag; int error, idx, nsegs, prod; ALC_LOCK_ASSERT(sc); @@ -1801,7 +1798,7 @@ alc_encap(struct alc_softc *sc, struct m m = *m_head; ip = NULL; tcp = NULL; - ip_off = poff = 0; + poff = 0; if ((m->m_pkthdr.csum_flags & (ALC_CSUM_FEATURES | CSUM_TSO)) != 0) { /* * AR8131/AR8132 requires offset of TCP/UDP header in its @@ -1811,7 +1808,6 @@ alc_encap(struct alc_softc *sc, struct m * cycles on FreeBSD so fast host CPU is required to get * smooth TSO performance. */ - struct ether_header *eh; if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ @@ -1825,32 +1821,13 @@ alc_encap(struct alc_softc *sc, struct m *m_head = m; } - ip_off = sizeof(struct ether_header); - m = m_pullup(m, ip_off); - if (m == NULL) { - *m_head = NULL; - return (ENOBUFS); - } - eh = mtod(m, struct ether_header *); - /* - * Check if hardware VLAN insertion is off. - * Additional check for LLC/SNAP frame? - */ - if (eh->ether_type == htons(ETHERTYPE_VLAN)) { - ip_off = sizeof(struct ether_vlan_header); - m = m_pullup(m, ip_off); - if (m == NULL) { - *m_head = NULL; - return (ENOBUFS); - } - } - m = m_pullup(m, ip_off + sizeof(struct ip)); + m = m_pullup(m, sizeof(struct ether_header) + sizeof(struct ip)); if (m == NULL) { *m_head = NULL; return (ENOBUFS); } - ip = (struct ip *)(mtod(m, char *) + ip_off); - poff = ip_off + (ip->ip_hl << 2); + ip = (struct ip *)(mtod(m, char *) + sizeof(struct ether_header)); + poff = sizeof(struct ether_header) + (ip->ip_hl << 2); if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { m = m_pullup(m, poff + sizeof(struct tcphdr)); if (m == NULL) { @@ -2133,6 +2110,7 @@ alc_ioctl(struct ifnet *ifp, u_long cmd, (ifp->if_capenable & IFCAP_TSO4) != 0) { ifp->if_capenable &= ~IFCAP_TSO4; ifp->if_hwassist &= ~CSUM_TSO; + VLAN_CAPABILITIES(ifp); } ALC_UNLOCK(sc); } @@ -2204,14 +2182,6 @@ alc_ioctl(struct ifnet *ifp, u_long cmd, if ((mask & IFCAP_VLAN_HWTSO) != 0 && (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWTSO; - /* - * VLAN hardware tagging is required to do checksum - * offload or TSO on VLAN interface. Checksum offload - * on VLAN interface also requires hardware checksum - * offload of parent interface. - */ - if ((ifp->if_capenable & IFCAP_TXCSUM) == 0) - ifp->if_capenable &= ~IFCAP_VLAN_HWCSUM; if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) ifp->if_capenable &= ~(IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM); From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 23 21:38:41 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 7E152106564A; Tue, 23 Mar 2010 21:38:41 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CD4D8FC0C; Tue, 23 Mar 2010 21: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 o2NLcfQF094621; Tue, 23 Mar 2010 21:38:41 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NLcfEv094619; Tue, 23 Mar 2010 21:38:41 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201003232138.o2NLcfEv094619@svn.freebsd.org> From: Andrew Gallatin Date: Tue, 23 Mar 2010 21: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: r205538 - stable/7/sys/dev/mxge 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, 23 Mar 2010 21:38:41 -0000 Author: gallatin Date: Tue Mar 23 21:38:41 2010 New Revision: 205538 URL: http://svn.freebsd.org/changeset/base/205538 Log: MFC 204212: Update mxge to support IFCAP_VLAN_HWTSO Modified: stable/7/sys/dev/mxge/if_mxge.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/mxge/if_mxge.c ============================================================================== --- stable/7/sys/dev/mxge/if_mxge.c Tue Mar 23 21:38:25 2010 (r205537) +++ stable/7/sys/dev/mxge/if_mxge.c Tue Mar 23 21:38:41 2010 (r205538) @@ -3855,6 +3855,13 @@ mxge_ioctl(struct ifnet *ifp, u_long com } if (mask & IFCAP_VLAN_HWTAGGING) ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + if (mask & IFCAP_VLAN_HWTSO) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + + if (!(ifp->if_capabilities & IFCAP_VLAN_HWTSO) || + !(ifp->if_capenable & IFCAP_VLAN_HWTAGGING)) + ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; + mtx_unlock(&sc->driver_mtx); VLAN_CAPABILITIES(ifp); @@ -4450,6 +4457,11 @@ mxge_attach(device_t dev) #ifdef MXGE_NEW_VLAN_API ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM; + + /* Only FW 1.4.32 and newer can do TSO over vlans */ + if (sc->fw_ver_major == 1 && sc->fw_ver_minor == 4 && + sc->fw_ver_tiny >= 32) + ifp->if_capabilities |= IFCAP_VLAN_HWTSO; #endif sc->max_mtu = mxge_max_mtu(sc); From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 23 21:39:34 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 0BB90106567B; Tue, 23 Mar 2010 21:39:34 +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 EF0C58FC2D; Tue, 23 Mar 2010 21:39: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 o2NLdX2t094869; Tue, 23 Mar 2010 21:39:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NLdXQQ094867; Tue, 23 Mar 2010 21:39:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201003232139.o2NLdXQQ094867@svn.freebsd.org> From: John Baldwin Date: Tue, 23 Mar 2010 21:39: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: r205539 - stable/7/sys/boot/i386/loader 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, 23 Mar 2010 21:39:34 -0000 Author: jhb Date: Tue Mar 23 21:39:33 2010 New Revision: 205539 URL: http://svn.freebsd.org/changeset/base/205539 Log: Enable the ability to build ZFS into the loader so that /boot/zfsloader actually contains ZFS support. Submitted by: Alexander Zagrebin alexz of visp ru Modified: stable/7/sys/boot/i386/loader/Makefile Modified: stable/7/sys/boot/i386/loader/Makefile ============================================================================== --- stable/7/sys/boot/i386/loader/Makefile Tue Mar 23 21:38:41 2010 (r205538) +++ stable/7/sys/boot/i386/loader/Makefile Tue Mar 23 21:39:33 2010 (r205539) @@ -17,12 +17,12 @@ LIBFIREWIRE= ${.OBJDIR}/../libfirewire/l .endif # Set by zfsloader Makefile -#.if ${MK_ZFS} != "no" -#CFLAGS+= -DLOADER_ZFS_SUPPORT -#LIBZFS= ${.OBJDIR}/../../zfs/libzfsboot.a -#.else +.if defined(LOADER_ZFS_SUPPORT) +CFLAGS+= -DLOADER_ZFS_SUPPORT +LIBZFS= ${.OBJDIR}/../../zfs/libzfsboot.a +.else LIBZFS= -#.endif +.endif # Enable PXE TFTP or NFS support, not both. .if defined(LOADER_TFTP_SUPPORT) From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 23 21:43: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 C2F0D1065781; Tue, 23 Mar 2010 21:43: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 976DF8FC17; Tue, 23 Mar 2010 21:43:01 +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 o2NLh169095677; Tue, 23 Mar 2010 21:43:01 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NLh1L8095675; Tue, 23 Mar 2010 21:43:01 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201003232143.o2NLh1L8095675@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 23 Mar 2010 21:43: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: r205540 - stable/7/sys/dev/msk 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, 23 Mar 2010 21:43:01 -0000 Author: yongari Date: Tue Mar 23 21:43:01 2010 New Revision: 205540 URL: http://svn.freebsd.org/changeset/base/205540 Log: MFC r204361-204362: r204361: Reuse the configured LE for VLAN if new LE was created for TSO. Only old controllers need to create new LE for TSO. This change makes TSO work over VLANs. r204362: Add TSO support on VLANs. Controller requires VLAN hardware tagging to make TSO work over VLANs. Modified: stable/7/sys/dev/msk/if_msk.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/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Tue Mar 23 21:39:33 2010 (r205539) +++ stable/7/sys/dev/msk/if_msk.c Tue Mar 23 21:43:01 2010 (r205540) @@ -1006,11 +1006,6 @@ msk_ioctl(struct ifnet *ifp, u_long comm if ((mask & IFCAP_RXCSUM) != 0 && (IFCAP_RXCSUM & ifp->if_capabilities) != 0) ifp->if_capenable ^= IFCAP_RXCSUM; - if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && - (IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) { - ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; - msk_setvlan(sc_if, ifp); - } if ((mask & IFCAP_VLAN_HWCSUM) != 0 && (IFCAP_VLAN_HWCSUM & ifp->if_capabilities) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; @@ -1022,6 +1017,16 @@ msk_ioctl(struct ifnet *ifp, u_long comm else ifp->if_hwassist &= ~CSUM_TSO; } + if ((mask & IFCAP_VLAN_HWTSO) != 0 && + (IFCAP_VLAN_HWTSO & ifp->if_capabilities) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) { + ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + if ((IFCAP_VLAN_HWTAGGING & ifp->if_capenable) == 0) + ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; + msk_setvlan(sc_if, ifp); + } if (ifp->if_mtu > ETHERMTU && (sc_if->msk_flags & MSK_FLAG_JUMBO_NOCSUM) != 0) { ifp->if_hwassist &= ~(MSK_CSUM_FEATURES | CSUM_TSO); @@ -1561,7 +1566,7 @@ msk_attach(device_t dev) * this workaround does not work so disable checksum offload * for VLAN interface. */ - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING; + ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO; /* * Enable Rx checksum offloading for VLAN taggedd frames * if controller support new descriptor format. @@ -2688,7 +2693,7 @@ msk_encap(struct msk_if_softc *sc_if, st } /* Check if we have a VLAN tag to insert. */ if ((m->m_flags & M_VLANTAG) != 0) { - if (tso == 0) { + if (tx_le == NULL) { tx_le = &sc_if->msk_rdata.msk_tx_ring[prod]; tx_le->msk_addr = htole32(0); tx_le->msk_control = htole32(OP_VLAN | HW_OWNER | From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 23 21:56:08 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 3681D106566B; Tue, 23 Mar 2010 21:56:08 +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 23E6E8FC0A; Tue, 23 Mar 2010 21:56:08 +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 o2NLu8It098815; Tue, 23 Mar 2010 21:56:08 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NLu8fn098812; Tue, 23 Mar 2010 21:56:08 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201003232156.o2NLu8fn098812@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 23 Mar 2010 21:56:08 +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: r205543 - stable/7/sys/dev/msk 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, 23 Mar 2010 21:56:08 -0000 Author: yongari Date: Tue Mar 23 21:56:07 2010 New Revision: 205543 URL: http://svn.freebsd.org/changeset/base/205543 Log: MFC r204363,204365-204367,204539-204540: r204363: Optimize inserting LE for TX checksum computation. Controller does not require checksum LE configuration if checksum start and write position is the same as before. So keep track last checksum start and write position and insert new LE whenever the position is changed. This reduces number of LEs used in TX path as well as slightly enhance TX performance. r204365: Don't hardcod register offset to set PCIe max read request size. The register offset is not valid on 88E8072 controller. Also don't blindly increase max read request size to 4096, instead, use 2048 which seems to be more sane value and only change the value if the hardware default size(512) was used on that register. For PCIX controllers, use system defined constant rather than using magic value. While I'm here stop showing negotiated link width. r204366: Allocate single MSI message. msk(4) used to allocate 2 MSI messages for controllers like 88E8053 which reports two MSI messages. Because we don't get anything useful things with 2 MSI messages, allocating 1 MSI message would be more sane approach. While I'm here, enable MSI for dual-port controllers too. Because status block is shared for dual-port controllers, I don't think msk(4) will encounter problem for using MSI on dual-port controllers. r204367: Remove trailing white spaces. r204539: Properly sync status LEs after processing. r204540: Make sure to enable flow-control only if established link is full-duplex. Previously msk(4) used to allow flow-control on 1000baseT half-duplex media. Also GMAC pause is enabled if link partner is capable of handling it. While I'm here use IFM_OPTIONS instead of using IFM_GMASK to check optional flags of link. Modified: stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/msk/if_mskreg.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/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Tue Mar 23 21:51:31 2010 (r205542) +++ stable/7/sys/dev/msk/if_msk.c Tue Mar 23 21:56:07 2010 (r205543) @@ -393,12 +393,6 @@ static struct resource_spec msk_irq_spec { -1, 0, 0 } }; -static struct resource_spec msk_irq_spec_msi2[] = { - { SYS_RES_IRQ, 1, RF_ACTIVE }, - { SYS_RES_IRQ, 2, RF_ACTIVE }, - { -1, 0, 0 } -}; - static int msk_miibus_readreg(device_t dev, int phy, int reg) { @@ -538,28 +532,25 @@ msk_miibus_statchg(device_t dev) break; } - if (((mii->mii_media_active & IFM_GMASK) & IFM_FDX) != 0) - gmac |= GM_GPCR_DUP_FULL; /* Disable Rx flow control. */ - if (((mii->mii_media_active & IFM_GMASK) & IFM_FLAG0) == 0) + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FLAG0) == 0) gmac |= GM_GPCR_FC_RX_DIS; /* Disable Tx flow control. */ - if (((mii->mii_media_active & IFM_GMASK) & IFM_FLAG1) == 0) + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FLAG1) == 0) gmac |= GM_GPCR_FC_TX_DIS; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) + gmac |= GM_GPCR_DUP_FULL; + else + gmac |= GM_GPCR_FC_RX_DIS | GM_GPCR_FC_TX_DIS; gmac |= GM_GPCR_RX_ENA | GM_GPCR_TX_ENA; GMAC_WRITE_2(sc, sc_if->msk_port, GM_GP_CTRL, gmac); /* Read again to ensure writing. */ GMAC_READ_2(sc, sc_if->msk_port, GM_GP_CTRL); - - gmac = GMC_PAUSE_ON; - if (((mii->mii_media_active & IFM_GMASK) & - (IFM_FLAG0 | IFM_FLAG1)) == 0) - gmac = GMC_PAUSE_OFF; - /* Diable pause for 10/100 Mbps in half-duplex mode. */ - if ((((mii->mii_media_active & IFM_GMASK) & IFM_FDX) == 0) && - (IFM_SUBTYPE(mii->mii_media_active) == IFM_100_TX || - IFM_SUBTYPE(mii->mii_media_active) == IFM_10_T)) - gmac = GMC_PAUSE_OFF; + gmac = GMC_PAUSE_OFF; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FLAG0) != 0) + gmac = GMC_PAUSE_ON; + } CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), gmac); /* Enable PHY interrupt for FIFO underrun/overflow. */ @@ -738,6 +729,7 @@ msk_init_tx_ring(struct msk_if_softc *sc int i; sc_if->msk_cdata.msk_tso_mtu = 0; + sc_if->msk_cdata.msk_last_csum = 0; sc_if->msk_cdata.msk_tx_prod = 0; sc_if->msk_cdata.msk_tx_cons = 0; sc_if->msk_cdata.msk_tx_cnt = 0; @@ -1355,35 +1347,22 @@ mskc_reset(struct msk_softc *sc) * On dual port PCI-X card, there is an problem where status * can be received out of order due to split transactions. */ - if (sc->msk_bustype == MSK_PCIX_BUS && sc->msk_num_port > 1) { - int pcix; + if (sc->msk_pcixcap != 0 && sc->msk_num_port > 1) { uint16_t pcix_cmd; - if (pci_find_extcap(sc->msk_dev, PCIY_PCIX, &pcix) == 0) { - pcix_cmd = pci_read_config(sc->msk_dev, pcix + 2, 2); - /* Clear Max Outstanding Split Transactions. */ - pcix_cmd &= ~0x70; - CSR_WRITE_1(sc, B2_TST_CTRL1, TST_CFG_WRITE_ON); - pci_write_config(sc->msk_dev, pcix + 2, pcix_cmd, 2); - CSR_WRITE_1(sc, B2_TST_CTRL1, TST_CFG_WRITE_OFF); - } + pcix_cmd = pci_read_config(sc->msk_dev, + sc->msk_pcixcap + PCIXR_COMMAND, 2); + /* Clear Max Outstanding Split Transactions. */ + pcix_cmd &= ~PCIXM_COMMAND_MAX_SPLITS; + CSR_WRITE_1(sc, B2_TST_CTRL1, TST_CFG_WRITE_ON); + pci_write_config(sc->msk_dev, + sc->msk_pcixcap + PCIXR_COMMAND, pcix_cmd, 2); + CSR_WRITE_1(sc, B2_TST_CTRL1, TST_CFG_WRITE_OFF); } - if (sc->msk_bustype == MSK_PEX_BUS) { - uint16_t v, width; - - v = pci_read_config(sc->msk_dev, PEX_DEV_CTRL, 2); - /* Change Max. Read Request Size to 4096 bytes. */ - v &= ~PEX_DC_MAX_RRS_MSK; - v |= PEX_DC_MAX_RD_RQ_SIZE(5); - pci_write_config(sc->msk_dev, PEX_DEV_CTRL, v, 2); - width = pci_read_config(sc->msk_dev, PEX_LNK_STAT, 2); - width = (width & PEX_LS_LINK_WI_MSK) >> 4; - v = pci_read_config(sc->msk_dev, PEX_LNK_CAP, 2); - v = (v & PEX_LS_LINK_WI_MSK) >> 4; - if (v != width) - device_printf(sc->msk_dev, - "negotiated width of link(x%d) != " - "max. width of link(x%d)\n", width, v); + if (sc->msk_expcap != 0) { + /* Change Max. Read Request Size to 2048 bytes. */ + if (pci_get_max_read_req(sc->msk_dev) == 512) + pci_set_max_read_req(sc->msk_dev, 2048); } /* Clear status list. */ @@ -1521,7 +1500,7 @@ msk_attach(device_t dev) * Enable Rx checksum offloading if controller support new * descriptor format. */ - if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0 && + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0 && (sc_if->msk_flags & MSK_FLAG_NORX_CSUM) == 0) ifp->if_capabilities |= IFCAP_RXCSUM; ifp->if_hwassist = MSK_CSUM_FEATURES | CSUM_TSO; @@ -1571,7 +1550,7 @@ msk_attach(device_t dev) * Enable Rx checksum offloading for VLAN taggedd frames * if controller support new descriptor format. */ - if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0 && + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0 && (sc_if->msk_flags & MSK_FLAG_NORX_CSUM) == 0) ifp->if_capabilities |= IFCAP_VLAN_HWCSUM; } @@ -1695,11 +1674,13 @@ mskc_attach(device_t dev) } /* Check bus type. */ - if (pci_find_extcap(sc->msk_dev, PCIY_EXPRESS, ®) == 0) + if (pci_find_extcap(sc->msk_dev, PCIY_EXPRESS, ®) == 0) { sc->msk_bustype = MSK_PEX_BUS; - else if (pci_find_extcap(sc->msk_dev, PCIY_PCIX, ®) == 0) + sc->msk_expcap = reg; + } else if (pci_find_extcap(sc->msk_dev, PCIY_PCIX, ®) == 0) { sc->msk_bustype = MSK_PCIX_BUS; - else + sc->msk_pcixcap = reg; + } else sc->msk_bustype = MSK_PCI_BUS; switch (sc->msk_hw_id) { @@ -1769,37 +1750,16 @@ mskc_attach(device_t dev) msic = pci_msi_count(dev); if (bootverbose) device_printf(dev, "MSI count : %d\n", msic); - /* - * The Yukon II reports it can handle two messages, one for each - * possible port. We go ahead and allocate two messages and only - * setup a handler for both if we have a dual port card. - * - * XXX: I haven't untangled the interrupt handler to handle dual - * port cards with separate MSI messages, so for now I disable MSI - * on dual port cards. - */ if (legacy_intr != 0) msi_disable = 1; - if (msi_disable == 0) { - switch (msic) { - case 2: - case 1: /* 88E8058 reports 1 MSI message */ - msir = msic; - if (sc->msk_num_port == 1 && - pci_alloc_msi(dev, &msir) == 0) { - if (msic == msir) { - sc->msk_pflags |= MSK_FLAG_MSI; - sc->msk_irq_spec = msic == 2 ? - msk_irq_spec_msi2 : - msk_irq_spec_msi; - } else - pci_release_msi(dev); - } - break; - default: - device_printf(dev, - "Unexpected number of MSI messages : %d\n", msic); - break; + if (msi_disable == 0 && msic > 0) { + msir = 1; + if (pci_alloc_msi(dev, &msir) == 0) { + if (msir == 1) { + sc->msk_pflags |= MSK_FLAG_MSI; + sc->msk_irq_spec = msk_irq_spec_msi; + } else + pci_release_msi(dev); } } @@ -1873,7 +1833,7 @@ mskc_attach(device_t dev) if (legacy_intr) error = bus_setup_intr(dev, sc->msk_irq[0], INTR_TYPE_NET | INTR_MPSAFE, NULL, msk_legacy_intr, sc, - &sc->msk_intrhand[0]); + &sc->msk_intrhand); else { TASK_INIT(&sc->msk_int_task, 0, msk_int_task, sc); sc->msk_tq = taskqueue_create_fast("msk_taskq", M_WAITOK, @@ -1881,7 +1841,7 @@ mskc_attach(device_t dev) taskqueue_start_threads(&sc->msk_tq, 1, PI_NET, "%s taskq", device_get_nameunit(sc->msk_dev)); error = bus_setup_intr(dev, sc->msk_irq[0], INTR_TYPE_NET | - INTR_MPSAFE, msk_intr, NULL, sc, &sc->msk_intrhand[0]); + INTR_MPSAFE, msk_intr, NULL, sc, &sc->msk_intrhand); } if (error != 0) { @@ -1995,13 +1955,9 @@ mskc_detach(device_t dev) taskqueue_free(sc->msk_tq); sc->msk_tq = NULL; } - if (sc->msk_intrhand[0]) { - bus_teardown_intr(dev, sc->msk_irq[0], sc->msk_intrhand[0]); - sc->msk_intrhand[0] = NULL; - } - if (sc->msk_intrhand[1]) { - bus_teardown_intr(dev, sc->msk_irq[0], sc->msk_intrhand[0]); - sc->msk_intrhand[1] = NULL; + if (sc->msk_intrhand) { + bus_teardown_intr(dev, sc->msk_irq[0], sc->msk_intrhand); + sc->msk_intrhand = NULL; } bus_release_resources(dev, sc->msk_irq_spec, sc->msk_irq); if ((sc->msk_pflags & MSK_FLAG_MSI) != 0) @@ -2532,7 +2488,7 @@ msk_encap(struct msk_if_softc *sc_if, st struct mbuf *m; bus_dmamap_t map; bus_dma_segment_t txsegs[MSK_MAXTXSEGS]; - uint32_t control, prod, si; + uint32_t control, csum, prod, si; uint16_t offset, tcp_offset, tso_mtu; int error, i, nseg, tso; @@ -2711,17 +2667,22 @@ msk_encap(struct msk_if_softc *sc_if, st if ((sc_if->msk_flags & MSK_FLAG_AUTOTX_CSUM) != 0) control |= CALSUM; else { - tx_le = &sc_if->msk_rdata.msk_tx_ring[prod]; - tx_le->msk_addr = htole32(((tcp_offset + - m->m_pkthdr.csum_data) & 0xffff) | - ((uint32_t)tcp_offset << 16)); - tx_le->msk_control = htole32(1 << 16 | - (OP_TCPLISW | HW_OWNER)); - control = CALSUM | WR_SUM | INIT_SUM | LOCK_SUM; + control |= CALSUM | WR_SUM | INIT_SUM | LOCK_SUM; if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0) control |= UDPTCP; - sc_if->msk_cdata.msk_tx_cnt++; - MSK_INC(prod, MSK_TX_RING_CNT); + /* Checksum write position. */ + csum = (tcp_offset + m->m_pkthdr.csum_data) & 0xffff; + /* Checksum start position. */ + csum |= (uint32_t)tcp_offset << 16; + if (csum != sc_if->msk_cdata.msk_last_csum) { + tx_le = &sc_if->msk_rdata.msk_tx_ring[prod]; + tx_le->msk_addr = htole32(csum); + tx_le->msk_control = htole32(1 << 16 | + (OP_TCPLISW | HW_OWNER)); + sc_if->msk_cdata.msk_tx_cnt++; + MSK_INC(prod, MSK_TX_RING_CNT); + sc_if->msk_cdata.msk_last_csum = csum; + } } } @@ -3414,7 +3375,6 @@ msk_handle_events(struct msk_softc *sc) /* Sync status LEs. */ bus_dmamap_sync(sc->msk_stat_tag, sc->msk_stat_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - /* XXX Sync Rx LEs here. */ rxput[MSK_PORT_A] = rxput[MSK_PORT_B] = 0; @@ -3424,13 +3384,6 @@ msk_handle_events(struct msk_softc *sc) control = le32toh(sd->msk_control); if ((control & HW_OWNER) == 0) break; - /* - * Marvell's FreeBSD driver updates status LE after clearing - * HW_OWNER. However we don't have a way to sync single LE - * with bus_dma(9) API. bus_dma(9) provides a way to sync - * an entire DMA map. So don't sync LE until we have a better - * way to sync LEs. - */ control &= ~HW_OWNER; sd->msk_control = htole32(control); status = le32toh(sd->msk_status); @@ -3491,7 +3444,8 @@ msk_handle_events(struct msk_softc *sc) } sc->msk_stat_cons = cons; - /* XXX We should sync status LEs here. See above notes. */ + bus_dmamap_sync(sc->msk_stat_tag, sc->msk_stat_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); if (rxput[MSK_PORT_A] > 0) msk_rxput(sc->msk_if[MSK_PORT_A]); @@ -3757,7 +3711,7 @@ msk_init_locked(struct msk_if_softc *sc_ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON | GMC_BYP_RETR_ON); - + /* * Initialize GMAC first such that speed/duplex/flow-control * parameters are renegotiated when interface is brought up. @@ -3805,7 +3759,7 @@ msk_init_locked(struct msk_if_softc *sc_ eaddr[2] | (eaddr[3] << 8)); GMAC_WRITE_2(sc, sc_if->msk_port, GM_SRC_ADDR_2H, eaddr[4] | (eaddr[5] << 8)); - + /* Disable interrupts for counter overflows. */ GMAC_WRITE_2(sc, sc_if->msk_port, GM_TX_IRQ_MSK, 0); GMAC_WRITE_2(sc, sc_if->msk_port, GM_RX_IRQ_MSK, 0); Modified: stable/7/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/7/sys/dev/msk/if_mskreg.h Tue Mar 23 21:51:31 2010 (r205542) +++ stable/7/sys/dev/msk/if_mskreg.h Tue Mar 23 21:56:07 2010 (r205543) @@ -2361,6 +2361,7 @@ struct msk_chain_data { bus_dmamap_t msk_jumbo_rx_ring_map; bus_dmamap_t msk_jumbo_rx_sparemap; uint16_t msk_tso_mtu; + uint32_t msk_last_csum; int msk_tx_prod; int msk_tx_cons; int msk_tx_cnt; @@ -2467,14 +2468,16 @@ struct msk_hw_stats { struct msk_softc { struct resource *msk_res[1]; /* I/O resource */ struct resource_spec *msk_res_spec; - struct resource *msk_irq[2]; /* IRQ resources */ + struct resource *msk_irq[1]; /* IRQ resources */ struct resource_spec *msk_irq_spec; - void *msk_intrhand[2]; /* irq handler handle */ + void *msk_intrhand; /* irq handler handle */ device_t msk_dev; uint8_t msk_hw_id; uint8_t msk_hw_rev; uint8_t msk_bustype; uint8_t msk_num_port; + int msk_expcap; + int msk_pcixcap; int msk_ramsize; /* amount of SRAM on NIC */ uint32_t msk_pmd; /* physical media type */ uint32_t msk_intrmask; From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 23 22:06: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 6AED2106566C; Tue, 23 Mar 2010 22:06:59 +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 574BC8FC13; Tue, 23 Mar 2010 22:06: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 o2NM6xgV001634; Tue, 23 Mar 2010 22:06:59 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NM6xTU001632; Tue, 23 Mar 2010 22:06:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201003232206.o2NM6xTU001632@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 23 Mar 2010 22:06: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: r205546 - stable/7/sys/dev/bce 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, 23 Mar 2010 22:06:59 -0000 Author: yongari Date: Tue Mar 23 22:06:59 2010 New Revision: 205546 URL: http://svn.freebsd.org/changeset/base/205546 Log: MFC r204368,204370-204372: r204368: Allow disabling VLAN hardware tag stripping with software work around. Management firmware(ASF/IPMI/UMP) requires the VLAN hardware tag stripping so don't actually disable VLAN hardware tag stripping. If VLAN hardware tag stripping was disabled, bce(4) manually reconstruct VLAN frame by appending stripped VLAN tag. Also remove unnecessary IFCAP_VLAN_MTU message. r204370: Make sure to stop controller first before changing MTU. And if interface is not running don't initialize controller. While here remove unnecessary update of error variable. r204371: Make toggling TSO, VLAN hardware checksum offloading work. Also fix TX/RX checksum handler to set/clear relavant assist bits which was used to cause unexpected results. With this change, bce(4) can be bridged with other interfaces that lack TSO, VLAN checksum offloading. r204372: Prefer m_collapse(9) over m_defrag(9). Modified: stable/7/sys/dev/bce/if_bce.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/bce/if_bce.c ============================================================================== --- stable/7/sys/dev/bce/if_bce.c Tue Mar 23 22:06:56 2010 (r205545) +++ stable/7/sys/dev/bce/if_bce.c Tue Mar 23 22:06:59 2010 (r205546) @@ -5886,6 +5886,7 @@ bce_rx_intr(struct bce_softc *sc) { struct ifnet *ifp = sc->bce_ifp; struct l2_fhdr *l2fhdr; + struct ether_vlan_header *vh; unsigned int pkt_len; u16 sw_rx_cons, sw_rx_cons_idx, hw_rx_cons; u32 status; @@ -6141,12 +6142,37 @@ bce_rx_intr(struct bce_softc *sc) /* Attach the VLAN tag. */ if (status & L2_FHDR_STATUS_L2_VLAN_TAG) { + if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) { #if __FreeBSD_version < 700000 - VLAN_INPUT_TAG(ifp, m0, l2fhdr->l2_fhdr_vlan_tag, continue); + VLAN_INPUT_TAG(ifp, m0, + l2fhdr->l2_fhdr_vlan_tag, continue); #else - m0->m_pkthdr.ether_vtag = l2fhdr->l2_fhdr_vlan_tag; - m0->m_flags |= M_VLANTAG; + m0->m_pkthdr.ether_vtag = + l2fhdr->l2_fhdr_vlan_tag; + m0->m_flags |= M_VLANTAG; #endif + } else { + /* + * bce(4) controllers can't disable VLAN + * tag stripping if management firmware + * (ASF/IPMI/UMP) is running. So we always + * strip VLAN tag and manually reconstruct + * the VLAN frame by appending stripped + * VLAN tag in driver if VLAN tag stripping + * was disabled. + * + * TODO: LLC SNAP handling. + */ + bcopy(mtod(m0, uint8_t *), + mtod(m0, uint8_t *) - ETHER_VLAN_ENCAP_LEN, + ETHER_ADDR_LEN * 2); + m0->m_data -= ETHER_VLAN_ENCAP_LEN; + vh = mtod(m0, struct ether_vlan_header *); + vh->evl_encap_proto = htons(ETHERTYPE_VLAN); + vh->evl_tag = htons(l2fhdr->l2_fhdr_vlan_tag); + m0->m_pkthdr.len += ETHER_VLAN_ENCAP_LEN; + m0->m_len += ETHER_VLAN_ENCAP_LEN; + } } /* Increment received packet statistics. */ @@ -6687,7 +6713,7 @@ bce_tx_encap_skip_tso: sc->fragmented_mbuf_count++; /* Try to defrag the mbuf. */ - m0 = m_defrag(*m_head, M_DONTWAIT); + m0 = m_collapse(*m_head, M_DONTWAIT, BCE_MAX_SEGMENTS); if (m0 == NULL) { /* Defrag was unsuccessful */ m_freem(*m_head); @@ -6963,7 +6989,7 @@ bce_ioctl(struct ifnet *ifp, u_long comm struct bce_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; struct mii_data *mii; - int mask, error = 0; + int mask, error = 0, reinit; DBENTER(BCE_VERBOSE_MISC); @@ -6984,7 +7010,16 @@ bce_ioctl(struct ifnet *ifp, u_long comm BCE_LOCK(sc); ifp->if_mtu = ifr->ifr_mtu; - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + reinit = 0; + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + /* + * Because allocation size is used in RX + * buffer allocation, stop controller if + * it is already running. + */ + bce_stop(sc); + reinit = 1; + } #ifdef BCE_JUMBO_HDRSPLIT /* No buffer allocation size changes are necessary. */ #else @@ -7002,7 +7037,8 @@ bce_ioctl(struct ifnet *ifp, u_long comm } #endif - bce_init_locked(sc); + if (reinit != 0) + bce_init_locked(sc); BCE_UNLOCK(sc); break; @@ -7036,7 +7072,6 @@ bce_ioctl(struct ifnet *ifp, u_long comm } BCE_UNLOCK(sc); - error = 0; break; @@ -7046,10 +7081,8 @@ bce_ioctl(struct ifnet *ifp, u_long comm DBPRINT(sc, BCE_VERBOSE_MISC, "Received SIOCADDMULTI/SIOCDELMULTI\n"); BCE_LOCK(sc); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) bce_set_rx_mode(sc); - error = 0; - } BCE_UNLOCK(sc); break; @@ -7069,50 +7102,46 @@ bce_ioctl(struct ifnet *ifp, u_long comm mask = ifr->ifr_reqcap ^ ifp->if_capenable; DBPRINT(sc, BCE_INFO_MISC, "Received SIOCSIFCAP = 0x%08X\n", (u32) mask); - /* Toggle the TX checksum capabilites enable flag. */ - if (mask & IFCAP_TXCSUM) { + /* Toggle the TX checksum capabilities enable flag. */ + if (mask & IFCAP_TXCSUM && + ifp->if_capabilities & IFCAP_TXCSUM) { ifp->if_capenable ^= IFCAP_TXCSUM; if (IFCAP_TXCSUM & ifp->if_capenable) - ifp->if_hwassist = BCE_IF_HWASSIST; + ifp->if_hwassist |= BCE_IF_HWASSIST; else - ifp->if_hwassist = 0; + ifp->if_hwassist &= ~BCE_IF_HWASSIST; } /* Toggle the RX checksum capabilities enable flag. */ - if (mask & IFCAP_RXCSUM) { + if (mask & IFCAP_RXCSUM && + ifp->if_capabilities & IFCAP_RXCSUM) ifp->if_capenable ^= IFCAP_RXCSUM; - if (IFCAP_RXCSUM & ifp->if_capenable) - ifp->if_hwassist = BCE_IF_HWASSIST; - else - ifp->if_hwassist = 0; - } /* Toggle the TSO capabilities enable flag. */ - if (bce_tso_enable && (mask & IFCAP_TSO4)) { + if (bce_tso_enable && (mask & IFCAP_TSO4) && + ifp->if_capabilities & IFCAP_TSO4) { ifp->if_capenable ^= IFCAP_TSO4; - if (IFCAP_RXCSUM & ifp->if_capenable) - ifp->if_hwassist = BCE_IF_HWASSIST; + if (IFCAP_TSO4 & ifp->if_capenable) + ifp->if_hwassist |= CSUM_TSO; else - ifp->if_hwassist = 0; + ifp->if_hwassist &= ~CSUM_TSO; } - /* Toggle VLAN_MTU capabilities enable flag. */ - if (mask & IFCAP_VLAN_MTU) { - BCE_PRINTF("%s(%d): Changing VLAN_MTU not supported.\n", - __FILE__, __LINE__); - } - - /* Toggle VLANHWTAG capabilities enabled flag. */ - if (mask & IFCAP_VLAN_HWTAGGING) { - if (sc->bce_flags & BCE_MFW_ENABLE_FLAG) - BCE_PRINTF("%s(%d): Cannot change VLAN_HWTAGGING while " - "management firmware (ASF/IPMI/UMP) is running!\n", - __FILE__, __LINE__); - else - BCE_PRINTF("%s(%d): Changing VLAN_HWTAGGING not supported!\n", - __FILE__, __LINE__); - } + if (mask & IFCAP_VLAN_HWCSUM && + ifp->if_capabilities & IFCAP_VLAN_HWCSUM) + ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; + /* + * Don't actually disable VLAN tag stripping as + * management firmware (ASF/IPMI/UMP) requires the + * feature. If VLAN tag stripping is disabled driver + * will manually reconstruct the VLAN frame by + * appending stripped VLAN tag. + */ + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING)) + ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + VLAN_CAPABILITIES(ifp); break; default: /* We don't know how to handle the IOCTL, pass it on. */ From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 23 22:14: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 A2F591065688; Tue, 23 Mar 2010 22:14:05 +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 90BA58FC19; Tue, 23 Mar 2010 22:14: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 o2NME5KQ003436; Tue, 23 Mar 2010 22:14:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NME5Vr003434; Tue, 23 Mar 2010 22:14:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201003232214.o2NME5Vr003434@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 23 Mar 2010 22:14:05 +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: r205548 - stable/7/sys/dev/bce 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, 23 Mar 2010 22:14:05 -0000 Author: yongari Date: Tue Mar 23 22:14:05 2010 New Revision: 205548 URL: http://svn.freebsd.org/changeset/base/205548 Log: MFC r204373-204374: r204373: Move TSO setup to new function bce_tso_setup(). Also remove VLAN parsing code in TSO path as the controller requires VLAN hardware tagging to make TSO work over VLANs. While parsing the mbuf in TSO patch, always perform check for writable mbuf as bce(4) have to reset IP length and IP checksum field of IP header and make sure to ensure contiguous buffer before accessing IP/TCP headers. While I'm here replace magic number 40 to more readable sizeof(struct ip) + sizeof(struct tcphdr). r204374: Add TSO support on VLANs. bce(4) controllers require VLAN hardware tagging to make TSO work on VLANs so explicitly disable TSO on VLAN if VLAN hardware tagging is disabled. Modified: stable/7/sys/dev/bce/if_bce.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/bce/if_bce.c ============================================================================== --- stable/7/sys/dev/bce/if_bce.c Tue Mar 23 22:11:39 2010 (r205547) +++ stable/7/sys/dev/bce/if_bce.c Tue Mar 23 22:14:05 2010 (r205548) @@ -403,6 +403,7 @@ static void bce_fill_pg_chain (struct b static void bce_free_pg_chain (struct bce_softc *); #endif +static struct mbuf *bce_tso_setup (struct bce_softc *, struct mbuf **, u16 *); static int bce_tx_encap (struct bce_softc *, struct mbuf **); static void bce_start_locked (struct ifnet *); static void bce_start (struct ifnet *); @@ -1057,7 +1058,8 @@ bce_attach(device_t dev) if (bce_tso_enable) { ifp->if_hwassist = BCE_IF_HWASSIST | CSUM_TSO; - ifp->if_capabilities = BCE_IF_CAPABILITIES | IFCAP_TSO4; + ifp->if_capabilities = BCE_IF_CAPABILITIES | IFCAP_TSO4 | + IFCAP_VLAN_HWTSO; } else { ifp->if_hwassist = BCE_IF_HWASSIST; ifp->if_capabilities = BCE_IF_CAPABILITIES; @@ -6585,6 +6587,110 @@ bce_init(void *xsc) } +static struct mbuf * +bce_tso_setup(struct bce_softc *sc, struct mbuf **m_head, u16 *flags) +{ + struct mbuf *m; + struct ether_header *eh; + struct ip *ip; + struct tcphdr *th; + u16 etype; + int hdr_len, ip_hlen = 0, tcp_hlen = 0, ip_len = 0; + + DBRUN(sc->requested_tso_frames++); + /* Controller requires to monify mbuf chains. */ + if (M_WRITABLE(*m_head) == 0) { + m = m_dup(*m_head, M_DONTWAIT); + m_freem(*m_head); + if (m == NULL) { + sc->mbuf_alloc_failed_count++; + *m_head = NULL; + return (NULL); + } + *m_head = m; + } + /* + * For TSO the controller needs two pieces of info, + * the MSS and the IP+TCP options length. + */ + m = m_pullup(*m_head, sizeof(struct ether_header) + sizeof(struct ip)); + if (m == NULL) { + *m_head = NULL; + return (NULL); + } + eh = mtod(m, struct ether_header *); + etype = ntohs(eh->ether_type); + + /* Check for supported TSO Ethernet types (only IPv4 for now) */ + switch (etype) { + case ETHERTYPE_IP: + ip = (struct ip *)(m->m_data + sizeof(struct ether_header)); + /* TSO only supported for TCP protocol. */ + if (ip->ip_p != IPPROTO_TCP) { + BCE_PRINTF("%s(%d): TSO enabled for non-TCP frame!.\n", + __FILE__, __LINE__); + m_freem(*m_head); + *m_head = NULL; + return (NULL); + } + + /* Get IP header length in bytes (min 20) */ + ip_hlen = ip->ip_hl << 2; + m = m_pullup(*m_head, sizeof(struct ether_header) + ip_hlen + + sizeof(struct tcphdr)); + if (m == NULL) { + *m_head = NULL; + return (NULL); + } + + /* Get the TCP header length in bytes (min 20) */ + th = (struct tcphdr *)((caddr_t)ip + ip_hlen); + tcp_hlen = (th->th_off << 2); + + /* Make sure all IP/TCP options live in the same buffer. */ + m = m_pullup(*m_head, sizeof(struct ether_header)+ ip_hlen + + tcp_hlen); + if (m == NULL) { + *m_head = NULL; + return (NULL); + } + + /* IP header length and checksum will be calc'd by hardware */ + ip_len = ip->ip_len; + ip->ip_len = 0; + ip->ip_sum = 0; + break; + case ETHERTYPE_IPV6: + BCE_PRINTF("%s(%d): TSO over IPv6 not supported!.\n", + __FILE__, __LINE__); + m_freem(*m_head); + *m_head = NULL; + return (NULL); + /* NOT REACHED */ + default: + BCE_PRINTF("%s(%d): TSO enabled for unsupported protocol!.\n", + __FILE__, __LINE__); + m_freem(*m_head); + *m_head = NULL; + return (NULL); + } + + hdr_len = sizeof(struct ether_header) + ip_hlen + tcp_hlen; + + DBPRINT(sc, BCE_EXTREME_SEND, "%s(): hdr_len = %d, e_hlen = %d, " + "ip_hlen = %d, tcp_hlen = %d, ip_len = %d\n", + __FUNCTION__, hdr_len, sizeof(struct ether_header), ip_hlen, + tcp_hlen, ip_len); + + /* Set the LSO flag in the TX BD */ + *flags |= TX_BD_FLAGS_SW_LSO; + /* Set the length of IP + TCP options (in 32 bit words) */ + *flags |= (((ip_hlen + tcp_hlen - sizeof(struct ip) - + sizeof(struct tcphdr)) >> 2) << 8); + return (*m_head); +} + + /****************************************************************************/ /* Encapsultes an mbuf cluster into the tx_bd chain structure and makes the */ /* memory visible to the controller. */ @@ -6601,12 +6707,8 @@ bce_tx_encap(struct bce_softc *sc, struc bus_dmamap_t map; struct tx_bd *txbd = NULL; struct mbuf *m0; - struct ether_vlan_header *eh; - struct ip *ip; - struct tcphdr *th; - u16 prod, chain_prod, etype, mss = 0, vlan_tag = 0, flags = 0; + u16 prod, chain_prod, mss = 0, vlan_tag = 0, flags = 0; u32 prod_bseq; - int hdr_len = 0, e_hlen = 0, ip_hlen = 0, tcp_hlen = 0, ip_len = 0; #ifdef BCE_DEBUG u16 debug_prod; @@ -6623,72 +6725,16 @@ bce_tx_encap(struct bce_softc *sc, struc /* Transfer any checksum offload flags to the bd. */ m0 = *m_head; if (m0->m_pkthdr.csum_flags) { - if (m0->m_pkthdr.csum_flags & CSUM_IP) - flags |= TX_BD_FLAGS_IP_CKSUM; - if (m0->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) - flags |= TX_BD_FLAGS_TCP_UDP_CKSUM; if (m0->m_pkthdr.csum_flags & CSUM_TSO) { - /* For TSO the controller needs two pieces of info, */ - /* the MSS and the IP+TCP options length. */ + m0 = bce_tso_setup(sc, m_head, &flags); + if (m0 == NULL) + goto bce_tx_encap_exit; mss = htole16(m0->m_pkthdr.tso_segsz); - - /* Map the header and find the Ethernet type & header length */ - eh = mtod(m0, struct ether_vlan_header *); - if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { - etype = ntohs(eh->evl_proto); - e_hlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; - } else { - etype = ntohs(eh->evl_encap_proto); - e_hlen = ETHER_HDR_LEN; - } - - /* Check for supported TSO Ethernet types (only IPv4 for now) */ - switch (etype) { - case ETHERTYPE_IP: - ip = (struct ip *)(m0->m_data + e_hlen); - - /* TSO only supported for TCP protocol */ - if (ip->ip_p != IPPROTO_TCP) { - BCE_PRINTF("%s(%d): TSO enabled for non-TCP frame!.\n", - __FILE__, __LINE__); - goto bce_tx_encap_skip_tso; - } - - /* Get IP header length in bytes (min 20) */ - ip_hlen = ip->ip_hl << 2; - - /* Get the TCP header length in bytes (min 20) */ - th = (struct tcphdr *)((caddr_t)ip + ip_hlen); - tcp_hlen = (th->th_off << 2); - - /* IP header length and checksum will be calc'd by hardware */ - ip_len = ip->ip_len; - ip->ip_len = 0; - ip->ip_sum = 0; - break; - case ETHERTYPE_IPV6: - BCE_PRINTF("%s(%d): TSO over IPv6 not supported!.\n", - __FILE__, __LINE__); - goto bce_tx_encap_skip_tso; - default: - BCE_PRINTF("%s(%d): TSO enabled for unsupported protocol!.\n", - __FILE__, __LINE__); - goto bce_tx_encap_skip_tso; - } - - hdr_len = e_hlen + ip_hlen + tcp_hlen; - - DBPRINT(sc, BCE_EXTREME_SEND, - "%s(): hdr_len = %d, e_hlen = %d, ip_hlen = %d, tcp_hlen = %d, ip_len = %d\n", - __FUNCTION__, hdr_len, e_hlen, ip_hlen, tcp_hlen, ip_len); - - /* Set the LSO flag in the TX BD */ - flags |= TX_BD_FLAGS_SW_LSO; - /* Set the length of IP + TCP options (in 32 bit words) */ - flags |= (((ip_hlen + tcp_hlen - 40) >> 2) << 8); - -bce_tx_encap_skip_tso: - DBRUN(sc->requested_tso_frames++); + } else { + if (m0->m_pkthdr.csum_flags & CSUM_IP) + flags |= TX_BD_FLAGS_IP_CKSUM; + if (m0->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) + flags |= TX_BD_FLAGS_TCP_UDP_CKSUM; } } @@ -7131,6 +7177,9 @@ bce_ioctl(struct ifnet *ifp, u_long comm ifp->if_capabilities & IFCAP_VLAN_HWCSUM) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; + if ((mask & IFCAP_VLAN_HWTSO) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; /* * Don't actually disable VLAN tag stripping as * management firmware (ASF/IPMI/UMP) requires the @@ -7139,8 +7188,12 @@ bce_ioctl(struct ifnet *ifp, u_long comm * appending stripped VLAN tag. */ if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && - (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING)) + (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING)) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) + == 0) + ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; + } VLAN_CAPABILITIES(ifp); break; default: From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 23 22:17: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 C0A60106566B; Tue, 23 Mar 2010 22:17:49 +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 AEFE58FC13; Tue, 23 Mar 2010 22:17: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 o2NMHnn2004506; Tue, 23 Mar 2010 22:17:49 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NMHnU2004504; Tue, 23 Mar 2010 22:17:49 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201003232217.o2NMHnU2004504@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 23 Mar 2010 22:17: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: r205552 - stable/7/sys/dev/bge 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, 23 Mar 2010 22:17:49 -0000 Author: yongari Date: Tue Mar 23 22:17:49 2010 New Revision: 205552 URL: http://svn.freebsd.org/changeset/base/205552 Log: MFC r204376: Disable TSO on BCM5755M controller until I understand better for the issue. I still have no idea why TSO does not work on this controller. davidch@ also confirmed there is no known TSO related issues for this controller. Modified: stable/7/sys/dev/bge/if_bge.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/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Tue Mar 23 22:17:29 2010 (r205551) +++ stable/7/sys/dev/bge/if_bge.c Tue Mar 23 22:17:49 2010 (r205552) @@ -2656,9 +2656,11 @@ bge_attach(device_t dev) /* * BCM5754 and BCM5787 shares the same ASIC id so * explicit device id check is required. + * Due to unknown reason TSO does not work on BCM5755M. */ if (pci_get_device(dev) != BCOM_DEVICEID_BCM5754 && - pci_get_device(dev) != BCOM_DEVICEID_BCM5754M) + pci_get_device(dev) != BCOM_DEVICEID_BCM5754M && + pci_get_device(dev) != BCOM_DEVICEID_BCM5755M) sc->bge_flags |= BGE_FLAG_TSO; } From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 23 22:20: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 F3975106566C; Tue, 23 Mar 2010 22:20:51 +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 C7EFB8FC1E; Tue, 23 Mar 2010 22:20: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 o2NMKpNY005310; Tue, 23 Mar 2010 22:20:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NMKpNt005308; Tue, 23 Mar 2010 22:20:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201003232220.o2NMKpNt005308@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 23 Mar 2010 22:20: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: r205554 - stable/7/sys/dev/age 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, 23 Mar 2010 22:20:52 -0000 Author: yongari Date: Tue Mar 23 22:20:51 2010 New Revision: 205554 URL: http://svn.freebsd.org/changeset/base/205554 Log: MFC r204377: Add TSO support on VLANs. While I'm here remove unnecessary check of VLAN hardware checksum offloading. vlan(4) already takes care of this. Modified: stable/7/sys/dev/age/if_age.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/age/if_age.c ============================================================================== --- stable/7/sys/dev/age/if_age.c Tue Mar 23 22:19:27 2010 (r205553) +++ stable/7/sys/dev/age/if_age.c Tue Mar 23 22:20:51 2010 (r205554) @@ -74,9 +74,6 @@ __FBSDID("$FreeBSD$"); /* "device miibus" required. See GENERIC if you get errors here. */ #include "miibus_if.h" -#ifndef IFCAP_VLAN_HWTSO -#define IFCAP_VLAN_HWTSO 0 -#endif #define AGE_CSUM_FEATURES (CSUM_TCP | CSUM_UDP) MODULE_DEPEND(age, pci, 1, 1, 1); @@ -633,8 +630,8 @@ age_attach(device_t dev) ether_ifattach(ifp, sc->age_eaddr); /* VLAN capability setup. */ - ifp->if_capabilities |= IFCAP_VLAN_MTU; - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM; + ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | + IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO; ifp->if_capenable = ifp->if_capabilities; /* Tell the upper layer(s) we support long frames. */ @@ -1892,29 +1889,19 @@ age_ioctl(struct ifnet *ifp, u_long cmd, if ((mask & IFCAP_WOL_MAGIC) != 0 && (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0) ifp->if_capenable ^= IFCAP_WOL_MAGIC; - - if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && - (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) { - ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; - age_rxvlan(sc); - } if ((mask & IFCAP_VLAN_HWCSUM) != 0 && (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; if ((mask & IFCAP_VLAN_HWTSO) != 0 && (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWTSO; - /* - * VLAN hardware tagging is required to do checksum - * offload or TSO on VLAN interface. Checksum offload - * on VLAN interface also requires hardware assistance - * of parent interface. - */ - if ((ifp->if_capenable & IFCAP_TXCSUM) == 0) - ifp->if_capenable &= ~IFCAP_VLAN_HWCSUM; - if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) - ifp->if_capenable &= - ~(IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM); + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) { + ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) + ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; + age_rxvlan(sc); + } AGE_UNLOCK(sc); VLAN_CAPABILITIES(ifp); break; From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 23 22:24:03 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 70B6D106566B; Tue, 23 Mar 2010 22:24:03 +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 43E948FC08; Tue, 23 Mar 2010 22: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 o2NMO3GF006154; Tue, 23 Mar 2010 22:24:03 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NMO33F006152; Tue, 23 Mar 2010 22:24:03 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201003232224.o2NMO33F006152@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 23 Mar 2010 22: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: r205556 - stable/7/sys/dev/ale 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, 23 Mar 2010 22:24:03 -0000 Author: yongari Date: Tue Mar 23 22:24:02 2010 New Revision: 205556 URL: http://svn.freebsd.org/changeset/base/205556 Log: MFC r204378: Add TSO support on VLANs. While I'm here remove unnecessary check of VLAN hardware checksum offloading. vlan(4) already takes care of this. Modified: stable/7/sys/dev/ale/if_ale.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/ale/if_ale.c ============================================================================== --- stable/7/sys/dev/ale/if_ale.c Tue Mar 23 22:22:26 2010 (r205555) +++ stable/7/sys/dev/ale/if_ale.c Tue Mar 23 22:24:02 2010 (r205556) @@ -78,9 +78,6 @@ __FBSDID("$FreeBSD$"); /* For more information about Tx checksum offload issues see ale_encap(). */ #define ALE_CSUM_FEATURES (CSUM_TCP | CSUM_UDP) -#ifndef IFCAP_VLAN_HWTSO -#define IFCAP_VLAN_HWTSO 0 -#endif MODULE_DEPEND(ale, pci, 1, 1, 1); MODULE_DEPEND(ale, ether, 1, 1, 1); @@ -617,8 +614,8 @@ ale_attach(device_t dev) ether_ifattach(ifp, sc->ale_eaddr); /* VLAN capability setup. */ - ifp->if_capabilities |= IFCAP_VLAN_MTU; - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM; + ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | + IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO; ifp->if_capenable = ifp->if_capabilities; /* * Even though controllers supported by ale(3) have Rx checksum @@ -2003,29 +2000,19 @@ ale_ioctl(struct ifnet *ifp, u_long cmd, if ((mask & IFCAP_WOL_MAGIC) != 0 && (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0) ifp->if_capenable ^= IFCAP_WOL_MAGIC; - - if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && - (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) { - ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; - ale_rxvlan(sc); - } if ((mask & IFCAP_VLAN_HWCSUM) != 0 && (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; if ((mask & IFCAP_VLAN_HWTSO) != 0 && (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWTSO; - /* - * VLAN hardware tagging is required to do checksum - * offload or TSO on VLAN interface. Checksum offload - * on VLAN interface also requires hardware checksum - * offload of parent interface. - */ - if ((ifp->if_capenable & IFCAP_TXCSUM) == 0) - ifp->if_capenable &= ~IFCAP_VLAN_HWCSUM; - if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) - ifp->if_capenable &= - ~(IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM); + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) { + ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) + ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; + ale_rxvlan(sc); + } ALE_UNLOCK(sc); VLAN_CAPABILITIES(ifp); break; From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 23 23:09: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 0259B106564A; Tue, 23 Mar 2010 23:09:39 +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 E32F18FC12; Tue, 23 Mar 2010 23:09:38 +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 o2NN9cVd016590; Tue, 23 Mar 2010 23:09:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NN9cwJ016585; Tue, 23 Mar 2010 23:09:38 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201003232309.o2NN9cwJ016585@svn.freebsd.org> From: Xin LI Date: Tue, 23 Mar 2010 23:09:38 +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: r205563 - 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: Tue, 23 Mar 2010 23:09:39 -0000 Author: delphij Date: Tue Mar 23 23:09:38 2010 New Revision: 205563 URL: http://svn.freebsd.org/changeset/base/205563 Log: MFC: nc from OpenBSD 4.6. Deleted: stable/7/contrib/netcat/FREEBSD-Xlist stable/7/contrib/netcat/FREEBSD-upgrade Modified: stable/7/contrib/netcat/atomicio.c (contents, props changed) stable/7/contrib/netcat/atomicio.h (contents, props changed) stable/7/contrib/netcat/nc.1 stable/7/contrib/netcat/netcat.c Directory Properties: stable/7/contrib/netcat/ (props changed) stable/7/contrib/netcat/socks.c (props changed) Modified: stable/7/contrib/netcat/atomicio.c ============================================================================== --- stable/7/contrib/netcat/atomicio.c Tue Mar 23 23:03:30 2010 (r205562) +++ stable/7/contrib/netcat/atomicio.c Tue Mar 23 23:09:38 2010 (r205563) @@ -1,7 +1,7 @@ -/* $OpenBSD: atomicio.c,v 1.8 2006/02/11 19:31:18 otto Exp $ */ - +/* $OpenBSD: atomicio.c,v 1.9 2007/09/07 14:50:44 tobias Exp $ */ /* - * Copyright (c) 2005 Anil Madhavapeddy. All rights served. + * Copyright (c) 2006 Damien Miller. All rights reserved. + * Copyright (c) 2005 Anil Madhavapeddy. All rights reserved. * Copyright (c) 1995,1999 Theo de Raadt. All rights reserved. * All rights reserved. * @@ -26,32 +26,37 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include -#include +#include + #include +#include #include + #include "atomicio.h" /* * ensure all of data on socket comes through. f==read || f==vwrite */ size_t -atomicio(f, fd, _s, n) - ssize_t (*f) (int, void *, size_t); - int fd; - void *_s; - size_t n; +atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n) { char *s = _s; size_t pos = 0; ssize_t res; + struct pollfd pfd; + pfd.fd = fd; + pfd.events = f == read ? POLLIN : POLLOUT; while (n > pos) { res = (f) (fd, s + pos, n - pos); switch (res) { case -1: - if (errno == EINTR || errno == EAGAIN) + if (errno == EINTR) + continue; + if (errno == EAGAIN) { + (void)poll(&pfd, 1, -1); continue; + } return 0; case 0: errno = EPIPE; @@ -60,5 +65,5 @@ atomicio(f, fd, _s, n) pos += (size_t)res; } } - return pos; + return (pos); } Modified: stable/7/contrib/netcat/atomicio.h ============================================================================== --- stable/7/contrib/netcat/atomicio.h Tue Mar 23 23:03:30 2010 (r205562) +++ stable/7/contrib/netcat/atomicio.h Tue Mar 23 23:09:38 2010 (r205563) @@ -1,6 +1,7 @@ -/* $OpenBSD: atomicio.h,v 1.1 2005/05/24 20:13:28 avsm Exp $ */ +/* $OpenBSD: atomicio.h,v 1.2 2007/09/07 14:50:44 tobias Exp $ */ /* + * Copyright (c) 2006 Damien Miller. All rights reserved. * Copyright (c) 1995,1999 Theo de Raadt. All rights reserved. * All rights reserved. * @@ -25,9 +26,14 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef _ATOMICIO_H +#define _ATOMICIO_H + /* * Ensure all of data on socket comes through. f==read || f==vwrite */ size_t atomicio(ssize_t (*)(int, void *, size_t), int, void *, size_t); #define vwrite (ssize_t (*)(int, void *, size_t))write + +#endif /* _ATOMICIO_H */ Modified: stable/7/contrib/netcat/nc.1 ============================================================================== --- stable/7/contrib/netcat/nc.1 Tue Mar 23 23:03:30 2010 (r205562) +++ stable/7/contrib/netcat/nc.1 Tue Mar 23 23:09:38 2010 (r205563) @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.44 2006/12/02 01:08:30 jmc Exp $ +.\" $OpenBSD: nc.1,v 1.50 2009/06/05 06:47:12 jmc Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 21, 2006 +.Dd June 5 2009 .Dt NC 1 .Os .Sh NAME @@ -36,13 +36,17 @@ .Sh SYNOPSIS .Nm nc .Bk -words -.Op Fl 46DEdhklnorStUuvz +.Op Fl 46DdEhklnorStUuvz .Op Fl e Ar IPsec_policy +.Op Fl I Ar length .Op Fl i Ar interval +.Op Fl -no-tcpopt +.Op Fl O Ar length .Op Fl P Ar proxy_username .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 w Ar timeout .Op Fl X Ar proxy_protocol .Oo Xo @@ -50,7 +54,7 @@ .Ar port Oc Oc .Xc .Op Ar hostname -.Op Ar port Ns Bq Ar s +.Op Ar port .Ek .Sh DESCRIPTION The @@ -100,10 +104,6 @@ to use IPv6 addresses only. Enable debugging on the socket. .It Fl d Do not attempt to read from stdin. -.It Fl h -Prints out -.Nm -help. .It Fl E Shortcut for .Qo @@ -118,6 +118,12 @@ to be used using the syntax described in .Xr ipsec_set_policy 3 . This flag can be specified up to two times, as typically one policy for each direction is needed. +.It Fl h +Prints out +.Nm +help. +.It Fl I Ar length +Specifies the size of the TCP receive buffer. .It Fl i Ar interval Specifies a delay time interval between lines of text sent and received. Also causes a delay time between connections to multiple ports. @@ -146,6 +152,13 @@ option are ignored. .It Fl n Do not do any DNS or service lookups on any specified addresses, hostnames or ports. +.It Fl -no-tcpopt +Disables the use of TCP options on the socket, by setting the boolean +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, @@ -196,6 +209,9 @@ to script telnet sessions. Specifies to use Unix Domain Sockets. .It Fl u Use UDP instead of the default option of TCP. +.It Fl V Ar fib +Set the routing table (FIB). +The default is 0. .It Fl v Have .Nm @@ -263,8 +279,8 @@ unless the option is given (in which case the local host is used). .Pp -.Ar port Ns Op Ar s -can be single integers or ranges. +.Ar port +can be a single integer or a range of ports. Ranges are in the form nn-mm. In general, a destination port must be specified, @@ -437,7 +453,9 @@ if the proxy requires it: .Ex -std .Sh SEE ALSO .Xr cat 1 , -.Xr ssh 1 +.Xr setfib 1 , +.Xr ssh 1 , +.Xr tcp 4 .Sh AUTHORS Original implementation by *Hobbit* .Aq hobbit@avian.org . Modified: stable/7/contrib/netcat/netcat.c ============================================================================== --- stable/7/contrib/netcat/netcat.c Tue Mar 23 23:03:30 2010 (r205562) +++ stable/7/contrib/netcat/netcat.c Tue Mar 23 23:09:38 2010 (r205563) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.89 2007/02/20 14:11:17 jmc Exp $ */ +/* $OpenBSD: netcat.c,v 1.93 2009/06/05 00:18:10 claudio Exp $ */ /* * Copyright (c) 2001 Eric Jackson * @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -50,6 +51,7 @@ #include #include +#include #include #include #include @@ -78,6 +80,7 @@ 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 */ int rflag; /* Random ports flag */ @@ -88,8 +91,11 @@ int vflag; /* Verbosity */ int xflag; /* Socks proxy */ int zflag; /* Port Scan Flag */ int Dflag; /* sodebug */ +int Iflag; /* TCP receive buffer size */ +int Oflag; /* TCP send buffer size */ int Sflag; /* TCP MD5 signature option */ int Tflag = -1; /* IP Type of Service */ +u_int rdomain; int timeout = -1; int family = AF_UNSPEC; @@ -120,6 +126,8 @@ int main(int argc, char *argv[]) { int ch, s, ret, socksv, ipsec_count; + int numfibs; + size_t intsize = sizeof(int); char *host, *uport; struct addrinfo hints; struct servent *sv; @@ -128,7 +136,12 @@ main(int argc, char *argv[]) char *proxy; const char *errstr, *proxyhost = "", *proxyport = NULL; struct addrinfo proxyhints; + struct option longopts[] = { + { "no-tcpopt", no_argument, &FreeBSD_Oflag, 1 }, + { NULL, 0, NULL, 0 } + }; + rdomain = 0; ret = 1; ipsec_count = 0; s = 0; @@ -137,8 +150,9 @@ main(int argc, char *argv[]) uport = NULL; sv = NULL; - while ((ch = getopt(argc, argv, - "46e:DEdhi:jklnoP:p:rSs:tT:Uuvw:X:x:z")) != -1) { + while ((ch = getopt_long(argc, argv, + "46DdEe:hI:i:jklnO:oP:p:rSs:tT:UuV:vw:X:x:z", + longopts, NULL)) != -1) { switch (ch) { case '4': family = AF_INET; @@ -220,6 +234,14 @@ main(int argc, char *argv[]) case 'u': uflag = 1; break; + case 'V': + if (sysctlbyname("net.fibs", &numfibs, &intsize, NULL, 0) == -1) + errx(1, "Multiple FIBS not supported"); + rdomain = (unsigned int)strtonum(optarg, 0, + numfibs - 1, &errstr); + if (errstr) + errx(1, "FIB %s: %s", errstr, optarg); + break; case 'v': vflag = 1; break; @@ -240,12 +262,28 @@ main(int argc, char *argv[]) case 'D': Dflag = 1; break; + case 'I': + Iflag = strtonum(optarg, 1, 65536 << 14, &errstr); + if (errstr != NULL) + errx(1, "TCP receive window %s: %s", + errstr, optarg); + break; + case 'O': + Oflag = strtonum(optarg, 1, 65536 << 14, &errstr); + if (errstr != NULL) { + if (strcmp(errstr, "invalid") != 0) + errx(1, "TCP send window %s: %s", + errstr, optarg); + } + break; case 'S': Sflag = 1; break; case 'T': Tflag = parse_iptos(optarg); break; + case 0: + break; default: usage(1); } @@ -508,7 +546,7 @@ int remote_connect(const char *host, const char *port, struct addrinfo hints) { struct addrinfo *res, *res0; - int s, error; + int s, error, on = 1; if ((error = getaddrinfo(host, port, &hints, &res))) errx(1, "getaddrinfo: %s", gai_strerror(error)); @@ -525,10 +563,19 @@ remote_connect(const char *host, const c add_ipsec_policy(s, ipsec_policy[1]); #endif + if (rdomain) { + if (setfib(rdomain) == -1) + err(1, "setfib"); + } + /* Bind to a local port or source address if specified. */ 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 memset(&ahints, 0, sizeof(struct addrinfo)); ahints.ai_family = res0->ai_family; ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; @@ -591,6 +638,11 @@ local_listen(char *host, char *port, str res0->ai_protocol)) < 0) continue; + if (rdomain) { + if (setfib(rdomain) == -1) + err(1, "setfib"); + } + ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x)); if (ret == -1) err(1, NULL); @@ -600,6 +652,11 @@ local_listen(char *host, char *port, str if (ipsec_policy[1] != NULL) add_ipsec_policy(s, ipsec_policy[1]); #endif + if (FreeBSD_Oflag) { + if (setsockopt(s, IPPROTO_TCP, TCP_NOOPT, + &FreeBSD_Oflag, sizeof(FreeBSD_Oflag)) == -1) + err(1, "disable TCP options"); + } if (bind(s, (struct sockaddr *)res0->ai_addr, res0->ai_addrlen) == 0) @@ -829,6 +886,21 @@ set_common_sockopts(int s) &Tflag, sizeof(Tflag)) == -1) err(1, "set IP ToS"); } + if (Iflag) { + if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, + &Iflag, sizeof(Iflag)) == -1) + err(1, "set TCP receive buffer size"); + } + if (Oflag) { + if (setsockopt(s, SOL_SOCKET, SO_SNDBUF, + &Oflag, sizeof(Oflag)) == -1) + err(1, "set TCP send buffer size"); + } + if (FreeBSD_Oflag) { + if (setsockopt(s, IPPROTO_TCP, TCP_NOOPT, + &FreeBSD_Oflag, sizeof(FreeBSD_Oflag)) == -1) + err(1, "disable TCP options"); + } } int @@ -854,20 +926,24 @@ help(void) usage(0); fprintf(stderr, "\tCommand Summary:\n\ \t-4 Use IPv4\n\ - \t-6 Use IPv6\n"); + \t-6 Use IPv6\n\ + \t-D Enable the debug socket option\n\ + \t-d Detach from stdin\n"); #ifdef IPSEC fprintf(stderr, "\ - \t-e policy Use specified IPsec policy\n\ - \t-E Use IPsec ESP\n"); + \t-E Use IPsec ESP\n\ + \t-e policy Use specified IPsec policy\n"); #endif fprintf(stderr, "\ - \t-D Enable the debug socket option\n\ - \t-d Detach from stdin\n\ \t-h This help text\n\ + \t-I length TCP receive buffer length\n\ \t-i secs\t Delay interval for lines sent, ports scanned\n\ \t-k Keep inbound sockets open for multiple connects\n\ \t-l Listen mode, for inbound connects\n\ \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\ @@ -877,6 +953,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 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\ @@ -914,13 +991,15 @@ add_ipsec_policy(int s, char *policy) void usage(int ret) { + fprintf(stderr, #ifdef IPSEC - fprintf(stderr, "usage: nc [-46DEdhklnrStUuvz] [-e policy] [-i interval] [-P proxy_username] [-p source_port]\n"); + "usage: nc [-46DdEhklnorStUuvz] [-e policy] [-I length] [-i interval] [-O length]\n" #else - fprintf(stderr, "usage: nc [-46DdhklnrStUuvz] [-i interval] [-P proxy_username] [-p source_port]\n"); + "usage: nc [-46DdhklnorStUuvz] [-I length] [-i interval] [-O length]\n" #endif - fprintf(stderr, "\t [-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_protocol]\n"); - fprintf(stderr, "\t [-x proxy_address[:port]] [hostname] [port[s]]\n"); + "\t [-P proxy_username] [-p source_port] [-s source_ip_address] [-T ToS]\n" + "\t [-V fib] [-w timeout] [-X proxy_protocol]\n" + "\t [-x proxy_address[:port]] [hostname] [port]\n"); if (ret) exit(1); } From owner-svn-src-stable-7@FreeBSD.ORG Tue Mar 23 23:28:15 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 401B91065674; Tue, 23 Mar 2010 23:28:15 +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 2C1748FC19; Tue, 23 Mar 2010 23:28:15 +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 o2NNSFF7021077; Tue, 23 Mar 2010 23:28:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2NNSFSA021072; Tue, 23 Mar 2010 23:28:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201003232328.o2NNSFSA021072@svn.freebsd.org> From: Xin LI Date: Tue, 23 Mar 2010 23:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205568 - in stable/7: contrib/less usr.bin/less 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, 23 Mar 2010 23:28:15 -0000 Author: delphij Date: Tue Mar 23 23:28:14 2010 New Revision: 205568 URL: http://svn.freebsd.org/changeset/base/205568 Log: MFC: less v436. Added: stable/7/contrib/less/cvt.c - copied unchanged from r204195, head/contrib/less/cvt.c stable/7/contrib/less/pattern.c - copied unchanged from r204195, head/contrib/less/pattern.c stable/7/contrib/less/pattern.h - copied unchanged from r204195, head/contrib/less/pattern.h Modified: stable/7/contrib/less/COPYING stable/7/contrib/less/LICENSE stable/7/contrib/less/Makefile.aut stable/7/contrib/less/Makefile.dsb stable/7/contrib/less/Makefile.dsg stable/7/contrib/less/Makefile.dsu stable/7/contrib/less/Makefile.in stable/7/contrib/less/Makefile.o2e stable/7/contrib/less/Makefile.o9c stable/7/contrib/less/Makefile.o9u stable/7/contrib/less/Makefile.wnb stable/7/contrib/less/Makefile.wnm stable/7/contrib/less/NEWS stable/7/contrib/less/README stable/7/contrib/less/brac.c stable/7/contrib/less/ch.c stable/7/contrib/less/charset.c stable/7/contrib/less/charset.h stable/7/contrib/less/cmd.h stable/7/contrib/less/cmdbuf.c stable/7/contrib/less/command.c stable/7/contrib/less/configure stable/7/contrib/less/configure.ac stable/7/contrib/less/decode.c stable/7/contrib/less/defines.ds stable/7/contrib/less/defines.o2 stable/7/contrib/less/defines.o9 stable/7/contrib/less/defines.wn stable/7/contrib/less/edit.c stable/7/contrib/less/filename.c stable/7/contrib/less/forwback.c stable/7/contrib/less/funcs.h stable/7/contrib/less/help.c stable/7/contrib/less/ifile.c stable/7/contrib/less/input.c stable/7/contrib/less/install.sh stable/7/contrib/less/jump.c stable/7/contrib/less/less.h stable/7/contrib/less/less.hlp stable/7/contrib/less/less.man stable/7/contrib/less/less.nro stable/7/contrib/less/lessecho.c stable/7/contrib/less/lessecho.man stable/7/contrib/less/lessecho.nro stable/7/contrib/less/lesskey.c stable/7/contrib/less/lesskey.h stable/7/contrib/less/lesskey.man stable/7/contrib/less/lesskey.nro stable/7/contrib/less/lglob.h stable/7/contrib/less/line.c stable/7/contrib/less/linenum.c stable/7/contrib/less/lsystem.c stable/7/contrib/less/main.c stable/7/contrib/less/mark.c stable/7/contrib/less/mkhelp.c stable/7/contrib/less/optfunc.c stable/7/contrib/less/option.c stable/7/contrib/less/option.h stable/7/contrib/less/opttbl.c stable/7/contrib/less/os.c stable/7/contrib/less/output.c stable/7/contrib/less/pckeys.h stable/7/contrib/less/position.c stable/7/contrib/less/position.h stable/7/contrib/less/prompt.c stable/7/contrib/less/screen.c stable/7/contrib/less/scrsize.c stable/7/contrib/less/search.c stable/7/contrib/less/signal.c stable/7/contrib/less/tags.c stable/7/contrib/less/ttyin.c stable/7/contrib/less/version.c stable/7/usr.bin/less/Makefile Directory Properties: stable/7/contrib/less/ (props changed) stable/7/usr.bin/less/ (props changed) Modified: stable/7/contrib/less/COPYING ============================================================================== --- stable/7/contrib/less/COPYING Tue Mar 23 23:25:17 2010 (r205567) +++ stable/7/contrib/less/COPYING Tue Mar 23 23:28:14 2010 (r205568) @@ -1,285 +1,626 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of this License. - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it @@ -287,15 +628,15 @@ free software which everyone can redistr To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least +state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -304,37 +645,30 @@ the "copyright" line and a pointer to wh GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. Modified: stable/7/contrib/less/LICENSE ============================================================================== --- stable/7/contrib/less/LICENSE Tue Mar 23 23:25:17 2010 (r205567) +++ stable/7/contrib/less/LICENSE Tue Mar 23 23:28:14 2010 (r205568) @@ -2,7 +2,7 @@ ------------ Less -Copyright (C) 1984-2007 Mark Nudelman +Copyright (C) 1984-2009 Mark Nudelman Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: stable/7/contrib/less/Makefile.aut ============================================================================== --- stable/7/contrib/less/Makefile.aut Tue Mar 23 23:25:17 2010 (r205567) +++ stable/7/contrib/less/Makefile.aut Tue Mar 23 23:28:14 2010 (r205568) @@ -10,10 +10,10 @@ srcdir = . SRC = \ main.c screen.c brac.c ch.c charset.c cmdbuf.c \ - command.c decode.c edit.c filename.c forwback.c \ + command.c cvt.c decode.c edit.c filename.c forwback.c \ help.c ifile.c input.c jump.c line.c linenum.c \ lsystem.c mark.c optfunc.c option.c opttbl.c os.c \ - output.c position.c prompt.c search.c signal.c \ + output.c pattern.c position.c prompt.c search.c signal.c \ tags.c ttyin.c version.c DISTFILES_W = \ defines.ds Makefile.dsb Makefile.dsg Makefile.dsu \ @@ -24,7 +24,8 @@ DISTFILES = \ ${SRC} regexp.c regexp.h \ COPYING INSTALL LICENSE Makefile.in Makefile.aut NEWS README \ configure configure.ac lesskey.c lessecho.c scrsize.c \ - charset.h cmd.h funcs.h lglob.h less.h lesskey.h option.h pckeys.h position.h \ + charset.h cmd.h funcs.h lglob.h less.h lesskey.h option.h \ + pckeys.h pattern.h position.h \ install.sh defines.h.in mkinstalldirs \ less.nro less.man lesskey.nro lesskey.man lessecho.nro lessecho.man \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 24 10:02: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 526A6106566C; Wed, 24 Mar 2010 10:02:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26C908FC15; Wed, 24 Mar 2010 10:02: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 o2OA2BXn063427; Wed, 24 Mar 2010 10:02:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OA2B1X063424; Wed, 24 Mar 2010 10:02:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201003241002.o2OA2B1X063424@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 24 Mar 2010 10:02: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: r205583 - 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: Wed, 24 Mar 2010 10:02:11 -0000 Author: kib Date: Wed Mar 24 10:02:10 2010 New Revision: 205583 URL: http://svn.freebsd.org/changeset/base/205583 Log: MFC r204957: Fall back to wbinvd when region for CLFLUSH is >= 2MB. MFC r205334 (by avg): Fix a typo in a comment. Modified: stable/7/sys/amd64/amd64/pmap.c 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/amd64/amd64/pmap.c ============================================================================== --- stable/7/sys/amd64/amd64/pmap.c Wed Mar 24 09:45:17 2010 (r205582) +++ stable/7/sys/amd64/amd64/pmap.c Wed Mar 24 10:02:10 2010 (r205583) @@ -955,7 +955,8 @@ pmap_invalidate_cache_range(vm_offset_t if (cpu_feature & CPUID_SS) ; /* If "Self Snoop" is supported, do nothing. */ - else if (cpu_feature & CPUID_CLFSH) { + else if ((cpu_feature & CPUID_CLFSH) != 0 && + eva - sva < 2 * 1024 * 1024) { /* * Otherwise, do per-cache line flush. Use the mfence @@ -972,7 +973,8 @@ pmap_invalidate_cache_range(vm_offset_t /* * No targeted cache flush methods are supported by CPU, - * globally invalidate cache as a last resort. + * or the supplied range is bigger than 2MB. + * Globally invalidate cache. */ pmap_invalidate_cache(); } Modified: stable/7/sys/i386/i386/pmap.c ============================================================================== --- stable/7/sys/i386/i386/pmap.c Wed Mar 24 09:45:17 2010 (r205582) +++ stable/7/sys/i386/i386/pmap.c Wed Mar 24 10:02:10 2010 (r205583) @@ -972,7 +972,8 @@ pmap_invalidate_cache_range(vm_offset_t if (cpu_feature & CPUID_SS) ; /* If "Self Snoop" is supported, do nothing. */ - else if (cpu_feature & CPUID_CLFSH) { + else if ((cpu_feature & CPUID_CLFSH) != 0 && + eva - sva < 2 * 1024 * 1024) { /* * Otherwise, do per-cache line flush. Use the mfence @@ -989,7 +990,8 @@ pmap_invalidate_cache_range(vm_offset_t /* * No targeted cache flush methods are supported by CPU, - * globally invalidate cache as a last resort. + * or the supplied range is bigger than 2MB. + * Globally invalidate cache. */ pmap_invalidate_cache(); } From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 24 16:47: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 A6570106566B; Wed, 24 Mar 2010 16:47:12 +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 892CA8FC13; Wed, 24 Mar 2010 16:47: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 o2OGlCwn055619; Wed, 24 Mar 2010 16:47:12 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OGlCwC055617; Wed, 24 Mar 2010 16:47:12 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201003241647.o2OGlCwC055617@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 24 Mar 2010 16:47: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: r205608 - stable/7/usr.bin/kdump 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, 24 Mar 2010 16:47:12 -0000 Author: jh Date: Wed Mar 24 16:47:12 2010 New Revision: 205608 URL: http://svn.freebsd.org/changeset/base/205608 Log: MFC r203551: - Cast intptr_t, pid_t and time_t values to intmax_t and use %jd with printf. - Cast the system call return value to long and use %ld in a printf in ktrsysret(). PR: bin/123774 Modified: stable/7/usr.bin/kdump/kdump.c Directory Properties: stable/7/usr.bin/kdump/ (props changed) Modified: stable/7/usr.bin/kdump/kdump.c ============================================================================== --- stable/7/usr.bin/kdump/kdump.c Wed Mar 24 16:07:33 2010 (r205607) +++ stable/7/usr.bin/kdump/kdump.c Wed Mar 24 16:47:12 2010 (r205608) @@ -179,14 +179,16 @@ main(int argc, char *argv[]) if (ktr_header.ktr_type & KTR_DROP) { ktr_header.ktr_type &= ~KTR_DROP; if (!drop_logged && threads) { - (void)printf("%6d %6d %-8.*s Events dropped.\n", - ktr_header.ktr_pid, ktr_header.ktr_tid > - 0 ? ktr_header.ktr_tid : 0, MAXCOMLEN, - ktr_header.ktr_comm); + (void)printf( + "%6jd %6jd %-8.*s Events dropped.\n", + (intmax_t)ktr_header.ktr_pid, + ktr_header.ktr_tid > 0 ? + (intmax_t)ktr_header.ktr_tid : 0, + MAXCOMLEN, ktr_header.ktr_comm); drop_logged = 1; } else if (!drop_logged) { - (void)printf("%6d %-8.*s Events dropped.\n", - ktr_header.ktr_pid, MAXCOMLEN, + (void)printf("%6jd %-8.*s Events dropped.\n", + (intmax_t)ktr_header.ktr_pid, MAXCOMLEN, ktr_header.ktr_comm); drop_logged = 1; } @@ -306,10 +308,11 @@ dumpheader(struct ktr_header *kth) * negative tid's as 0. */ if (threads) - (void)printf("%6d %6d %-8.*s ", kth->ktr_pid, kth->ktr_tid > - 0 ? kth->ktr_tid : 0, MAXCOMLEN, kth->ktr_comm); + (void)printf("%6jd %6jd %-8.*s ", (intmax_t)kth->ktr_pid, + kth->ktr_tid > 0 ? (intmax_t)kth->ktr_tid : 0, + MAXCOMLEN, kth->ktr_comm); else - (void)printf("%6d %-8.*s ", kth->ktr_pid, MAXCOMLEN, + (void)printf("%6jd %-8.*s ", (intmax_t)kth->ktr_pid, MAXCOMLEN, kth->ktr_comm); if (timestamp) { if (timestamp == 3) { @@ -322,8 +325,8 @@ dumpheader(struct ktr_header *kth) timevalsub(&kth->ktr_time, &prevtime); prevtime = temp; } - (void)printf("%ld.%06ld ", - kth->ktr_time.tv_sec, kth->ktr_time.tv_usec); + (void)printf("%jd.%06ld ", (intmax_t)kth->ktr_time.tv_sec, + kth->ktr_time.tv_usec); } (void)printf("%s ", type); } @@ -824,7 +827,7 @@ ktrsysret(struct ktr_sysret *ktr) if (error == 0) { if (fancy) { - (void)printf("%d", ret); + (void)printf("%ld", (long)ret); if (ret < 0 || ret > 9) (void)printf("/%#lx", (long)ret); } else { @@ -1273,7 +1276,7 @@ ktrstat(struct stat *statp) printf("rdev=%ju, ", (uintmax_t)statp->st_rdev); printf("atime="); if (resolv == 0) - printf("%ld", statp->st_atimespec.tv_sec); + printf("%jd", (intmax_t)statp->st_atimespec.tv_sec); else { tm = localtime(&statp->st_atimespec.tv_sec); (void)strftime(timestr, sizeof(timestr), TIME_FORMAT, tm); @@ -1285,7 +1288,7 @@ ktrstat(struct stat *statp) printf(", "); printf("stime="); if (resolv == 0) - printf("%ld", statp->st_mtimespec.tv_sec); + printf("%jd", (intmax_t)statp->st_mtimespec.tv_sec); else { tm = localtime(&statp->st_mtimespec.tv_sec); (void)strftime(timestr, sizeof(timestr), TIME_FORMAT, tm); @@ -1297,7 +1300,7 @@ ktrstat(struct stat *statp) printf(", "); printf("ctime="); if (resolv == 0) - printf("%ld", statp->st_ctimespec.tv_sec); + printf("%jd", (intmax_t)statp->st_ctimespec.tv_sec); else { tm = localtime(&statp->st_ctimespec.tv_sec); (void)strftime(timestr, sizeof(timestr), TIME_FORMAT, tm); @@ -1309,7 +1312,7 @@ ktrstat(struct stat *statp) printf(", "); printf("birthtime="); if (resolv == 0) - printf("%ld", statp->st_birthtimespec.tv_sec); + printf("%jd", (intmax_t)statp->st_birthtimespec.tv_sec); else { tm = localtime(&statp->st_birthtimespec.tv_sec); (void)strftime(timestr, sizeof(timestr), TIME_FORMAT, tm); From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 24 17:13: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 202EC106574B; Wed, 24 Mar 2010 17:13:20 +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 0E00C8FC1A; Wed, 24 Mar 2010 17:13: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 o2OHDJMu061623; Wed, 24 Mar 2010 17:13:19 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OHDJnb061620; Wed, 24 Mar 2010 17:13:19 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201003241713.o2OHDJnb061620@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 24 Mar 2010 17:13:19 +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: r205610 - stable/7/sys/dev/msk 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, 24 Mar 2010 17:13:20 -0000 Author: yongari Date: Wed Mar 24 17:13:19 2010 New Revision: 205610 URL: http://svn.freebsd.org/changeset/base/205610 Log: MFC r204541: Implement rudimentary interrupt moderation with programmable countdown timer register. The timer resolution may vary among controllers but the value would be represented by core clock cycles. msk(4) will automatically computes number of required clock cycles from given micro-seconds unit. The default interrupt holdoff timer value is 100us which will ensure less than 10k interrupts under load. The timer value can be changed with dev.mskc.0.int_holdoff sysctl node. Note, the interrupt moderation is shared resource on dual-port controllers so you can't use separate interrupt moderation value for each port. This means we can't stop interrupt moderation in driver stop routine. Also have msk_tick() reclaim transmitted Tx buffers as safety belt. With this change there is no need to check missing Tx completion interrupt in watchdog handler, so remove it. Modified: stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/msk/if_mskreg.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/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Wed Mar 24 17:11:01 2010 (r205609) +++ stable/7/sys/dev/msk/if_msk.c Wed Mar 24 17:13:19 2010 (r205610) @@ -1661,6 +1661,14 @@ mskc_attach(device_t dev) } } + sc->msk_int_holdoff = MSK_INT_HOLDOFF_DEFAULT; + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "int_holdoff", CTLFLAG_RW, &sc->msk_int_holdoff, 0, + "Maximum number of time to delay interrupts"); + resource_int_value(device_get_name(dev), device_get_unit(dev), + "int_holdoff", &sc->msk_int_holdoff); + /* Soft reset. */ CSR_WRITE_2(sc, B0_CTST, CS_RST_SET); CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); @@ -2803,8 +2811,6 @@ static void msk_watchdog(struct msk_if_softc *sc_if) { struct ifnet *ifp; - uint32_t ridx; - int idx; MSK_IF_LOCK_ASSERT(sc_if); @@ -2821,24 +2827,6 @@ msk_watchdog(struct msk_if_softc *sc_if) return; } - /* - * Reclaim first as there is a possibility of losing Tx completion - * interrupts. - */ - ridx = sc_if->msk_port == MSK_PORT_A ? STAT_TXA1_RIDX : STAT_TXA2_RIDX; - idx = CSR_READ_2(sc_if->msk_softc, ridx); - if (sc_if->msk_cdata.msk_tx_cons != idx) { - msk_txeof(sc_if, idx); - if (sc_if->msk_cdata.msk_tx_cnt == 0) { - if_printf(ifp, "watchdog timeout (missed Tx interrupts) " - "-- recovering\n"); - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue(taskqueue_fast, - &sc_if->msk_tx_task); - return; - } - } - if_printf(ifp, "watchdog timeout\n"); ifp->if_oerrors++; ifp->if_drv_flags &= ~IFF_DRV_RUNNING; @@ -3168,6 +3156,7 @@ msk_tick(void *xsc_if) mii_tick(mii); if ((sc_if->msk_flags & MSK_FLAG_LINK) == 0) msk_miibus_statchg(sc_if->msk_if_dev); + msk_handle_events(sc_if->msk_softc); msk_watchdog(sc_if); callout_reset(&sc_if->msk_tick_ch, hz, msk_tick, sc_if); } @@ -3906,6 +3895,17 @@ msk_init_locked(struct msk_if_softc *sc_ sc->msk_intrmask |= Y2_IS_PORT_B; sc->msk_intrhwemask |= Y2_HWE_L2_MASK; } + /* Configure IRQ moderation mask. */ + CSR_WRITE_4(sc, B2_IRQM_MSK, sc->msk_intrmask); + if (sc->msk_int_holdoff > 0) { + /* Configure initial IRQ moderation timer value. */ + CSR_WRITE_4(sc, B2_IRQM_INI, + MSK_USECS(sc, sc->msk_int_holdoff)); + CSR_WRITE_4(sc, B2_IRQM_VAL, + MSK_USECS(sc, sc->msk_int_holdoff)); + /* Start IRQ moderation. */ + CSR_WRITE_1(sc, B2_IRQM_CTRL, TIM_START); + } CSR_WRITE_4(sc, B0_HWE_IMSK, sc->msk_intrhwemask); CSR_READ_4(sc, B0_HWE_IMSK); CSR_WRITE_4(sc, B0_IMSK, sc->msk_intrmask); Modified: stable/7/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/7/sys/dev/msk/if_mskreg.h Wed Mar 24 17:11:01 2010 (r205609) +++ stable/7/sys/dev/msk/if_mskreg.h Wed Mar 24 17:13:19 2010 (r205610) @@ -2406,6 +2406,8 @@ struct msk_ring_data { #define MSK_PROC_MIN 30 #define MSK_PROC_MAX (MSK_RX_RING_CNT - 1) +#define MSK_INT_HOLDOFF_DEFAULT 100 + #define MSK_TX_TIMEOUT 5 #define MSK_PUT_WM 10 @@ -2496,6 +2498,7 @@ struct msk_softc { bus_dmamap_t msk_stat_map; struct msk_stat_desc *msk_stat_ring; bus_addr_t msk_stat_ring_paddr; + int msk_int_holdoff; int msk_process_limit; int msk_stat_cons; struct taskqueue *msk_tq; From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 24 17:15: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 6D457106567D; Wed, 24 Mar 2010 17:15:39 +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 5B6B88FC2D; Wed, 24 Mar 2010 17:15: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 o2OHFdfw062249; Wed, 24 Mar 2010 17:15:39 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OHFdA4062247; Wed, 24 Mar 2010 17:15:39 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201003241715.o2OHFdA4062247@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 24 Mar 2010 17:15: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: r205612 - 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: Wed, 24 Mar 2010 17:15:39 -0000 Author: yongari Date: Wed Mar 24 17:15:39 2010 New Revision: 205612 URL: http://svn.freebsd.org/changeset/base/205612 Log: MFC r204543: Document newly added loader tunable and sysctl variable dev.mskc.%d.int_holdoff Modified: stable/7/share/man/man4/msk.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/msk.4 ============================================================================== --- stable/7/share/man/man4/msk.4 Wed Mar 24 17:15:04 2010 (r205611) +++ stable/7/share/man/man4/msk.4 Wed Mar 24 17:15:39 2010 (r205612) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 6, 2009 +.Dd March 1, 2010 .Dt MSK 4 .Os .Sh NAME @@ -235,6 +235,12 @@ variables and .Xr loader 8 tunables: .Bl -tag -width indent +.It Va dev.mskc.%d.int_holdoff +Maximum number of time to delay interrupts. +The valid range is 0 to 34359738 for 125MHz clock in units of 1us, +the default is 100 (100us). +The interface need to be brought down and up again before a change +takes effect. .It Va dev.mskc.%d.process_limit Maximum amount of Rx events to be processed in the event loop before rescheduling a taskqueue. From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 24 17:21: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 856DD1065677; Wed, 24 Mar 2010 17:21:05 +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 72B3E8FC28; Wed, 24 Mar 2010 17:21: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 o2OHL5Me063541; Wed, 24 Mar 2010 17:21:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OHL5K9063538; Wed, 24 Mar 2010 17:21:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201003241721.o2OHL5K9063538@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 24 Mar 2010 17:21:05 +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: r205614 - stable/7/sys/dev/msk 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, 24 Mar 2010 17:21:05 -0000 Author: yongari Date: Wed Mar 24 17:21:05 2010 New Revision: 205614 URL: http://svn.freebsd.org/changeset/base/205614 Log: MFC r204545: Remove taskqueue based interrupt handling. After r204541 msk(4) does not generate excessive interrupts any more so we don't need to have two copies of interrupt handler. While I'm here remove two STAT_PUT_IDX register accesses in LE status event handler. After r204539 msk(4) always sync status LEs so there is no need to resort to reading STAT_PUT_IDX register to know the end of status LE processing. Just trust status LE's ownership bit. Modified: stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/msk/if_mskreg.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/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Wed Mar 24 17:18:44 2010 (r205613) +++ stable/7/sys/dev/msk/if_msk.c Wed Mar 24 17:21:05 2010 (r205614) @@ -113,7 +113,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -257,9 +256,7 @@ static int msk_attach(device_t); static int msk_detach(device_t); static void msk_tick(void *); -static void msk_legacy_intr(void *); -static int msk_intr(void *); -static void msk_int_task(void *, int); +static void msk_intr(void *); static void msk_intr_phy(struct msk_if_softc *); static void msk_intr_gmac(struct msk_if_softc *); static __inline void msk_rxput(struct msk_if_softc *); @@ -273,8 +270,8 @@ static void msk_rxeof(struct msk_if_soft static void msk_jumbo_rxeof(struct msk_if_softc *, uint32_t, uint32_t, int); static void msk_txeof(struct msk_if_softc *, int); static int msk_encap(struct msk_if_softc *, struct mbuf **); -static void msk_tx_task(void *, int); static void msk_start(struct ifnet *); +static void msk_start_locked(struct ifnet *); static int msk_ioctl(struct ifnet *, u_long, caddr_t); static void msk_set_prefetch(struct msk_softc *, int, bus_addr_t, uint32_t); static void msk_set_rambuffer(struct msk_if_softc *); @@ -1513,9 +1510,6 @@ msk_attach(device_t dev) IFQ_SET_MAXLEN(&ifp->if_snd, MSK_TX_RING_CNT - 1); ifp->if_snd.ifq_drv_maxlen = MSK_TX_RING_CNT - 1; IFQ_SET_READY(&ifp->if_snd); - - TASK_INIT(&sc_if->msk_tx_task, 1, msk_tx_task, ifp); - /* * Get station address for this interface. Note that * dual port cards actually come with three station @@ -1838,25 +1832,10 @@ mskc_attach(device_t dev) } /* Hook interrupt last to avoid having to lock softc. */ - if (legacy_intr) - error = bus_setup_intr(dev, sc->msk_irq[0], INTR_TYPE_NET | - INTR_MPSAFE, NULL, msk_legacy_intr, sc, - &sc->msk_intrhand); - else { - TASK_INIT(&sc->msk_int_task, 0, msk_int_task, sc); - sc->msk_tq = taskqueue_create_fast("msk_taskq", M_WAITOK, - taskqueue_thread_enqueue, &sc->msk_tq); - taskqueue_start_threads(&sc->msk_tq, 1, PI_NET, "%s taskq", - device_get_nameunit(sc->msk_dev)); - error = bus_setup_intr(dev, sc->msk_irq[0], INTR_TYPE_NET | - INTR_MPSAFE, msk_intr, NULL, sc, &sc->msk_intrhand); - } - + error = bus_setup_intr(dev, sc->msk_irq[0], INTR_TYPE_NET | + INTR_MPSAFE, NULL, msk_intr, sc, &sc->msk_intrhand); if (error != 0) { device_printf(dev, "couldn't set up interrupt handler\n"); - if (legacy_intr == 0) - taskqueue_free(sc->msk_tq); - sc->msk_tq = NULL; goto fail; } fail: @@ -1893,7 +1872,6 @@ msk_detach(device_t dev) /* Can't hold locks while calling detach. */ MSK_IF_UNLOCK(sc_if); callout_drain(&sc_if->msk_tick_ch); - taskqueue_drain(taskqueue_fast, &sc_if->msk_tx_task); ether_ifdetach(ifp); MSK_IF_LOCK(sc_if); } @@ -1958,11 +1936,6 @@ mskc_detach(device_t dev) msk_status_dma_free(sc); - if (legacy_intr == 0 && sc->msk_tq != NULL) { - taskqueue_drain(sc->msk_tq, &sc->msk_int_task); - taskqueue_free(sc->msk_tq); - sc->msk_tq = NULL; - } if (sc->msk_intrhand) { bus_teardown_intr(dev, sc->msk_irq[0], sc->msk_intrhand); sc->msk_intrhand = NULL; @@ -2742,30 +2715,29 @@ msk_encap(struct msk_if_softc *sc_if, st } static void -msk_tx_task(void *arg, int pending) +msk_start(struct ifnet *ifp) { - struct ifnet *ifp; + struct msk_if_softc *sc_if; - ifp = arg; - msk_start(ifp); + sc_if = ifp->if_softc; + MSK_IF_LOCK(sc_if); + msk_start_locked(ifp); + MSK_IF_UNLOCK(sc_if); } static void -msk_start(struct ifnet *ifp) +msk_start_locked(struct ifnet *ifp) { - struct msk_if_softc *sc_if; - struct mbuf *m_head; + struct msk_if_softc *sc_if; + struct mbuf *m_head; int enq; sc_if = ifp->if_softc; - - MSK_IF_LOCK(sc_if); + MSK_IF_LOCK_ASSERT(sc_if); if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING || (sc_if->msk_flags & MSK_FLAG_LINK) == 0) { - MSK_IF_UNLOCK(sc_if); + IFF_DRV_RUNNING || (sc_if->msk_flags & MSK_FLAG_LINK) == 0) return; - } for (enq = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) && sc_if->msk_cdata.msk_tx_cnt < @@ -2803,8 +2775,6 @@ msk_start(struct ifnet *ifp) /* Set a timeout in case the chip goes out to lunch. */ sc_if->msk_watchdog_timer = MSK_TX_TIMEOUT; } - - MSK_IF_UNLOCK(sc_if); } static void @@ -2832,7 +2802,7 @@ msk_watchdog(struct msk_if_softc *sc_if) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; msk_init_locked(sc_if); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue(taskqueue_fast, &sc_if->msk_tx_task); + msk_start_locked(ifp); } static int @@ -3355,20 +3325,16 @@ msk_handle_events(struct msk_softc *sc) int rxput[2]; struct msk_stat_desc *sd; uint32_t control, status; - int cons, idx, len, port, rxprog; - - idx = CSR_READ_2(sc, STAT_PUT_IDX); - if (idx == sc->msk_stat_cons) - return (0); + int cons, len, port, rxprog; /* Sync status LEs. */ bus_dmamap_sync(sc->msk_stat_tag, sc->msk_stat_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); rxput[MSK_PORT_A] = rxput[MSK_PORT_B] = 0; - rxprog = 0; - for (cons = sc->msk_stat_cons; cons != idx;) { + cons = sc->msk_stat_cons; + for (;;) { sd = &sc->msk_stat_ring[cons]; control = le32toh(sd->msk_control); if ((control & HW_OWNER) == 0) @@ -3441,17 +3407,17 @@ msk_handle_events(struct msk_softc *sc) if (rxput[MSK_PORT_B] > 0) msk_rxput(sc->msk_if[MSK_PORT_B]); - return (sc->msk_stat_cons != CSR_READ_2(sc, STAT_PUT_IDX)); + return (rxprog > sc->msk_process_limit ? EAGAIN : 0); } -/* Legacy interrupt handler for shared interrupt. */ static void -msk_legacy_intr(void *xsc) +msk_intr(void *xsc) { struct msk_softc *sc; struct msk_if_softc *sc_if0, *sc_if1; struct ifnet *ifp0, *ifp1; uint32_t status; + int domore; sc = xsc; MSK_LOCK(sc); @@ -3496,9 +3462,8 @@ msk_legacy_intr(void *xsc) if ((status & Y2_IS_HW_ERR) != 0) msk_intr_hwerr(sc); - while (msk_handle_events(sc) != 0) - ; - if ((status & Y2_IS_STAT_BMU) != 0) + domore = msk_handle_events(sc); + if ((status & Y2_IS_STAT_BMU) != 0 && domore == 0) CSR_WRITE_4(sc, STAT_CTRL, SC_STAT_CLR_IRQ); /* Reenable interrupts. */ @@ -3506,103 +3471,12 @@ msk_legacy_intr(void *xsc) if (ifp0 != NULL && (ifp0->if_drv_flags & IFF_DRV_RUNNING) != 0 && !IFQ_DRV_IS_EMPTY(&ifp0->if_snd)) - taskqueue_enqueue(taskqueue_fast, &sc_if0->msk_tx_task); - if (ifp1 != NULL && (ifp1->if_drv_flags & IFF_DRV_RUNNING) != 0 && - !IFQ_DRV_IS_EMPTY(&ifp1->if_snd)) - taskqueue_enqueue(taskqueue_fast, &sc_if1->msk_tx_task); - - MSK_UNLOCK(sc); -} - -static int -msk_intr(void *xsc) -{ - struct msk_softc *sc; - uint32_t status; - - sc = xsc; - status = CSR_READ_4(sc, B0_Y2_SP_ISRC2); - /* Reading B0_Y2_SP_ISRC2 masks further interrupts. */ - if (status == 0 || status == 0xffffffff) { - CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2); - return (FILTER_STRAY); - } - - taskqueue_enqueue(sc->msk_tq, &sc->msk_int_task); - return (FILTER_HANDLED); -} - -static void -msk_int_task(void *arg, int pending) -{ - struct msk_softc *sc; - struct msk_if_softc *sc_if0, *sc_if1; - struct ifnet *ifp0, *ifp1; - uint32_t status; - int domore; - - sc = arg; - MSK_LOCK(sc); - - /* Get interrupt source. */ - status = CSR_READ_4(sc, B0_ISRC); - if (status == 0 || status == 0xffffffff || - (sc->msk_pflags & MSK_FLAG_SUSPEND) != 0 || - (status & sc->msk_intrmask) == 0) - goto done; - - sc_if0 = sc->msk_if[MSK_PORT_A]; - sc_if1 = sc->msk_if[MSK_PORT_B]; - ifp0 = ifp1 = NULL; - if (sc_if0 != NULL) - ifp0 = sc_if0->msk_ifp; - if (sc_if1 != NULL) - ifp1 = sc_if1->msk_ifp; - - if ((status & Y2_IS_IRQ_PHY1) != 0 && sc_if0 != NULL) - msk_intr_phy(sc_if0); - if ((status & Y2_IS_IRQ_PHY2) != 0 && sc_if1 != NULL) - msk_intr_phy(sc_if1); - if ((status & Y2_IS_IRQ_MAC1) != 0 && sc_if0 != NULL) - msk_intr_gmac(sc_if0); - if ((status & Y2_IS_IRQ_MAC2) != 0 && sc_if1 != NULL) - msk_intr_gmac(sc_if1); - if ((status & (Y2_IS_CHK_RX1 | Y2_IS_CHK_RX2)) != 0) { - device_printf(sc->msk_dev, "Rx descriptor error\n"); - sc->msk_intrmask &= ~(Y2_IS_CHK_RX1 | Y2_IS_CHK_RX2); - CSR_WRITE_4(sc, B0_IMSK, sc->msk_intrmask); - CSR_READ_4(sc, B0_IMSK); - } - if ((status & (Y2_IS_CHK_TXA1 | Y2_IS_CHK_TXA2)) != 0) { - device_printf(sc->msk_dev, "Tx descriptor error\n"); - sc->msk_intrmask &= ~(Y2_IS_CHK_TXA1 | Y2_IS_CHK_TXA2); - CSR_WRITE_4(sc, B0_IMSK, sc->msk_intrmask); - CSR_READ_4(sc, B0_IMSK); - } - if ((status & Y2_IS_HW_ERR) != 0) - msk_intr_hwerr(sc); - - domore = msk_handle_events(sc); - if ((status & Y2_IS_STAT_BMU) != 0) - CSR_WRITE_4(sc, STAT_CTRL, SC_STAT_CLR_IRQ); - - if (ifp0 != NULL && (ifp0->if_drv_flags & IFF_DRV_RUNNING) != 0 && - !IFQ_DRV_IS_EMPTY(&ifp0->if_snd)) - taskqueue_enqueue(taskqueue_fast, &sc_if0->msk_tx_task); + msk_start_locked(ifp0); if (ifp1 != NULL && (ifp1->if_drv_flags & IFF_DRV_RUNNING) != 0 && !IFQ_DRV_IS_EMPTY(&ifp1->if_snd)) - taskqueue_enqueue(taskqueue_fast, &sc_if1->msk_tx_task); + msk_start_locked(ifp1); - if (domore > 0) { - taskqueue_enqueue(sc->msk_tq, &sc->msk_int_task); - MSK_UNLOCK(sc); - return; - } -done: MSK_UNLOCK(sc); - - /* Reenable interrupts. */ - CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2); } static void Modified: stable/7/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/7/sys/dev/msk/if_mskreg.h Wed Mar 24 17:18:44 2010 (r205613) +++ stable/7/sys/dev/msk/if_mskreg.h Wed Mar 24 17:21:05 2010 (r205614) @@ -2501,8 +2501,6 @@ struct msk_softc { int msk_int_holdoff; int msk_process_limit; int msk_stat_cons; - struct taskqueue *msk_tq; - struct task msk_int_task; struct mtx msk_mtx; }; @@ -2547,7 +2545,6 @@ struct msk_if_softc { struct msk_ring_data msk_rdata; struct msk_softc *msk_softc; /* parent controller */ struct msk_hw_stats msk_stats; - struct task msk_tx_task; int msk_if_flags; uint16_t msk_vtag; /* VLAN tag id. */ }; From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 24 17:32:21 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 2E1561065674; Wed, 24 Mar 2010 17:32:21 +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 1B8198FC1B; Wed, 24 Mar 2010 17:32:21 +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 o2OHWLbM066179; Wed, 24 Mar 2010 17:32:21 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OHWKDK066177; Wed, 24 Mar 2010 17:32:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201003241732.o2OHWKDK066177@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 24 Mar 2010 17:32: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: r205616 - stable/7/sys/dev/bge 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, 24 Mar 2010 17:32:21 -0000 Author: yongari Date: Wed Mar 24 17:32:20 2010 New Revision: 205616 URL: http://svn.freebsd.org/changeset/base/205616 Log: MFC r204975,204978-204979,204981: r204975: Enable hardware fixes for BCM5704 B0 as recommended by data sheet. r204978: Set maximum read byte count to 2048 for PCI-X BCM5703/5704 devices. Also disable relaxed ordering as recommended by data sheet for PCI-X devices. For PCI-X BCM5704, set maximum outstanding split transactions to 0 as indicated by data sheet. For BCM5703 in PCI-X mode, DMA read watermark should be less than or equal to maximum read byte count configuration. Enforce this limitation in DMA read watermark configuration. r204979: Fix typo in r204975. r204981: Fix typo in r204978. Modified: stable/7/sys/dev/bge/if_bge.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/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Wed Mar 24 17:29:32 2010 (r205615) +++ stable/7/sys/dev/bge/if_bge.c Wed Mar 24 17:32:20 2010 (r205616) @@ -1342,6 +1342,7 @@ static int bge_chipinit(struct bge_softc *sc) { uint32_t dma_rw_ctl; + uint16_t val; int i; /* Set endianness before we access any non-PCI registers. */ @@ -1362,6 +1363,17 @@ bge_chipinit(struct bge_softc *sc) i < BGE_STATUS_BLOCK_END + 1; i += sizeof(uint32_t)) BGE_MEMWIN_WRITE(sc, i, 0); + if (sc->bge_chiprev == BGE_CHIPREV_5704_BX) { + /* + * Fix data corruption caused by non-qword write with WB. + * Fix master abort in PCI mode. + * Fix PCI latency timer. + */ + val = pci_read_config(sc->bge_dev, BGE_PCI_MSI_DATA + 2, 2); + val |= (1 << 10) | (1 << 12) | (1 << 13); + pci_write_config(sc->bge_dev, BGE_PCI_MSI_DATA + 2, val, 2); + } + /* * Set up the PCI DMA control register. */ @@ -1378,6 +1390,15 @@ bge_chipinit(struct bge_softc *sc) dma_rw_ctl |= (sc->bge_asicrev == BGE_ASICREV_BCM5780) ? BGE_PCIDMARWCTL_ONEDMA_ATONCE_GLOBAL : BGE_PCIDMARWCTL_ONEDMA_ATONCE_LOCAL; + } else if (sc->bge_asicrev == BGE_ASICREV_BCM5703) { + /* + * In the BCM5703, the DMA read watermark should + * be set to less than or equal to the maximum + * memory read byte count of the PCI-X command + * register. + */ + dma_rw_ctl |= BGE_PCIDMARWCTL_RD_WAT_SHIFT(4) | + BGE_PCIDMARWCTL_WR_WAT_SHIFT(3); } else if (sc->bge_asicrev == BGE_ASICREV_BCM5704) { /* 1536 bytes for read, 384 bytes for write. */ dma_rw_ctl |= BGE_PCIDMARWCTL_RD_WAT_SHIFT(7) | @@ -3158,7 +3179,26 @@ bge_reset(struct bge_softc *sc) pci_write_config(dev, BGE_PCI_CACHESZ, cachesize, 4); pci_write_config(dev, BGE_PCI_CMD, command, 4); write_op(sc, BGE_MISC_CFG, BGE_32BITTIME_66MHZ); - + /* + * Disable PCI-X relaxed ordering to ensure status block update + * comes first then packet buffer DMA. Otherwise driver may + * read stale status block. + */ + if (sc->bge_flags & BGE_FLAG_PCIX) { + devctl = pci_read_config(dev, + sc->bge_pcixcap + PCIXR_COMMAND, 2); + devctl &= ~PCIXM_COMMAND_ERO; + if (sc->bge_asicrev == BGE_ASICREV_BCM5703) { + devctl &= ~PCIXM_COMMAND_MAX_READ; + devctl |= PCIXM_COMMAND_MAX_READ_2048; + } else if (sc->bge_asicrev == BGE_ASICREV_BCM5704) { + devctl &= ~(PCIXM_COMMAND_MAX_SPLITS | + PCIXM_COMMAND_MAX_READ); + devctl |= PCIXM_COMMAND_MAX_READ_2048; + } + pci_write_config(dev, sc->bge_pcixcap + PCIXR_COMMAND, + devctl, 2); + } /* Re-enable MSI, if neccesary, and enable the memory arbiter. */ if (BGE_IS_5714_FAMILY(sc)) { /* This chip disables MSI on reset. */ From owner-svn-src-stable-7@FreeBSD.ORG Wed Mar 24 17:38:08 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 D5A641065670; Wed, 24 Mar 2010 17:38:08 +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 C37898FC0A; Wed, 24 Mar 2010 17:38:08 +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 o2OHc87t067538; Wed, 24 Mar 2010 17:38:08 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2OHc8DR067536; Wed, 24 Mar 2010 17:38:08 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201003241738.o2OHc8DR067536@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 24 Mar 2010 17:38:08 +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: r205618 - stable/7/sys/dev/msk 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, 24 Mar 2010 17:38:09 -0000 Author: yongari Date: Wed Mar 24 17:38:08 2010 New Revision: 205618 URL: http://svn.freebsd.org/changeset/base/205618 Log: MFC r205161: It seems PCI_OUR_REG_[1-5] registers are not mapped on PCI configuration space on Yukon Ultra(88E8056) such that accesses to these registers were NOPs which in turn make msk(4) instable on this controller. Use indirect access method to access PCI_OUR_REG_[1-5] registers. This should fix a long standing instability bug which prevented msk(4) working on Yukon Ultra. Special thanks to koitsu who gave me remote access to his system. PR: kern/114631, kern/116853 Modified: stable/7/sys/dev/msk/if_msk.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/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Wed Mar 24 17:36:56 2010 (r205617) +++ stable/7/sys/dev/msk/if_msk.c Wed Mar 24 17:38:08 2010 (r205618) @@ -1125,7 +1125,7 @@ msk_phy_power(struct msk_softc *sc, int */ CSR_WRITE_1(sc, B2_Y2_CLK_GATE, val); - val = pci_read_config(sc->msk_dev, PCI_OUR_REG_1, 4); + val = CSR_PCI_READ_4(sc, PCI_OUR_REG_1); val &= ~(PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD); if (sc->msk_hw_id == CHIP_ID_YUKON_XL) { if (sc->msk_hw_rev > CHIP_REV_YU_XL_A1) { @@ -1136,7 +1136,7 @@ msk_phy_power(struct msk_softc *sc, int } } /* Release PHY from PowerDown/COMA mode. */ - pci_write_config(sc->msk_dev, PCI_OUR_REG_1, val, 4); + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_1, val); switch (sc->msk_hw_id) { case CHIP_ID_YUKON_EC_U: case CHIP_ID_YUKON_EX: @@ -1145,16 +1145,16 @@ msk_phy_power(struct msk_softc *sc, int CSR_WRITE_2(sc, B0_CTST, Y2_HW_WOL_OFF); /* Enable all clocks. */ - pci_write_config(sc->msk_dev, PCI_OUR_REG_3, 0, 4); - our = pci_read_config(sc->msk_dev, PCI_OUR_REG_4, 4); + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_3, 0); + our = CSR_PCI_READ_4(sc, PCI_OUR_REG_4); our &= (PCI_FORCE_ASPM_REQUEST|PCI_ASPM_GPHY_LINK_DOWN| PCI_ASPM_INT_FIFO_EMPTY|PCI_ASPM_CLKRUN_REQUEST); /* Set all bits to 0 except bits 15..12. */ - pci_write_config(sc->msk_dev, PCI_OUR_REG_4, our, 4); - our = pci_read_config(sc->msk_dev, PCI_OUR_REG_5, 4); + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_4, our); + our = CSR_PCI_READ_4(sc, PCI_OUR_REG_5); our &= PCI_CTL_TIM_VMAIN_AV_MSK; - pci_write_config(sc->msk_dev, PCI_OUR_REG_5, our, 4); - pci_write_config(sc->msk_dev, PCI_CFG_REG_1, 0, 4); + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_5, our); + CSR_PCI_WRITE_4(sc, PCI_CFG_REG_1, 0); /* * Disable status race, workaround for * Yukon EC Ultra & Yukon EX. @@ -1175,7 +1175,7 @@ msk_phy_power(struct msk_softc *sc, int } break; case MSK_PHY_POWERDOWN: - val = pci_read_config(sc->msk_dev, PCI_OUR_REG_1, 4); + val = CSR_PCI_READ_4(sc, PCI_OUR_REG_1); val |= PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD; if (sc->msk_hw_id == CHIP_ID_YUKON_XL && sc->msk_hw_rev > CHIP_REV_YU_XL_A1) { @@ -1183,7 +1183,7 @@ msk_phy_power(struct msk_softc *sc, int if (sc->msk_num_port > 1) val &= ~PCI_Y2_PHY2_COMA; } - pci_write_config(sc->msk_dev, PCI_OUR_REG_1, val, 4); + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_1, val); val = Y2_PCI_CLK_LNK1_DIS | Y2_COR_CLK_LNK1_DIS | Y2_CLK_GAT_LNK1_DIS | Y2_PCI_CLK_LNK2_DIS | From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 25 00:37:14 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 927D2106567E; Thu, 25 Mar 2010 00:37:14 +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 818F08FC1E; Thu, 25 Mar 2010 00:37:14 +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 o2P0bEiL084918; Thu, 25 Mar 2010 00:37:14 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2P0bEd9084916; Thu, 25 Mar 2010 00:37:14 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201003250037.o2P0bEd9084916@svn.freebsd.org> From: Maxim Sobolev Date: Thu, 25 Mar 2010 00:37:14 +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: r205633 - stable/7/contrib/tcp_wrappers 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, 25 Mar 2010 00:37:14 -0000 Author: sobomax Date: Thu Mar 25 00:37:13 2010 New Revision: 205633 URL: http://svn.freebsd.org/changeset/base/205633 Log: MFC: allow comment in the middle of configuration line not only at the beginning. Modified: stable/7/contrib/tcp_wrappers/hosts_access.c Directory Properties: stable/7/contrib/tcp_wrappers/ (props changed) Modified: stable/7/contrib/tcp_wrappers/hosts_access.c ============================================================================== --- stable/7/contrib/tcp_wrappers/hosts_access.c Wed Mar 24 23:08:25 2010 (r205632) +++ stable/7/contrib/tcp_wrappers/hosts_access.c Thu Mar 25 00:37:13 2010 (r205633) @@ -148,6 +148,7 @@ struct request_info *request; char *sh_cmd; /* becomes optional shell command */ int match = NO; struct tcpd_context saved_context; + char *cp; saved_context = tcpd_context; /* stupid compilers */ @@ -164,7 +165,16 @@ struct request_info *request; tcpd_warn("missing newline or line too long"); continue; } - if (sv_list[0] == '#' || sv_list[strspn(sv_list, " \t\r\n")] == 0) + /* Ignore anything after unescaped # character */ + for (cp = strchr(sv_list, '#'); cp != NULL;) { + if (cp > sv_list && cp[-1] == '\\') { + cp = strchr(cp + 1, '#'); + continue; + } + *cp = '\0'; + break; + } + if (sv_list[strspn(sv_list, " \t\r\n")] == 0) continue; if ((cl_list = split_at(sv_list, ':')) == 0) { tcpd_warn("missing \":\" separator"); From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 25 13:15: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 1AF9E106566B; Thu, 25 Mar 2010 13:15:56 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 089CB8FC1F; Thu, 25 Mar 2010 13:15:56 +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 o2PDFt1Y091762; Thu, 25 Mar 2010 13:15:55 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2PDFtSN091758; Thu, 25 Mar 2010 13:15:55 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201003251315.o2PDFtSN091758@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 25 Mar 2010 13:15: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: r205639 - stable/7/usr.sbin/chown 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, 25 Mar 2010 13:15:56 -0000 Author: gavin Date: Thu Mar 25 13:15:55 2010 New Revision: 205639 URL: http://svn.freebsd.org/changeset/base/205639 Log: Merge r204165 from head: Add a "-x" option to chown(8)/chgrp(1) similar to the same option in du(1), cp(1) etc, to prevent the crossing of mountpoints whilst using the commands recursively. PR: bin/130855 Submitted by: keramida Modified: stable/7/usr.sbin/chown/chgrp.1 stable/7/usr.sbin/chown/chown.8 stable/7/usr.sbin/chown/chown.c Directory Properties: stable/7/usr.sbin/chown/ (props changed) Modified: stable/7/usr.sbin/chown/chgrp.1 ============================================================================== --- stable/7/usr.sbin/chown/chgrp.1 Thu Mar 25 12:56:20 2010 (r205638) +++ stable/7/usr.sbin/chown/chgrp.1 Thu Mar 25 13:15:55 2010 (r205639) @@ -31,7 +31,7 @@ .\" @(#)chgrp.1 8.3 (Berkeley) 3/31/94 .\" $FreeBSD$ .\" -.Dd April 25, 2003 +.Dd February 21, 2010 .Dt CHGRP 1 .Os .Sh NAME @@ -39,7 +39,7 @@ .Nd change group .Sh SYNOPSIS .Nm -.Op Fl fhv +.Op Fl fhvx .Oo .Fl R .Op Fl H | Fl L | Fl P @@ -89,6 +89,8 @@ If the flag is specified more than once, .Nm will print the filename, followed by the old and new numeric group ID. +.It Fl x +File system mount points are not traversed. .El .Pp The @@ -125,7 +127,9 @@ In previous versions of this system, sym .Pp The .Fl v -option is non-standard and its use in scripts is not recommended. +and +.Fl x +options are non-standard and their use in scripts is not recommended. .Sh SEE ALSO .Xr chown 2 , .Xr fts 3 , Modified: stable/7/usr.sbin/chown/chown.8 ============================================================================== --- stable/7/usr.sbin/chown/chown.8 Thu Mar 25 12:56:20 2010 (r205638) +++ stable/7/usr.sbin/chown/chown.8 Thu Mar 25 13:15:55 2010 (r205639) @@ -28,7 +28,7 @@ .\" @(#)chown.8 8.3 (Berkeley) 3/31/94 .\" $FreeBSD$ .\" -.Dd April 25, 2003 +.Dd February 21, 2010 .Dt CHOWN 8 .Os .Sh NAME @@ -36,7 +36,7 @@ .Nd change file owner and group .Sh SYNOPSIS .Nm -.Op Fl fhv +.Op Fl fhvx .Oo .Fl R .Op Fl H | Fl L | Fl P @@ -44,7 +44,7 @@ .Ar owner Ns Op : Ns Ar group .Ar .Nm -.Op Fl fhv +.Op Fl fhvx .Oo .Fl R .Op Fl H | Fl L | Fl P @@ -97,6 +97,8 @@ If the flag is specified more than once, .Nm will print the filename, followed by the old and new numeric user/group ID. +.It Fl x +File system mount points are not traversed. .El .Pp The @@ -146,7 +148,9 @@ owners. .Pp The .Fl v -option is non-standard and its use in scripts is not recommended. +and +.Fl x +options are non-standard and their use in scripts is not recommended. .Sh SEE ALSO .Xr chgrp 1 , .Xr find 1 , Modified: stable/7/usr.sbin/chown/chown.c ============================================================================== --- stable/7/usr.sbin/chown/chown.c Thu Mar 25 12:56:20 2010 (r205638) +++ stable/7/usr.sbin/chown/chown.c Thu Mar 25 13:15:55 2010 (r205639) @@ -73,14 +73,14 @@ main(int argc, char **argv) { FTS *ftsp; FTSENT *p; - int Hflag, Lflag, Rflag, fflag, hflag, vflag; + int Hflag, Lflag, Rflag, fflag, hflag, vflag, xflag; int ch, fts_options, rval; char *cp; ischown = (strcmp(basename(argv[0]), "chown") == 0); - Hflag = Lflag = Rflag = fflag = hflag = vflag = 0; - while ((ch = getopt(argc, argv, "HLPRfhv")) != -1) + Hflag = Lflag = Rflag = fflag = hflag = vflag = xflag = 0; + while ((ch = getopt(argc, argv, "HLPRfhvx")) != -1) switch (ch) { case 'H': Hflag = 1; @@ -105,6 +105,9 @@ main(int argc, char **argv) case 'v': vflag++; break; + case 'x': + xflag = 1; + break; case '?': default: usage(); @@ -128,6 +131,8 @@ main(int argc, char **argv) } } else fts_options = hflag ? FTS_PHYSICAL : FTS_LOGICAL; + if (xflag) + fts_options |= FTS_XDEV; uid = (uid_t)-1; gid = (gid_t)-1; @@ -301,11 +306,11 @@ usage(void) if (ischown) (void)fprintf(stderr, "%s\n%s\n", - "usage: chown [-fhv] [-R [-H | -L | -P]] owner[:group]" + "usage: chown [-fhvx] [-R [-H | -L | -P]] owner[:group]" " file ...", - " chown [-fhv] [-R [-H | -L | -P]] :group file ..."); + " chown [-fhvx] [-R [-H | -L | -P]] :group file ..."); else (void)fprintf(stderr, "%s\n", - "usage: chgrp [-fhv] [-R [-H | -L | -P]] group file ..."); + "usage: chgrp [-fhvx] [-R [-H | -L | -P]] group file ..."); exit(1); } From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 25 15:53:03 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 3A4E2106566C; Thu, 25 Mar 2010 15:53:03 +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 0EE948FC2F; Thu, 25 Mar 2010 15:53: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 o2PFr203067340; Thu, 25 Mar 2010 15:53:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2PFr2lg067337; Thu, 25 Mar 2010 15:53:02 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201003251553.o2PFr2lg067337@svn.freebsd.org> From: John Baldwin Date: Thu, 25 Mar 2010 15:53:02 +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: r205646 - 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: Thu, 25 Mar 2010 15:53:03 -0000 Author: jhb Date: Thu Mar 25 15:53:02 2010 New Revision: 205646 URL: http://svn.freebsd.org/changeset/base/205646 Log: MFC 205013: Print out the family and model from the cpu_id. This is especially useful given the advent of the extended family and extended model fields. The values are printed in hex to match their common usage in documentation. Modified: stable/7/sys/amd64/amd64/identcpu.c stable/7/sys/i386/i386/identcpu.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/identcpu.c ============================================================================== --- stable/7/sys/amd64/amd64/identcpu.c Thu Mar 25 15:48:23 2010 (r205645) +++ stable/7/sys/amd64/amd64/identcpu.c Thu Mar 25 15:53:02 2010 (r205646) @@ -186,7 +186,9 @@ printcpuinfo(void) if (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD || cpu_vendor_id == CPU_VENDOR_CENTAUR) { - printf(" Stepping = %u", cpu_id & 0xf); + printf(" Family = %x", CPUID_TO_FAMILY(cpu_id)); + printf(" Model = %x", CPUID_TO_MODEL(cpu_id)); + printf(" Stepping = %u", cpu_id & CPUID_STEPPING); if (cpu_high > 0) { u_int cmp = 1, htt = 1; Modified: stable/7/sys/i386/i386/identcpu.c ============================================================================== --- stable/7/sys/i386/i386/identcpu.c Thu Mar 25 15:48:23 2010 (r205645) +++ stable/7/sys/i386/i386/identcpu.c Thu Mar 25 15:53:02 2010 (r205646) @@ -672,9 +672,11 @@ printcpuinfo(void) cpu_vendor_id == CPU_VENDOR_NSC || (cpu_vendor_id == CPU_VENDOR_CYRIX && ((cpu_id & 0xf00) > 0x500))) { - printf(" Stepping = %u", cpu_id & 0xf); + printf(" Family = %x", CPUID_TO_FAMILY(cpu_id)); + printf(" Model = %x", CPUID_TO_MODEL(cpu_id)); + printf(" Stepping = %u", cpu_id & CPUID_STEPPING); if (cpu_vendor_id == CPU_VENDOR_CYRIX) - printf(" DIR=0x%04x", cyrix_did); + printf("\n DIR=0x%04x", cyrix_did); if (cpu_high > 0) { u_int cmp = 1, htt = 1; From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 25 16:31: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 BC8B5106566C; Thu, 25 Mar 2010 16:31:05 +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 AC3388FC22; Thu, 25 Mar 2010 16:31: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 o2PGV5jS075916; Thu, 25 Mar 2010 16:31:05 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2PGV52c075915; Thu, 25 Mar 2010 16:31:05 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201003251631.o2PGV52c075915@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 25 Mar 2010 16:31:05 +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: r205648 - stable/7/bin/ls 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, 25 Mar 2010 16:31:05 -0000 Author: jh Date: Thu Mar 25 16:31:05 2010 New Revision: 205648 URL: http://svn.freebsd.org/changeset/base/205648 Log: MFC r202944: Print full path in the error message. It's possible that fts(3) provides an empty fts_name and reporting the full path is more appropriate especially with the -R option. PR: bin/107515 Modified: stable/7/bin/ls/ls.c Directory Properties: stable/7/bin/ls/ (props changed) Modified: stable/7/bin/ls/ls.c ============================================================================== --- stable/7/bin/ls/ls.c Thu Mar 25 15:56:04 2010 (r205647) +++ stable/7/bin/ls/ls.c Thu Mar 25 16:31:05 2010 (r205648) @@ -504,7 +504,7 @@ traverse(int argc, char *argv[], int opt break; case FTS_DNR: case FTS_ERR: - warnx("%s: %s", p->fts_name, strerror(p->fts_errno)); + warnx("%s: %s", p->fts_path, strerror(p->fts_errno)); rval = 1; break; case FTS_D: From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 25 20:07:31 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 22C0A106566C; Thu, 25 Mar 2010 20:07:31 +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 108448FC18; Thu, 25 Mar 2010 20:07:31 +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 o2PK7Ub5024053; Thu, 25 Mar 2010 20:07:30 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2PK7UOQ024051; Thu, 25 Mar 2010 20:07:30 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201003252007.o2PK7UOQ024051@svn.freebsd.org> From: Xin LI Date: Thu, 25 Mar 2010 20:07: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: r205655 - in stable: 6/contrib/cpio/lib 7/contrib/cpio/lib 8/contrib/cpio/lib 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, 25 Mar 2010 20:07:31 -0000 Author: delphij Date: Thu Mar 25 20:07:30 2010 New Revision: 205655 URL: http://svn.freebsd.org/changeset/base/205655 Log: MFC r205654: The rmt client in GNU cpio could have a heap overflow when a malicious remote tape service returns deliberately crafted packets containing more data than requested. Fix this by checking the returned amount of data and bail out when it is more than what we requested. PR: gnu/145010 Submitted by: naddy Reviewed by: imp Security: CVE-2010-0624 Modified: stable/7/contrib/cpio/lib/rtapelib.c Directory Properties: stable/7/contrib/cpio/ (props changed) Changes in other areas also in this revision: Modified: stable/6/contrib/cpio/lib/rtapelib.c stable/8/contrib/cpio/lib/rtapelib.c Directory Properties: stable/6/contrib/cpio/ (props changed) stable/8/contrib/cpio/ (props changed) Modified: stable/7/contrib/cpio/lib/rtapelib.c ============================================================================== --- stable/7/contrib/cpio/lib/rtapelib.c Thu Mar 25 20:02:54 2010 (r205654) +++ stable/7/contrib/cpio/lib/rtapelib.c Thu Mar 25 20:07:30 2010 (r205655) @@ -570,7 +570,8 @@ rmt_read__ (int handle, char *buffer, si sprintf (command_buffer, "R%lu\n", (unsigned long) length); if (do_command (handle, command_buffer) == -1 - || (status = get_status (handle)) == SAFE_READ_ERROR) + || (status = get_status (handle)) == SAFE_READ_ERROR + || status > length) return SAFE_READ_ERROR; for (counter = 0; counter < status; counter += rlen, buffer += rlen) From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 26 00:05: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 9E77B1065673; Fri, 26 Mar 2010 00:05:42 +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 720B18FC1D; Fri, 26 Mar 2010 00:05: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 o2Q05gUq076509; Fri, 26 Mar 2010 00:05:42 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2Q05gHA076507; Fri, 26 Mar 2010 00:05:42 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201003260005.o2Q05gHA076507@svn.freebsd.org> From: Maxim Sobolev Date: Fri, 26 Mar 2010 00:05: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: r205658 - 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, 26 Mar 2010 00:05:42 -0000 Author: sobomax Date: Fri Mar 26 00:05:42 2010 New Revision: 205658 URL: http://svn.freebsd.org/changeset/base/205658 Log: MFC: workaround no-carrier issue on IBM HS21. PR: 118238 Modified: stable/7/sys/dev/mii/brgphy.c Directory Properties: stable/7/sys/dev/mii/ (props changed) Modified: stable/7/sys/dev/mii/brgphy.c ============================================================================== --- stable/7/sys/dev/mii/brgphy.c Thu Mar 25 23:38:10 2010 (r205657) +++ stable/7/sys/dev/mii/brgphy.c Fri Mar 26 00:05:42 2010 (r205658) @@ -72,8 +72,9 @@ struct brgphy_softc { int mii_model; int mii_rev; int serdes_flags; /* Keeps track of the serdes type used */ -#define BRGPHY_5706S 0x0001 -#define BRGPHY_5708S 0x0002 +#define BRGPHY_5706S 0x0001 +#define BRGPHY_5708S 0x0002 +#define BRGPHY_NOANWAIT 0x0004 int bce_phy_flags; /* PHY flags transferred from the MAC driver */ }; @@ -142,6 +143,23 @@ static const struct mii_phydesc brgphys[ MII_PHY_END }; +#define HS21_PRODUCT_ID "IBM eServer BladeCenter HS21" +#define HS21_BCM_CHIPID 0x57081021 + +static int +detect_hs21(struct bce_softc *bce_sc) +{ + char *sysenv; + + if (bce_sc->bce_chipid != HS21_BCM_CHIPID) + return (0); + sysenv = getenv("smbios.system.product"); + if (sysenv == NULL) + return (0); + if (strncmp(sysenv, HS21_PRODUCT_ID, strlen(HS21_PRODUCT_ID)) != 0) + return (0); + return (1); +} /* Search for our PHY in the list of known PHYs */ static int @@ -291,6 +309,19 @@ brgphy_attach(device_t dev) if (bce_sc && (bce_sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG)) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_2500_SX, IFM_FDX, sc->mii_inst), 0); printf("2500baseSX-FDX, "); + } else if ((bsc->serdes_flags & BRGPHY_5708S) && bce_sc && + (detect_hs21(bce_sc) != 0)) { + /* + * There appears to be certain silicon revision + * in IBM HS21 blades that is having issues with + * this driver wating for the auto-negotiation to + * complete. This happens with a specific chip id + * only and when the 1000baseSX-FDX is the only + * mode. Workaround this issue since it's unlikely + * to be ever addressed. + */ + printf("auto-neg workaround, "); + bsc->serdes_flags |= BRGPHY_NOANWAIT; } } @@ -532,7 +563,8 @@ brgphy_status(struct mii_softc *sc) /* Autoneg is still in progress. */ if ((bmcr & BRGPHY_BMCR_AUTOEN) && - (bmsr & BRGPHY_BMSR_ACOMP) == 0) { + (bmsr & BRGPHY_BMSR_ACOMP) == 0 && + (bsc->serdes_flags & BRGPHY_NOANWAIT) == 0) { /* Erg, still trying, I guess... */ mii->mii_media_active |= IFM_NONE; goto brgphy_status_exit; From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 26 12:53:47 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 520F2106564A; Fri, 26 Mar 2010 12:53:47 +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 2646E8FC0C; Fri, 26 Mar 2010 12:53:47 +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 o2QCrlnx050357; Fri, 26 Mar 2010 12:53:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QCrl50050356; Fri, 26 Mar 2010 12:53:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201003261253.o2QCrl50050356@svn.freebsd.org> From: John Baldwin Date: Fri, 26 Mar 2010 12:53:47 +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: r205685 - in stable/7/sys: . cddl/contrib/opensolaris contrib/dev/acpica contrib/pf 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, 26 Mar 2010 12:53:47 -0000 Author: jhb Date: Fri Mar 26 12:53:46 2010 New Revision: 205685 URL: http://svn.freebsd.org/changeset/base/205685 Log: Move mergeinfo for dev/mii up to sys. Modified: 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) stable/7/sys/dev/mii/ (props changed) From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 26 13:01: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 A94EF1065673; Fri, 26 Mar 2010 13:01:53 +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 97DD18FC22; Fri, 26 Mar 2010 13:01: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 o2QD1rIE052328; Fri, 26 Mar 2010 13:01:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QD1rR6052325; Fri, 26 Mar 2010 13:01:53 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201003261301.o2QD1rR6052325@svn.freebsd.org> From: John Baldwin Date: Fri, 26 Mar 2010 13:01: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: r205688 - in stable/7/sys: amd64/include 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: Fri, 26 Mar 2010 13:01:53 -0000 Author: jhb Date: Fri Mar 26 13:01:53 2010 New Revision: 205688 URL: http://svn.freebsd.org/changeset/base/205688 Log: MFC 205210,205448: Remove unneeded type specifiers from 64-bit constants. The compiler infers their natural type from the constants' values. Modified: stable/7/sys/amd64/include/specialreg.h stable/7/sys/i386/include/specialreg.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/amd64/include/specialreg.h ============================================================================== --- stable/7/sys/amd64/include/specialreg.h Fri Mar 26 13:01:30 2010 (r205687) +++ stable/7/sys/amd64/include/specialreg.h Fri Mar 26 13:01:53 2010 (r205688) @@ -313,16 +313,16 @@ #define MTRR_N64K 8 /* numbers of fixed-size entries */ #define MTRR_N16K 16 #define MTRR_N4K 64 -#define MTRR_CAP_WC 0x0000000000000400UL -#define MTRR_CAP_FIXED 0x0000000000000100UL -#define MTRR_CAP_VCNT 0x00000000000000ffUL -#define MTRR_DEF_ENABLE 0x0000000000000800UL -#define MTRR_DEF_FIXED_ENABLE 0x0000000000000400UL -#define MTRR_DEF_TYPE 0x00000000000000ffUL -#define MTRR_PHYSBASE_PHYSBASE 0x000ffffffffff000UL -#define MTRR_PHYSBASE_TYPE 0x00000000000000ffUL -#define MTRR_PHYSMASK_PHYSMASK 0x000ffffffffff000UL -#define MTRR_PHYSMASK_VALID 0x0000000000000800UL +#define MTRR_CAP_WC 0x0000000000000400 +#define MTRR_CAP_FIXED 0x0000000000000100 +#define MTRR_CAP_VCNT 0x00000000000000ff +#define MTRR_DEF_ENABLE 0x0000000000000800 +#define MTRR_DEF_FIXED_ENABLE 0x0000000000000400 +#define MTRR_DEF_TYPE 0x00000000000000ff +#define MTRR_PHYSBASE_PHYSBASE 0x000ffffffffff000 +#define MTRR_PHYSBASE_TYPE 0x00000000000000ff +#define MTRR_PHYSMASK_PHYSMASK 0x000ffffffffff000 +#define MTRR_PHYSMASK_VALID 0x0000000000000800 /* Performance Control Register (5x86 only). */ #define PCR0 0x20 @@ -350,22 +350,22 @@ #define MCG_STATUS_RIPV 0x00000001 #define MCG_STATUS_EIPV 0x00000002 #define MCG_STATUS_MCIP 0x00000004 -#define MCG_CTL_ENABLE 0xffffffffffffffffUL -#define MCG_CTL_DISABLE 0x0000000000000000UL +#define MCG_CTL_ENABLE 0xffffffffffffffff +#define MCG_CTL_DISABLE 0x0000000000000000 #define MSR_MC_CTL(x) (MSR_MC0_CTL + (x) * 4) #define MSR_MC_STATUS(x) (MSR_MC0_STATUS + (x) * 4) #define MSR_MC_ADDR(x) (MSR_MC0_ADDR + (x) * 4) #define MSR_MC_MISC(x) (MSR_MC0_MISC + (x) * 4) -#define MC_STATUS_MCA_ERROR 0x000000000000ffffUL -#define MC_STATUS_MODEL_ERROR 0x00000000ffff0000UL -#define MC_STATUS_OTHER_INFO 0x01ffffff00000000UL -#define MC_STATUS_PCC 0x0200000000000000UL -#define MC_STATUS_ADDRV 0x0400000000000000UL -#define MC_STATUS_MISCV 0x0800000000000000UL -#define MC_STATUS_EN 0x1000000000000000UL -#define MC_STATUS_UC 0x2000000000000000UL -#define MC_STATUS_OVER 0x4000000000000000UL -#define MC_STATUS_VAL 0x8000000000000000UL +#define MC_STATUS_MCA_ERROR 0x000000000000ffff +#define MC_STATUS_MODEL_ERROR 0x00000000ffff0000 +#define MC_STATUS_OTHER_INFO 0x01ffffff00000000 +#define MC_STATUS_PCC 0x0200000000000000 +#define MC_STATUS_ADDRV 0x0400000000000000 +#define MC_STATUS_MISCV 0x0800000000000000 +#define MC_STATUS_EN 0x1000000000000000 +#define MC_STATUS_UC 0x2000000000000000 +#define MC_STATUS_OVER 0x4000000000000000 +#define MC_STATUS_VAL 0x8000000000000000 /* * The following four 3-byte registers control the non-cacheable regions. Modified: stable/7/sys/i386/include/specialreg.h ============================================================================== --- stable/7/sys/i386/include/specialreg.h Fri Mar 26 13:01:30 2010 (r205687) +++ stable/7/sys/i386/include/specialreg.h Fri Mar 26 13:01:53 2010 (r205688) @@ -319,16 +319,16 @@ #define MTRR_N64K 8 /* numbers of fixed-size entries */ #define MTRR_N16K 16 #define MTRR_N4K 64 -#define MTRR_CAP_WC 0x0000000000000400ULL -#define MTRR_CAP_FIXED 0x0000000000000100ULL -#define MTRR_CAP_VCNT 0x00000000000000ffULL -#define MTRR_DEF_ENABLE 0x0000000000000800ULL -#define MTRR_DEF_FIXED_ENABLE 0x0000000000000400ULL -#define MTRR_DEF_TYPE 0x00000000000000ffULL -#define MTRR_PHYSBASE_PHYSBASE 0x000ffffffffff000ULL -#define MTRR_PHYSBASE_TYPE 0x00000000000000ffULL -#define MTRR_PHYSMASK_PHYSMASK 0x000ffffffffff000ULL -#define MTRR_PHYSMASK_VALID 0x0000000000000800ULL +#define MTRR_CAP_WC 0x0000000000000400 +#define MTRR_CAP_FIXED 0x0000000000000100 +#define MTRR_CAP_VCNT 0x00000000000000ff +#define MTRR_DEF_ENABLE 0x0000000000000800 +#define MTRR_DEF_FIXED_ENABLE 0x0000000000000400 +#define MTRR_DEF_TYPE 0x00000000000000ff +#define MTRR_PHYSBASE_PHYSBASE 0x000ffffffffff000 +#define MTRR_PHYSBASE_TYPE 0x00000000000000ff +#define MTRR_PHYSMASK_PHYSMASK 0x000ffffffffff000 +#define MTRR_PHYSMASK_VALID 0x0000000000000800 /* * Cyrix configuration registers, accessible as IO ports. @@ -419,22 +419,22 @@ #define MCG_STATUS_RIPV 0x00000001 #define MCG_STATUS_EIPV 0x00000002 #define MCG_STATUS_MCIP 0x00000004 -#define MCG_CTL_ENABLE 0xffffffffffffffffUL -#define MCG_CTL_DISABLE 0x0000000000000000UL +#define MCG_CTL_ENABLE 0xffffffffffffffff +#define MCG_CTL_DISABLE 0x0000000000000000 #define MSR_MC_CTL(x) (MSR_MC0_CTL + (x) * 4) #define MSR_MC_STATUS(x) (MSR_MC0_STATUS + (x) * 4) #define MSR_MC_ADDR(x) (MSR_MC0_ADDR + (x) * 4) #define MSR_MC_MISC(x) (MSR_MC0_MISC + (x) * 4) -#define MC_STATUS_MCA_ERROR 0x000000000000ffffUL -#define MC_STATUS_MODEL_ERROR 0x00000000ffff0000UL -#define MC_STATUS_OTHER_INFO 0x01ffffff00000000UL -#define MC_STATUS_PCC 0x0200000000000000UL -#define MC_STATUS_ADDRV 0x0400000000000000UL -#define MC_STATUS_MISCV 0x0800000000000000UL -#define MC_STATUS_EN 0x1000000000000000UL -#define MC_STATUS_UC 0x2000000000000000UL -#define MC_STATUS_OVER 0x4000000000000000UL -#define MC_STATUS_VAL 0x8000000000000000UL +#define MC_STATUS_MCA_ERROR 0x000000000000ffff +#define MC_STATUS_MODEL_ERROR 0x00000000ffff0000 +#define MC_STATUS_OTHER_INFO 0x01ffffff00000000 +#define MC_STATUS_PCC 0x0200000000000000 +#define MC_STATUS_ADDRV 0x0400000000000000 +#define MC_STATUS_MISCV 0x0800000000000000 +#define MC_STATUS_EN 0x1000000000000000 +#define MC_STATUS_UC 0x2000000000000000 +#define MC_STATUS_OVER 0x4000000000000000 +#define MC_STATUS_VAL 0x8000000000000000 /* * The following four 3-byte registers control the non-cacheable regions. From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 26 13:50: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 A3F5E1065677; Fri, 26 Mar 2010 13:50:19 +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 91DA48FC15; Fri, 26 Mar 2010 13:50:19 +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 o2QDoJOT063130; Fri, 26 Mar 2010 13:50:19 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QDoJHZ063123; Fri, 26 Mar 2010 13:50:19 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201003261350.o2QDoJHZ063123@svn.freebsd.org> From: John Baldwin Date: Fri, 26 Mar 2010 13:50:19 +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: r205690 - in stable/7/sys: amd64/amd64 amd64/include i386/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: Fri, 26 Mar 2010 13:50:19 -0000 Author: jhb Date: Fri Mar 26 13:50:19 2010 New Revision: 205690 URL: http://svn.freebsd.org/changeset/base/205690 Log: MFC 205214: - Extend the machine check record structure to include several fields useful for parsing model-specific and other fields in machine check events including the global machine check capabilities and status registers, CPU identification, and the FreeBSD CPU ID. - Report these added fields in the console log of a machine check so that a record structure can be reconstituted from the console messages. - Parse new architectural errors including memory controller errors. Modified: stable/7/sys/amd64/amd64/mca.c stable/7/sys/amd64/include/mca.h stable/7/sys/amd64/include/specialreg.h stable/7/sys/i386/i386/mca.c stable/7/sys/i386/include/mca.h stable/7/sys/i386/include/specialreg.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/amd64/amd64/mca.c ============================================================================== --- stable/7/sys/amd64/amd64/mca.c Fri Mar 26 13:49:46 2010 (r205689) +++ stable/7/sys/amd64/amd64/mca.c Fri Mar 26 13:50:19 2010 (r205690) @@ -177,19 +177,46 @@ mca_error_request(uint16_t mca_error) return ("???"); } +static const char * +mca_error_mmtype(uint16_t mca_error) +{ + + switch ((mca_error & 0x70) >> 4) { + case 0x0: + return ("GEN"); + case 0x1: + return ("RD"); + case 0x2: + return ("WR"); + case 0x3: + return ("AC"); + case 0x4: + return ("MS"); + } + return ("???"); +} + /* Dump details about a single machine check. */ static void __nonnull(1) mca_log(const struct mca_record *rec) { uint16_t mca_error; - printf("MCA: bank %d, status 0x%016llx\n", rec->mr_bank, + printf("MCA: Bank %d, Status 0x%016llx\n", rec->mr_bank, (long long)rec->mr_status); - printf("MCA: CPU %d ", rec->mr_apic_id); + printf("MCA: Global Cap 0x%016llx, Status 0x%016llx\n", + (long long)rec->mr_mcg_cap, (long long)rec->mr_mcg_status); + printf("MCA: Vendor \"%s\", ID 0x%x, APIC ID %d\n", cpu_vendor, + rec->mr_cpu_id, rec->mr_apic_id); + printf("MCA: CPU %d ", rec->mr_cpu); if (rec->mr_status & MC_STATUS_UC) printf("UNCOR "); - else + else { printf("COR "); + if (rec->mr_mcg_cap & MCG_CAP_TES_P) + printf("(%lld) ", ((long long)rec->mr_status & + MC_STATUS_COR_COUNT) >> 38); + } if (rec->mr_status & MC_STATUS_PCC) printf("PCC "); if (rec->mr_status & MC_STATUS_OVER) @@ -212,6 +239,9 @@ mca_log(const struct mca_record *rec) case 0x0004: printf("FRC error"); break; + case 0x0005: + printf("internal parity error"); + break; case 0x0400: printf("internal timer error"); break; @@ -236,6 +266,17 @@ mca_log(const struct mca_record *rec) break; } + /* Memory controller error. */ + if ((mca_error & 0xef80) == 0x0080) { + printf("%s channel ", mca_error_mmtype(mca_error)); + if ((mca_error & 0x000f) != 0x000f) + printf("%d", mca_error & 0x000f); + else + printf("??"); + printf(" memory error"); + break; + } + /* Cache error. */ if ((mca_error & 0xef00) == 0x0100) { printf("%sCACHE %s %s error", @@ -313,6 +354,11 @@ mca_check_status(int bank, struct mca_re rec->mr_misc = rdmsr(MSR_MC_MISC(bank)); rec->mr_tsc = rdtsc(); rec->mr_apic_id = PCPU_GET(apic_id); + rec->mr_mcg_cap = rdmsr(MSR_MCG_CAP); + rec->mr_mcg_status = rdmsr(MSR_MCG_STATUS); + rec->mr_cpu_id = cpu_id; + rec->mr_cpu_vendor_id = cpu_vendor_id; + rec->mr_cpu = PCPU_GET(cpuid); /* * Clear machine check. Don't do this for uncorrectable Modified: stable/7/sys/amd64/include/mca.h ============================================================================== --- stable/7/sys/amd64/include/mca.h Fri Mar 26 13:49:46 2010 (r205689) +++ stable/7/sys/amd64/include/mca.h Fri Mar 26 13:50:19 2010 (r205690) @@ -37,6 +37,11 @@ struct mca_record { uint64_t mr_tsc; int mr_apic_id; int mr_bank; + uint64_t mr_mcg_cap; + uint64_t mr_mcg_status; + int mr_cpu_id; + int mr_cpu_vendor_id; + int mr_cpu; }; #ifdef _KERNEL Modified: stable/7/sys/amd64/include/specialreg.h ============================================================================== --- stable/7/sys/amd64/include/specialreg.h Fri Mar 26 13:49:46 2010 (r205689) +++ stable/7/sys/amd64/include/specialreg.h Fri Mar 26 13:50:19 2010 (r205690) @@ -260,6 +260,7 @@ #define MSR_MTRR16kBase 0x258 #define MSR_MTRR4kBase 0x268 #define MSR_PAT 0x277 +#define MSR_MC0_CTL2 0x280 #define MSR_MTRRdefType 0x2ff #define MSR_MC0_CTL 0x400 #define MSR_MC0_STATUS 0x401 @@ -345,8 +346,10 @@ #define MCG_CAP_COUNT 0x000000ff #define MCG_CAP_CTL_P 0x00000100 #define MCG_CAP_EXT_P 0x00000200 +#define MCG_CAP_CMCI_P 0x00000400 #define MCG_CAP_TES_P 0x00000800 #define MCG_CAP_EXT_CNT 0x00ff0000 +#define MCG_CAP_SER_P 0x01000000 #define MCG_STATUS_RIPV 0x00000001 #define MCG_STATUS_EIPV 0x00000002 #define MCG_STATUS_MCIP 0x00000004 @@ -356,9 +359,14 @@ #define MSR_MC_STATUS(x) (MSR_MC0_STATUS + (x) * 4) #define MSR_MC_ADDR(x) (MSR_MC0_ADDR + (x) * 4) #define MSR_MC_MISC(x) (MSR_MC0_MISC + (x) * 4) +#define MSR_MC_CTL2(x) (MSR_MC0_CTL2 + (x)) /* If MCG_CAP_CMCI_P */ #define MC_STATUS_MCA_ERROR 0x000000000000ffff #define MC_STATUS_MODEL_ERROR 0x00000000ffff0000 #define MC_STATUS_OTHER_INFO 0x01ffffff00000000 +#define MC_STATUS_COR_COUNT 0x001fffc000000000 /* If MCG_CAP_TES_P */ +#define MC_STATUS_TES_STATUS 0x0060000000000000 /* If MCG_CAP_TES_P */ +#define MC_STATUS_AR 0x0080000000000000 /* If MCG_CAP_CMCI_P */ +#define MC_STATUS_S 0x0100000000000000 /* If MCG_CAP_CMCI_P */ #define MC_STATUS_PCC 0x0200000000000000 #define MC_STATUS_ADDRV 0x0400000000000000 #define MC_STATUS_MISCV 0x0800000000000000 @@ -366,6 +374,10 @@ #define MC_STATUS_UC 0x2000000000000000 #define MC_STATUS_OVER 0x4000000000000000 #define MC_STATUS_VAL 0x8000000000000000 +#define MC_MISC_RA_LSB 0x000000000000003f /* If MCG_CAP_SER_P */ +#define MC_MISC_ADDRESS_MODE 0x00000000000001c0 /* If MCG_CAP_SER_P */ +#define MC_CTL2_THRESHOLD 0x0000000000003fff +#define MC_CTL2_CMCI_EN 0x0000000040000000 /* * The following four 3-byte registers control the non-cacheable regions. Modified: stable/7/sys/i386/i386/mca.c ============================================================================== --- stable/7/sys/i386/i386/mca.c Fri Mar 26 13:49:46 2010 (r205689) +++ stable/7/sys/i386/i386/mca.c Fri Mar 26 13:50:19 2010 (r205690) @@ -177,19 +177,46 @@ mca_error_request(uint16_t mca_error) return ("???"); } +static const char * +mca_error_mmtype(uint16_t mca_error) +{ + + switch ((mca_error & 0x70) >> 4) { + case 0x0: + return ("GEN"); + case 0x1: + return ("RD"); + case 0x2: + return ("WR"); + case 0x3: + return ("AC"); + case 0x4: + return ("MS"); + } + return ("???"); +} + /* Dump details about a single machine check. */ static void __nonnull(1) mca_log(const struct mca_record *rec) { uint16_t mca_error; - printf("MCA: bank %d, status 0x%016llx\n", rec->mr_bank, + printf("MCA: Bank %d, Status 0x%016llx\n", rec->mr_bank, (long long)rec->mr_status); - printf("MCA: CPU %d ", rec->mr_apic_id); + printf("MCA: Global Cap 0x%016llx, Status 0x%016llx\n", + (long long)rec->mr_mcg_cap, (long long)rec->mr_mcg_status); + printf("MCA: Vendor \"%s\", ID 0x%x, APIC ID %d\n", cpu_vendor, + rec->mr_cpu_id, rec->mr_apic_id); + printf("MCA: CPU %d ", rec->mr_cpu); if (rec->mr_status & MC_STATUS_UC) printf("UNCOR "); - else + else { printf("COR "); + if (rec->mr_mcg_cap & MCG_CAP_TES_P) + printf("(%lld) ", ((long long)rec->mr_status & + MC_STATUS_COR_COUNT) >> 38); + } if (rec->mr_status & MC_STATUS_PCC) printf("PCC "); if (rec->mr_status & MC_STATUS_OVER) @@ -212,6 +239,9 @@ mca_log(const struct mca_record *rec) case 0x0004: printf("FRC error"); break; + case 0x0005: + printf("internal parity error"); + break; case 0x0400: printf("internal timer error"); break; @@ -236,6 +266,17 @@ mca_log(const struct mca_record *rec) break; } + /* Memory controller error. */ + if ((mca_error & 0xef80) == 0x0080) { + printf("%s channel ", mca_error_mmtype(mca_error)); + if ((mca_error & 0x000f) != 0x000f) + printf("%d", mca_error & 0x000f); + else + printf("??"); + printf(" memory error"); + break; + } + /* Cache error. */ if ((mca_error & 0xef00) == 0x0100) { printf("%sCACHE %s %s error", @@ -313,6 +354,11 @@ mca_check_status(int bank, struct mca_re rec->mr_misc = rdmsr(MSR_MC_MISC(bank)); rec->mr_tsc = rdtsc(); rec->mr_apic_id = PCPU_GET(apic_id); + rec->mr_mcg_cap = rdmsr(MSR_MCG_CAP); + rec->mr_mcg_status = rdmsr(MSR_MCG_STATUS); + rec->mr_cpu_id = cpu_id; + rec->mr_cpu_vendor_id = cpu_vendor_id; + rec->mr_cpu = PCPU_GET(cpuid); /* * Clear machine check. Don't do this for uncorrectable Modified: stable/7/sys/i386/include/mca.h ============================================================================== --- stable/7/sys/i386/include/mca.h Fri Mar 26 13:49:46 2010 (r205689) +++ stable/7/sys/i386/include/mca.h Fri Mar 26 13:50:19 2010 (r205690) @@ -37,6 +37,11 @@ struct mca_record { uint64_t mr_tsc; int mr_apic_id; int mr_bank; + uint64_t mr_mcg_cap; + uint64_t mr_mcg_status; + int mr_cpu_id; + int mr_cpu_vendor_id; + int mr_cpu; }; #ifdef _KERNEL Modified: stable/7/sys/i386/include/specialreg.h ============================================================================== --- stable/7/sys/i386/include/specialreg.h Fri Mar 26 13:49:46 2010 (r205689) +++ stable/7/sys/i386/include/specialreg.h Fri Mar 26 13:50:19 2010 (r205690) @@ -266,6 +266,7 @@ #define MSR_MTRR16kBase 0x258 #define MSR_MTRR4kBase 0x268 #define MSR_PAT 0x277 +#define MSR_MC0_CTL2 0x280 #define MSR_MTRRdefType 0x2ff #define MSR_MC0_CTL 0x400 #define MSR_MC0_STATUS 0x401 @@ -414,8 +415,10 @@ #define MCG_CAP_COUNT 0x000000ff #define MCG_CAP_CTL_P 0x00000100 #define MCG_CAP_EXT_P 0x00000200 +#define MCG_CAP_CMCI_P 0x00000400 #define MCG_CAP_TES_P 0x00000800 #define MCG_CAP_EXT_CNT 0x00ff0000 +#define MCG_CAP_SER_P 0x01000000 #define MCG_STATUS_RIPV 0x00000001 #define MCG_STATUS_EIPV 0x00000002 #define MCG_STATUS_MCIP 0x00000004 @@ -425,9 +428,14 @@ #define MSR_MC_STATUS(x) (MSR_MC0_STATUS + (x) * 4) #define MSR_MC_ADDR(x) (MSR_MC0_ADDR + (x) * 4) #define MSR_MC_MISC(x) (MSR_MC0_MISC + (x) * 4) +#define MSR_MC_CTL2(x) (MSR_MC0_CTL2 + (x)) /* If MCG_CAP_CMCI_P */ #define MC_STATUS_MCA_ERROR 0x000000000000ffff #define MC_STATUS_MODEL_ERROR 0x00000000ffff0000 #define MC_STATUS_OTHER_INFO 0x01ffffff00000000 +#define MC_STATUS_COR_COUNT 0x001fffc000000000 /* If MCG_CAP_TES_P */ +#define MC_STATUS_TES_STATUS 0x0060000000000000 /* If MCG_CAP_TES_P */ +#define MC_STATUS_AR 0x0080000000000000 /* If MCG_CAP_CMCI_P */ +#define MC_STATUS_S 0x0100000000000000 /* If MCG_CAP_CMCI_P */ #define MC_STATUS_PCC 0x0200000000000000 #define MC_STATUS_ADDRV 0x0400000000000000 #define MC_STATUS_MISCV 0x0800000000000000 @@ -435,6 +443,10 @@ #define MC_STATUS_UC 0x2000000000000000 #define MC_STATUS_OVER 0x4000000000000000 #define MC_STATUS_VAL 0x8000000000000000 +#define MC_MISC_RA_LSB 0x000000000000003f /* If MCG_CAP_SER_P */ +#define MC_MISC_ADDRESS_MODE 0x00000000000001c0 /* If MCG_CAP_SER_P */ +#define MC_CTL2_THRESHOLD 0x0000000000003fff +#define MC_CTL2_CMCI_EN 0x0000000040000000 /* * The following four 3-byte registers control the non-cacheable regions. From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 26 14:52: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 93A561065686; Fri, 26 Mar 2010 14:52:58 +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 682F68FC1F; Fri, 26 Mar 2010 14:52: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 o2QEqwDm077349; Fri, 26 Mar 2010 14:52:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QEqw86077348; Fri, 26 Mar 2010 14:52:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201003261452.o2QEqw86077348@svn.freebsd.org> From: John Baldwin Date: Fri, 26 Mar 2010 14:52:58 +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: r205697 - in stable/7/sys: . cddl/contrib/opensolaris contrib/dev/acpica contrib/pf 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, 26 Mar 2010 14:52:58 -0000 Author: jhb Date: Fri Mar 26 14:52:58 2010 New Revision: 205697 URL: http://svn.freebsd.org/changeset/base/205697 Log: Fixup earlier merge so that svn will ignore glimpse and cscope files on all of the kernel source tree rather than sys/sys/. Modified: 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) stable/7/sys/sys/ (props changed) From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 26 18:34: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 58053106566B; Fri, 26 Mar 2010 18:34:26 +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 2BAFA8FC14; Fri, 26 Mar 2010 18:34:26 +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 o2QIYQ6U026733; Fri, 26 Mar 2010 18:34:26 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QIYQp0026732; Fri, 26 Mar 2010 18:34:26 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201003261834.o2QIYQp0026732@svn.freebsd.org> From: John Baldwin Date: Fri, 26 Mar 2010 18:34:26 +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: r205704 - in stable/7/sys: . cddl/contrib/opensolaris contrib/dev/acpica contrib/pf 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, 26 Mar 2010 18:34:26 -0000 Author: jhb Date: Fri Mar 26 18:34:25 2010 New Revision: 205704 URL: http://svn.freebsd.org/changeset/base/205704 Log: Trim some broken mergeinfo. Modified: 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) From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 26 18:54:46 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 6DDCA1065676; Fri, 26 Mar 2010 18:54:46 +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 5C03F8FC17; Fri, 26 Mar 2010 18:54:46 +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 o2QIskc6031333; Fri, 26 Mar 2010 18:54:46 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QIskBX031329; Fri, 26 Mar 2010 18:54:46 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201003261854.o2QIskBX031329@svn.freebsd.org> From: John Baldwin Date: Fri, 26 Mar 2010 18:54:46 +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: r205707 - in stable/7/sys: conf i386/conf 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, 26 Mar 2010 18:54:46 -0000 Author: jhb Date: Fri Mar 26 18:54:46 2010 New Revision: 205707 URL: http://svn.freebsd.org/changeset/base/205707 Log: MFC 204972: Make NKPT a kernel option on i386 so that it can be set to a non-default value from kernel config files. Modified: stable/7/sys/conf/options.i386 stable/7/sys/i386/conf/NOTES stable/7/sys/i386/i386/mp_machdep.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/conf/options.i386 ============================================================================== --- stable/7/sys/conf/options.i386 Fri Mar 26 18:54:25 2010 (r205706) +++ stable/7/sys/conf/options.i386 Fri Mar 26 18:54:46 2010 (r205707) @@ -12,6 +12,7 @@ I586_PMC_GUPROF opt_i586_guprof.h MAXMEM MPTABLE_FORCE_HTT MP_WATCHDOG +NKPT opt_pmap.h PERFMON PMAP_SHPGPERPROC opt_pmap.h POWERFAIL_NMI opt_trap.h Modified: stable/7/sys/i386/conf/NOTES ============================================================================== --- stable/7/sys/i386/conf/NOTES Fri Mar 26 18:54:25 2010 (r205706) +++ stable/7/sys/i386/conf/NOTES Fri Mar 26 18:54:46 2010 (r205707) @@ -1140,6 +1140,15 @@ options PMAP_SHPGPERPROC=201 # options KVA_PAGES=260 +# +# Number of initial kernel page table pages used for early bootstrap. +# This number should include enough pages to map the kernel, any +# modules or other data loaded with the kernel by the loader, and data +# structures allocated before the VM system is initialized such as the +# vm_page_t array. Each page table page maps 4MB (2MB with PAE). +# +options NKPT=31 + ##################################################################### # ABI Emulation Modified: stable/7/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/7/sys/i386/i386/mp_machdep.c Fri Mar 26 18:54:25 2010 (r205706) +++ stable/7/sys/i386/i386/mp_machdep.c Fri Mar 26 18:54:46 2010 (r205707) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include "opt_cpu.h" #include "opt_kstack_pages.h" #include "opt_mp_watchdog.h" +#include "opt_pmap.h" #include "opt_sched.h" #include "opt_smp.h" From owner-svn-src-stable-7@FreeBSD.ORG Fri Mar 26 19:00:17 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 E094D106566B; Fri, 26 Mar 2010 19:00:17 +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 CE73A8FC12; Fri, 26 Mar 2010 19:00:17 +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 o2QJ0HB7032782; Fri, 26 Mar 2010 19:00:17 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2QJ0HTi032779; Fri, 26 Mar 2010 19:00:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201003261900.o2QJ0HTi032779@svn.freebsd.org> From: John Baldwin Date: Fri, 26 Mar 2010 19:00:17 +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: r205709 - in stable/7/sys: amd64/acpica i386/acpica 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, 26 Mar 2010 19:00:18 -0000 Author: jhb Date: Fri Mar 26 19:00:17 2010 New Revision: 205709 URL: http://svn.freebsd.org/changeset/base/205709 Log: MFC 205332: Use the same policy for rejecting / not-reject ACPI tables with incorrect checksums as the base acpi(4) driver. This fixes a problem where the MADT parser would reject the MADT table during early boot causing the MP Table to be, but then the acpi(4) driver would attach and use non-SMP interrupt routing. Modified: stable/7/sys/amd64/acpica/acpi_machdep.c stable/7/sys/i386/acpica/acpi_machdep.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/acpica/acpi_machdep.c ============================================================================== --- stable/7/sys/amd64/acpica/acpi_machdep.c Fri Mar 26 18:58:22 2010 (r205708) +++ stable/7/sys/amd64/acpica/acpi_machdep.c Fri Mar 26 19:00:17 2010 (r205709) @@ -156,8 +156,10 @@ map_table(vm_paddr_t pa, int offset, con if (ACPI_FAILURE(AcpiTbChecksum(table, length))) { if (bootverbose) printf("ACPI: Failed checksum for table %s\n", sig); +#if (ACPI_CHECKSUM_ABORT) table_unmap(table, length); return (NULL); +#endif } return (table); } Modified: stable/7/sys/i386/acpica/acpi_machdep.c ============================================================================== --- stable/7/sys/i386/acpica/acpi_machdep.c Fri Mar 26 18:58:22 2010 (r205708) +++ stable/7/sys/i386/acpica/acpi_machdep.c Fri Mar 26 19:00:17 2010 (r205709) @@ -634,8 +634,10 @@ map_table(vm_paddr_t pa, int offset, con if (ACPI_FAILURE(AcpiTbChecksum(table, length))) { if (bootverbose) printf("ACPI: Failed checksum for table %s\n", sig); +#if (ACPI_CHECKSUM_ABORT) table_unmap(table, length); return (NULL); +#endif } return (table); }