]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoAdd explicit check for not set time inside cam_periph_freeze_after_event().
Alexander Motin [Sun, 14 Oct 2012 08:50:05 +0000 (08:50 +0000)]
Add explicit check for not set time inside cam_periph_freeze_after_event().

System time is set later on boot process then initial bus scan by CAM.
Until that moment microtime() is equal to microuptime(), and if system
boots quickly, the value can be close to zero. That causes settle time
waiting even for buses that don't use reset during probe.

On my test system this reduces boot time by 1 second if USB enabled, or
by 4 seconds if USB disabled.  CAM waited for ctl2cam0 bus "settle".

11 years agoRemove trailing whitespace.
Joel Dahl [Sun, 14 Oct 2012 07:22:56 +0000 (07:22 +0000)]
Remove trailing whitespace.

11 years agoMinor mdoc and language fixes.
Joel Dahl [Sun, 14 Oct 2012 07:19:42 +0000 (07:19 +0000)]
Minor mdoc and language fixes.

11 years agoSince the introduction of the new advanced boot menu (r222417), options like
Devin Teske [Sun, 14 Oct 2012 06:52:49 +0000 (06:52 +0000)]
Since the introduction of the new advanced boot menu (r222417), options like
"boot verbose", "single user mode", "ACPI" and more are now stateful boolean
menuitems rather than direct action-items.

A short-coming in this new menu system is that when a user sets a non-default
value in loader.conf(5), this non-default state is not reflected in the menu
-- leading to confusion as to whether the option was taking effect or not.

This patch adds dynamic menuitem constructors _and_ the necessary Forth
callbacks to initialize these stateful menuitems -- causing the aforementioned
menuitems to adhere to loader.conf(5) settings.

PR: bin/172529
Approved by: adrian (co-mentor)
MFC after: 21 days

11 years agogetopt_long() returns an int. Use the return value accordingly.
Attilio Rao [Sun, 14 Oct 2012 03:59:17 +0000 (03:59 +0000)]
getopt_long() returns an int. Use the return value accordingly.

Pointy hat to: me
MFC after: 2 months
X-MFC: r241519,241521

11 years agoRename s/DEBUG()/FS_DEBUG() and s/DEBUG2G()/FS_DEBUG2G() in order to
Attilio Rao [Sun, 14 Oct 2012 03:51:59 +0000 (03:51 +0000)]
Rename s/DEBUG()/FS_DEBUG() and s/DEBUG2G()/FS_DEBUG2G() in order to
avoid a name clash in sparc64.

MFC after: 2 months
X-MFC: r241519

11 years agoCorrect an error in pmap_pv_reclaim(). It can legitimately encounter
Alan Cox [Sun, 14 Oct 2012 03:40:08 +0000 (03:40 +0000)]
Correct an error in pmap_pv_reclaim().  It can legitimately encounter
wired mappings.  If it does, it should just skip them.

11 years agoImport a FreeBSD port of the FUSE Linux module.
Attilio Rao [Sat, 13 Oct 2012 23:54:26 +0000 (23:54 +0000)]
Import a FreeBSD port of the FUSE Linux module.
This has been developed during 2 summer of code mandates and being revived
by gnn recently.
The functionality in this commit mirrors entirely content of fusefs-kmod
port, which doesn't need to be installed anymore for -CURRENT setups.

In order to get some sparse technical notes, please refer to:
http://lists.freebsd.org/pipermail/freebsd-fs/2012-March/013876.html

or to the project branch:
svn://svn.freebsd.org/base/projects/fuse/

which also contains granular history of changes happened during port
refinements. This commit does not came from the branch reintegration
itself because it seems svn is not behaving properly for this functionaly
at the moment.

Partly Sponsored by: Google, Summer of Code program 2005, 2011
Originally submitted by: ilya, Csaba Henk <csaba-ml AT creo DOT hu >
In collabouration with: pho
Tested by: flo, gnn, Gustau Perez,
Kevin Oberman <rkoberman AT gmail DOT com>
MFC after: 2 months

11 years agoMove vm_page_requeue() to the only file that uses it.
Alan Cox [Sat, 13 Oct 2012 20:19:43 +0000 (20:19 +0000)]
Move vm_page_requeue() to the only file that uses it.

MFC after: 3 weeks

11 years ago* Update the comment that explains the choice of values in the
Steve Kargl [Sat, 13 Oct 2012 19:53:11 +0000 (19:53 +0000)]
* Update the comment that explains the choice of values in the
  table and the requirement on trailing zero bits.

* Remove the __aligned() compiler directives as these were found
  to have a negative effect on the produced code.

Submitted by: bde
Approved by: das (mentor)

11 years ago- Fix typo
Gabor Kovesdan [Sat, 13 Oct 2012 19:37:58 +0000 (19:37 +0000)]
- Fix typo

Spotted by: glebius

11 years ago- Regen after GNU sort removal
Gabor Kovesdan [Sat, 13 Oct 2012 19:29:38 +0000 (19:29 +0000)]
- Regen after GNU sort removal

