]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoAdd a driver ioctl to clear a port's MAC statistics.
np [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
melifaro [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
mav [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.
mav [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.
jimharris [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
mav [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
np [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
alc [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.
np [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.
np [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.
np [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
jhb [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
jhb [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...
kevlo [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
yongari [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.
yongari [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
yongari [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.
yongari [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.
yongari [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
yongari [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 [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
mav [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 [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
eadler [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 [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
kevlo [Tue, 9 Oct 2012 08:27:40 +0000 (08:27 +0000)]
Prefer NULL over 0 for pointers

11 years agoFix typo: s/unknow/unknown
kevlo [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.
dteske [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
dteske [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.
dteske [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
dteske [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.
glebius [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

11 years agoCatch up with r241245 and do not return packet back in host byte order.
glebius [Mon, 8 Oct 2012 22:58:28 +0000 (22:58 +0000)]
Catch up with r241245 and do not return packet back in host byte order.

11 years agoAdd several asserts to i386 pmap, which mostly state that pv entry shall
kib [Mon, 8 Oct 2012 18:33:08 +0000 (18:33 +0000)]
Add several asserts to i386 pmap, which mostly state that pv entry shall
have corresponding pte.

Reviewed by: alc
Tested by: pho
MFC after: 3 days

11 years agoIn a few places, like the implementation of ptrace(), a thread may call
alc [Mon, 8 Oct 2012 16:57:05 +0000 (16:57 +0000)]
In a few places, like the implementation of ptrace(), a thread may call
upon pmap_enter() to create a mapping within a different address space,
i.e., not the thread's own address space.  On i386, this entails the
creation of a temporary mapping to the affected page table page (PTP).  In
general, pmap_enter() will read from this PTP, allocate a PV entry, and
write to this PTP.  The trouble comes when the system is short of memory.
In order to allocate a new PV entry, an older PV entry has to be
reclaimed.  Reclaiming a PV entry involves destroying a mapping, which
requires access to the affected PTP.  Thus, the PTP mapped at the
beginning of pmap_enter() is no longer mapped at the end of pmap_enter(),
which leads to pmap_enter() modifying the wrong PTP.  To address this
problem, pmap_pv_reclaim() is changed to use an alternate method of
mapping PTPs.

Update a related comment.

Reported by: pho
Diagnosed by: kib
MFC after: 5 days

11 years agoRestrict the module to varied environments.
obrien [Mon, 8 Oct 2012 14:08:13 +0000 (14:08 +0000)]
Restrict the module to varied environments.

11 years agoip6_ipsec_output: fix a typo in r241344
avg [Mon, 8 Oct 2012 13:45:40 +0000 (13:45 +0000)]
ip6_ipsec_output: fix a typo in r241344

Acting as a remote drone of glebius.

11 years agoRemove my pre-commit review request for mergemaster
dougb [Mon, 8 Oct 2012 10:34:49 +0000 (10:34 +0000)]
Remove my pre-commit review request for mergemaster

11 years ago After r241245 it appeared that in_delayed_cksum(), which still expects
glebius [Mon, 8 Oct 2012 08:03:58 +0000 (08:03 +0000)]
  After r241245 it appeared that in_delayed_cksum(), which still expects
host byte order, was sometimes called with net byte order. Since we are
moving towards net byte order throughout the stack, the function was
converted to expect net byte order, and its consumers fixed appropriately:
  - ip_output(), ipfilter(4) not changed, since already call
    in_delayed_cksum() with header in net byte order.
  - divert(4), ng_nat(4), ipfw_nat(4) now don't need to swap byte order
    there and back.
  - mrouting code and IPv6 ipsec now need to switch byte order there and
    back, but I hope, this is temporary solution.
  - In ipsec(4) shifted switch to net byte order prior to in_delayed_cksum().
  - pf_route() catches up on r241245 changes to ip_output().

11 years agoRework device detach. While here, move driver lock/callout
yongari [Mon, 8 Oct 2012 07:33:43 +0000 (07:33 +0000)]
Rework device detach. While here, move driver lock/callout
initialization to the beginning of device attach for readability.

11 years agoNo reason to play with IP header before calling sctp_delayed_cksum()
glebius [Mon, 8 Oct 2012 07:21:32 +0000 (07:21 +0000)]
No reason to play with IP header before calling sctp_delayed_cksum()
with offset beyond the IP header.

11 years agoLimit applying TX data corruption and FIFO workaround to BCM5719
yongari [Mon, 8 Oct 2012 07:13:45 +0000 (07:13 +0000)]
Limit applying TX data corruption and FIFO workaround to BCM5719
A0. It's believed BCM5720 does not have the issue.

11 years agoFix typo. Check against number of allocated MSI-X vectors.
yongari [Mon, 8 Oct 2012 07:01:07 +0000 (07:01 +0000)]
Fix typo. Check against number of allocated MSI-X vectors.
There is no ale(4) controller that supports MSI-X so this is not
real issue.

PR: kern/171825

11 years agoMigrate the TID TXQ accesses to a new set of macros, rather than reusing
adrian [Sun, 7 Oct 2012 23:45:19 +0000 (23:45 +0000)]
Migrate the TID TXQ accesses to a new set of macros, rather than reusing
the ATH_TXQ_* macros.

* Introduce the new macros;
* rename the TID queue and TID filtered frame queue so the compiler
  tells me I'm using the wrong macro.

These should correspond 1:1 to the existing code.

11 years agoLoop reading the RTC registers until the same values are obtained
imp [Sun, 7 Oct 2012 20:36:46 +0000 (20:36 +0000)]
Loop reading the RTC registers until the same values are obtained
twice, as advised in the atmel docs.

Submitted by: Ian Lapore

11 years agoRemove contractions.
joel [Sun, 7 Oct 2012 20:01:41 +0000 (20:01 +0000)]
Remove contractions.

11 years agoMinor mdoc fixes.
joel [Sun, 7 Oct 2012 19:53:04 +0000 (19:53 +0000)]
Minor mdoc fixes.

11 years agoMake graid command line a bit more friendly by allowing volume name or
mav [Sun, 7 Oct 2012 19:30:16 +0000 (19:30 +0000)]
Make graid command line a bit more friendly by allowing volume name or
provider name to be specified instead of geom name (first argument in all
subcommands except label).  In most cases there is only one array used
any way, so it is not really useful to make user type ugly geom names like
Intel-f0bdf223 or SiI-732c2b9448cf.  Though they can be used in some cases.

Sponsored by: iXsystems, Inc.
MFC after: 1 month

11 years agoOptimize the TLB invalidations performed by pmap_protect(). Use the new
alc [Sun, 7 Oct 2012 18:07:45 +0000 (18:07 +0000)]
Optimize the TLB invalidations performed by pmap_protect().  Use the new
range-based invalidation function instead of performing per-page
invalidations.  Don't bother invalidating mappings that don't have PTE_D
set, since they don't allow write access.

11 years agoFix the showconfig target. bmake sends debug output to stderr.
marcel [Sun, 7 Oct 2012 17:48:38 +0000 (17:48 +0000)]
Fix the showconfig target. bmake sends debug output to stderr.

Submitted by: Simon Garrety <sjg@juniper.net>

11 years agoFix 32-bit library builds after the removal of adding -E to make for AS,
marcel [Sun, 7 Oct 2012 16:45:38 +0000 (16:45 +0000)]
Fix 32-bit library builds after the removal of adding -E to make for AS,
CC, CXX and LD. This fix implements the intended as it should have been
implemented all along: by passing AS, CC, CXX and LD on the commandline
of the sub-make instead of in the environment of the sub-make.

Breakage pointed-out by: dim@

11 years agoComment and Copyright fixes/updates.
dteske [Sun, 7 Oct 2012 15:37:30 +0000 (15:37 +0000)]
Comment and Copyright fixes/updates.

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

11 years agoImprove a few comments.
imp [Sun, 7 Oct 2012 02:08:19 +0000 (02:08 +0000)]
Improve a few comments.

11 years agoUse the RTC unit to get the time. This works on all known AT91SAM9*
imp [Sun, 7 Oct 2012 01:58:32 +0000 (01:58 +0000)]
Use the RTC unit to get the time.  This works on all known AT91SAM9*
processors, either on reboot or after power down with battery backup.
However, the AT91RM9200 RTC always resets on reboot making it just
about useless at the moment (if we support a low-power mode or an
extended sleep mode, it might become useful).

Submitted by: Ian Lepore

11 years agoata_da: set disk::d_ident from serial number
avg [Sat, 6 Oct 2012 21:42:07 +0000 (21:42 +0000)]
ata_da: set disk::d_ident from serial number

MFC after: 10 days

11 years agoprocstat_getprocs: honor kvm_getprocs interface - cnt is signed
avg [Sat, 6 Oct 2012 20:17:28 +0000 (20:17 +0000)]
procstat_getprocs: honor kvm_getprocs interface - cnt is signed

MFC after: 10 days

11 years agokvm_getprocs: gracefully handle errors from kvm_deadprocs
avg [Sat, 6 Oct 2012 20:16:04 +0000 (20:16 +0000)]
kvm_getprocs: gracefully handle errors from kvm_deadprocs

and don't confuse callers with incorrect return value

MFC after: 9 days

11 years agokvm_proclist: ignore processes in larvae state
avg [Sat, 6 Oct 2012 20:12:24 +0000 (20:12 +0000)]
kvm_proclist: ignore processes in larvae state

Reviewed by: jhb
MFC after: 8 days

11 years agoadd detection of serial console presence to btx and boot2-like blocks
avg [Sat, 6 Oct 2012 20:08:29 +0000 (20:08 +0000)]
add detection of serial console presence to btx and boot2-like blocks

Note that this commit slightly increases size of boot blocks.

Reviewed by: jhb
Tested by: Olivier Cochard-Labbe <olivier@cochard.me>
MFC after: 26 days

11 years agoi386 comconsole: don't loop forever if hardware doesn't respond
avg [Sat, 6 Oct 2012 20:04:51 +0000 (20:04 +0000)]
i386 comconsole: don't loop forever if hardware doesn't respond

- clear capability flags when hw timeouts
- retire comc_started status variable and directly use c_flags to see
  if comconsole is selected for use

Reviewed by: jhb
Tested by: Uffe Jakobsen <uffe@uffe.org>,
Olivier Cochard-Labbe <olivier@cochard.me>
MFC after: 26 days

11 years agoboot/console: handle consoles that fail to probe
avg [Sat, 6 Oct 2012 20:01:17 +0000 (20:01 +0000)]
boot/console: handle consoles that fail to probe

- clarify meaning of console flags
- perform i/o via a console only if both of the following conditions are met:
   o console is active (selected by user or config)
   o console flags that it can perform the operation
- warn if a chosen console can not work (the warning may go nowhere without
  working and active console, though)

Reviewed by: jhb
Tested by: Uffe Jakobsen <uffe@uffe.org>,
Olivier Cochard-Labbe' <olivier@cochard.me>
MFC after: 26 days

11 years agoAdd support for bmake. This includes:
marcel [Sat, 6 Oct 2012 20:01:05 +0000 (20:01 +0000)]
Add support for bmake. This includes:
1.  Don't do upgrade_checks when using bmake. As long as we have WITH_BMAKE,
    there's a bootstrap complication in ths respect. Avoid it. Make the
    necessary changes to have upgrade_checks work wth bmake anyway.
2.  Remove the use of -E. It's not needed in our build because we use ?= for
    the respective variables, which means that we'll take the environment
    value (if any) anyway.
3.  Properly declare phony targets as phony as bmake is a lot smarter (and
    thus agressive) about build avoidance.
4.  Make sure CLEANFILES is complete and use it on .NOPATH. bmake is a lot
    smarter about build avoidance and should not find files we generate in
    the source tree. We should not have files in the repository we want to
    generate, but this is an easier way to cross this hurdle.
5.  Have behavior under bmake the same as it is under make with respect to
    halting when sub-commands fail. Add "set -e" to compound commands so
    that bmake is informed when sub-commands fail.
6.  Make sure crunchgen uses the same make as the rest of the build. This
    is important when the make utility isn't called make (but bmake for
    example).
7.  While here, add support for using MAKEOBJDIR to set the object tree
    location. It's the second alternative bmake looks for when determining
    the actual object directory (= .OBJDIR).

Submitted by: Simon Gerraty <sjg@juniper.net>
Submitted by: John Van Horne <jvanhorne@juniper.net>

11 years agozvol: set mediasize in geom provider right upon its creation
avg [Sat, 6 Oct 2012 19:57:27 +0000 (19:57 +0000)]
zvol: set mediasize in geom provider right upon its creation

... instead of deferring the action until first open.
Unlike upstream this has no benefit on FreeBSD.
We know that as soon as the provider is created it is going to be tasted
and thus opened.  Initial mediasize of zero causes tasting failure
and subsequent retasting because of the size change.

MFC after: 14 days

11 years agog_part_taste: directly destroy consumer and geom here, no need for withering
avg [Sat, 6 Oct 2012 19:52:50 +0000 (19:52 +0000)]
g_part_taste: directly destroy consumer and geom here, no need for withering

Besides withered but still alive consumers may interfere with
re-tatsing.

MFC after: 16 days

11 years agocngetc: use cpu_spinwait to ease the cncheckc loop a tiny bit
avg [Sat, 6 Oct 2012 19:50:23 +0000 (19:50 +0000)]
cngetc: use cpu_spinwait to ease the cncheckc loop a tiny bit

Reviewed by: julian
MFC after: 10 days

11 years agozfsboot: simplify probe_drive() a little bit
avg [Sat, 6 Oct 2012 19:48:15 +0000 (19:48 +0000)]
zfsboot: simplify probe_drive() a little bit

The first discovered pool, whether it covers the whole boot disk or not,
is going to be first in zfs_pools list.  So there is no need at all
for spapp parameter.

This commit also fixes a bug where NULL would be assigned to NULL
pointer when probe_drive was called  with the spapp parameter of NULL.

MFC after: 21 days

11 years agozfs boot: export boot/primary pool and vdev guid all the way to kenv
avg [Sat, 6 Oct 2012 19:47:24 +0000 (19:47 +0000)]
zfs boot: export boot/primary pool and vdev guid all the way to kenv

This is work in progress to for znextboot and it also provides
some convenient infrastructure.

MFC after: 20 days

11 years agozfs loader: treat plain pool name as a name of its root dataset
avg [Sat, 6 Oct 2012 19:42:50 +0000 (19:42 +0000)]
zfs loader: treat plain pool name as a name of its root dataset

... as opposed to the previous behavior of treating it as boot
dataset (specified by bootfs or default)

MFC after: 19 days

11 years agozfs boot spa_status: print bootfs for each reported pool
avg [Sat, 6 Oct 2012 19:42:05 +0000 (19:42 +0000)]
zfs boot spa_status: print bootfs for each reported pool

MFC after: 9 days

11 years agoboot/zfs: a small whitespace cleanup
avg [Sat, 6 Oct 2012 19:41:11 +0000 (19:41 +0000)]
boot/zfs: a small whitespace cleanup

MFC after: 5 days

11 years agoboot/zfs: call zfs_spa_init for all found pools
avg [Sat, 6 Oct 2012 19:40:12 +0000 (19:40 +0000)]
boot/zfs: call zfs_spa_init for all found pools

... and drop those for which it fails.
Also, add more sanity checking to the function.

MFC after: 16 days

11 years agozfsboot: use the same zfs dataset naming format as loader
avg [Sat, 6 Oct 2012 19:38:33 +0000 (19:38 +0000)]
zfsboot: use the same zfs dataset naming format as loader

Also, pool name alone now names a root dataset of the pool regardless
of bootfs property value.

MFC after: 15 days

11 years agoIn general pmap implementations do not set the wired attribute on
alc [Sat, 6 Oct 2012 19:33:52 +0000 (19:33 +0000)]
In general pmap implementations do not set the wired attribute on
the temporary mappings that are used to implement operations like
pmap_zero_page().  There is no reason for the MIPS pmap to deviate
from that practice.

11 years agozfs_mount: taste geom providers for root pool config
avg [Sat, 6 Oct 2012 19:33:47 +0000 (19:33 +0000)]
zfs_mount: taste geom providers for root pool config

This should allow to mount a dataset as a root filesystem even if
it belongs to a pool that is not described in zpool.cache.
This adds some overhead to the boot process though.

If the root filesystem's pool is found in zpool.cache, the by default
its cached configuration will be used for import.
vfs.zfs.rootpool.prefer_cached_config could be set to zero to force
the config to be retasted.

Discussed with: gibbs, pjd, des
MFC after: 25 days

11 years agoUpdate to include WITH_BMAKE.
marcel [Sat, 6 Oct 2012 19:28:19 +0000 (19:28 +0000)]
Update to include WITH_BMAKE.

11 years agozfs boot: add lszfs command to i386 loader
avg [Sat, 6 Oct 2012 19:27:54 +0000 (19:27 +0000)]
zfs boot: add lszfs command to i386 loader

... to list child datasets of a specified dataset.
Dataset name should be provided in poolname/dsname format.

MFC after: 17 days

11 years agozfs boot: add code for listing child datasets of a given dataset
avg [Sat, 6 Oct 2012 19:27:04 +0000 (19:27 +0000)]
zfs boot: add code for listing child datasets of a given dataset

- only filesystem datasets are supported
- children names are printed to stdout

To do: allow to iterate over the list and fetch names programatically

MFC after: 17 days

11 years agozfs boot: chose a "first" pool if none is explicitly requested
avg [Sat, 6 Oct 2012 19:25:40 +0000 (19:25 +0000)]
zfs boot: chose a "first" pool if none is explicitly requested

MFC after: 8 days

11 years agoktrace/kern_exec: check p_tracecred instead of p_cred
avg [Sat, 6 Oct 2012 19:23:44 +0000 (19:23 +0000)]
ktrace/kern_exec: check p_tracecred instead of p_cred

.. when deciding whether to continue tracing across suid/sgid exec.
Otherwise if root ktrace-d an unprivileged process and the processed
exec-ed a suid program, then tracing didn't continue across exec.

Reviewed by: bde, kib
MFC after: 22 days

11 years agomake: report :M or :N pattern in debug mode
avg [Sat, 6 Oct 2012 19:19:32 +0000 (19:19 +0000)]
make: report :M or :N pattern in debug mode

MFC after: 12 days

11 years agoAdd bmake to the build and allow it to be installed as make(1) instead
marcel [Sat, 6 Oct 2012 19:19:21 +0000 (19:19 +0000)]
Add bmake to the build and allow it to be installed as make(1) instead
of FreeBSD's make by setting WITH_BMAKE.  The WITH_BMAKE build makes it
easy for people to switch while working out the kinks -- think ports
tree here.  The option will be removed in due time.

Submitted by: Simon Gerraty (sjg@juniper.net)

11 years agoCorrect two pessimizations in pmap_extract_and_hold(). Test the PTE for
alc [Sat, 6 Oct 2012 19:05:50 +0000 (19:05 +0000)]
Correct two pessimizations in pmap_extract_and_hold().  Test the PTE for
having PTE_RO set instead of PTE_D.  This avoids some unnecessary failures
by pmap_extract_and_hold() that will have to be handled by a call to
vm_fault_hold().  Testing the PTE for both being non-zero and having PTE_V
set is redundant.  The latter suffices.

11 years agoFix "make install"
kientzle [Sat, 6 Oct 2012 17:54:42 +0000 (17:54 +0000)]
Fix "make install"

Also make arm the same as other platforms:  Install man
pages for all CPUs in the family.

11 years ago A step in resolving mess with byte ordering for AF_INET. After this change:
glebius [Sat, 6 Oct 2012 10:02:11 +0000 (10:02 +0000)]
  A step in resolving mess with byte ordering for AF_INET. After this change:

  - All packets in NETISR_IP queue are in net byte order.
  - ip_input() is entered in net byte order and converts packet
    to host byte order right _after_ processing pfil(9) hooks.
  - ip_output() is entered in host byte order and converts packet
    to net byte order right _before_ processing pfil(9) hooks.
  - ip_fragment() accepts and emits packet in net byte order.
  - ip_forward(), ip_mloopback() use host byte order (untouched actually).
  - ip_fastforward() no longer modifies packet at all (except ip_ttl).
  - Swapping of byte order there and back removed from the following modules:
    pf(4), ipfw(4), enc(4), if_bridge(4).
  - Swapping of byte order added to ipfilter(4), based on __FreeBSD_version
  - __FreeBSD_version bumped.
  - pfil(9) manual page updated.

Reviewed by: ray, luigi, eri, melifaro
Tested by: glebius (LE), ray (BE)

11 years ago The pfil(9) layer guarantees us presence of the protocol header,
glebius [Sat, 6 Oct 2012 07:06:57 +0000 (07:06 +0000)]
  The pfil(9) layer guarantees us presence of the protocol header,
so remove extra check, that is always false.

P.S. Also, goto there lead to unlocking a not locked rwlock.

11 years agomdoc: begin sentences on a new line.
joel [Sat, 6 Oct 2012 06:07:33 +0000 (06:07 +0000)]
mdoc: begin sentences on a new line.

11 years agoMinor mdoc fix.
joel [Sat, 6 Oct 2012 06:02:29 +0000 (06:02 +0000)]
Minor mdoc fix.

11 years agoRemove trailing whitespace.
joel [Sat, 6 Oct 2012 05:54:41 +0000 (05:54 +0000)]
Remove trailing whitespace.

11 years agoMFV: tcpdump 4.3.0.
delphij [Fri, 5 Oct 2012 20:19:28 +0000 (20:19 +0000)]
MFV: tcpdump 4.3.0.

MFC after: 4 weeks

11 years agoMFV: libpcap 1.3.0.
delphij [Fri, 5 Oct 2012 18:42:50 +0000 (18:42 +0000)]
MFV: libpcap 1.3.0.

MFC after: 4 weeks

11 years agoAllow time offsets to be negative, e.g. `at 1530 - 15 minutes`.
cracauer [Fri, 5 Oct 2012 17:54:27 +0000 (17:54 +0000)]
Allow time offsets to be negative, e.g. `at 1530 - 15 minutes`.

This is useful if you have been given some time for some event in some
format and you want your computer to do something to prepare for it.
Without having to do time arithmetic in a shellscript.

The syntax matches what the at(1) usually used on Linux supports.

11 years agoInitialise an uninitialised variable.
adrian [Fri, 5 Oct 2012 16:44:00 +0000 (16:44 +0000)]
Initialise an uninitialised variable.

11 years agoFurther adjust the workaround in r234501. Rounding all small requests up
jhb [Fri, 5 Oct 2012 15:52:31 +0000 (15:52 +0000)]
Further adjust the workaround in r234501.  Rounding all small requests up
to 32k swamped the controller causing firmware hangs.  Instead, round
requests smaller than 64k up to the next power of 2 as a general rule.
To handle the one known special case of a command that accepts a 12k
buffer returning a 24k-ish reply, round requests between 8k and 16k up
to 32k rather than 16k.  The result is that commands less than 8k should
now be rounded up to a smaller size (either 4k or 8k) rather than 32k.

PR: kern/155658
Tested by: Andreas Longwitz
MFC after: 1 week

11 years agomount.h: MNTK_VGONE_UPPER and MNTK_VGONE_WAITER were supposed to be different
avg [Fri, 5 Oct 2012 14:42:38 +0000 (14:42 +0000)]
mount.h: MNTK_VGONE_UPPER and MNTK_VGONE_WAITER were supposed to be different

... otherwise a waiter is never woken up.

Reported by: swills
Discussed with: jhb
Approved by: kib
MFC after: 3 days

11 years ago Provide ability for printing and decoding pfsync(4) traffic. This
glebius [Fri, 5 Oct 2012 07:51:21 +0000 (07:51 +0000)]
  Provide ability for printing and decoding pfsync(4) traffic. This
doesn't mean supporting IFT_PFSYNC (which I hope will eventually
die). This means decoding packets with IP protocol of 240 caught
on any normal interface like Ethernet.

  The code is based on couple of files from OpenBSD, significantly
modified by myself.

  Parser differentiates for four levels of verbosity: no -v, -v,
-vv and -vvv.

  We don't yet forward this code upstream, because currently it
strongly relies on if_pfsync.h and even on pfvar.h. I hope that
this can be fixed in future.

Reviewed by: gnn, delphij

11 years agoFollow Broadcom datasheet:
yongari [Fri, 5 Oct 2012 07:13:21 +0000 (07:13 +0000)]
Follow Broadcom datasheet:
 Delay 100 microseconds after enabling transmit MAC.
 Delay 10 microseconds after enabling receive MAC.

11 years agoAdd 40 microseconds delay after updating EMAC Mode register as
yongari [Fri, 5 Oct 2012 06:24:22 +0000 (06:24 +0000)]
Add 40 microseconds delay after updating EMAC Mode register as
recommended by Broadcom data sheet.

11 years agoRemove references to CVS so that people will stop bringing it up
dougb [Fri, 5 Oct 2012 05:01:42 +0000 (05:01 +0000)]
Remove references to CVS so that people will stop bringing it up

For -p:
The localtime update should have been excluded in the first place

The make.conf comparison has been OBE for some time now, and there
is no src.conf equivalent to share/examples/make.conf, so remove
the whole thing.

Update copyright

11 years agoEliminate a stale and a duplicated comment.
alc [Fri, 5 Oct 2012 04:35:20 +0000 (04:35 +0000)]
Eliminate a stale and a duplicated comment.

11 years agoAPE firmware touches EMAC Mode and TX/RX MAC Mode registers to keep
yongari [Fri, 5 Oct 2012 03:46:25 +0000 (03:46 +0000)]
APE firmware touches EMAC Mode and TX/RX MAC Mode registers to keep
the MAC connected to the outside world.  So keep the accesses
atomic.