]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoDisallow various debug.kdb sysctl's when securelevel is raised.
obrien [Tue, 13 Dec 2011 17:59:16 +0000 (17:59 +0000)]
Disallow various debug.kdb sysctl's when securelevel is raised.

PR: 161350

12 years agoAdd support for __COUNTER__.
ed [Tue, 13 Dec 2011 17:34:47 +0000 (17:34 +0000)]
Add support for __COUNTER__.

__COUNTER__ allows one to obtain incrementing (read: unique) numbers
from the C preprocesor. This is useful when implementing things like a
robust implementation of CTASSERT(), which currently fails when using
it more than once on a single line of code. Probably not likely to cause
any breakage, but still.

__COUNTER__ was also added to GCC 4.3, but since that implementation is
GPLv3 licensed, I took the liberty of implementing it without looking at
any upstream sources. Therefore, this version is licensed under the same
license as the rest of the code; GPLv2.

12 years agoDon't use __P().
ed [Tue, 13 Dec 2011 14:53:26 +0000 (14:53 +0000)]
Don't use __P().

The rest of the file doesn't use it either and according to style(9), it
should not be used.

12 years agoAdd compatibility support for specifing IPv4 aliases in
glebius [Tue, 13 Dec 2011 14:36:04 +0000 (14:36 +0000)]
Add compatibility support for specifing IPv4 aliases in
rc.conf without the "inet" keyword.

Obtained from: hrs

12 years agoReplace `inline static' by `static inline'.
ed [Tue, 13 Dec 2011 14:06:01 +0000 (14:06 +0000)]
Replace `inline static' by `static inline'.

If I interpret the C standard correctly, the storage specifier should be
placed before the inline keyword. While at it, replace __inline by
inline in the files affected.

12 years ago- Add a sysctl to allow non-root users the ability to set idle
eadler [Tue, 13 Dec 2011 14:00:27 +0000 (14:00 +0000)]
- Add a sysctl to allow non-root users the ability to set idle
priorities.

- While here fix up some style nits.

Discussed with: cperciva (breifly)
Reviewed by: pjd (earlier version)
Reviewed by: bde
Approved by: jhb
MFC after: 1 month

12 years agoReplace __signed by signed.
ed [Tue, 13 Dec 2011 13:38:03 +0000 (13:38 +0000)]
Replace __signed by signed.

The signed keyword is an integral part of the C syntax. There's no need
to use __signed.

12 years agoReplace __const by const in all non-contributed source code.
ed [Tue, 13 Dec 2011 13:32:56 +0000 (13:32 +0000)]
Replace __const by const in all non-contributed source code.

