]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agoFix two bugs in r218670.
Konstantin Belousov [Sat, 23 Apr 2011 21:38:21 +0000 (21:38 +0000)]
Fix two bugs in r218670.

Hold the vnode around the region where object lock is dropped, until
vnode lock is acquired.

Do not drop the vnode reference for a case when the object was
deallocated during unlock. Note that in this case, VV_TEXT is cleared
by vnode_pager_dealloc().

Reported and tested by: pho
Reviewed by: alc
MFC after: 3 days

13 years ago- Clarification on kld_file_stat.size
Glen Barber [Sat, 23 Apr 2011 20:59:58 +0000 (20:59 +0000)]
- Clarification on kld_file_stat.size
- While here, remove a few C comments that don't seem to contribute
  anything additional to the man page.

PR: 146047
Submitted by: arundel
MFC after: 3 days

13 years agoAs previously advertised, remove the error message for enable_quotas
Doug Barton [Sat, 23 Apr 2011 17:37:14 +0000 (17:37 +0000)]
As previously advertised, remove the error message for enable_quotas
prior to 9.0-RELEASE.

This change should not be MFC'ed.

13 years agoCheck return code of setuid() and setgid() in finger.
Simon L. B. Nielsen [Sat, 23 Apr 2011 14:19:26 +0000 (14:19 +0000)]
Check return code of setuid() and setgid() in finger.

While they will not fail in normal circumstances, better safe than
sorry.

MFC after: 1 week

13 years agoCheck return code of setuid() in timedc.
Simon L. B. Nielsen [Sat, 23 Apr 2011 13:57:12 +0000 (13:57 +0000)]
Check return code of setuid() in timedc.

While it will not fail in normal circumstances, better safe than
sorry.

MFC after: 3 days

13 years agoCheck return code of setuid(), setgid(), and setgroups() in rwhod.
Simon L. B. Nielsen [Sat, 23 Apr 2011 13:42:03 +0000 (13:42 +0000)]
Check return code of setuid(), setgid(), and setgroups() in rwhod.

While they will not fail in normal circumstances, better safe than
sorry.

MFC after: 1 week

13 years agoCheck return code of setuid() in traceroute.
Simon L. B. Nielsen [Sat, 23 Apr 2011 13:07:35 +0000 (13:07 +0000)]
Check return code of setuid() in traceroute.

While it will not fail in normal circumstances, better safe than sorry.

Reported by: LLVM's clang static analyzer
MFC after: 3 days

13 years agoFix a LOR in vfs_busy() where, after msleeping, it would lock
Rick Macklem [Sat, 23 Apr 2011 11:22:48 +0000 (11:22 +0000)]
Fix a LOR in vfs_busy() where, after msleeping, it would lock
the mutexes in the wrong order for the case where the
MBF_MNTLSTLOCK is set. I believe this did have the
potential for deadlock. For example, if multiple nfsd threads
called vfs_busyfs(), which calls vfs_busy() with MBF_MNTLSTLOCK.
Thanks go to pho for catching this during his testing.

Tested by: pho
Submitted by: kib
MFC after: 2 weeks

13 years agoFix a corner-case of interrupt handling which resulted in potentially
Adrian Chadd [Sat, 23 Apr 2011 06:37:09 +0000 (06:37 +0000)]
Fix a corner-case of interrupt handling which resulted in potentially
spurious (and fatal) interrupt errors.

One user reported seeing this:

Apr 22 18:04:24 ceres kernel: ar5416GetPendingInterrupts: fatal error,
  ISR_RAC 0x0 SYNC_CAUSE 0x2000

SYNC_CAUSE of 0x2000 is AR_INTR_SYNC_LOCAL_TIMEOUT which is a bus timeout;
this shouldn't cause HAL_INT_FATAL to be set.

After checking out ath9k, ath9k_ar9002_hw_get_isr() clears (*masked)
before continuing, regardless of whether any bits in the ISR registers
are set. So if AR_INTR_SYNC_CAUSE is set to something that isn't
treated as fatal, and AR_ISR isn't read or is read and is 0, then
(*masked) wouldn't be cleared. Thus any of the existing bits set
that were passed in would be preserved in the output.

The caller in if_ath - ath_intr() - wasn't setting the masked value
to 0 before calling ath_hal_getisr(), so anything that was present
in that uninitialised variable would be preserved in the case above
of AR_ISR=0, AR_INTR_SYNC_CAUSE != 0; and if the HAL_INT_FATAL bit
was set, a fatal condition would be interpreted and the chip was
reset.

This patch does the following:

* ath_intr() - set masked to 0 before calling ath_hal_getisr();
* ar5416GetPendingInterrupts() - clear (*masked) before processing
  continues; so if the interrupt source is AR_INTR_SYNC_CAUSE
  and it isn't fatal, the hardware isn't reset via returning
  HAL_INT_FATAL.

