]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agoMFC
attilio [Sat, 4 Jun 2011 22:05:20 +0000 (22:05 +0000)]
MFC

13 years agofind: Exit if there is an unknown option.
jilles [Sat, 4 Jun 2011 21:59:55 +0000 (21:59 +0000)]
find: Exit if there is an unknown option.

Ignoring the parameter with the unknown options is unlikely to be what was
intended.

Example:
  find -n .

Note that things like
  find -n
already caused an exit, equivalent to "find" by itself.

13 years agoRename recently added USB serial driver.
hselasky [Sat, 4 Jun 2011 20:40:24 +0000 (20:40 +0000)]
Rename recently added USB serial driver.

Suggested by: YongHyeon PYUN
MFC after: 7 days

13 years agoAdd _mbuf() variants of various inpcb-related interfaces, including lookup,
rwatson [Sat, 4 Jun 2011 16:33:06 +0000 (16:33 +0000)]
Add _mbuf() variants of various inpcb-related interfaces, including lookup,
hash install, etc.  For now, these are arguments are unused, but as we add
RSS support, we will want to use hashes extracted from mbufs, rather than
manually calculated hashes of header fields, due to the expensive of the
software version of Toeplitz (and similar hashes).

Add notes that it would be nice to be able to pass mbufs into lookup
routines in pf(4), optimising firewall lookup in the same way, but the
code structure there doesn't facilitate that currently.

(In principle there is no reason this couldn't be MFCed -- the change
extends rather than modifies the KBI.  However, it won't be useful without
other previous possibly less MFCable changes.)

Reviewed by:    bz
Sponsored by:   Juniper Networks, Inc.

13 years agoIP divert sockets use their inpcbinfo for port reservation, although not
rwatson [Sat, 4 Jun 2011 16:26:02 +0000 (16:26 +0000)]
IP divert sockets use their inpcbinfo for port reservation, although not
for lookup.  I missed its call to in_pcbbind() when preparing previous
patches, which would lead to a lock assertion failure (although problem
not an actual race condition due to global pcbinfo locks providing
required synchronisation -- in this particular case only).  This change
adds the missing locking of the pcbhash lock.

(Existing comments in the ipdivert code question the need for using the
global hash to manage the namespace, as really it's a simple port
namespace and not an address/port namespace.  Also, although in_pcbbind
is used to manage reservations, the hash tables aren't used for lookup.
It might be a good idea to make them use hashed lookup, or to use a
different reservation scheme.)

Reviewed by:    bz
Reported by:    Kristof Provost <kristof at sigsegv.be>
Sponsored by:   Juniper Networks

13 years agoAdd a very simple IPDIVERT test, which creates IP divert sockets and
rwatson [Sat, 4 Jun 2011 16:25:12 +0000 (16:25 +0000)]
Add a very simple IPDIVERT test, which creates IP divert sockets and
checks for collision/non-collision properties in binding them.  This
test would have identified a bug recently reported on current@
involding my disaggregation of the pcbinfo lock.

It would be nice if this test also exercised packet diversion and
injection, but that is for another day.

MFC after: 3 days
Sponsored by: Juniper Networks, Inc.

13 years agoRead from the socket using the same max buffer size as we use while
sobomax [Sat, 4 Jun 2011 16:01:30 +0000 (16:01 +0000)]
Read from the socket using the same max buffer size as we use while
sending. What happens otherwise is that the sender splits all the
traffic into 32k chunks, while the receiver is waiting for the whole
packet. Then for a certain packet sizes, particularly 66607 bytes in
my case, the communication stucks to secondary is expecting to
read one chunk of 66607 bytes, while primary is sending two chunks
of 32768 bytes and third chunk of 1071. Probably due to TCP windowing
and buffering the final chunk gets stuck somewhere, so neither server
not client can make any progress.

This patch also protect from short reads, as according to the manual
page there are some cases when MSG_WAITALL can give less data than
expected.

MFC after: 3 days

13 years agoEnable HT40 (40MHz channel width) support.
bschmidt [Sat, 4 Jun 2011 15:22:01 +0000 (15:22 +0000)]
Enable HT40 (40MHz channel width) support.

13 years agoAdd new fan controller driver for the G4 MDD PowerMac. Submitted and tested
andreast [Sat, 4 Jun 2011 15:17:35 +0000 (15:17 +0000)]
Add new fan controller driver for the G4 MDD PowerMac. Submitted and tested
by Justin Hibbits.

Approved by: nwhitehorn (mentor)

13 years agosh: Reduce more needless differences between error messages.
jilles [Sat, 4 Jun 2011 15:05:52 +0000 (15:05 +0000)]
sh: Reduce more needless differences between error messages.

13 years agoCertain adapters have HT40 support on some but not all channels. The
bschmidt [Sat, 4 Jun 2011 15:05:32 +0000 (15:05 +0000)]
Certain adapters have HT40 support on some but not all channels. The
Intel 4965 devices for example have HT40 on 2GHz completely disabled
but it is still supported for 5GHz. To handle that in sta mode we
need to check if we can "upgrade" to a HT40 channel after the
association, if that is not possible but we are still announcing
support to the remote side we are left with a very flabby connection.

Reviewed by: adrian

13 years agoData frames sent over the mgmt path might be part of a TX aggr session
bschmidt [Sat, 4 Jun 2011 14:28:09 +0000 (14:28 +0000)]
Data frames sent over the mgmt path might be part of a TX aggr session
too. In that case don't fiddle with the seqno as drivers are supposed
to handle that.

Currently only the powersave feature does sent QoS-null-data frames
before and after a background scan which must be handled correctly. Due
to this being quite rare we don't fiddle around with starting of aggr
sessions.

13 years agoFix resolv.conf search list creation:
bz [Sat, 4 Jun 2011 12:51:22 +0000 (12:51 +0000)]
Fix resolv.conf search list creation:
1) do not print out an empty "search ", things do not like it.
2) the search list is not comma separated.

Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems

13 years agoOnly consider QoS frames for TX packet aggregation.
bschmidt [Sat, 4 Jun 2011 11:56:20 +0000 (11:56 +0000)]
Only consider QoS frames for TX packet aggregation.

13 years agoThe firmware of 4965 series adapters seems to die while trying to send
bschmidt [Sat, 4 Jun 2011 11:43:09 +0000 (11:43 +0000)]
The firmware of 4965 series adapters seems to die while trying to send
probe requests at 1Mbps while being associated on a 5GHz channel. Sending
those at 6Mbps does work, so use that instead during a background scan.
This workaround allows us to re-enable background scan support for the
4965 adapters.

Also, just enabling one antenna on 5GHz results in better reception of
beacons:
test            00:26:5a:c6:14:1a   40   54M -71:-95  200 E    WME HTCAP ATH
vs
test            00:26:5a:c6:14:1a   40   54M -92:-95  200 E    WME HTCAP ATH
Due to roam:rssi thresholds set to 7 by default it might have been
impossible to associate to that network. While here use
IEEE80211_IS_CHAN_5GHZ() to determine the band.

13 years agosh: Honour -n while processing -c string.
jilles [Sat, 4 Jun 2011 11:28:42 +0000 (11:28 +0000)]
sh: Honour -n while processing -c string.

13 years ago- Improve error handling.
andreast [Sat, 4 Jun 2011 09:25:59 +0000 (09:25 +0000)]
- Improve error handling.
- Add retry loops for the i2c read/write functions.

Approved by: nwhitehorn (mentor)

13 years ago- Improve error handling.
andreast [Sat, 4 Jun 2011 09:23:54 +0000 (09:23 +0000)]
- Improve error handling.
- Add a retry loop for the i2c sensor reading.
- Check on busy status of the chip and on invalid values.
- Fix a typo in a comment.
- Replace the constant 2732 with the ZERO_C_TO_K macro.

Approved by: nwhitehorn (mentor)

13 years agoReplace the FCU_ZERO_C_TO_K with the ZERO_C_TO_K from powermac_thermal.h.
andreast [Sat, 4 Jun 2011 09:19:53 +0000 (09:19 +0000)]
Replace the FCU_ZERO_C_TO_K with the ZERO_C_TO_K from powermac_thermal.h.

Approved by: nwhitehorn (mentor)

13 years agoCommit radar detection changes missed by my previous commit.
adrian [Sat, 4 Jun 2011 08:24:58 +0000 (08:24 +0000)]
Commit radar detection changes missed by my previous commit.

13 years agoAdd support for True IDE mode to the Octeon CF driver. This mode is
imp [Sat, 4 Jun 2011 07:06:05 +0000 (07:06 +0000)]
Add support for True IDE mode to the Octeon CF driver.  This mode is
signalled when the attribute address for the CF is 0 in the octeon
sysinfo structure.  In this mode, the DATA port is 16-bits, but the
other ports are 8-bits, but on a 16-bit bus (so you have to access it
a short at a time, but only believe the lower byte).  See the code for
more details on this slightly odd arrangement.  I'm still not 100%
happy with the abstractions here on many levels (starting with the
globals for these settings, on down to no bus_space use, etc), but the
driver had these problems before the change.

Also, clean up the code a bit to make this support easier, and the
code a bit easier to read.  I tried to follow existing style, but may
have missed a few spots.  Add some comments.

Fix probe/attach routine to return a proper error for the simulator.

With this change, my EBH5200 eval board now recognizes the CF well
enough to boot to the login prompt.  Before it would say it never
became ready.  My CN3010-EVB-HS5 still boots properly.  My older
CN3860-based board won't load the 64-bit kernel, either before or
after the change, and I didn't chase that down.

13 years agoopensolaris compat / zfs: avoid early overflow in ddi_get_lbolt*
avg [Sat, 4 Jun 2011 07:02:06 +0000 (07:02 +0000)]
opensolaris compat / zfs: avoid early overflow in ddi_get_lbolt*

Reported by: David P. Discher <dpd@bitgravity.com>
Tested by: will
Reviewed by: art
Discussed with: dwhite
MFC after: 2 weeks

13 years agoA few changes to make radar detection implementable in a hal_dfs/
adrian [Sat, 4 Jun 2011 04:14:59 +0000 (04:14 +0000)]
A few changes to make radar detection implementable in a hal_dfs/
module.

* If sc->sc_dodfs is set to 1 by the ath_dfs_radar_enable(),
  set the relevant rx filter bit to begin receiving radar PHY
  errors. The HAL code already knows how to set the relevant
  error mask register to enable radar events.

* Add a missing call to ath_dfs_radar_enable() after ath_hal_reset()

* change ath_dfs_process_phyerr() to take a const char *buf for now,
  rather than a descriptor. This way it can get access to the packet
  buffer contents.

13 years agoRetry the memory map-related portions of r222613, written by andreast,
nwhitehorn [Sat, 4 Jun 2011 04:00:40 +0000 (04:00 +0000)]
Retry the memory map-related portions of r222613, written by andreast,
after some minor tweaks and an increase in the early-boot stack space in
r222632.

13 years agoFix a typo derived from a mismerge from mmu_oea that would cause
nwhitehorn [Sat, 4 Jun 2011 03:22:16 +0000 (03:22 +0000)]
Fix a typo derived from a mismerge from mmu_oea that would cause
pmap_sync_icache() to sync random (possibly uncached or nonexisting!)
memory, causing kernel page faults or machine checks, most easily
triggered by using GDB. While here, add an additional safeguard to only
sync cacheable memory.

MFC after: 2 days

13 years agoModify the new NFS server so that the NFSv3 Pathconf RPC
rmacklem [Sat, 4 Jun 2011 01:13:09 +0000 (01:13 +0000)]
Modify the new NFS server so that the NFSv3 Pathconf RPC
doesn't return an error when the underlying file system
lacks support for any of the four _PC_xxx values used, by
falling back to default values.

