]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoPull up vendor changes to mdoc(7).
Ruslan Ermilov [Thu, 8 Dec 2011 13:54:06 +0000 (13:54 +0000)]
Pull up vendor changes to mdoc(7).

12 years agoCherry-pick vendor changes to mdoc:
Ruslan Ermilov [Thu, 8 Dec 2011 13:45:32 +0000 (13:45 +0000)]
Cherry-pick vendor changes to mdoc:

: 2011-10-23  Ingo Schwarze  <schwarze@openbsd.org>
:
:         [mdoc] Synchronize string tables with the mandoc(1) utility.
:
:         * tmac/doc-common: Add many architecture names used in NetBSD and
:         OpenBSD (and "arm" from FreeBSD) and remove the duplicate OS version
:         entry for Darwin-10.6.0.
:
:         * tmac/doc-syms: Add many library names used in NetBSD and FreeBSD.
:
:         * tmac/groff_mdoc.man: Document all supported architecture names, OS
:         versions, and library names.
:
: 2011-09-11  Joseph Koshy  <jkoshy@users.sourceforge.net>
:
:         [mdoc] Add some library strings.
:
:         * tmac/doc-syms: Add `libdwarf' and `libelf'.
:         * tmac/groff_mdoc.man: Document them.
:
: 2011-07-03  Guillem Jover  <guillem@debian.org>
:
:         mdoc: Update more OS versions strings.
:
:         * tmac/doc-common: Add versions strings for NetBSD, OpenBSD,
:         FreeBSD, and DragonFly.

12 years agoMake berase() work on platforms whose kernel lacks DIOCGDELETE ioctl.
Robert Millan [Thu, 8 Dec 2011 12:31:47 +0000 (12:31 +0000)]
Make berase() work on platforms whose kernel lacks DIOCGDELETE ioctl.

Approved by: kib (mentor)

12 years ago- Add support for Support SEAGATE DAT Scopion 130
Eitan Adler [Thu, 8 Dec 2011 03:20:48 +0000 (03:20 +0000)]
- Add support for Support SEAGATE DAT Scopion 130

PR: kern/141934
Submitted by: HASHI Hiroaki <hashiz@stenmark.meridiani.jp>
Approved by: sbruno@
MFC after: 1 week

12 years ago- Fix ktrace leakage if error is set
Eitan Adler [Thu, 8 Dec 2011 03:20:38 +0000 (03:20 +0000)]
- Fix ktrace leakage if error is set

PR: kern/163098
Submitted by: Loganaden Velvindron <loganaden@devio.us>
Approved by: sbruno@
MFC after: 1 month

12 years ago- set progname for use in usage()
Eitan Adler [Thu, 8 Dec 2011 02:40:46 +0000 (02:40 +0000)]
- set progname for use in usage()

PR: bin/162908
Submitted by: Oleg Ginzburg <olevole@olevole.ru>
Approved by: sbruno@
MFC after: 3 days

12 years agoDisable all clocks and put PHY into COMA before entering into
Pyun YongHyeon [Wed, 7 Dec 2011 23:20:14 +0000 (23:20 +0000)]
Disable all clocks and put PHY into COMA before entering into
suspend state.  This will save more power.
On resume, make sure to enable all clocks.  While I'm here, if
controller is not fast ethernet, enable gigabit PHY.

12 years agoConsistently use a tab character instead of using either a space or
Pyun YongHyeon [Wed, 7 Dec 2011 22:04:57 +0000 (22:04 +0000)]
Consistently use a tab character instead of using either a space or
tab after #define.
While I'm here consistently use capital letters when it uses
hexadecimal notation.

No functional changes.

12 years agoProtect SIOCSIFMTU ioctl handler with driver lock.
Pyun YongHyeon [Wed, 7 Dec 2011 21:54:44 +0000 (21:54 +0000)]
Protect SIOCSIFMTU ioctl handler with driver lock.
Don't blindly re-initialize controller whenever MTU is changed.
Now, reinitializing is done only when driver is running.

While here, remove unnecessary assignment of error value since it
was already initialized to 0.

12 years agoImplement hardware MAC statistics counter. Counters could be
Pyun YongHyeon [Wed, 7 Dec 2011 21:46:09 +0000 (21:46 +0000)]
Implement hardware MAC statistics counter.  Counters could be
queried with dev.et.%d.stats sysctl node where %d is an instance of
device.

12 years agoRework link state tracking and TX/RX MAC configuration.
Pyun YongHyeon [Wed, 7 Dec 2011 21:29:51 +0000 (21:29 +0000)]
Rework link state tracking and TX/RX MAC configuration.
 o Do not report link status if driver is not running.
 o TX/RX MAC configuration should be done with resolved speed,
   duplex and flow control after establishing a link so it can't
   be done in driver initialization routine.
   Move the configuration to miibus_statchg callback which will be
   called whenever any link state change is detected.
   At this moment, flow-control is not enabled yet mainly because
   I was not able to set correct flow control parameters to
   generate TX pause frames.
 o Now TX/RX MAC is enabled only when a valid link is detected.
   Rearragnge hardware initialization routine a bit to leave
   enabling MAC to miibus_statchg callback.  In order to that,
   TX/RX DMA engine is enabled in et_init_locked().
 o Introduce ET_FLAG_LINK flag to track current link state.
 o Introduce ET_FLAG_FASTETHER flag to mark whether controller is
   fast ethernet.  This flag is checked in miibus_statchg callback
   to know whether PHY established a valid link.
 o In et_stop(), TX/RX MAC is explicitly disabled instead of
   relying on et_reset().  And move et_reset() from et_stop() to
   controller initialization.  Controler reset is not required here
   and it would also clear critial registers(i.e station address,
   RX filter configuration, WOL etc) that are required to make WOL
   work.
 o Switching to current media is done in et_init_locked() after
   setting IFF_DRV_RUNNING flag.  This should ensure reliable
   auto-negotiation/manual link establishment.
 o In et_start_locked(), check whether driver got a valid link
   before trying to send frames.
 o Remove checking a link in et_tick() as this is done by
   miibus_statchg callback.