This doesn't fix any underlying errors which trigger
AR_INTR_SYNC_LOCAL_TIMEOUT - which is a bus timeout of some
sort - so that likely should be further investigated.

13 years agoo Remove an incomplete sentence.
Maxim Konovalov [Sat, 23 Apr 2011 05:56:06 +0000 (05:56 +0000)]
o Remove an incomplete sentence.

PR: docs/156593
Submitted by: Yuri Pankov
MFC after: 1 week

13 years agoImprove the error handling for the new get_pidfile_from_conf()
Doug Barton [Sat, 23 Apr 2011 05:24:17 +0000 (05:24 +0000)]
Improve the error handling for the new get_pidfile_from_conf()

13 years agoIntroduce to rc.subr get_pidfile_from_conf(). It does just what it sounds
Doug Barton [Sat, 23 Apr 2011 04:26:31 +0000 (04:26 +0000)]
Introduce to rc.subr get_pidfile_from_conf(). It does just what it sounds
like, determines the path to a pid file as it is specified in a conf file.

Use the new feature for rc.d/named and rc.d/devd, the 2 services in the
base that list their pid files in their conf files.

Remove the now-obsolete named_pidfile, and warn users if they have it set.

13 years agoFix the merlin LNA configuration code - these are bit flags, not raw values to be
Adrian Chadd [Fri, 22 Apr 2011 17:57:13 +0000 (17:57 +0000)]
Fix the merlin LNA configuration code - these are bit flags, not raw values to be
written into the registers.

13 years agoNote which of the built kernels is being installed.
David E. O'Brien [Fri, 22 Apr 2011 17:10:51 +0000 (17:10 +0000)]
Note which of the built kernels is being installed.

PR: 156579
Submitted by: dhw

13 years agoCorrect spelling in comments.
Marius Strobl [Fri, 22 Apr 2011 13:56:21 +0000 (13:56 +0000)]
Correct spelling in comments.

Submitted by: brucec

13 years agoMore spelling fixes.
Marius Strobl [Fri, 22 Apr 2011 12:46:39 +0000 (12:46 +0000)]
More spelling fixes.

Submitted by: N.J. Mann

13 years agoCorrect spelling in comments.
Marius Strobl [Fri, 22 Apr 2011 12:42:41 +0000 (12:42 +0000)]
Correct spelling in comments.

Submitted by: brucec

13 years agoMF sparc64: r181701 (partial), r182020 (partial), r182730 (partial), r216628,
Marius Strobl [Fri, 22 Apr 2011 12:39:48 +0000 (12:39 +0000)]
MF sparc64: r181701 (partial), r182020 (partial), r182730 (partial), r216628,
r216801

- cosmetic changes and style fixes
- Trick GAS/GCC into compiling access to TICK/(S)TICK_COMPARE independently
  of the selected instruction set. Moreover, sun4v doesn't need the WAR for
  BlackBird CPUs.
- Rename the "xor" parameter to "xorval" as the former is a reserved keyword
  in C++.

13 years agoThe second regdomain word is a set of bitflags describing
Adrian Chadd [Fri, 22 Apr 2011 10:59:20 +0000 (10:59 +0000)]
The second regdomain word is a set of bitflags describing
regulatory domain behaviour. Document what the v14 EEPROM
flags are.

13 years agoBring over a pdadc calibration fix from ath9k - unused power detector
Adrian Chadd [Fri, 22 Apr 2011 10:57:46 +0000 (10:57 +0000)]
Bring over a pdadc calibration fix from ath9k - unused power detector
gain values should be 58, not the previous values.

Obtained From: linux ath9k

13 years agoCorrect spelling.
Marius Strobl [Fri, 22 Apr 2011 09:59:16 +0000 (09:59 +0000)]
Correct spelling.

Submitted by: brucec

13 years ago- Correct spelling. [1]
Marius Strobl [Fri, 22 Apr 2011 09:52:28 +0000 (09:52 +0000)]
- Correct spelling. [1]
- Remove variables which are unused besides initialization. [2]

Submitted by: brucec [1], Christoph Mallon [2]

13 years agoCorrect spelling in a comment.
Marius Strobl [Fri, 22 Apr 2011 09:44:01 +0000 (09:44 +0000)]
Correct spelling in a comment.

Submitted by: brucec

13 years agoCorrect spelling in comments.
Marius Strobl [Fri, 22 Apr 2011 09:41:51 +0000 (09:41 +0000)]
Correct spelling in comments.

Submitted by: brucec

13 years agoCorrect spelling in comments.
Marius Strobl [Fri, 22 Apr 2011 09:39:05 +0000 (09:39 +0000)]
Correct spelling in comments.

Submitted by: brucec

13 years agoCorrect spelling in comments.
Marius Strobl [Fri, 22 Apr 2011 09:31:40 +0000 (09:31 +0000)]
Correct spelling in comments.

Submitted by: brucec