11 years ago- Remove WITH_GNU_SORT support
Gabor Kovesdan [Sat, 13 Oct 2012 19:29:07 +0000 (19:29 +0000)]
- Remove WITH_GNU_SORT support

11 years agoEliminate the conditional for releasing the page queues lock in
Alan Cox [Sat, 13 Oct 2012 18:46:46 +0000 (18:46 +0000)]
Eliminate the conditional for releasing the page queues lock in
vm_page_sleep().  vm_page_sleep() is no longer called with this lock
held.

Eliminate assertions that the page queues lock is NOT held.  These
assertions won't translate well to having distinct locks on the active
and inactive page queues, and they really aren't that useful.

MFC after: 3 weeks

11 years ago- Remove GNU sort and the WITH_GNU_SORT knob
Gabor Kovesdan [Sat, 13 Oct 2012 18:40:39 +0000 (18:40 +0000)]
- Remove GNU sort and the WITH_GNU_SORT knob

11 years agoDon't exclude XPT SIM from locking in xpt_create_path_unlocked().
Alexander Motin [Sat, 13 Oct 2012 18:24:52 +0000 (18:24 +0000)]
Don't exclude XPT SIM from locking in xpt_create_path_unlocked().
We don't want xpt periph, device, target or bus disappeared because of
incorrect reference counting.

11 years agoUse xpt_create_path_unlocked() for initial debug path compilation because
Alexander Motin [Sat, 13 Oct 2012 18:11:50 +0000 (18:11 +0000)]
Use xpt_create_path_unlocked() for initial debug path compilation because
we are not holding respective SIM lock.

11 years agoExtend SIM lock coverage during the bus registration process.
Alexander Motin [Sat, 13 Oct 2012 17:55:06 +0000 (17:55 +0000)]
Extend SIM lock coverage during the bus registration process.

11 years agoMake a command for pkg_info changeable like pkg_version in
Hajimu UMEMOTO [Sat, 13 Oct 2012 14:45:42 +0000 (14:45 +0000)]
Make a command for pkg_info changeable like pkg_version in
/etc/periodic/weekly/400.status-pkg to be friendly with pkgng.

MFC after: 1 week

11 years agoFix XPT_DEBUG paths operations locking:
Alexander Motin [Sat, 13 Oct 2012 11:23:16 +0000 (11:23 +0000)]
Fix XPT_DEBUG paths operations locking:
 - Extend the lock to cover xpt_path_release() for the new path.
 - While xpt_action() is called while holding right SIM lock for the new
   bus, the old path release may require different SIM lock. So we have
   to temporary drop the new lock and get the old one.

11 years agoXPT_DEV_MATCH is probably the only xpt_action() method that is called
Alexander Motin [Sat, 13 Oct 2012 10:18:36 +0000 (10:18 +0000)]
XPT_DEV_MATCH is probably the only xpt_action() method that is called
without holding SIM lock. It really doesn't need that lock, but adding it
removes that specific exception, allowing to assert locking there later.

Submitted by: ken@ (earlier version)

11 years agoCleanup documentation: cloning route support has been removed in r186119.
Alexander V. Chernikov [Sat, 13 Oct 2012 09:31:01 +0000 (09:31 +0000)]
Cleanup documentation: cloning route support has been removed in r186119.

MFC after: 2 weeks

11 years agoAdd forgotten documentation for new NGM_NETFLOW_V9INFO message.
Alexander V. Chernikov [Sat, 13 Oct 2012 09:25:29 +0000 (09:25 +0000)]
Add forgotten documentation for new NGM_NETFLOW_V9INFO message.

Submitted by: Dmitry Luhtionov <dmitryluhtionov at gmail.com>
MFC with: r241446

11 years agoFix the non-TDMA build.
Adrian Chadd [Sat, 13 Oct 2012 06:27:34 +0000 (06:27 +0000)]
Fix the non-TDMA build.

11 years agoSVN r240684 broke the ability of the dot module to map include dependencies.
Devin Teske [Sat, 13 Oct 2012 03:56:33 +0000 (03:56 +0000)]
SVN r240684 broke the ability of the dot module to map include dependencies.
Teach the dot module about the new location these includes moved to (as part
of r240684) and clean things up a bit.

Reviewed by: adrian (co-mentor)
Approved by: adrian (co-mentor)

11 years agoReplace all uses of the vm page queues lock by a new R/W lock.
Alan Cox [Fri, 12 Oct 2012 23:26:00 +0000 (23:26 +0000)]
Replace all uses of the vm page queues lock by a new R/W lock.
Unfortunately, this lock cannot be defined as static under Xen because it
is (ab)used to serialize queued page table changes.

Tested by: sbruno

11 years agoSome 3G modems return the wrong signature in echo packets and make it
Nick Hibma [Fri, 12 Oct 2012 22:48:33 +0000 (22:48 +0000)]
Some 3G modems return the wrong signature in echo packets and make it
impossible to use LQR/ECHO. They return want_magic instead.

