]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agodb/hash: Use O_CLOEXEC instead of separate fcntl() call.
jilles [Sun, 11 Aug 2013 15:38:48 +0000 (15:38 +0000)]
db/hash: Use O_CLOEXEC instead of separate fcntl() call.

In particular, a hash db is used by getpwnam() and getpwuid().

MFC after: 1 week

11 years agowait: Make sure WIFSIGNALED(s) is false if WIFCONTINUED(s) is true.
jilles [Sun, 11 Aug 2013 14:15:01 +0000 (14:15 +0000)]
wait: Make sure WIFSIGNALED(s) is false if WIFCONTINUED(s) is true.

11 years agoUse realpath(1) to determine the location of the newvers.sh script,
gjb [Sun, 11 Aug 2013 13:57:14 +0000 (13:57 +0000)]
Use realpath(1) to determine the location of the newvers.sh script,
since the current working directory might not be what is expected,
causing svn{,lite}version to fail to find ${0} (itself).

Submitted by: Dan Mack

11 years agoIn su(1), fix option ordering and clarify that the login class specified
trasz [Sun, 11 Aug 2013 11:06:49 +0000 (11:06 +0000)]
In su(1), fix option ordering and clarify that the login class specified
must be defined in login.conf.

MFC after: 1 month

11 years agoUse device_printf().
rpaulo [Sun, 11 Aug 2013 06:57:57 +0000 (06:57 +0000)]
Use device_printf().

11 years agoUse the correct structure size when flipping the BT coex state machine.
adrian [Sun, 11 Aug 2013 03:39:28 +0000 (03:39 +0000)]
Use the correct structure size when flipping the BT coex state machine.

This showed up when doing some basic testing on the Intel 6230.

Tested:

* Intel 6230, STA mode

11 years agoPrepare for the PAN (personal area network) support for iwn(4).
adrian [Sun, 11 Aug 2013 01:57:54 +0000 (01:57 +0000)]
Prepare for the PAN (personal area network) support for iwn(4).

* Break out the single, static RX context into a pointer, and ..
* .. extend it to two RX contexts - a default and a PAN context.

Whilst here, add a few extra fields in preparation for further iwn(4)
work.

Tested:

* Intel 4965, STA mode - same level of stability
* Intel 5100, STA mode - no change

Submitted by: Cedric Gross <cg@gross.info>

11 years agoAdd firmware for the Intel 2030 and variants.
adrian [Sun, 11 Aug 2013 01:09:16 +0000 (01:09 +0000)]
Add firmware for the Intel 2030 and variants.

Submitted by: Cedric GROSS <cg@gross.info>
Obtained from: Linux, Intel

11 years agoRemove a now-unused firmware.
adrian [Sun, 11 Aug 2013 01:04:07 +0000 (01:04 +0000)]
Remove a now-unused firmware.

11 years agoUpdate the 6000g2a image.
adrian [Sun, 11 Aug 2013 01:03:32 +0000 (01:03 +0000)]
Update the 6000g2a image.

Obtained from: Linux, Intel

11 years agofasttrap_fork(): unlock the processes before removing the tracepoints.
rpaulo [Sun, 11 Aug 2013 00:57:01 +0000 (00:57 +0000)]
fasttrap_fork(): unlock the processes before removing the tracepoints.

In the future, we'll need to come up with new proc_*() functions that accept
locked processes. For now, this prevents postgresql + DTrace from crashing the
system.

MFC after: 1 month

11 years agoLoad the dtraceall module if /dev/dtrace/dtrace doesn't exist.
rpaulo [Sat, 10 Aug 2013 23:17:09 +0000 (23:17 +0000)]
Load the dtraceall module if /dev/dtrace/dtrace doesn't exist.

MFC after: 3 days

11 years agoAdd in missing m_free()'s during error conditions.
adrian [Sat, 10 Aug 2013 21:46:58 +0000 (21:46 +0000)]
Add in missing m_free()'s during error conditions.

11 years agoThe r254167 moved initialization of the sleepqueues before the witness
kib [Sat, 10 Aug 2013 21:42:14 +0000 (21:42 +0000)]
The r254167 moved initialization of the sleepqueues before the witness
is operational.  init_sleepqueues() initializes 256 mutexes, which,
due to witness still being cold, started to overflow the pending_locks
array.

As stated in the reported panic message, increase WITNESS_PENDLIST
from 768 to 1024, which provides space for additional 256 locks.

Reported by: many
Tested by: rakuco, bdrewery

11 years agoParseGetLine: don't treat a zero byte as end of buffer if P_end says it isn't.
sjg [Sat, 10 Aug 2013 21:31:35 +0000 (21:31 +0000)]
ParseGetLine: don't treat a zero byte as end of buffer if P_end says it isn't.
Consume up to next newline, and issue a parse warning.
If no newline found before P_end, carry on as before.

11 years agoMatch malloc(9) calls with free(9), not contigfree(9). Also remove
kib [Sat, 10 Aug 2013 20:54:15 +0000 (20:54 +0000)]
Match malloc(9) calls with free(9), not contigfree(9).  Also remove
unneeded checks for NULL, free(9) can handle NULL pointers on its own,
and the regions were allocated with M_WAITOK flag as well.

Reported and tested by: Larry Rosenman <ler@lerctr.org>
MFC after: 1 week

11 years agoThe random_adapters.c is standard in the conf/files. Revert wrong
kib [Sat, 10 Aug 2013 19:38:29 +0000 (19:38 +0000)]
The random_adapters.c is standard in the conf/files.  Revert wrong
r254185.