Tested by: avg
MFC after: 2 weeks

13 years agosh: Add tests for -n flag. These already pass.
jilles [Fri, 3 Jun 2011 21:17:42 +0000 (21:17 +0000)]
sh: Add tests for -n flag. These already pass.

13 years ago- Rename the Cronyx Omega2-PCI entry to Exar XR17C158 since that is the
jhb [Fri, 3 Jun 2011 20:59:21 +0000 (20:59 +0000)]
- Rename the Cronyx Omega2-PCI entry to Exar XR17C158 since that is the
  real owner of the device ID.  Also rename the associated config
  function while here.
- Add support for the 2-port and 4-port Exar parts as well: Exar XR17C/D152
  and Exar XR17C154.

Tested by: Mike Tancsa, Willy Offermans  Willy of offermans rompen nl
MFC after: 1 week

13 years ago- Introduce a define for ZERO_C_TO_K.
andreast [Fri, 3 Jun 2011 20:43:12 +0000 (20:43 +0000)]
- Introduce a define for ZERO_C_TO_K.
- Fix the printing of the temperature when we exceed the critical value.

Approved by: nwhitehorn (mentor)

13 years ago- Improve error handling.
andreast [Fri, 3 Jun 2011 18:58:32 +0000 (18:58 +0000)]
- Improve error handling.
- Add a retry loop for the i2c sensor reading.
- Update the sensor handling for sensors which do not have a location
entry. [1]

Submitted by: [1] Justin Hibbits.
Approved by: nwhitehorn (mentor)

13 years agoUpgrade libcompiler_rt from revision 117047 to 132478.
ed [Fri, 3 Jun 2011 17:49:16 +0000 (17:49 +0000)]
Upgrade libcompiler_rt from revision 117047 to 132478.

It seems there have only been a small amount to the compiler-rt source
code in the mean time. I'd rather have the code in sync as much as
possible by the time we release 9.0. Changes:

- The libcompiler_rt library is now dual licensed under both the
  University of Illinois "BSD-Like" license and the MIT license.

- Our local modifications for using .hidden instead of .private_extern
  have been upstreamed, meaning our changes to lib/assembly.h can now be
  reverted.

- A possible endless recursion in __modsi3() has been fixed.

- Support for ARM EABI has been added, but it has no effect on FreeBSD
  (yet).

- The functions __udivmodsi4 and __divmodsi4 have been added.

Requested by: many, including bf@ and Pedro Giffuni

13 years agoMFC
attilio [Fri, 3 Jun 2011 17:09:15 +0000 (17:09 +0000)]
MFC

13 years agoExplicitly initialize the packet buffer to NULL after we unmap the zero copy
csjp [Fri, 3 Jun 2011 14:57:38 +0000 (14:57 +0000)]
Explicitly initialize the packet buffer to NULL after we unmap the zero copy
buffers.  This fixes a segfault on exit due to calling free on a bogus pointer.
This should be considered a temporary stop gap fix to avoid the crash.  The
complete fix re-shuffles the initializations of some of the clean-up pointers.

The details of the fix can be found in the libpcap git repository:
commit bc8209b71e928870b0f172d43b174ab27ba24394

Proded by: kevlo, rpaulo
MFC after: 2 weeks
Submitted by: Anton Yuzhaninov

13 years agoWhen MANCOLOR environment variable is set, enable ANSI color escapes
ru [Fri, 3 Jun 2011 14:34:38 +0000 (14:34 +0000)]
When MANCOLOR environment variable is set, enable ANSI color escapes
in grotty(1).  This makes it possible to view colorized manpages in
color.

When MANPAGER environment variable is set, use it instead of PAGER.

Why another environment variable, one might ask?  With color output
enabled, both a terminal and a pager should support the ANSI color
escapes.  On a supporting terminal, less(1) with option -R would be
such a pager, while "more -s" (the current default pager for man(1))
will show garbage.  It means a different default pager is needed when
color output is enabled, but many people have PAGER set customary,
and it's unlikely to support ANSI color escapes, so introducing yet
another variable (MANPAGER) seemed like a good option to me:

- if MANPAGER is set, use that unconditionally;

- if you disable color support (it is by default), and don't set
  MANPAGER, you get an old behavior: -P pager, $PAGER, "more -s",
  in that order;

- if you enable color support (by setting MANCOLOR), and don't set
  MANPAGER, we ignore PAGER which is unlikely to support ANSI color
  escapes, and you get: -P pager, "less -Rs", in that order;

- you might have good reasons for different man(1) and general
  purpose pagers;

- later versions of GNU man(1) support MANPAGER.

13 years agoUpdate disk's stripesize and stripeoffset parameters on provider open.
mav [Fri, 3 Jun 2011 13:49:18 +0000 (13:49 +0000)]
Update disk's stripesize and stripeoffset parameters on provider open.
They are media-dependent and may change in run-time, same as sectorsize
and/or mediasize.

SCSI devices return physical sector size and offset via READ CAPACITY(16)
command and so can not report it until media inserted or at least until
probe sequence completed. UNMAP support is also reported there.

13 years agoProperly return an ENOBUFS error if a write to a tun(4) device fails
jhb [Fri, 3 Jun 2011 13:47:05 +0000 (13:47 +0000)]
Properly return an ENOBUFS error if a write to a tun(4) device fails
due to m_uiotombuf() failing.

While here, trim unneeded error handling related to tuninit() since it
can never fail.

Submitted by: Martin Birgmeier  la5lbtyi aon at
Reviewed by: glebius
MFC after: 1 week

13 years agoDon't use col(1) since grotty(1) never outputs reverse line feeds,
ru [Fri, 3 Jun 2011 13:45:11 +0000 (13:45 +0000)]
Don't use col(1) since grotty(1) never outputs reverse line feeds,
and because col(1) mangles ANSI color escapes if enabled.  Spaces
to tabs compression is now done by passing -h to grotty(1).