With this change it is now possible to use

enable lqr
set lqrperiod 5
enable echo
set echoperiod 5

in your ppp.conf file.

MFC after: 3 days

11 years agoFix build with PAE enabled. I doubt any code uses CAM_SCATTER_VALID or
Alexander Motin [Fri, 12 Oct 2012 22:06:06 +0000 (22:06 +0000)]
Fix build with PAE enabled.  I doubt any code uses CAM_SCATTER_VALID or
CAM_DATA_PHYS, or they ever correctly worked, but make this build at least.

11 years agoTemporary fix for kern/172364.
Navdeep Parhar [Fri, 12 Oct 2012 21:58:21 +0000 (21:58 +0000)]
Temporary fix for kern/172364.

PR: kern/172364
MFC after: 3 days

11 years agoUse global knob in the TP_PARA_REG3 register to disable congestion
Navdeep Parhar [Fri, 12 Oct 2012 21:48:21 +0000 (21:48 +0000)]
Use global knob in the TP_PARA_REG3 register to disable congestion
drops if the user has chosen this behaviour.

MFC after: 3 days

11 years agoAdd locking to adv(4) driver and mark it MPSAFE.
John Baldwin [Fri, 12 Oct 2012 21:31:44 +0000 (21:31 +0000)]
Add locking to adv(4) driver and mark it MPSAFE.
- Disable the support for the second channel on twin-channel EISA cards as
  the current incarnation can't possibly work correctly (it hasn't worked
  since switching to new-bus where new-bus allocates the softc).  If anyone
  bothers to test this again it can be fixed properly and brought back.
- Use device_printf() and device_get_nameunit() instead of adv_name().
- Remove use of explicit bus space handles and tags.
- Use PCI bus accessors and helper routines rather than accessing
  config registers directly.
- Handle failures from adv_attach().

Tested by: no one (hope it works)

11 years agoFix type in last commit.
Gleb Smirnoff [Fri, 12 Oct 2012 19:53:13 +0000 (19:53 +0000)]
Fix type in last commit.

Submitted by: brueffer

11 years agoGet SIM lock in several places while calling CAM functions.
Alexander Motin [Fri, 12 Oct 2012 18:21:31 +0000 (18:21 +0000)]
Get SIM lock in several places while calling CAM functions.
This fixes several use-after-free panics on systems with SAS enclosures.

Submitted by: ken@, mav@

11 years agoProtect xpt_getattr() calls with the SIM lock and assert that.
Alexander Motin [Fri, 12 Oct 2012 17:18:24 +0000 (17:18 +0000)]
Protect xpt_getattr() calls with the SIM lock and assert that.

Submitted by: ken@ (earlier version)

11 years agoUse CLOCK_UPTIME to get the uptime.
Ed Maste [Fri, 12 Oct 2012 15:03:28 +0000 (15:03 +0000)]
Use CLOCK_UPTIME to get the uptime.

11 years agoBe more explicit on how "intact" incoming packets in raw sockets are.
Gleb Smirnoff [Fri, 12 Oct 2012 12:27:30 +0000 (12:27 +0000)]
Be more explicit on how "intact" incoming packets in raw sockets are.

11 years agoRevert fixup of ip_len from r241480. Now stack isn't yet
Gleb Smirnoff [Fri, 12 Oct 2012 09:32:38 +0000 (09:32 +0000)]
Revert fixup of ip_len from r241480. Now stack isn't yet
ready for that change.

11 years agoIn ip_stripoptions():
Gleb Smirnoff [Fri, 12 Oct 2012 09:24:24 +0000 (09:24 +0000)]
In ip_stripoptions():
  - Remove unused argument and incorrect comment.
  - Fixup ip_len after stripping.

11 years agoRemove whitespace.
Joel Dahl [Fri, 12 Oct 2012 06:16:51 +0000 (06:16 +0000)]
Remove whitespace.

11 years agoSince the moduledata structure member priv is a void pointer, using
Kevin Lo [Fri, 12 Oct 2012 01:31:02 +0000 (01:31 +0000)]
Since the moduledata structure member priv is a void pointer, using
NULL instead of 0 when dealing with pointers.

11 years agoVirtio SCSI driver
Peter Grehan [Thu, 11 Oct 2012 23:41:18 +0000 (23:41 +0000)]
Virtio SCSI driver

Submitted by: Bryan Venteicher  bryanv at daemoninthecloset dot org
Reviewed by: grehan

11 years agoPatch from Bryan to fix a virtqueue issue:
Peter Grehan [Thu, 11 Oct 2012 23:03:42 +0000 (23:03 +0000)]
Patch from Bryan to fix a virtqueue issue:

    virtqueue: Fix non-indirect virtqueues

    We really must walk the entire descriptor chain in order
    to append the to be free'd chain to the existing free
    chain.

Submitted by: Bryan Venteicher (bryanv@daemoninthecloset.org)
Reported by: cognet

11 years agoMake local function static.
Ed Maste [Thu, 11 Oct 2012 21:24:07 +0000 (21:24 +0000)]
Make local function static.

