gnn [Wed, 12 Jan 2011 20:44:11 +0000 (20:44 +0000)]
MFC: 215207
Add a queue to hold packets while we await an ARP reply.
When a fast machine first brings up some non TCP networking program
it is quite possible that we will drop packets due to the fact that
only one packet can be held per ARP entry. This leads to packets
being missed when a program starts or restarts if the ARP data is
not currently in the ARP cache.
This code adds a new sysctl, net.link.ether.inet.maxhold, which defines
a system wide maximum number of packets to be held in each ARP entry.
Up to maxhold packets are queued until an ARP reply is received or
the ARP times out. The default setting is the old value of 1
which has been part of the BSD networking code since time
immemorial.
Expose the time we hold an incomplete ARP entry by adding
the sysctl net.link.ether.inet.wait, which defaults to 20
seconds, the value used when the new ARP code was added..
dougb [Tue, 11 Jan 2011 20:08:34 +0000 (20:08 +0000)]
For stat.c
==========
MFC r216196:
Bring in the change from NetBSD 1.18:
"If using stat (the -L flag) and it fails, fall back to lstat(). It
may be the case that we're examining a broken symlink, and anything is
better than nothing."
The changes in 1.14 through 1.17 were not relevant to us.
Obtained from: atatat@NetBSD.org
MFC r216202:
Bring in the change from NetBSD 1.22:
"Fix a trivial truncation case, and eliminate a corner case that might
print a nul character."
I am purposely bypassing the following versions:
1.19 A build infrastructure change that does not apply to us
1.20 A feature I am not interested in, but don't object if someone else
wants to pick it up
1.21 A build infrastructure change that does not apply to us
Obtained from: atatat@NetBSD.org
MFC r216203:
Bring in a new feature, adding a -f option to readlink to print the path
of the target, similar to realpath(1). See the discussion at:
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=34662
This brings in the following changes:
1.24
"PR/34662: martijnb at atlas dot ipv6 dot stack dot nl: readlink doesn't
grok -f, and there's no alternative (+fix)
Patch applied with minor tweak (%y -> %R, as it was already taken) plus
some nits from myself. Thanks!"
Obtained from: elad@NetBSD.org
1.25
"Fix a segfault when doing 'stat -f %R' on the stdin file handle, instead
fake the filename '(stdin)' like the %N format."
Obtained from: mlelstv@NetBSD.org
1.27
"The ofmt variable is actually a bit mask (not the character that was
in the format string) so that we can "or" it with the bits in the
formats variable. This fixes the missing " -> " in front of the real
path (when you use %SR).
Also, the ?: needs another space."
Obtained from: atatat@NetBSD.org
I am purposely omitting the following changes:
1.23 A humanize_number(3) clone that should better be implemented by
actually using humanize_number(3)
1.26 This is the removal of license clause 3 and 4, already handled
by imp in r203971
MFC 216205:
Bring in the update from NetBSD 1.28:
"Fix WARNS=4 issues (-Wcast-qual -Wsign-compare)"
Because of code differences I had to hand-apply parts of the patch,
so responsibility for errors goes to me.
Obtained from: lukem@NetBSD.org
MFC 216206: [ Also applies to Makefile ]
Fix an "unused variable" error that gets us all the way to WARNS=6
MFC 216207:
Bring in the following changes from NetBSD. See the discussion at:
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44128
1.29
"Don't printf time_t with %d; fixes PR 44128 from yamt. With this change it
successfully prints mtimes after 2038."
1.30
"Improve previous with comments."
Obtained from: dholland@NetBSD.org (both)
MFC 216343:
Bring in the change from OpenBSD's 1.14:
"synchronize synopsis and usage; "-l", "-r", "-s" and "-x" are mutually
exclusive; while here, slightly improve spacing in the source code
so it fits on a 80-column display again.
diff greatly improved by martynas@"
Obtained from: sobrado@OpenBSD.org
MFC 216512:
Bring in the relevant changes from NetBSD's 1.31:
"Use strlcpy, not strncpy, when the desired semantics are strlcpy's
rather than strncpy's."
Note: NetBSD's 1.32 is their adoption of our r216206
Obtained from: dholland@NetBSD.org
For stat.1
==========
MFC 216197:
Add my own documentation for the change in our r216196, aka NetBSD's 1.18
For -L if stat(2) fails, fall back to lstat(2).
.Dd purposely not bumped because more changes are coming.
MFC 216204:
Bring in the update from NetBSD 1.19, the documentation of readlink -f
"PR/34662: martijnb at atlas dot ipv6 dot stack dot nl: readlink doesn't
grok -f, and there's no alternative (+fix)
Patch applied with minor tweak (%y -> %R, as it was already taken) plus
some nits from myself. Thanks!"
Obtained from: elad@NetBSD.org
MFC 216209:
Bring in the change from NetBSD 1.12:
"document default format."
Obtained from: yamt@NetBSD.org
MFC 216213:
Bring in the changes from NetBSD 1.13 that we did not already have, with
some differences.
"Sort options. Use more mdoc macros. Some nit fixes. Bump date."
Obtained from: wiz@NetBSD.org
MFC 216215:
Bring in the changes from NetBSD 1.16 that we did not already have.
"Some fixes from jmc@openbsd."
Obtained from: wiz@NetBSD.org
MFC 216216:
Bring in the change from NetBSD 1.20:
"Make sentence easier to parse. From jsing@openbsd via jmc@openbsd."
Obtained from: wiz@NetBSD.org
MFC 216218:
Bring in the following changes from NetBSD:
1.21
"Document the flags displayed by the default format, and mention their short
names. From espie@openbsd via jmc@openbsd."
1.24
"Fix three variable names.
From Todd T. Fries via Jason McIntyre."
Obtained from: wiz@NetBSD.org (previous 2)
1.25
"Be consistent: document the birthtime field of struct stat for
the "B" field specifier."
Obtained from: reed@NetBSD.org
1.26
"Drop trailing space."
Obtained from: wiz@NetBSD.org
1.27
"Since we have st_birthtime in struct stat, it is in default display."
Obtained from: enami@NetBSD.org
Purposely skipping the following revisions:
1.22 NetBSD-specific change
1.23 Removal of license clauses 3 and 4, already handled by imp
in our r203971
MFC 216219:
Bring in the change from NetBSD 1.28:
"\\ -> \e"
Obtained from: joerg@NetBSD.org
Bump .Dd because we're now up to date with the latest NetBSD version
dim [Tue, 11 Jan 2011 19:17:13 +0000 (19:17 +0000)]
MFC r215801:
Change ambiguous (or invalid, depending on how strict you want to be :)
assembly instruction "movw %rcx,2(%rax)" to "movw %cx,2(%rax)", since
the intent was to move 16 bits of data, in this case.
dim [Tue, 11 Jan 2011 19:13:29 +0000 (19:13 +0000)]
MFC r215212:
Similar to r212647, remove the workaround in sys/net/vnet.h for an ld
bug (incorrect placement of __start_SECNAME in some cases) that was
fixed in r210245.
There is already an UPDATING entry about needing a recent ld.
mdf [Tue, 11 Jan 2011 17:33:29 +0000 (17:33 +0000)]
MFC r216463:
One of the compat32 functions was copying in a raw timespec, instead of
a 32-bit one. This can cause weird timeout issues, as the copying reads
garbage from the user.
mdf [Tue, 11 Jan 2011 17:29:34 +0000 (17:29 +0000)]
(Note the previous commit was a MFC of r216616).
MFC r216620:
Initialize fp_location for explicitly managed fail points, and push
the parentheses around the location for simple fail points into the
location string. This makes the print on fail point set more
consistent between the two versions.
Also fix up fail.h a little for style(9): only use one of sys/param.h
and sys/types.h, and use the existing __XSTRING() macro instead of
rolling our own. Also fix up a few tabs on changed and nearby lines.
Lastly, since KFAIL_POINT_{BEGIN,END} are not meant for use outside
this file, just eliminate the macros entirely.
mdf [Tue, 11 Jan 2011 17:26:36 +0000 (17:26 +0000)]
Move the fail_point_entry definition from fail.h to kern_fail.c, which
allows putting the enumeration constants of fail point types with the
text string that matches them.
mdf [Tue, 11 Jan 2011 17:16:50 +0000 (17:16 +0000)]
MFC r217109:
Fix a memory overflow where the input length to g_gpt_utf8_to_utf16()
was specified incorrectly, causing the bzero to run past the end of a
malloc(9)'d object.
Submitted by: Eric Youngblut < eyoungblut AT isilon DOT com >
yongari [Mon, 10 Jan 2011 19:43:16 +0000 (19:43 +0000)]
MFC r217226:
Apply DMA address space restriction to controllers that have 4GB
DMA boundary bug and runs with PCI-X mode. watchdog timeout was
observed on BCM5704 which lives behind certain PCI-X bridge(e.g.
AMD 8131 PCI-X bridge). It's still not clear whether the root
cause came from that PCI-X bridge or not. The watchdog timeout
indicates the issue is in TX path. If the bridge reorders TX
mailbox write accesses it would generate all kinds of problems but
I'm not sure. This should be revisited.
Early MFC requested by re@ for inclusion in 8.2-RC2/7.4-RC2.
Tested by: Michael L. Squires (mikes <> siralan dot org)
deischen [Mon, 10 Jan 2011 04:48:18 +0000 (04:48 +0000)]
MFC: 217169
Make sure to always do source address selection on
an unbound socket, regardless of any multicast options.
If an address is specified via a multicast option, then
let it override normal the source address selection.
This fixes a bug where source address selection was
not being performed when multicast options were present
but without an interface being specified.
Move the increment operation under the lock and split the condition
variable into two so that we can see on which one we are waiting.
This might also more properly propagate the update of the
flowclean_cycles flag and avoid "hangs" people were seeing.
Add and export constants of array sizes of jail parameters as compiled into
the kernel.
This is the least intrusive way to allow kvm to read the (sparse) arrays
independent of the options the kernel was compiled with.
Reviewed by: jhb (originally)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Sponsored by: CK Software GmbH
Move the uint64_t to were the padding was before, rather than before all
pad. Keep them to the end so that the two pad[]s are kept together.
This should restore ABI as well on platforms, where
sizeof(void *) != sizeof(uint64_t)
after r216968, r217018.
rmacklem [Sat, 8 Jan 2011 01:11:14 +0000 (01:11 +0000)]
MFC: r216700
Modify the experimental NFS server so that it uses LK_SHARED
for RPC operations when it can. Since VFS_FHTOVP() currently
always gets an exclusively locked vnode and is usually called
at the beginning of each RPC, the RPCs for a given vnode will
still be serialized. As such, passing a lock type argument to
VFS_FHTOVP() would be preferable to doing the vn_lock() with
LK_DOWNGRADE after the VFS_FHTOVP() call.
rmacklem [Fri, 7 Jan 2011 20:31:47 +0000 (20:31 +0000)]
MFC: r216693
Add an argument to nfsvno_getattr() in the experimental
NFS server, so that it can avoid calling VOP_ISLOCKED()
when the vnode is known to be locked. This will allow
LK_SHARED to be used for these cases, which happen to
be all the cases that can use LK_SHARED. This does not
fix any bug, but it reduces the number of calls to
VOP_ISLOCKED() and prepares the code so that it can be
switched to using LK_SHARED in a future patch.
rmacklem [Fri, 7 Jan 2011 20:07:30 +0000 (20:07 +0000)]
MFC: r216692
Simplify vnode locking in the expeimental NFS server's
readdir functions. In particular, get rid of two bogus
VOP_ISLOCKED() calls. Removing the VOP_ISLOCKED() calls
is the only actual bug fixed by this patch.
cperciva [Fri, 7 Jan 2011 14:03:28 +0000 (14:03 +0000)]
MFC r216944,r216963,r216960: Improve the stability of the i386/XEN pmap
code by correctly protecting page mapping queue variables within a
critical section and by adding ham-fisted locking to pmap.c.
cperciva [Thu, 6 Jan 2011 12:34:18 +0000 (12:34 +0000)]
MFC r200288, r200346, r200352: Make minidump work on i386/XEN.
Note that r200288 and r200346 touched i386/i386/dump_machdep.c,
but in that file r200346 was a back-out of r200288; so the fact
that dump_machdep.c has moved to the x86 tree is not a problem.
In the !XEN case the files under i386/i386 are unchanged after
preprocessing.
kib [Wed, 5 Jan 2011 13:50:37 +0000 (13:50 +0000)]
MFC r216799:
Move the increment of vm object generation count into
vm_object_set_writeable_dirty(). Merge two loops in
vm_object_page_clean(), doing the removal of write permission and
cleaning in the same loop. Clear the OBJ_MIGHTBEDIRTY flag after the
cleaning loop, not before.
marius [Wed, 5 Jan 2011 13:26:26 +0000 (13:26 +0000)]
MFC: r216820
- Add CPUTYPE support for sparc64. The net result is that it's now possible
to let the compiler optimize for the famility of UltraSPARC-III CPUs as the
default already was to optimize for UltraSPARC-I/II and generating generic
64-bit V9 is mainly for reference purposes. At least for SPARC64-V CPUs
code optimized for UltraSPARC-I/II still is the most performant one.
Thanks go to Michael Moll for testing SPARC64-V.
- Move a booke MACHINE_CPU bit into the right section.
kib [Wed, 5 Jan 2011 12:47:42 +0000 (12:47 +0000)]
MFC r216794:
Add reporting of GEOM::candelete BIO_GETATTR for md(4) and geom_disk(4).
Non-zero value of attribute means that device supports BIO_DELETE.
marius [Wed, 5 Jan 2011 12:27:52 +0000 (12:27 +0000)]
MFC: r216802
- Move the macros for generating load and store instructions to asmacros.h
so they can be shared by different source files and extend them by a
variant for atomic compare and swap.
- Consistently use EMPTY.
marius [Wed, 5 Jan 2011 12:05:27 +0000 (12:05 +0000)]
MFC: r216628
Extend the hack of r182730 to trick GAS/GCC into compiling access to
STICK/STICK_COMPARE independently of the selected instruction set by
TICK_COMPARE so tick.c once again can be compiled with gcc -mcpu=v9
for reference purposes.
marius [Wed, 5 Jan 2011 11:46:17 +0000 (11:46 +0000)]
MFC: r216623
- Add a comment regarding the fact that as documented in the datasheet
manual 1000BASE-T modes of DP83865 only work together with other National
Semiconductor PHYs.
- Spell 10BASE-T correctly
- Remove some redundant braces.
marius [Wed, 5 Jan 2011 11:43:17 +0000 (11:43 +0000)]
MFC: r216085
- Remove the remaining support for older (in this case pre-7.0-RELEASE)
versions of FreeBSD. In fact we are already missing a lot of conditional
code necessary to support older versions of FreeBSD, including alternatives
for vital functionality not yet provided by the respective subsystem back
then (see for example r199663). So this change shouldn't actually break
this driver on versions of FreeBSD that were supported before. Besides,
this driver also isn't maintained as an multi-release version outside of
the main repository, so removing the conditional code shouldn't be a
problem in that regard either.
- Sprinkle some more const on tables.
marius [Wed, 5 Jan 2011 11:29:07 +0000 (11:29 +0000)]
MFC: r216891
Extend the section in which interrupts are disabled in the TLB demap
functions, otherwise if we get preempted after checking whether a certain
pmap is active on the current CPU but before disabling interrupts we might
operate on an outdated state as the pmap might have been deactivated in
the meantime. As the same issue may arises when the TLB demap function is
interrupted by a TLB demap IPI, just entering a critical section before
the check isn't sufficient so we have to fully disable interrupts instead.
bschmidt [Sun, 2 Jan 2011 09:03:53 +0000 (09:03 +0000)]
MFC r216824:
The RX path is missing a few bus_dmamap_*() calls, this results in
modification of memory which was already free'd and eventually in:
wpi0: could not map mbuf (error 12)
wpi0: wpi_rx_intr: bus_dmamap_load failed, error 12
and an usuable device.
rmacklem [Fri, 31 Dec 2010 14:03:57 +0000 (14:03 +0000)]
MFC: r216510
Fix two vnode locking problems in nfsd_recalldelegation() in the
experimental NFSv4 server. The first was a bogus use of VOP_ISLOCKED()
in a KASSERT() and the second was the need to lock the vnode for the
nfsrv_checkremove() call. Also, delete a "__unused" that was bogus,
since the argument is used.
bschmidt [Fri, 31 Dec 2010 12:48:43 +0000 (12:48 +0000)]
MFC r216049:
Some drivers rely on the existence of certain keys. The Atheros 9xxx
driver for example requests the NetCfgInstanceId but doesn't check the
returned status code and will happily access random memory instead.
pjd [Thu, 30 Dec 2010 09:45:26 +0000 (09:45 +0000)]
MFC r216565,r216631,r216632,r216633,r216774:
r216565:
Reduce lock scope a little.
r216631:
On error, unbusy file system and jump to the end, so we won't try to unlock
NULL *vpp.
Reviewed by: kib
r216632:
- Move pubflag and lockflag handling from nfsrv_fhtovp() to nfs_namei() -
this is the only place that is different from all the other nfsrv_fhtovp()
consumers.
This simplifies nfsrv_fhtovp() a bit and also eliminates one
vn_lock/VOP_UNLOCK() cycle in case of NFSv3.
- Implement NFSRV_FLAG_BUSY flag for nfsrv_fhtovp() that tells it to leave
mount point busy.
Reviewed by: kib
r216633:
Use newly added NFSRV_FLAG_BUSY flag for nfsrv_fhtovp() to keep mount point
busy. This fixes a race where we can pass invalid mount point to VFS_VGET()
via vp->v_mount when exported file system was forcibly unmounted between
nfsrv_fhtovp() and VFS_VGET().
Reviewed by: kib
r216774:
ZFS might not return monotonically increasing directory offset cookies,
so turn off UFS-specific hack that assumes so in ZFS case.
Before the change we can miss returning some directory entries to a
NFS client.
I believe that the hack should be moved to ufs_readdir(), but until we find
somebody who will do it, turn it off for ZFS in NFS server code.
rmacklem [Wed, 29 Dec 2010 02:54:41 +0000 (02:54 +0000)]
MFC: r216691
Since VOP_READDIR() for ZFS does not return monotonically
increasing directory offset cookies, disable the UFS related
loop that skips over directory entries at the beginning of
the block for the experimental NFS server. This loop is
required for UFS since it always returns directory entries
starting at the beginning of the block that
the requested directory offset is in. In discussion with pjd@
and mckusick@ it seems that this behaviour of UFS should maybe
change, with this fix being an interim patch until then.
This patch only fixes the experimental server, since pjd@ is
working on a patch for the regular server.
wollman [Mon, 27 Dec 2010 23:46:47 +0000 (23:46 +0000)]
Merge three revisions from head:
r214583 | wollman | 2010-10-30 22:36:05 -0400 (Sat, 30 Oct 2010) | 6 lines
Changed paths:
M /head/usr.bin/locate/locate/locate.rc
M /head/usr.bin/locate/locate/updatedb.sh
Make it possible to exclude directories by name no matter where they
are in the filesystem from the locate database. By default, exclude
".zfs" directories, as users who who have set snapdir=visible and are
taking frequent snapshots most likely do not want the snapshots
included in the locate database.
------------------------------------------------------------------------
r214613 | wollman | 2010-10-31 21:51:47 -0400 (Sun, 31 Oct 2010) | 7 lines
Changed paths:
M /head/usr.bin/locate/locate/updatedb.sh
jilles@ pointed out that using ${PRUNEDIRS:=".zfs"} in updatedb.sh
made it impossible to override PRUNEDIRS to make it empty. Use the
non-colon form to only set PRUNEDIRS if it is completely unset. (For
parallelism, the other configuration defaults here could be done the
same way, but that could be more obviously accomplished by disabling
updatedb in periodic.conf, so leave them alone for now.)
------------------------------------------------------------------------
r214615 | wollman | 2010-10-31 22:20:18 -0400 (Sun, 31 Oct 2010) | 6 lines
Changed paths:
M /head/usr.bin/locate/locate/updatedb.sh
Style cleanup: make this look more like a 21st-century shell script
and not something out of the early 1980s. Make sure all error
messages go to stderr, not stdout. Since there's error-handling code
to handle empty SEARCHPATHS and FILESYSTEMS, use the initialization
form that allows this error to be diagnosed. (hat tip: jilles@)
attilio [Mon, 27 Dec 2010 12:52:35 +0000 (12:52 +0000)]
MFC r215868, 215918, 216266, 216298:
- Advertise when the reboot came from a watchdog-induced reset
- Fix a bug where TCO_BOOT_STS was supposed to be cleared after
TCO_SECOND_TO_STS
- Use macros for max and min value capping when re-arming the
watchdog timeout
attilio [Mon, 27 Dec 2010 12:39:24 +0000 (12:39 +0000)]
MFC r215679:
Add the ability for GDB to printout the thread name along with other thread
specific informations.
In order to achieve that, for both on-line debugging and core analysis,
a new member to PT_LWPINFO ptrace(2) interface is added and a new
ELF note (NT_THRMISC) as well.
nwhitehorn [Wed, 22 Dec 2010 14:46:38 +0000 (14:46 +0000)]
MFC r216469:
Fix the overflowing livefs ISO by removing man pages from the HFS part of
the hybrid disk. This is a stopgap until a better solution can be found,
but lets the powerpc release build complete for the time being.
bschmidt [Tue, 21 Dec 2010 09:16:42 +0000 (09:16 +0000)]
Add 2 missing bus_dmamap_sync() calls. Those fix random 'scan timeout',
'could not set power mode', 'device config failed' and other errors due
reading invalid memory.
bschmidt [Tue, 21 Dec 2010 09:14:59 +0000 (09:14 +0000)]
Fix association on 5GHz channels. The device is initially configured using
a 2GHz channel with appropriate flags set to sc->config. Due to not zeroing
sc->config for auth/assoc those flags are still set while trying to connect
on a 5GHz channel.
* Make blkfront not advertise a larger maximum I/O size than it can handle
for unaligned data (r216241)
* Correctly reserve CPU #0's DPCPU pages (r216041)
* Make machdep.independent_wallclock do what it claims (r216382)
* Don't round xen timecounter to the nearest tick (r215663), but decrease
its frequency to avoid wrapping at ~4.3s (r216385)
* Remove debugging code which caused a massing slowdown in fork-heavy
workloads (r215813)
* Add a missing page table flush before invalidating TLBs in pmap_qremove
(r215819+215844)
* In pmap_release, don't unpin pages which weren't pinned (r215525) and don't
KASSERT page mappings which don't exist (r215470); but do pmap_qremove all
the relevant pages (r215472)
* Don't unmask an event channel until after we register the interrupt handler
for it (r216280)