12 years agoAs per das@'s suggestion, s/__noreturn/_Noreturn/, since the latter is an
David Chisnall [Wed, 7 Dec 2011 21:17:50 +0000 (21:17 +0000)]
As per das@'s suggestion, s/__noreturn/_Noreturn/, since the latter is an
identifier reserved for the implementation in C99 and earlier so there is
no sensible reason for introducing yet another reserved identifier when we
could just use the one C1x uses.

Approved by: brooks (mentor)

12 years agoSome fixes to the man pages for [at_]quick_exit(3)
David Chisnall [Wed, 7 Dec 2011 21:02:35 +0000 (21:02 +0000)]
Some fixes to the man pages for [at_]quick_exit(3)

Reviewed by:    pluknet
Approved by:    dim (mentor)

12 years agoMake it possible to use the debug versions of std::map and std::multimap
Dimitry Andric [Wed, 7 Dec 2011 21:00:33 +0000 (21:00 +0000)]
Make it possible to use the debug versions of std::map and std::multimap
with clang, by removing two unneeded using declarations.  Otherwise, you
would get errors similar to:

/usr/include/c++/4.2/debug/map.h:77:20: error: dependent using declaration resolved to type without 'typename'
      using _Base::value_compare;
                   ^

N.B.: Take care when you actually use the debug versions of any
libstdc++ header.  They are more likely to contain problems, because
they are exercised far less often, and since the standard library
complexity guarantees don't always apply anymore, compile times can
drastically increase.

MFC after: 2 weeks

12 years agoRemove et_enable_intrs(), et_disable_intrs() functions and
Pyun YongHyeon [Wed, 7 Dec 2011 19:43:04 +0000 (19:43 +0000)]
Remove et_enable_intrs(), et_disable_intrs() functions and
manipulation of interrupt register access is done through
CSR_WRITE_4 macro.  Also add disabling interrupt into et_reset()
because we want interrupt disabled state after controller reset.
While I'm here slightly change interrupt handler to be more
readable one.

12 years agoController does not require TX start command for every frame. So
Pyun YongHyeon [Wed, 7 Dec 2011 19:08:54 +0000 (19:08 +0000)]
Controller does not require TX start command for every frame.  So
send a single TX command after setting up all TX frames.  This
removes unnecessary register accesses and bus_dmamap_sync(9) calls.
et(4) uses TX interrupt moderation so it's possible to have TX
buffers that were already transmitted but waiting for TX completion
interrupt.  If the number of available TX descriptor is less then
1/3 of total TX descriptor, try reclaiming first to get enough free
TX descriptors before setting up TX descriptors.
After r228325, et_txeof() no longer tries to send frames after
reclaiming TX buffers.  That change was made to give more chance
to transmit frames in main interrupt handler since we can still
send frames in interrupt handler with RX interrupt.  So right
before exiting interrupt hander, after enabling interrupt, try to
send more frames.  This gives slightly better performance numbers.

While I'm here reduce number of spare TX descriptors from 8 to 4.
Controller does not require reserved TX descriptors, it was just to
reduce TX overhead.  After r228325, driver has much lower TX
overhead so it does not make sense to reserve 8 TX descriptors.

12 years agoOverhaul bus_dma(9) usage in et(4) and clean up TX/RX path. This
Pyun YongHyeon [Wed, 7 Dec 2011 18:17:09 +0000 (18:17 +0000)]
Overhaul bus_dma(9) usage in et(4) and clean up TX/RX path.  This
change should make et(4) work on any architectures.
 o Remove m_getl inline function and replace it with stanard mbuf
   interfaces.  Previous code tried to minimize code duplication
   but this came from incorrect use of common DMA tag.
   Driver may be still use a common RX allocation handler with
   additional structure changes but I don't see much point to do
   that it would make it hard to understand the code.
 o Remove DragonflyBSD specific constant EVL_ENCAPLEN, use
   ETHER_VLAN_ENCAP_LEN instead.
 o Add bunch of new RX status definition.  It seems controller
   supports RX checksum offloading but I was not able to make the
   feature work yet.  Currently driver checks whether recevied
   frame is good one or not.
 o Avoid a typedef ending in '_t' as style(9) says.
 o Controller has no restriction on DMA address space, so there
   is no reason to limit the DMA address to 32bit.  Descriptor
   rings,  status blocks and TX/RX buffers now use full 64bit DMA
   addressing.
 o Allocate DMA memory shared between host and controller as
   coherent.
 o Create 3 separate DMA tags to be used as TX, mini RX ring and
   stanard RX ring.  Previously it created a single DMA tag and it
   was used to all three rings.
 o et(4) does not support jumbo frame at this moment and I still
   don't quite understand how jumbo frame works on this controller
   so use two RX rings to handle small sized frame and normal sized
   frame respectively.  The mini RX ring will be used to receive
   frames that are less than or equal to 127 bytes.  The second RX
   ring is used to receive frames that are not handled by the first
   RX ring.
   If jumbo frame support is implemented, driver may have to choose
   better RX scheme by letting the second RX ring handle jumbo
   frames.  This scheme will mimic Broadcom's efficient jumbo frame
   handling feature.  However RAM buffer size(16KB) of the
   controller is too small to hold 2 jumbo frames, if 9KB
   jumbo frame is used, I'm not sure how good performance would it
   have.
 o In et_rxeof(), make sure to check whether controller received
   good frame or not.  Passing corrupted frame to upper layer is
   bad idea.
 o If driver receives a bad frame or driver fails to allocate RX
   buffer due to resource shortage condition, reuse previously
   loaded DMA map for RX buffer instead of unloading/loading RX
   buffer again.
 o et_init_tx_ring() never fails so change return type to void.
 o In watchdog handler, show TX DMA write back status of errored
   frame which could be used as a clue to debug watchdog timeout.
 o Add missing bus_dmamap_sync() in various places such that et(4)
   should work with bounce buffers(e.g. PAE).
 o TX side bus_dmamap_load_mbuf_sg(9) support.
 o RX side bus_dmamap_load_mbuf_sg(9) support.
 o Controller has no DMA alignment limit in RX buffer so use
   m_adj(9) in RX buffer allocation to make IP header align on 2
   bytes boundary.  Otherwise it would trigger unaligned access
   error in upper layer on strict alignment architectures.
   One of down side of controller is it provides limited set of RX
   buffer length like most Intel controllers.  This is not problem
   at this moment because driver does not support jumbo frame yet
   but it may require alignment fixup code to support jumbo frame
   on strict alignment architectures.
 o In et_txeof(), don't zero TX descriptors for transmitted frames.
   TX descriptors don't need write access after transmission.
   Driver sets IFF_DRV_OACTIVE when the number of available TX
   descriptors are less than or equal to ET_NSEG_SPARE.  Make sure
   to clear IFF_DRV_OACTIVE only when the number of available TX
   descriptor is greater than ET_NSEG_SPARE.