11 years agoFix tiypo.
Aleksandr Rybalko [Thu, 11 Oct 2012 21:19:42 +0000 (21:19 +0000)]
Fix tiypo.

Submitted by: Luiz Otavio O Souza
Approved by: adrian (mentor)

11 years agoPoint freebsd.org cluster machines to mx1 for their smarthost.
Peter Wemm [Thu, 11 Oct 2012 20:46:04 +0000 (20:46 +0000)]
Point freebsd.org cluster machines to mx1 for their smarthost.

11 years agoUse separate malloc buckets for CAM devices, CCBs and paths. This will
Alexander Motin [Thu, 11 Oct 2012 20:14:11 +0000 (20:14 +0000)]
Use separate malloc buckets for CAM devices, CCBs and paths. This will
make it easier to track down the source of any use after free problems.

Submitted by: ken@

11 years agoDon't duplicate path/ccb allocation code, use existing functions.
Alexander Motin [Thu, 11 Oct 2012 19:57:11 +0000 (19:57 +0000)]
Don't duplicate path/ccb allocation code, use existing functions.

11 years agoExclude potential circular symlink when creating src tarball.
Ed Maste [Thu, 11 Oct 2012 18:41:32 +0000 (18:41 +0000)]
Exclude potential circular symlink when creating src tarball.

Normal release builds are not affected by this but it can happen if using
these release bits against a work tree.

Sponsored by: ADARA Networks

11 years agoAdd NG_NETFLOW_V9INFO_TYPE command to be able to request netflowv9-specific
Alexander V. Chernikov [Thu, 11 Oct 2012 16:15:18 +0000 (16:15 +0000)]
Add NG_NETFLOW_V9INFO_TYPE command to be able to request netflowv9-specific
data.

Submitted by: Dmitry Luhtionov <dmitryluhtionov at gmail.com>
MFC after: 2 weeks

11 years agoIncrease device CCB queue array size by CAM_RL_VALUES - 1 (4) elements.
Alexander Motin [Thu, 11 Oct 2012 15:21:07 +0000 (15:21 +0000)]
Increase device CCB queue array size by CAM_RL_VALUES - 1 (4) elements.
It is required to store extra recovery requests in case of bus resets.
On ATA/SATA this fixes assertion panics on HEAD with INVARIANTS enabled or
possible memory corruptions otherwise if timeout/reset happens when device
CCB queue is already full.

Reported by: gibbs@
MFC after: 1 week

11 years agoFix my last commit. Only call strunvis after properly checking the argument is
Stefan Farfeleder [Thu, 11 Oct 2012 08:18:28 +0000 (08:18 +0000)]
Fix my last commit.  Only call strunvis after properly checking the argument is
not NULL.

11 years agoDecode the first two fstab fields with strunvis(3). This allows having spaces
Stefan Farfeleder [Thu, 11 Oct 2012 07:54:29 +0000 (07:54 +0000)]
Decode the first two fstab fields with strunvis(3). This allows having spaces
in devices and mount paths, encoded as \s or \040.

PR: bin/117687
Submitted by: Martin Kammerhofer
Discussed on: arch

11 years agoApply some style. Checked with md5.
Stefan Farfeleder [Thu, 11 Oct 2012 07:39:51 +0000 (07:39 +0000)]
Apply some style. Checked with md5.

11 years agoAdd APE firmware support and improve firmware handshake procedure.
Pyun YongHyeon [Thu, 11 Oct 2012 06:43:43 +0000 (06:43 +0000)]
Add APE firmware support and improve firmware handshake procedure.
This change will enable IPMI access on 5717/5718/5719/5720 and 5761
controllers. Because ASF is not available when APE firmware is
present, bge_allow_asf tunable is ignored when driver detects APE
firmware.  Also bge(4) no longer performs two resets(one blind
reset and the other reset with firmware in mind) in device attach.
Now bge(4) performs a reset with enough information in bge_reset().
The APE firmware also needs special handling to make suspend/resume
work but it was not implemented yet.

With this change, bge(4) should work on any 5717/5718/5719/5720
controllers. Special thanks to Mike Hibler at Emulab who setup
remote debugging on Dell R820. Without his help I couldn't be able
to address several issues happened on Dell Rx20 systems. And many
thanks to Broadcom for continuing to support FreeBSD!

Submitted by: davidch (initial version)
H/W donated by: Broadcom
Tested by: many
Tested on: Del R820/R720/R620/R420/R320 and HP Proliant DL 360 G8

11 years agoFor 5717C/5719C/5720C and 57765 PHYs, do not perform any special
Pyun YongHyeon [Thu, 11 Oct 2012 06:07:48 +0000 (06:07 +0000)]
For 5717C/5719C/5720C and 57765 PHYs, do not perform any special
handling(jumbo, wire speed etc) in brgphy_reset().  Touching
BRGPHY_MII_AUXCTL register seems to confuse APE firmware such that
it couldn't establish a link.