13 years agoCorrect spelling in comments.
Marius Strobl [Fri, 22 Apr 2011 09:22:27 +0000 (09:22 +0000)]
Correct spelling in comments.

Submitted by: brucec

13 years agoUtilize vfs_sanitizeopts() in vfs_mergeopts() to merge options. Because
Jaakko Heinonen [Fri, 22 Apr 2011 07:26:09 +0000 (07:26 +0000)]
Utilize vfs_sanitizeopts() in vfs_mergeopts() to merge options. Because
vfs_sanitizeopts() can handle "ro" and "rw" options properly, there is
no more need to add "noro" in vfs_donmount() to cancel "ro".

This also fixes a problem of canceling options beginning with "no".
For example, "noatime" didn't cancel "nonoatime". Thus it was possible
that both "noatime" and "nonoatime" were active at the same time.

Reviewed by: bde

13 years agoRevert r220907 and r220915.
Adrian Chadd [Fri, 22 Apr 2011 00:44:27 +0000 (00:44 +0000)]
Revert r220907 and r220915.

Changing the size of struct ieee80211_mimo_info changes
the STA info data, breaking ifconfig in general.

13 years ago- Centralize driver tunables initialization/validation.
David Christensen [Thu, 21 Apr 2011 23:06:00 +0000 (23:06 +0000)]
- Centralize driver tunables initialization/validation.
- Centralize PCI resource allocation/release.
- Enable flowid (TSS) support.
- Added "per-fastpath" locks and watchdog timeouts.
- Fixed problem where the CQ producer index was advanced beyond
  the size of the CQ ring during initialization.
- Replaced hard-coded debug levels in some debug print statements.
- More style(9) fixes.

MFC after: Two weeks

13 years ago- Use the streaming cache unless BUS_DMA_COHERENT is specified. Since
Marius Strobl [Thu, 21 Apr 2011 21:56:28 +0000 (21:56 +0000)]
- Use the streaming cache unless BUS_DMA_COHERENT is specified. Since
  r220375 all drivers enabled in the sparc64 GENERIC should be either
  correctly using bus_dmamap_sync(9) calls or supply BUS_DMA_COHERENT
  when appropriate or as a workaround for missing bus_dmamap_sync(9)
  calls (sound(4) drivers and partially sym(4)). In at least some
  configurations taking advantage of the streaming cache results in
  a modest performance improvement.
- Remove the memory barrier for BUS_DMASYNC_PREREAD which as the
  comment already suggested is bogus.
- Add my copyright for having implemented several things like support
  for the Fire and Oberon IOMMUs, taking over PROM IOMMU mappings etc.

13 years agoAdd g_eli_key_cache.c to GELI.
Pawel Jakub Dawidek [Thu, 21 Apr 2011 21:15:11 +0000 (21:15 +0000)]
Add g_eli_key_cache.c to GELI.

MFC after: 2 weeks

13 years agoAccording to ATA specifications, when ATAPI master is the only device, it
Alexander Motin [Thu, 21 Apr 2011 20:56:34 +0000 (20:56 +0000)]
According to ATA specifications, when ATAPI master is the only device, it
should respond with all zeroes to any access to slave registers. Test with
PATA devices confirmed such behavior. Unluckily, Intel SATA controllers in
legacy emulation mode behave differently, not making any difference between
ATA and ATAPI devices. It causes false positive slave device detection and,
as result, command timeouts.

To workaround this problem, mask result of legacy-emulated soft-reset with
the device presence information received from the SATA-specific registers.

13 years agoRemove the nm_mtx mutex locking from the test for
Rick Macklem [Thu, 21 Apr 2011 19:56:06 +0000 (19:56 +0000)]
Remove the nm_mtx mutex locking from the test for
nm_maxfilesize. This value rarely, if ever, changes
and the nm_mtx mutex is locked/unlocked earlier in
the function, which should be sufficient to avoid
getting a stale cached value for it. There is a
discussion w.r.t. what these tests should be, but
I've left them basically the same as the regular
NFS client for now.

Suggested by: pjd
MFC after: 2 weeks

13 years agoExpand / correct newsyslog regression tests:
Simon L. B. Nielsen [Thu, 21 Apr 2011 16:40:34 +0000 (16:40 +0000)]
Expand / correct newsyslog regression tests:
- Test newslog with clasic naming of rotates files to actually test
  the correct number of log files as newsyslog now does the correct
  thing post r220926.
- Add some more newsyslog tests which tests keeping 0, 1, and 2
  logfiles.

13 years agoFix an old bug in newsyslog where we kept one log file more than was
Simon L. B. Nielsen [Thu, 21 Apr 2011 16:31:05 +0000 (16:31 +0000)]
Fix an old bug in newsyslog where we kept one log file more than was
requested in newsyslog.conf.  This was only the case using the non-time
based filenames (.0, .1, .2 etc.).

The change also makes newsyslog clean clean up the old extra logfile so
users don't end up with a single stale logfile which won't be rotated
out.