12 years agoEliminate stale numbers from a comment.
Alan Cox [Wed, 7 Dec 2011 16:27:23 +0000 (16:27 +0000)]
Eliminate stale numbers from a comment.

12 years agostyle(9) cleanups.
David Chisnall [Wed, 7 Dec 2011 16:12:54 +0000 (16:12 +0000)]
style(9) cleanups.

Approved by: brooks (mentor)

12 years agoImplement quick_exit() / at_quick_exit() from C++11 / C1x. Also add a
David Chisnall [Wed, 7 Dec 2011 15:25:48 +0000 (15:25 +0000)]
Implement quick_exit() / at_quick_exit() from C++11 / C1x.  Also add a
__noreturn macro and modify the other exiting functions to use it.

The __noreturn macro, unlike __dead2, must be used BEFORE the function.
This is in line with the C and C++ specifications that place _Noreturn (c1x)
and [[noreturn]] (C++11) in front of the functions.  As with __dead2, this
macro falls back to using the GCC attribute.

Unfortunately, clang currently sets the same value for the C version macro
in C99 and C1x modes, so these functions are hidden by default.  At some
point before 10.0, I need to go through the headers and clean up the C1x /
C++11 visibility.

Reviewed by: brooks (mentor)

12 years agoFix double free.
Gleb Smirnoff [Wed, 7 Dec 2011 13:37:42 +0000 (13:37 +0000)]
Fix double free.

PR: kern/163089
Submitted by: Herbie Robinson <Herbie.Robinson stratus.com>

12 years ago- Match GNU behavior of exit code
Gabor Kovesdan [Wed, 7 Dec 2011 12:25:28 +0000 (12:25 +0000)]
- Match GNU behavior of exit code
- Rename variable that has a different meaning now

PR: bin/162930
Submitted by: Jan Beich <jbeich@tormail.net>
MFC after: 1 week

12 years agoThe NOTE_COPY should have been named NOTE_FFCOPY from the very
Ruslan Ermilov [Wed, 7 Dec 2011 11:06:18 +0000 (11:06 +0000)]
The NOTE_COPY should have been named NOTE_FFCOPY from the very
beginning.

Submitted by: Igor Sysoev

12 years agoEliminate the possibility of 32-bit arithmetic overflow in the calculation
Alan Cox [Wed, 7 Dec 2011 07:03:14 +0000 (07:03 +0000)]
Eliminate the possibility of 32-bit arithmetic overflow in the calculation
of vm_kmem_size that may occur if the system administrator has specified a
vm.vm_kmem_size tunable value that exceeds the hard cap.

PR: 162741
Submitted by: Adam McDougall
Reviewed by: bde@
MFC after: 3 weeks

12 years agoFix a very special case when SIOCAIFADDR supplies mask of 0.0.0.0,
Gleb Smirnoff [Tue, 6 Dec 2011 20:55:20 +0000 (20:55 +0000)]
Fix a very special case when SIOCAIFADDR supplies mask of 0.0.0.0,
don't overwrite the mask with autoguessing based on classes.

12 years agoMK_CTF is not defined when kmod.mk is used with old bsd.own.mk.
Max Khon [Tue, 6 Dec 2011 18:01:09 +0000 (18:01 +0000)]
MK_CTF is not defined when kmod.mk is used with old bsd.own.mk.

12 years agoDon't support OpenLDAP during lib32 build.
Hajimu UMEMOTO [Tue, 6 Dec 2011 12:03:01 +0000 (12:03 +0000)]
Don't support OpenLDAP during lib32 build.

12 years agoForce linker error when created shared library contains a relocation
Konstantin Belousov [Tue, 6 Dec 2011 11:28:17 +0000 (11:28 +0000)]
Force linker error when created shared library contains a relocation
against text. Provide the override switch to turn off the strict
behaviour. Apparently, openssl libcrypto needs it due to assembler
code not being PIC.

Discussed with: bf
MFC after: 2 weeks

12 years agoMost users of pipe(2) do not call fstat(2) on the returned pipe descriptors.
Konstantin Belousov [Tue, 6 Dec 2011 11:24:03 +0000 (11:24 +0000)]
Most users of pipe(2) do not call fstat(2) on the returned pipe descriptors.
Optimize for the case, by lazily allocating the pipe inode number at the
fstat(2) time. If alloc_unr(9) returns failure, do not fail fstat(2), since
uses of inode numbers are even rare then fstat(2), but provide zero inode
forever. Note that alloc_unr() failure is unlikely due to total number
of pipes in the system limited by the number of file descriptors.

Based on the submission by: gianni
MFC after: 2 weeks

12 years agoMention that Cold Presence Detection feature used for hot-plug detection
Alexander Motin [Tue, 6 Dec 2011 09:12:11 +0000 (09:12 +0000)]
Mention that Cold Presence Detection feature used for hot-plug detection
when interface power management is enabled.

12 years agoCorrect some bInterval USB template descriptor values.
Hans Petter Selasky [Tue, 6 Dec 2011 08:08:52 +0000 (08:08 +0000)]
Correct some bInterval USB template descriptor values.

MFC after: 3 days

12 years agoFix compile warning when using clang to compile the code.
Hans Petter Selasky [Tue, 6 Dec 2011 07:55:25 +0000 (07:55 +0000)]
Fix compile warning when using clang to compile the code.

Submitted by: arundel @
MFC after: 3 days

