]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoMake procstat -l output similar to the output of limits(1).
Mikolaj Golub [Mon, 12 Dec 2011 21:41:05 +0000 (21:41 +0000)]
Make procstat -l output similar to the output of limits(1).

Suggested by: jhb
MFC after: 1 week

12 years ago- Add support for ASCII art splash screens in TheDraw format
Eitan Adler [Mon, 12 Dec 2011 21:12:07 +0000 (21:12 +0000)]
- Add support for ASCII art splash screens in TheDraw format

PR: kern/143370
Submitted by: Antony Mawer <antony@mawer.org>
Reviewed by: gjb (doc)
Reviewed by: des (style)
Approved by: ed
MFC after: 1 month

12 years ago - Define true and false in sys/types.h for _KERNEL consumers, and
Matthew D Fleming [Mon, 12 Dec 2011 18:44:17 +0000 (18:44 +0000)]
 - Define true and false in sys/types.h for _KERNEL consumers, and
   typedef bool.  Due to macro expansion it seemed better to use a
   typedef for kernel consumers (specifically ofed won't compile
   without more changes if a define is used).
 - <stdbool.h> should also not re-define bool/true/false if they are
   defined by <sys/types.h>.  It would probably be a programming error
   to define _KERNEL for user-space code, but downstream consumers
   like Isilon have already been including <stdbool.h> in kernel
   sources, and this protects that usage.
 - sizeof(_Bool) is not necessarily the same as sizeof(int), so kernel
   modules should be rebuild with this change.  Bump __FreeBSD_version.

MFC after: 2 weeks
Sponsored by: Isilon Systems, LLC

12 years agoDo not define bool/true/false if the symbols already exist.
Matthew D Fleming [Mon, 12 Dec 2011 18:43:24 +0000 (18:43 +0000)]
Do not define bool/true/false if the symbols already exist.

MFC after: 2 weeks
Sponsored by: Isilon Systems, LLC

12 years agoDo not use the sometimes-reserved work 'bool' for a variable name.
Matthew D Fleming [Mon, 12 Dec 2011 18:43:18 +0000 (18:43 +0000)]
Do not use the sometimes-reserved work 'bool' for a variable name.

MFC after: 2 weeks
Sponsored by: Isilon Systems, LLC

12 years agoConsistently use types in e1000 driver code:
Matthew D Fleming [Mon, 12 Dec 2011 18:27:34 +0000 (18:27 +0000)]
Consistently use types in e1000 driver code:

 - Two struct members eee_disable are used in a function that expects
   an int *, so declare them int, not bool.
 - igb_tx_ctx_setup() returns a boolean value, so declare it bool, not int.
 - igb_header_split is passed to TUNABLE_INT, so delcare it int, not bool.
 - igb_tso_setup() returns a bool, so declare it bool, not boolean_t.
 - Do not re-define bool/true/false if the symbols already exist.

MFC after: 2 weeks
Sponsored by: Isilon Systems, LLC

12 years agoConsistently use types in ixgbe driver code:
Matthew D Fleming [Mon, 12 Dec 2011 18:27:28 +0000 (18:27 +0000)]
Consistently use types in ixgbe driver code:

 - {ixgbe,ixv}_header_split is passed to TUNABLE_INT, so delcare it
   int, not bool.
 - {ixgbe,ixv}_tx_ctx_setup() returns a boolean value, so declare it
   bool, not int.
 - {ixgbe,ixv}_tso_setup() returns a bool, so declare it bool, not boolean_t.
 - {ixgbe,ixv}_txeof() returns a bool, so declare it bool, not boolean_t.
 - Do not re-define bool if the symbol already exists.

MFC after: 2 weeks
Sponsored by: Isilon Systems, LLC

12 years agoThere's a small set of events on Nehalem, that are not supported in
Fabien Thomas [Mon, 12 Dec 2011 13:12:55 +0000 (13:12 +0000)]
There's a small set of events on Nehalem, that are not supported in
processors with CPUID signature 06_1AH, 06_1EH, and 06_1FH.

Refuse to allocate them on unsupported model.

Submitted by: Davide Italiano <davide.italiano@gmail.com>
MFC after: 1 month

