From owner-svn-src-stable-6@FreeBSD.ORG Mon Dec 1 19:29:48 2008 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1194C1065670; Mon, 1 Dec 2008 19:29:48 +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 ECFFF8FC1D; Mon, 1 Dec 2008 19:29:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB1JTlpd034990; Mon, 1 Dec 2008 19:29:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB1JTlol034989; Mon, 1 Dec 2008 19:29:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200812011929.mB1JTlol034989@svn.freebsd.org> From: John Baldwin Date: Mon, 1 Dec 2008 19:29:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185528 - stable/6/sys/kern X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2008 19:29:48 -0000 Author: jhb Date: Mon Dec 1 19:29:47 2008 New Revision: 185528 URL: http://svn.freebsd.org/changeset/base/185528 Log: Expand the scope of the 'aio_freeproc_mtx' lock to protect the aio data structures used in the socket upcall. This removes the need for Giant to be held for the aio socket upcall and thus the need for NET_NEEDS_GIANT() for AIO in 6.x. Note that this is not an MFC of the locking in 7.x+ as the AIO code in 7.x is substantially different from that in 6.x. Modified: stable/6/sys/kern/vfs_aio.c Modified: stable/6/sys/kern/vfs_aio.c ============================================================================== --- stable/6/sys/kern/vfs_aio.c Mon Dec 1 17:45:56 2008 (r185527) +++ stable/6/sys/kern/vfs_aio.c Mon Dec 1 19:29:47 2008 (r185528) @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include "opt_vfs_aio.h" -NET_NEEDS_GIANT("aio"); /* * Counter for allocating reference ids to new jobs. Wrapped to 1 on @@ -504,8 +503,10 @@ aio_free_entry(struct aiocblist *aiocbe) splx(s); } else if (aiocbe->jobstate == JOBST_JOBQGLOBAL) { s = splnet(); + mtx_lock(&aio_freeproc_mtx); TAILQ_REMOVE(&aio_jobs, aiocbe, list); TAILQ_REMOVE(&ki->kaio_jobqueue, aiocbe, plist); + mtx_unlock(&aio_freeproc_mtx); splx(s); } else if (aiocbe->jobstate == JOBST_JOBFINISHED) TAILQ_REMOVE(&ki->kaio_jobdone, aiocbe, plist); @@ -561,6 +562,7 @@ aio_proc_rundown(void *arg, struct proc * queues so they are cleaned up with any others. */ s = splnet(); + mtx_lock(&aio_freeproc_mtx); for (aiocbe = TAILQ_FIRST(&ki->kaio_sockqueue); aiocbe; aiocbe = aiocbn) { aiocbn = TAILQ_NEXT(aiocbe, plist); @@ -581,6 +583,7 @@ aio_proc_rundown(void *arg, struct proc TAILQ_INSERT_HEAD(&aio_jobs, aiocbe, list); TAILQ_INSERT_HEAD(&ki->kaio_jobqueue, aiocbe, plist); } + mtx_unlock(&aio_freeproc_mtx); splx(s); restart1: @@ -591,12 +594,14 @@ restart1: } restart2: - for (aiocbe = TAILQ_FIRST(&ki->kaio_jobqueue); aiocbe; aiocbe = - aiocbn) { - aiocbn = TAILQ_NEXT(aiocbe, plist); + mtx_lock(&aio_freeproc_mtx); + while ((aiocbe = TAILQ_FIRST(&ki->kaio_jobqueue)) != NULL) { + mtx_unlock(&aio_freeproc_mtx); if (aio_free_entry(aiocbe)) goto restart2; + mtx_lock(&aio_freeproc_mtx); } + mtx_unlock(&aio_freeproc_mtx); /* * Note the use of lots of splbio here, trying to avoid splbio for long chains @@ -627,11 +632,15 @@ restart4: * If we've slept, jobs might have moved from one queue to another. * Retry rundown if we didn't manage to empty the queues. */ + mtx_lock(&aio_freeproc_mtx); if (TAILQ_FIRST(&ki->kaio_jobdone) != NULL || TAILQ_FIRST(&ki->kaio_jobqueue) != NULL || TAILQ_FIRST(&ki->kaio_bufqueue) != NULL || - TAILQ_FIRST(&ki->kaio_bufdone) != NULL) + TAILQ_FIRST(&ki->kaio_bufdone) != NULL) { + mtx_unlock(&aio_freeproc_mtx); goto restart1; + } + mtx_unlock(&aio_freeproc_mtx); for (lj = TAILQ_FIRST(&ki->kaio_liojoblist); lj; lj = ljn) { ljn = TAILQ_NEXT(lj, lioj_list); @@ -667,6 +676,7 @@ aio_selectjob(struct aiothreadlist *aiop struct proc *userp; s = splnet(); + mtx_lock(&aio_freeproc_mtx); for (aiocbe = TAILQ_FIRST(&aio_jobs); aiocbe; aiocbe = TAILQ_NEXT(aiocbe, list)) { userp = aiocbe->userproc; @@ -674,10 +684,12 @@ aio_selectjob(struct aiothreadlist *aiop if (ki->kaio_active_count < ki->kaio_maxactive_count) { TAILQ_REMOVE(&aio_jobs, aiocbe, list); + mtx_unlock(&aio_freeproc_mtx); splx(s); return (aiocbe); } } + mtx_unlock(&aio_freeproc_mtx); splx(s); return (NULL); @@ -816,6 +828,7 @@ aio_daemon(void *uproc) */ wakeup(mycp); + mtx_lock(&aio_freeproc_mtx); for (;;) { /* * curcp is the current daemon process context. @@ -826,7 +839,6 @@ aio_daemon(void *uproc) /* * Take daemon off of free queue */ - mtx_lock(&aio_freeproc_mtx); if (aiop->aiothreadflags & AIOP_FREE) { TAILQ_REMOVE(&aio_freeproc, aiop, list); aiop->aiothreadflags &= ~AIOP_FREE; @@ -919,8 +931,10 @@ aio_daemon(void *uproc) aiocbe->jobstate = JOBST_JOBFINISHED; s = splnet(); + mtx_lock(&aio_freeproc_mtx); TAILQ_REMOVE(&ki->kaio_jobqueue, aiocbe, plist); TAILQ_INSERT_TAIL(&ki->kaio_jobdone, aiocbe, plist); + mtx_unlock(&aio_freeproc_mtx); splx(s); KNOTE_UNLOCKED(&aiocbe->klist, 0); @@ -968,11 +982,10 @@ aio_daemon(void *uproc) * If daemon is inactive for a long time, allow it to exit, * thereby freeing resources. */ - if (msleep(aiop->aiothread, &aio_freeproc_mtx, PDROP | PRIBIO, + if (msleep(aiop->aiothread, &aio_freeproc_mtx, PRIBIO, "aiordy", aiod_lifetime)) { s = splnet(); if (TAILQ_EMPTY(&aio_jobs)) { - mtx_lock(&aio_freeproc_mtx); if ((aiop->aiothreadflags & AIOP_FREE) && (num_aio_procs > target_aio_procs)) { TAILQ_REMOVE(&aio_freeproc, aiop, list); @@ -989,7 +1002,6 @@ aio_daemon(void *uproc) #endif kthread_exit(0); } - mtx_unlock(&aio_freeproc_mtx); } splx(s); } @@ -1229,6 +1241,7 @@ aio_swake_cb(struct socket *so, struct s SOCKBUF_UNLOCK(&so->so_rcv); } + mtx_lock(&aio_freeproc_mtx); for (cb = TAILQ_FIRST(&so->so_aiojobq); cb; cb = cbn) { cbn = TAILQ_NEXT(cb, list); if (opcode == cb->uaiocb.aio_lio_opcode) { @@ -1245,14 +1258,13 @@ aio_swake_cb(struct socket *so, struct s } while (wakecount--) { - mtx_lock(&aio_freeproc_mtx); if ((aiop = TAILQ_FIRST(&aio_freeproc)) != 0) { TAILQ_REMOVE(&aio_freeproc, aiop, list); aiop->aiothreadflags &= ~AIOP_FREE; wakeup(aiop->aiothread); } - mtx_unlock(&aio_freeproc_mtx); } + mtx_unlock(&aio_freeproc_mtx); } /* @@ -1420,6 +1432,7 @@ no_kqueue: */ so = fp->f_data; sb = (opcode == LIO_READ) ? &so->so_rcv : &so->so_snd; + mtx_lock(&aio_freeproc_mtx); SOCKBUF_LOCK(sb); s = splnet(); if (((opcode == LIO_READ) && (!soreadable(so))) || ((opcode == @@ -1431,11 +1444,13 @@ no_kqueue: ki->kaio_queue_count++; num_queue_count++; SOCKBUF_UNLOCK(sb); + mtx_unlock(&aio_freeproc_mtx); splx(s); error = 0; goto done; } SOCKBUF_UNLOCK(sb); + mtx_unlock(&aio_freeproc_mtx); splx(s); } @@ -1455,6 +1470,7 @@ no_kqueue: if (lj) lj->lioj_queue_count++; s = splnet(); + mtx_lock(&aio_freeproc_mtx); TAILQ_INSERT_TAIL(&ki->kaio_jobqueue, aiocbe, plist); TAILQ_INSERT_TAIL(&aio_jobs, aiocbe, list); splx(s); @@ -1470,7 +1486,6 @@ no_kqueue: * (thread) due to resource issues, we return an error for now (EAGAIN), * which is likely not the correct thing to do. */ - mtx_lock(&aio_freeproc_mtx); retryproc: if ((aiop = TAILQ_FIRST(&aio_freeproc)) != NULL) { TAILQ_REMOVE(&aio_freeproc, aiop, list); @@ -1728,6 +1743,7 @@ aio_cancel(struct thread *td, struct aio s = splnet(); + mtx_lock(&aio_freeproc_mtx); for (cbe = TAILQ_FIRST(&so->so_aiojobq); cbe; cbe = cbn) { cbn = TAILQ_NEXT(cbe, list); if ((uap->aiocbp == NULL) || @@ -1755,6 +1771,7 @@ aio_cancel(struct thread *td, struct aio break; } } + mtx_unlock(&aio_freeproc_mtx); splx(s); if ((cancelled) && (uap->aiocbp)) { @@ -1767,6 +1784,7 @@ aio_cancel(struct thread *td, struct aio goto done; s = splnet(); + mtx_lock(&aio_freeproc_mtx); for (cbe = TAILQ_FIRST(&ki->kaio_jobqueue); cbe; cbe = cbn) { cbn = TAILQ_NEXT(cbe, plist); @@ -1796,6 +1814,7 @@ aio_cancel(struct thread *td, struct aio } } } + mtx_unlock(&aio_freeproc_mtx); splx(s); done: if (notcancelled) { @@ -1833,11 +1852,13 @@ aio_error(struct thread *td, struct aio_ if ((jobref == -1) || (jobref == 0)) return (EINVAL); + mtx_lock(&aio_freeproc_mtx); PROC_LOCK(p); TAILQ_FOREACH(cb, &ki->kaio_jobdone, plist) { if (((intptr_t)cb->uaiocb._aiocb_private.kernelinfo) == jobref) { PROC_UNLOCK(p); + mtx_unlock(&aio_freeproc_mtx); td->td_retval[0] = cb->uaiocb._aiocb_private.error; return (0); } @@ -1850,6 +1871,7 @@ aio_error(struct thread *td, struct aio_ if (((intptr_t)cb->uaiocb._aiocb_private.kernelinfo) == jobref) { PROC_UNLOCK(p); + mtx_unlock(&aio_freeproc_mtx); td->td_retval[0] = EINPROGRESS; splx(s); return (0); @@ -1861,6 +1883,7 @@ aio_error(struct thread *td, struct aio_ if (((intptr_t)cb->uaiocb._aiocb_private.kernelinfo) == jobref) { PROC_UNLOCK(p); + mtx_unlock(&aio_freeproc_mtx); td->td_retval[0] = EINPROGRESS; splx(s); return (0); @@ -1874,6 +1897,7 @@ aio_error(struct thread *td, struct aio_ if (((intptr_t)cb->uaiocb._aiocb_private.kernelinfo) == jobref) { PROC_UNLOCK(p); + mtx_unlock(&aio_freeproc_mtx); td->td_retval[0] = cb->uaiocb._aiocb_private.error; splx(s); return (0); @@ -1885,6 +1909,7 @@ aio_error(struct thread *td, struct aio_ if (((intptr_t)cb->uaiocb._aiocb_private.kernelinfo) == jobref) { PROC_UNLOCK(p); + mtx_unlock(&aio_freeproc_mtx); td->td_retval[0] = EINPROGRESS; splx(s); return (0); @@ -1892,6 +1917,7 @@ aio_error(struct thread *td, struct aio_ } splx(s); PROC_UNLOCK(p); + mtx_unlock(&aio_freeproc_mtx); #if (0) /* From owner-svn-src-stable-6@FreeBSD.ORG Mon Dec 1 20:33:23 2008 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29A201065678; Mon, 1 Dec 2008 20:33:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12E5D8FC2A; Mon, 1 Dec 2008 20:33:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB1KXMgi036482; Mon, 1 Dec 2008 20:33:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB1KXMul036481; Mon, 1 Dec 2008 20:33:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200812012033.mB1KXMul036481@svn.freebsd.org> From: Marius Strobl Date: Mon, 1 Dec 2008 20:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185530 - stable/6/lib/libcam X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2008 20:33:23 -0000 Author: marius Date: Mon Dec 1 20:33:22 2008 New Revision: 185530 URL: http://svn.freebsd.org/changeset/base/185530 Log: MFC: r184379 Supply a valid Connect ID when issuing XPT_DEV_MATCH. PR: 127605 Modified: stable/6/lib/libcam/ (props changed) stable/6/lib/libcam/camlib.c Modified: stable/6/lib/libcam/camlib.c ============================================================================== --- stable/6/lib/libcam/camlib.c Mon Dec 1 20:16:56 2008 (r185529) +++ stable/6/lib/libcam/camlib.c Mon Dec 1 20:33:22 2008 (r185530) @@ -346,6 +346,9 @@ cam_open_btl(path_id_t path_id, target_i bzero(&ccb, sizeof(union ccb)); ccb.ccb_h.func_code = XPT_DEV_MATCH; + ccb.ccb_h.path_id = CAM_XPT_PATH_ID; + ccb.ccb_h.target_id = CAM_TARGET_WILDCARD; + ccb.ccb_h.target_lun = CAM_LUN_WILDCARD; /* Setup the result buffer */ bufsize = sizeof(struct dev_match_result); From owner-svn-src-stable-6@FreeBSD.ORG Fri Dec 5 17:44:27 2008 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 372EE1065670; Fri, 5 Dec 2008 17:44:27 +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 223768FC14; Fri, 5 Dec 2008 17:44:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB5HiRqU069057; Fri, 5 Dec 2008 17:44:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB5HiQrT069049; Fri, 5 Dec 2008 17:44:26 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200812051744.mB5HiQrT069049@svn.freebsd.org> From: John Baldwin Date: Fri, 5 Dec 2008 17:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185644 - in stable/6: share/man/man4 sys/amd64/conf sys/conf sys/dev/nfe sys/i386/conf sys/modules sys/modules/nfe X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2008 17:44:27 -0000 Author: jhb Date: Fri Dec 5 17:44:26 2008 New Revision: 185644 URL: http://svn.freebsd.org/changeset/base/185644 Log: MFC: Add the nfe(4) driver as an alternative to nve(4). To avoid astonishment, nve(4) takes precedence over nfe(4) in this branch. I have also not added it to GENERIC. Reviewed by: yongari (briefly) Added: stable/6/share/man/man4/nfe.4 - copied, changed from r159967, head/share/man/man4/nfe.4 stable/6/sys/dev/nfe/ stable/6/sys/dev/nfe/if_nfe.c (contents, props changed) stable/6/sys/dev/nfe/if_nfereg.h (contents, props changed) stable/6/sys/dev/nfe/if_nfevar.h (contents, props changed) stable/6/sys/modules/nfe/ stable/6/sys/modules/nfe/Makefile (contents, props changed) Modified: stable/6/share/man/man4/ (props changed) stable/6/share/man/man4/Makefile stable/6/share/man/man4/polling.4 stable/6/share/man/man4/xl.4 (props changed) stable/6/sys/amd64/conf/NOTES stable/6/sys/conf/files.amd64 stable/6/sys/conf/files.i386 stable/6/sys/i386/conf/NOTES stable/6/sys/modules/Makefile Modified: stable/6/share/man/man4/Makefile ============================================================================== --- stable/6/share/man/man4/Makefile Fri Dec 5 17:13:40 2008 (r185643) +++ stable/6/share/man/man4/Makefile Fri Dec 5 17:44:26 2008 (r185644) @@ -180,6 +180,7 @@ MAN= aac.4 \ ncv.4 \ netgraph.4 \ netintro.4 \ + ${_nfe.4} \ ${_nfsmb.4} \ ng_async.4 \ ng_atm.4 \ @@ -469,6 +470,7 @@ MLINKS+=mxge.4 if_mxge.4 MLINKS+=my.4 if_my.4 MLINKS+=netintro.4 net.4 \ netintro.4 networking.4 +MLINKS+=${_nfe.4} ${_if_nfe.4} MLINKS+=nge.4 if_nge.4 MLINKS+=${_nve.4} ${_if_nve.4} MLINKS+=oldcard.4 card.4 @@ -522,9 +524,11 @@ MLINKS+=watchdog.4 SW_WATCHDOG.4 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" _amdsmb.4= amdsmb.4 _coretemp.4= coretemp.4 +_if_nfe.4= if_nfe.4 _if_nve.4= if_nve.4 _ipmi.4= ipmi.4 _nfsmb.4= nfsmb.4 +_nfe.4= nfe.4 _nve.4= nve.4 _rr232x.4= rr232x.4 _spkr.4= spkr.4 Copied and modified: stable/6/share/man/man4/nfe.4 (from r159967, head/share/man/man4/nfe.4) ============================================================================== --- head/share/man/man4/nfe.4 Mon Jun 26 23:41:07 2006 (r159967, copy source) +++ stable/6/share/man/man4/nfe.4 Fri Dec 5 17:44:26 2008 (r185644) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 6, 2006 +.Dd October 2, 2008 .Dt NFE 4 .Os .Sh NAME @@ -28,7 +28,7 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device miibus" -.Cd "device nve" +.Cd "device nfe" .Ed .Pp Alternatively, to load the driver as a @@ -42,31 +42,139 @@ The .Nm driver supports PCI Ethernet adapters based on the NVIDIA nForce Media and Communications Processors (MCP), such as -the nForce, nForce 2, nForce 3, CK804, MCP04, MCP51 and MCP55 -Ethernet controller chips. +the nForce, nForce 2, nForce 3, CK804, MCP04, MCP51, MCP55, +MCP61, MCP65, MCP67, MCP73, MCP77 and MCP79 Ethernet +controller chips. +.Pp +Supported features include (hardware support provided): +.Pp +.Bl -bullet -compact +.It +Receive/Transmit IP/TCP/UDP checksum offload +.It +Hardware VLAN tag insertion/stripping +.It +TCP segmentation offload (TSO) +.It +MSI/MSI-X +.It +Jumbo Frames +.El +.Pp +Support for Jumbo Frames is provided via the interface MTU setting. +Selecting an MTU larger than 1500 bytes with the +.Xr ifconfig 8 +utility configures the adapter to receive and transmit Jumbo Frames. .Pp The .Nm -driver supports the following -.Ar media -types: -.Pp -.Bl -tag -width autoselect -compact +driver supports the following media types: +.Bl -tag -width "10baseT/UTP" .It Cm autoselect Enable autoselection of the media type and options. -.It Cm 10baseT +.It Cm 10baseT/UTP Set 10Mbps operation. .It Cm 100baseTX Set 100Mbps (Fast Ethernet) operation. .It Cm 1000baseT Set 1000Mbps (Gigabit Ethernet) operation (recent models only). .El +.Pp +The +.Nm +driver supports the following media options: +.Bl -tag -width ".Cm 10baseT/UTP" +.It Cm half-duplex +Force half duplex operation. +.It Cm full-duplex +Force full duplex operation. +.El +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +driver supports the following NVIDIA MCP onboard adapters: +.Pp +.Bl -bullet -compact +.It +NVIDIA nForce MCP Networking Adapter +.It +NVIDIA nForce MCP04 Networking Adapter +.It +NVIDIA nForce 430 MCP12 Networking Adapter +.It +NVIDIA nForce 430 MCP13 Networking Adapter +.It +NVIDIA nForce MCP51 Networking Adapter +.It +NVIDIA nForce MCP55 Networking Adapter +.It +NVIDIA nForce MCP61 Networking Adapter +.It +NVIDIA nForce MCP65 Networking Adapter +.It +NVIDIA nForce MCP67 Networking Adapter +.It +NVIDIA nForce MCP73 Networking Adapter +.It +NVIDIA nForce MCP77 Networking Adapter +.It +NVIDIA nForce MCP79 Networking Adapter +.It +NVIDIA nForce2 MCP2 Networking Adapter +.It +NVIDIA nForce2 400 MCP4 Networking Adapter +.It +NVIDIA nForce2 400 MCP5 Networking Adapter +.It +NVIDIA nForce3 MCP3 Networking Adapter +.It +NVIDIA nForce3 250 MCP6 Networking Adapter +.It +NVIDIA nForce3 MCP7 Networking Adapter +.It +NVIDIA nForce4 CK804 MCP8 Networking Adapter +.It +NVIDIA nForce4 CK804 MCP9 Networking Adapter +.El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width indent +.It Va hw.nfe.msi_disable +Whether or not MSI support is enabled in the driver. +The default value is 0. +.It Va hw.nfe.msix_disable +Whether or not MSI-X support is enabled in the driver. +The default value is 0. +.El +.Sh SYSCTL VARIABLES +The following +.Xr sysctl 8 +variables can be used to modify or monitor +.Nm +behavior. +.Bl -tag -width indent +.It Va dev.nfe.%d.process_limit +Maximum number of Rx events to be processed in the event loop +before rescheduling a taskqueue. +The accepted range is 50 to 255, the default value is 192. +The interface does not need to be brought down and up again +before a change takes effect. +.El .Sh SEE ALSO +.Xr altq 4 , .Xr arp 4 , .Xr intro 4 , .Xr miibus 4 , .Xr netintro 4 , .Xr pci 4 , +.Xr polling 4 , +.Xr sysctl 8 , .Xr ifconfig 8 .Sh HISTORY The @@ -74,7 +182,7 @@ The device driver first appeared in .Ox 3.9 , and then in -.Fx 6.0 . +.Fx 7.0 . .Sh AUTHORS .An -nosplit The @@ -92,5 +200,3 @@ driver was ported to by .An Shigeaki Tagashira .Aq shigeaki@se.hiroshima-u.ac.jp . -.Sh CAVEATS -NVIDIA refuse to release any documentation on their products. Modified: stable/6/share/man/man4/polling.4 ============================================================================== --- stable/6/share/man/man4/polling.4 Fri Dec 5 17:13:40 2008 (r185643) +++ stable/6/share/man/man4/polling.4 Fri Dec 5 17:44:26 2008 (r185644) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2006 +.Dd April 6, 2007 .Dt POLLING 4 .Os .Sh NAME @@ -184,6 +184,7 @@ As of this writing, the .Xr fwip 4 , .Xr fxp 4 , .Xr ixgb 4 , +.Xr nfe 4 , .Xr nge 4 , .Xr re 4 , .Xr rl 4 , Modified: stable/6/sys/amd64/conf/NOTES ============================================================================== --- stable/6/sys/amd64/conf/NOTES Fri Dec 5 17:13:40 2008 (r185643) +++ stable/6/sys/amd64/conf/NOTES Fri Dec 5 17:44:26 2008 (r185644) @@ -234,6 +234,7 @@ options DRM_DEBUG # Include debug print # lnc: Lance/PCnet cards (Isolan, Novell NE2100, NE32-VL, AMD Am7990 and # Am79C960) # mxge: Myricom Myri-10G 10GbE NIC +# nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) # nve: nVidia nForce MCP on-board Ethernet Networking #XXX# still calls MD i386 kvtop function instead of vtophys etc @@ -243,6 +244,7 @@ options DRM_DEBUG # Include debug print #XXX#options ED_SIC #XXX#device lnc device mxge # Myricom Myri-10G 10GbE NIC +device nfe # nVidia nForce MCP on-board Ethernet Networking device nve # nVidia nForce MCP on-board Ethernet Networking device ath Modified: stable/6/sys/conf/files.amd64 ============================================================================== --- stable/6/sys/conf/files.amd64 Fri Dec 5 17:13:40 2008 (r185643) +++ stable/6/sys/conf/files.amd64 Fri Dec 5 17:44:26 2008 (r185644) @@ -200,6 +200,7 @@ dev/mxge/mxge_ethp_z8e.c optional mxge p dev/mxge/mxge_rss_eth_z8e.c optional mxge pci dev/mxge/mxge_rss_ethp_z8e.c optional mxge pci net/zlib.c optional mxge +dev/nfe/if_nfe.c optional nfe pci dev/nve/if_nve.c optional nve pci dev/nvram/nvram.c optional nvram isa dev/rr232x/os_bsd.c optional rr232x Modified: stable/6/sys/conf/files.i386 ============================================================================== --- stable/6/sys/conf/files.i386 Fri Dec 5 17:13:40 2008 (r185643) +++ stable/6/sys/conf/files.i386 Fri Dec 5 17:44:26 2008 (r185644) @@ -234,6 +234,7 @@ dev/mxge/mxge_ethp_z8e.c optional mxge p dev/mxge/mxge_rss_eth_z8e.c optional mxge pci dev/mxge/mxge_rss_ethp_z8e.c optional mxge pci net/zlib.c optional mxge +dev/nfe/if_nfe.c optional nfe pci dev/nve/if_nve.c optional nve pci dev/nvram/nvram.c optional nvram isa dev/ppc/ppc.c optional ppc Added: stable/6/sys/dev/nfe/if_nfe.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/6/sys/dev/nfe/if_nfe.c Fri Dec 5 17:44:26 2008 (r185644) @@ -0,0 +1,2993 @@ +/* $OpenBSD: if_nfe.c,v 1.54 2006/04/07 12:38:12 jsg Exp $ */ + +/*- + * Copyright (c) 2006 Shigeaki Tagashira + * Copyright (c) 2006 Damien Bergamini + * Copyright (c) 2005, 2006 Jonathan Gray + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */ + +#include +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_device_polling.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +MODULE_DEPEND(nfe, pci, 1, 1, 1); +MODULE_DEPEND(nfe, ether, 1, 1, 1); +MODULE_DEPEND(nfe, miibus, 1, 1, 1); + +/* "device miibus" required. See GENERIC if you get errors here. */ +#include "miibus_if.h" + +static int nfe_probe(device_t); +static int nfe_attach(device_t); +static int nfe_detach(device_t); +static int nfe_suspend(device_t); +static int nfe_resume(device_t); +static int nfe_shutdown(device_t); +static void nfe_power(struct nfe_softc *); +static int nfe_miibus_readreg(device_t, int, int); +static int nfe_miibus_writereg(device_t, int, int, int); +static void nfe_miibus_statchg(device_t); +static void nfe_link_task(void *, int); +static void nfe_set_intr(struct nfe_softc *); +static __inline void nfe_enable_intr(struct nfe_softc *); +static __inline void nfe_disable_intr(struct nfe_softc *); +static int nfe_ioctl(struct ifnet *, u_long, caddr_t); +static void nfe_alloc_msix(struct nfe_softc *, int); +static void nfe_intr(void *); +static void nfe_int_task(void *, int); +static __inline void nfe_discard_rxbuf(struct nfe_softc *, int); +static __inline void nfe_discard_jrxbuf(struct nfe_softc *, int); +static int nfe_newbuf(struct nfe_softc *, int); +static int nfe_jnewbuf(struct nfe_softc *, int); +static int nfe_rxeof(struct nfe_softc *, int); +static int nfe_jrxeof(struct nfe_softc *, int); +static void nfe_txeof(struct nfe_softc *); +static int nfe_encap(struct nfe_softc *, struct mbuf **); +static void nfe_setmulti(struct nfe_softc *); +static void nfe_tx_task(void *, int); +static void nfe_start(struct ifnet *); +static void nfe_watchdog(struct ifnet *); +static void nfe_init(void *); +static void nfe_init_locked(void *); +static void nfe_stop(struct ifnet *); +static int nfe_alloc_rx_ring(struct nfe_softc *, struct nfe_rx_ring *); +static void nfe_alloc_jrx_ring(struct nfe_softc *, struct nfe_jrx_ring *); +static int nfe_init_rx_ring(struct nfe_softc *, struct nfe_rx_ring *); +static int nfe_init_jrx_ring(struct nfe_softc *, struct nfe_jrx_ring *); +static void nfe_free_rx_ring(struct nfe_softc *, struct nfe_rx_ring *); +static void nfe_free_jrx_ring(struct nfe_softc *, struct nfe_jrx_ring *); +static int nfe_alloc_tx_ring(struct nfe_softc *, struct nfe_tx_ring *); +static void nfe_init_tx_ring(struct nfe_softc *, struct nfe_tx_ring *); +static void nfe_free_tx_ring(struct nfe_softc *, struct nfe_tx_ring *); +static int nfe_ifmedia_upd(struct ifnet *); +static void nfe_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static void nfe_tick(void *); +static void nfe_get_macaddr(struct nfe_softc *, uint8_t *); +static void nfe_set_macaddr(struct nfe_softc *, uint8_t *); +static void nfe_dma_map_segs(void *, bus_dma_segment_t *, int, int); + +static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); +static int sysctl_hw_nfe_proc_limit(SYSCTL_HANDLER_ARGS); + +#ifdef NFE_DEBUG +static int nfedebug = 0; +#define DPRINTF(sc, ...) do { \ + if (nfedebug) \ + device_printf((sc)->nfe_dev, __VA_ARGS__); \ +} while (0) +#define DPRINTFN(sc, n, ...) do { \ + if (nfedebug >= (n)) \ + device_printf((sc)->nfe_dev, __VA_ARGS__); \ +} while (0) +#else +#define DPRINTF(sc, ...) +#define DPRINTFN(sc, n, ...) +#endif + +#define NFE_LOCK(_sc) mtx_lock(&(_sc)->nfe_mtx) +#define NFE_UNLOCK(_sc) mtx_unlock(&(_sc)->nfe_mtx) +#define NFE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->nfe_mtx, MA_OWNED) + +/* Tunables. */ +static int msi_disable = 0; +static int msix_disable = 0; +static int jumbo_disable = 0; +TUNABLE_INT("hw.nfe.msi_disable", &msi_disable); +TUNABLE_INT("hw.nfe.msix_disable", &msix_disable); +TUNABLE_INT("hw.nfe.jumbo_disable", &jumbo_disable); + +static device_method_t nfe_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, nfe_probe), + DEVMETHOD(device_attach, nfe_attach), + DEVMETHOD(device_detach, nfe_detach), + DEVMETHOD(device_suspend, nfe_suspend), + DEVMETHOD(device_resume, nfe_resume), + DEVMETHOD(device_shutdown, nfe_shutdown), + + /* bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_driver_added, bus_generic_driver_added), + + /* MII interface */ + DEVMETHOD(miibus_readreg, nfe_miibus_readreg), + DEVMETHOD(miibus_writereg, nfe_miibus_writereg), + DEVMETHOD(miibus_statchg, nfe_miibus_statchg), + + { NULL, NULL } +}; + +static driver_t nfe_driver = { + "nfe", + nfe_methods, + sizeof(struct nfe_softc) +}; + +static devclass_t nfe_devclass; + +DRIVER_MODULE(nfe, pci, nfe_driver, nfe_devclass, 0, 0); +DRIVER_MODULE(miibus, nfe, miibus_driver, miibus_devclass, 0, 0); + +static struct nfe_type nfe_devs[] = { + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_NFORCE_LAN, + "NVIDIA nForce MCP Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_NFORCE2_LAN, + "NVIDIA nForce2 MCP2 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_NFORCE2_400_LAN1, + "NVIDIA nForce2 400 MCP4 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_NFORCE2_400_LAN2, + "NVIDIA nForce2 400 MCP5 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_NFORCE3_LAN1, + "NVIDIA nForce3 MCP3 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_NFORCE3_250_LAN, + "NVIDIA nForce3 250 MCP6 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_NFORCE3_LAN4, + "NVIDIA nForce3 MCP7 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_NFORCE4_LAN1, + "NVIDIA nForce4 CK804 MCP8 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_NFORCE4_LAN2, + "NVIDIA nForce4 CK804 MCP9 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP04_LAN1, + "NVIDIA nForce MCP04 Networking Adapter"}, /* MCP10 */ + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP04_LAN2, + "NVIDIA nForce MCP04 Networking Adapter"}, /* MCP11 */ + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_NFORCE430_LAN1, + "NVIDIA nForce 430 MCP12 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_NFORCE430_LAN2, + "NVIDIA nForce 430 MCP13 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP55_LAN1, + "NVIDIA nForce MCP55 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP55_LAN2, + "NVIDIA nForce MCP55 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP61_LAN1, + "NVIDIA nForce MCP61 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP61_LAN2, + "NVIDIA nForce MCP61 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP61_LAN3, + "NVIDIA nForce MCP61 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP61_LAN4, + "NVIDIA nForce MCP61 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP65_LAN1, + "NVIDIA nForce MCP65 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP65_LAN2, + "NVIDIA nForce MCP65 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP65_LAN3, + "NVIDIA nForce MCP65 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP65_LAN4, + "NVIDIA nForce MCP65 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP67_LAN1, + "NVIDIA nForce MCP67 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP67_LAN2, + "NVIDIA nForce MCP67 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP67_LAN3, + "NVIDIA nForce MCP67 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP67_LAN4, + "NVIDIA nForce MCP67 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP73_LAN1, + "NVIDIA nForce MCP73 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP73_LAN2, + "NVIDIA nForce MCP73 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP73_LAN3, + "NVIDIA nForce MCP73 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP73_LAN4, + "NVIDIA nForce MCP73 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_LAN1, + "NVIDIA nForce MCP77 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_LAN2, + "NVIDIA nForce MCP77 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_LAN3, + "NVIDIA nForce MCP77 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_LAN4, + "NVIDIA nForce MCP77 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP79_LAN1, + "NVIDIA nForce MCP79 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP79_LAN2, + "NVIDIA nForce MCP79 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP79_LAN3, + "NVIDIA nForce MCP79 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP79_LAN4, + "NVIDIA nForce MCP79 Networking Adapter"}, + {0, 0, NULL} +}; + + +/* Probe for supported hardware ID's */ +static int +nfe_probe(device_t dev) +{ + struct nfe_type *t; + + t = nfe_devs; + /* Check for matching PCI DEVICE ID's */ + while (t->name != NULL) { + if ((pci_get_vendor(dev) == t->vid_id) && + (pci_get_device(dev) == t->dev_id)) { + device_set_desc(dev, t->name); + return (BUS_PROBE_LOW_PRIORITY); + } + t++; + } + + return (ENXIO); +} + +static void +nfe_alloc_msix(struct nfe_softc *sc, int count) +{ + int rid; + + rid = PCIR_BAR(2); + sc->nfe_msix_res = bus_alloc_resource_any(sc->nfe_dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + if (sc->nfe_msix_res == NULL) { + device_printf(sc->nfe_dev, + "couldn't allocate MSIX table resource\n"); + return; + } + rid = PCIR_BAR(3); + sc->nfe_msix_pba_res = bus_alloc_resource_any(sc->nfe_dev, + SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (sc->nfe_msix_pba_res == NULL) { + device_printf(sc->nfe_dev, + "couldn't allocate MSIX PBA resource\n"); + bus_release_resource(sc->nfe_dev, SYS_RES_MEMORY, PCIR_BAR(2), + sc->nfe_msix_res); + sc->nfe_msix_res = NULL; + return; + } + + if (pci_alloc_msix(sc->nfe_dev, &count) == 0) { + if (count == NFE_MSI_MESSAGES) { + if (bootverbose) + device_printf(sc->nfe_dev, + "Using %d MSIX messages\n", count); + sc->nfe_msix = 1; + } else { + if (bootverbose) + device_printf(sc->nfe_dev, + "couldn't allocate MSIX\n"); + pci_release_msi(sc->nfe_dev); + bus_release_resource(sc->nfe_dev, SYS_RES_MEMORY, + PCIR_BAR(3), sc->nfe_msix_pba_res); + bus_release_resource(sc->nfe_dev, SYS_RES_MEMORY, + PCIR_BAR(2), sc->nfe_msix_res); + sc->nfe_msix_pba_res = NULL; + sc->nfe_msix_res = NULL; + } + } +} + +static int +nfe_attach(device_t dev) +{ + struct nfe_softc *sc; + struct ifnet *ifp; + bus_addr_t dma_addr_max; + int error = 0, i, msic, reg, rid; + + sc = device_get_softc(dev); + sc->nfe_dev = dev; + + mtx_init(&sc->nfe_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF); + callout_init_mtx(&sc->nfe_stat_ch, &sc->nfe_mtx, 0); + TASK_INIT(&sc->nfe_link_task, 0, nfe_link_task, sc); + + pci_enable_busmaster(dev); + + rid = PCIR_BAR(0); + sc->nfe_res[0] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->nfe_res[0] == NULL) { + device_printf(dev, "couldn't map memory resources\n"); + mtx_destroy(&sc->nfe_mtx); + return (ENXIO); + } + + if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) { + uint16_t v, width; + + v = pci_read_config(dev, reg + 0x08, 2); + /* Change max. read request size to 4096. */ + v &= ~(7 << 12); + v |= (5 << 12); + pci_write_config(dev, reg + 0x08, v, 2); + + v = pci_read_config(dev, reg + 0x0c, 2); + /* link capability */ + v = (v >> 4) & 0x0f; + width = pci_read_config(dev, reg + 0x12, 2); + /* negotiated link width */ + width = (width >> 4) & 0x3f; + if (v != width) + device_printf(sc->nfe_dev, + "warning, negotiated width of link(x%d) != " + "max. width of link(x%d)\n", width, v); + } + + /* Allocate interrupt */ + if (msix_disable == 0 || msi_disable == 0) { + if (msix_disable == 0 && + (msic = pci_msix_count(dev)) == NFE_MSI_MESSAGES) + nfe_alloc_msix(sc, msic); + if (msi_disable == 0 && sc->nfe_msix == 0 && + (msic = pci_msi_count(dev)) == NFE_MSI_MESSAGES && + pci_alloc_msi(dev, &msic) == 0) { + if (msic == NFE_MSI_MESSAGES) { + if (bootverbose) + device_printf(dev, + "Using %d MSI messages\n", msic); + sc->nfe_msi = 1; + } else + pci_release_msi(dev); + } + } + + if (sc->nfe_msix == 0 && sc->nfe_msi == 0) { + rid = 0; + sc->nfe_irq[0] = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); + if (sc->nfe_irq[0] == NULL) { + device_printf(dev, "couldn't allocate IRQ resources\n"); + error = ENXIO; + goto fail; + } + } else { + for (i = 0, rid = 1; i < NFE_MSI_MESSAGES; i++, rid++) { + sc->nfe_irq[i] = bus_alloc_resource_any(dev, + SYS_RES_IRQ, &rid, RF_ACTIVE); + if (sc->nfe_irq[i] == NULL) { + device_printf(dev, + "couldn't allocate IRQ resources for " + "message %d\n", rid); + error = ENXIO; + goto fail; + } + } + /* Map interrupts to vector 0. */ + if (sc->nfe_msix != 0) { + NFE_WRITE(sc, NFE_MSIX_MAP0, 0); + NFE_WRITE(sc, NFE_MSIX_MAP1, 0); + } else if (sc->nfe_msi != 0) { + NFE_WRITE(sc, NFE_MSI_MAP0, 0); + NFE_WRITE(sc, NFE_MSI_MAP1, 0); + } + } + + /* Set IRQ status/mask register. */ + sc->nfe_irq_status = NFE_IRQ_STATUS; + sc->nfe_irq_mask = NFE_IRQ_MASK; + sc->nfe_intrs = NFE_IRQ_WANTED; + sc->nfe_nointrs = 0; + if (sc->nfe_msix != 0) { + sc->nfe_irq_status = NFE_MSIX_IRQ_STATUS; + sc->nfe_nointrs = NFE_IRQ_WANTED; + } else if (sc->nfe_msi != 0) { + sc->nfe_irq_mask = NFE_MSI_IRQ_MASK; + sc->nfe_intrs = NFE_MSI_VECTOR_0_ENABLED; + } + + sc->nfe_devid = pci_get_device(dev); + sc->nfe_revid = pci_get_revid(dev); + sc->nfe_flags = 0; + + switch (sc->nfe_devid) { + case PCI_PRODUCT_NVIDIA_NFORCE3_LAN2: + case PCI_PRODUCT_NVIDIA_NFORCE3_LAN3: + case PCI_PRODUCT_NVIDIA_NFORCE3_LAN4: + case PCI_PRODUCT_NVIDIA_NFORCE3_LAN5: + sc->nfe_flags |= NFE_JUMBO_SUP | NFE_HW_CSUM; + break; + case PCI_PRODUCT_NVIDIA_MCP51_LAN1: + case PCI_PRODUCT_NVIDIA_MCP51_LAN2: + sc->nfe_flags |= NFE_40BIT_ADDR | NFE_PWR_MGMT; + break; + case PCI_PRODUCT_NVIDIA_CK804_LAN1: + case PCI_PRODUCT_NVIDIA_CK804_LAN2: + case PCI_PRODUCT_NVIDIA_MCP04_LAN1: + case PCI_PRODUCT_NVIDIA_MCP04_LAN2: + sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM; + break; + case PCI_PRODUCT_NVIDIA_MCP55_LAN1: + case PCI_PRODUCT_NVIDIA_MCP55_LAN2: + sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM | + NFE_HW_VLAN | NFE_PWR_MGMT | NFE_TX_FLOW_CTRL; + break; + + case PCI_PRODUCT_NVIDIA_MCP61_LAN1: + case PCI_PRODUCT_NVIDIA_MCP61_LAN2: + case PCI_PRODUCT_NVIDIA_MCP61_LAN3: + case PCI_PRODUCT_NVIDIA_MCP61_LAN4: + case PCI_PRODUCT_NVIDIA_MCP67_LAN1: + case PCI_PRODUCT_NVIDIA_MCP67_LAN2: + case PCI_PRODUCT_NVIDIA_MCP67_LAN3: + case PCI_PRODUCT_NVIDIA_MCP67_LAN4: + case PCI_PRODUCT_NVIDIA_MCP73_LAN1: + case PCI_PRODUCT_NVIDIA_MCP73_LAN2: + case PCI_PRODUCT_NVIDIA_MCP73_LAN3: + case PCI_PRODUCT_NVIDIA_MCP73_LAN4: + sc->nfe_flags |= NFE_40BIT_ADDR | NFE_PWR_MGMT | + NFE_CORRECT_MACADDR | NFE_TX_FLOW_CTRL; + break; + case PCI_PRODUCT_NVIDIA_MCP77_LAN1: + case PCI_PRODUCT_NVIDIA_MCP77_LAN2: + case PCI_PRODUCT_NVIDIA_MCP77_LAN3: + case PCI_PRODUCT_NVIDIA_MCP77_LAN4: + /* XXX flow control */ + sc->nfe_flags |= NFE_40BIT_ADDR | NFE_HW_CSUM | NFE_PWR_MGMT | + NFE_CORRECT_MACADDR; + break; + case PCI_PRODUCT_NVIDIA_MCP79_LAN1: + case PCI_PRODUCT_NVIDIA_MCP79_LAN2: + case PCI_PRODUCT_NVIDIA_MCP79_LAN3: + case PCI_PRODUCT_NVIDIA_MCP79_LAN4: + /* XXX flow control */ + sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM | + NFE_PWR_MGMT | NFE_CORRECT_MACADDR; + break; + case PCI_PRODUCT_NVIDIA_MCP65_LAN1: + case PCI_PRODUCT_NVIDIA_MCP65_LAN2: + case PCI_PRODUCT_NVIDIA_MCP65_LAN3: + case PCI_PRODUCT_NVIDIA_MCP65_LAN4: + sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | + NFE_PWR_MGMT | NFE_CORRECT_MACADDR | NFE_TX_FLOW_CTRL; + break; + } + + nfe_power(sc); + /* Check for reversed ethernet address */ + if ((NFE_READ(sc, NFE_TX_UNK) & NFE_MAC_ADDR_INORDER) != 0) + sc->nfe_flags |= NFE_CORRECT_MACADDR; + nfe_get_macaddr(sc, sc->eaddr); + /* + * Allocate the parent bus DMA tag appropriate for PCI. + */ + dma_addr_max = BUS_SPACE_MAXADDR_32BIT; + if ((sc->nfe_flags & NFE_40BIT_ADDR) != 0) + dma_addr_max = NFE_DMA_MAXADDR; + error = bus_dma_tag_create( + bus_get_dma_tag(sc->nfe_dev), /* parent */ + 1, 0, /* alignment, boundary */ + dma_addr_max, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, 0, /* maxsize, nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->nfe_parent_tag); + if (error) + goto fail; + + ifp = sc->nfe_ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + device_printf(dev, "can not if_alloc()\n"); + error = ENOSPC; + goto fail; + } + TASK_INIT(&sc->nfe_tx_task, 1, nfe_tx_task, ifp); + + /* + * Allocate Tx and Rx rings. + */ + if ((error = nfe_alloc_tx_ring(sc, &sc->txq)) != 0) + goto fail; + + if ((error = nfe_alloc_rx_ring(sc, &sc->rxq)) != 0) + goto fail; + + nfe_alloc_jrx_ring(sc, &sc->jrxq); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "process_limit", CTLTYPE_INT | CTLFLAG_RW, + &sc->nfe_process_limit, 0, sysctl_hw_nfe_proc_limit, "I", + "max number of Rx events to process"); + + sc->nfe_process_limit = NFE_PROC_DEFAULT; + error = resource_int_value(device_get_name(dev), device_get_unit(dev), + "process_limit", &sc->nfe_process_limit); + if (error == 0) { + if (sc->nfe_process_limit < NFE_PROC_MIN || + sc->nfe_process_limit > NFE_PROC_MAX) { + device_printf(dev, "process_limit value out of range; " + "using default: %d\n", NFE_PROC_DEFAULT); + sc->nfe_process_limit = NFE_PROC_DEFAULT; + } + } + + ifp->if_softc = sc; + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); + ifp->if_mtu = ETHERMTU; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_ioctl = nfe_ioctl; + ifp->if_start = nfe_start; + ifp->if_hwassist = 0; + ifp->if_capabilities = 0; + ifp->if_watchdog = NULL; + ifp->if_init = nfe_init; + IFQ_SET_MAXLEN(&ifp->if_snd, NFE_TX_RING_COUNT - 1); + ifp->if_snd.ifq_drv_maxlen = NFE_TX_RING_COUNT - 1; + IFQ_SET_READY(&ifp->if_snd); + + if (sc->nfe_flags & NFE_HW_CSUM) { + ifp->if_capabilities |= IFCAP_HWCSUM; + ifp->if_hwassist |= NFE_CSUM_FEATURES; + } + ifp->if_capenable = ifp->if_capabilities; + + sc->nfe_framesize = ifp->if_mtu + NFE_RX_HEADERS; + /* VLAN capability setup. */ + ifp->if_capabilities |= IFCAP_VLAN_MTU; + if ((sc->nfe_flags & NFE_HW_VLAN) != 0) { + ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING; + } + ifp->if_capenable = ifp->if_capabilities; + + /* + * Tell the upper layer(s) we support long frames. + * Must appear after the call to ether_ifattach() because + * ether_ifattach() sets ifi_hdrlen to the default value. + */ + ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); + +#ifdef DEVICE_POLLING + ifp->if_capabilities |= IFCAP_POLLING; +#endif + + /* Do MII setup */ + if (mii_phy_probe(dev, &sc->nfe_miibus, nfe_ifmedia_upd, + nfe_ifmedia_sts)) { + device_printf(dev, "MII without any phy!\n"); + error = ENXIO; + goto fail; + } + ether_ifattach(ifp, sc->eaddr); + + TASK_INIT(&sc->nfe_int_task, 0, nfe_int_task, sc); + sc->nfe_tq = taskqueue_create_fast("nfe_taskq", M_WAITOK, + taskqueue_thread_enqueue, &sc->nfe_tq); + taskqueue_start_threads(&sc->nfe_tq, 1, PI_NET, "%s taskq", + device_get_nameunit(sc->nfe_dev)); + error = 0; + if (sc->nfe_msi == 0 && sc->nfe_msix == 0) { + error = bus_setup_intr(dev, sc->nfe_irq[0], + INTR_TYPE_NET | INTR_FAST, nfe_intr, sc, + &sc->nfe_intrhand[0]); + } else { + for (i = 0; i < NFE_MSI_MESSAGES; i++) { + error = bus_setup_intr(dev, sc->nfe_irq[i], + INTR_TYPE_NET | INTR_FAST, nfe_intr, sc, + &sc->nfe_intrhand[i]); + if (error != 0) + break; + } + } + if (error) { + device_printf(dev, "couldn't set up irq\n"); + taskqueue_free(sc->nfe_tq); + sc->nfe_tq = NULL; + ether_ifdetach(ifp); + goto fail; + } + +fail: + if (error) + nfe_detach(dev); + + return (error); +} + + +static int +nfe_detach(device_t dev) +{ + struct nfe_softc *sc; + struct ifnet *ifp; + uint8_t eaddr[ETHER_ADDR_LEN]; + int i, rid; + + sc = device_get_softc(dev); + KASSERT(mtx_initialized(&sc->nfe_mtx), ("nfe mutex not initialized")); + ifp = sc->nfe_ifp; + +#ifdef DEVICE_POLLING + if (ifp != NULL && ifp->if_capenable & IFCAP_POLLING) + ether_poll_deregister(ifp); +#endif + if (device_is_attached(dev)) { + NFE_LOCK(sc); + nfe_stop(ifp); + ifp->if_flags &= ~IFF_UP; + NFE_UNLOCK(sc); + callout_drain(&sc->nfe_stat_ch); + taskqueue_drain(taskqueue_fast, &sc->nfe_tx_task); + taskqueue_drain(taskqueue_swi, &sc->nfe_link_task); + ether_ifdetach(ifp); + } + + if (ifp) { + /* restore ethernet address */ + if ((sc->nfe_flags & NFE_CORRECT_MACADDR) == 0) { + for (i = 0; i < ETHER_ADDR_LEN; i++) { + eaddr[i] = sc->eaddr[5 - i]; + } + } else + bcopy(sc->eaddr, eaddr, ETHER_ADDR_LEN); + nfe_set_macaddr(sc, eaddr); + if_free(ifp); + } + if (sc->nfe_miibus) + device_delete_child(dev, sc->nfe_miibus); + bus_generic_detach(dev); + if (sc->nfe_tq != NULL) { + taskqueue_drain(sc->nfe_tq, &sc->nfe_int_task); + taskqueue_free(sc->nfe_tq); + sc->nfe_tq = NULL; + } + + for (i = 0; i < NFE_MSI_MESSAGES; i++) { + if (sc->nfe_intrhand[i] != NULL) { + bus_teardown_intr(dev, sc->nfe_irq[i], + sc->nfe_intrhand[i]); + sc->nfe_intrhand[i] = NULL; + } + } + + if (sc->nfe_msi == 0 && sc->nfe_msix == 0) { + if (sc->nfe_irq[0] != NULL) + bus_release_resource(dev, SYS_RES_IRQ, 0, + sc->nfe_irq[0]); + } else { + for (i = 0, rid = 1; i < NFE_MSI_MESSAGES; i++, rid++) { + if (sc->nfe_irq[i] != NULL) { + bus_release_resource(dev, SYS_RES_IRQ, rid, + sc->nfe_irq[i]); + sc->nfe_irq[i] = NULL; + } + } + pci_release_msi(dev); + } + if (sc->nfe_msix_pba_res != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(3), + sc->nfe_msix_pba_res); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-6@FreeBSD.ORG Fri Dec 5 19:53:12 2008 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1E1F106564A; Fri, 5 Dec 2008 19:53:12 +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 BFE7C8FC14; Fri, 5 Dec 2008 19:53:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB5JrCkB071499; Fri, 5 Dec 2008 19:53:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB5JrCmP071495; Fri, 5 Dec 2008 19:53:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200812051953.mB5JrCmP071495@svn.freebsd.org> From: John Baldwin Date: Fri, 5 Dec 2008 19:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185645 - in stable/6/sys: . dev/mii X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2008 19:53:13 -0000 Author: jhb Date: Fri Dec 5 19:53:12 2008 New Revision: 185645 URL: http://svn.freebsd.org/changeset/base/185645 Log: MFC: Support for the IC Plus IP101 10/100 PHY and Vitesse VSC8601 PHY that are found on some nvidia parts. Suggested by: yongari Modified: stable/6/sys/ (props changed) stable/6/sys/dev/mii/ciphy.c stable/6/sys/dev/mii/ciphyreg.h stable/6/sys/dev/mii/miidevs stable/6/sys/dev/mii/rlphy.c Modified: stable/6/sys/dev/mii/ciphy.c ============================================================================== --- stable/6/sys/dev/mii/ciphy.c Fri Dec 5 17:44:26 2008 (r185644) +++ stable/6/sys/dev/mii/ciphy.c Fri Dec 5 19:53:12 2008 (r185645) @@ -93,6 +93,7 @@ static const struct mii_phydesc ciphys[] MII_PHY_DESC(CICADA, CS8201), MII_PHY_DESC(CICADA, CS8201A), MII_PHY_DESC(CICADA, CS8201B), + MII_PHY_DESC(VITESSE, VSC8601), MII_PHY_END }; @@ -356,11 +357,28 @@ ciphy_fixup(struct mii_softc *sc) { uint16_t model; uint16_t status, speed; + uint16_t val; model = MII_MODEL(PHY_READ(sc, CIPHY_MII_PHYIDR2)); status = PHY_READ(sc, CIPHY_MII_AUXCSR); speed = status & CIPHY_AUXCSR_SPEED; + if (strcmp(device_get_name(device_get_parent(sc->mii_dev)), + "nfe") == 0) { + /* need to set for 2.5V RGMII for NVIDIA adapters */ + val = PHY_READ(sc, CIPHY_MII_ECTL1); + val &= ~(CIPHY_ECTL1_IOVOL | CIPHY_ECTL1_INTSEL); + val |= (CIPHY_IOVOL_2500MV | CIPHY_INTSEL_RGMII); + PHY_WRITE(sc, CIPHY_MII_ECTL1, val); + /* From Linux. */ + val = PHY_READ(sc, CIPHY_MII_AUXCSR); + val |= CIPHY_AUXCSR_MDPPS; + PHY_WRITE(sc, CIPHY_MII_AUXCSR, val); + val = PHY_READ(sc, CIPHY_MII_10BTCSR); + val |= CIPHY_10BTCSR_ECHO; + PHY_WRITE(sc, CIPHY_MII_10BTCSR, val); + } + switch (model) { case MII_MODEL_CICADA_CS8201: @@ -398,6 +416,8 @@ ciphy_fixup(struct mii_softc *sc) } break; + case MII_MODEL_VITESSE_VSC8601: + break; default: device_printf(sc->mii_dev, "unknown CICADA PHY model %x\n", model); Modified: stable/6/sys/dev/mii/ciphyreg.h ============================================================================== --- stable/6/sys/dev/mii/ciphyreg.h Fri Dec 5 17:44:26 2008 (r185644) +++ stable/6/sys/dev/mii/ciphyreg.h Fri Dec 5 19:53:12 2008 (r185645) @@ -251,6 +251,16 @@ /* Extended PHY control register #1 */ #define CIPHY_MII_ECTL1 0x17 #define CIPHY_ECTL1_ACTIPHY 0x0020 /* Enable ActiPHY power saving */ +#define CIPHY_ECTL1_IOVOL 0x0e00 /* MAC interface and I/O voltage select */ +#define CIPHY_ECTL1_INTSEL 0xf000 /* select MAC interface */ + +#define CIPHY_IOVOL_3300MV 0x0000 /* 3.3V for I/O pins */ +#define CIPHY_IOVOL_2500MV 0x0200 /* 2.5V for I/O pins */ + +#define CIPHY_INTSEL_GMII 0x0000 /* GMII/MII */ +#define CIPHY_INTSEL_RGMII 0x1000 +#define CIPHY_INTSEL_TBI 0x2000 +#define CIPHY_INTSEL_RTBI 0x3000 /* Extended PHY control register #2 */ #define CIPHY_MII_ECTL2 0x18 Modified: stable/6/sys/dev/mii/miidevs ============================================================================== --- stable/6/sys/dev/mii/miidevs Fri Dec 5 17:44:26 2008 (r185644) +++ stable/6/sys/dev/mii/miidevs Fri Dec 5 19:53:12 2008 (r185645) @@ -68,6 +68,7 @@ oui SEEQ 0x00a07d Seeq oui SIS 0x00e006 Silicon Integrated Systems oui TDK 0x00c039 TDK oui TI 0x080028 Texas Instruments +oui VITESSE 0x0001c1 Vitesse Semiconductor oui XAQTI 0x00e0ae XaQti Corp. oui MARVELL 0x005043 Marvell Semiconductor oui xxMARVELL 0x000ac2 Marvell Semiconductor @@ -143,6 +144,7 @@ model BROADCOM2 BCM5906 0x0004 BCM5906 model CICADA CS8201 0x0001 Cicada CS8201 10/100/1000TX PHY model CICADA CS8201A 0x0020 Cicada CS8201 10/100/1000TX PHY model CICADA CS8201B 0x0021 Cicada CS8201 10/100/1000TX PHY +model VITESSE VSC8601 0x0002 Vitesse VSC8601 10/100/1000TX PHY /* Davicom Semiconductor PHYs */ model DAVICOM DM9102 0x0004 DM9102 10/100 media interface @@ -155,6 +157,7 @@ model xxICS 1892 0x0003 ICS1892 10/100 model xxICS 1893 0x0004 ICS1893 10/100 media interface /* IC Plus Corp. PHYs */ +model ICPLUS IP101 0x0005 IC Plus 10/100 PHY model ICPLUS IP1000A 0x0008 IC Plus 10/100/1000 media interface model ICPLUS IP1001 0x0019 IC Plus IP1001 10/100/1000 media interface Modified: stable/6/sys/dev/mii/rlphy.c ============================================================================== --- stable/6/sys/dev/mii/rlphy.c Fri Dec 5 17:44:26 2008 (r185644) +++ stable/6/sys/dev/mii/rlphy.c Fri Dec 5 19:53:12 2008 (r185645) @@ -93,6 +93,7 @@ static const struct mii_phydesc rlintphy static const struct mii_phydesc rlphys[] = { MII_PHY_DESC(REALTEK, RTL8201L), + MII_PHY_DESC(ICPLUS, IP101), MII_PHY_END }; From owner-svn-src-stable-6@FreeBSD.ORG Fri Dec 5 21:14:31 2008 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2000B1065672; Fri, 5 Dec 2008 21:14:31 +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 0D1098FC16; Fri, 5 Dec 2008 21:14:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB5LEUYE073229; Fri, 5 Dec 2008 21:14:30 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB5LEUGm073224; Fri, 5 Dec 2008 21:14:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200812052114.mB5LEUGm073224@svn.freebsd.org> From: John Baldwin Date: Fri, 5 Dec 2008 21:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185648 - in stable/6/sys: alpha/alpha amd64/amd64 ia64/ia64 powerpc/powerpc sparc64/sparc64 X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2008 21:14:31 -0000 Author: jhb Date: Fri Dec 5 21:14:30 2008 New Revision: 185648 URL: http://svn.freebsd.org/changeset/base/185648 Log: MFC: It has been observed on the mailing lists that the different categories of pages don't sum to anywhere near the total number of pages on amd64. This is for the most part because uma_small_alloc() pages have never been counted as wired pages, like their kmem_malloc() brethren. They should be. This changes fixes that. Discussed with: alc (a while ago) Modified: stable/6/sys/alpha/alpha/uma_machdep.c stable/6/sys/amd64/amd64/uma_machdep.c stable/6/sys/ia64/ia64/uma_machdep.c stable/6/sys/powerpc/powerpc/uma_machdep.c stable/6/sys/sparc64/sparc64/vm_machdep.c Modified: stable/6/sys/alpha/alpha/uma_machdep.c ============================================================================== --- stable/6/sys/alpha/alpha/uma_machdep.c Fri Dec 5 20:50:24 2008 (r185647) +++ stable/6/sys/alpha/alpha/uma_machdep.c Fri Dec 5 21:14:30 2008 (r185648) @@ -49,9 +49,9 @@ uma_small_alloc(uma_zone_t zone, int byt *flags = UMA_SLAB_PRIV; if ((wait & (M_NOWAIT | M_USE_RESERVE)) == M_NOWAIT) - pflags = VM_ALLOC_INTERRUPT; + pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED; else - pflags = VM_ALLOC_SYSTEM; + pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED; if (wait & M_ZERO) pflags |= VM_ALLOC_ZERO; for (;;) { @@ -76,7 +76,9 @@ uma_small_free(void *mem, int size, u_in vm_page_t m; m = PHYS_TO_VM_PAGE(ALPHA_K0SEG_TO_PHYS((vm_offset_t)mem)); + m->wire_count--; vm_page_lock_queues(); vm_page_free(m); vm_page_unlock_queues(); + atomic_subtract_int(&cnt.v_wire_count, 1); } Modified: stable/6/sys/amd64/amd64/uma_machdep.c ============================================================================== --- stable/6/sys/amd64/amd64/uma_machdep.c Fri Dec 5 20:50:24 2008 (r185647) +++ stable/6/sys/amd64/amd64/uma_machdep.c Fri Dec 5 21:14:30 2008 (r185648) @@ -50,9 +50,9 @@ uma_small_alloc(uma_zone_t zone, int byt *flags = UMA_SLAB_PRIV; if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT) - pflags = VM_ALLOC_INTERRUPT; + pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED; else - pflags = VM_ALLOC_SYSTEM; + pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED; if (wait & M_ZERO) pflags |= VM_ALLOC_ZERO; for (;;) { @@ -82,7 +82,9 @@ uma_small_free(void *mem, int size, u_in pa = DMAP_TO_PHYS((vm_offset_t)mem); dump_drop_page(pa); m = PHYS_TO_VM_PAGE(pa); + m->wire_count--; vm_page_lock_queues(); vm_page_free(m); vm_page_unlock_queues(); + atomic_subtract_int(&cnt.v_wire_count, 1); } Modified: stable/6/sys/ia64/ia64/uma_machdep.c ============================================================================== --- stable/6/sys/ia64/ia64/uma_machdep.c Fri Dec 5 20:50:24 2008 (r185647) +++ stable/6/sys/ia64/ia64/uma_machdep.c Fri Dec 5 21:14:30 2008 (r185648) @@ -48,9 +48,9 @@ uma_small_alloc(uma_zone_t zone, int byt *flags = UMA_SLAB_PRIV; if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT) - pflags = VM_ALLOC_INTERRUPT; + pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED; else - pflags = VM_ALLOC_SYSTEM; + pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED; if (wait & M_ZERO) pflags |= VM_ALLOC_ZERO; @@ -76,7 +76,9 @@ uma_small_free(void *mem, int size, u_in vm_page_t m; m = PHYS_TO_VM_PAGE(IA64_RR_MASK((u_int64_t)mem)); + m->wire_count--; vm_page_lock_queues(); vm_page_free(m); vm_page_unlock_queues(); + atomic_subtract_int(&cnt.v_wire_count, 1); } Modified: stable/6/sys/powerpc/powerpc/uma_machdep.c ============================================================================== --- stable/6/sys/powerpc/powerpc/uma_machdep.c Fri Dec 5 20:50:24 2008 (r185647) +++ stable/6/sys/powerpc/powerpc/uma_machdep.c Fri Dec 5 21:14:30 2008 (r185648) @@ -54,9 +54,9 @@ uma_small_alloc(uma_zone_t zone, int byt *flags = UMA_SLAB_PRIV; if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT) - pflags = VM_ALLOC_INTERRUPT; + pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED; else - pflags = VM_ALLOC_SYSTEM; + pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED; if (wait & M_ZERO) pflags |= VM_ALLOC_ZERO; @@ -84,8 +84,10 @@ uma_small_free(void *mem, int size, u_in vm_page_t m; m = PHYS_TO_VM_PAGE((u_int32_t)mem); + m->wire_count--; vm_page_lock_queues(); vm_page_free(m); vm_page_unlock_queues(); + atomic_subtract_int(&cnt.v_wire_count, 1); atomic_subtract_int(&hw_uma_mdpages, 1); } Modified: stable/6/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- stable/6/sys/sparc64/sparc64/vm_machdep.c Fri Dec 5 20:50:24 2008 (r185647) +++ stable/6/sys/sparc64/sparc64/vm_machdep.c Fri Dec 5 21:14:30 2008 (r185648) @@ -462,9 +462,9 @@ uma_small_alloc(uma_zone_t zone, int byt *flags = UMA_SLAB_PRIV; if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT) - pflags = VM_ALLOC_INTERRUPT; + pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED; else - pflags = VM_ALLOC_SYSTEM; + pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED; if (wait & M_ZERO) pflags |= VM_ALLOC_ZERO; @@ -501,7 +501,9 @@ uma_small_free(void *mem, int size, u_in PMAP_STATS_INC(uma_nsmall_free); m = PHYS_TO_VM_PAGE(TLB_DIRECT_TO_PHYS((vm_offset_t)mem)); + m->wire_count--; vm_page_lock_queues(); vm_page_free(m); vm_page_unlock_queues(); + atomic_subtract_int(&cnt.v_wire_count, 1); } From owner-svn-src-stable-6@FreeBSD.ORG Sat Dec 6 14:20:04 2008 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D04441065675; Sat, 6 Dec 2008 14:20:04 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE3F88FC23; Sat, 6 Dec 2008 14:20:04 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB6EK4tM096602; Sat, 6 Dec 2008 14:20:04 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB6EK40O096601; Sat, 6 Dec 2008 14:20:04 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200812061420.mB6EK40O096601@svn.freebsd.org> From: Giorgos Keramidas Date: Sat, 6 Dec 2008 14:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185706 - in stable/6/sys: . boot/forth X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2008 14:20:05 -0000 Author: keramida (doc committer) Date: Sat Dec 6 14:20:04 2008 New Revision: 185706 URL: http://svn.freebsd.org/changeset/base/185706 Log: MFC: r175379, r175380 Document that loader(8) stops reading `loader.conf' when it encounters a syntax error, and add a tip about adding first the `vital' options and then experimental ones. PR: docs/119658 Submitted by: Julian Stacey, jhs at berklix.org Modified: stable/6/sys/ (props changed) stable/6/sys/boot/forth/loader.conf.5 Modified: stable/6/sys/boot/forth/loader.conf.5 ============================================================================== --- stable/6/sys/boot/forth/loader.conf.5 Sat Dec 6 13:50:03 2008 (r185705) +++ stable/6/sys/boot/forth/loader.conf.5 Sat Dec 6 14:20:04 2008 (r185706) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd November 15, 2005 +.Dd January 16, 2008 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -238,6 +238,16 @@ contains the instructions to automatical .Xr boot 8 , .Xr loader 8 , .Xr loader.4th 8 +.Sh BUGS +The +.Xr loader 8 +stops reading +.Nm +when it encounters a syntax error, so any options which are vital for +booting a particular system (i.e.\& +.Dq Va hw.ata.ata_dma Ns "=0" ) +should precede any experimental additions to +.Nm . .Sh HISTORY The file .Nm From owner-svn-src-stable-6@FreeBSD.ORG Sat Dec 6 14:33:25 2008 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8A3D1065672; Sat, 6 Dec 2008 14:33:25 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 963E08FC0C; Sat, 6 Dec 2008 14:33:25 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB6EXP18097044; Sat, 6 Dec 2008 14:33:25 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB6EXPCF097043; Sat, 6 Dec 2008 14:33:25 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200812061433.mB6EXPCF097043@svn.freebsd.org> From: Giorgos Keramidas Date: Sat, 6 Dec 2008 14:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185708 - stable/6/usr.bin/xargs X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2008 14:33:25 -0000 Author: keramida (doc committer) Date: Sat Dec 6 14:33:25 2008 New Revision: 185708 URL: http://svn.freebsd.org/changeset/base/185708 Log: MFC: r175680, r175728. Document the no-op -r option of BSD xargs(1). PR: docs/106416 Submitted by: Pete Slagle, freebsd-stable at voidcaptain.com Modified: stable/6/usr.bin/xargs/ (props changed) stable/6/usr.bin/xargs/xargs.1 Modified: stable/6/usr.bin/xargs/xargs.1 ============================================================================== --- stable/6/usr.bin/xargs/xargs.1 Sat Dec 6 14:23:45 2008 (r185707) +++ stable/6/usr.bin/xargs/xargs.1 Sat Dec 6 14:33:25 2008 (r185708) @@ -37,7 +37,7 @@ .\" $FreeBSD$ .\" $xMach: xargs.1,v 1.2 2002/02/23 05:23:37 tim Exp $ .\" -.Dd August 2, 2004 +.Dd January 26, 2008 .Dt XARGS 1 .Os .Sh NAME @@ -45,7 +45,7 @@ .Nd "construct argument list(s) and execute utility" .Sh SYNOPSIS .Nm -.Op Fl 0opt +.Op Fl 0oprt .Op Fl E Ar eofstr .Oo .Fl I Ar replstr @@ -213,6 +213,34 @@ in the POSIX locale, causes the command to be executed, any other response causes it to be skipped. No commands are executed if the process is not attached to a terminal. +.It Fl r +Compatibility with GNU +.Nm . +The GNU version of +.Nm +runs the +.Ar utility +argument at least once, even if +.Nm +input is empty, and it supports a +.Fl r +option to inhibit this behavior. +The +.Fx +version of +.Nm +does not run the +.Ar utility +argument on empty input, but it supports the +.Fl r +option for command-line compatibility with GNU +.Nm , +but the +.Fl r +option does nothing in the +.Fx +version of +.Nm . .It Fl R Ar replacements Specify the maximum number of arguments that .Fl I From owner-svn-src-stable-6@FreeBSD.ORG Sat Dec 6 14:36:08 2008 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2DA01065670; Sat, 6 Dec 2008 14:36:08 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B88E88FC12; Sat, 6 Dec 2008 14:36:08 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB6Ea8s5097167; Sat, 6 Dec 2008 14:36:08 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB6Ea81p097166; Sat, 6 Dec 2008 14:36:08 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200812061436.mB6Ea81p097166@svn.freebsd.org> From: Giorgos Keramidas Date: Sat, 6 Dec 2008 14:36:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185709 - stable/6/usr.sbin/mtree X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2008 14:36:09 -0000 Author: keramida (doc committer) Date: Sat Dec 6 14:36:08 2008 New Revision: 185709 URL: http://svn.freebsd.org/changeset/base/185709 Log: MFC: r173282 Use getcwd() instead of getwd(). The former includes buffer length checks, so it's probably "safer" to use in mtree. Modified: stable/6/usr.sbin/mtree/ (props changed) From owner-svn-src-stable-6@FreeBSD.ORG Sat Dec 6 14:42:37 2008 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DEC7106564A; Sat, 6 Dec 2008 14:42:37 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF70A8FC13; Sat, 6 Dec 2008 14:42:36 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB6Egaxx097405; Sat, 6 Dec 2008 14:42:36 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB6EgaOY097404; Sat, 6 Dec 2008 14:42:36 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200812061442.mB6EgaOY097404@svn.freebsd.org> From: Giorgos Keramidas Date: Sat, 6 Dec 2008 14:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185710 - stable/6/share/man/man5 X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2008 14:42:37 -0000 Author: keramida (doc committer) Date: Sat Dec 6 14:42:36 2008 New Revision: 185710 URL: http://svn.freebsd.org/changeset/base/185710 Log: MFC: r172623, r175681, r176182, r176184, and r185217 * Document quotachecks use of the passno field. * Explain how the passno field in /etc/fstab works with fsck and quotacheck in some more detail. * Explain in more detail how the pass number field works. * Remove information about block devices; we don't have this sort of separation between character and block devices anymore. * Enhance the explanation of using filesystem-specific mount options, and add a mount_msdosfs example. Modified: stable/6/share/man/man5/ (props changed) stable/6/share/man/man5/fstab.5 Modified: stable/6/share/man/man5/fstab.5 ============================================================================== --- stable/6/share/man/man5/fstab.5 Sat Dec 6 14:36:08 2008 (r185709) +++ stable/6/share/man/man5/fstab.5 Sat Dec 6 14:42:36 2008 (r185710) @@ -32,7 +32,7 @@ .\" @(#)fstab.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 5, 1993 +.Dd November 23, 2008 .Dt FSTAB 5 .Os .Sh NAME @@ -64,15 +64,8 @@ doing their thing. .Pp The first field, .Pq Fa fs_spec , -describes the block special device or +describes the special device or remote file system to be mounted. -For file systems of type -.Em ufs , -the special file name is the block special file name, -and not the character special file name. -If a program needs the character special file name, -the program must create it by appending a ``r'' after the -last ``/'' in the special file name. .Pp The second field, .Pq Fa fs_file , @@ -98,8 +91,7 @@ describes the mount options associated w It is formatted as a comma separated list of options. It contains at least the type of mount (see .Fa fs_type -below) plus any additional options -appropriate to the file system type. +below) plus any additional options appropriate to the file system type. See the options flag .Pq Fl o in the @@ -107,6 +99,32 @@ in the page and the file system specific page, such as .Xr mount_nfs 8 , for additional options that may be specified. +All options that can be given to the file system specific mount commands +can be used in +.Nm +as well. +They just need to be formatted a bit differently. +The arguments of the +.Fl o +option can be used without the preceding +.Fl o +flag. +Other options need both the file system specific flag and its argument, +separated by an equal sign. +For example, mounting an +.Xr msdosfs 5 +filesystem, the options +.Bd -literal -offset indent +-o sync -o noatime -m 644 -M 755 -u foo -g bar +.Ed +.Pp +should be written as +.Bd -literal -offset indent +sync,noatime,-m=644,-M=755,-u=foo,-g=bar +.Ed +.Pp +in the option field of +.Nm . .Pp If the options ``userquota'' and/or ``groupquota'' are specified, the file system is automatically processed by the @@ -186,20 +204,72 @@ The sixth field, .Pq Fa fs_passno , is used by the .Xr fsck 8 -program to determine the order in which file system checks are done -at reboot time. +and +.Xr quotacheck 8 +programs to determine the order in which file system and quota +checks are done at reboot time. +The +.Fa fs_passno +field can be any value between 0 and +.Ql INT_MAX Ns -1 . +.Pp The root file system should be specified with a .Fa fs_passno of 1, and other file systems should have a .Fa fs_passno -of 2. -File systems within a drive will be checked sequentially, +of 2 or greater. +A file system with a +.Fa fs_passno +value of 1 is always checked sequentially and be completed before +another file system is processed, and it will be processed before +all file systems with a larger +.Fa fs_passno . +.Pp +For any given value of +.Fa fs_passno , +file systems within a drive will be checked sequentially, but file systems on different drives will be checked at the same time to utilize parallelism available in the hardware. +Once all file system checks are complete for the current +.Fa fs_passno , +the same process will start over for the next +.Fa fs_passno . +.Pp If the sixth field is not present or is zero, a value of zero is returned and .Xr fsck 8 +and +.Xr quotacheck 8 will assume that the file system does not need to be checked. +.Pp +The +.Fa fs_passno +field can be used to implement finer control when +the system utilities may determine that the file system resides +on a different physical device, when it actually does not, as with a +.Xr ccd 4 +device. +All file systems with a lower +.Fa fs_passno +value will be completed before starting on file systems with a +higher +.Fa fs_passno +value. +E.g. all file systems with a +.Fa fs_passno +of 2 will be completed before any file systems with a +.Fa fs_passno +of 3 or greater are started. +Gaps are allowed between the different +.Fa fs_passno +values. +E.g. file systems listed in +.Pa /etc/fstab +may have +.Fa fs_passno +values such as 0, 1, 2, 15, 100, 200, 300, and may appear in any order +within +.Pa /etc/fstab . .Bd -literal #define FSTAB_RW "rw" /* read/write device */ #define FSTAB_RQ "rq" /* read/write with quotas */ @@ -237,6 +307,7 @@ resides in .Sh SEE ALSO .Xr getfsent 3 , .Xr getvfsbyname 3 , +.Xr ccd 4 , .Xr dump 8 , .Xr fsck 8 , .Xr mount 8 , From owner-svn-src-stable-6@FreeBSD.ORG Sat Dec 6 14:50:46 2008 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C93541065672; Sat, 6 Dec 2008 14:50:46 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B76E18FC20; Sat, 6 Dec 2008 14:50:46 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB6Eokku097723; Sat, 6 Dec 2008 14:50:46 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB6Eoknr097722; Sat, 6 Dec 2008 14:50:46 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200812061450.mB6Eoknr097722@svn.freebsd.org> From: Giorgos Keramidas Date: Sat, 6 Dec 2008 14:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185712 - in stable/6/lib/libc: . gen sys X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2008 14:50:46 -0000 Author: keramida (doc committer) Date: Sat Dec 6 14:50:46 2008 New Revision: 185712 URL: http://svn.freebsd.org/changeset/base/185712 Log: MFC: r185519 The times(3) function returns the number of CLK_TCKs since the startup time of FreeBSD, not since the UNIX Epoch. PR: docs/122359 Submitted by: Viktor Štujber Modified: stable/6/lib/libc/ (props changed) stable/6/lib/libc/gen/times.3 stable/6/lib/libc/sys/ (props changed) Modified: stable/6/lib/libc/gen/times.3 ============================================================================== --- stable/6/lib/libc/gen/times.3 Sat Dec 6 14:45:03 2008 (r185711) +++ stable/6/lib/libc/gen/times.3 Sat Dec 6 14:50:46 2008 (r185712) @@ -32,7 +32,7 @@ .\" @(#)times.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd December 1, 2008 .Dt TIMES 3 .Os .Sh NAME @@ -56,9 +56,13 @@ The .Fn times function returns the value of time in .Dv CLK_TCK Ns 's -of a second since -0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal -Time. +of a second since the system startup time. +The current value of +.Dv CLK_TCK , +the frequency of the statistics clock in ticks per second, may be +obtained through the +.Xr sysconf 3 +interface. .Pp It also fills in the structure pointed to by .Fa tp @@ -135,6 +139,7 @@ and .Xr getrusage 2 , .Xr gettimeofday 2 , .Xr wait 2 , +.Xr sysconf 3 , .Xr clocks 7 .Sh STANDARDS The