12 years agoReally protect kern.proc.ps_strings sysctls with p_candebug(). This
Mikolaj Golub [Tue, 6 Dec 2011 06:40:14 +0000 (06:40 +0000)]
Really protect kern.proc.ps_strings sysctls with p_candebug(). This
was intended to be in r228288.

Spotted by: many
MFC after: 1 week

12 years agoCatch up with Bryan Venteicher's virtio Hg repo:
Peter Grehan [Tue, 6 Dec 2011 06:28:32 +0000 (06:28 +0000)]
Catch up with Bryan Venteicher's virtio Hg repo:

c162516
  Remove vtblk_sector_size

c162515
  Wrap long license lines

c162514
  Remove vtblk_unit

c162513
  Wrap long lines in the license.

c162512
  Remove verbose messages when link goes up/down.

  A similar message is printed elsewhere as a result of
  if_link_state_change().

c162511
  Explicity compare pointer to NULL

c162510
  Allocate the mac filter table at attach time.

c162509
  Add real BSD licenses to the header files copied from Linux.

  The chases upstream changes made in Linux awhile ago.

c162508
  Only notify if we actually dequeued something.

c162507
  Change a couple of if () { KASSERT(...) } to just KASSERTs.

  In non-debug kernels, the if() { } probably get optomized
  away, but I guess this is clearer.

c162506
  Remove VIRTIO_BLK_F_TOPOLOGY fields in the config.

  TOPOLOGY has since been removed from the spec, and the FreeBSD
  didn't really do anything with the fields anyways.

c162505
  Move vtblk_enqueue_request() outside the locks when getting the ident.

c162504
  Remove soon to be uneeded trylock during dump [1].
  http://lists.freebsd.org/pipermail/freebsd-current/2011-November/029226.html

c162503
  Remove emtpy line

c162502
  Drop frame if cannot allocate a vtnet_tx_header.

  If we don't, we set OACTIVE, but if there are no
  other frames in flight, vtnet_txeof() will never
  be called to unset OACTIVE. The interface would
  have to be down/up'ed in order to become usable.

  We could be cuter here and only do this if the
  virtqueue is emtpy, but its probably not worth
  the complication.

c162501
  Start mbuf replacement loop at 1 for clarity

Obtained from: Bryan Venteicher  bryanv at daemoninthecloset dot org

12 years agoMake et_probe() return BUS_PROBE_DEFAULT such that allow other
Pyun YongHyeon [Tue, 6 Dec 2011 00:58:42 +0000 (00:58 +0000)]
Make et_probe() return BUS_PROBE_DEFAULT such that allow other
driver that has high precedence for the controller override et(4).
Add missing callout_drain(9) in device detach and rework detach
routine.  While I'm here use rman_get_rid(9) instead of using
cached resource id because bus methods are free to change the
id.

12 years agoet(4) supports VLAN oversized frame so correctly set header length.
Pyun YongHyeon [Tue, 6 Dec 2011 00:18:37 +0000 (00:18 +0000)]
et(4) supports VLAN oversized frame so correctly set header length.
While I'm here remove initializing if_mtu, it is set by
ether_ifattach(9).  Also move callout_init_mtx(9) to the right below
driver lock initialization.

12 years agoFix alt(4) support. Also add check for number of available TX
Pyun YongHyeon [Mon, 5 Dec 2011 22:55:52 +0000 (22:55 +0000)]
Fix alt(4) support.  Also add check for number of available TX
descriptors before trying to send frames.  If we're not able to
send a frame, make sure to prepend it to if_snd queue such that
alt(4) should work.

While I'm here prefer ETHER_BPF_MTAP to BPF_MTAP.  ETHER_BPF_MTAP
should be used for controllers that support VLAN hardware tag
insertion.  The controller supports VLAN tag insertion but lacks
VLAN tag stripping in RX path though.

12 years agoImplement suspend/resume methods. Driver has no issue with
Pyun YongHyeon [Mon, 5 Dec 2011 22:22:39 +0000 (22:22 +0000)]
Implement suspend/resume methods.  Driver has no issue with
suspend/resume.

12 years agoRemove NetBSD license. r199548 removed all bit macros that were
Pyun YongHyeon [Mon, 5 Dec 2011 22:09:07 +0000 (22:09 +0000)]
Remove NetBSD license. r199548 removed all bit macros that were
derived from NetBSD.

12 years ago- In mii_attach(9) just set the driver for a newly added miibus(4) instance
Marius Strobl [Mon, 5 Dec 2011 21:38:45 +0000 (21:38 +0000)]
- In mii_attach(9) just set the driver for a newly added miibus(4) instance
  before calling bus_enumerate_hinted_children(9) (which is the minimum for
  this to work) instead of fully probing it so later on we can just call
  bus_generic_attach(9) on the parent of the miibus(4) instance. The latter
  is necessary in order to work around what seems to be a bzzarre race in
  newbus affecting a few machines since r227687, causing no driver being
  probed for the newly added miibus(4) instance. Presumably this is the
  same race that was the motivation for the work around done in r215348.
  Reported and tested by: yongari
- Revert the removal of a static in r221913 in order to help compilers to
  produce more optimal code.

12 years agoDon't output a warning if kern.proc.auxv sysctl has returned EPERM.
Mikolaj Golub [Mon, 5 Dec 2011 19:39:15 +0000 (19:39 +0000)]
Don't output a warning if kern.proc.auxv sysctl has returned EPERM.
After r228288 this is rather a normal situation.

MFC after: 1 week

12 years agoProtect kern.proc.auxv and kern.proc.ps_strings sysctls with p_candebug().
Mikolaj Golub [Mon, 5 Dec 2011 19:34:02 +0000 (19:34 +0000)]
Protect kern.proc.auxv and kern.proc.ps_strings sysctls with p_candebug().

Citing jilles:

If we are ever going to do ASLR, the AUXV information tells an attacker
where the stack, executable and RTLD are located, which defeats much of
the point of randomizing the addresses in the first place.

Given that the AUXV information seems to be used by debuggers only anyway,
I think it would be good to move it to p_candebug() now.

The full virtual memory maps (KERN_PROC_VMMAP, procstat -v) are already
under p_candebug().

Suggested by: jilles
Discussed with: rwatson
MFC after: 1 week