Pointed out by: peter

11 years agoRestore the ability to kldload random.ko, by linking in the newly
kib [Sat, 10 Aug 2013 18:23:28 +0000 (18:23 +0000)]
Restore the ability to kldload random.ko, by linking in the newly
added random_adaptors.c.

11 years agoFix a typo. The script should run /usr/bin/svnliteversion instead of
gjb [Sat, 10 Aug 2013 18:23:18 +0000 (18:23 +0000)]
Fix a typo.  The script should run /usr/bin/svnliteversion instead of
/usr/bin/svnversion in the affected section.

Reported by: lev, Dan Mack

11 years agoDifferent consumers of the struct vm_page abuse pageq member to keep
kib [Sat, 10 Aug 2013 17:36:42 +0000 (17:36 +0000)]
Different consumers of the struct vm_page abuse pageq member to keep
additional information, when the page is guaranteed to not belong to a
paging queue.  Usually, this results in a lot of type casts which make
reasoning about the code correctness harder.

Sometimes m->object is used instead of pageq, which could cause real
and confusing bugs if non-NULL m->object is leaked.  See r141955 and
r253140 for examples.

Change the pageq member into a union containing explicitly-typed
members.  Use them instead of type-punning or abusing m->object in x86
pmaps, uma and vm_page_alloc_contig().

Requested and reviewed by: alc
Sponsored by: The FreeBSD Foundation

11 years agoFix the return value when we found a symbol in .dynstr. This nasty bug was
rpaulo [Sat, 10 Aug 2013 07:39:15 +0000 (07:39 +0000)]
Fix the return value when we found a symbol in .dynstr. This nasty bug was
preventing a lot of symbol lookups in dtruss -s, for example.

11 years agomdoc: remove commented out macro, sort SEE ALSO and add missing .El.
joel [Sat, 10 Aug 2013 06:48:20 +0000 (06:48 +0000)]
mdoc: remove commented out macro, sort SEE ALSO and add missing .El.

11 years agoMinor mdoc nits.
joel [Sat, 10 Aug 2013 06:39:42 +0000 (06:39 +0000)]
Minor mdoc nits.

11 years agomdoc: document title should be all caps.
joel [Sat, 10 Aug 2013 06:37:53 +0000 (06:37 +0000)]
mdoc: document title should be all caps.

11 years agoFix bug in r253719: fix command line watchdog disable.
alfred [Sat, 10 Aug 2013 01:48:15 +0000 (01:48 +0000)]
Fix bug in r253719: fix command line watchdog disable.

r253719 disallowed watchdog(8) from disabling the watchdog
by breaking the ability to pass 0 as a timeout arg.  Fix this.

11 years agoUse the correct address when calling kva_free()
cognet [Sat, 10 Aug 2013 00:53:22 +0000 (00:53 +0000)]
Use the correct address when calling kva_free()

Pointy hat to: cognet
Spotted out by: alc

11 years ago- The address lies in the bus space handle, not in the cookie
cognet [Sat, 10 Aug 2013 00:31:49 +0000 (00:31 +0000)]
- The address lies in the bus space handle, not in the cookie
- Use the right address when calling kva_free()
(Is there any reason why the s3c2xx0 comes with its own version of bs_map/
 bs_unmap ? It seems to be just the same as in bus_space_generic.c)

11 years agoRemove unused definition for CTL_VM_NAMES.
zont [Fri, 9 Aug 2013 23:47:43 +0000 (23:47 +0000)]
Remove unused definition for CTL_VM_NAMES.

Suggested by: bde

11 years agoDon't call sleepinit() from proc0_init(), make it a SYSINIT instead.
cognet [Fri, 9 Aug 2013 23:13:52 +0000 (23:13 +0000)]
Don't call sleepinit() from proc0_init(), make it a SYSINIT instead.
vmem needs the sleepq locks to be initialized when free'ing kva, so we want it
called as early as possible.

11 years agoInstead of just trying to do it for arm, make sure vm_kmem_size is properly
cognet [Fri, 9 Aug 2013 22:30:54 +0000 (22:30 +0000)]
Instead of just trying to do it for arm, make sure vm_kmem_size is properly
aligned in kmeminit(), where it'll work for any arch.

Suggested by: alc

11 years ago- The address lies in the bus space handle, not in the cookie
cognet [Fri, 9 Aug 2013 21:56:28 +0000 (21:56 +0000)]
- The address lies in the bus space handle, not in the cookie
- Use the right address when calling kva_free()

11 years agoMake sure vm_kmem_size is aligned on a page boundary, since that's what vmem
cognet [Fri, 9 Aug 2013 21:53:02 +0000 (21:53 +0000)]
Make sure vm_kmem_size is aligned on a page boundary, since that's what vmem
expects.

11 years agoRevert the addition of VPO_BUSY and instead update vm_page_replace() to
jhb [Fri, 9 Aug 2013 21:14:55 +0000 (21:14 +0000)]
Revert the addition of VPO_BUSY and instead update vm_page_replace() to
properly unbusy the page.

Submitted by: alc