This change also cleans up some code a bit to avoid more copy / paste
code and removes some old copy / paste code in the process.

PR: bin/76697
MFC after: 2 weeks

13 years agoAdd some more bit definitions:
Attilio Rao [Thu, 21 Apr 2011 14:39:33 +0000 (14:39 +0000)]
Add some more bit definitions:
- TCO_MESSAGEx: TCO specific regs providing the ability to monitor BIOS
  bootup activity.
- TCO_NEWCENTURY: reporting RTC year roll over.
- TCO_NMI2SMI_EN, TCO_NMI_NOW: controlling SMIs conversion to NMIs and
  NMI trigger.
- SMI_GBL_EN: Enabling SMI delivery for all the northbridge controller.

MFC after: 10 days

13 years agoRemove all object files during 'make clean'.
Andrey V. Elsukov [Thu, 21 Apr 2011 14:17:36 +0000 (14:17 +0000)]
Remove all object files during 'make clean'.

MFC after: 1 week

13 years agoIf number of keys for the given provider doesn't exceed the limit,
Pawel Jakub Dawidek [Thu, 21 Apr 2011 13:35:20 +0000 (13:35 +0000)]
If number of keys for the given provider doesn't exceed the limit,
allocate all of them at attach time. This allows to avoid moving
keys around in the most-recently-used queue and needs no mutex
synchronization nor refcounting.

MFC after: 2 weeks

13 years agoInstead of allocating memory for all the keys at device attach,
Pawel Jakub Dawidek [Thu, 21 Apr 2011 13:31:43 +0000 (13:31 +0000)]
Instead of allocating memory for all the keys at device attach,
create reasonably large cache for the keys that is filled when
needed. The previous version was problematic for very large providers
(hundreds of terabytes or serval petabytes). Every terabyte of data
needs around 256kB for keys. Make the default cache limit big enough
to fit all the keys needed for 4TB providers, which will eat at most
1MB of memory.

MFC after: 2 weeks

13 years agoRevert r220906, since the vp isn't always locked when
Rick Macklem [Thu, 21 Apr 2011 12:38:12 +0000 (12:38 +0000)]
Revert r220906, since the vp isn't always locked when
nfscl_request() is called. It will need a more involved
patch.

13 years ago - Fix mapping of the last two SATA ports on 6-port Intel controllers.
Alexander Motin [Thu, 21 Apr 2011 11:44:16 +0000 (11:44 +0000)]
 - Fix mapping of the last two SATA ports on 6-port Intel controllers.
This improves hard-reset and hot-plug on these ports.
 - Device with ID 0x29218086 is a 2-port variant of ICH9 in legacy mode.
Skip probing for nonexistent slave devices there.

13 years agoUse periodic status polling added at r214671 only in ATA_CAM mode. Legacy
Alexander Motin [Thu, 21 Apr 2011 09:02:19 +0000 (09:02 +0000)]
Use periodic status polling added at r214671 only in ATA_CAM mode. Legacy
mode won't receive much benefit from it due to its hot-plug limitations.

13 years agoConvert to new ieee80211_mimo_info format.
Adrian Chadd [Thu, 21 Apr 2011 08:20:56 +0000 (08:20 +0000)]
Convert to new ieee80211_mimo_info format.

13 years agoUse size_t for sopt_valsize.
Gleb Smirnoff [Thu, 21 Apr 2011 08:18:55 +0000 (08:18 +0000)]
Use size_t for sopt_valsize.

Submitted by: Brandon Gooch <jamesbrandongooch gmail.com>

13 years agoMake PATA-like soft-reset in ata(4) more strict in checking disk signature.
Alexander Motin [Thu, 21 Apr 2011 07:26:14 +0000 (07:26 +0000)]
Make PATA-like soft-reset in ata(4) more strict in checking disk signature.
It allows to avoid false positive device detection under Xen, that caused
long probe delays due to subsequent IDENTIFY command timeouts.

MFC after: 1 month

13 years agoRemove GNU man implemenation now that the BSD version has cooked for a while.
Gordon Tetlow [Thu, 21 Apr 2011 07:14:10 +0000 (07:14 +0000)]
Remove GNU man implemenation now that the BSD version has cooked for a while.

13 years ago- Allows using full device name paths, such as /dev/ad0 or /dev/mirror/gm0 in config...
Josh Paetzel [Thu, 21 Apr 2011 06:25:12 +0000 (06:25 +0000)]
- Allows using full device name paths, such as /dev/ad0 or /dev/mirror/gm0 in config files
- Fixes some issues creating gmirror devices, including on GPT partitions
- Bugfixes for ZFS mirroring
- Enhanced GELI to work with a passphrase only, or key-file only
- Bugfix to prevent crashing of PC-BSD Live media when checking for upgrade partitions

Submitted by: Kris Moore <kmoore@freebsd.org>
Approved by: kib (mentor)
Sponsored by: iXsystems