11 years agoRework controller reset procedure. Previously driver saved
Pyun YongHyeon [Thu, 11 Oct 2012 05:48:04 +0000 (05:48 +0000)]
Rework controller reset procedure. Previously driver saved
BGE_PCI_PCISTATE register before issuing global reset. After
issuing reset, it reads BGE_PCI_PCISTATE register again and
compares the saved register value and current value. It was used to
know whether the global reset operation was completed or not.
Unfortunately, this logic caused several issues on recent BCM5717/
5718/5719 and BCM5720 controllers. It seems APE firmware accesses
some registers while global reset is in progress such that reading
BGE_PCI_PCISTATE register after reset does not yield old pre-reset
state value. This resulted in consuming too much time in global
reset and sometimes it couldn't successfully complete reset.

The BGE_MISCCFG_RESET_CORE_CLOCKS of BGE_MISC_CFG register is
self-clearing bit so driver is able to know the reset completion.
But the core-lock reset will disable indirect/flat/standard access
modes such that driver cannot poll BGE_MISCCFG_RESET_CORE_CLOCKS
bit of BGE_MISC_CFG register. So just wait enough time for
core-clock reset to complete.
Data sheet says driver should wait 100us for PCI/PCI-X devices and
100ms for PCIe devices. I chose 1ms for PCI/PCI-X since this value
was used for many years in bge(4). For PCIe devices, use 100ms as
recommended by data sheet.

bge_chipinit() also cleared BGE_MAC_MODE register which shall clear
firmware configured mode information. I think this will result in
losing ASF/IPMI link in device attachment. Let bge_reset() honor
firmware configured BGE_MAC_MODE register and don't announce driver
is UP in bge_reset(). Firmware should have control over driver until
it's fully initialized by driver.

While I'm here, enable workaround for PCI-X BCM5704 A0 in
bge_reset(). This will prevent internal arbitration logic from
switching to the other DMA engine after a retry cycle.

11 years agoCount number of times each queue pair's interrupt handler is invoked.
Jim Harris [Wed, 10 Oct 2012 23:35:16 +0000 (23:35 +0000)]
Count number of times each queue pair's interrupt handler is invoked.

Also add sysctls to query and reset each queue pair's stats, including
the new count added here.

Sponsored by: Intel

11 years agoPut the nvme_qpair mutex on its own cacheline.
Jim Harris [Wed, 10 Oct 2012 23:28:58 +0000 (23:28 +0000)]
Put the nvme_qpair mutex on its own cacheline.

Sponsored by: Intel

11 years ago - Remove ancient checks for sim->softc == NULL. It can't be NULL, as it is
Alexander Motin [Wed, 10 Oct 2012 22:02:11 +0000 (22:02 +0000)]
 - Remove ancient checks for sim->softc == NULL. It can't be NULL, as it is
set not-NULL during SIM registration and set to UMASS_GONE on destruction.
Debug messages there look broken for at least 9 years, as they dereference
softc value that was just checked to be equal to NULL.
 - Remove magic pointer value UMASS_GONE and use simple NULL instead.

Found by: Clang Static Analyzer

11 years agoAdd man pages for nvme(4) and nvd(4).
Jim Harris [Wed, 10 Oct 2012 21:38:17 +0000 (21:38 +0000)]
Add man pages for nvme(4) and nvd(4).

Sponsored by: Intel
Reviewed by: joel

11 years agoPull in r164132 from upstream llvm trunk:
Dimitry Andric [Wed, 10 Oct 2012 21:37:21 +0000 (21:37 +0000)]
Pull in r164132 from upstream llvm trunk:

  When creating MCAsmBackend pass the CPU string as well. In X86AsmBackend
  store this and use it to not emit long nops when the CPU is geode which
  doesnt support them.

  Fixes PR11212.

Pull in r164133 from upstream clang trunk:

  Follow up on llvm r164132.

This should prevent illegal instructions when building world on Geode
CPUs (e.g. Soekris).

MFC after: 3 days

11 years agoPull in r163710 from upstream llvm trunk:
Dimitry Andric [Wed, 10 Oct 2012 21:29:00 +0000 (21:29 +0000)]
Pull in r163710 from upstream llvm trunk:

  Add support for AMD Geode.

MFC after: 3 days

11 years agoNULL-ify last previously used pointer instead of last possible pointer.
Alexander Motin [Wed, 10 Oct 2012 20:41:37 +0000 (20:41 +0000)]
NULL-ify last previously used pointer instead of last possible pointer.
This should be only a cosmetic change.

Found by: Clang Static Analyzer

11 years agoAdd a "clearstats" subcommand to cxgbetool that lets you clear the
Navdeep Parhar [Wed, 10 Oct 2012 20:09:19 +0000 (20:09 +0000)]
Add a "clearstats" subcommand to cxgbetool that lets you clear the
MAC statistics for any port.

For example:
# cxgbetool t4nex0 clearstats 0

Submitted by: gnn@
MFC after: 3 days