12 years agoIntroduce vm_reserv_alloc_contig() and teach vm_page_alloc_contig() how to
Alan Cox [Mon, 5 Dec 2011 18:29:25 +0000 (18:29 +0000)]
Introduce vm_reserv_alloc_contig() and teach vm_page_alloc_contig() how to
use superpage reservations.  So, for the first time, kernel virtual memory
that is allocated by contigmalloc(), kmem_alloc_attr(), and
kmem_alloc_contig() can be promoted to superpages.  In fact, even a series
of small contigmalloc() allocations may collectively result in a promoted
superpage.

Eliminate some duplication of code in vm_reserv_alloc_page().

Change the type of vm_reserv_reclaim_contig()'s first parameter in order
that it be consistent with other vm_*_contig() functions.

Tested by: marius (sparc64)

12 years agoFix off by one error in mbuf access. Previously it caused panic.
Pyun YongHyeon [Mon, 5 Dec 2011 18:10:43 +0000 (18:10 +0000)]
Fix off by one error in mbuf access.  Previously it caused panic.
While I'm here use NULL to compare mbuf pointer and add additional
check for zero length mbuf before accessing the mbuf.

PR: kern/162932

12 years ago- Make heimdal buildable with WITH_OPENLDAP defined, again.
Hajimu UMEMOTO [Mon, 5 Dec 2011 16:38:52 +0000 (16:38 +0000)]
- Make heimdal buildable with WITH_OPENLDAP defined, again.
- Our heimdal uses the deprecated OpenLDAP functions.

12 years agoGet rid of kludgy per-descriptor state handling in acpi_apm.
Ed Schouten [Mon, 5 Dec 2011 16:08:18 +0000 (16:08 +0000)]
Get rid of kludgy per-descriptor state handling in acpi_apm.

Where i386/bios/apm.c requires no per-descriptor state, the ACPI version
of these device do. Instead of using hackish clone lists that leave
stale device nodes lying around, use the cdevpriv API.

12 years agoadd netmap support for "em", "lem", "igb" and "re".
Luigi Rizzo [Mon, 5 Dec 2011 15:33:13 +0000 (15:33 +0000)]
add netmap support for "em", "lem", "igb" and "re".

On my hardware, "em" in netmap mode does about 1.388 Mpps
on one card (on an Asus motherboard), and 1.1 Mpps on another
card (PCIe bus). Both seem to be NIC-limited, because
i have the same rate even with the CPU running at 150 MHz.

On the "re" driver the tx throughput is around 420-450 Kpps
on various (8111C and the like) chipsets. On the Rx side
performance seems much better, and i can receive the full
load generated by the "em" cards.

"igb" is untested as i don't have the hardware.

12 years agorevise the implementation of the rings connected to the host stack
Luigi Rizzo [Mon, 5 Dec 2011 15:21:21 +0000 (15:21 +0000)]
revise the implementation of the rings connected to the host stack

12 years agoUse the correct volume identifier field when parsing MR_EVT_ARG_LD_STRIP
John Baldwin [Mon, 5 Dec 2011 15:11:35 +0000 (15:11 +0000)]
Use the correct volume identifier field when parsing MR_EVT_ARG_LD_STRIP
arguments.

MFC after: 2 weeks

12 years agoFix style(9) issues from r228270.
Justin Hibbits [Mon, 5 Dec 2011 14:13:21 +0000 (14:13 +0000)]
Fix style(9) issues from r228270.

Approved by: nwhitehorn (mentor)

12 years ago1. Fix the handling of link reset while in netmap more.
Luigi Rizzo [Mon, 5 Dec 2011 12:06:53 +0000 (12:06 +0000)]
1. Fix the handling of link reset while in netmap more.
   A link reset now is completely transparent for the netmap client:
   even if the NIC resets its own ring (e.g. restarting from 0),
   the client will not see any change in the current rx/tx positions,
   because the driver will keep track of the offset between the two.

2. make the device-specific code more uniform across different drivers
   There were some inconsistencies in the implementation of the netmap
   support routines, now drivers have been aligned to a common
   code structure.

3. import netmap support for ixgbe . This is implemented as a very
   small patch for ixgbe.c (233 lines, 11 chunks, mostly comments:
   in total the patch has only 54 lines of new code) , as most of
   the code is in an external file sys/dev/netmap/ixgbe_netmap.h ,
   following some initial comments from Jack Vogel about making
   changes less intrusive.
   (Note, i have emailed Jack multiple times asking if he had
   comments on this structure of the code; i got no reply so
   i assume he is fine with it).

Support for other drivers (em, lem, re, igb) will come later.

"ixgbe" is now the reference driver for netmap support. Both the
external file (sys/dev/netmap/ixgbe_netmap.h) and the device-specific
patches (in sys/dev/ixgbe/ixgbe.c) are heavily commented and should
serve as a reference for other device drivers.

Tested on i386 and amd64 with the pkt-gen program in tools/tools/netmap,
the sender does 14.88 Mpps at 1050 Mhz and 14.2 Mpps at 900 MHz
on an i7-860 with 4 cores and 82599 card. Haven't tried yet more
aggressive optimizations such as adding 'prefetch' instructions
in the time-critical parts of the code.

12 years agoAdd a missing curly bracket
Kevin Lo [Mon, 5 Dec 2011 10:34:52 +0000 (10:34 +0000)]
Add a missing curly bracket

12 years agoFix some uninitialized variables in pipe regression tests that result in
Eitan Adler [Mon, 5 Dec 2011 04:20:13 +0000 (04:20 +0000)]
Fix some uninitialized variables in pipe regression tests that result in
failure.

PR: misc/161175
Submitted by: gianni@
Approved by: nwhitehorn@
MFC after: 1 week

12 years agoDisable KDB/DDB options for XLP N32 compile.
Jayachandran C. [Mon, 5 Dec 2011 03:18:40 +0000 (03:18 +0000)]
Disable KDB/DDB options for XLP N32 compile.

n32 abi is not supported in KDB/DDB yet, disable the option in
XLPN32 conf.

Reported by: gonzo, bz

12 years agoFix N32 compilation again for XLP.
Jayachandran C. [Mon, 5 Dec 2011 03:10:01 +0000 (03:10 +0000)]
Fix N32 compilation again for XLP.