Discussed with: uqs

13 years agoRe-enable SGR support (ANSI color escapes) in grotty(1) by default.
ru [Fri, 3 Jun 2011 12:02:53 +0000 (12:02 +0000)]
Re-enable SGR support (ANSI color escapes) in grotty(1) by default.
Our man(1) and bsd.doc.mk still disable it for POLA reasons via the
-c option to grotty(1).

PR: gnu/82353

13 years agoDon't pass -o1- to groff(1) by default. If ms(7) formatted document
ru [Fri, 3 Jun 2011 11:58:17 +0000 (11:58 +0000)]
Don't pass -o1- to groff(1) by default.  If ms(7) formatted document
uses the .RP macro, a separate cover page is created as page 0 which
is not otherwise output.  The bug was hiding by a hack in troffrc
that disables SGR support in grotty(1), which I'm going to remove now.
For POLA reasons, still disable SGR support in grotty(1), by passing
-P-c to groff(1).  If we want SGR sequences in these documents, this
can be removed.

MFC after: 1 week

13 years agoGenerally clean up markup.
ru [Fri, 3 Jun 2011 10:39:36 +0000 (10:39 +0000)]
Generally clean up markup.

13 years agoBring over the relevant registers to use when implementing the quiet time
adrian [Fri, 3 Jun 2011 07:27:53 +0000 (07:27 +0000)]
Bring over the relevant registers to use when implementing the quiet time
portion of 802.11h.

The AR5212 code has been brought over as a reference, it's currently
untested.

Obtained from: Atheros

13 years agoIncrease maximum supported number of ranges per TRIM command from 256 to 512
mav [Fri, 3 Jun 2011 07:25:36 +0000 (07:25 +0000)]
Increase maximum supported number of ranges per TRIM command from 256 to 512
to use full potential of Intel X25-M SSDs. On synthetic test with 32K ranges
it gives about 20% speedup, which probably costs more then 2K of RAM.

13 years agoAdd diagnostic message about not aligned partitions.
ae [Fri, 3 Jun 2011 06:58:24 +0000 (06:58 +0000)]
Add diagnostic message about not aligned partitions.

Idea from: ivoras

13 years agoTrim more when parsing MANCONFIG directive.
ru [Fri, 3 Jun 2011 05:56:52 +0000 (05:56 +0000)]
Trim more when parsing MANCONFIG directive.

13 years agoTypo.
ru [Fri, 3 Jun 2011 05:16:54 +0000 (05:16 +0000)]
Typo.

13 years agoAdded support for the MANWIDTH environment variable:
ru [Fri, 3 Jun 2011 05:16:33 +0000 (05:16 +0000)]
Added support for the MANWIDTH environment variable:

If set to a numeric value, used as the width manpages should be
displayed.  Otherwise, if set to a special value ``tty'', and
output is to a terminal, the pages may be displayed over the
whole width of the screen.

13 years agoQuantities stored on the stack on ppc64 tend to be twice as large as on
nwhitehorn [Fri, 3 Jun 2011 00:11:13 +0000 (00:11 +0000)]
Quantities stored on the stack on ppc64 tend to be twice as large as on
ppc32, so make the early stack correspondingly twice as big.

13 years agoAlways use LCM when stripesize > 0.
ae [Thu, 2 Jun 2011 22:15:19 +0000 (22:15 +0000)]
Always use LCM when stripesize > 0.

13 years agoUse stripesize and stripeoffset in the automatic calculation of
ae [Thu, 2 Jun 2011 21:59:21 +0000 (21:59 +0000)]
Use stripesize and stripeoffset in the automatic calculation of
partition offsets. If user requests specific alignment and
provider's stripesize is not zero, then use a least common multiple
from the stripesize and user specified value.
Also fix "gpart resize" implementation: do not try to align the partition
size, because the start offset may be not aligned. Instead align the
end offset and then calculate size. Also use stripesize and stripeoffset
for "gpart resize" command.

13 years agoWhen possible, join ranges of subsequest BIO_DELETE requests to handle more
mav [Thu, 2 Jun 2011 20:56:42 +0000 (20:56 +0000)]
When possible, join ranges of subsequest BIO_DELETE requests to handle more
(up to 2048 instead of 256 or even 64) of them with single TRIM request.

OCZ Vertex2/Vertex3 SSDs can handle no more then 64 ranges per TRIM request.
Due to lack of BIO_DELETE clustering now, it means that we could delete no
more then 2MB per request (on FS with 32K block) with limited request rate.
This change increases delete rate on Vertex2 from 250MB/s to 950MB/s.

13 years agoFix the nfs related daemons so that they don't intermittently
rmacklem [Thu, 2 Jun 2011 20:15:32 +0000 (20:15 +0000)]
Fix the nfs related daemons so that they don't intermittently
fail with "bind: address already in use". This problem was reported
to the freebsd-stable@ mailing list on Feb. 19 under the subject
heading "statd/lockd startup failure" by george+freebsd at m5p dot com.
The problem is that the first combination of {udp,tcp X ipv4,ipv6}
would select a port# dynamically, but one of the other three combinations
would have that port# already in use. The patch is somewhat involved
because it was requested by dougb@ that the four combinations use the
same port# wherever possible. The patch splits the create_service()
function into two functions. The first goes as far as bind(2) in a
loop for up to GETPORT_MAXTRY - 1 times, attempting to use the same port#
for all four cases. If these attempts fail, the last attempt allows
the 4 cases to use different port #s. After this function has succeeded,
the second function, called complete_service(), does the rest of what
create_service() did.
The three daemons mountd, rpc.lockd and rpc.statd all have a
create_service() function that is patched in a similar way. However,
create_service() has non-trivial differences for the three daemons
that made it impractical to share the same functions between them.

Reviewed by: jhb
MFC after: 2 weeks