11 years agoUpgrade to 9.8.3-P4:
Xin LI [Wed, 10 Oct 2012 19:47:52 +0000 (19:47 +0000)]
Upgrade to 9.8.3-P4:

Prevents a lockup when queried a deliberately constructed combination
of records. [CVE-2012-5166]

For more information: https://kb.isc.org/article/AA-00801

11 years agopanic() with reasonable message instead of returning zero frequency causing
Alexander Motin [Wed, 10 Oct 2012 19:46:46 +0000 (19:46 +0000)]
panic() with reasonable message instead of returning zero frequency causing
division by zero later if event timer's minimal period is above one second.
For now it is just a theoretical possibility.

Found by: Clang Static Analyzer

11 years agoVendor import of BIND 9.8.3-P4.
Xin LI [Wed, 10 Oct 2012 19:42:37 +0000 (19:42 +0000)]
Vendor import of BIND 9.8.3-P4.

11 years agoThere are SCSI conditions that are not an errors. In those cases cderror()
Alexander Motin [Wed, 10 Oct 2012 19:32:40 +0000 (19:32 +0000)]
There are SCSI conditions that are not an errors. In those cases cderror()
returns zero while request status is not CAM_REQ_CMP.  That could cause
partial device attach or other unexpected results.

Found by: Clang Static Analyzer

11 years agoAdd a driver ioctl to clear a port's MAC statistics.
Navdeep Parhar [Wed, 10 Oct 2012 19:27:40 +0000 (19:27 +0000)]
Add a driver ioctl to clear a port's MAC statistics.

Submitted by: gnn@
MFC after: 3 days

11 years agoDo not check if found IPv4 rte is dynamic if net.inet.icmp.drop_redirect is
Alexander V. Chernikov [Wed, 10 Oct 2012 19:06:11 +0000 (19:06 +0000)]
Do not check if found IPv4 rte is dynamic if net.inet.icmp.drop_redirect is
enabled. This eliminates one mtx_lock() per each routing lookup thus improving
performance in several cases (routing to directly connected interface or routing
to default gateway).

Icmp redirects should not be used to provide routing direction nowadays, even
for end hosts. Routers should not use them too (and this is explicitly restricted
in IPv6, see RFC 4861, clause 8.2).

Current commit changes rnh_machaddr function to 'stock' rn_match (and back) for every
AF_INET routing table in given VNET instance on drop_redirect sysctl change.

This change is part of bigger patch eliminating rte locking.

Sponsored by: Yandex LLC
MFC after: 2 weeks

11 years agoReally handle xpt_compile_path() error in xpt_bus_register() instead of
Alexander Motin [Wed, 10 Oct 2012 18:34:15 +0000 (18:34 +0000)]
Really handle xpt_compile_path() error in xpt_bus_register() instead of
print error message and probably crash just after it on NULL dereference.

Found by: Clang Static Analyzer

11 years agoRemove 'periph == NULL' check from bunch of periph drivers.
Alexander Motin [Wed, 10 Oct 2012 18:10:11 +0000 (18:10 +0000)]
Remove 'periph == NULL' check from bunch of periph drivers.
This condition can never be true as functions are called from single place
and the checks just pollute the code and confuse Clang Static Analyzer.

11 years agoAdd support for locate LED.
Jim Harris [Wed, 10 Oct 2012 18:01:56 +0000 (18:01 +0000)]
Add support for locate LED.

While here, change ISCI_LED to ISCI_PHY since conceptually the hardware
ties the LEDs to a phy and the LEDs for a given phy cannot be controlled
independently.

Submitted by: Paul Maulberger <Paul.Maulberger at gmx.de> (with modifications)

11 years agoAdd checks for ata_sata_scr_read() return statuses. It is mostly to silence
Alexander Motin [Wed, 10 Oct 2012 17:51:23 +0000 (17:51 +0000)]
Add checks for ata_sata_scr_read() return statuses. It is mostly to silence
Clang Static Analyzer warnings as errors there are usually unlikely.

11 years agoAdd an "i2c" subcommand to cxgbetool. You can use this to read
Navdeep Parhar [Wed, 10 Oct 2012 17:29:51 +0000 (17:29 +0000)]
Add an "i2c" subcommand to cxgbetool.  You can use this to read
information from the transceivers connected to the ports of a
cxgbe(4) based card.

# cxgbetool t4nex0 i2c <port_id> <dev_addr> <addr> [<count>]

For example:
# cxgbetool t4nex0 i2c 0 0xa0 3
0x10 [16]