12 years agoAdd missing static and const keywords to kbdcontrol.
Ed Schouten [Mon, 12 Dec 2011 12:33:38 +0000 (12:33 +0000)]
Add missing static and const keywords to kbdcontrol.

None of the symbols provided by kbdcontrol.c are used by other source
files of this binary. Slightly reduce the binary size and make much more
symbols read-only by adding proper static and const keywords.

12 years agoAdd VIA microde update support to cpuctl(4) and cpucontrol(8).
Fabien Thomas [Mon, 12 Dec 2011 12:30:44 +0000 (12:30 +0000)]
Add VIA microde update support to cpuctl(4) and cpucontrol(8).

Support have been tested with X2 CPU and QuadCore CPU.

MFC after: 1 month

12 years agoAdd support for STT_GNU_IFUNC and R_MACHINE_IRELATIVE GNU extensions to
Konstantin Belousov [Mon, 12 Dec 2011 11:03:14 +0000 (11:03 +0000)]
Add support for STT_GNU_IFUNC and R_MACHINE_IRELATIVE GNU extensions to
rtld on 386 and amd64. This adds runtime bits neccessary for the use
of the dispatch functions from the dynamically-linked executables and
shared libraries.

To allow use of external references from the dispatch function, resolution
of the R_MACHINE_IRESOLVE relocations in PLT is postponed until GOT entries
for PLT are prepared, and normal resolution of the GOT entries is finished.
Similar to how it is done by GNU, IRELATIVE relocations are resolved in
advance, instead of normal lazy handling for PLT.

Move the init_pltgot() call before the relocations for the object are
processed.

MFC after: 3 weeks

12 years agoAdd definitions for GNU-specific STT_GNU_IFUNC symbol type,
Konstantin Belousov [Mon, 12 Dec 2011 10:10:49 +0000 (10:10 +0000)]
Add definitions for GNU-specific STT_GNU_IFUNC symbol type,
and R_{386,X86_64}_IRELATIVE relocations.

MFC after: 3 weeks

12 years agoput sys/systm.h at its proper place or add it if missing
Andriy Gapon [Mon, 12 Dec 2011 10:05:13 +0000 (10:05 +0000)]
put sys/systm.h at its proper place or add it if missing

Reported by: lstewart, tinderbox
Pointyhat to: avg, attilio
MFC after: 1 week
MFC with: r228430

12 years agoFix printf.
Konstantin Belousov [Mon, 12 Dec 2011 10:04:04 +0000 (10:04 +0000)]
Fix printf.

Submitted by: az
MFC after: 1 week

12 years agoAdd watchdog support for VIA south bridge chipset.
Fabien Thomas [Mon, 12 Dec 2011 09:50:33 +0000 (09:50 +0000)]
Add watchdog support for VIA south bridge chipset.
Tested on VT8251, VX900 but CX700, VX800, VX855 should works.

MFC after: 1 month
Sponsored by: NETASQ

12 years agokern_racct: move sys/systm.h inclusion to its proper place
Andriy Gapon [Mon, 12 Dec 2011 07:46:10 +0000 (07:46 +0000)]
kern_racct: move sys/systm.h inclusion to its proper place

This should fix the build failure introduced with r228424.
Also remove duplicate inclusion of sys/param.h.

Pointyhat to: avg
MFC after: 1 week

12 years agosyscons: make sc_puts static as it is used only privately
Andriy Gapon [Sun, 11 Dec 2011 21:10:11 +0000 (21:10 +0000)]
syscons: make sc_puts static as it is used only privately

Perhaps sc_puts should also be renamed to scputs to follow the implied
naming conventions in the file...

MFC after: 2 weeks

12 years agoAdd static keywords to vidcontrol(1).
Ed Schouten [Sun, 11 Dec 2011 21:02:33 +0000 (21:02 +0000)]
Add static keywords to vidcontrol(1).

While there, remove the false optimisation of the colors array. It seems
that changing it to an array of pointers instead of a 16x16 array does
not cause any increase in binary size at all.

12 years agopanic: add a switch and infrastructure for stopping other CPUs in SMP case
Andriy Gapon [Sun, 11 Dec 2011 21:02:01 +0000 (21:02 +0000)]
panic: add a switch and infrastructure for stopping other CPUs in SMP case