11 years agoInitial commit of my USB test code which can exercise connected USB
hselasky [Fri, 9 Aug 2013 20:08:42 +0000 (20:08 +0000)]
Initial commit of my USB test code which can exercise connected USB
devices and the FreeBSD USB stack itself. This program can be used to
test compliance against well established usb.org standards, also
called chapter-9 tests. The host platform can act as either USB device
or USB host depending on the available hardware. The basic USB
communication happens through FreeBSD's own libusb v2, and some
sysctls are also used to invoke specific error conditions. This test
program can be used to verify correct operation of external USB
harddisks under heavy load and various other conditions. The software
is driven via a simple command line interface. Main supported USB host
classes are "USB mass storage" and "USB modems".

11 years agoFix the freaddir implementation for the stand-alone interpreter.
marcel [Fri, 9 Aug 2013 19:10:56 +0000 (19:10 +0000)]
Fix the freaddir implementation for the stand-alone interpreter.

Bug pointed out by: Jan Beich <jbeich@tormail.org>

11 years agoAdd mkostemp() and mkostemps().
jilles [Fri, 9 Aug 2013 17:24:23 +0000 (17:24 +0000)]
Add mkostemp() and mkostemps().

These are like mkstemp() and mkstemps() but allow passing open(2) flags like
O_CLOEXEC.

11 years agoAdd missing 'VPO_BUSY' from r254141 to fix kernel build break.
obrien [Fri, 9 Aug 2013 16:43:50 +0000 (16:43 +0000)]
Add missing 'VPO_BUSY' from r254141 to fix kernel build break.

11 years ago* Add random_adaptors.[ch] which is basically a store of random_adaptor's.
obrien [Fri, 9 Aug 2013 15:31:50 +0000 (15:31 +0000)]
* Add random_adaptors.[ch] which is basically a store of random_adaptor's.
  random_adaptor is basically an adapter that plugs in to random(4).
  random_adaptor can only be plugged in to random(4) very early in bootup.
  Unplugging random_adaptor from random(4) is not supported, and is probably a
  bad idea anyway, due to potential loss of entropy pools.
  We currently have 3 random_adaptors:
  + yarrow
  + rdrand (ivy.c)
  + nehemeiah

* Remove platform dependent logic from probe.c, and move it into
  corresponding registration routines of each random_adaptor provider.
  probe.c doesn't do anything other than picking a specific random_adaptor
  from a list of registered ones.

* If the kernel doesn't have any random_adaptor adapters present then the
  creation of /dev/random is postponed until next random_adaptor is kldload'ed.

* Fix randomdev_soft.c to refer to its own random_adaptor, instead of a
  system wide one.

Submitted by: arthurmesh@gmail.com, obrien
Obtained from: Juniper Networks
Reviewed by: so (des)

11 years agoOn all the architectures, avoid to preallocate the physical memory
attilio [Fri, 9 Aug 2013 11:28:55 +0000 (11:28 +0000)]
On all the architectures, avoid to preallocate the physical memory
for nodes used in vm_radix.
On architectures supporting direct mapping, also avoid to pre-allocate
the KVA for such nodes.

In order to do so make the operations derived from vm_radix_insert()
to fail and handle all the deriving failure of those.

vm_radix-wise introduce a new function called vm_radix_replace(),
which can replace a leaf node, already present, with a new one,
and take into account the possibility, during vm_radix_insert()
allocation, that the operations on the radix trie can recurse.
This means that if operations in vm_radix_insert() recursed
vm_radix_insert() will start from scratch again.

Sponsored by: EMC / Isilon storage division
Reviewed by: alc (older version)
Reviewed by: jeff
Tested by: pho, scottl

11 years agoGive mutex(9) the ability to recurse on a per-instance basis.
attilio [Fri, 9 Aug 2013 11:24:29 +0000 (11:24 +0000)]
Give mutex(9) the ability to recurse on a per-instance basis.
Now the MTX_RECURSE flag can be passed to the mtx_*_flag() calls.
This helps in cases we want to narrow down to specific calls the
possibility to recurse for some locks.

Sponsored by: EMC / Isilon storage division
Reviewed by: jeff, alc
Tested by: pho

11 years agoThe soft and hard busy mechanism rely on the vm object lock to work.
attilio [Fri, 9 Aug 2013 11:11:11 +0000 (11:11 +0000)]
The soft and hard busy mechanism rely on the vm object lock to work.
Unify the 2 concept into a real, minimal, sxlock where the shared
acquisition represent the soft busy and the exclusive acquisition
represent the hard busy.
The old VPO_WANTED mechanism becames the hard-path for this new lock
and it becomes per-page rather than per-object.
The vm_object lock becames an interlock for this functionality:
it can be held in both read or write mode.
However, if the vm_object lock is held in read mode while acquiring
or releasing the busy state, the thread owner cannot make any
assumption on the busy state unless it is also busying it.

Also:
- Add a new flag to directly shared busy pages while vm_page_alloc
  and vm_page_grab are being executed.  This will be very helpful
  once these functions happen under a read object lock.
- Move the swapping sleep into its own per-object flag

The KPI is heavilly changed this is why the version is bumped.
It is very likely that some VM ports users will need to change
their own code.

Sponsored by: EMC / Isilon storage division
Discussed with: alc
Reviewed by: jeff, kib
Tested by: gavin, bapt (older version)
Tested by: pho, scottl

11 years agoDon't dereference null pointer should acl_alloc() be passed M_NOWAIT
trasz [Fri, 9 Aug 2013 08:40:31 +0000 (08:40 +0000)]
Don't dereference null pointer should acl_alloc() be passed M_NOWAIT
and allocation failed.  Nothing in the tree passed M_NOWAIT.

Obtained from: mjg
MFC after: 1 month