(As per SFF-8472 the SFP+ module is at 0xa0 and bit 4 in the value at
address 3 indicates it's a 10Gbase-SR module, which it is.)

11 years agoMFi386 r241356
Alan Cox [Wed, 10 Oct 2012 17:15:34 +0000 (17:15 +0000)]
MFi386 r241356
  Add several asserts.

MFC after: 3 days

11 years agoAdd a driver ioctl to read a byte from any device on a port's i2c bus.
Navdeep Parhar [Wed, 10 Oct 2012 17:13:46 +0000 (17:13 +0000)]
Add a driver ioctl to read a byte from any device on a port's i2c bus.
This lets userspace read arbitrary information from the SFP+ modules
etc. on this bus.

Reading multiple bytes in the same transaction isn't possible right now.
I'll update the driver once the chip's firmware supports this.

MFC after: 3 days

11 years agoThere is no need to report the same error twice.
Navdeep Parhar [Wed, 10 Oct 2012 16:54:14 +0000 (16:54 +0000)]
There is no need to report the same error twice.

MFC after: 3 days

11 years agoRemove unused item. cxgbe's rx queue's lock was removed a long time ago.
Navdeep Parhar [Wed, 10 Oct 2012 16:52:39 +0000 (16:52 +0000)]
Remove unused item.  cxgbe's rx queue's lock was removed a long time ago.

MFC after: 3 days

11 years agoWITH_CTF is now a "normal" build option (WITHOUT_CTF is supported and
John Baldwin [Wed, 10 Oct 2012 16:07:23 +0000 (16:07 +0000)]
WITH_CTF is now a "normal" build option (WITHOUT_CTF is supported and
MK_CTF is used internally).

Reviewed by: fjoe

11 years ago- Fix the error message when a dependency string is not provided to
John Baldwin [Wed, 10 Oct 2012 14:47:46 +0000 (14:47 +0000)]
- Fix the error message when a dependency string is not provided to
  reference a missing dependency rather than a missing compile command.
- Don't append a newline to the auto-generated compile command.  The
  compile command has a newline appended when it is later output to the
  Makefile.

MFC after: 2 weeks

11 years agoRevert previous commit...
Kevin Lo [Wed, 10 Oct 2012 08:36:38 +0000 (08:36 +0000)]
Revert previous commit...

Pointyhat to: kevlo (myself)

11 years agoRemove unnecessary delay. I don't see any comments in data sheet
Pyun YongHyeon [Wed, 10 Oct 2012 05:43:04 +0000 (05:43 +0000)]
Remove unnecessary delay. I don't see any comments in data sheet
that requires 10ms delay after device reset.  Because that code was
there from day 1, I guess it was added to give enough settlement
time after updating BGE_MAC_MODE register.
The recommended delay time for BGE_MAC_MODE after updating is 40us
and it was already done in r241219.

11 years agoFix a long standing VCPU reset sequence bug on BCM5906.
Pyun YongHyeon [Wed, 10 Oct 2012 04:38:29 +0000 (04:38 +0000)]
Fix a long standing VCPU reset sequence bug on BCM5906.
The VCPU(Virtual CPU) of BCM5906 is used to provide a mechanism to
control the bootcode execution and to pick up configuration data
stored inside the EEPROM.
The bootcode of BCM5906 will check the BGE_VCPU_STATUS_DRV_RESET
bit to decide which booting procedure to choose.
Data sheet indicates the VCPU of BCM5906 should set
BGE_VCPU_STATUS_DRV_RESET bit *before* VCPU reset or global reset.

11 years agoDo not force PCIe 1.0a mode in device reset on BCM5717 and newer
Pyun YongHyeon [Wed, 10 Oct 2012 02:35:10 +0000 (02:35 +0000)]
Do not force PCIe 1.0a mode in device reset on BCM5717 and newer
controllers. BCM5785 does not require PCI 1.0a mode as well during
reset.

11 years agoHonor PHY type fiber for BCM5717/BCM5718/BCM5719/BCM5720.
Pyun YongHyeon [Wed, 10 Oct 2012 02:21:36 +0000 (02:21 +0000)]
Honor PHY type fiber for BCM5717/BCM5718/BCM5719/BCM5720.

11 years agoOn PHY write error use hex number to show the value.
Pyun YongHyeon [Wed, 10 Oct 2012 01:59:53 +0000 (01:59 +0000)]
On PHY write error use hex number to show the value.
Add more comments.

11 years agoIf the maximum payload size is 256 bytes or more, set the DMA write
Pyun YongHyeon [Wed, 10 Oct 2012 01:24:02 +0000 (01:24 +0000)]
If the maximum payload size is 256 bytes or more, set the DMA write
water mark to 256 bytes.  Otherwise controller will encounter DMA
write under run errors and would result in RX DMA hang. If the
maximum payload size is 128 bytes, the water mark is set to 128
bytes as usual.
While here, set maximum read request size to 2048 for BCM5719/BCM5720.
For other PCIe devices, use 4096. And reprogram the maximum read
request size whenever device reset is performed.

11 years agoGrab the softc from the ACPI host-pci bridge device instead of from the pci
Neel Natu [Wed, 10 Oct 2012 00:06:31 +0000 (00:06 +0000)]
Grab the softc from the ACPI host-pci bridge device instead of from the pci
endpoint device.

Reviewed by: jhb

11 years agoCast vendor-specific spell on VIA VT1818S codecs alike to VT1708S to
Alexander Motin [Tue, 9 Oct 2012 17:06:31 +0000 (17:06 +0000)]
Cast vendor-specific spell on VIA VT1818S codecs alike to VT1708S to
make analog input loopback and dual-stream playback work by enabling
signal mixing by nid 22, as it should be according to info returned by
the CODEC.  Otherwise pin nid 28 receives only signal from DAC nid 16.

PR: kern/169124
MFC after: 1 week

11 years agoAdd an unified macro to deny ability from the compiler to reorder
Attilio Rao [Tue, 9 Oct 2012 14:32:30 +0000 (14:32 +0000)]
Add an unified macro to deny ability from the compiler to reorder
instruction loads/stores at its will.
The macro __compiler_membar() is currently supported for both gcc and
clang, but kernel compilation will fail otherwise.

Reviewed by: bde, kib
Discussed with: dim, theraven
MFC after: 2 weeks

11 years agoRemove undefined behavior from sranddev() and
Eitan Adler [Tue, 9 Oct 2012 14:25:14 +0000 (14:25 +0000)]
Remove undefined behavior from sranddev() and
srandomdev(). This doesn't actually work
with any modern C compiler:

In particular, both clang and modern gcc
verisons silently elide any xor operation
with 'junk'.

Approved by: secteam
MFC after: 3 days

11 years agoReverts r234074,234105,234564,234723,234989,235231-235232 and part of
Attilio Rao [Tue, 9 Oct 2012 12:22:43 +0000 (12:22 +0000)]
Reverts r234074,234105,234564,234723,234989,235231-235232 and part of
r234247.
Use, instead, the static intializer introduced in r239923 for x86 and
sparc64 intr_cpus, unwinding the code to the initial version.

Reviewed by: marius

11 years agoPrefer NULL over 0 for pointers
Kevin Lo [Tue, 9 Oct 2012 08:27:40 +0000 (08:27 +0000)]
Prefer NULL over 0 for pointers

11 years agoFix typo: s/unknow/unknown
Kevin Lo [Tue, 9 Oct 2012 06:15:16 +0000 (06:15 +0000)]
Fix typo: s/unknow/unknown

11 years agoFix a typo (s/prefix/suffix/) and comment.
Devin Teske [Tue, 9 Oct 2012 03:54:53 +0000 (03:54 +0000)]
Fix a typo (s/prefix/suffix/) and comment.

NOTE: This is in an unused portion of the menu framework.

Reviewed by: eadler, adrian (co-mentor)
Approved by: adrian (co-mentor)

11 years agoFix an oversight that cyclic menu items actually are zero-based and can
Devin Teske [Tue, 9 Oct 2012 03:11:15 +0000 (03:11 +0000)]
Fix an oversight that cyclic menu items actually are zero-based and can
accommodate 10 different states.

Reviewed by: eadler, adrian (co-mentor)
Approved by: adrian (co-mentor)

11 years agoMake the "Options:" separator-text configurable by setting $menu_optionstext.
Devin Teske [Tue, 9 Oct 2012 01:31:03 +0000 (01:31 +0000)]
Make the "Options:" separator-text configurable by setting $menu_optionstext.

Reviewed by: eadler, adrian (co-mentor)
Approved by: adrian (co-mentor)
MFC after: 3 days

11 years agoAdd an echo to say we're "Booting..." when the overloaded "boot" Ficl word is
Devin Teske [Mon, 8 Oct 2012 23:02:35 +0000 (23:02 +0000)]
Add an echo to say we're "Booting..." when the overloaded "boot" Ficl word is
executed to better differentiate between loader-specific errors and kernel-
specific errors (if ever any of either).

This type of functionality hasn't been required before the introduction of the
advanced menu system (r222417). Adding this functionality will help different-
iate errors at the loader-level such as a BTX halt caused by heap exhaustion
and errors that may be involved with executing the kernel (wrong architecture
for example). A user can learn that messages before "Booting..." are related to
the loader(8) environment and it's Forth-ilk, while those after are not
related to loader(8) -- the point that loader(8) has ``left the building''.

This patch also includes a man-page update to color.4th(8) as the color logic
moves to a lower-level (from being included by beastie.4th to being included
by loader.4th).

After noticing a delay between execution of the overloaded "boot" FICL word and
the display of text on-screen, gcooper confirmed that the introduction of a
builtin memory test (disabled by adding hw.memtest.tests="0" to loader.conf(5))
was the cause of the delay.

This patch adds an echo to produce "Booting..." when the overloaded "boot" word
is executed (this includes from the interactive command-prompt on all arches,
from the menu system on arches that run the beastie menu, and even those arches
that run the menu but disable it by setting beastie_disable="YES" in
loader.conf(5)). When loader_color="YES" in loader.conf(5), the same message is
produced but in white text on a blue background (only the letters produced have
this background -- opposed to perhaps the entire line).

11 years agoAny pfil(9) hooks should be called with already set VNET context.
Gleb Smirnoff [Mon, 8 Oct 2012 23:02:32 +0000 (23:02 +0000)]
Any pfil(9) hooks should be called with already set VNET context.

Reviewed by: bz