13 years agoImport compiler-rt r132478.
ed [Thu, 2 Jun 2011 20:02:42 +0000 (20:02 +0000)]
Import compiler-rt r132478.

13 years agoFix the nfs related daemons so that they don't intermittently
rmacklem [Thu, 2 Jun 2011 19:49:47 +0000 (19:49 +0000)]
Fix the nfs related daemons so that they don't intermittently
fail with "bind: address already in use". This problem was reported
to the freebsd-stable@ mailing list on Feb. 19 under the subject
heading "statd/lockd startup failure" by george+freebsd at m5p dot com.
The problem is that the first combination of {udp,tcp X ipv4,ipv6}
would select a port# dynamically, but one of the other three combinations
would have that port# already in use. The patch is somewhat involved
because it was requested by dougb@ that the four combinations use the
same port# wherever possible. The patch splits the create_service()
function into two functions. The first goes as far as bind(2) in a
loop for up to GETPORT_MAXTRY - 1 times, attempting to use the same port#
for all four cases. If these attempts fail, the last attempt allows
the 4 cases to use different port #s. After this function has succeeded,
the second function, called complete_service(), does the rest of what
create_service() did.
The three daemons mountd, rpc.lockd and rpc.statd all have a
create_service() function that is patched in a similar way. However,
create_service() has non-trivial differences for the three daemons
that made it impractical to share the same functions between them.

Reviewed by: jhb
MFC after: 2 weeks

13 years agoFix the nfs related daemons so that they don't intermittently
rmacklem [Thu, 2 Jun 2011 19:33:33 +0000 (19:33 +0000)]
Fix the nfs related daemons so that they don't intermittently
fail with "bind: address already in use". This problem was reported
to the freebsd-stable@ mailing list on Feb. 19 under the subject
heading "statd/lockd startup failure" by george+freebsd at m5p dot com.
The problem is that the first combination of {udp,tcp X ipv4,ipv6}
would select a port# dynamically, but one of the other three combinations
would have that port# already in use. The patch is somewhat involved
because it was requested by dougb@ that the four combinations use the
same port# wherever possible. The patch splits the create_service()
function into two functions. The first goes as far as bind(2) in a
loop for up to GETPORT_MAXTRY - 1 times, attempting to use the same port#
for all four cases. If these attempts fail, the last attempt allows
the 4 cases to use different port #s. After this function has succeeded,
the second function, called complete_service(), does the rest of what
create_service() did.
The three daemons mountd, rpc.lockd and rpc.statd all have a
create_service() function that is patched in a similar way. However,
create_service() has non-trivial differences for the three daemons
that made it impractical to share the same functions between them.

Reviewed by: jhb
MFC after: 2 weeks

13 years agoTemporarily back out those parts of r222613 related to parsing the memory
nwhitehorn [Thu, 2 Jun 2011 17:43:17 +0000 (17:43 +0000)]
Temporarily back out those parts of r222613 related to parsing the memory
map. They cause non-understood boot failures on some Apple machines with
more than 2 GB of RAM (like my work desktop).

13 years agoThe POWER7 has only 32 SLB slots instead of 64, like other supported
nwhitehorn [Thu, 2 Jun 2011 14:25:52 +0000 (14:25 +0000)]
The POWER7 has only 32 SLB slots instead of 64, like other supported
64-bit PowerPC CPUs. Add infrastructure to support variable numbers of
SLB slots and move the user slot from 63 to 0, so that it is always
available.

13 years agoWrite the multi step netconfig to a temporary file and only move that
bz [Thu, 2 Jun 2011 14:25:27 +0000 (14:25 +0000)]
Write the multi step netconfig to a temporary file and only move that
to the final name if netconfig was completely finished.  This fixes
reentrance problems even better than r222611.

Suggested by: nwhitehorn
Reviewed by: nwhitehorn
Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems

13 years agoIf running under a hypervisor, don't yell at the user about starting
nwhitehorn [Thu, 2 Jun 2011 14:23:36 +0000 (14:23 +0000)]
If running under a hypervisor, don't yell at the user about starting
unknown CPU types, instead relying on the hypervisor to have given us a
reasonable environment.

13 years agoMissed file in r222613.
nwhitehorn [Thu, 2 Jun 2011 14:22:00 +0000 (14:22 +0000)]
Missed file in r222613.

13 years agoExplicitly initialize the first thread's MSR to PSL_KERNSET.
nwhitehorn [Thu, 2 Jun 2011 14:21:20 +0000 (14:21 +0000)]
Explicitly initialize the first thread's MSR to PSL_KERNSET.

13 years agoInclude the modules area in the mapped kernel code. This fixes the kernel's
nwhitehorn [Thu, 2 Jun 2011 14:19:18 +0000 (14:19 +0000)]
Include the modules area in the mapped kernel code. This fixes the kernel's
access to modules and loader metadata when started from real mode, but
without a direct map.

13 years agoRemove some dead code: unnecessary isyncs and memory sorting, which are
nwhitehorn [Thu, 2 Jun 2011 14:15:44 +0000 (14:15 +0000)]
Remove some dead code: unnecessary isyncs and memory sorting, which are
handled in mtmsr() and mem_regions(), respectively.

13 years agoMFpseries:
nwhitehorn [Thu, 2 Jun 2011 14:12:37 +0000 (14:12 +0000)]
MFpseries:
Renovate and improve the AIM Open Firmware support:
- Add RTAS (Run-Time Abstraction Services) support, found on all IBM systems
  and some Apple ones
- Improve support for 32-bit real mode Open Firmware systems
- Pull some more OF bits over from the AIM directory
- Fix memory detection on IBM LPARs and systems with more than one /memory
  node (by andreast@)

13 years agoMFC
attilio [Thu, 2 Jun 2011 14:09:30 +0000 (14:09 +0000)]
MFC