11 years agoAdd -c flag to pgrep(1) and pkill(1), to match login classes.
trasz [Fri, 9 Aug 2013 08:38:51 +0000 (08:38 +0000)]
Add -c flag to pgrep(1) and pkill(1), to match login classes.

MFC after: 1 month

11 years agofollow up to r254051
avg [Fri, 9 Aug 2013 08:11:09 +0000 (08:11 +0000)]
follow up to r254051

- update powerpc/GENERIC64 as well, suggested by mdf
- update comments so that they make sense after the change, suggested by
  jhb

X-MFC after: never (change specific to head)

11 years agoAdd empty zones for Shared Address Space (RFC 6598)
erwin [Fri, 9 Aug 2013 07:57:04 +0000 (07:57 +0000)]
Add empty zones for Shared Address Space (RFC 6598)

Approved by: delphij (mentor)
MFC after: 3 days
Sponsored by: DK Hostmaster A/S

11 years ago - Fix compile errors from the clang conversion
jeff [Fri, 9 Aug 2013 03:29:46 +0000 (03:29 +0000)]
 - Fix compile errors from the clang conversion
 - Grab AF_SDP_INET from sys/socket.h

Submitted by: Garrett Cooper
Sponsored by: EMC / Isilon Storage Division

11 years ago - Reserve a special AF for SDP. The one we were incorrectly using before
jeff [Fri, 9 Aug 2013 03:26:17 +0000 (03:26 +0000)]
 - Reserve a special AF for SDP.  The one we were incorrectly using before
   was taken by another AF.

Sponsored by: EMC / Isilon Storage Division

11 years ago - Correctly handle various edge cases in sysfs emulation.
jeff [Fri, 9 Aug 2013 03:24:48 +0000 (03:24 +0000)]
 - Correctly handle various edge cases in sysfs emulation.

Sponsored by: EMC / Isilon Storage Division

11 years ago - Use the correct type in the linux bitops emulation.
jeff [Fri, 9 Aug 2013 03:24:12 +0000 (03:24 +0000)]
 - Use the correct type in the linux bitops emulation.

Submitted by: Maxim Ignatenko <gelraen.ua@gmail.com>

11 years agoFix for IPv4 fragment packets treated as RMCP.
yongari [Fri, 9 Aug 2013 01:15:32 +0000 (01:15 +0000)]
Fix for IPv4 fragment packets treated as RMCP.

bit25 of rxMode MAC register of 5762 needs to be set for rx mgmt
filter to work correctly when processing match for UDP header
fields.  Otherwise false positive can occur which causes IPv4
fragment to be received by APE instead of host.

Reported by: Geans Pin <geanspin@broadcom.com>

11 years agoRate limit the 'out of chain frame' messages to once per 60 seconds.
scottl [Fri, 9 Aug 2013 01:10:33 +0000 (01:10 +0000)]
Rate limit the 'out of chain frame' messages to once per 60 seconds.

Obtained from: Netflix
MFC after: 3 days

11 years agoSometimes a device misbehaves so badly that it disrupts the entire system.
scottl [Fri, 9 Aug 2013 01:09:02 +0000 (01:09 +0000)]
Sometimes a device misbehaves so badly that it disrupts the entire system.
Add a tunable that allows such a device to be excluded from the driver.
The id parameter is the target id that the driver assigns to a given device.

dev.mps.X.exclude_ids=<id>,<id>

Obtained from: Netflix
MFC after: 3 days

11 years agoAdd a helpful message that can help point to why a sysctl tree removal failed
scottl [Fri, 9 Aug 2013 01:04:44 +0000 (01:04 +0000)]
Add a helpful message that can help point to why a sysctl tree removal failed

Obtained from: Netflix
MFC after: 3 days

11 years agoMFV r254079:
delphij [Thu, 8 Aug 2013 23:38:31 +0000 (23:38 +0000)]
MFV r254079:

Illumos ZFS issues:
  3957 ztest should update the cachefile before killing itself
  3958 multiple scans can lead to partial resilvering
  3959 ddt entries are not always resilvered
  3960 dsl_scan can skip over dedup-ed blocks if
       physical birth != logical birth
  3961 freed gang blocks are not resilvered and can cause pool to suspend
  3962 ztest should print out zfs debug buffer before exiting

11 years agoUpdate legacy static assignments in old code to support dynamic framing,
dteske [Thu, 8 Aug 2013 22:34:00 +0000 (22:34 +0000)]
Update legacy static assignments in old code to support dynamic framing,
plotting, and alignment coinciding with enhancements in SVN r242667.