Historical behavior of letting other CPUs merily go on is a default for
time being.  The new behavior can be switched on via
kern.stop_scheduler_on_panic tunable and sysctl.

Stopping of the CPUs has (at least) the following benefits:
- more of the system state at panic time is preserved intact
- threads and interrupts do not interfere with dumping of the system
  state

Only one thread runs uninterrupted after panic if stop_scheduler_on_panic
is set.  That thread might call code that is also used in normal context
and that code might use locks to prevent concurrent execution of certain
parts.  Those locks might be held by the stopped threads and would never
be released.  To work around this issue, it was decided that instead of
explicit checks for panic context, we would rather put those checks
inside the locking primitives.

This change has substantial portions written and re-written by attilio
and kib at various times.  Other changes are heavily based on the ideas
and patches submitted by jhb and mdf.  bde has provided many insights
into the details and history of the current code.

The new behavior may cause problems for systems that use a USB keyboard
for interfacing with system console.  This is because of some unusual
locking patterns in the ukbd code which have to be used because on one
hand ukbd is below syscons, but on the other hand it has to interface
with other usb code that uses regular mutexes/Giant for its concurrency
protection.  Dumping to USB-connected disks may also be affected.

PR: amd64/139614 (at least)
In cooperation with: attilio, jhb, kib, mdf
Discussed with: arch@, bde
Tested by: Eugene Grosbein <eugen@grosbein.net>,
gnn,
Steven Hartland <killing@multiplay.co.uk>,
glebius,
Andrew Boyer <aboyer@averesystems.com>
(various versions of the patch)
MFC after: 3 months (or never)

12 years agoAdd static keywords to chio(1).
Ed Schouten [Sun, 11 Dec 2011 20:53:12 +0000 (20:53 +0000)]
Add static keywords to chio(1).

All other global variables are already marked static, so for consistency
sake, add them to these three arrays as well.

12 years agoAdd more static keywords to rcorder(8).
Ed Schouten [Sun, 11 Dec 2011 20:48:40 +0000 (20:48 +0000)]
Add more static keywords to rcorder(8).

The global variables and functions provided by rcorder.c are not used in
the other C files, as the other C files only provide memory allocation
and hash functions. This reduces the binary size by 10%.

12 years agoMinor whitespace cleanup to make.conf(5).
Glen Barber [Sun, 11 Dec 2011 20:01:37 +0000 (20:01 +0000)]
Minor whitespace cleanup to make.conf(5).

MFC after: 1 week
X-MFC-With: 228418

12 years agoDocument the SVN variable needs to be set in make.conf(5) when SVN_UPDATE
Glen Barber [Sun, 11 Dec 2011 19:53:11 +0000 (19:53 +0000)]
Document the SVN variable needs to be set in make.conf(5) when SVN_UPDATE
is set.

PR: 163162
Submitted by: Oliver Hartmann <ohartman!zedat.fu-berlin.de>
Patch by: Benjamin Kaduk <kaduk!mit.edu> (original)
MFC after: 1 week

12 years agoAdd missing static keyword.
Ed Schouten [Sun, 11 Dec 2011 19:28:04 +0000 (19:28 +0000)]
Add missing static keyword.

All global variables and functions are marked static. Simply because
this is an enum, doesn't mean we can't do so as well.

12 years agoAdd missing static keyword.
Ed Schouten [Sun, 11 Dec 2011 19:22:42 +0000 (19:22 +0000)]
Add missing static keyword.

All global variables and functions in powerd are marked static, except
this array of strings. Add the keyword, for consistency.

12 years agoLast change still had an issue, one more time...
Jack F Vogel [Sun, 11 Dec 2011 18:46:14 +0000 (18:46 +0000)]
Last change still had an issue, one more time...

12 years agoIncrease the available virtual address space for user programs on PowerPC
Nathan Whitehorn [Sun, 11 Dec 2011 17:23:03 +0000 (17:23 +0000)]
Increase the available virtual address space for user programs on PowerPC
AIM systems to 4 GB on 32-bit systems and 2^64 bytes on 64-bit systems.
VM_MAXUSER_ADDRESS remains at 2 GB on pending Book-E, pending review of
an increase to 3 GB by those more familiar with Book-E.