Disable DDB/KDB related options for N32, and add back a cast that was
lost during the last set of updates.

Reported by: gonzo, bz

12 years agoFix XLP compilation.
Jayachandran C. [Mon, 5 Dec 2011 02:56:08 +0000 (02:56 +0000)]
Fix XLP compilation.

Add definitions of LSU_DEBUG_ADDR and LSU_DEBUG_DATA0, the code that uses
it was added in r227799

Reported by: gonzo

12 years agoAdd a devd notification for closing/opening the lid on PowerBooks and iBooks.
Justin Hibbits [Mon, 5 Dec 2011 00:12:10 +0000 (00:12 +0000)]
Add a devd notification for closing/opening the lid on PowerBooks and iBooks.

Approved by: nwhitehorn (mentor)

12 years agolibc: Eliminate 13 relative relocations in wctype().
Jilles Tjoelker [Mon, 5 Dec 2011 00:00:47 +0000 (00:00 +0000)]
libc: Eliminate 13 relative relocations in wctype().

12 years agoProtect process environment variables with p_candebug().
Mikolaj Golub [Sun, 4 Dec 2011 21:43:13 +0000 (21:43 +0000)]
Protect process environment variables with p_candebug().

Discussed with: jilles, kib, rwatson
MFC after: 2 weeks

12 years agozfsboot: print boot.config contents before parsing it
Andriy Gapon [Sun, 4 Dec 2011 21:32:18 +0000 (21:32 +0000)]
zfsboot: print boot.config contents before parsing it

as parsing can be a destructive operation

MFC after: 2 weeks

12 years agozfs boot: allow file vdevs to be used in testing (e.g. with zfsboottest)
Andriy Gapon [Sun, 4 Dec 2011 21:29:56 +0000 (21:29 +0000)]
zfs boot: allow file vdevs to be used in testing (e.g. with zfsboottest)

MFC after: 1 week

12 years agocritical_exit: ignore td_owepreempt if kdb_active is set
Andriy Gapon [Sun, 4 Dec 2011 21:27:41 +0000 (21:27 +0000)]
critical_exit: ignore td_owepreempt if kdb_active is set

calling mi_switch in such a context results in a recursion via
kdb_switch

Suggested by: jhb
Reviewed by: jhb
MFC after: 5 weeks

12 years agoIn sysctl_kern_proc_ps_strings() there is no much sense in checking
Mikolaj Golub [Sun, 4 Dec 2011 21:24:01 +0000 (21:24 +0000)]
In sysctl_kern_proc_ps_strings() there is no much sense in checking
for P_WEXIT and P_SYSTEM flags.

Reviewed by: kib

12 years agoInitialize fifoinfo fi_wgen field on open. The only important is the
Konstantin Belousov [Sun, 4 Dec 2011 19:25:49 +0000 (19:25 +0000)]
Initialize fifoinfo fi_wgen field on open. The only important is the
difference between fi_wgen and f_seqcount, so the change is purely
cosmetic, but it makes the code easier to understand.

Submitted by: gianni
MFC after: 2 weeks

12 years agoUse explicit information from the kernel to detect the traps due to
Konstantin Belousov [Sun, 4 Dec 2011 18:43:09 +0000 (18:43 +0000)]
Use explicit information from the kernel to detect the traps due to
syscall entry and leave.

Based on submision by: Dan Nelson <dnelson allantgroup com>
MFC after: 1 month

12 years agoThis patch adds a sysctl to the NFSv4 server which optionally disables the
Rick Macklem [Sun, 4 Dec 2011 16:33:04 +0000 (16:33 +0000)]
This patch adds a sysctl to the NFSv4 server which optionally disables the
check for a UTF-8 compliant file name. Enabling this sysctl results in
an NFSv4 server that is non-RFC3530 compliant, therefore it is not enabled
by default. However, enabling this sysctl results in NFSv3 compatible
behaviour and fixes the problem reported by "dan at sunsaturn.com"
to freebsd-current@ on Nov. 14, 2011 under the subject "NFSV4 readlink_stat".

Tested by: dan at sunsaturn.com
Reviewed by: zack
MFC after: 2 weeks

12 years agoSupport domain-search in dhclient(8)
Jean-Sébastien Pédron [Sun, 4 Dec 2011 14:44:31 +0000 (14:44 +0000)]
Support domain-search in dhclient(8)

The "domain-search" option (option 119) allows a DHCP server to publish
a list of implicit domain suffixes used during name lookup. This option
is described in RFC 3397.

For instance, if the domain-search option says:
    ".example.org .example.com"
and one wants to resolve "foobar", the resolver will try:
    1. "foobar.example.org"
    2. "foobar.example.com"

The file /etc/resolv.conf is updated with a "search" directive if the
DHCP server provides "domain-search".

A regression test suite is included in this patch under
tools/regression/sbin/dhclient.