11 years agoMFV r254106 (OpenSSL bugfix for RT #2984):
delphij [Thu, 8 Aug 2013 22:29:35 +0000 (22:29 +0000)]
MFV r254106 (OpenSSL bugfix for RT #2984):

Check DTLS_BAD_VER for version number.

The version check for DTLS1_VERSION was redundant as
DTLS1_VERSION > TLS1_1_VERSION, however we do need to
check for DTLS1_BAD_VER for compatibility.

Requested by: zi
Approved by: benl

11 years agoSince the introduction of SVN r244048 and [follow-up] r244089, it is now
dteske [Thu, 8 Aug 2013 22:09:46 +0000 (22:09 +0000)]
Since the introduction of SVN r244048 and [follow-up] r244089, it is now
safe to build upon ``boot_serial?'' functionality to make safer UI choices.

11 years agoSmall typo.
pfg [Thu, 8 Aug 2013 22:07:59 +0000 (22:07 +0000)]
Small typo.

MFC after: 3 days

11 years agoAllow drivers to return BUS_PROBE_NOWILDCARD from their attach routine to
rstone [Thu, 8 Aug 2013 19:30:49 +0000 (19:30 +0000)]
Allow drivers to return BUS_PROBE_NOWILDCARD from their attach routine to
match devices where the driver class was fixed but the unit number was
wildcarded.  This better matches the documented behaviour in
DEVICE_PROBE(9).

Reviewed by: imp

11 years agogpt_entries is used as limit for the number of partition entries in
ae [Thu, 8 Aug 2013 16:09:20 +0000 (16:09 +0000)]
gpt_entries is used as limit for the number of partition entries in
the GEOM_PART. Instead of just using number of entries from the GPT
header, calculate this limit based on the reserved space between
GPT header and first available LBA.

MFC after: 2 weeks

11 years agoWhen newvers.sh is run, it is possible that the svnversion
gjb [Thu, 8 Aug 2013 15:59:00 +0000 (15:59 +0000)]
When newvers.sh is run, it is possible that the svnversion
(or svnliteversion) in the current lookup path is not what
was used to check out the tree.  If an incompatible version
is used, the svn revision number is not reported in uname(1).

Run ${svnversion} on newvers.sh itself when evaluating if the
svn(1) in use is compatible with the tree.  Fallback to an
empty ${svnversion} if necessary.

With this change, svnliteversion from base is only used
if no compatible svnversion is found, so with this change,
the version of svn(1) from the ports tree is evaluated first.

Requested by: many
MFC after: 3 days
X-MFC-To: stable/9, releng/9.2 only

11 years agoPart of r245761 makes "grep -D skip" broken for pipes, i.e.
ache [Thu, 8 Aug 2013 11:53:47 +0000 (11:53 +0000)]
Part of r245761 makes "grep -D skip" broken for pipes, i.e.
echo xxx | grep -D skip xxx
returns nothing. Instead of just removing added S_ISFIFO condition
(originally absent in this version of grep), make it work as latest
GNU version does: don't skip directories and devices if fd == STDIN_FILENO.

11 years agoMake the check for number of entries less strict.
ae [Thu, 8 Aug 2013 11:24:25 +0000 (11:24 +0000)]
Make the check for number of entries less strict.
Some partitioning tools can create GPT with number of entries less
than 128.

MFC after: 1 week

11 years agoAccording to POSIX \ in the fnmatch(3) pattern should escape
ache [Thu, 8 Aug 2013 09:04:02 +0000 (09:04 +0000)]
According to POSIX \ in the fnmatch(3) pattern should escape
any character including '\0', but our version replace escaped '\0'
with '\\'.
I.e. fnmatch("\\", "\\", 0) should not match while fnmatch("\\", "", 0)
should (Linux and NetBSD does the same). Was vice versa.

PR:     181129
MFC after:      1 week

11 years agoCap the number of streams supported to two for now.
adrian [Thu, 8 Aug 2013 05:52:41 +0000 (05:52 +0000)]
Cap the number of streams supported to two for now.

I haven't yet reviewed the Intel driver(s) in more depth to see if
there are 1x1 NICs that report they support 2 transmit/receive chains..
if so then we'll have to update this.

Tested:

* Intel 4965, which is a 2x2 device with 3 RX and 2 TX chains.

PR: kern/181132

11 years agoConvert net80211 over to using if_transmit for the dispatch from the
adrian [Thu, 8 Aug 2013 05:09:35 +0000 (05:09 +0000)]
Convert net80211 over to using if_transmit for the dispatch from the
upper layer(s).

This eliminates the if_snd queue from net80211. Yay!

This unfortunately has a few side effects:

* It breaks ALTQ to net80211 for now - sorry everyone, but fixing
  parallelism and eliminating the if_snd queue is more important
  than supporting this broken traffic scheduling model. :-)

* There's no VAP and IC flush methods just yet - I think I'll add
  some NULL methods for now just as placeholders.

* It reduces throughput a little because now net80211 will drop packets
  rather than buffer them if the driver doesn't do its own buffering.
  This will be addressed in the future as I implement per-node software
  queues.

Tested:

* ath(4) and iwn(4) in STA operation

11 years agoUse local variables with the appropriate types and eliminate a bunch of casts.
neel [Thu, 8 Aug 2013 03:17:39 +0000 (03:17 +0000)]
Use local variables with the appropriate types and eliminate a bunch of casts.

This is a cosmetic change but it does help with a proposed change to increase
the maximum size of physical memory supported on amd64 platforms.

Submitted by: Chris Torek (torek@torek.net)

11 years agoOur libc iconv (unlike gnu iconv and the citrus code in NetBSD) has a
peter [Thu, 8 Aug 2013 01:53:27 +0000 (01:53 +0000)]
Our libc iconv (unlike gnu iconv and the citrus code in NetBSD) has a
bypass mode when src == dst.  Unfortunately, there are tools in ports
that pass byte streams through iconv to determine if the encodings
are valid.  eg: gettext-0.18.3+.

Disable the optimization and behave like the other implementations.

11 years agoMFV r254071:
delphij [Wed, 7 Aug 2013 22:21:00 +0000 (22:21 +0000)]
MFV r254071:

Fix a regression introduced by fix for Illumos bug #3834.  Quote from
Matthew Ahrens on the Illumos issue:

ztest fails this assertion because ztest_dmu_read_write() does
        dmu_tx_hold_free(tx, bigobj, bigoff, bigsize);
and then
    dmu_object_set_checksum(os, bigobj,
        (enum zio_checksum)ztest_random_dsl_prop(ZFS_PROP_CHECKSUM), tx);

If the region to free is past the end of the file, the DMU assumes that there
will be nothing to do for this object.  However, ztest does set_checksum(),
which must modify the dnode.  The fix is for ztest to also call

    dmu_tx_hold_bonus(tx, bigobj);

so we can account for the dirty data associated with setting the checksum

Illumos ZFS issues:
  3955 ztest failure: assertion refcount_count(&tx->tx_space_written)
         + delta <= tx->tx_space_towrite

11 years agoAllow net80211 to compile on stable/9 and stable/8.
adrian [Wed, 7 Aug 2013 22:01:43 +0000 (22:01 +0000)]
Allow net80211 to compile on stable/9 and stable/8.

11 years agoMFV r254070:
delphij [Wed, 7 Aug 2013 21:16:14 +0000 (21:16 +0000)]
MFV r254070:

Merge vendor bugfix for ZFS test suite that triggers false positives.

Illumos ZFS issues:
  3949 ztest fault injection should avoid resilvering devices
  3950 ztest: deadman fires when we're doing a scan
  3951 ztest hang when running dedup test
  3952 ztest: ztest_reguid test and ztest_fault_inject don't place nice together

11 years agoImprove the sysctl symbol extraction from the kernel so that it find more
obrien [Wed, 7 Aug 2013 20:35:26 +0000 (20:35 +0000)]
Improve the sysctl symbol extraction from the kernel so that it find more
(all?) sysctl's.  Previously some where missed, depending on how they were
defined.

11 years agoDon't emit a spurious EVFILT_PROC event with no fflags set on process exit
jhb [Wed, 7 Aug 2013 19:56:35 +0000 (19:56 +0000)]
Don't emit a spurious EVFILT_PROC event with no fflags set on process exit
if NOTE_EXIT is not being monitored.  The rationale is that a listener
should only get an event for exit() if they registered interest via
NOTE_EXIT.  This matches the behavior on OS X.
- Don't save the exit status on process exit unless NOTE_EXIT is being
  monitored.
- Add an internal EV_DROP flag that requests kqueue_scan() to free the
  knote without signalling it to userland and use this when a process
  exits but the fflags in the knote is zero.

Reviewed by: jmg
MFC after: 1 month

11 years agoSplit the pagequeues per NUMA domains, and split pageademon process
kib [Wed, 7 Aug 2013 16:36:38 +0000 (16:36 +0000)]
Split the pagequeues per NUMA domains, and split pageademon process
into threads each processing queue in a single domain.  The structure
of the pagedaemons and queues is kept intact, most of the changes come
from the need for code to find an owning page queue for given page,
calculated from the segment containing the page.

The tie between NUMA domain and pagedaemon thread/pagequeue split is
rather arbitrary, the multithreaded daemon could be allowed for the
single-domain machines, or one domain might be split into several page
domains, to further increase concurrency.

Right now, each pagedaemon thread tries to reach the global target,
precalculated at the start of the pass.  This is not optimal, since it
could cause excessive page deactivation and freeing.  The code should
be changed to re-check the global page deficit state in the loop after
some number of iterations.

The pagedaemons reach the quorum before starting the OOM, since one
thread inability to meet the target is normal for split queues.  Only
when all pagedaemons fail to produce enough reusable pages, OOM is
started by single selected thread.

Launder is modified to take into account the segments layout with
regard to the region for which cleaning is performed.

Based on the preliminary patch by jeff, sponsored by EMC / Isilon
Storage Division.

Reviewed by: alc
Tested by: pho
Sponsored by: The FreeBSD Foundation

11 years agoChange the pmap_ts_referenced() method of amd64 pmap to use shared
kib [Wed, 7 Aug 2013 16:33:15 +0000 (16:33 +0000)]
Change the pmap_ts_referenced() method of amd64 pmap to use shared
pvh_global_lock.  This allows the method to be executed in parallel,
avoiding undue contention on the pvh_global_lock for the multithreaded
pagedaemon.

The pmap_ts_referenced() function has to inspect the page mappings for
several pmaps, which need to be locked while pv list lock is owned.
This contradicts to the lock order, where pmap lock is before pv list
lock.  Introduce the generation count for the pv list of the page or
superpage, which indicate any change in the pv list, and, as usual,
perform restart of the iteration if generation changed while pv lock
was dropped for blocking acquire of a pmap lock.

Reported and tested by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation

11 years agoFix previous commit: both flags must be set.
rpaulo [Wed, 7 Aug 2013 15:55:12 +0000 (15:55 +0000)]
Fix previous commit: both flags must be set.

11 years agoDon't bother trying to work around buffers which are not aligned on a cache
cognet [Wed, 7 Aug 2013 15:44:58 +0000 (15:44 +0000)]
Don't bother trying to work around buffers which are not aligned on a cache
line boundary. It has never been 100% correct, and it can't work on SMP,
because nothing prevents another core from accessing data from an unrelated
buffer in the same cache line while we invalidated it. Just use bounce pages
instead.

Reviewed by: ian
Approved by: mux (mentor) (implicit)

11 years agoRemove droping topology mutex after iterating 100 periphs in CAMGETPASSTHRU.
mav [Wed, 7 Aug 2013 11:34:20 +0000 (11:34 +0000)]
Remove droping topology mutex after iterating 100 periphs in CAMGETPASSTHRU.
That is not so slow and so often operation to handle unneeded otherwise
xsoftc.xpt_generation and respective locking complications.

11 years agoRemove __attribute__((__aligned__)) that generates incorrect alignment on compilers...
theraven [Wed, 7 Aug 2013 11:30:04 +0000 (11:30 +0000)]
Remove __attribute__((__aligned__)) that generates incorrect alignment on compilers that know about SSE.  Code left over from old header that thought that 64 bits was the maximum alignment that anything would ever need...

11 years agoBring initial support for Allwinner A20 SoC (Cubieboard2).
ganbold [Wed, 7 Aug 2013 11:07:56 +0000 (11:07 +0000)]
Bring initial support for Allwinner A20 SoC (Cubieboard2).
Add support for A20 timer.
Correct interrupt offset depending from chip.
Add basic code for CPU configuration module.
For now, add kernel config and dts file
(only FDT blob related problem needs to be solved later in
order to have one kernel for both cubieboard1 and 2).

Approved by: ray@

11 years agoImprove r253721 by reporting detected lack of BIO_FLUSH support to GEOM.
mav [Wed, 7 Aug 2013 08:20:11 +0000 (08:20 +0000)]
Improve r253721 by reporting detected lack of BIO_FLUSH support to GEOM.
That prevents more of such requests from coming and errors from logging.

11 years agoenable KDB_TRACE in GENERICs
avg [Wed, 7 Aug 2013 08:03:50 +0000 (08:03 +0000)]
enable KDB_TRACE in GENERICs

KDB_TRACE is not an alternative to DDB/etc, they are complementary.
So I do not see any reason to not enable KDB_TRACE by default.

X-MFC after: never (change specific to head)

11 years agoRemove unsigned comparison < 0
kevlo [Wed, 7 Aug 2013 07:22:56 +0000 (07:22 +0000)]
Remove unsigned comparison < 0

Found by: LLVM
Reviewed by: luigi

11 years agoReplace kernel virtual address space allocation with vmem. This provides
jeff [Wed, 7 Aug 2013 06:21:20 +0000 (06:21 +0000)]
Replace kernel virtual address space allocation with vmem.  This provides
transparent layering and better fragmentation.

 - Normalize functions that allocate memory to use kmem_*
 - Those that allocate address space are named kva_*
 - Those that operate on maps are named kmap_*
 - Implement recursive allocation handling for kmem_arena in vmem.

Reviewed by: alc
Tested by: pho
Sponsored by: EMC / Isilon Storage Division

11 years agoMake sure IFM_AVALID is also set when checking ifm_status.
rpaulo [Wed, 7 Aug 2013 04:03:30 +0000 (04:03 +0000)]
Make sure IFM_AVALID is also set when checking ifm_status.

Submitted by: yongari

11 years agoAdd a missing module version declaration to if_tun(4).
markj [Wed, 7 Aug 2013 01:32:08 +0000 (01:32 +0000)]
Add a missing module version declaration to if_tun(4).

PR: 181078
Submitted by: Brandon Gooch <jamesbrandongooch@gmail.com>
MFC after: 1 week

11 years agoFix a timing issue with the wired driver.
rpaulo [Wed, 7 Aug 2013 01:01:58 +0000 (01:01 +0000)]
Fix a timing issue with the wired driver.

After configuring the interface, wait for the link to become active.
Many ethernet drivers reset the chip when we set multicast filters
(causing significant delays due to link re-negotiation) and, by the time
we start sending packets, they are discared instead of going to the ether.

Tested by: dumbbell

11 years agoPass variables prefixed with both LD_ and LD_32_ to the run-time linker.
markj [Wed, 7 Aug 2013 00:28:17 +0000 (00:28 +0000)]
Pass variables prefixed with both LD_ and LD_32_ to the run-time linker.
This prevents unintentional execution of programs when running ldd(1) on
32-bit Linux binaries.

PR: 175339, 127276
Suggested by: kib, rstone
Reviewed by: kib
MFC after: 2 weeks

11 years agoFill in the description fields for M_FICT_PAGES.
markj [Wed, 7 Aug 2013 00:20:30 +0000 (00:20 +0000)]
Fill in the description fields for M_FICT_PAGES.

Reviewed by: kib
MFC after: 3 days

11 years agoChange <sys/diskpc98.h> to not redefine the same symbols that are
marcel [Wed, 7 Aug 2013 00:00:48 +0000 (00:00 +0000)]
Change <sys/diskpc98.h> to not redefine the same symbols that are
being defined in <sys/diskmbr.h>. Instead give the symbols here a
"PC98_" prefix. This way, both <sys/diskmbr.h> and <sys/diskpc98.h>
can be included in the same C source file.

The renaming is trivial. The only gotcha is that DOSBBSECTOR is
also redefined from 0 to 1. This because DOSBBSECTOR was always
used in conjunction with an addition of 1. The PC98_BBSECTOR symbol
is defined as 1 and the expression is simplified.

Note: it is not believed that ports are seriously impacted; or at
all for that matter.

Approved by: nyan@

11 years agoMFV r254011:
delphij [Tue, 6 Aug 2013 21:36:01 +0000 (21:36 +0000)]
MFV r254011:

This change have no effect to FreeBSD but integrated for
completeness.

Illumos ZFS issues:
  348 ZFS should handle DKIOCGMEDIAINFOEXT failure

11 years agoAdjust make knobs to know that WITH_ICONV installs a /usr/bin/iconv
sbruno [Tue, 6 Aug 2013 21:30:37 +0000 (21:30 +0000)]
Adjust make knobs to know that WITH_ICONV installs a /usr/bin/iconv

Remove it if the knob isn't tweaked.  Certain ports seem to think that
if /usr/bin/iconv exists, then libc has built in libiconv things and will
blow up pretty nicely when built.

Reviewed by: gjb@
MFC after: 2 weeks

11 years agoMake the various driver MSIX setup routines fallback to MSI more
jfv [Tue, 6 Aug 2013 21:01:38 +0000 (21:01 +0000)]
Make the various driver MSIX setup routines fallback to MSI more
gracefully. This change was suggested by Marius Strobl, thank you.

PR: kern/181016
MFC after: ASAP

11 years ago- Fix a bug in the MSI allocation logic so an MSI is also employed if a
marius [Tue, 6 Aug 2013 19:14:02 +0000 (19:14 +0000)]
- Fix a bug in the MSI allocation logic so an MSI is also employed if a
  controller supports only a single message. I haven't seen such an adapter
  out in the wild, though, so this change likely is a NOP.
  While at it, further simplify the MSI allocation logic; there's no need
  to check the number of available messages on our own as pci_alloc_msi(9)
  will just fail if it can't provide us with the single message we want.
- Nuke the unused softc of aacch(4).

MFC after: 1 month

11 years agoAs it turns out, MSIs are broken with 2820SA so introduce an AAC_FLAGS_NOMSI
marius [Tue, 6 Aug 2013 18:55:59 +0000 (18:55 +0000)]
As it turns out, MSIs are broken with 2820SA so introduce an AAC_FLAGS_NOMSI
quirk and apply it to these controllers [1]. The same problem was reported
for 2230S, in which case it wasn't actually clear whether the culprit is the
controller or the mainboard, though. In order to be on the safe side, flag
MSIs as being broken with the latter type of controller as well. Given that
these are the only reports of MSI-related breakage with aac(4) so far and
OSes like OpenSolaris unconditionally employ MSIs for all adapters of this
family, however, it doesn't seem warranted to generally disable the use of
MSIs in aac(4).
While it, simplify the MSI allocation logic a bit; there's no need to check
for the presence of the MSI capability on our own as pci_alloc_msi(9) will
just fail when these kind of interrupts are not available.
Reported and tested by: David Boyd [1]

MFC after: 3 days

11 years agoWhen the igb driver is static there are cases when early interrupts occur,
jfv [Tue, 6 Aug 2013 18:00:53 +0000 (18:00 +0000)]
When the igb driver is static there are cases when early interrupts occur,
resulting in a panic in refresh_mbufs, to prevent this add a check in the
interrupt handler for DRV_RUNNING.

MFC after: 1 day (critical for 9.2)

11 years agoFix incompatibility in ICMPV6CTL_ND6_PRLIST sysctl, and SIOCGPRLST_IN6,
hrs [Tue, 6 Aug 2013 17:10:52 +0000 (17:10 +0000)]
Fix incompatibility in ICMPV6CTL_ND6_PRLIST sysctl, and SIOCGPRLST_IN6,
SIOCGDRLST_IN6, and SIOCGNBRINFO_IN6 ioctl.  These userland interfaces
treat expiration times in time_second, not time_uptime.

11 years agoThis bug fix is in a code path in rename taken when there is a
mckusick [Tue, 6 Aug 2013 16:50:05 +0000 (16:50 +0000)]
This bug fix is in a code path in rename taken when there is a
collision between a rename and an open system call for the same
target file. Here, rename releases its vnode references, waits for
the open to finish, and then restarts by reacquiring its needed
vnode locks. In this case, rename was unlocking but failing to
release its reference to one of its held vnodes. The effect was
that even after all the actual references to the vnode had gone,
the vnode still showed active references. For files that had been
removed, their space was not reclaimed until the filesystem was
forcibly unmounted.

This bug manifested itself in the Postgres server which would
leak/lose hundreds of files per day amounting to many gigabytes of
disk space. This bug required shutting down Postgres, forcibly
unmounting its filesystem, remounting its filesystem and restarting
Postgres every few days to recover the lost space.

Reported by: Dan Thomas and Palle Girgensohn
Bug-fix by:  kib
Tested by:   Dan Thomas and Palle Girgensohn
MFC after:   2 weeks

11 years agofix fat-fingering in r253996
avg [Tue, 6 Aug 2013 16:18:07 +0000 (16:18 +0000)]
fix fat-fingering in r253996

MFC after: 17 days
X-MFC with: r253996

11 years agoopensolaris code: translate INVARIANTS to DEBUG and ZFS_DEBUG
avg [Tue, 6 Aug 2013 15:51:56 +0000 (15:51 +0000)]
opensolaris code: translate INVARIANTS to DEBUG and ZFS_DEBUG

Do this by forcing inclusion of
sys/cddl/compat/opensolaris/sys/debug_compat.h
via -include option into all source files from OpenSolaris.
Note that this -include option must always be after -include opt_global.h.

Additionally, remove forced definition of DEBUG for some modules and fix
their build without DEBUG.

Also, meaning of DEBUG was overloaded to enable WITNESS support for some
OpenSolaris (primarily ZFS) locks.  Now this overloading is removed and
that use of DEBUG is replaced with a new option OPENSOLARIS_WITNESS.

MFC after: 17 days