12 years agoKeep track of PVO entries in each pmap, which allows much faster
Nathan Whitehorn [Sun, 11 Dec 2011 17:19:48 +0000 (17:19 +0000)]
Keep track of PVO entries in each pmap, which allows much faster
pmap_remove() for large sparse requests. This can prevent pmap_remove()
operations on 64-bit process destruction or swapout that would take
several hundred times the lifetime of the universe to complete. This
behavior is largely indistinguishable from a hang.

12 years agoInclude sys/queue.h: snmpmod.h uses TAILQ.
Mikolaj Golub [Sun, 11 Dec 2011 17:10:33 +0000 (17:10 +0000)]
Include sys/queue.h: snmpmod.h uses TAILQ.

PR: bin/153153
MFC after: 2 weeks

12 years agoAdd more files to cleanup with 'make delete-old' when WITHOUT_CLANG is
Dimitry Andric [Sun, 11 Dec 2011 14:01:11 +0000 (14:01 +0000)]
Add more files to cleanup with 'make delete-old' when WITHOUT_CLANG is
in effect.

MFC after: 1 week

12 years agoLet reboot(8) use getprogname() to compare the program name.
Ed Schouten [Sun, 11 Dec 2011 11:42:44 +0000 (11:42 +0000)]
Let reboot(8) use getprogname() to compare the program name.

While there, mark the global variable dohalt static, as reboot(8) only
consists of a single C file.

12 years agoAdd missing static keywords to global variables in camcontrol.
Ed Schouten [Sun, 11 Dec 2011 11:38:50 +0000 (11:38 +0000)]
Add missing static keywords to global variables in camcontrol.

While there, make the vendor list const and add appropriate keywords to
functions that use this list.

12 years agoMove 3.5 KB from the data segment to the text segment.
Ed Schouten [Sun, 11 Dec 2011 09:56:48 +0000 (09:56 +0000)]
Move 3.5 KB from the data segment to the text segment.