13 years agoImplement very basic ALQ logging for net80211.
Adrian Chadd [Thu, 21 Apr 2011 03:59:37 +0000 (03:59 +0000)]
Implement very basic ALQ logging for net80211.

This is destined to be a lightweight and optional set of ALQ
probes for debugging events which are just impossible to debug
with printf/log (eg packet TX/RX handling; AMPDU handling.)

The probes and operations themselves will appear in subsequent
commits.

13 years agoChange the MIMO userland export ABI to include flags, number of radio chains,
Adrian Chadd [Thu, 21 Apr 2011 03:47:40 +0000 (03:47 +0000)]
Change the MIMO userland export ABI to include flags, number of radio chains,
extended EVM statistics and EXT channel data.

ifconfig still displays 3 chains worth of ctl noise/rssi.

13 years agoAdd a check for VI_DOOMED at the beginning of nfscl_request()
Rick Macklem [Wed, 20 Apr 2011 23:25:18 +0000 (23:25 +0000)]
Add a check for VI_DOOMED at the beginning of nfscl_request()
so that it won't try and use vp->v_mount to do an RPC during
a forced dismount. There needs to be at least one more kernel
commit, plus a change to the umount(8) command before forced
dismounts will work for the experimental NFS client.

MFC after: 2 weeks

13 years agoRing the freelist doorbell from within refill_fl. While here, fix a bug
Navdeep Parhar [Wed, 20 Apr 2011 23:20:00 +0000 (23:20 +0000)]
Ring the freelist doorbell from within refill_fl.  While here, fix a bug
that could have allowed the hardware pidx to reach the cidx even though
the freelist isn't empty.  (Haven't actually seen this but it was there
waiting to happen..)

MFC after: 1 week

13 years agosh: Do not word split "${#parameter}".
Jilles Tjoelker [Wed, 20 Apr 2011 22:24:54 +0000 (22:24 +0000)]
sh: Do not word split "${#parameter}".

This is only a problem if IFS contains digits, which is unusual but valid.

Because of an incorrect fix for PR bin/12137, "${#parameter}" was treated
as ${#parameter}. The underlying problem was that "${#parameter}"
erroneously added CTLESC bytes before determining the length. This
was properly fixed for PR bin/56147 but the incorrect fix was not backed
out.

Reported by: Seeker on forums.freebsd.org
MFC after: 2 weeks

13 years agoOnly set the sample rate if the USB audio channel reports
Hans Petter Selasky [Wed, 20 Apr 2011 19:41:08 +0000 (19:41 +0000)]
Only set the sample rate if the USB audio channel reports
that it supports the frequency control request.

MFC after: 7 days
Approved by: thompsa (mentor)

13 years agoCorrect comment.
Pawel Jakub Dawidek [Wed, 20 Apr 2011 18:49:12 +0000 (18:49 +0000)]
Correct comment.

MFC after: 1 week

13 years agoWhen we become primary, we connect to the remote and expect it to be in
Pawel Jakub Dawidek [Wed, 20 Apr 2011 18:43:28 +0000 (18:43 +0000)]
When we become primary, we connect to the remote and expect it to be in
secondary role. It is possible that the remote node is primary, but only
because there was a role change and it didn't finish cleaning up (unmounting
file systems, etc.). If we detect such situation, wait for the remote node
to switch the role to secondary before accepting I/Os. If we don't wait for
it in that case, we will most likely cause split-brain.

MFC after: 1 week

13 years agoUse the correct free routine when destroying a control queue.
Navdeep Parhar [Wed, 20 Apr 2011 18:04:34 +0000 (18:04 +0000)]
Use the correct free routine when destroying a control queue.

X-MFC after: r220873

13 years agoAdd ref to the latest firmware additions.
Bernhard Schmidt [Wed, 20 Apr 2011 17:53:39 +0000 (17:53 +0000)]
Add ref to the latest firmware additions.

13 years agoNow that all bits are in for 1030/6230 adapters enable those.
Bernhard Schmidt [Wed, 20 Apr 2011 17:49:05 +0000 (17:49 +0000)]
Now that all bits are in for 1030/6230 adapters enable those.
While here pull the adapter names from the Linux driver and sort
the list by ID.

13 years agoThe 6000 series gen2 adapters have 2 firmware images, one with
Bernhard Schmidt [Wed, 20 Apr 2011 17:43:20 +0000 (17:43 +0000)]
The 6000 series gen2 adapters have 2 firmware images, one with
advanced btcoex support and one without.

13 years agoAdd firmware images for the 6000 series g2a and g2b adapters.
Bernhard Schmidt [Wed, 20 Apr 2011 17:34:09 +0000 (17:34 +0000)]
Add firmware images for the 6000 series g2a and g2b adapters.