As C1X is close to being released, there is no need to wrap around a
feature that is already part of C90. Most of these files already use
`const' in different placed as well.

12 years agodhclient-script relied on incorrect behavior of SIOCAIFADDR ioctl,
glebius [Tue, 13 Dec 2011 11:54:51 +0000 (11:54 +0000)]
dhclient-script relied on incorrect behavior of SIOCAIFADDR ioctl,
that changed 0.0.0.0/0.0.0.0 prefix to 0.0.0.0/255.0.0.0.

In the r228313 this behavior was fixed, and since dhclient-script
got broken.

I'm not sure this fix is a perfect one, it just changes
dhclient-script to set 0.0.0.0/255.0.0.0 explicitly.

PR: kern/163206

12 years ago - Fix different variable types use in different files after r121184,
mav [Tue, 13 Dec 2011 11:13:28 +0000 (11:13 +0000)]
 - Fix different variable types use in different files after r121184,
causing problems on amd64.
 - s/%lud/%lu/.

MFC after: 1 month

12 years agoFix few bugs in isp(4) target mode support:
mav [Tue, 13 Dec 2011 09:58:05 +0000 (09:58 +0000)]
Fix few bugs in isp(4) target mode support:
 - in destroy_lun_state() assert hold == 1 instead of 0, as it should
receive hold taken by the create_lun_state() or get_lun_statep() before;
 - fix hold count leak inside rls_lun_statep() that also fired above assert;
 - in destroy_lun_state() use SIM bus number instead of SIM path id for
ISP_GET_PC_ADDR(), as it was before r196008;
 - make isp_disable_lun() to set status in CCB;
 - make isp_target_mark_aborted() set status into the proper CCB.

Reviewed by: mjacob
Sponsored by: iXsystems, inc.
MFC after: 1 month

12 years agoStaticify dumpfs.
ed [Tue, 13 Dec 2011 09:01:44 +0000 (09:01 +0000)]
Staticify dumpfs.

This tool only consists of a single C file, so we can simply mark
everything except main() static. This seems to shave off about 8% of the
binary size.

12 years agoThe "inet" keyword in the "ifconfig_IF_aliasN" is mandatory for
ru [Tue, 13 Dec 2011 08:23:03 +0000 (08:23 +0000)]
The "inet" keyword in the "ifconfig_IF_aliasN" is mandatory for
IPv4 aliases to work since network.subr@197139.

MFC after: 3 days

12 years agoSome cleanup of BOOTP code. Initially I wanted to just change the ifioctl()
glebius [Tue, 13 Dec 2011 07:02:48 +0000 (07:02 +0000)]
Some cleanup of BOOTP code. Initially I wanted to just change the ifioctl()
usage, but end up with more changes.

- Use SIOCAIFADDR instead of old rusty SIOCSIFADDR, SIOCSIFBRDADDR
  and SIOCSIFNETMASK.
- Use queue(9) instead of hand made stailq.
- Use one socket for all ifioctl() and send/receive operations.
- Use __func__ instead of cut-n-paste in logging and panics.
- Axe some dead or strange code.

Tested by: gonzo, Stefan Bethke <stb lassitu.de>

12 years agoBelatedly catch up with r151555. in_scrubprefix() also needs this fix. We
glebius [Tue, 13 Dec 2011 06:56:43 +0000 (06:56 +0000)]
Belatedly catch up with r151555. in_scrubprefix() also needs this fix. We
should compare not only addresses, but their masks, too, when searching
for matching prefix.

12 years agoStyle(9) changes.
adrian [Tue, 13 Dec 2011 05:13:51 +0000 (05:13 +0000)]
Style(9) changes.

12 years agoDocument a large number of currently undocumented sysctls. While here
eadler [Tue, 13 Dec 2011 00:38:50 +0000 (00:38 +0000)]
Document a large number of currently undocumented sysctls. While here
fix some style(9) issues and reduce redundancy.

PR: kern/155491
PR: kern/155490
PR: kern/155489
Submitted by: Galimov Albert <wtfcrap@mail.ru>
Approved by: bde
Reviewed by: jhb
MFC after: 1 week

12 years agoRevert the approach for skipping lockstat_probe_func call when doing
attilio [Mon, 12 Dec 2011 23:29:32 +0000 (23:29 +0000)]
Revert the approach for skipping lockstat_probe_func call when doing
lock_success/lock_failure, introduced in r228424, by directly skipping
in dtrace_probe.

This mainly helps in avoiding namespace pollution and thus lockstat.h
dependency by systm.h.

As an added bonus, this also helps in MFC case.
Reviewed by: avg
MFC after: 3 months (or never)
X-MFC: r228424

12 years agoMake 64-bit procstat output ELF auxiliary vectors for 32-bit processes.
trociny [Mon, 12 Dec 2011 22:01:33 +0000 (22:01 +0000)]
Make 64-bit procstat output ELF auxiliary vectors for 32-bit processes.

Reviewed by: kib
MFC after: 1 week

12 years agoMake procstat -l output similar to the output of limits(1).
trociny [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
eadler [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
mdf [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.
mdf [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.
mdf [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:
mdf [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:
mdf [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
fabient [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 [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).
fabient [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
kib [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,
kib [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
avg [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.
kib [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.
fabient [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
avg [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
avg [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 [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
avg [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 [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 [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).
gjb [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
gjb [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 [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 [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...
jfv [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
nwhitehorn [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
nwhitehorn [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.
trociny [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
dim [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 [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 [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 [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.
jfv [Sun, 11 Dec 2011 09:37:25 +0000 (09:37 +0000)]
Correct LINT build issues in the ioctl code.

12 years ago- fix typo
eadler [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
alc [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 [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 [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 [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 [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.
jfv [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
pjd [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
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.
jfv [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
jfv [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
des [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.
dim [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.
yongari [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 [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
dim [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.
kib [Fri, 9 Dec 2011 20:41:54 +0000 (20:41 +0000)]
Typo.

MFC after: 3 days

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

MFC after: 3 days

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

12 years ago- Add a test for PR 151758.
jhb [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).
yongari [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
yongari [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
yongari [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 agoThe vfs.zfs.txg.timeout sysctl can be safely modified at run time.
pjd [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
yongari [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
jhb [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
pho [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.
jh [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.
jh [Fri, 9 Dec 2011 13:15:19 +0000 (13:15 +0000)]
- Fix markup.
- Remove trailing whitespace.

12 years agoUpdate du(1):
gjb [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
gjb [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..
pfg [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).
mm [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).
ru [Thu, 8 Dec 2011 13:54:06 +0000 (13:54 +0000)]
Pull up vendor changes to mdoc(7).

12 years agoMake berase() work on platforms whose kernel lacks DIOCGDELETE ioctl.
rmh [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
eadler [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
eadler [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()
eadler [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
yongari [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
yongari [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.
yongari [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
yongari [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.
yongari [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
theraven [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)
theraven [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
dim [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
yongari [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.