The `struct modes' are only used by the getter-functions in the same
file, so we can safely mark them static and const.

12 years agoCorrect LINT build issues in the ioctl code.
Jack F Vogel [Sun, 11 Dec 2011 09:37:25 +0000 (09:37 +0000)]
Correct LINT build issues in the ioctl code.

12 years ago- fix typo
Eitan Adler [Sat, 10 Dec 2011 21:05:06 +0000 (21:05 +0000)]
- fix typo

Approved by: kib@

12 years agoAvoid the possibility of integer overflow in the calculation of
Alan Cox [Sat, 10 Dec 2011 18:42:00 +0000 (18:42 +0000)]
Avoid the possibility of integer overflow in the calculation of
VM_KMEM_SIZE_MAX.  Specifically, if the user/kernel address space split
was changed such that the kernel address space was greater than or equal
to 2 GB, then overflow would occur.

PR: 161721
MFC after: 3 weeks

12 years agoMake comsat(8) approximately 15% smaller.
Ed Schouten [Sat, 10 Dec 2011 18:35:26 +0000 (18:35 +0000)]
Make comsat(8) approximately 15% smaller.

This program only consists of a single C file, so simply mark everything
except main() static.

12 years agoAdd more static keywords to truss(1) source code.
Ed Schouten [Sat, 10 Dec 2011 18:27:55 +0000 (18:27 +0000)]
Add more static keywords to truss(1) source code.

There are some tables in the source code that are only used by the
individual source files themselves. Therefore there is no need to export
them.

12 years agoAdd missing "static const" to long options table.
Ed Schouten [Sat, 10 Dec 2011 18:21:03 +0000 (18:21 +0000)]
Add missing "static const" to long options table.

This table is only used in this C file and passed to getopt_long(), so
we can safely add static and const to it.

12 years agoReplace char copyright[] by static const char copyright[].
Ed Schouten [Sat, 10 Dec 2011 18:11:06 +0000 (18:11 +0000)]
Replace char copyright[] by static const char copyright[].

It seems the latter is used throughout the tree.

12 years agoFix NETMAP code problem in the build.
Jack F Vogel [Sat, 10 Dec 2011 18:00:53 +0000 (18:00 +0000)]
Fix NETMAP code problem in the build.

12 years agoMove ru_inblock increment into arc_read_nolock() so we don't account for
Pawel Jakub Dawidek [Sat, 10 Dec 2011 13:02:52 +0000 (13:02 +0000)]
Move ru_inblock increment into arc_read_nolock() so we don't account for
cached reads.

Discussed with: gibbs
No objections from: avg
Tested by: Marcus Reid <marcus@blazingdot.com>
MFC after: 1 week

12 years agoFix a bug reported by Irene Ruengeler which resulted in not sending
Michael Tuexen [Sat, 10 Dec 2011 10:52:54 +0000 (10:52 +0000)]
Fix a bug reported by Irene Ruengeler which resulted in not sending
out HEARTBEATs when requested by the user. The HEARTBEATs were only
queued, but not actually sent out.

MFC after: 2 months.

12 years agoPart 2 of 2 New deltas for the 1G drivers.
Jack F Vogel [Sat, 10 Dec 2011 07:08:52 +0000 (07:08 +0000)]
Part 2 of 2  New deltas for the 1G drivers.

There have still been intermittent problems with apparent TX
hangs for some customers. These have been problematic to reproduce
but I believe these changes will address them. Testing on a number
of fronts have been positive.

EM: there is an important 'chicken bit' fix for 82574 in the shared
code this is supported in the core here.
    - The TX path has been tightened up to improve performance. In
      particular UDP with jumbo frames was having problems, and the
      changes here have improved that.
    - OACTIVE has been used more carefully on the theory that some
      hangs may be due to a problem in this interaction
    - Problems with the RX init code, the "lazy" allocation and
      ring initialization has been found to cause problems in some
      newer client systems, and as it really is not that big a win
      (its not in a hot path) it seems best to remove it.
    - HWTSO was broken when VLAN HWTAGGING or HWFILTER is used, I
      found this was due to an error in setting up the descriptors
      in em_xmit.

IGB:
    - TX is also improved here. With multiqueue I realized its very
      important to handle OACTIVE only under the CORE lock so there
      are no races between the queues.
    - Flow Control handling was broken in a couple ways, I have changed
      and I hope improved that in this delta.
    - UDP also had a problem in the TX path here, it was change to
      improve that.
    - On some hardware, with the driver static, a weird stray interrupt
      seems to sometimes fire and cause a panic in the RX mbuf refresh
      code. This is addressed by setting interrupts late in the init
      path, and also to set all interrupts bits off at the start of that.

12 years agoPart 1 of two parts, this is the shared code changes in
Jack F Vogel [Sat, 10 Dec 2011 06:55:02 +0000 (06:55 +0000)]
Part 1 of two parts, this is the shared code changes in
support of new deltas for both em and igb drivers.

Note that I am not able to track all the bugs fixed in
this code, I am a consumer of it as a component of my
core drivers. It is important to keep the FreeBSD drivers
up to date with it however.

One important note is there is a key fix for 82574 in this
update. Also, there are lots of white space changes, I am
not happy about them but have no control over it :)

12 years agoAdd minimal validation of the service name to fend off at least one
Dag-Erling Smørgrav [Sat, 10 Dec 2011 01:44:24 +0000 (01:44 +0000)]
Add minimal validation of the service name to fend off at least one
attack vector against applications that allow the applicant to specify
which policy to apply.

Submitted by: Matthias Drochner <drochner@netbsd.org>
MFC after: 1 week

12 years agoUse the correct upstream revision number for llvm/clang 3.0 release.
Dimitry Andric [Sat, 10 Dec 2011 01:01:44 +0000 (01:01 +0000)]
Use the correct upstream revision number for llvm/clang 3.0 release.

The r145546 revision is from branches/release_30, the r145349 revision
is from tags/RELEASE_30/final.

MFC after: 1 week

12 years agoFreeBSD driver does not require arpcom structure in softc.
Pyun YongHyeon [Fri, 9 Dec 2011 23:37:55 +0000 (23:37 +0000)]
FreeBSD driver does not require arpcom structure in softc.

12 years agoRemove the unused if_free_type() function.
Brooks Davis [Fri, 9 Dec 2011 23:26:28 +0000 (23:26 +0000)]
Remove the unused if_free_type() function.

X-MFC after: never

12 years agoUpgrade our copy of llvm/clang to 3.0 release. Release notes can be
Dimitry Andric [Fri, 9 Dec 2011 22:23:45 +0000 (22:23 +0000)]
Upgrade our copy of llvm/clang to 3.0 release.  Release notes can be
found at: http://llvm.org/releases/3.0/docs/ReleaseNotes.html

MFC after: 1 week

12 years agoTypo.
Konstantin Belousov [Fri, 9 Dec 2011 20:41:54 +0000 (20:41 +0000)]
Typo.

MFC after: 3 days

12 years agoTypo.
Konstantin Belousov [Fri, 9 Dec 2011 20:40:24 +0000 (20:40 +0000)]
Typo.

MFC after: 3 days

12 years agoAdded jimharris.
Jim Harris [Fri, 9 Dec 2011 20:23:58 +0000 (20:23 +0000)]
Added jimharris.

12 years ago- Add a test for PR 151758.
John Baldwin [Fri, 9 Dec 2011 19:24:17 +0000 (19:24 +0000)]
- Add a test for PR 151758.
- While here, make this compile and work on non-i386:
  - Use CMSG_SPACE(), CMSG_LEN(), and CMSG_FIRSTHDR() instead of ignoring
    padding between 'struct cmsghdr' and control message payloads.
  - Don't initialize the control message before calling recvmsg().
    Instead, check that we get a valid control message on return from
    recvmsg().
- Use errx() instead of err() for some errors that don't report failures
  that set errno.

Requested by: kib (1)

12 years agoAfter r228293, et(4) supports altq(4).
Pyun YongHyeon [Fri, 9 Dec 2011 19:17:51 +0000 (19:17 +0000)]
After r228293, et(4) supports altq(4).

12 years agoAnnounce flow control ability to PHY driver and enable RX flow
Pyun YongHyeon [Fri, 9 Dec 2011 19:10:38 +0000 (19:10 +0000)]
Announce flow control ability to PHY driver and enable RX flow
control.  Controller does not automatically generate pause frames
based on number of available RX buffers so it's very hard to
know when driver should generate XON frame in time.  The only
mechanism driver can detect low number of RX buffer condition is
ET_INTR_RXRING0_LOW or ET_INTR_RXRING1_LOW interrupt.  This
interrupt is generated whenever controller notices the number of
available RX buffers are lower than pre-programmed value(
ET_RX_RING0_MINCNT and ET_RX_RING1_MINCNT register).  This scheme
does not provide a way to detect when controller sees enough number
of RX buffers again such that efficient generation of XON/XOFF
frame is not easy.

While here, add more flow control related register definition.

12 years agoRemove unnecessary definition of ET_PCIR_BAR. Controller support
Pyun YongHyeon [Fri, 9 Dec 2011 18:34:45 +0000 (18:34 +0000)]
Remove unnecessary definition of ET_PCIR_BAR.  Controller support
I/O memory only.
While here, use pci_set_max_read_req(9) rather than directly
manipulating PCIe device control register.

12 years agoVendor import of clang 3.0 final release:
Dimitry Andric [Fri, 9 Dec 2011 18:30:42 +0000 (18:30 +0000)]
Vendor import of clang 3.0 final release:
http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_30/final@145349

12 years agoVendor import of llvm 3.0 final release:
Dimitry Andric [Fri, 9 Dec 2011 18:27:22 +0000 (18:27 +0000)]
Vendor import of llvm 3.0 final release:
http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_30/final@145349

12 years agoThe vfs.zfs.txg.timeout sysctl can be safely modified at run time.
Pawel Jakub Dawidek [Fri, 9 Dec 2011 18:22:57 +0000 (18:22 +0000)]
The vfs.zfs.txg.timeout sysctl can be safely modified at run time.

MFC after: 1 week

12 years agoDo not disable interrupt without knowing whether the raised
Pyun YongHyeon [Fri, 9 Dec 2011 18:17:02 +0000 (18:17 +0000)]
Do not disable interrupt without knowing whether the raised
interrupt is ours.  Note, interrupts are automatically ACKed when
the status register is read.
Add RX/TX DMA error to interrupt handler and do full controller
reset if driver happen to encounter these errors.  There is no way
to recover from these DMA errors without controller reset.
Rename local variable name intrs with status to enhance
readability.

While I'm here, rename ET_INTR_TXEOF and ET_INTR_RXEOF to
ET_INTR_TXDMA and ET_INTR_RXDMA respectively.  These interrupts
indicate that a frame is successfully DMAed to controller's
internal FIFO and they have nothing to do with EOF(end of frame).
Driver does not need to wait actual end of TX/RX of a frame(e.g.
no need to wait the end signal of TX which is generated when a
frame in TX FIFO is emptied by MAC).  Previous names were somewhat
confusing.

12 years agoExplicitly use curthread while manipulating td_fpop during last close
John Baldwin [Fri, 9 Dec 2011 17:49:34 +0000 (17:49 +0000)]
Explicitly use curthread while manipulating td_fpop during last close
of a devfs file descriptor in devfs_close_f().  The passed in td argument
may be NULL if the close was invoked by garbage collection of open
file descriptors in pending control messages in the socket buffer of a
UNIX domain socket after it was closed.

PR: kern/151758
Submitted by: Andrey Shidakov  andrey shidakov ru
Submitted by: Ruben van Staveren  ruben verweg com
Reviewed by: kib
MFC after: 2 weeks

12 years agoMove cpu_set_upcall(newtd, td) up before the first call of
Peter Holm [Fri, 9 Dec 2011 17:19:41 +0000 (17:19 +0000)]
Move cpu_set_upcall(newtd, td) up before the first call of
thread_free(newtd).  This to avoid a possible page fault in
cpu_thread_clean() as seen on amd64 with syscall fuzzing.

Reviewed by: kib
MFC after: 1 week

12 years agosbuf_data() hasn't returned NULL for overflowed buffers since r71721.
Jaakko Heinonen [Fri, 9 Dec 2011 13:28:41 +0000 (13:28 +0000)]
sbuf_data() hasn't returned NULL for overflowed buffers since r71721.

12 years ago- Fix markup.
Jaakko Heinonen [Fri, 9 Dec 2011 13:15:19 +0000 (13:15 +0000)]
- Fix markup.
- Remove trailing whitespace.

12 years agoUpdate du(1):
Glen Barber [Fri, 9 Dec 2011 02:30:56 +0000 (02:30 +0000)]
Update du(1):

- Sort arguments alphabetically where appropriate
- '-B blocksize' is not mutually exclusive of '-h|-k|-m'
- Mention '-t' in synopsis
- Other wording improvements
- Update usage() output to reflect the new synopsis [1]
- Other miscellaneous improvements

PR: 162438
Submitted by: arundel
Reviewed by: Benjamin Kaduk (kaduk ! mit.edu), jhb[1] (original version)
MFC after: 1 week

12 years agoAs of r226865, daily_scrub_zfs_default_threshold is 35 days; document
Glen Barber [Thu, 8 Dec 2011 23:58:26 +0000 (23:58 +0000)]
As of r226865, daily_scrub_zfs_default_threshold is 35 days; document
accordingly.

PR: 162890
Submitted by: Oliver Hartmann (ohartman ! mail.zedat.fu-berlin.de)
Patch by: Niclas Zeising (niclas.zeising ! gmail.com)
MFC after: 1 week
X-Need-MFC: r226865

12 years agoAdd myself as new committer: add PGP key and announce..
Pedro F. Giffuni [Thu, 8 Dec 2011 22:33:37 +0000 (22:33 +0000)]
Add myself as new committer: add PGP key and announce..

Approved by: jhb (mentor)

12 years agoSome mdoc(7) style and typo fixes to zfs(8).
Martin Matuska [Thu, 8 Dec 2011 19:38:42 +0000 (19:38 +0000)]
Some mdoc(7) style and typo fixes to zfs(8).

Submitted by: Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
MFC after: 3 days

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