13 years agoUpdate iwn(4) firmware blobs:
Bernhard Schmidt [Wed, 20 Apr 2011 17:32:20 +0000 (17:32 +0000)]
Update iwn(4) firmware blobs:
- bump iwn1000fw to 39.31.5.1
- bump iwn5000fw to 8.83.5.1
- bump iwn6050fw to 41.28.5.1

13 years agoAdd basic support for advanced bluetooth coexistence required
Bernhard Schmidt [Wed, 20 Apr 2011 16:59:27 +0000 (16:59 +0000)]
Add basic support for advanced bluetooth coexistence required
for 6005 gen2b (1030/6030) adapters.

13 years agoIf we act in different role than requested by the remote node, log it
Pawel Jakub Dawidek [Wed, 20 Apr 2011 16:38:05 +0000 (16:38 +0000)]
If we act in different role than requested by the remote node, log it
as a warning and not an error.

MFC after: 1 week

13 years agoTimeout must be positive.
Pawel Jakub Dawidek [Wed, 20 Apr 2011 16:36:59 +0000 (16:36 +0000)]
Timeout must be positive.

MFC after: 1 week

13 years agor179417 introduced a bug into pthread_once(). Previously pthread_once()
Ryan Stone [Wed, 20 Apr 2011 14:19:34 +0000 (14:19 +0000)]
r179417 introduced a bug into pthread_once().  Previously pthread_once()
used a global pthread_mutex_t for synchronization.  r179417 replaced that
with an implementation that directly used atomic instructions and thr_*
syscalls to synchronize callers to pthread_once.  However, calling
pthread_mutex_lock on the global mutex implicitly ensured that
_thr_check_init() had been called but with r179417 this was no longer
guaranteed.  This meant that if you were unlucky enough to have your first
call into libthr be a call to pthread_once(), you would segfault when
trying to access the pointer returned by _get_curthread().

The fix is to explicitly call _thr_check_init() from pthread_once().

Reviewed by: davidxu
Approved by: emaste (mentor)
MFC after: 1 week

13 years agoWhen calling XPT_REL_SIMQ to ajust number of openings, do not try to really
Alexander Motin [Wed, 20 Apr 2011 14:16:22 +0000 (14:16 +0000)]
When calling XPT_REL_SIMQ to ajust number of openings, do not try to really
release device. We haven't frozen the device before and attempt to release
it will at least cause warning message from kernel.

13 years agoAdd basic support for DMA-capable ATA disks on DMA-incapable controller.
Alexander Motin [Wed, 20 Apr 2011 13:27:50 +0000 (13:27 +0000)]
Add basic support for DMA-capable ATA disks on DMA-incapable controller.
This is really rare situation these days, but still may happen in embedded.

13 years agoCompile in in_cksum* implementations for both IPv6 and IPv6.
Bjoern A. Zeeb [Wed, 20 Apr 2011 12:58:30 +0000 (12:58 +0000)]
Compile in in_cksum* implementations for both IPv6 and IPv6.
While in_pseudo() etc. is often used in offloading feature support,
in_cksum() is mostly used to fix some broken hardware.

Keeping both around for the moment allows us to compile NIC drivers
even in an IPv6 only environment without the need to mangle them
with #ifdef INETs in a way they are not prepared for.  This will
leave some dead code paths that will not be exercised for IPv6.

Reviewed by: gnn
Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems
MFC after: 3 days

13 years agoDon't spam syslog with "inet_ntop(): Address family not supported
Ruslan Ermilov [Wed, 20 Apr 2011 08:38:25 +0000 (08:38 +0000)]
Don't spam syslog with "inet_ntop(): Address family not supported
by protocol family" when processing requests received from the
UNIX domain socket.

MFC after: 3 days

13 years agoMFp4 CH=191760,191770:
Bjoern A. Zeeb [Wed, 20 Apr 2011 08:05:23 +0000 (08:05 +0000)]
MFp4 CH=191760,191770:

Not compiling in and not initializing from inetsw from in_proto.c for
IPv6 only, we need to initialize upper layer protocols from inet6sw.
Make sure to not initialize them twice in a Dual-Stack
environment but only conditionally on no INET as we have done for
TCP for a long time.  Otherwise we would leak resources.

Reviewed by: gnn
Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems
MFC after: 3 days

13 years agoMFp4 CH=191760:
Bjoern A. Zeeb [Wed, 20 Apr 2011 08:03:22 +0000 (08:03 +0000)]
MFp4 CH=191760:

When compiling out INET we still need the initialization routines
as well as the tuning and montoring sysctls shared with IPv6.

Move the two send/recvspace variables up from the middle of the
file to ease compiling out the INET only code.

Reviewed by: gnn
Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems
MFC after: 3 days

13 years agoMFp4 CH=191470:
Bjoern A. Zeeb [Wed, 20 Apr 2011 08:00:29 +0000 (08:00 +0000)]
MFp4 CH=191470:

Move the ipport_tick_callout and related functions from ip_input.c
to in_pcb.c.  The random source port allocation code has been merged
and is now local to in_pcb.c only.
Use a SYSINIT to get the callout started and no longer depend on
initialization from the inet code, which would not work in an IPv6
only setup.

Reviewed by: gnn
Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems
MFC after: 4 days

13 years agoMFp4 CH=191466:
Bjoern A. Zeeb [Wed, 20 Apr 2011 07:55:33 +0000 (07:55 +0000)]
MFp4 CH=191466:

Move fw_one_pass to where it belongs: it is a property of ipfw,
not of ip_input.

Reviewed by: gnn
Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems
MFC after: 3 days

13 years agoModify the offset + size checks for read and write in the
Rick Macklem [Wed, 20 Apr 2011 01:15:22 +0000 (01:15 +0000)]
Modify the offset + size checks for read and write in the
experimental NFS client to take care of overflows for the calls
above the buffer cache layer in a manner similar to r220876.
Thanks go to dillon at apollo.backplane.com for providing the
snippet of code that does this.

MFC after: 2 weeks

13 years agoModify the offset + size checks for read and write in the
Rick Macklem [Wed, 20 Apr 2011 00:21:51 +0000 (00:21 +0000)]
Modify the offset + size checks for read and write in the
experimental NFS client to take care of overflows. Thanks
go to dillon at apollo.backplane.com for providing the
snippet of code that does this.

MFC after: 2 weeks

13 years agoAdd stablerestart(5) to the See Also list for nfsd.8.
Rick Macklem [Tue, 19 Apr 2011 23:33:51 +0000 (23:33 +0000)]
Add stablerestart(5) to the See Also list for nfsd.8.
This is a content change.

Suggested by: Jeremy Chadwick
MFC after: 2 weeks

13 years agoUse Toeplitz hash for RSS.
Navdeep Parhar [Tue, 19 Apr 2011 22:14:18 +0000 (22:14 +0000)]
Use Toeplitz hash for RSS.

MFC after: 3 days

13 years ago- Move all Ethernet specific items from sge_eq to sge_txq. sge_eq is
Navdeep Parhar [Tue, 19 Apr 2011 22:08:28 +0000 (22:08 +0000)]
- Move all Ethernet specific items from sge_eq to sge_txq.  sge_eq is
  now a suitable base for all kinds of egress queues.

- Add control queues (sge_ctrlq) and allocate one of these per hardware
  channel.  They can be used to program filters and steer traffic (and
  more).

MFC after: 1 week

13 years agoCorrectly output the entire array for hw.acpi.thermal._ACx.
Matthew D Fleming [Tue, 19 Apr 2011 20:44:43 +0000 (20:44 +0000)]
Correctly output the entire array for hw.acpi.thermal._ACx.

Reported by: Taku YAMAMOTO < taku AT tackymt DOT homeip DOT net >
Tested by: Nick Ulen < uncle AT wolfman DOT devio DOT us >

13 years agoEnable DC calibration for all 6000 series devices, except those
Bernhard Schmidt [Tue, 19 Apr 2011 19:51:35 +0000 (19:51 +0000)]
Enable DC calibration for all 6000 series devices, except those
with an internal PA.
Override the chainmask also for the 6050.

13 years agoPull some features out of the firmware:
Bernhard Schmidt [Tue, 19 Apr 2011 19:47:41 +0000 (19:47 +0000)]
Pull some features out of the firmware:
- If a ENH_SENS TLV section exit the firmware is capable of doing
  enhanced sensitivity calibration.
- Newer devices/firmwares have more calibration commands therefore
  hardcoding the noise gain/reset commands no longer works. It is
  supposed to use the next index after the newest calibration type
  support. Read the command index of the TLV section if available.

13 years agoScenario:
Pawel Jakub Dawidek [Tue, 19 Apr 2011 19:26:27 +0000 (19:26 +0000)]
Scenario:
- We have two nodes connected and synchronized (local counters on both sides
  are 0).
- We take secondary down and recreate it.
- Primary connects to it and starts synchronization (but local counters are
  still 0).
- We switch the roles.
- Synchronization restarts but data is synchronized now from new primary
  (because local counters are 0) that doesn't have new data yet.

This fix this issue we bump local counter on primary when we discover that
connected secondary was recreated and has no data yet.

Reported by: trociny
Discussed with: trociny
Tested by: trociny
MFC after: 1 week

13 years agoRemove support for the Intel C Compiler from the build infrastructure.
Dimitry Andric [Tue, 19 Apr 2011 18:09:21 +0000 (18:09 +0000)]
Remove support for the Intel C Compiler from the build infrastructure.
This support has not worked for several years, and is not likely to work
again, unless Intel decides to release a native FreeBSD version of their
compiler. ;)

13 years agoRemove a comment which is no longer true since r213878, apart from
Marius Strobl [Tue, 19 Apr 2011 17:49:59 +0000 (17:49 +0000)]
Remove a comment which is no longer true since r213878, apart from
this driver not using mii(4) in the first place.