13 years agoEmpty the network configuration only after the user decided to pick an
bz [Thu, 2 Jun 2011 14:08:50 +0000 (14:08 +0000)]
Empty the network configuration only after the user decided to pick an
interface.  Otherwise an accidental start of the netowrk configuration
and immediate cancel after the install has finished removes the previously
configured settings.

Discussed with: nwhitehorn
Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems

13 years agoFix opening a shell on the new system (prevent the shell's stderr from
nwhitehorn [Thu, 2 Jun 2011 13:57:49 +0000 (13:57 +0000)]
Fix opening a shell on the new system (prevent the shell's stderr from
ending up in the install log).

13 years agoDo not hide stripeoffset from libgeom(3), it may be useful even when
ae [Thu, 2 Jun 2011 12:49:45 +0000 (12:49 +0000)]
Do not hide stripeoffset from libgeom(3), it may be useful even when
stripesize is zero.

MFC after: 1 week

13 years agoDo not leak the pcbinfohash lock in the case where in6_pcbladdr() returns
rwatson [Thu, 2 Jun 2011 10:21:05 +0000 (10:21 +0000)]
Do not leak the pcbinfohash lock in the case where in6_pcbladdr() returns
an error during TCP connect(2) on an IPv6 socket.

Submitted by: bz
Sponsored by: Juniper Networks, Inc.

13 years agoFix man -t by not passing grotty flags to groff when grotty is not
uqs [Thu, 2 Jun 2011 10:18:49 +0000 (10:18 +0000)]
Fix man -t by not passing grotty flags to groff when grotty is not
involved.

This fixes a regression introduced with r221303.

Noticed by: jilles

13 years agomdoc: reorder sections consistently
uqs [Thu, 2 Jun 2011 09:56:53 +0000 (09:56 +0000)]
mdoc: reorder sections consistently

13 years agomdoc: fix markup
uqs [Thu, 2 Jun 2011 09:56:42 +0000 (09:56 +0000)]
mdoc: fix markup

13 years agoCut and paste mistake corrected.
jfv [Thu, 2 Jun 2011 05:31:54 +0000 (05:31 +0000)]
Cut and paste mistake corrected.

13 years agoThere are a couple of structs in mfireg.h with members named 'class'.
emaste [Thu, 2 Jun 2011 00:43:16 +0000 (00:43 +0000)]
There are a couple of structs in mfireg.h with members named 'class'.
These cause problems when trying to include the header in a C++ project.
Rename them to 'evt_class', and track the change in mfi and mfiutil.

Submitted by: Mark Johnston
Sponsored by: Sandvine Incorporated
Reviewed by: jhb@
MFC after: 1 week

13 years agoFirst off: update the driver README, the old one was horribly
jfv [Thu, 2 Jun 2011 00:34:57 +0000 (00:34 +0000)]
First off: update the driver README, the old one was horribly
crusty, and this still isn't perfect, but its at least a bit
more recent.

Secondly, a few improvements to the driver from Andrew Boyer,
support hint to allow devices to not attach, add VLAN_HWTSO
capability so vlans can use TSO, fix in the interrupt handler
to make sure the stack TX queue is processed. Oh, and also
make sure IPv6 does not cause a re-init in the ioctl routine.
Thanks for your efforts Andrew!

Thanks to Claudio Jeker for noticing the ixgbe_xmit() routine
was not correctly swapping the dma map from the first to the
last descriptor in a multi-descriptor transmission, corrected
this.

13 years agoIn the VOP_PUTPAGES() implementations, change the default error from
kib [Wed, 1 Jun 2011 21:00:28 +0000 (21:00 +0000)]
In the VOP_PUTPAGES() implementations, change the default error from
VM_PAGER_AGAIN to VM_PAGER_ERROR for the uwritten pages. Return
VM_PAGER_AGAIN for the partially written page. Always forward at least
one page in the loop of vm_object_page_clean().

VM_PAGER_ERROR causes the page reactivation and does not clear the
page dirty state, so the write is not lost.

The change fixes an infinite loop in vm_object_page_clean() when the
filesystem returns permanent errors for some page writes.

Reported and tested by: gavin
Reviewed by: alc, rmacklem
MFC after: 1 week

13 years agoFlesh out the radar detection related operations for the ath driver.
adrian [Wed, 1 Jun 2011 20:09:49 +0000 (20:09 +0000)]
Flesh out the radar detection related operations for the ath driver.

This is in no way a complete DFS/radar detection implementation!
It merely creates an abstracted interface which allows for future
development of the DFS radar detection code.

Note: Net80211 already handles the bulk of the DFS machinery,
all we need to do here is figure out that a radar event has occured
and inform it as such. It then drives the DFS state engine for us.

The "null" DFS radar detection module is included by default;
it doesn't require a device line.

This commit:

* Adds a simple abstracted layer for radar detection state -
  sys/dev/ath/ath_dfs/;
* Implements a null DFS module which doesn't do anything;
  (ie, implements the exact behaviour at the moment);
* Adds hooks to the ath driver to process received radar events
  and gives the DFS module a chance to determine whether
  a radar has been detected.

Obtained from: Atheros

13 years agoAdd some missing DFS chipset functionality to the FreeBSD HAL.
adrian [Wed, 1 Jun 2011 20:01:02 +0000 (20:01 +0000)]
Add some missing DFS chipset functionality to the FreeBSD HAL.

Please note - this doesn't in any way constitute a full DFS
implementation, it merely adds the relevant capability bits and
radar detection threshold register access.

The particulars:

* Add new capability bits outlining what the DFS capabilities
  are of the various chipsets.
* Add HAL methods to set and get the radar related register values.
* Add AR5212 and AR5416+ DFS radar related register value
  routines.
* Add a missing HAL phy error code that's related to radar event
  processing.
* Add HAL_PHYERR_PARAM, a data type that encapsulates the radar
  register values.

The AR5212 routines are just for completeness. The AR5416 routines
are a super-set of those; I may later on do a drive-by pass to
tidy up duplicate code.

Obtained from: Linux, Atheros

13 years agoAdd an optional netisr dispatch point at ether_input(), but set the
rwatson [Wed, 1 Jun 2011 20:00:25 +0000 (20:00 +0000)]
Add an optional netisr dispatch point at ether_input(), but set the
default dispatch method to NETISR_DISPATCH_DIRECT in order to force
direct dispatch.  This adds a fairly negligble overhead without
changing default behavior, but in the future will allow deferred or
hybrid dispatch to other worker threads before link layer processing
has taken place.

For example, this could allow redistribution using RSS hashes
without ethernet header cache line hits, if the NIC was unable to
adequately implement load balancing to too small a number of input
queues -- perhaps due to hard queueset counts of 1, 3, or 8, but in
a modern system with 16-128 threads.  This can happen on highly
threaded systems, where you want want an ithread per core,
redistributing work to other queues, but also on virtualised systems
where hardware hashing is (or is not) available, but only a single
queue has been directed to one VCPU on a VM.

Note: this adds a previously non-present assertion about the
equivalence of the ifnet from which the packet is received, and the
ifnet stamped in the mbuf header.  I believe this assertion to
generally be true, but we'll find out soon -- if it's not, we might
have to add additional overhead in some cases to add an m_tag with
the originating ifnet pointer stored in it.

Reviewed by:    bz
MFC after:      3 weeks
Sponsored by:   Juniper Networks, Inc.

13 years agoO_FORWARD_IP is only action which depends from the result of lookup of
ae [Wed, 1 Jun 2011 19:44:52 +0000 (19:44 +0000)]
O_FORWARD_IP is only action which depends from the result of lookup of
dynamic rules. We are doing forwarding in the following cases:
 o For the simple ipfw fwd rule, e.g.

fwd 10.0.0.1 ip from any to any out xmit em0
fwd 127.0.0.1,3128 tcp from any to any 80 in recv em1

 o For the dynamic fwd rule, e.g.

  fwd 192.168.0.1 tcp from any to 10.0.0.3 3333 setup keep-state

        When this rule triggers it creates a dynamic rule, but this
dynamic rule should forward packets only in forward direction.

 o And the last case that does not work before - simple fwd rule which
 triggers when some dynamic rule is already executed.

PR: kern/147720, kern/150798
MFC after: 1 month

13 years agoPoke correct GPIO pins for newer axe(4) controllers with Marvell
yongari [Wed, 1 Jun 2011 18:42:44 +0000 (18:42 +0000)]
Poke correct GPIO pins for newer axe(4) controllers with Marvell
PHY. Newer models seem to use different LED mode that requires
enabling both GPIO1 and GPIO2.

Tested by: marcel

13 years agoAdd support for new USB serial driver.
hselasky [Wed, 1 Jun 2011 17:58:27 +0000 (17:58 +0000)]
Add support for new USB serial driver.

Submitted by: Lev Serebryakov, lev @
MFC after: 14 days

13 years agoMFC
attilio [Wed, 1 Jun 2011 16:54:33 +0000 (16:54 +0000)]
MFC

13 years agoDon't try to close the stream if fopen(3) fails.
jh [Wed, 1 Jun 2011 15:48:43 +0000 (15:48 +0000)]
Don't try to close the stream if fopen(3) fails.

PR: bin/155349
Submitted by: Urankar Mikael

13 years agoHide some debug messages under debug macro.
ae [Wed, 1 Jun 2011 12:33:05 +0000 (12:33 +0000)]
Hide some debug messages under debug macro.

MFC after: 1 week

13 years agoHide useless warning under debug macro.
ae [Wed, 1 Jun 2011 12:05:35 +0000 (12:05 +0000)]
Hide useless warning under debug macro.

PR: kern/69963
MFC after: 1 week

13 years agoAdd .interp back into INITIAL_READONLY_SECTIONS in MIPS n64 ABI.
jchandra [Wed, 1 Jun 2011 10:23:03 +0000 (10:23 +0000)]
Add .interp back into INITIAL_READONLY_SECTIONS in MIPS n64 ABI.

The binutils update in r218822 caused the MIPS n64 dynamic binaries to
fail because the ".interp" section is not in the initial sections.
This happens because elf64bmip-defs.sh overrides INITIAL_READONLY_SECTIONS
to add ".MIPS.options" sections instead of the ".reginfo" section used
by n32.
This used to work fine, but after r218822, INITIAL_READONLY_SECTIONS also
contains the .interp section, so the override has to be done differently.

Reported by : aduane at juniper

Obtained from: gonzo (Initial version)

13 years agoProvide hit-count with rest of the information about a filter.
np [Wed, 1 Jun 2011 01:32:58 +0000 (01:32 +0000)]
Provide hit-count with rest of the information about a filter.

MFC after: 1 week

13 years agoFirmware device log.
np [Tue, 31 May 2011 23:49:13 +0000 (23:49 +0000)]
Firmware device log.

# sysctl dev.t4nex.0.devlog

MFC after: mdf's sysctl+sbuf changes are MFC'd

13 years agoFix a bug introduced in revision 222537.
ken [Tue, 31 May 2011 22:39:32 +0000 (22:39 +0000)]
Fix a bug introduced in revision 222537.

In msgbuf_reinit() and msgbuf_init(), we weren't initializing the mutex.
Depending on the contents of memory, the LO_INITIALIZED flag might be
set on the mutex (either due to a warm reboot, and the message buffer
remaining in place, or due to garbage in memory) and in that case, with
INVARIANTS turned on, we would trigger an assertion that the mutex had
already been initialized.

Fix this by bzeroing the message buffer mutex for the _init() and _reinit()
paths.

Reported by: mdf

13 years agoRevert mismerge
attilio [Tue, 31 May 2011 21:42:34 +0000 (21:42 +0000)]
Revert mismerge

13 years agoMFC
attilio [Tue, 31 May 2011 21:22:44 +0000 (21:22 +0000)]
MFC

13 years agoRevert r222363, as bde@ pointed out the initial solution was far more
attilio [Tue, 31 May 2011 20:59:53 +0000 (20:59 +0000)]
Revert r222363, as bde@ pointed out the initial solution was far more
correct.

13 years agoFix KTR_CPUMASK in order to accept a string representing a cpuset_t.
attilio [Tue, 31 May 2011 20:48:58 +0000 (20:48 +0000)]
Fix KTR_CPUMASK in order to accept a string representing a cpuset_t.
This introduce all the underlying support for making this possible (via
the function cpusetobj_strscan() and keeps ktr_cpumask exported.  sparc64
implements its own assembly primitives for tracing events and needs to
properly check it.  Anyway the sparc64 logic is not implemented yet due
to lack of knowledge (by me) and time (by marius), but it is just a
matter of using ktr_cpumask when possible.

Tested and fixed by: pluknet
Reviewed by: marius

13 years agoRevert a change that crept in during MFC.
attilio [Tue, 31 May 2011 20:23:33 +0000 (20:23 +0000)]
Revert a change that crept in during MFC.

13 years agoMerge ACPICA 20110527.
jkim [Tue, 31 May 2011 19:45:58 +0000 (19:45 +0000)]
Merge ACPICA 20110527.

13 years agoAdd module version to iwi/ipw/wpi and iwn.
bschmidt [Tue, 31 May 2011 19:08:25 +0000 (19:08 +0000)]
Add module version to iwi/ipw/wpi and iwn.

The version is used to check if a module is already preset, not setting
it results in:

can't re-use a leaf (ipw)!
module_register: module pci/ipw already exists!
Module pci/ipw failed to register: 17

while trying to load the module due to an entry in loader.conf. With this
commit we get the expected:

module ipw already present!

Reported by: Dru Lavigne, bz
Tested by: bz
MFC after: 1 week

13 years agoIf driver is not running, disable interrupts and do not try to
yongari [Tue, 31 May 2011 18:45:15 +0000 (18:45 +0000)]
If driver is not running, disable interrupts and do not try to
process received frames.  Previously it was possible to handle RX
interrupts even if controller is not fully initialized. This
resulted in non-working driver after system is up and running.

Reported by: hselasky
Tested by: hselasky

13 years agoAdd a sentence to the umount.8 man page to clarify the behaviour
rmacklem [Tue, 31 May 2011 18:27:18 +0000 (18:27 +0000)]
Add a sentence to the umount.8 man page to clarify the behaviour
for forced dismount when used on an NFS mount point. Requested by
Jeremy Chadwick.
This is a content change.

MFC after: 2 weeks

13 years agoFix the new NFS client so that it doesn't do an NFSv3
rmacklem [Tue, 31 May 2011 17:43:25 +0000 (17:43 +0000)]
Fix the new NFS client so that it doesn't do an NFSv3
Pathconf RPC for cases where the reply doesn't include
the answer. This fixes a problem reported by avg@ where
the NFSv3 Pathconf RPC would fail when "ls -l" did an
lpathconf(2) for _PC_ACL_NFS4.

Tested by: avg
MFC after: 2 weeks

13 years agoFix apparent garbage in the message buffer.
ken [Tue, 31 May 2011 17:29:58 +0000 (17:29 +0000)]
Fix apparent garbage in the message buffer.

While we have had a fix in place (options PRINTF_BUFR_SIZE=128) to fix
scrambled console output, the message buffer and syslog were still getting
log messages one character at a time.  While all of the characters still
made it into the log (courtesy of atomic operations), they were often
interleaved when there were multiple threads writing to the buffer at the
same time.

This fixes message buffer accesses to use buffering logic as well, so that
strings that are less than PRINTF_BUFR_SIZE will be put into the message
buffer atomically.  So now dmesg output should look the same as console
output.

subr_msgbuf.c: Convert most message buffer calls to use a new spin
lock instead of atomic variables in some places.

Add a new routine, msgbuf_addstr(), that adds a
NUL-terminated string to a message buffer.  This
takes a priority argument, which allows us to
eliminate some races (at least in the the string
at a time case) that are present in the
implementation of msglogchar().  (dangling and
lastpri are static variables, and are subject to
races when multiple callers are present.)

msgbuf_addstr() also allows the caller to request
that carriage returns be stripped out of the
string.  This matches the behavior of msglogchar(),
but in testing so far it doesn't appear that any
newlines are being stripped out.  So the carriage
return removal functionality may be a candidate
for removal later on if further analysis shows
that it isn't necessary.

subr_prf.c: Add a new msglogstr() routine that calls
msgbuf_logstr().

Rename putcons() to putbuf().  This now handles
buffered output to the message log as well as
the console.  Also, remove the logic in putcons()
(now putbuf()) that added a carriage return before
a newline.  The console path was the only path that
needed it, and cnputc() (called by cnputs())
already adds a carriage return.  So this
duplication resulted in kernel-generated console
output lines ending in '\r''\r''\n'.

Refactor putchar() to handle the new buffering
scheme.

Add buffering to log().

Change log_console() to use msglogstr() instead of
msglogchar().  Don't add extra newlines by default
in log_console().  Hide that behavior behind a
tunable/sysctl (kern.log_console_add_linefeed) for
those who would like the old behavior.  The old
behavior led to the insertion of extra newlines
for log output for programs that print out a
string, and then a trailing newline on a separate
write.  (This is visible with dmesg -a.)

msgbuf.h: Add a prototype for msgbuf_addstr().

Add three new fields to struct msgbuf, msg_needsnl,
msg_lastpri and msg_lock.  The first two are needed
for log message functionality previously handled
by msglogchar().  (Which is still active if
buffering isn't enabled.)

Include sys/lock.h and sys/mutex.h for the new
mutex.

Reviewed by: gibbs