From f9e2e99d5d3ec4cb3f335e6c1152536600c6a0ca Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Tue, 16 Nov 2010 12:30:47 +0000 Subject: [PATCH 01/38] fix misspelling in a comment Reported by: Daniel Braniss MFC after: 3 days --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c index 09fcab3b28db..a45f986feaaf 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c @@ -1557,7 +1557,7 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int flags, vnode_t **vpp) int err; /* - * zfs_zget() can't operate on virtual entires like .zfs/ or + * zfs_zget() can't operate on virtual entries like .zfs/ or * .zfs/snapshot/ directories, that's why we return EOPNOTSUPP. * This will make NFS to switch to LOOKUP instead of using VGET. */ From 40934baa605543988ec92c34d30b9ee95f14fe5b Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Tue, 16 Nov 2010 12:43:45 +0000 Subject: [PATCH 02/38] hwpstate: use CPU_FOREACH when binding to all available processors Also, add a comment mentioning _PSD - on some systems it's enough to put one logical CPU into a particular P-state to make other CPUs in the same domain to enter that P-state. Also, call sched_unbind() after the loop - sched_bind() automatically rebinds from previous CPU to a new one, and the new arrangement of code is safer against early loop exit. Plus one minor style nit. MFC after: 10 days --- sys/x86/cpufreq/hwpstate.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/sys/x86/cpufreq/hwpstate.c b/sys/x86/cpufreq/hwpstate.c index 18659d7c1e3c..272792658e62 100644 --- a/sys/x86/cpufreq/hwpstate.c +++ b/sys/x86/cpufreq/hwpstate.c @@ -157,7 +157,6 @@ DRIVER_MODULE(hwpstate, cpu, hwpstate_driver, hwpstate_devclass, 0, 0); static int hwpstate_goto_pstate(device_t dev, int pstate) { - struct pcpu *pc; int i; uint64_t msr; int j; @@ -171,18 +170,15 @@ hwpstate_goto_pstate(device_t dev, int pstate) if(limit > id) id = limit; - error = 0; /* * We are going to the same Px-state on all cpus. + * Probably should take _PSD into account. */ - for (i = 0; i < mp_ncpus; i++) { - /* Find each cpu. */ - pc = pcpu_find(i); - if (pc == NULL) - return (ENXIO); - thread_lock(curthread); + error = 0; + CPU_FOREACH(i) { /* Bind to each cpu. */ - sched_bind(curthread, pc->pc_cpuid); + thread_lock(curthread); + sched_bind(curthread, i); thread_unlock(curthread); HWPSTATE_DEBUG(dev, "setting P%d-state on cpu%d\n", id, PCPU_GET(cpuid)); @@ -204,10 +200,10 @@ hwpstate_goto_pstate(device_t dev, int pstate) HWPSTATE_DEBUG(dev, "error: loop is not enough.\n"); error = ENXIO; } - thread_lock(curthread); - sched_unbind(curthread); - thread_unlock(curthread); } + thread_lock(curthread); + sched_unbind(curthread); + thread_unlock(curthread); return (error); } From 0c87b5e24307691c0c4ed268fb2fcff5b7579297 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Tue, 16 Nov 2010 14:08:21 +0000 Subject: [PATCH 03/38] No need to include sys/systm.h twice. --- sys/kern/kern_rmlock.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/kern/kern_rmlock.c b/sys/kern/kern_rmlock.c index 0ab5d744a5f9..7f2b4e7367be 100644 --- a/sys/kern/kern_rmlock.c +++ b/sys/kern/kern_rmlock.c @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From c59690f24972dc50e5296b15f04c1121772dba2a Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Tue, 16 Nov 2010 15:53:44 +0000 Subject: [PATCH 04/38] zfs+sendfile: populate all requested pages, not just those already cached kern_sendfile() uses vm_rdwr() to read-ahead blocks of data to populate page cache. When sendfile stumbles upon a page that is not populated yet, it sends out all the mbufs that it collected so far. This resulted in very poor performance with ZFS when file data is not in the page cache, because ZFS vop_read for UIO_NOCOPY case populated only those pages that are already in cache, but not valid. Which means that most of the time it populated only the first requested page in the described above scenario. Reported by: Alexander Zagrebin Tested by: Alexander Zagrebin , Artemiev Igor MFC after: 12 days --- .../opensolaris/uts/common/fs/zfs/zfs_vnops.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c index ba0f0eb48717..85647a89ef15 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -67,6 +67,7 @@ #include #include #include +#include /* * Programming rules. @@ -481,7 +482,7 @@ mappedread(vnode_t *vp, int nbytes, uio_t *uio) uiomove_fromphys(&m, off, bytes, uio); VM_OBJECT_LOCK(obj); vm_page_wakeup(m); - } else if (m != NULL && uio->uio_segflg == UIO_NOCOPY) { + } else if (uio->uio_segflg == UIO_NOCOPY) { /* * The code below is here to make sendfile(2) work * correctly with ZFS. As pointed out by ups@ @@ -491,7 +492,7 @@ mappedread(vnode_t *vp, int nbytes, uio_t *uio) */ KASSERT(off == 0, ("unexpected offset in mappedread for sendfile")); - if ((m->oflags & VPO_BUSY) != 0) { + if (m != NULL && (m->oflags & VPO_BUSY) != 0) { /* * Reference the page before unlocking and * sleeping so that the page daemon is less @@ -501,8 +502,17 @@ mappedread(vnode_t *vp, int nbytes, uio_t *uio) vm_page_flag_set(m, PG_REFERENCED); vm_page_sleep(m, "zfsmrb"); goto again; + } else if (m == NULL) { + m = vm_page_alloc(obj, OFF_TO_IDX(start), + VM_ALLOC_NOBUSY | VM_ALLOC_NORMAL); + if (m == NULL) { + VM_OBJECT_UNLOCK(obj); + VM_WAIT; + VM_OBJECT_LOCK(obj); + goto again; + } } - vm_page_busy(m); + vm_page_io_start(m); VM_OBJECT_UNLOCK(obj); if (dirbytes > 0) { error = dmu_read_uio(os, zp->z_id, uio, @@ -520,7 +530,7 @@ mappedread(vnode_t *vp, int nbytes, uio_t *uio) VM_OBJECT_LOCK(obj); if (error == 0) m->valid = VM_PAGE_BITS_ALL; - vm_page_wakeup(m); + vm_page_io_finish(m); if (error == 0) { uio->uio_resid -= bytes; uio->uio_offset += bytes; From b751664f7fc136bace3c4350590173be77ab24d5 Mon Sep 17 00:00:00 2001 From: "George V. Neville-Neil" Date: Tue, 16 Nov 2010 20:39:52 +0000 Subject: [PATCH 05/38] Fix an error in our results printing. --- tools/tools/mctest/mctest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools/mctest/mctest.cc b/tools/tools/mctest/mctest.cc index 5ddb98c3ba64..6d723ba137f2 100644 --- a/tools/tools/mctest/mctest.cc +++ b/tools/tools/mctest/mctest.cc @@ -419,7 +419,7 @@ int source(char *interface, struct in_addr *group, int pkt_size, // cout << "sec: " << result.tv_sec; // cout << " usecs: " << result.tv_usec << endl; } - cout << "comparing %lu deltas" << long(deltas.size()) << endl; + cout << "comparing " << long(deltas.size()) << " deltas" << endl; cout << "number represents usecs of round-trip time" << endl; sort(deltas.begin(), deltas.end()); for (int i = 0; idx[i] != 0; ++i) { From 6a67588bbb5ffcf28601e2c7444a38a8d5407aea Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Tue, 16 Nov 2010 22:16:38 +0000 Subject: [PATCH 06/38] Add an SCTP socket option to retrieve the number of timeouts of an association. MFC after: 3 days. --- sys/netinet/sctp.h | 1 + sys/netinet/sctp_uio.h | 11 +++++++++++ sys/netinet/sctp_usrreq.c | 23 +++++++++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/sys/netinet/sctp.h b/sys/netinet/sctp.h index 69473e2c64a3..14acd9dac612 100644 --- a/sys/netinet/sctp.h +++ b/sys/netinet/sctp.h @@ -123,6 +123,7 @@ struct sctp_paramhdr { #define SCTP_LOCAL_AUTH_CHUNKS 0x00000103 #define SCTP_GET_ASSOC_NUMBER 0x00000104 /* ro */ #define SCTP_GET_ASSOC_ID_LIST 0x00000105 /* ro */ +#define SCTP_TIMEOUTS 0x00000106 /* * user socket options: BSD implementation specific diff --git a/sys/netinet/sctp_uio.h b/sys/netinet/sctp_uio.h index c90152153f1e..1cb62f372817 100644 --- a/sys/netinet/sctp_uio.h +++ b/sys/netinet/sctp_uio.h @@ -563,6 +563,17 @@ struct sctp_sack_info { uint32_t sack_freq; }; +struct sctp_timeouts { + sctp_assoc_t stimo_assoc_id; + uint32_t stimo_init; + uint32_t stimo_data; + uint32_t stimo_sack; + uint32_t stimo_shutdown; + uint32_t stimo_heartbeat; + uint32_t stimo_cookie; + uint32_t stimo_shutdownack; +}; + struct sctp_cwnd_args { struct sctp_nets *net; /* network to *//* FIXME: LP64 issue */ uint32_t cwnd_new_value;/* cwnd in k */ diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 266c08c1a372..812a459fc66a 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -2441,6 +2441,29 @@ sctp_getopt(struct socket *so, int optname, void *optval, size_t *optsize, *optsize = sizeof(*srto); } break; + case SCTP_TIMEOUTS: + { + struct sctp_timeouts *stimo; + + SCTP_CHECK_AND_CAST(stimo, optval, struct sctp_timeouts, *optsize); + SCTP_FIND_STCB(inp, stcb, stimo->stimo_assoc_id); + + if (stcb) { + stimo->stimo_init = stcb->asoc.timoinit; + stimo->stimo_data = stcb->asoc.timodata; + stimo->stimo_sack = stcb->asoc.timosack; + stimo->stimo_shutdown = stcb->asoc.timoshutdown; + stimo->stimo_heartbeat = stcb->asoc.timoheartbeat; + stimo->stimo_cookie = stcb->asoc.timocookie; + stimo->stimo_shutdownack = stcb->asoc.timoshutdownack; + SCTP_TCB_UNLOCK(stcb); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + error = EINVAL; + } + *optsize = sizeof(*stimo); + } + break; case SCTP_ASSOCINFO: { struct sctp_assocparams *sasoc; From e04bbe2020aa0be96fb539b4fd694f61a353a0d7 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Tue, 16 Nov 2010 22:21:14 +0000 Subject: [PATCH 07/38] Add in forgotten install rule. --- share/mk/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/Makefile b/share/mk/Makefile index f0a7cdfe4f29..162411ad706d 100644 --- a/share/mk/Makefile +++ b/share/mk/Makefile @@ -12,7 +12,7 @@ FILES+= bsd.obj.mk bsd.own.mk FILES+= bsd.port.mk bsd.port.options.mk bsd.port.post.mk FILES+= bsd.port.pre.mk bsd.port.subdir.mk bsd.prog.mk FILES+= bsd.snmpmod.mk bsd.subdir.mk bsd.sys.mk bsd.symver.mk -FILES+= sys.mk version_gen.awk +FILES+= sys.mk version_gen.awk bsd.crunchgen.mk NO_OBJ= FILESDIR= ${BINDIR}/mk From 84103d748fe72fc0dd629221c7a8bba48ab22d31 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Tue, 16 Nov 2010 22:22:16 +0000 Subject: [PATCH 08/38] .. and then notice that the list of mk files is ordered, and update to suit. --- share/mk/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/mk/Makefile b/share/mk/Makefile index 162411ad706d..64c65492c510 100644 --- a/share/mk/Makefile +++ b/share/mk/Makefile @@ -5,14 +5,14 @@ FILES= bsd.README FILES+= bsd.arch.inc.mk FILES+= bsd.compat.mk bsd.cpu.mk bsd.dep.mk bsd.doc.mk bsd.dtrace.mk FILES+= bsd.endian.mk -FILES+= bsd.files.mk bsd.incs.mk bsd.info.mk bsd.init.mk +FILES+= bsd.files.mk bsd.crunchgen.mk bsd.incs.mk bsd.info.mk bsd.init.mk FILES+= bsd.kmod.mk FILES+= bsd.lib.mk bsd.libnames.mk bsd.links.mk bsd.man.mk bsd.nls.mk FILES+= bsd.obj.mk bsd.own.mk FILES+= bsd.port.mk bsd.port.options.mk bsd.port.post.mk FILES+= bsd.port.pre.mk bsd.port.subdir.mk bsd.prog.mk FILES+= bsd.snmpmod.mk bsd.subdir.mk bsd.sys.mk bsd.symver.mk -FILES+= sys.mk version_gen.awk bsd.crunchgen.mk +FILES+= sys.mk version_gen.awk NO_OBJ= FILESDIR= ${BINDIR}/mk From 7d31a7629582afc93110254ab5f57b905ec250a1 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Tue, 16 Nov 2010 22:23:20 +0000 Subject: [PATCH 09/38] Re-enable generating links. --- share/mk/bsd.crunchgen.mk | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/share/mk/bsd.crunchgen.mk b/share/mk/bsd.crunchgen.mk index 565b11208b3f..5ebfd94f97db 100644 --- a/share/mk/bsd.crunchgen.mk +++ b/share/mk/bsd.crunchgen.mk @@ -51,17 +51,14 @@ $(OUTPUTS): $(CRUNCH_SRCDIR_${P})/Makefile .else $(OUTPUTS): $(.CURDIR)/../../$(D)/$(P)/Makefile .endif -# Disable building links for bsdbox - whatever is installing the binaries into -# the embedded system should (for now) do the linking there. This may change -# in the future. -adrian -#.ifndef CRUNCH_SUPPRESS_LINK_${P} -#LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(P) -#.endif -#.for A in $(CRUNCH_ALIAS_$(P)) -#.ifndef CRUNCH_SUPPRESS_LINK_${A} -#LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(A) -#.endif -#.endfor +.ifndef CRUNCH_SUPPRESS_LINK_${P} +LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(P) +.endif +.for A in $(CRUNCH_ALIAS_$(P)) +.ifndef CRUNCH_SUPPRESS_LINK_${A} +LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(A) +.endif +.endfor .endfor .endfor From 50083a562405062e9fb38724cdbe85338e25a402 Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Tue, 16 Nov 2010 22:44:58 +0000 Subject: [PATCH 10/38] Invalidate TLBs explicitly. r1.4 of sys/i386/i386/i686_mem.c removed this code but probably it only worked by chance because modifying CR4.PGE bit causes invlidation of entire TLBs. Since these are very rare events, this micro-optimization seems useless. Reviewed by: jhb --- sys/amd64/amd64/amd64_mem.c | 4 +++- sys/i386/i386/i686_mem.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/amd64_mem.c b/sys/amd64/amd64/amd64_mem.c index 2768cf428fe1..55e8f974a8b7 100644 --- a/sys/amd64/amd64/amd64_mem.c +++ b/sys/amd64/amd64/amd64_mem.c @@ -321,6 +321,7 @@ amd64_mrstoreone(void *arg) /* Flushes caches and TLBs. */ wbinvd(); + invltlb(); /* Disable MTRRs (E = 0). */ wrmsr(MSR_MTRRdefType, rdmsr(MSR_MTRRdefType) & ~MTRR_DEF_ENABLE); @@ -388,8 +389,9 @@ amd64_mrstoreone(void *arg) wrmsr(msr + 1, msrv); } - /* Flush caches, TLBs. */ + /* Flush caches and TLBs. */ wbinvd(); + invltlb(); /* Enable MTRRs. */ wrmsr(MSR_MTRRdefType, rdmsr(MSR_MTRRdefType) | MTRR_DEF_ENABLE); diff --git a/sys/i386/i386/i686_mem.c b/sys/i386/i386/i686_mem.c index cc6f300617a0..f8580cd5a708 100644 --- a/sys/i386/i386/i686_mem.c +++ b/sys/i386/i386/i686_mem.c @@ -315,6 +315,7 @@ i686_mrstoreone(void *arg) /* Flushes caches and TLBs. */ wbinvd(); + invltlb(); /* Disable MTRRs (E = 0). */ wrmsr(MSR_MTRRdefType, rdmsr(MSR_MTRRdefType) & ~MTRR_DEF_ENABLE); @@ -382,8 +383,9 @@ i686_mrstoreone(void *arg) wrmsr(msr + 1, msrv); } - /* Flush caches, TLBs. */ + /* Flush caches and TLBs. */ wbinvd(); + invltlb(); /* Enable MTRRs. */ wrmsr(MSR_MTRRdefType, rdmsr(MSR_MTRRdefType) | MTRR_DEF_ENABLE); From 816b3bd1b06ce4934f5dbe4ef7cdb6dfec3a398c Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Tue, 16 Nov 2010 23:26:02 +0000 Subject: [PATCH 11/38] Restore CR0 after MTRR initialization for correctness sakes. There will be no noticeable change because we enable caches before we enter here for both BSP and AP cases. Remove another pointless optimization for CR4.PGE bit while I am here. --- sys/amd64/amd64/amd64_mem.c | 18 ++++++++---------- sys/i386/i386/i686_mem.c | 18 ++++++++---------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/sys/amd64/amd64/amd64_mem.c b/sys/amd64/amd64/amd64_mem.c index 55e8f974a8b7..260b77b4955b 100644 --- a/sys/amd64/amd64/amd64_mem.c +++ b/sys/amd64/amd64/amd64_mem.c @@ -307,17 +307,17 @@ amd64_mrstoreone(void *arg) struct mem_range_desc *mrd; u_int64_t omsrv, msrv; int i, j, msr; - u_int cr4save; + u_long cr0, cr4; mrd = sc->mr_desc; /* Disable PGE. */ - cr4save = rcr4(); - if (cr4save & CR4_PGE) - load_cr4(cr4save & ~CR4_PGE); + cr4 = rcr4(); + load_cr4(cr4 & ~CR4_PGE); /* Disable caches (CD = 1, NW = 0). */ - load_cr0((rcr0() & ~CR0_NW) | CR0_CD); + cr0 = rcr0(); + load_cr0((cr0 & ~CR0_NW) | CR0_CD); /* Flushes caches and TLBs. */ wbinvd(); @@ -396,11 +396,9 @@ amd64_mrstoreone(void *arg) /* Enable MTRRs. */ wrmsr(MSR_MTRRdefType, rdmsr(MSR_MTRRdefType) | MTRR_DEF_ENABLE); - /* Enable caches (CD = 0, NW = 0). */ - load_cr0(rcr0() & ~(CR0_CD | CR0_NW)); - - /* Restore PGE. */ - load_cr4(cr4save); + /* Restore caches and PGE. */ + load_cr0(cr0); + load_cr4(cr4); } /* diff --git a/sys/i386/i386/i686_mem.c b/sys/i386/i386/i686_mem.c index f8580cd5a708..a8d8baf78d6a 100644 --- a/sys/i386/i386/i686_mem.c +++ b/sys/i386/i386/i686_mem.c @@ -301,17 +301,17 @@ i686_mrstoreone(void *arg) struct mem_range_desc *mrd; u_int64_t omsrv, msrv; int i, j, msr; - u_int cr4save; + u_long cr0, cr4; mrd = sc->mr_desc; /* Disable PGE. */ - cr4save = rcr4(); - if (cr4save & CR4_PGE) - load_cr4(cr4save & ~CR4_PGE); + cr4 = rcr4(); + load_cr4(cr4 & ~CR4_PGE); /* Disable caches (CD = 1, NW = 0). */ - load_cr0((rcr0() & ~CR0_NW) | CR0_CD); + cr0 = rcr0(); + load_cr0((cr0 & ~CR0_NW) | CR0_CD); /* Flushes caches and TLBs. */ wbinvd(); @@ -390,11 +390,9 @@ i686_mrstoreone(void *arg) /* Enable MTRRs. */ wrmsr(MSR_MTRRdefType, rdmsr(MSR_MTRRdefType) | MTRR_DEF_ENABLE); - /* Enable caches (CD = 0, NW = 0). */ - load_cr0(rcr0() & ~(CR0_CD | CR0_NW)); - - /* Restore PGE. */ - load_cr4(cr4save); + /* Restore caches and PGE. */ + load_cr0(cr0); + load_cr4(cr4); } /* From 20723e34e3dad31245c4f45daa150aae93672c31 Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Wed, 17 Nov 2010 09:25:08 +0000 Subject: [PATCH 12/38] No need to re-initialize the callout. We initially do it in in6_lltable_new() right after allocation. Worse, we are losing the right flags here. MFC after: 4 days --- sys/netinet6/nd6.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 10fae8247868..0315469fe8f2 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -851,10 +851,8 @@ nd6_lookup(struct in6_addr *addr6, int flags, struct ifnet *ifp) llflags |= LLE_EXCLUSIVE; ln = lla_lookup(LLTABLE6(ifp), llflags, (struct sockaddr *)&sin6); - if ((ln != NULL) && (flags & LLE_CREATE)) { + if ((ln != NULL) && (flags & LLE_CREATE)) ln->ln_state = ND6_LLINFO_NOSTATE; - callout_init(&ln->ln_timer_ch, 0); - } return (ln); } From 41521775702cd0f9e829e966679724e905cca1f0 Mon Sep 17 00:00:00 2001 From: Bernhard Schmidt Date: Wed, 17 Nov 2010 09:28:17 +0000 Subject: [PATCH 13/38] Use kmem_alloc_contig() to honour the cache_type variable. Pointed out by: alc --- sys/compat/ndis/ntoskrnl_var.h | 10 +++++++++ sys/compat/ndis/subr_ntoskrnl.c | 37 +++++++++++++++++++++++++++------ 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/sys/compat/ndis/ntoskrnl_var.h b/sys/compat/ndis/ntoskrnl_var.h index 9ed52d8cb48d..ebe3f5dd2df2 100644 --- a/sys/compat/ndis/ntoskrnl_var.h +++ b/sys/compat/ndis/ntoskrnl_var.h @@ -162,6 +162,16 @@ typedef struct mdl mdl, ndis_buffer; #define WDM_MINOR_WINXP 0x20 #define WDM_MINOR_WIN2003 0x30 +enum nt_caching_type { + MmNonCached = 0, + MmCached = 1, + MmWriteCombined = 2, + MmHardwareCoherentCached = 3, + MmNonCachedUnordered = 4, + MmUSWCCached = 5, + MmMaximumCacheType = 6 +}; + /*- * The ndis_kspin_lock type is called KSPIN_LOCK in MS-Windows. * According to the Windows DDK header files, KSPIN_LOCK is defined like this: diff --git a/sys/compat/ndis/subr_ntoskrnl.c b/sys/compat/ndis/subr_ntoskrnl.c index f169de5698e5..a46640a36db2 100644 --- a/sys/compat/ndis/subr_ntoskrnl.c +++ b/sys/compat/ndis/subr_ntoskrnl.c @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -197,9 +198,10 @@ static uint32_t InterlockedDecrement(volatile uint32_t *); static void ExInterlockedAddLargeStatistic(uint64_t *, uint32_t); static void *MmAllocateContiguousMemory(uint32_t, uint64_t); static void *MmAllocateContiguousMemorySpecifyCache(uint32_t, - uint64_t, uint64_t, uint64_t, uint32_t); + uint64_t, uint64_t, uint64_t, enum nt_caching_type); static void MmFreeContiguousMemory(void *); -static void MmFreeContiguousMemorySpecifyCache(void *, uint32_t, uint32_t); +static void MmFreeContiguousMemorySpecifyCache(void *, uint32_t, + enum nt_caching_type); static uint32_t MmSizeOfMdl(void *, size_t); static void *MmMapLockedPages(mdl *, uint8_t); static void *MmMapLockedPagesSpecifyCache(mdl *, @@ -2424,11 +2426,34 @@ MmAllocateContiguousMemorySpecifyCache(size, lowest, highest, uint64_t lowest; uint64_t highest; uint64_t boundary; - uint32_t cachetype; + enum nt_caching_type cachetype; { + vm_memattr_t memattr; + void *ret; - return (contigmalloc(size, M_DEVBUF, M_ZERO|M_NOWAIT, lowest, - highest, PAGE_SIZE, boundary)); + switch (cachetype) { + case MmNonCached: + memattr = VM_MEMATTR_UNCACHEABLE; + break; + case MmWriteCombined: + memattr = VM_MEMATTR_WRITE_COMBINING; + break; + case MmNonCachedUnordered: + memattr = VM_MEMATTR_UNCACHEABLE; + break; + case MmCached: + case MmHardwareCoherentCached: + case MmUSWCCached: + default: + memattr = VM_MEMATTR_DEFAULT; + break; + } + + ret = (void *)kmem_alloc_contig(kernel_map, size, M_ZERO | M_NOWAIT, + lowest, highest, PAGE_SIZE, boundary, memattr); + if (ret != NULL) + malloc_type_allocated(M_DEVBUF, round_page(size)); + return (ret); } static void @@ -2442,7 +2467,7 @@ static void MmFreeContiguousMemorySpecifyCache(base, size, cachetype) void *base; uint32_t size; - uint32_t cachetype; + enum nt_caching_type cachetype; { contigfree(base, size, M_DEVBUF); } From 511fa5ac98055681b169b76b984e0821043188c4 Mon Sep 17 00:00:00 2001 From: Bernhard Schmidt Date: Wed, 17 Nov 2010 09:32:39 +0000 Subject: [PATCH 14/38] Fix a panic on i386 for drivers using MmAllocateContiguousMemory() and MmAllocateContiguousMemorySpecifyCache(). Those two functions take 64-bit variable(s) for their arguments. On i386 that takes additional 32-bit variable per argument. This is required so that windrv_wrap() can correctly wrap function that miniport driver calls with stdcall convention. Similar explanation is provided in subr_ndis.c for other functions. Submitted by: Paul B Mahol --- sys/compat/ndis/subr_ntoskrnl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/ndis/subr_ntoskrnl.c b/sys/compat/ndis/subr_ntoskrnl.c index a46640a36db2..1aaafdc18d8a 100644 --- a/sys/compat/ndis/subr_ntoskrnl.c +++ b/sys/compat/ndis/subr_ntoskrnl.c @@ -4237,8 +4237,8 @@ image_patch_table ntoskrnl_functbl[] = { IMPORT_FFUNC(ExInterlockedAddLargeStatistic, 2), IMPORT_SFUNC(IoAllocateMdl, 5), IMPORT_SFUNC(IoFreeMdl, 1), - IMPORT_SFUNC(MmAllocateContiguousMemory, 2), - IMPORT_SFUNC(MmAllocateContiguousMemorySpecifyCache, 5), + IMPORT_SFUNC(MmAllocateContiguousMemory, 2 + 1), + IMPORT_SFUNC(MmAllocateContiguousMemorySpecifyCache, 5 + 3), IMPORT_SFUNC(MmFreeContiguousMemory, 1), IMPORT_SFUNC(MmFreeContiguousMemorySpecifyCache, 3), IMPORT_SFUNC_MAP(MmGetPhysicalAddress, pmap_kextract, 1), From 683525038b676289425c19f2cbadd2494a0f3c38 Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Wed, 17 Nov 2010 10:43:20 +0000 Subject: [PATCH 15/38] Do not initialize flag variables before needed. Consistently use the LLE_ prefix for lla_lookup() and the ND6_ prefix for nd6_lookup() even though both are defined the same. Use the right flag variable when checking each. No real functional change. MFC after: 4 days --- sys/netinet6/nd6.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 0315469fe8f2..f07e47f3f345 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -836,7 +836,7 @@ nd6_lookup(struct in6_addr *addr6, int flags, struct ifnet *ifp) { struct sockaddr_in6 sin6; struct llentry *ln; - int llflags = 0; + int llflags; bzero(&sin6, sizeof(sin6)); sin6.sin6_len = sizeof(struct sockaddr_in6); @@ -845,13 +845,14 @@ nd6_lookup(struct in6_addr *addr6, int flags, struct ifnet *ifp) IF_AFDATA_LOCK_ASSERT(ifp); + llflags = 0; if (flags & ND6_CREATE) llflags |= LLE_CREATE; if (flags & ND6_EXCLUSIVE) llflags |= LLE_EXCLUSIVE; ln = lla_lookup(LLTABLE6(ifp), llflags, (struct sockaddr *)&sin6); - if ((ln != NULL) && (flags & LLE_CREATE)) + if ((ln != NULL) && (llflags & LLE_CREATE)) ln->ln_state = ND6_LLINFO_NOSTATE; return (ln); @@ -1451,7 +1452,7 @@ nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr, int do_update; int olladdr; int llchange; - int flags = 0; + int flags; int newstate = 0; uint16_t router = 0; struct sockaddr_in6 sin6; @@ -1478,13 +1479,13 @@ nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr, * Spec says nothing in sections for RA, RS and NA. There's small * description on it in NS section (RFC 2461 7.2.3). */ - flags |= lladdr ? ND6_EXCLUSIVE : 0; + flags = lladdr ? ND6_EXCLUSIVE : 0; IF_AFDATA_LOCK(ifp); ln = nd6_lookup(from, flags, ifp); if (ln == NULL) { - flags |= LLE_EXCLUSIVE; - ln = nd6_lookup(from, flags |ND6_CREATE, ifp); + flags |= ND6_EXCLUSIVE; + ln = nd6_lookup(from, flags | ND6_CREATE, ifp); IF_AFDATA_UNLOCK(ifp); is_newentry = 1; } else { From 51e5e45458acc003ae42de05224ecf06c1f2f1ac Mon Sep 17 00:00:00 2001 From: Ivan Voras Date: Wed, 17 Nov 2010 15:12:10 +0000 Subject: [PATCH 16/38] Change "wait" banner to "qlen" to be more indicative of its purpose and to be more inline with what gstat uses. Reviewed by: gnn Silence from: phk, keramida --- usr.sbin/iostat/iostat.8 | 2 +- usr.sbin/iostat/iostat.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/iostat/iostat.8 b/usr.sbin/iostat/iostat.8 index 6a9ef02b4dfb..69fadcff8ed7 100644 --- a/usr.sbin/iostat/iostat.8 +++ b/usr.sbin/iostat/iostat.8 @@ -348,7 +348,7 @@ write operations per second kilobytes read per second .It kw/s kilobytes write per second -.It wait +.It qlen transactions queue length .It svc_t average duration of transactions, in milliseconds diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c index dfa5ebc38aec..f4156406d801 100644 --- a/usr.sbin/iostat/iostat.c +++ b/usr.sbin/iostat/iostat.c @@ -750,11 +750,11 @@ devstats(int perf_select, long double etime, int havelast) printf("\n"); if (Iflag == 0) printf( - "device r/s w/s kr/s kw/s wait svc_t %%b " + "device r/s w/s kr/s kw/s qlen svc_t %%b " ); else printf( - "device r/i w/i kr/i kw/i wait svc_t %%b " + "device r/i w/i kr/i kw/i qlen svc_t %%b " ); if (Tflag > 0) printf("tin tout "); From 8da821ff0397d17719d231ad7e815c144d7209b3 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 17 Nov 2010 15:42:47 +0000 Subject: [PATCH 17/38] Remove unused autofs userland bits. Approved by: core --- lib/libautofs/Makefile | 11 - lib/libautofs/libautofs.3 | 265 ----------------- lib/libautofs/libautofs.c | 479 ------------------------------- lib/libautofs/libautofs.h | 104 ------- sbin/mount_autofs/Makefile | 9 - sbin/mount_autofs/mount_autofs.8 | 71 ----- sbin/mount_autofs/mount_autofs.c | 113 -------- 7 files changed, 1052 deletions(-) delete mode 100644 lib/libautofs/Makefile delete mode 100644 lib/libautofs/libautofs.3 delete mode 100644 lib/libautofs/libautofs.c delete mode 100644 lib/libautofs/libautofs.h delete mode 100644 sbin/mount_autofs/Makefile delete mode 100644 sbin/mount_autofs/mount_autofs.8 delete mode 100644 sbin/mount_autofs/mount_autofs.c diff --git a/lib/libautofs/Makefile b/lib/libautofs/Makefile deleted file mode 100644 index 197585699766..000000000000 --- a/lib/libautofs/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -# $Id: Makefile,v 1.5 2004/09/08 08:12:21 bright Exp $ -# $FreeBSD$ - -LIB= autofs -SHLIB_MAJOR= 3 - -SRCS= libautofs.c -INCS= libautofs.h -MAN= libautofs.3 - -.include diff --git a/lib/libautofs/libautofs.3 b/lib/libautofs/libautofs.3 deleted file mode 100644 index f4e07a90a9f6..000000000000 --- a/lib/libautofs/libautofs.3 +++ /dev/null @@ -1,265 +0,0 @@ -.\" Copyright (c) 2004 Alfred Perlstein -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" $Id: libautofs.3,v 1.4 2004/09/08 08:12:21 bright Exp $ -.\" $FreeBSD$ -.Dd September 9, 2004 -.Dt LIBAUTOFS 3 -.Os -.Sh NAME -.Nm libautofs -.Nd "procedural interface to managing an autofs file system" -.Sh SYNOPSIS -.In libautofs.h -.Ft int -.Fn autoh_get "const char *path" "autoh_t *hndlp" -.Ft void -.Fn autoh_free "autoh_t hndl" -.Ft int -.Fn autoh_getall "autoh_t **hndlpp" "int *cnt" -.Ft void -.Fn autoh_freeall "autoh_t *hndlep" -.Ft int -.Fn autoh_fd "autoh_t hndl" -.Ft const char * -.Fn autoh_mp "autoh_t hndl" -.Ft int -.Fn autoreq_get "autoh_t hndl" "autoreq_t **reqpp" "int *cntp" -.Ft void -.Fn autoreq_free "autoh_t hndl" "autoreq_t *reqp" -.Ft int -.Fn autoreq_serv "autoh_t hndl" "autoreq_t req" -.Ft enum autoreq_op -.Fn autoreq_getop "autoreq_t req" -.Ft const char * -.Fn autoreq_getpath "autoreq_t req" -.Ft autoino_t -.Fn autoreq_getino "autoreq_t req" -.Ft autoino_t -.Fn autoreq_getdirino "autoreq_t req" -.Ft void -.Fn autoreq_getaux "autoreq_t req" "void **auxdatap" "size_t *auxsizep" -.Ft void -.Fn autoreq_getoffset "autoreq_t req" "off_t *offp" -.Ft void -.Fn autoreq_getxid "autoreq_t req" "int *xidp" -.Ft void -.Fn autoreq_setino "autoreq_t req" "autoino_t ino" -.Ft void -.Fn autoreq_seterrno "autoreq_t req" "int errno" -.Ft void -.Fn autoreq_setaux "autoreq_t req" "void *auxdata" "size_t auxsize" -.Ft void -.Fn autoreq_seteof "autoreq_t req" "int eof" -.Ft int -.Fn autoh_togglepath "autoh_t hndl" "int toggle" "pid_t pid" "const char *path" -.Ft int -.Fn autoh_togglefd "autoh_t hndl" "int toggle" "pid_t pid" "int fd" -.Sh DESCRIPTION -The -.Nm libautofs -library provides a "mostly" stable interface to the -.Xr autofs 9 -file system. -.Pp -The interface to -.Xr autofs 9 -is managed via handles of type -.Fa autoh_t -and -.Fa autoreq_t -which refer to handles to -.Xr autofs 9 -mount points and requests respectively. -.Pp -The -.Fn autoh_get -function returns a handle to an -.Xr autofs 9 -file system based on the -.Fa path -parameter. -The handle returned should be freed via the -.Fn autoh_free -function. -.Pp -The -.Fn autoh_getall -function returns an array of handles to all mounted -.Xr autofs 9 -file systems, each of which should be released via the -.Fn autoh_free -function or released en-mass via the -.Fn autoh_freeall -function. -.Pp -The -.Fn autoh_fd -function returns a file descriptor that can be used with -.Xr select 2 -or -.Xr poll 2 -to check for "exceptional" data to detect an -.Xr autofs 9 -event. -Users of -.Xr select 2 -should set the fd in the -.Fa exceptfds -fd_set. -Users of -.Xr poll 2 -should set POLLPRI in the pollfd -.Fa fds -argument. -.Pp -The -.Fn autoh_mp -function returns the path to the autofs file system that the -.Fa hndl -is derived from. -.Pp -The -.Fn autoreq_get -function returns an array of autofs requests in -.Fa reqpp , -the number of requests is stored into -.Fa cntp . -Each request should be released using the -.Fn autoreq_free -function. -.Pp -Requests that are retrieved via the -.Fn autoreq_get -are served via the "autoreq_" functions. -.Pp -The following functions returns information about the request. -.Bl -tag -width indent -.It Fn autoreq_getop -return the operation type of the request, that would be one of -AUTOREQ_OP_UNKNOWN, AUTOREQ_OP_LOOKUP, AUTOREQ_OP_STAT, AUTOREQ_OP_READDIR -depending on the type of request that -.Xr autofs 9 -requires service from. -.It Fn autoreq_getpath -return the path of the mountpoint associated with the request -.Fa req . -.It Fn autoreq_getino -return the inode associated with the request -.Fa req . -.It Fn autoreq_getdirno -return the directory inode associated with the request -.Fa req . -.It Fn autoreq_getaux -return the auxiliary data associated with the request -.Fa req . -.It Fn autoreq_getoffset -return the offset request associated with the request -.Fa req . -(used for readdir request) -.It Fn autoreq_getxid -return the transaction id associated with an autofs request, these -are unique per mount point, but not system wide. -They can be used -for debugging to ensure requests are being accepted by the kernel. -.El -.Pp -The following functions allow one to set the response sent to -.Xr autofs 9 -to the requesting userland application. -.Bl -tag -width indent -.It Fn autoreq_setino -Set the request -.Fa req -inode to -.Fa ino , -this is typically unused. -.It Fn autoreq_seterrno -set the error returned to the application sending the request, typically -this is left alone, or set to ENOENT if the request is for a non-existent -name. -The default error is no error. -Meaning the application will see -a successful return. -.It Fn autoreq_setaux -used to set the auxiliary data for a request, currently used to set -the dirent structures for serving a readdir request. -Default is no -auxiliary data. -.It Fn autoreq_seteof -used to set the eof flag for readdir requests (default is not eof.) -.El -.Pp -The functions -.Fn autoh_togglepath -and -.Fn autoh_togglefd -are used to set options on an -.Xr autofs 9 -directory via -.Fa path -and -.Fa fd -respectively. -The -.Fa pid -argument should be set to the pid of the process serving -.Xr autofs 9 -requests, or -1 to disable the option. -The options are -.Bl -tag -width AUTO_INDIRECT -.It Fa AUTO_MOUNTER -set this process as the one responsible for the -.Xr autofs 9 -node, if this process exits, then requests into the autofs will begin to fail. -.It Fa AUTO_BROWSE -dispatch directory read requests for this node to the process identified by -.Fa pid . -Specifically, calls to -.Xr getdirentries 2 -and -.Xr getdents 2 -will be routed to userland after the current actual directory contents -are read into userland. -.It Fa AUTO_DIRECT -Set the directory as a mount trigger. -Any request to enter the directory -will trigger a callback into the process -.Fa pid . -.It Fa AUTO_INDIRECT -Set the directory as an indirect trigger. -Any request for an entry inside -the directory will be routed to the process identified by -.Fa pid . -.El -.Sh EXAMPLES -See /usr/share/examples/autofs/driver/ -.Sh HISTORY -The -.Nm -utility first appeared in -.Fx 6.0 . -.Sh AUTHORS -This manual page and the autofs file system suite were written by -.An Alfred Perlstein . diff --git a/lib/libautofs/libautofs.c b/lib/libautofs/libautofs.c deleted file mode 100644 index 459b32d2048b..000000000000 --- a/lib/libautofs/libautofs.c +++ /dev/null @@ -1,479 +0,0 @@ -/* - * Copyright (c) 2004 Alfred Perlstein - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - * $Id: libautofs.c,v 1.5 2004/09/08 08:44:12 bright Exp $ - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#ifdef AUTOFSSTANDALONE -#include "../autofs/autofs.h" -#else -#include -#endif - -#include "libautofs.h" - -struct auto_handle { - char ah_mp[MNAMELEN]; - fsid_t ah_fsid; - int ah_fd; -}; - -static int autofs_sysctl(int, fsid_t *, void *, size_t *, void *, size_t); -static void safe_free(void *ptr); -static int getmntlst(struct statfs **sfsp, int *cntp); - -static void -safe_free(void *ptr) -{ - int saved_errno; - - saved_errno = errno; - free(ptr); - errno = saved_errno; -} - -int -getmntlst(struct statfs **sfsp, int *cntp) -{ - int cnt; - long bufsize; - - *sfsp = NULL; - cnt = getfsstat(NULL, 0, MNT_NOWAIT); - bufsize = cnt * sizeof(**sfsp); - /*fprintf(stderr, "getmntlst bufsize %ld, cnt %d\n", bufsize, cnt);*/ - *sfsp = malloc(bufsize); - if (sfsp == NULL) - goto err; - cnt = getfsstat(*sfsp, bufsize, MNT_NOWAIT); - if (cnt == -1) - goto err; - *cntp = cnt; - /*fprintf(stderr, "getmntlst ok, cnt %d\n", cnt);*/ - return (0); -err: - safe_free(sfsp); - *sfsp = NULL; - /*fprintf(stderr, "getmntlst bad\n");*/ - return (-1); -} - -/* get a handle based on a path. */ -int -autoh_get(const char *path, autoh_t *ahp) -{ - struct statfs *sfsp, *sp; - int cnt, fd, i; - autoh_t ret; - - ret = NULL; - /* - * We use getfsstat to prevent avoid the lookups on the mountpoints - * that statfs(2) would do. - */ - if (getmntlst(&sfsp, &cnt)) - goto err; - for (i = 0; i < cnt; i++) { - if (strcmp(sfsp[i].f_mntonname, path) == 0) - break; - } - if (i == cnt) { - /*fprintf(stderr, "autoh_get bad %d %d\n", i, cnt);*/ - errno = ENOENT; - goto err; - } - sp = &sfsp[i]; - if (strcmp(sp->f_fstypename, "autofs")) { - errno = ENOTTY; - goto err; - } - fd = open(sp->f_mntonname, O_RDONLY); - if (fd == -1) - goto err; - ret = malloc(sizeof(*ret)); - if (ret == NULL) - goto err; - - ret->ah_fsid = sp->f_fsid; - ret->ah_fd = fd; - strlcpy(ret->ah_mp, sp->f_mntonname, sizeof(ret->ah_mp)); - safe_free(sfsp); - *ahp = ret; - return (0); -err: - safe_free(ret); - safe_free(sfsp); - return (-1); -} - -/* release. */ -void -autoh_free(autoh_t ah) -{ - int saved_errno; - - saved_errno = errno; - close(ah->ah_fd); - free(ah); - errno = saved_errno; -} - -/* - * Get an array of pointers to all the currently mounted autofs - * instances. - */ -int -autoh_getall(autoh_t **arrayp, int *cntp) -{ - struct statfs *sfsp; - int cnt, i, pos; - autoh_t *array; - - array = NULL; - /* - * We use getfsstat to prevent avoid the lookups on the mountpoints - * that statfs(2) would do. - */ - if (getmntlst(&sfsp, &cnt)) - goto err; - array = *arrayp = calloc(cnt + 1, sizeof(**arrayp)); - if (array == NULL) - goto err; - for (i = 0, pos = 0; i < cnt; i++) { - if (autoh_get(sfsp[i].f_mntonname, &array[pos]) == -1) { - /* not an autofs entry, that's ok, otherwise bail */ - if (errno == ENOTTY) - continue; - goto err; - } - pos++; - } - if (pos == 0) { - errno = ENOENT; - goto err; - } - *arrayp = array; - *cntp = pos; - safe_free(sfsp); - return (0); -err: - safe_free(sfsp); - if (array) - autoh_freeall(array); - return (-1); -} - -/* release. */ -void -autoh_freeall(autoh_t *ah) -{ - autoh_t *ahp; - - ahp = ah; - - while (*ahp != NULL) { - autoh_free(*ahp); - ahp++; - } - safe_free(ah); -} - -/* return fd to select on. */ -int -autoh_fd(autoh_t ah) -{ - - return (ah->ah_fd); -} - -const char * -autoh_mp(autoh_t ah) -{ - - return (ah->ah_mp); -} - -static int do_autoreq_get(autoh_t ah, autoreq_t *reqp, int *cntp); - -/* get an array of pending requests */ -int -autoreq_get(autoh_t ah, autoreq_t **reqpp, int *cntp) -{ - int cnt, i; - autoreq_t req, *reqp; - - if (do_autoreq_get(ah, &req, &cnt)) - return (-1); - - reqp = calloc(cnt + 1, sizeof(*reqp)); - if (reqp == NULL) { - safe_free(req); - return (-1); - } - for (i = 0; i < cnt; i++) - reqp[i] = &req[i]; - *reqpp = reqp; - *cntp = cnt; - return (0); -} - -int -do_autoreq_get(autoh_t ah, autoreq_t *reqp, int *cntp) -{ - size_t olen; - struct autofs_userreq *reqs; - int cnt, error; - int vers; - - vers = AUTOFS_PROTOVERS; - - error = 0; - reqs = NULL; - olen = 0; - cnt = 0; - error = autofs_sysctl(AUTOFS_CTL_GETREQS, &ah->ah_fsid, NULL, &olen, - &vers, sizeof(vers)); - if (error == -1) - goto out; - if (olen == 0) - goto out; - - reqs = malloc(olen); - if (reqs == NULL) - goto out; - error = autofs_sysctl(AUTOFS_CTL_GETREQS, &ah->ah_fsid, reqs, &olen, - &vers, sizeof(vers)); - if (error == -1) - goto out; -out: - if (error) { - safe_free(reqs); - return (-1); - } - cnt = olen / sizeof(*reqs); - *cntp = cnt; - *reqp = reqs; - return (0); -} - -/* free an array of requests */ -void -autoreq_free(autoh_t ah __unused, autoreq_t *req) -{ - - free(*req); - free(req); -} - -/* serve a request */ -int -autoreq_serv(autoh_t ah, autoreq_t req) -{ - int error; - - error = autofs_sysctl(AUTOFS_CTL_SERVREQ, &ah->ah_fsid, NULL, NULL, - req, sizeof(*req)); - return (error); -} - -enum autoreq_op -autoreq_getop(autoreq_t req) -{ - - switch (req->au_op) { - case AREQ_LOOKUP: - return (AUTOREQ_OP_LOOKUP); - case AREQ_STAT: - return (AUTOREQ_OP_STAT); - case AREQ_READDIR: - return (AUTOREQ_OP_READDIR); - default: - return (AUTOREQ_OP_UNKNOWN); - } -} - -/* get a request's file name. */ -const char * -autoreq_getpath(autoreq_t req) -{ - - return (req->au_name); -} - -/* get a request's inode. a indirect mount may return AUTO_INODE_NONE. */ -autoino_t -autoreq_getino(autoreq_t req) -{ - - return (req->au_ino); -} - -void -autoreq_setino(autoreq_t req, autoino_t ino) -{ - - req->au_ino = ino; -} - -/* get a request's directory inode. */ -autoino_t -autoreq_getdirino(autoreq_t req) -{ - - return (req->au_dino); -} - -void -autoreq_seterrno(autoreq_t req, int error) -{ - - req->au_errno = error; -} - -void -autoreq_setaux(autoreq_t req, void *auxdata, size_t auxlen) -{ - - req->au_auxdata = auxdata; - req->au_auxlen = auxlen; -} - -void -autoreq_getaux(autoreq_t req, void **auxdatap, size_t *auxlenp) -{ - - *auxdatap = req->au_auxdata; - *auxlenp = req->au_auxlen; -} - -void -autoreq_seteof(autoreq_t req, int eof) -{ - - req->au_eofflag = eof; -} - -void -autoreq_getoffset(autoreq_t req, off_t *offp) -{ - - *offp = req->au_offset - AUTOFS_USEROFF; -} - -void -autoreq_getxid(autoreq_t req, int *xid) -{ - - *xid = req->au_xid; -} - -/* toggle by path. args = handle, AUTO_?, pid (-1 to disable), path. */ -int -autoh_togglepath(autoh_t ah, int op, pid_t pid, const char *path) -{ - int fd, ret; - - fd = open(path, O_RDONLY); - if (fd == -1) - return (-1); - ret = autoh_togglefd(ah, op, pid, fd); - close(fd); - return (ret); -} - -/* toggle by fd. args = handle, AUTO_?, pid (-1 to disable), fd. */ -int -autoh_togglefd(autoh_t ah, int op, pid_t pid, int fd) -{ - struct stat sb; - struct autofs_mounterreq mr; - int error, realop; - - switch (op) { - case AUTO_DIRECT: - realop = AUTOFS_CTL_TRIGGER; - break; - case AUTO_INDIRECT: - realop = AUTOFS_CTL_SUBTRIGGER; - break; - case AUTO_MOUNTER: - realop = AUTOFS_CTL_MOUNTER; - break; - case AUTO_BROWSE: - realop = AUTOFS_CTL_BROWSE; - break; - default: - errno = ENOTTY; - return (-1); - } - - if (fstat(fd, &sb)) - return (-1); - bzero(&mr, sizeof(mr)); - mr.amu_ino = sb.st_ino; - mr.amu_pid = pid; - error = autofs_sysctl(realop, &ah->ah_fsid, NULL, NULL, - &mr, sizeof(mr)); - return (error); -} - -int -autofs_sysctl(op, fsid, oldp, oldlenp, newp, newlen) - int op; - fsid_t *fsid; - void *oldp; - size_t *oldlenp; - void *newp; - size_t newlen; -{ - struct vfsidctl vc; - - bzero(&vc, sizeof(vc)); - vc.vc_op = op; - strcpy(vc.vc_fstypename, "*"); - vc.vc_vers = VFS_CTL_VERS1; - vc.vc_fsid = *fsid; - vc.vc_ptr = newp; - vc.vc_len = newlen; - return (sysctlbyname("vfs.autofs.ctl", oldp, oldlenp, &vc, sizeof(vc))); -} - diff --git a/lib/libautofs/libautofs.h b/lib/libautofs/libautofs.h deleted file mode 100644 index f391bad3096f..000000000000 --- a/lib/libautofs/libautofs.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2004 Alfred Perlstein - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - * $Id: libautofs.h,v 1.4 2004/09/08 08:12:21 bright Exp $ - */ -#ifndef _LIBAUTOFS_H -#define _LIBAUTOFS_H - -struct auto_handle; -typedef struct auto_handle * autoh_t; -struct autofs_userreq; -typedef struct autofs_userreq * autoreq_t; -typedef uint64_t autoino_t; - -#define AUTO_INODE_NONE 0 - -#define AUTO_DIRECT 1 -#define AUTO_INDIRECT 2 -#define AUTO_MOUNTER 3 -#define AUTO_BROWSE 4 - -enum autoreq_op { - AUTOREQ_OP_UNKNOWN = 0, - AUTOREQ_OP_LOOKUP, - AUTOREQ_OP_STAT, - AUTOREQ_OP_READDIR -}; - -/* get a handle based on a path. */ -int autoh_get(const char *, autoh_t *); -/* release. */ -void autoh_free(autoh_t); - -/* - * Get an array of pointers to handles for all autofs mounts, returns count - * or -1 - */ -int autoh_getall(autoh_t **, int *cnt); -/* free the array of pointers */ -void autoh_freeall(autoh_t *); - -/* return fd to select on. */ -int autoh_fd(autoh_t); - -/* returns the mount point of the autofs instance. */ -const char *autoh_mp(autoh_t); - -/* get an array of pending requests */ -int autoreq_get(autoh_t, autoreq_t **, int *); -/* free an array of requests */ -void autoreq_free(autoh_t, autoreq_t *); -/* serve a request */ -int autoreq_serv(autoh_t, autoreq_t); - -/* get the operation requested */ -enum autoreq_op autoreq_getop(autoreq_t); - -/* get a request's file name. */ -const char *autoreq_getpath(autoreq_t); -/* get a request's inode. a indirect mount may return AUTO_INODE_NONE. */ -autoino_t autoreq_getino(autoreq_t); -/* - * set a request's inode. an indirect mount may return AUTO_INODE_NONE, - * this is a fixup for indirect mounts. - */ -void autoreq_setino(autoreq_t, autoino_t); -/* get a request's directory inode. */ -autoino_t autoreq_getdirino(autoreq_t); -void autoreq_seterrno(autoreq_t, int); -void autoreq_setaux(autoreq_t, void *, size_t); -void autoreq_getaux(autoreq_t, void **, size_t *); -void autoreq_seteof(autoreq_t, int); -void autoreq_getoffset(autoreq_t, off_t *); -void autoreq_getxid(autoreq_t, int *); - -/* toggle by path. args = handle, AUTO_?, pid (-1 to disable), path. */ -int autoh_togglepath(autoh_t, int, pid_t, const char *); -/* toggle by fd. args = handle, AUTO_?, pid (-1 to disable), fd. */ -int autoh_togglefd(autoh_t, int, pid_t, int); - -#endif diff --git a/sbin/mount_autofs/Makefile b/sbin/mount_autofs/Makefile deleted file mode 100644 index b05d9613df71..000000000000 --- a/sbin/mount_autofs/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# $Id: Makefile,v 1.6 2004/09/08 08:27:12 bright Exp $ -# $FreeBSD$ - -PROG=mount_autofs -MAN=mount_autofs.8 -BINDIR?=/sbin -WARNS?= 2 - -.include diff --git a/sbin/mount_autofs/mount_autofs.8 b/sbin/mount_autofs/mount_autofs.8 deleted file mode 100644 index 5f10ea72e188..000000000000 --- a/sbin/mount_autofs/mount_autofs.8 +++ /dev/null @@ -1,71 +0,0 @@ -.\" Copyright (c) 2004 Alfred Perlstein -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" $Id: mount_autofs.8,v 1.3 2004/09/08 08:12:21 bright Exp $ -.\" $FreeBSD$ -.Dd August 30, 2004 -.Dt MOUNT_AUTOFS 8 -.Os -.Sh NAME -.Nm mount_autofs -.Nd mount an autofs file system -.Sh SYNOPSIS -.Nm -.Op Fl o Ar options -.Ar dummy -.Ar node -.Sh DESCRIPTION -The -.Nm -utility attaches an autofs file system -device on to the file system tree at the point -.Ar node . -.Pp -This command is normally executed by -.Xr mount 8 -at boot time. -.Pp -The options are as follows: -.Bl -tag -width indent -.It Fl o -Options are specified with a -.Fl o -flag followed by a comma separated string of options. -See the -.Xr mount 8 -man page for possible options and their meanings. -.El -.Sh SEE ALSO -.Xr mount 2 , -.Xr unmount 2 , -.Xr fstab 5 , -.Xr mount 8 -.Sh HISTORY -The -.Nm -utility first appeared in -.Fx 6.0 . -.Sh AUTHORS -This manual page and the autofs file system suite were written by -.An Alfred Perlstein . diff --git a/sbin/mount_autofs/mount_autofs.c b/sbin/mount_autofs/mount_autofs.c deleted file mode 100644 index 17fbb5b5b6fe..000000000000 --- a/sbin/mount_autofs/mount_autofs.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2004 Alfred Perlstein - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: mount_autofs.c,v 1.5 2004/09/08 08:12:21 bright Exp $ - * $FreeBSD$ - */ -#include -#include -#include -#include -#include - -#include -#include -#include - -void usage(void); - -const char *progname; - -void -usage(void) { - - errx(1, "usage: %s node", progname); -} -int mymount(const char *type, const char *dir, int flags, void *data); - -#if __FreeBSD_version < 600000 -int -mymount(const char *type, const char *dir, int flags, void *data) -{ - - return (mount(type, dir, flags, data)); -} -#else -void ioset(struct iovec *iovp, const char *str); - -void -ioset(struct iovec *iovp, const char *str) -{ - - iovp->iov_base = __DECONST(char *, str); - iovp->iov_len = strlen(str) + 1; -} - -int -mymount( - const char *type, - const char *dir, - int flags __unused, - void *data __unused -) -{ - struct iovec iov[4], *iovp; - - iovp = &iov[0]; - ioset(iovp++, "fstype"); - ioset(iovp++, type); - ioset(iovp++, "fspath"); - ioset(iovp++, dir); - return (nmount(iov, 4, 0)); -} -#endif - -int -main(int argc, char **argv) -{ - int error; - int ch; - - progname = argv[0]; - - while ((ch = getopt(argc, argv, "o:")) != -1) { - /* just eat opts for now */ - switch (ch) { - case '?': - usage(); - } - } - argc -= optind; - argv += optind; - - if (argc < 2) { - usage(); - } - - error = mymount("autofs", argv[1], 0, NULL); - if (error) - perror("mount"); - return (error == 0 ? EXIT_SUCCESS : EXIT_FAILURE); -} From 1563ee36b996c993c5a34cefe573bed96b26ebc3 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Wed, 17 Nov 2010 16:17:15 +0000 Subject: [PATCH 18/38] Only save FPU context when not executing in the context of the crypto thread. Tested by: Mike Tancsa --- sys/crypto/aesni/aesni_wrap.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/sys/crypto/aesni/aesni_wrap.c b/sys/crypto/aesni/aesni_wrap.c index 36c66eac13f6..3fd397c6e5c8 100644 --- a/sys/crypto/aesni/aesni_wrap.c +++ b/sys/crypto/aesni/aesni_wrap.c @@ -246,14 +246,21 @@ int aesni_cipher_setup(struct aesni_session *ses, struct cryptoini *encini) { struct thread *td; - int error; + int error, saved_ctx; td = curthread; - error = fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); + if (!is_fpu_kern_thread(0)) { + error = fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); + saved_ctx = 1; + } else { + error = 0; + saved_ctx = 0; + } if (error == 0) { error = aesni_cipher_setup_common(ses, encini->cri_key, encini->cri_klen); - fpu_kern_leave(td, &ses->fpu_ctx); + if (saved_ctx) + fpu_kern_leave(td, &ses->fpu_ctx); } return (error); } @@ -264,16 +271,22 @@ aesni_cipher_process(struct aesni_session *ses, struct cryptodesc *enccrd, { struct thread *td; uint8_t *buf; - int error, allocated; + int error, allocated, saved_ctx; buf = aesni_cipher_alloc(enccrd, crp, &allocated); if (buf == NULL) return (ENOMEM); td = curthread; - error = fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); - if (error != 0) - goto out; + if (!is_fpu_kern_thread(0)) { + error = fpu_kern_enter(td, &ses->fpu_ctx, FPU_KERN_NORMAL); + if (error != 0) + goto out; + saved_ctx = 1; + } else { + saved_ctx = 0; + error = 0; + } if ((enccrd->crd_flags & CRD_F_KEY_EXPLICIT) != 0) { error = aesni_cipher_setup_common(ses, enccrd->crd_key, @@ -311,7 +324,8 @@ aesni_cipher_process(struct aesni_session *ses, struct cryptodesc *enccrd, ses->iv); } } - fpu_kern_leave(td, &ses->fpu_ctx); + if (saved_ctx) + fpu_kern_leave(td, &ses->fpu_ctx); if (allocated) crypto_copyback(crp->crp_flags, crp->crp_buf, enccrd->crd_skip, enccrd->crd_len, buf); From 2cbfd42740a69d1c06163a8aa06293741a479b99 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Wed, 17 Nov 2010 16:17:35 +0000 Subject: [PATCH 19/38] Add IDs for VIA VX900 chipset SATA controller. MFC after: 1 week --- sys/dev/ata/chipsets/ata-via.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/ata/chipsets/ata-via.c b/sys/dev/ata/chipsets/ata-via.c index 284a89280d06..347cd2615b17 100644 --- a/sys/dev/ata/chipsets/ata-via.c +++ b/sys/dev/ata/chipsets/ata-via.c @@ -106,6 +106,7 @@ ata_via_probe(device_t dev) { ATA_VIACX700, 0x00, VIA133, VIASATA, ATA_SA150, "CX700" }, { ATA_VIAVX800, 0x00, VIA133, VIASATA, ATA_SA150, "VX800" }, { ATA_VIAVX855, 0x00, VIA133, 0x00, ATA_UDMA6, "VX855" }, + { ATA_VIAVX900, 0x00, VIA133, VIASATA, ATA_SA300, "VX900" }, { 0, 0, 0, 0, 0, 0 }}; static struct ata_chip_id new_ids[] = {{ ATA_VIA6410, 0x00, 0, 0x00, ATA_UDMA6, "6410" }, @@ -123,7 +124,9 @@ ata_via_probe(device_t dev) if (pci_get_devid(dev) == ATA_VIA82C571 || pci_get_devid(dev) == ATA_VIACX700IDE || - pci_get_devid(dev) == ATA_VIASATAIDE) { + pci_get_devid(dev) == ATA_VIASATAIDE || + pci_get_devid(dev) == ATA_VIASATAIDE2 || + pci_get_devid(dev) == ATA_VIASATAIDE3) { if (!(ctlr->chip = ata_find_chip(dev, ids, -99))) return ENXIO; } From 040545848d203804a186cf6af2b992335ae73ffd Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Wed, 17 Nov 2010 17:52:04 +0000 Subject: [PATCH 20/38] Add IDs for VIA VX900 chipset SATA controller. (Missed part of r215428) --- sys/dev/ata/ata-pci.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/ata/ata-pci.h b/sys/dev/ata/ata-pci.h index 258212eb9b65..7964601a6574 100644 --- a/sys/dev/ata/ata-pci.h +++ b/sys/dev/ata/ata-pci.h @@ -512,7 +512,10 @@ struct ata_pci_controller { #define ATA_VIACX700 0x83241106 #define ATA_VIASATAIDE 0x53241106 #define ATA_VIAVX800 0x83531106 +#define ATA_VIASATAIDE2 0xc4091106 #define ATA_VIAVX855 0x84091106 +#define ATA_VIASATAIDE3 0x90011106 +#define ATA_VIAVX900 0x84101106 /* global prototypes ata-pci.c */ int ata_pci_probe(device_t dev); From 2f4fcd485d93d3b8df17d21df33e430bce5e4674 Mon Sep 17 00:00:00 2001 From: Pyun YongHyeon Date: Wed, 17 Nov 2010 18:09:02 +0000 Subject: [PATCH 21/38] MCP55 is the only NVIDIA controller that supports VLAN tag insertion/stripping and it also supports TSO over VLAN. Implement TSO over VLAN support for MCP55 controller. While I'm here clean up SIOCSIFCAP ioctl handler. Since nfe(4) sets ifp capabilities based on various hardware flags in device attach, there is no need to check hardware flags again in SIOCSIFCAP ioctl handler. Also fix a bug which toggled both TX and RX checksum offloading even if user requested either TX or RX checksum configuration change. Tested by: Rob Farmer ( rfarmer <> predatorlabs dot net ) --- sys/dev/nfe/if_nfe.c | 57 ++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/sys/dev/nfe/if_nfe.c b/sys/dev/nfe/if_nfe.c index c77a4da3c56b..8e816f6f61f5 100644 --- a/sys/dev/nfe/if_nfe.c +++ b/sys/dev/nfe/if_nfe.c @@ -593,7 +593,8 @@ nfe_attach(device_t dev) if ((sc->nfe_flags & NFE_HW_VLAN) != 0) { ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING; if ((ifp->if_capabilities & IFCAP_HWCSUM) != 0) - ifp->if_capabilities |= IFCAP_VLAN_HWCSUM; + ifp->if_capabilities |= IFCAP_VLAN_HWCSUM | + IFCAP_VLAN_HWTSO; } if (pci_find_extcap(dev, PCIY_PMG, ®) == 0) @@ -1777,20 +1778,35 @@ nfe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) if ((mask & IFCAP_WOL_MAGIC) != 0 && (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0) ifp->if_capenable ^= IFCAP_WOL_MAGIC; - - if ((sc->nfe_flags & NFE_HW_CSUM) != 0 && - (mask & IFCAP_HWCSUM) != 0) { - ifp->if_capenable ^= IFCAP_HWCSUM; - if ((IFCAP_TXCSUM & ifp->if_capenable) != 0 && - (IFCAP_TXCSUM & ifp->if_capabilities) != 0) + if ((mask & IFCAP_TXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { + ifp->if_capenable ^= IFCAP_TXCSUM; + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) ifp->if_hwassist |= NFE_CSUM_FEATURES; else ifp->if_hwassist &= ~NFE_CSUM_FEATURES; + } + if ((mask & IFCAP_RXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_RXCSUM) != 0) { + ifp->if_capenable ^= IFCAP_RXCSUM; init++; } - if ((sc->nfe_flags & NFE_HW_VLAN) != 0 && - (mask & IFCAP_VLAN_HWTAGGING) != 0) { + if ((mask & IFCAP_TSO4) != 0 && + (ifp->if_capabilities & IFCAP_TSO4) != 0) { + ifp->if_capenable ^= IFCAP_TSO4; + if ((IFCAP_TSO4 & ifp->if_capenable) != 0) + ifp->if_hwassist |= CSUM_TSO; + else + 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; + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) + ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; init++; } /* @@ -1800,28 +1816,17 @@ nfe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) * VLAN stripping. So when we know Rx checksum offload is * disabled turn entire hardware VLAN assist off. */ - if ((sc->nfe_flags & (NFE_HW_CSUM | NFE_HW_VLAN)) == - (NFE_HW_CSUM | NFE_HW_VLAN)) { - if ((ifp->if_capenable & IFCAP_RXCSUM) == 0) - ifp->if_capenable &= ~IFCAP_VLAN_HWTAGGING; + if ((ifp->if_capenable & IFCAP_RXCSUM) == 0) { + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) + init++; + ifp->if_capenable &= ~(IFCAP_VLAN_HWTAGGING | + IFCAP_VLAN_HWTSO); } - - if ((sc->nfe_flags & NFE_HW_CSUM) != 0 && - (mask & IFCAP_TSO4) != 0) { - ifp->if_capenable ^= IFCAP_TSO4; - if ((IFCAP_TSO4 & ifp->if_capenable) != 0 && - (IFCAP_TSO4 & ifp->if_capabilities) != 0) - ifp->if_hwassist |= CSUM_TSO; - else - ifp->if_hwassist &= ~CSUM_TSO; - } - if (init > 0 && (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; nfe_init(sc); } - if ((sc->nfe_flags & NFE_HW_VLAN) != 0) - VLAN_CAPABILITIES(ifp); + VLAN_CAPABILITIES(ifp); break; default: error = ether_ioctl(ifp, cmd, data); From f5d34df525d0214cd98141d75e2ca7d89887d44c Mon Sep 17 00:00:00 2001 From: "George V. Neville-Neil" Date: Wed, 17 Nov 2010 18:55:12 +0000 Subject: [PATCH 22/38] Add new, per connection, statistics for TCP, including: Retransmitted Packets Zero Window Advertisements Out of Order Receives These statistics are available via the -T argument to netstat(1). MFC after: 2 weeks --- sys/netinet/tcp.h | 5 ++++- sys/netinet/tcp_output.c | 6 ++++-- sys/netinet/tcp_reass.c | 1 + sys/netinet/tcp_usrreq.c | 3 +++ sys/netinet/tcp_var.h | 3 +++ usr.bin/netstat/inet.c | 39 ++++++++++++++++++++++++--------------- usr.bin/netstat/main.c | 11 +++++++++-- usr.bin/netstat/netstat.1 | 6 +++++- usr.bin/netstat/netstat.h | 1 + 9 files changed, 54 insertions(+), 21 deletions(-) diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index 62a89f7addac..443425f7c721 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -225,9 +225,12 @@ struct tcp_info { u_int32_t tcpi_snd_nxt; /* Next egress seqno */ u_int32_t tcpi_rcv_nxt; /* Next ingress seqno */ u_int32_t tcpi_toe_tid; /* HWTID for TOE endpoints */ + u_int32_t tcpi_snd_rexmitpack; /* Retransmitted packets */ + u_int32_t tcpi_rcv_ooopack; /* Out-of-order packets */ + u_int32_t tcpi_snd_zerowin; /* Zero-sized windows sent */ /* Padding to grow without breaking ABI. */ - u_int32_t __tcpi_pad[29]; /* Padding. */ + u_int32_t __tcpi_pad[26]; /* Padding. */ }; #endif diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 7db0adb42ded..bf42dacf02dd 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -803,6 +803,7 @@ tcp_output(struct tcpcb *tp) if ((tp->t_flags & TF_FORCEDATA) && len == 1) TCPSTAT_INC(tcps_sndprobe); else if (SEQ_LT(tp->snd_nxt, tp->snd_max) || sack_rxmit) { + tp->t_sndrexmitpack++; TCPSTAT_INC(tcps_sndrexmitpack); TCPSTAT_ADD(tcps_sndrexmitbyte, len); } else { @@ -1027,9 +1028,10 @@ tcp_output(struct tcpcb *tp) * to read more data than can be buffered prior to transmitting on * the connection. */ - if (th->th_win == 0) + if (th->th_win == 0) { + tp->t_sndzerowin++; tp->t_flags |= TF_RXWIN0SENT; - else + } else tp->t_flags &= ~TF_RXWIN0SENT; if (SEQ_GT(tp->snd_up, tp->snd_nxt)) { th->th_urp = htons((u_short)(tp->snd_up - tp->snd_nxt)); diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 1d840cd4175a..d430991fc2f8 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -266,6 +266,7 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tlenp, struct mbuf *m) th->th_seq += i; } } + tp->t_rcvoopack++; TCPSTAT_INC(tcps_rcvoopack); TCPSTAT_ADD(tcps_rcvoobyte, *tlenp); diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index a28ddef232a7..a2231ba46fda 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1218,6 +1218,9 @@ tcp_fill_info(struct tcpcb *tp, struct tcp_info *ti) ti->tcpi_rcv_mss = tp->t_maxseg; if (tp->t_flags & TF_TOE) ti->tcpi_options |= TCPI_OPT_TOE; + ti->tcpi_snd_rexmitpack = tp->t_sndrexmitpack; + ti->tcpi_rcv_ooopack = tp->t_rcvoopack; + ti->tcpi_snd_zerowin = tp->t_sndzerowin; } /* diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 7b386670035a..a37d306ad6cd 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -177,6 +177,7 @@ struct tcpcb { u_long snd_cwnd_prev; /* cwnd prior to retransmit */ u_long snd_ssthresh_prev; /* ssthresh prior to retransmit */ tcp_seq snd_recover_prev; /* snd_recover prior to retransmit */ + int t_sndzerowin; /* zero-window updates sent */ u_int t_badrxtwin; /* window for retransmit recovery */ u_char snd_limited; /* segments limited transmitted */ /* SACK related state */ @@ -193,6 +194,8 @@ struct tcpcb { u_int32_t rfbuf_ts; /* recv buffer autoscaling timestamp */ int rfbuf_cnt; /* recv buffer autoscaling byte count */ struct toe_usrreqs *t_tu; /* offload operations vector */ + int t_sndrexmitpack; /* retransmit packets sent */ + int t_rcvoopack; /* out-of-order packets received */ void *t_toe; /* TOE pcb pointer */ int t_bytes_acked; /* # bytes acked during current RTT */ struct cc_algo *cc_algo; /* congestion control algorithm */ diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c index a975287ce85f..01a02429f35d 100644 --- a/usr.bin/netstat/inet.c +++ b/usr.bin/netstat/inet.c @@ -411,25 +411,30 @@ protopr(u_long off, const char *name, int af1, int proto) if (Lflag) printf("%-5.5s %-14.14s %-22.22s\n", "Proto", "Listen", "Local Address"); - else { + if (Tflag) + printf((Aflag && !Wflag) ? + "%-5.5s %-6.6s %-6.6s %-6.6s %-18.18s %s\n" : + "%-5.5s %-6.6s %-6.6s %-6.6s %-22.22s %s\n", + "Proto", "Rexmit", "OOORcv", "0-win", + "Local Address", "Foreign Address"); + if (xflag) { + printf("%-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s ", + "R-MBUF", "S-MBUF", "R-CLUS", + "S-CLUS", "R-HIWA", "S-HIWA", + "R-LOWA", "S-LOWA", "R-BCNT", + "S-BCNT", "R-BMAX", "S-BMAX"); + printf("%7.7s %7.7s %7.7s %7.7s %7.7s %7.7s %s\n", + "rexmt", "persist", "keep", + "2msl", "delack", "rcvtime", + "(state)"); + } + if (!xflag && !Tflag) printf((Aflag && !Wflag) ? "%-5.5s %-6.6s %-6.6s %-18.18s %-18.18s" : "%-5.5s %-6.6s %-6.6s %-22.22s %-22.22s", "Proto", "Recv-Q", "Send-Q", "Local Address", "Foreign Address"); - if (xflag) { - printf("%-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s ", - "R-MBUF", "S-MBUF", "R-CLUS", - "S-CLUS", "R-HIWA", "S-HIWA", - "R-LOWA", "S-LOWA", "R-BCNT", - "S-BCNT", "R-BMAX", "S-BMAX"); - printf("%7.7s %7.7s %7.7s %7.7s %7.7s %7.7s %s\n", - "rexmt", "persist", "keep", - "2msl", "delack", "rcvtime", - "(state)"); - } else - printf("(state)\n"); - } + first = 0; } if (Lflag && so->so_qlimit == 0) @@ -455,6 +460,10 @@ protopr(u_long off, const char *name, int af1, int proto) snprintf(buf1, 15, "%d/%d/%d", so->so_qlen, so->so_incqlen, so->so_qlimit); printf("%-14.14s ", buf1); + } else if (Tflag) { + if (istcp) + printf("%6u %6u %6u ", tp->t_sndrexmitpack, + tp->t_rcvoopack, tp->t_sndzerowin); } else { printf("%6u %6u ", so->so_rcv.sb_cc, so->so_snd.sb_cc); } @@ -540,7 +549,7 @@ protopr(u_long off, const char *name, int af1, int proto) timer->t_rcvtime / 1000, (timer->t_rcvtime % 1000) / 10); } } - if (istcp && !Lflag) { + if (istcp && !Lflag && !xflag && !Tflag) { if (tp->t_state < 0 || tp->t_state >= TCP_NSTATES) printf("%d", tp->t_state); else { diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index f54db4ee700f..43b3232fc56a 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -342,6 +342,7 @@ int Qflag; /* show netisr information */ int rflag; /* show routing tables (or routing stats) */ int sflag; /* show protocol statistics */ int Wflag; /* wide display */ +int Tflag; /* TCP Information */ int xflag; /* extra information, includes all socket buffer info */ int zflag; /* zero stats */ @@ -361,7 +362,7 @@ main(int argc, char *argv[]) af = AF_UNSPEC; - while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:Qq:rSsuWw:xz")) + while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:Qq:rSTsuWw:xz")) != -1) switch(ch) { case 'A': @@ -476,6 +477,9 @@ main(int argc, char *argv[]) interval = atoi(optarg); iflag = 1; break; + case 'T': + Tflag = 1; + break; case 'x': xflag = 1; break; @@ -515,6 +519,9 @@ main(int argc, char *argv[]) if (!live) setgid(getgid()); + if (xflag && Tflag) + errx(1, "-x and -T are incompatible, pick one."); + if (Bflag) { if (!live) usage(); @@ -794,7 +801,7 @@ static void usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", -"usage: netstat [-AaLnSWx] [-f protocol_family | -p protocol]\n" +"usage: netstat [-AaLnSTWx] [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", " netstat -i | -I interface [-abdhnW] [-f address_family]\n" " [-M core] [-N system]", diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1 index 6cf895b455a4..2214d4715493 100644 --- a/usr.bin/netstat/netstat.1 +++ b/usr.bin/netstat/netstat.1 @@ -49,7 +49,7 @@ depending on the options for the information presented. .It Xo .Bk -words .Nm -.Op Fl AaLnSWx +.Op Fl AaLnSTWx .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system @@ -88,6 +88,10 @@ but show ports symbolically. If .Fl x is present, display socket buffer and tcp timer statistics for each internet socket. +When +.Fl T +is present, display information from the TCP control block, including +retransmits, out-of-order packets received, and zero-sized windows advertised. .It Xo .Bk -words .Nm diff --git a/usr.bin/netstat/netstat.h b/usr.bin/netstat/netstat.h index da3f8f38d593..18608702e5fe 100644 --- a/usr.bin/netstat/netstat.h +++ b/usr.bin/netstat/netstat.h @@ -50,6 +50,7 @@ extern int numeric_addr; /* show addresses numerically */ extern int numeric_port; /* show ports numerically */ extern int rflag; /* show routing tables (or routing stats) */ extern int sflag; /* show protocol statistics */ +extern int Tflag; /* show TCP control block info */ extern int Wflag; /* wide display */ extern int xflag; /* extended display, includes all socket buffer info */ extern int zflag; /* zero stats */ From 565d322630f1b4c2e07bd0ce3831c63a3435896c Mon Sep 17 00:00:00 2001 From: Andreas Tobler Date: Wed, 17 Nov 2010 19:25:37 +0000 Subject: [PATCH 23/38] Load the full 16k stack space. Approved by: nwhitehorn (mentor) --- sys/boot/powerpc/ofw/start.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/boot/powerpc/ofw/start.c b/sys/boot/powerpc/ofw/start.c index ff3fcd88c5a2..60c5db7559f8 100644 --- a/sys/boot/powerpc/ofw/start.c +++ b/sys/boot/powerpc/ofw/start.c @@ -48,7 +48,7 @@ stack: \n\ _start: \n\ lis %r1,stack@ha \n\ addi %r1,%r1,stack@l \n\ - addi %r1,%r1,8192 \n\ + addi %r1,%r1,16384 \n\ \n\ b startup \n\ "); From 6f9943822bd5646f9f9677dcf30ac0b92e5198dd Mon Sep 17 00:00:00 2001 From: Andreas Tobler Date: Wed, 17 Nov 2010 19:28:48 +0000 Subject: [PATCH 24/38] Make sure the .bss is cleared at the beginning. The pSeries OF ELF loader does not clear .bss automatically. Approved by: nwhitehorn (mentor) --- sys/boot/powerpc/ofw/start.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sys/boot/powerpc/ofw/start.c b/sys/boot/powerpc/ofw/start.c index 60c5db7559f8..8637e1f810af 100644 --- a/sys/boot/powerpc/ofw/start.c +++ b/sys/boot/powerpc/ofw/start.c @@ -50,7 +50,20 @@ _start: \n\ addi %r1,%r1,stack@l \n\ addi %r1,%r1,16384 \n\ \n\ - b startup \n\ + /* Clear the .bss!!! */ \n\ + li %r0,0 \n\ + lis %r8,_edata@ha \n\ + addi %r8,%r8,_edata@l\n\ + lis %r9,_end@ha \n\ + addi %r9,%r9,_end@l \n\ + \n\ +1: cmpw 0,%r8,%r9 \n\ + bge 2f \n\ + stw %r0,0(%r8) \n\ + addi %r8,%r8,4 \n\ + b 1b \n\ + \n\ +2: b startup \n\ "); void From cb1b50fa7c64d893e342c27882b18e39f85127ab Mon Sep 17 00:00:00 2001 From: Andreas Tobler Date: Wed, 17 Nov 2010 19:31:48 +0000 Subject: [PATCH 25/38] Move the declaration of the eh struct (used only when debugging is enabled) from ofwn_put into the debug section. Approved by: nwhitehorn (mentor) --- sys/boot/ofw/libofw/ofw_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/boot/ofw/libofw/ofw_net.c b/sys/boot/ofw/libofw/ofw_net.c index 830fcda3bb7f..36600efd0fe2 100644 --- a/sys/boot/ofw/libofw/ofw_net.c +++ b/sys/boot/ofw/libofw/ofw_net.c @@ -90,11 +90,11 @@ ofwn_probe(struct netif *nif, void *machdep_hint) static int ofwn_put(struct iodesc *desc, void *pkt, size_t len) { - struct ether_header *eh; size_t sendlen; ssize_t rv; #if defined(NETIF_DEBUG) + struct ether_header *eh; printf("netif_put: desc=0x%x pkt=0x%x len=%d\n", desc, pkt, len); eh = pkt; printf("dst: %s ", ether_sprintf(eh->ether_dhost)); From da068879c59171af5a1b7c747f47335aed819937 Mon Sep 17 00:00:00 2001 From: Andreas Tobler Date: Wed, 17 Nov 2010 19:35:56 +0000 Subject: [PATCH 26/38] Check the real-mode? OF property to find out whether we operate in real or virtual mode. In virtual mode we have to do memory mapping. On PowerMacs it is usually false while on pSeries we have found that it is true. The real-mode? property is not available on sparc64. Approved by: nwhitehorn (mentor) --- sys/boot/ofw/libofw/ofw_copy.c | 24 +++++++++++++++--------- sys/boot/ofw/libofw/openfirm.c | 12 ++++++++++++ sys/boot/ofw/libofw/openfirm.h | 1 + 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/sys/boot/ofw/libofw/ofw_copy.c b/sys/boot/ofw/libofw/ofw_copy.c index 781d4233a014..ffd698731503 100644 --- a/sys/boot/ofw/libofw/ofw_copy.c +++ b/sys/boot/ofw/libofw/ofw_copy.c @@ -91,16 +91,22 @@ ofw_mapmem(vm_offset_t dest, const size_t len) return (ENOMEM); } - if (OF_call_method("claim", mmu, 3, 1, destp, dlen, 0, &addr) == -1) { - printf("ofw_mapmem: virtual claim failed\n"); - return (ENOMEM); - } - - if (OF_call_method("map", mmu, 4, 0, destp, destp, dlen, 0) == -1) { - printf("ofw_mapmem: map failed\n"); - return (ENOMEM); - } + /* + * We only do virtual memory management when real_mode is false. + */ + if (real_mode == 0) { + if (OF_call_method("claim", mmu, 3, 1, destp, dlen, 0, &addr) + == -1) { + printf("ofw_mapmem: virtual claim failed\n"); + return (ENOMEM); + } + if (OF_call_method("map", mmu, 4, 0, destp, destp, dlen, 0) + == -1) { + printf("ofw_mapmem: map failed\n"); + return (ENOMEM); + } + } last_dest = (vm_offset_t) destp; last_len = dlen; diff --git a/sys/boot/ofw/libofw/openfirm.c b/sys/boot/ofw/libofw/openfirm.c index 4b84fa10c422..0114fb58f738 100644 --- a/sys/boot/ofw/libofw/openfirm.c +++ b/sys/boot/ofw/libofw/openfirm.c @@ -69,12 +69,15 @@ int (*openfirmware)(void *); phandle_t chosen; ihandle_t mmu; ihandle_t memory; +int real_mode = 0; /* Initialiser */ void OF_init(int (*openfirm)(void *)) { + phandle_t options; + char mode[8]; openfirmware = openfirm; @@ -89,6 +92,15 @@ OF_init(int (*openfirm)(void *)) } if (OF_getprop(chosen, "mmu", &mmu, sizeof(mmu)) == -1) OF_exit(); + + /* + * Check if we run in real mode. If so, we do not need to map + * memory later on. + */ + options = OF_finddevice("/options"); + OF_getprop(options, "real-mode?", mode, sizeof(mode)); + if (strncmp(mode, "true", 4) == 0) + real_mode = 1; } /* diff --git a/sys/boot/ofw/libofw/openfirm.h b/sys/boot/ofw/libofw/openfirm.h index 6c7ffb2697dd..c70c2e9314c8 100644 --- a/sys/boot/ofw/libofw/openfirm.h +++ b/sys/boot/ofw/libofw/openfirm.h @@ -72,6 +72,7 @@ typedef unsigned long int cell_t; extern int (*openfirmware)(void *); extern phandle_t chosen; extern ihandle_t memory, mmu; +extern int real_mode; /* * This isn't actually an Open Firmware function, but it seemed like the right From cac88fd5916005c0aefc823696eb6f3dbea9325d Mon Sep 17 00:00:00 2001 From: Tijl Coosemans Date: Wed, 17 Nov 2010 19:54:01 +0000 Subject: [PATCH 27/38] Let gcc and ld know where to find 32 bit libraries on amd64. Reviewed by: arch@ Approved by: kib (mentor) --- gnu/usr.bin/binutils/ld/Makefile.amd64 | 2 +- gnu/usr.bin/cc/cc_tools/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/usr.bin/binutils/ld/Makefile.amd64 b/gnu/usr.bin/binutils/ld/Makefile.amd64 index 8a0812925bff..d7276a02585c 100644 --- a/gnu/usr.bin/binutils/ld/Makefile.amd64 +++ b/gnu/usr.bin/binutils/ld/Makefile.amd64 @@ -12,7 +12,7 @@ e${NATIVE_EMULATION}.c: emulparams/${NATIVE_EMULATION}.sh emultempl/elf32.em \ ${NATIVE_EMULATION} "" no ${NATIVE_EMULATION} ${TARGET_TUPLE} X86_EMULATION= elf_i386_fbsd -_i386_path= \"${TOOLS_PREFIX}/usr/lib/i386\" +_i386_path= \"${TOOLS_PREFIX}/usr/lib32\" EMS+= ${X86_EMULATION} .for ext in ${ELF_SCR_EXT} LDSCRIPTS+= ${X86_EMULATION}.${ext} diff --git a/gnu/usr.bin/cc/cc_tools/Makefile b/gnu/usr.bin/cc/cc_tools/Makefile index 1ba230060e77..4d6de020f864 100644 --- a/gnu/usr.bin/cc/cc_tools/Makefile +++ b/gnu/usr.bin/cc/cc_tools/Makefile @@ -307,7 +307,7 @@ GENSRCS+= gcov-iov.h # Multilib config file multilib.h: -.if ${TARGET_ARCH} == "powerpc64" +.if ${TARGET_ARCH} == "powerpc64" || ${TARGET_ARCH} == "amd64" echo 'static const char *const multilib_raw[] = { \ ". !m64 !m32;", \ "64:../lib m64 !m32;", \ From 8694ea87f556275575d62374f80db26600404693 Mon Sep 17 00:00:00 2001 From: Andreas Tobler Date: Wed, 17 Nov 2010 20:37:16 +0000 Subject: [PATCH 28/38] Revert r215435. We need to figure out the exact value to be loaded. Approved by: nwhitehorn (mentor) --- sys/boot/powerpc/ofw/start.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/boot/powerpc/ofw/start.c b/sys/boot/powerpc/ofw/start.c index 8637e1f810af..1988b3c22cf2 100644 --- a/sys/boot/powerpc/ofw/start.c +++ b/sys/boot/powerpc/ofw/start.c @@ -48,7 +48,7 @@ stack: \n\ _start: \n\ lis %r1,stack@ha \n\ addi %r1,%r1,stack@l \n\ - addi %r1,%r1,16384 \n\ + addi %r1,%r1,8192 \n\ \n\ /* Clear the .bss!!! */ \n\ li %r0,0 \n\ From 144df3a28f3c4dd4dd06abec0c7a9c807a247300 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 17 Nov 2010 22:28:04 +0000 Subject: [PATCH 29/38] Add a resource_list_reserved() method that returns true if a resource list entry contains a reserved resource. --- sys/kern/subr_bus.c | 24 ++++++++++++++++++++++++ sys/sys/bus.h | 1 + 2 files changed, 25 insertions(+) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index d12968c07c25..5a53fc920c58 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -2933,6 +2933,30 @@ resource_list_busy(struct resource_list *rl, int type, int rid) return (1); } +/** + * @brief Determine if a resource entry is reserved. + * + * Returns true if a resource entry is reserved meaning that it has an + * associated "reserved" resource. The resource can either be + * allocated or unallocated. + * + * @param rl the resource list to search + * @param type the resource entry type (e.g. SYS_RES_MEMORY) + * @param rid the resource identifier + * + * @returns Non-zero if the entry is reserved, zero otherwise. + */ +int +resource_list_reserved(struct resource_list *rl, int type, int rid) +{ + struct resource_list_entry *rle; + + rle = resource_list_find(rl, type, rid); + if (rle != NULL && rle->flags & RLE_RESERVED) + return (1); + return (0); +} + /** * @brief Find a resource entry by type and rid. * diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 88a0f60cd7e3..ec3be645f79e 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -256,6 +256,7 @@ int resource_list_add_next(struct resource_list *rl, u_long start, u_long end, u_long count); int resource_list_busy(struct resource_list *rl, int type, int rid); +int resource_list_reserved(struct resource_list *rl, int type, int rid); struct resource_list_entry* resource_list_find(struct resource_list *rl, int type, int rid); From ee597c8246e264cba895a0c6b69bd283a7ad2acd Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Thu, 18 Nov 2010 08:03:40 +0000 Subject: [PATCH 30/38] Some VIA SATA controllers provide access to non-standard SATA registers via PCI config space. Use them to implement hot-plug and link speed reporting. Tested on ASRock PV530 board with VX900 chipset. --- sys/dev/ata/chipsets/ata-via.c | 132 ++++++++++++++++++++++++++++++++- 1 file changed, 128 insertions(+), 4 deletions(-) diff --git a/sys/dev/ata/chipsets/ata-via.c b/sys/dev/ata/chipsets/ata-via.c index 347cd2615b17..ee8405b02479 100644 --- a/sys/dev/ata/chipsets/ata-via.c +++ b/sys/dev/ata/chipsets/ata-via.c @@ -63,6 +63,12 @@ static int ata_via_new_setmode(device_t dev, int target, int mode); static int ata_via_sata_ch_attach(device_t dev); static int ata_via_sata_getrev(device_t dev, int target); static int ata_via_sata_setmode(device_t dev, int target, int mode); +static void ata_via_sata_reset(device_t dev); +static int ata_via_sata_scr_read(device_t dev, int port, int reg, + u_int32_t *result); +static int ata_via_sata_scr_write(device_t dev, int port, int reg, + u_int32_t value); +static int ata_via_sata_status(device_t dev); /* misc defines */ #define VIA33 0 @@ -153,11 +159,12 @@ ata_via_chipinit(device_t dev) if (ata_ahci_chipinit(dev) != ENXIO) return (0); } - /* 2 SATA without SATA registers on first channel + 1 PATA on second */ + /* 2 SATA with "SATA registers" at PCI config space + PATA on secondary */ if (ctlr->chip->cfg2 & VIASATA) { ctlr->ch_attach = ata_via_sata_ch_attach; ctlr->setmode = ata_via_sata_setmode; ctlr->getrev = ata_via_sata_getrev; + ctlr->reset = ata_via_sata_reset; return 0; } /* Legacy SATA/SATA+PATA with SATA registers in BAR(5). */ @@ -405,18 +412,30 @@ ata_via_sata_ch_attach(device_t dev) if (ata_pci_ch_attach(dev)) return ENXIO; - if (ch->unit == 0) + if (ch->unit == 0) { + ch->hw.status = ata_via_sata_status; + ch->hw.pm_read = ata_via_sata_scr_read; + ch->hw.pm_write = ata_via_sata_scr_write; + ch->flags |= ATA_PERIODIC_POLL; ch->flags |= ATA_SATA; + ata_sata_scr_write(ch, 0, ATA_SERROR, 0xffffffff); + ata_sata_scr_write(ch, 1, ATA_SERROR, 0xffffffff); + } return (0); } static int ata_via_sata_getrev(device_t dev, int target) { + device_t parent = device_get_parent(dev); struct ata_channel *ch = device_get_softc(dev); - if (ch->unit == 0) - return (1); + if (ch->unit == 0) { + if (pci_read_config(parent, 0xa0 + target, 1) & 0x10) + return (2); + else + return (1); + } return (0); } @@ -430,5 +449,110 @@ ata_via_sata_setmode(device_t dev, int target, int mode) return (ata_via_old_setmode(dev, target, mode)); } +static void +ata_via_sata_reset(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + int devs; + + if (ch->unit == 0) { + devs = ata_sata_phy_reset(dev, 0, 0); + DELAY(10000); + devs += ata_sata_phy_reset(dev, 1, 0); + } else + devs = 1; + if (devs) + ata_generic_reset(dev); +} + +static int +ata_via_sata_scr_read(device_t dev, int port, int reg, u_int32_t *result) +{ + struct ata_channel *ch; + device_t parent; + uint32_t val; + + parent = device_get_parent(dev); + ch = device_get_softc(dev); + port = (port == 1) ? 1 : 0; + switch (reg) { + case ATA_SSTATUS: + val = pci_read_config(parent, 0xa0 + port, 1); + *result = val & 0x03; + if (*result != ATA_SS_DET_NO_DEVICE) { + if (val & 0x04) + *result |= ATA_SS_IPM_PARTIAL; + else if (val & 0x08) + *result |= ATA_SS_IPM_SLUMBER; + else + *result |= ATA_SS_IPM_ACTIVE; + if (val & 0x10) + *result |= ATA_SS_SPD_GEN2; + else + *result |= ATA_SS_SPD_GEN1; + } + break; + case ATA_SERROR: + *result = pci_read_config(parent, 0xa8 + port * 4, 4); + break; + case ATA_SCONTROL: + val = pci_read_config(parent, 0xa4 + port, 1); + *result = 0; + if (val & 0x01) + *result |= ATA_SC_DET_RESET; + if (val & 0x02) + *result |= ATA_SC_DET_DISABLE; + if (val & 0x04) + *result |= ATA_SC_IPM_DIS_PARTIAL; + if (val & 0x08) + *result |= ATA_SC_IPM_DIS_SLUMBER; + break; + default: + return (EINVAL); + } + return (0); +} + +static int +ata_via_sata_scr_write(device_t dev, int port, int reg, u_int32_t value) +{ + struct ata_channel *ch; + device_t parent; + uint32_t val; + + parent = device_get_parent(dev); + ch = device_get_softc(dev); + port = (port == 1) ? 1 : 0; + switch (reg) { + case ATA_SERROR: + pci_write_config(parent, 0xa8 + port * 4, value, 4); + break; + case ATA_SCONTROL: + val = 0; + if (value & ATA_SC_DET_RESET) + val |= 0x01; + if (value & ATA_SC_DET_DISABLE) + val |= 0x02; + if (value & ATA_SC_IPM_DIS_PARTIAL) + val |= 0x04; + if (value & ATA_SC_IPM_DIS_SLUMBER) + val |= 0x08; + pci_write_config(parent, 0xa4 + port, val, 1); + break; + default: + return (EINVAL); + } + return (0); +} + +static int +ata_via_sata_status(device_t dev) +{ + + ata_sata_phy_check_events(dev, 0); + ata_sata_phy_check_events(dev, 1); + return (ata_pci_status(dev)); +} + ATA_DECLARE_DRIVER(ata_via); MODULE_DEPEND(ata_via, ata_ahci, 1, 1, 1); From c865d740d50f9e30c549fa7814d60d5daf456c72 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Thu, 18 Nov 2010 08:32:47 +0000 Subject: [PATCH 31/38] Correct description of the return values of the LibUSB v1.0 libusb_control_transfer() function. PR: usb/151851 Submitted by: HIROSHI OOTA Approved by: thompsa (mentor) --- lib/libusb/libusb.3 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/libusb/libusb.3 b/lib/libusb/libusb.3 index bec68d8d2c73..e5d3e0aa0893 100644 --- a/lib/libusb/libusb.3 +++ b/lib/libusb/libusb.3 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 14, 2010 +.Dd November 18, 2010 .Dt LIBUSB 3 .Os .Sh NAME @@ -380,10 +380,15 @@ LIBUSB_ERROR code on failure. .Pp .Ft int .Fn libusb_control_transfer "libusb_device_handle *devh" "uint8_t bmRequestType" "uint8_t bRequest" "uint16_t wValue" "uint16_t wIndex" "unsigned char *data" "uint16_t wLength" "unsigned int timeout" -Perform a USB control transfer. Returns 0 on success, LIBUSB_ERROR_TIMEOUT -if the transfer timeout, LIBUSB_ERROR_PIPE if the control request was not -supported, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and -LIBUSB_ERROR code on other failure. +Perform a USB control transfer. Returns the actual number of bytes +transferred on success in the range from and including zero until and +including +.Xa wLength . +On error a libusb error code is returned, for example +LIBUSB_ERROR_TIMEOUT if the transfer timeout, LIBUSB_ERROR_PIPE if the +control request was not supported, LIBUSB_ERROR_NO_DEVICE if the +device has been disconnected or another LIBUSB_ERROR code on other failures. +The libusb error codes are always negative. . .Pp .Ft int From 1f6aa21d474c6b312d62f6355ce5a6da6a0d0b65 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Thu, 18 Nov 2010 10:34:18 +0000 Subject: [PATCH 32/38] Record that there is no devices if SATA reset found none. --- sys/dev/ata/chipsets/ata-via.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/ata/chipsets/ata-via.c b/sys/dev/ata/chipsets/ata-via.c index ee8405b02479..0bfc30a096ba 100644 --- a/sys/dev/ata/chipsets/ata-via.c +++ b/sys/dev/ata/chipsets/ata-via.c @@ -463,6 +463,8 @@ ata_via_sata_reset(device_t dev) devs = 1; if (devs) ata_generic_reset(dev); + else + ch->devices = 0; } static int From 5c2a4ae217c19fee6cfe6334e2fbe9c0885c7daf Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Thu, 18 Nov 2010 11:58:17 +0000 Subject: [PATCH 33/38] Even if we are skipping SATA hard reset - set power management bits in SControl register. This should make things consistent and help to avoid unexpected PHY events that I've noticed in some cases on VIA controllers. --- sys/dev/ata/ata-sata.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/ata/ata-sata.c b/sys/dev/ata/ata-sata.c index d3df7ce4e4d5..e95fc8fcf208 100644 --- a/sys/dev/ata/ata-sata.c +++ b/sys/dev/ata/ata-sata.c @@ -153,8 +153,12 @@ ata_sata_phy_reset(device_t dev, int port, int quick) if (quick) { if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val)) return (0); - if ((val & ATA_SC_DET_MASK) == ATA_SC_DET_IDLE) + if ((val & ATA_SC_DET_MASK) == ATA_SC_DET_IDLE) { + ata_sata_scr_write(ch, port, ATA_SCONTROL, + ATA_SC_DET_IDLE | ((ch->pm_level > 0) ? 0 : + ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER)); return ata_sata_connect(ch, port, quick); + } } if (bootverbose) { From c2b82f3e6134dbf311b3c57579a82458f20877b9 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Thu, 18 Nov 2010 13:38:33 +0000 Subject: [PATCH 34/38] If HBA doesn't report user-enabled SATA capabilies (like ATA_CAM wrapper) - handle all of them as disabled. This was original cause of the problem, workarounded by r215453. MFC after: 1 week --- sys/cam/ata/ata_xpt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c index d8a7d0bae080..95f29cf8cf2d 100644 --- a/sys/cam/ata/ata_xpt.c +++ b/sys/cam/ata/ata_xpt.c @@ -963,6 +963,8 @@ device_fail: if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) xpt_action((union ccb *)&cts); if (cts.xport_specific.sata.valid & CTS_SATA_VALID_CAPS) caps &= cts.xport_specific.sata.caps; + else + caps = 0; /* Store result to SIM. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); @@ -1103,6 +1105,8 @@ device_fail: if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) xpt_action((union ccb *)&cts); if (cts.xport_specific.sata.valid & CTS_SATA_VALID_CAPS) caps &= cts.xport_specific.sata.caps; + else + caps = 0; /* Store result to SIM. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); From f0a0ad3b5813e1a54af2cae8a536f0062c61ceb0 Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Thu, 18 Nov 2010 16:32:52 +0000 Subject: [PATCH 35/38] Do not lint code beyond necessity (with apologies to Wiliam of Ockham). Don't lint externally maintained CDDL code, or relint the 32-bit libraries in amd64 mode. --- Makefile.inc1 | 2 +- cddl/Makefile.inc | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 3cb89c40c793..d6ae48f8c6c0 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -322,7 +322,7 @@ LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \ LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \ -DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO \ - -DWITHOUT_HTML -DNO_CTF DESTDIR=${LIB32TMP} + -DWITHOUT_HTML -DNO_CTF -DNO_LINT DESTDIR=${LIB32TMP} LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*} -DNO_INCS .endif diff --git a/cddl/Makefile.inc b/cddl/Makefile.inc index d3a491443884..9ebb86bffc5b 100644 --- a/cddl/Makefile.inc +++ b/cddl/Makefile.inc @@ -9,3 +9,8 @@ CFLAGS+= -DNEED_SOLARIS_BOOLEAN WARNS?= 6 CSTD?= gnu89 + +# Do not lint the CDDL stuff. It is all externally maintained and +# lint output is wasteful noise here. + +NO_LINT= From bab85d8dccef04a00975680ac4f050a758544bb4 Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Thu, 18 Nov 2010 17:58:59 +0000 Subject: [PATCH 36/38] Fix a bug introduced with r215298; when atphy_reset() is called from atphy_attach() the current media has not been set, yet, leading to a NULL-dereference in atphy_setmedia(). Submitted by: jkim (initial version) --- sys/dev/mii/atphy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/mii/atphy.c b/sys/dev/mii/atphy.c index cfabd21ef18e..07847bea4598 100644 --- a/sys/dev/mii/atphy.c +++ b/sys/dev/mii/atphy.c @@ -317,6 +317,7 @@ atphy_status(struct mii_softc *sc) static void atphy_reset(struct mii_softc *sc) { + struct ifmedia_entry *ife = sc->mii_pdata->mii_media.ifm_cur; struct atphy_softc *asc; uint32_t reg; int i; @@ -339,7 +340,7 @@ atphy_reset(struct mii_softc *sc) PHY_WRITE(sc, ATPHY_SCR, reg); /* Workaround F1 bug to reset phy. */ - atphy_setmedia(sc, sc->mii_pdata->mii_media.ifm_cur->ifm_media); + atphy_setmedia(sc, ife == NULL ? IFM_AUTO : ife->ifm_media); for (i = 0; i < 1000; i++) { DELAY(1); From cd48d66c7e662618171da8f0b2720a4f1ac6bea0 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Thu, 18 Nov 2010 18:09:25 +0000 Subject: [PATCH 37/38] Add VIA VX900 to the list of supported chipsets. --- share/man/man4/ata.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/ata.4 b/share/man/man4/ata.4 index 4a5ae6e9068e..ec6b3eecc2d1 100644 --- a/share/man/man4/ata.4 +++ b/share/man/man4/ata.4 @@ -183,7 +183,7 @@ SIS963, SIS964, SIS965. .It VIA: VT6410, VT6420, VT6421, VT82C586, VT82C586B, VT82C596, VT82C596B, VT82C686, VT82C686A, VT82C686B, VT8231, VT8233, VT8233A, VT8233C, VT8235, VT8237, -VT8237A, VT8237S, VT8251, CX700, VX800, VX855. +VT8237A, VT8237S, VT8251, CX700, VX800, VX855, VX900. .El .Pp Unknown ATA chipsets are supported in PIO modes, and if the standard From c268cdfc238b6ce6d0f40ac2a3885686cb423afe Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Thu, 18 Nov 2010 18:22:58 +0000 Subject: [PATCH 38/38] Fix paths for example files. --- contrib/ipfilter/man/ipnat.8 | 2 +- contrib/ipfilter/man/mkfilters.1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/ipfilter/man/ipnat.8 b/contrib/ipfilter/man/ipnat.8 index 192c1e74ccd9..432978615008 100644 --- a/contrib/ipfilter/man/ipnat.8 +++ b/contrib/ipfilter/man/ipnat.8 @@ -66,6 +66,6 @@ and active rules/table entries. .SH FILES /dev/ipnat .br -/usr/share/examples/ipf Directory with examples. +/usr/share/examples/ipfilter Directory with examples. .SH SEE ALSO ipnat(5), ipf(8), ipfstat(8) diff --git a/contrib/ipfilter/man/mkfilters.1 b/contrib/ipfilter/man/mkfilters.1 index b9e1ddd8872a..262e3658795c 100644 --- a/contrib/ipfilter/man/mkfilters.1 +++ b/contrib/ipfilter/man/mkfilters.1 @@ -6,7 +6,7 @@ mkfilters \- generate a minimal firewall ruleset for ipfilter .SH SYNOPSIS .B mkfilters .SH FILES -/usr/share/examples/ipf/mkfilters +/usr/share/examples/ipfilter/mkfilters .SH DESCRIPTION .PP \fBmkfilters\fP is a perl script that generates a minimal filter rule set for