Reviewed by:    yongari

13 years agoAllow VOP_ALLOCATE to be iterative, and have kern_posix_fallocate(9)
Matthew D Fleming [Tue, 19 Apr 2011 16:36:24 +0000 (16:36 +0000)]
Allow VOP_ALLOCATE to be iterative, and have kern_posix_fallocate(9)
drive looping and potentially yielding.

Requested by: kib

13 years agoDo not invoke resume event handlers if suspend was successful.
Jung-uk Kim [Tue, 19 Apr 2011 16:30:17 +0000 (16:30 +0000)]
Do not invoke resume event handlers if suspend was successful.

Pointy hat to: jkim

13 years agoImprove the man page and l2control's usage() a bit.
Maksim Yevmenkin [Tue, 19 Apr 2011 16:21:57 +0000 (16:21 +0000)]
Improve the man page and l2control's usage() a bit.

Submitted by: arundel
MFC after: 1 week

13 years agoAdd suspend/resume event handlers for apm(4) as well.
Jung-uk Kim [Tue, 19 Apr 2011 16:20:55 +0000 (16:20 +0000)]
Add suspend/resume event handlers for apm(4) as well.

13 years ago- Rewrite functions that copyin/out NAT configuration, so that they
Gleb Smirnoff [Tue, 19 Apr 2011 15:06:33 +0000 (15:06 +0000)]
- Rewrite functions that copyin/out NAT configuration, so that they
  calculate required memory size dynamically.
- Fix races on chain re-lock.
- Introduce new field to ip_fw_chain - generation count. Now utilized
  only in the NAT configuration, but can be utilized wider in ipfw.
- Get rid of NAT_BUF_LEN in ip_fw.h

PR: kern/143653

13 years agoCall init_param1() much earlier, so that msgbufsize is non-zero when we want
Sergey Kandaurov [Tue, 19 Apr 2011 15:05:12 +0000 (15:05 +0000)]
Call init_param1() much earlier, so that msgbufsize is non-zero when we want
to map and use the msgbuf.

Reviewed by: cognet
MFC after: 1 week

13 years agoRewrite NAT configuration parser, so that memory allocation size is
Gleb Smirnoff [Tue, 19 Apr 2011 15:03:12 +0000 (15:03 +0000)]
Rewrite NAT configuration parser, so that memory allocation size is
calculated dynamically.

PR: kern/143653

13 years agoFix mirror selection, which was broken by stderr redirection.
Nathan Whitehorn [Tue, 19 Apr 2011 13:54:51 +0000 (13:54 +0000)]
Fix mirror selection, which was broken by stderr redirection.

Reported by: Garrett Cooper

13 years agoRevert r220809 since it put the entry in the wrong place
Rick Macklem [Tue, 19 Apr 2011 13:19:13 +0000 (13:19 +0000)]
Revert r220809 since it put the entry in the wrong place
in the list and didn't change the date.

13 years agoAdd sysctl handlers for net.inet.ip.dummynet.hash_size, .pipe_byte_limit
Andrey V. Elsukov [Tue, 19 Apr 2011 11:33:39 +0000 (11:33 +0000)]
Add sysctl handlers for net.inet.ip.dummynet.hash_size, .pipe_byte_limit
and .pipe_slot_limit oids to prevent to set incorrect values.

MFC after: 2 weeks

13 years agoipdn_bound_var() functions is designed to bound a variable between
Andrey V. Elsukov [Tue, 19 Apr 2011 11:29:09 +0000 (11:29 +0000)]
ipdn_bound_var() functions is designed to bound a variable between
specified minimum and maximum. In case when specified default value
is out of bounds it does not work as expected and does not limit
variable. Check that default value is in range and limit it if needed.
Also bump max_hash_size value to 65536 to correspond with manual page.

PR: kern/152887
MFC after: 2 weeks

13 years agoFix some English grammar.
Alexander Motin [Tue, 19 Apr 2011 10:57:40 +0000 (10:57 +0000)]
Fix some English grammar.

13 years agoAccording to specification. device should respond to COMRESET with COMINIT
Alexander Motin [Tue, 19 Apr 2011 10:51:19 +0000 (10:51 +0000)]
According to specification. device should respond to COMRESET with COMINIT
in no more then 10ms. If we detected no device presence within that time,
there is no reason to wait longer.

13 years agoProperly handle memory allocation errors during error recovery.
Alexander Motin [Tue, 19 Apr 2011 08:01:17 +0000 (08:01 +0000)]
Properly handle memory allocation errors during error recovery.

13 years agoAdd leading zeros when printing the physical memory chunks on __powerpc64__.
Andreas Tobler [Tue, 19 Apr 2011 07:49:58 +0000 (07:49 +0000)]
Add leading zeros when printing the physical memory chunks on __powerpc64__.

Approved by: nwhitehorn (mentor)