PR: bin/151940
Sponsored by Yakaz (http://www.yakaz.com)

12 years agoModify the GPIO i2c bus code to allow for arbitrary data/clock
Adrian Chadd [Sun, 4 Dec 2011 12:10:24 +0000 (12:10 +0000)]
Modify the GPIO i2c bus code to allow for arbitrary data/clock
pins, rather than defaulting to 0 and 1.

This way the pin order can be reversed.  It is reversed with the
TP-Link TL-WR1043nd.

Submitted by: Stefan Bethke <stb@lassitu.de>

12 years agoAllow the i2c node requirements to be slightly relaxed.
Adrian Chadd [Sun, 4 Dec 2011 11:55:33 +0000 (11:55 +0000)]
Allow the i2c node requirements to be slightly relaxed.

These realtek switch PHYs speak a variant of i2c with some slightly
modified handling.

From the submitter, slightly modified now that some further digging
has been done:

  The I2C framework makes a assumption that the read/not-write bit of the first
  byte (the address) indicates whether reads or writes are to follow.

  The RTL8366 family uses the bus: after sending the address+read/not-write byte,
  two register address bytes are sent, then the 16-bit register value is sent
  or received.  While the register write access can be performed as a 4-byte
  write, the read access requires the read bit to be set, but the first two bytes
  for the register address then need to be transmitted.

This patch maintains the i2c protocol behaviour but allows it to be relaxed
(for these kinds of switch PHYs, and whatever else Realtek may do with this
almost-but-not-quite i2c bus) - by setting the "strict" hint to 0.
The "strict" hint defaults to 1.

Submitted by: Stefan Bethke <stb@lassitu.de>

12 years agoAdd quirk for Micron RealSSD eUSB failing on unsupported SCSI command
Ed Maste [Sat, 3 Dec 2011 19:56:52 +0000 (19:56 +0000)]
Add quirk for Micron RealSSD eUSB failing on unsupported SCSI command

It appears this device fails if sent a SYNCHRONIZE_CACHE command, so add
quirk to avoid sending it.

I will follow up with Micron on this issue, and will adjust the quirk if
necessary based on their feedback.

Reviewed by: hselasky@

12 years agoSimplify libusb_open_device_with_vid_pid(): Only set
Hans Petter Selasky [Sat, 3 Dec 2011 16:30:47 +0000 (16:30 +0000)]
Simplify libusb_open_device_with_vid_pid(): Only set
pdev to non-NULL on success instead of unconditonally
setting it and maybe resetting it later.

Submitted by: Christoph Mallon
MFC after: 3 days

12 years agolibusb_open() sets the given device handle to NULL if it
Hans Petter Selasky [Sat, 3 Dec 2011 16:19:07 +0000 (16:19 +0000)]
libusb_open() sets the given device handle to NULL if it
fails, so there is no need to do it again after returning.

Submitted by: Christoph Mallon
MFC after: 3 days

12 years agoMake sure the description of pause() is
Hans Petter Selasky [Sat, 3 Dec 2011 15:51:15 +0000 (15:51 +0000)]
Make sure the description of pause() is
equivalent to its implementation.
No code change.

Suggested by: Bruce Evans
MFC after: 3 days

12 years ago- Fix typos s/(more|less) then|\1 than/
Eitan Adler [Sat, 3 Dec 2011 15:41:37 +0000 (15:41 +0000)]
- Fix typos s/(more|less) then|\1 than/

Submitted by: Davide Italiano <davide.italiano@gmail.com>
Approved by: brucec
MFC after: 3 days

12 years agoFix a compile warning with clang.
Hans Petter Selasky [Sat, 3 Dec 2011 14:54:44 +0000 (14:54 +0000)]
Fix a compile warning with clang.

Reported by: arundel @
MFC after: 3 days

12 years agoAdd myself to the relevant doc files.
Justin Hibbits [Sat, 3 Dec 2011 14:03:53 +0000 (14:03 +0000)]
Add myself to the relevant doc files.

Approved by: nwhitehorn (mentor)

12 years agoRevert r225889 a bit. While it's correct that in total store order there's
Marius Strobl [Sat, 3 Dec 2011 13:51:57 +0000 (13:51 +0000)]
Revert r225889 a bit. While it's correct that in total store order there's
no need to additionally add CPU memory barriers to the acquire variants of
atomic(9), these are documented to also include compiler memory barriers.
So add the latter, which were previously included by using membar(), back.

12 years agoUse umtx_copyin_timeout() to copy and check timeout parameter.
Peter Holm [Sat, 3 Dec 2011 12:35:13 +0000 (12:35 +0000)]
Use umtx_copyin_timeout() to copy and check timeout parameter.

In collaboration with: kib
MFC after: 1 week

12 years agoAdd declaration of umtx_copyin_timeout()
Peter Holm [Sat, 3 Dec 2011 12:33:17 +0000 (12:33 +0000)]
Add declaration of umtx_copyin_timeout()

In collaboration with: kib
MFC after: 1 week

12 years agoAdd umtx_copyin_timeout() and move parameter checks here.
Peter Holm [Sat, 3 Dec 2011 12:30:58 +0000 (12:30 +0000)]
Add umtx_copyin_timeout() and move parameter checks here.

In collaboration with: kib
MFC after: 1 week

12 years agoRename copyin_timeout32 to umtx_copyin_timeout32 and move parameter
Peter Holm [Sat, 3 Dec 2011 12:28:33 +0000 (12:28 +0000)]
Rename copyin_timeout32 to umtx_copyin_timeout32 and move parameter
check here. Include check for negative seconds value.

In collaboration with: kib
MFC after: 1 week

12 years agoPost r223774, the NFSv4 client no longer has multiple instances
Rick Macklem [Sat, 3 Dec 2011 02:27:26 +0000 (02:27 +0000)]
Post r223774, the NFSv4 client no longer has multiple instances
of the same lock_owner4 string. As such, the handling of cleanup
of lock_owners could be simplified. This simplification permitted
the client to do a ReleaseLockOwner operation when the process that
the lock_owner4 string represents, has exited. This permits the
server to release any storage related to the lock_owner4 string
before the associated open is closed. Without this change, it
is possible to exhaust a server's storage when a long running
process opens a file and then many child processes do locking
on the file, because the open doesn't get closed. A similar patch
was applied to the Linux NFSv4 client recently so that it wouldn't
exhaust a server's storage.

Reviewed by: zack
MFC after: 2 weeks

12 years agoIt doesn't make much sense to check whether child is NULL after already
Marius Strobl [Fri, 2 Dec 2011 22:03:27 +0000 (22:03 +0000)]
It doesn't make much sense to check whether child is NULL after already
having dereferenced it. We either should generally check the device_t's
supplied to bus functions before using them (which we seem to virtually
never do) or just assume that they are not NULL.
While at it make this code fit 78 columns.

Found with: Coverity Prevent(tm)
CID: 4230

12 years ago- In device_probe_child(9) check the return value of device_set_driver(9)
Marius Strobl [Fri, 2 Dec 2011 21:19:14 +0000 (21:19 +0000)]
- In device_probe_child(9) check the return value of device_set_driver(9)
  when actually setting a driver as especially ENOMEM is fatal in these
  cases.
- Annotate other calls to device_set_devclass(9) and device_set_driver(9)
  without the return value being checked and that are okay to fail.

Reviewed by: yongari (slightly earlier version)

12 years agoWhen changing the user priority of a thread, change the real priority
John Baldwin [Fri, 2 Dec 2011 19:59:46 +0000 (19:59 +0000)]
When changing the user priority of a thread, change the real priority
in addition to the user priority for threads whose current real priority
is equal to the previous user priority or if the new priority is a
real-time priority.  This allows priority changes of other threads to
have an immediate effect.

MFC after: 2 weeks

12 years agoRemove unnecesary "Ns" macros and add missing command example to zpool(8).
Martin Matuska [Fri, 2 Dec 2011 19:56:46 +0000 (19:56 +0000)]
Remove unnecesary "Ns" macros and add missing command example to zpool(8).

Reported by: Nobuyuki Koganemaru <kogane@FreeBSD.org>
MFC after: 3 days

12 years agoAdd more controllers that support jumbo frame.
Pyun YongHyeon [Fri, 2 Dec 2011 19:01:26 +0000 (19:01 +0000)]
Add more controllers that support jumbo frame.

12 years agoClose race between geom destruction on g_vfs_close() when softc destroyed
Alexander Motin [Fri, 2 Dec 2011 17:09:48 +0000 (17:09 +0000)]
Close race between geom destruction on g_vfs_close() when softc destroyed
and g_vfs_orphan() call that tries to access softc, intruced at r227015.

PR: kern/162997

12 years agoRestore comment with credit to Marc Frajola.
Ed Maste [Fri, 2 Dec 2011 15:47:05 +0000 (15:47 +0000)]
Restore comment with credit to Marc Frajola.

fwdownload.c is derived from Andre Albsmeier's fwdownload.c, which was
written from scratch but was inspired by Marc's original idea and code.

12 years agoRevert r227812 and r227808 per discussion
Eitan Adler [Fri, 2 Dec 2011 15:41:09 +0000 (15:41 +0000)]
Revert r227812 and r227808 per discussion

Reviewed by: many
Approved by: des

12 years agoFix OF_finddevice error return value in case of FDT.
Jayachandran C. [Fri, 2 Dec 2011 15:24:39 +0000 (15:24 +0000)]
Fix OF_finddevice error return value in case of FDT.

According to the open firmware standard, finddevice call has to return
a phandle with value of -1 in case of error.

This commit is to:
- Fix the FDT implementation of this interface (ofw_fdt_finddevice) to
  return (phandle_t)-1 in case of error, instead of 0 as it does now.
- Fix up the callers of OF_finddevice() to compare the return value with
  -1 instead of 0 to check for errors.
- Since phandle_t is unsigned, the return value of OF_finddevice should
  be checked with '== -1' rather than '<= 0' or '> 0', fix up these cases
  as well.

Reported by: nwhitehorn

Reviewed by: raj
Approved by: raj, nwhitehorn

12 years agoAdd hw.ahci.force tunable to control whether AHCI drivers should attach
Alexander Motin [Fri, 2 Dec 2011 12:52:33 +0000 (12:52 +0000)]
Add hw.ahci.force tunable to control whether AHCI drivers should attach
to known AHCI-capable chips (AMD/NVIDIA), configured for legacy emulation.

Enabled by default to get additional performance and functionality of AHCI
when it can't be enabled by BIOS. Can be disabled to honor BIOS settings if
needed for some reason.

MFC after: 1 month

12 years agoSplit sentences at period boundaries.
David E. O'Brien [Fri, 2 Dec 2011 11:55:09 +0000 (11:55 +0000)]
Split sentences at period boundaries.

12 years agoUpdate Westmere uncore event exception list.
Fabien Thomas [Fri, 2 Dec 2011 10:02:49 +0000 (10:02 +0000)]
Update Westmere uncore event exception list.

Submitted by: Davide Italiano <davide italiano at gmail com>
MFC after: 1 week

12 years agoRegen.
Max Khon [Fri, 2 Dec 2011 09:28:19 +0000 (09:28 +0000)]
Regen.

12 years agoRevert to conservative defaults. WITH_PROFILE is a default now.
Max Khon [Fri, 2 Dec 2011 09:09:54 +0000 (09:09 +0000)]
Revert to conservative defaults. WITH_PROFILE is a default now.

NO_PROFILE overrides in Makefile.inc1 and bsd.own.m are left intact
so that the reversal to the WITHOUT_PROFILE will be easier in future.

12 years agoFix checks for error return from urtw_alloc_rx_data_list() and
Kevin Lo [Fri, 2 Dec 2011 02:19:03 +0000 (02:19 +0000)]
Fix checks for error return from urtw_alloc_rx_data_list() and
urtw_alloc_tx_data_list().

12 years agoPrevent user astonishment by providing the shell option at the end, after
Nathan Whitehorn [Fri, 2 Dec 2011 02:05:26 +0000 (02:05 +0000)]
Prevent user astonishment by providing the shell option at the end, after
any installer-provided configuration files have been copied. This allows
users to edit their fstab, if desired, and to see what the installer has
placed in rc.conf.

Requested by: phk
MFC after: 1 day

12 years agoTweak the r137233 fix to r136283 -- Code was making two send() attempts
David E. O'Brien [Fri, 2 Dec 2011 01:06:33 +0000 (01:06 +0000)]
Tweak the r137233 fix to r136283 -- Code was making two send() attempts
vs. the comment documented "If we are working with a privileged socket,
then take only one attempt".  Make the code match.

Furthermore, critical privileged applications that [over] log a vast amount
can look like a DoS to this code.  Given it's unlikely the single reattempted
send() will succeeded, avoid usurping the scheduler in a library API for a
single non-critical facility in critical applications.

Obtained from: Juniper Networks
Discussed with: glebius

12 years agoAdd a screen that asks if the user would like to enable crash dumps,
Ken Smith [Fri, 2 Dec 2011 00:38:47 +0000 (00:38 +0000)]
Add a screen that asks if the user would like to enable crash dumps,
giving them a very brief description of the trade-offs.  Whether the
user opts in or out add an entry to what will become /etc/rc.conf
explaining what dumpdev is and how to turn on/off crash dumps.  The folks
who handle interacting with users submitting PRs have asked for this.

Reviewed by: nwhitehorn
MFC after: 1 day