]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 years agoWith the fdc control device disappearing some 5 years ago, it is no
joerg [Wed, 24 Jun 2009 19:30:31 +0000 (19:30 +0000)]
With the fdc control device disappearing some 5 years ago, it is no
longer useful for the FD_STYPE and FD_SOPTS ioctls to insist on being
issued on a writable file descriptor.  Otherwise, there's no longer a
chance to set the drive type or options when a read-only medium is
present in the drive, as there is no way to obtain a writable fd then.

15 years agoDocument new hint.atapci.X.msi and hint.ata.X.pm_level tunables.
mav [Wed, 24 Jun 2009 19:25:47 +0000 (19:25 +0000)]
Document new hint.atapci.X.msi and hint.ata.X.pm_level tunables.

15 years agoWhitespace fix.
jhb [Wed, 24 Jun 2009 19:16:48 +0000 (19:16 +0000)]
Whitespace fix.

15 years agoRevert the part of r194763 which added a dying flag and instead
marius [Wed, 24 Jun 2009 19:04:08 +0000 (19:04 +0000)]
Revert the part of r194763 which added a dying flag and instead
call ether_ifdetach(9) before stopping the controller and the
callouts. The consensus is that the latter is now safe to do and
should also solve the problem of active BPF listeners clearing
promiscuous mode can result in the tick callout being restarted
which in turn will trigger a panic once it's actually gone.

15 years ago- Similar to the previous commit, but for CURRENT: Fix a bug where a FIFO vnode
lulf [Wed, 24 Jun 2009 18:44:38 +0000 (18:44 +0000)]
- Similar to the previous commit, but for CURRENT: Fix a bug where a FIFO vnode
  use count was increased twice, but only decreased once.

15 years agoDon't use sys/nfs/rpcv2.h - it is part of the old kernel RPC implementation
dfr [Wed, 24 Jun 2009 18:42:21 +0000 (18:42 +0000)]
Don't use sys/nfs/rpcv2.h - it is part of the old kernel RPC implementation
and will be removed.

15 years ago- Fix a bug where a FIFO vnode use count was increased twice, but only
lulf [Wed, 24 Jun 2009 18:38:51 +0000 (18:38 +0000)]
- Fix a bug where a FIFO vnode use count was increased twice, but only
  decreased once.

MFC after: 1 week

15 years agoIf the initial attempt to refresh credentials in the RPCSEC_GSS client
rmacklem [Wed, 24 Jun 2009 18:30:14 +0000 (18:30 +0000)]
If the initial attempt to refresh credentials in the RPCSEC_GSS client
side fails, the entry in the cache is left with no valid context
(gd_ctx == GSS_C_NO_CONTEXT). As such, subsequent hits on the cache
will result in persistent authentication failure, even after the user has
done a kinit or similar and acquired a new valid TGT. This patch adds a test
for that case upon a cache hit and calls rpc_gss_init() to make another
attempt at getting valid credentials. It also moves the setting of gc_proc
to before the import of the principal name to ensure that, if that case
fails, it will be detected as a failure after going to "out:".

Reviewed by: dfr
Approved by: kib (mentor)

15 years agoUpdate for the Intel 10G driver, this adds support for
jfv [Wed, 24 Jun 2009 18:27:07 +0000 (18:27 +0000)]
Update for the Intel 10G driver, this adds support for
newest hardware, adds multiqueue tx interface, infrastructure
cleanup to allow up to 32 MSIX vectors on newer Nehalem systems.
Bug fixes, etc.

15 years agoadd a link named athpeek since my fingers keep typing it
sam [Wed, 24 Jun 2009 18:24:37 +0000 (18:24 +0000)]
add a link named athpeek since my fingers keep typing it

15 years agoread back the written value and display
sam [Wed, 24 Jun 2009 18:24:20 +0000 (18:24 +0000)]
read back the written value and display

15 years agoAdd the "vnet" and "-vnet" options, to allow moving interfaces between
jamie [Wed, 24 Jun 2009 18:21:37 +0000 (18:21 +0000)]
Add the "vnet" and "-vnet" options, to allow moving interfaces between
jails with VIMAGE.

Approved by: bz (mentor)

15 years agoAdd libjail, a (somewhat) simpler interface to the jail_set and jail_get
jamie [Wed, 24 Jun 2009 18:19:55 +0000 (18:19 +0000)]
Add libjail, a (somewhat) simpler interface to the jail_set and jail_get
system calls and the security.jail.param sysctls.

Approved by: bz (mentor)

15 years agoAdd libjail, a (somewhat) simpler interface to the jail_set and jail_get
jamie [Wed, 24 Jun 2009 18:18:35 +0000 (18:18 +0000)]
Add libjail, a (somewhat) simpler interface to the jail_set and jail_get
system calls and the security.jail.param sysctls.

Approved by: bz (mentor)

15 years agoUpdates for both the em and igb drivers, add support
jfv [Wed, 24 Jun 2009 17:41:29 +0000 (17:41 +0000)]
Updates for both the em and igb drivers, add support
for multiqueue tx, shared code updates, new device
support, and some bug fixes.

15 years agoRemove usb. The need to have core@ approve major changes to usb has
imp [Wed, 24 Jun 2009 17:23:10 +0000 (17:23 +0000)]
Remove usb.  The need to have core@ approve major changes to usb has
passed now that the new usb stack is in the tree.  The coordination
issues that necessitated this entry are now OBE.

Approved by: core (rwatson)

15 years agoSome DMA related changes:
mav [Wed, 24 Jun 2009 17:03:06 +0000 (17:03 +0000)]
Some DMA related changes:
 - honor parent DMA tag limitations, as man page requires,
 - allow data buffer to be allocated within full 64bit address range, when
   support is announced by hardware,
 - add quirk, disabling 64bit addresses for broken chips, use it for MCP78.

15 years agoMove programming info from usb(4) to usbdi(9) and update for the usb stack
thompsa [Wed, 24 Jun 2009 17:01:17 +0000 (17:01 +0000)]
Move programming info from usb(4) to usbdi(9) and update for the usb stack
changeover. Needs much more content still.

15 years agoFix end-of-line issues that can come up when `lpq' reads information
gad [Wed, 24 Jun 2009 16:57:33 +0000 (16:57 +0000)]
Fix end-of-line issues that can come up when `lpq' reads information
about a queue from a remote host.  That remote host may use \r, \r\n,
or \n\r as the line-ending character.  In some cases the remote host
will write a single line of information without *any* EOL sequence.

Translate all the non-unix EOL's to the standard newline, and make
sure the final line includes a terminating newline.  Logic is also
added to translate all unprintable characters to '?', but that is
#if-ed out for now.

PR: bin/104731
MFC after: 3 weeks

15 years agoUnbreak sparc64 after the swap accounting changes: mark kernel_map
kib [Wed, 24 Jun 2009 16:52:30 +0000 (16:52 +0000)]
Unbreak sparc64 after the swap accounting changes: mark kernel_map
entries allocated for translations in pmap_init() as MAP_NOFAULT. This
prevents vm_map_insert from trying to account the entries for swap
usage, that is both wrong and too early to work.

While there, change FALSE to VMFS_NO_SPACE.

Reported and tested by: Florian Smeets <flo at kasimir com>
Reviewed by: marius

15 years agoRework locking and reference counting in ipx_control to be consistent with
rwatson [Wed, 24 Jun 2009 16:52:23 +0000 (16:52 +0000)]
Rework locking and reference counting in ipx_control to be consistent with
the model used in in_control().

MFC after: 6 weeks

15 years agofw_state ad cur_state are holding unsigned bitfields, so declare then
scottl [Wed, 24 Jun 2009 16:11:29 +0000 (16:11 +0000)]
fw_state ad cur_state are holding unsigned bitfields, so declare then
as unsigned as well.

Submitted by: rdivacky

15 years agodtrace/amd64: fix virtual address checks
avg [Wed, 24 Jun 2009 16:03:57 +0000 (16:03 +0000)]
dtrace/amd64: fix virtual address checks

On amd64 KERNBASE/kernbase does not mean start of kernel memory.
This should fix a KASSERT panic in dtrace_copycheck when copyin*()
is used in D program.
Also make checks for user memory a bit stricter.

Reported by: Thomas Backman <serenity@exscape.org>
Submitted by: wxs (kaddr part)
Tested by: Thomas Backman (prototype), wxs
Reviewed by: alc (concept), jhb, current@
Aprroved by: jb (concept)
MFC after: 2 weeks
PR: kern/134408

15 years agoMore precise description of the DS1553 driver.
raj [Wed, 24 Jun 2009 15:48:20 +0000 (15:48 +0000)]
More precise description of the DS1553 driver.

Pointed out by: stas

15 years agoIntroduce ata(4) support for Marvell integrated SATA controllers (found on
raj [Wed, 24 Jun 2009 15:41:18 +0000 (15:41 +0000)]
Introduce ata(4) support for Marvell integrated SATA controllers (found on
88F5xxx, 88F6xxx and MV78xxx system on chip devices).

Reviewed by: stas
Obtained from: Semihalf

15 years agoMove non-PCI prototypes from ata-pci.h -> ata-all.h.
raj [Wed, 24 Jun 2009 15:38:17 +0000 (15:38 +0000)]
Move non-PCI prototypes from ata-pci.h -> ata-all.h.

This removes unnecessary PCI #includes dependency for systems with ATA
controllers living at non-PCI buses.

Submitted by: Piotr Ziecik
Obtained from: Semihalf

15 years agoClean up struct prison, with the recent fields in more logical places,
jamie [Wed, 24 Jun 2009 15:32:57 +0000 (15:32 +0000)]
Clean up struct prison, with the recent fields in more logical places,
and room for future expansion.

Approved by: bz (mentor)

15 years agoFix a race in vi_if_move, where a vnet is used after the prison that
jamie [Wed, 24 Jun 2009 15:29:36 +0000 (15:29 +0000)]
Fix a race in vi_if_move, where a vnet is used after the prison that
referred to it has been released.

Approved by: bz (mentor)

15 years agoAdd missing unlock of if_addr_mtx when an unmatched ARP packet is received.
rwatson [Wed, 24 Jun 2009 14:49:26 +0000 (14:49 +0000)]
Add missing unlock of if_addr_mtx when an unmatched ARP packet is received.

Reported by: lstewart
MFC after: 6 weeks

15 years agoAllow admin to specify the initial mtu upon driver load
gallatin [Wed, 24 Jun 2009 14:47:32 +0000 (14:47 +0000)]
Allow admin to specify the initial mtu upon driver load
for mxge.

15 years agoClear 'ia' after iterating if_addrhead for unicast address matching: since
rwatson [Wed, 24 Jun 2009 14:29:40 +0000 (14:29 +0000)]
Clear 'ia' after iterating if_addrhead for unicast address matching: since
'ifa' was used as the TAILQ_FOREACH() iterator argument, and 'ia' was just
derived form it, it could be left non-NULL which confused later
conditional freeing code.  This could cause kernel panics if multicast IP
packets were received.  [1]

Call 'struct in_ifaddr *' in ip_rtaddr() 'ia', not 'ifa' in keeping with
normal conventions.

When 'ipstealth' is enabled returns from ip_input early, properly release
the 'ia' reference.

Reported by: lstewart, sam [1]
MFC after: 6 weeks

15 years agoAdd a new COMPAT7 flag for FreeBSD 7.x compatibility system calls.
jhb [Wed, 24 Jun 2009 13:36:37 +0000 (13:36 +0000)]
Add a new COMPAT7 flag for FreeBSD 7.x compatibility system calls.

15 years ago- Move syscall function argument structure types to be just above the
jhb [Wed, 24 Jun 2009 13:35:38 +0000 (13:35 +0000)]
- Move syscall function argument structure types to be just above the
  relevenat system call function.
- Whitespace fixes.

15 years agoFix copy-and-paste-o's from kinfo_getfile.3 in kinfo_getvmmap.3.
rwatson [Wed, 24 Jun 2009 12:52:59 +0000 (12:52 +0000)]
Fix copy-and-paste-o's from kinfo_getfile.3 in kinfo_getvmmap.3.

MFC after: 3 days

15 years agoAdd stack_print_short() and stack_print_short_ddb() interfaces to
rwatson [Wed, 24 Jun 2009 12:06:15 +0000 (12:06 +0000)]
Add stack_print_short() and stack_print_short_ddb() interfaces to
stack(9), which generate a more compact rendition of a stack trace
via the kernel's printf.

MFC after: 1 week

15 years agoUse proper form of gnu designated initalizers. This lets
rdivacky [Wed, 24 Jun 2009 12:01:10 +0000 (12:01 +0000)]
Use proper form of gnu designated initalizers. This lets
clang compile this files.

Approved by: ed (mentor)
Silence from: harti (maintainer?)

15 years agoPrintf fewer warnings when adding a route to an atalk address fails;
rwatson [Wed, 24 Jun 2009 10:46:03 +0000 (10:46 +0000)]
Printf fewer warnings when adding a route to an atalk address fails;
userspace will print the error.

MFC after: 3 days

15 years agoIn if_setlladdr(), use IF_ADDR_LOCK() and ifaddr references to improve
rwatson [Wed, 24 Jun 2009 10:36:48 +0000 (10:36 +0000)]
In if_setlladdr(), use IF_ADDR_LOCK() and ifaddr references to improve
the safety of link layer address manipulation.

MFC after: 6 weeks

15 years agoIn ARP input, more consistently acquire and release ifaddr references.
rwatson [Wed, 24 Jun 2009 10:33:35 +0000 (10:33 +0000)]
In ARP input, more consistently acquire and release ifaddr references.

MFC after: 6 weeks

15 years agoBreak at_ifawithnet() into two variants:
rwatson [Wed, 24 Jun 2009 10:32:44 +0000 (10:32 +0000)]
Break at_ifawithnet() into two variants:

- at_ifawithnet(), which acquires an locks it needs and returns an
  at_ifaddr reference.
- at_ifawithnet_locked(), which relies on the caller locking
  at_ifaddr_list, and returns a pointer rather than a reference.

Update various consumers to prefer one or the other, including ether
and fddi output, to properly release at_ifaddr references.

Rework at_control() to manage locking and references in a manner
identical to in_control().

MFC after: 6 weeks

15 years agoReduce debugging output for netatalk routing events.
rwatson [Wed, 24 Jun 2009 10:28:30 +0000 (10:28 +0000)]
Reduce debugging output for netatalk routing events.

MFC after: 3 days

15 years agoInitialize the uip to silence gcc warning that seems to sneak in in some
kib [Wed, 24 Jun 2009 09:26:33 +0000 (09:26 +0000)]
Initialize the uip to silence gcc warning that seems to sneak in in some
build environments.

Reported by: alc, bf1783 at googlemail com

15 years agoLock if_addrhead when iterating, and where necessary acquire and release
rwatson [Wed, 24 Jun 2009 08:53:23 +0000 (08:53 +0000)]
Lock if_addrhead when iterating, and where necessary acquire and release
ifadr references in if_sppp.

MFC after: 6 weeks

15 years agoMake stf_getsrcifa6() return a reference to an in6_ifaddr rather than
rwatson [Wed, 24 Jun 2009 08:52:09 +0000 (08:52 +0000)]
Make stf_getsrcifa6() return a reference to an in6_ifaddr rather than
a pointer, and dispose of the references when no longer needed.

MFC after: 6 weeks

15 years agoDo not stop the loop when an empty or deleted directory entry is found.
jhay [Wed, 24 Jun 2009 06:42:13 +0000 (06:42 +0000)]
Do not stop the loop when an empty or deleted directory entry is found.
Rather just skip over it.

15 years agoAdd detection of UFS filesystems.
cperciva [Wed, 24 Jun 2009 04:56:13 +0000 (04:56 +0000)]
Add detection of UFS filesystems.

PR: bin/135565
Submitted by: Daniel O'Connor
Reviewed by: randi
MFC after: 1 month

15 years agoThe bits set in a page's dirty mask are a subset of the bits set in its
alc [Wed, 24 Jun 2009 04:45:03 +0000 (04:45 +0000)]
The bits set in a page's dirty mask are a subset of the bits set in its
valid mask.  Consequently, there is no need to perform a bit-wise and of
the page's dirty and valid masks in order to determine which parts of a
page are dirty and valid.

Eliminate an unnecessary #include.

15 years agoSlight comment fix.
ariff [Wed, 24 Jun 2009 02:01:16 +0000 (02:01 +0000)]
Slight comment fix.

15 years agoUpdate SCCS IDs for Berkeley DB 1.86 merge.
delphij [Wed, 24 Jun 2009 01:15:10 +0000 (01:15 +0000)]
Update SCCS IDs for Berkeley DB 1.86 merge.

15 years agostyle: operators should appear at the line end if we have to wrap.
delphij [Wed, 24 Jun 2009 01:14:17 +0000 (01:14 +0000)]
style: operators should appear at the line end if we have to wrap.

15 years agoAdd a note about the implication of secure level setting against kldload,
delphij [Tue, 23 Jun 2009 23:56:56 +0000 (23:56 +0000)]
Add a note about the implication of secure level setting against kldload,
and cross reference security(7).

15 years agoMerge fmtcheck() prototype change.
delphij [Tue, 23 Jun 2009 23:53:35 +0000 (23:53 +0000)]
Merge fmtcheck() prototype change.

Obtained from: NetBSD

15 years agoUse const instead of __const, and merge the license change from NetBSD.
delphij [Tue, 23 Jun 2009 23:52:12 +0000 (23:52 +0000)]
Use const instead of __const, and merge the license change from NetBSD.

Obtained from: NetBSD

15 years ago - Use size_t instead of int when appropriate;
delphij [Tue, 23 Jun 2009 23:49:52 +0000 (23:49 +0000)]
 - Use size_t instead of int when appropriate;
 - Use C99 sparse initialization.

With these changes ifconfig(8) is WARNS=2 clean.

15 years ago%.s expects an int as the length specifier, so cast properly.
delphij [Tue, 23 Jun 2009 23:37:25 +0000 (23:37 +0000)]
%.s expects an int as the length specifier, so cast properly.

15 years agoUse strlcpy() instead of manually setting the last byte of the array to \0.
delphij [Tue, 23 Jun 2009 23:34:46 +0000 (23:34 +0000)]
Use strlcpy() instead of manually setting the last byte of the array to \0.

15 years agoUse strlcpy() instead of explicitly set \0 on the tail of the array.
delphij [Tue, 23 Jun 2009 23:32:24 +0000 (23:32 +0000)]
Use strlcpy() instead of explicitly set \0 on the tail of the array.

15 years agoStaticify internal routines.
delphij [Tue, 23 Jun 2009 23:30:56 +0000 (23:30 +0000)]
Staticify internal routines.

15 years agoMerge NetBSD revision 1.14: humanize_number.c is now 2-clause BSD licensed.
delphij [Tue, 23 Jun 2009 23:27:35 +0000 (23:27 +0000)]
Merge NetBSD revision 1.14: humanize_number.c is now 2-clause BSD licensed.
(humanize_number.3 intentionally hold back until I make sure why we didn't
merged dehumanize_number(3)).

Obtained from: NetBSD

15 years agoK&R -> ANSI
delphij [Tue, 23 Jun 2009 23:20:09 +0000 (23:20 +0000)]
K&R -> ANSI

15 years agoUse C99 initialization when necessary; apply static to internal rountines.
delphij [Tue, 23 Jun 2009 23:18:19 +0000 (23:18 +0000)]
Use C99 initialization when necessary; apply static to internal rountines.
This makes nfsstat WARNS=3 clean.

15 years agoK&R -> ANSI
delphij [Tue, 23 Jun 2009 23:17:04 +0000 (23:17 +0000)]
K&R -> ANSI

15 years agoMake algorithm a bit more bulletproof.
mav [Tue, 23 Jun 2009 23:16:37 +0000 (23:16 +0000)]
Make algorithm a bit more bulletproof.

15 years agoUse getprogname() instead of referencing __progname.
delphij [Tue, 23 Jun 2009 23:16:00 +0000 (23:16 +0000)]
Use getprogname() instead of referencing __progname.

15 years agoQuote -x tracing output so it is unambiguous.
jilles [Tue, 23 Jun 2009 22:53:34 +0000 (22:53 +0000)]
Quote -x tracing output so it is unambiguous.

It is usually but not always suitable for re-input to the shell.

Approved by: ed (mentor) (implicit)

15 years agoImplement a facility for dynamic per-cpu variables.
jeff [Tue, 23 Jun 2009 22:42:39 +0000 (22:42 +0000)]
Implement a facility for dynamic per-cpu variables.
 - Modules and kernel code alike may use DPCPU_DEFINE(),
   DPCPU_GET(), DPCPU_SET(), etc. akin to the statically defined
   PCPU_*.  Requires only one extra instruction more than PCPU_* and is
   virtually the same as __thread for builtin and much faster for shared
   objects.  DPCPU variables can be initialized when defined.
 - Modules are supported by relocating the module's per-cpu linker set
   over space reserved in the kernel.  Modules may fail to load if there
   is insufficient space available.
 - Track space available for modules with a one-off extent allocator.
   Free may block for memory to allocate space for an extent.

Reviewed by:    jhb, rwatson, kan, sam, grehan, marius, marcel, stas

15 years agoRemove duplicate if-statement on gmt_is_set in gmtsub().
edwin [Tue, 23 Jun 2009 22:28:44 +0000 (22:28 +0000)]
Remove duplicate if-statement on gmt_is_set in gmtsub().

MFC after: 1 week

15 years ago- Added code to read bootcode firwmare version.
davidch [Tue, 23 Jun 2009 22:19:27 +0000 (22:19 +0000)]
- Added code to read bootcode firwmare version.
- Created dedicated shared memory access routines.

MFC after: One week

15 years ago - Use cpuset_t and the CPU_ macros in place of cpumask_t so that ULE
jeff [Tue, 23 Jun 2009 22:12:37 +0000 (22:12 +0000)]
 - Use cpuset_t and the CPU_ macros in place of cpumask_t so that ULE
   supports arbitrary numbers of cpus rather than being limited by
   cpumask_t to the number of bits in a long.

15 years agoMake callers to in6_selectsrc() and in6_pcbladdr() pass in memory
bz [Tue, 23 Jun 2009 22:08:55 +0000 (22:08 +0000)]
Make callers to in6_selectsrc() and in6_pcbladdr() pass in memory
to save the selected source address rather than returning an
unreferenced copy to a pointer that might long be gone by the
time we use the pointer for anything meaningful.

Asked for by: rwatson
Reviewed by: rwatson

15 years agoFix variable name.
mav [Tue, 23 Jun 2009 22:08:25 +0000 (22:08 +0000)]
Fix variable name.

15 years agoAdd tests for r194774.
jilles [Tue, 23 Jun 2009 22:03:56 +0000 (22:03 +0000)]
Add tests for r194774.

Approved by: ed (mentor) (implicit)

15 years agoDo not fork for a subshell if it is the last thing this shell is doing
jilles [Tue, 23 Jun 2009 21:50:06 +0000 (21:50 +0000)]
Do not fork for a subshell if it is the last thing this shell is doing
(EV_EXIT). The fork is still done as normal if any traps are active.

In many cases, the fork can be avoided even without this change by using {}
instead of (), but in practice many scripts use (), likely because the
syntax is simpler.

Example:
  sh -c '(/bin/sleep 10)& sleep 1;ps -p $! -o comm='
Now prints "sleep" instead of "sh". $! is more useful this way.
Most shells (dash, bash, pdksh, ksh93, zsh) seem to print "sleep" for this.

Example:
  sh -c '( ( ( (ps jT))))'
Now shows no waiting shell processes instead of four.
Most shells (dash, bash, pdksh, ksh93, zsh) seem to show zero or one.

PR: bin/74404
Approved by: ed (mentor) (implicit)

15 years agoWhen mountd.c parses the nfsv4 root line(s) in /etc/exports, it
rmacklem [Tue, 23 Jun 2009 21:48:04 +0000 (21:48 +0000)]
When mountd.c parses the nfsv4 root line(s) in /etc/exports, it
allocates data structures that are never linked into the tree or free'd.
As such, mountd would leak memory every time it parsed an nfsv4 root line.
This patch frees up those structures to plug the leak.

Approved by: kib (mentor)

15 years agoRework r193814:
mav [Tue, 23 Jun 2009 21:45:33 +0000 (21:45 +0000)]
Rework r193814:
While general idea of patch was good, it was not working properly due the way
it was implemented. When we are using same timer interrupt for several of
hard/prof/stat purposes we should not send several IPIs same time to other
CPUs. Sending several IPIs same time leads to terrible accounting/profiling
results due to strong synchronization effect, when the second interrupt
handler accounts processing of the first one.
Interlink timer events in a such way, that no more then one IPI is sent for
any original timer interrupt.

15 years agoImprove my last commit: use a separate condvar to serialize.
ed [Tue, 23 Jun 2009 21:43:02 +0000 (21:43 +0000)]
Improve my last commit: use a separate condvar to serialize.

The advantage of using a separate condvar is that we can just use
cv_signal(9) instead of cv_broadcast(9). It makes no sense to wake up
multiple threads. It also makes the TTY code easier to understand.
t_dcdwait sounds totally unrelated.

15 years agoAdd one more reference to SEE ALSO. Sort while here.
joel [Tue, 23 Jun 2009 21:37:12 +0000 (21:37 +0000)]
Add one more reference to SEE ALSO. Sort while here.

Submitted by: ariff

15 years agoUse dcdwait to block threads to serialize writes.
ed [Tue, 23 Jun 2009 21:33:26 +0000 (21:33 +0000)]
Use dcdwait to block threads to serialize writes.

I suspect the usage of bgwait causes a lot of spurious wakeups when
threads are blocked in the background, because they will be woken up
each time a write() call is performed.

Also wakeup dcdwait when the TTY is abandoned.

15 years agoBring in a few mdoc/language fixes.
joel [Tue, 23 Jun 2009 21:24:21 +0000 (21:24 +0000)]
Bring in a few mdoc/language fixes.

Submitted by: ru

15 years agoUsermode portion of the support for swap allocation accounting:
kib [Tue, 23 Jun 2009 20:57:27 +0000 (20:57 +0000)]
Usermode portion of the support for swap allocation accounting:
- update for getrlimit(2) manpage;
- support for setting RLIMIT_SWAP in login class;
- addition to the limits(1) and sh and csh limit-setting builtins;
- tuning(7) documentation on the sysctls controlling overcommit.

In collaboration with: pho
Reviewed by: alc
Approved by: re (kensmith)

15 years agoImplement global and per-uid accounting of the anonymous memory. Add
kib [Tue, 23 Jun 2009 20:45:22 +0000 (20:45 +0000)]
Implement global and per-uid accounting of the anonymous memory. Add
rlimit RLIMIT_SWAP that limits the amount of swap that may be reserved
for the uid.

The accounting information (charge) is associated with either map entry,
or vm object backing the entry, assuming the object is the first one
in the shadow chain and entry does not require COW. Charge is moved
from entry to object on allocation of the object, e.g. during the mmap,
assuming the object is allocated, or on the first page fault on the
entry. It moves back to the entry on forks due to COW setup.

The per-entry granularity of accounting makes the charge process fair
for processes that change uid during lifetime, and decrements charge
for proper uid when region is unmapped.

The interface of vm_pager_allocate(9) is extended by adding struct ucred *,
that is used to charge appropriate uid when allocation if performed by
kernel, e.g. md(4).

Several syscalls, among them is fork(2), may now return ENOMEM when
global or per-uid limits are enforced.

In collaboration with: pho
Reviewed by: alc
Approved by: re (kensmith)

15 years agosh: Improve handling of setjmp/longjmp volatile:
jilles [Tue, 23 Jun 2009 20:45:12 +0000 (20:45 +0000)]
sh: Improve handling of setjmp/longjmp volatile:
- remove ineffective and unnecessary (void) &var; [1]
- remove some unnecessary volatile keywords
- add a necessary volatile keyword
- save the old handler before doing something that could use the saved
  value

Submitted by: Christoph Mallon [1]
Approved by: ed (mentor)

15 years ago- Update regarding the support for SBus GEM added in r194763.
marius [Tue, 23 Jun 2009 20:38:35 +0000 (20:38 +0000)]
- Update regarding the support for SBus GEM added in r194763.
- Improve the description a bit and add a reference to vlan(4).

15 years ago- Initialize the ifnet structure, especially if_dname, before probing
marius [Tue, 23 Jun 2009 20:36:59 +0000 (20:36 +0000)]
- Initialize the ifnet structure, especially if_dname, before probing
  the PHYs as some PHY drivers use it (but probably shouldn't). How
  gem(4) has worked with brgphy(4) on powerpc without this so far is
  unclear to me.
- Introduce a dying flag which is set during detach and checked in
  gem_ioctl() in order to prevent active BPF listeners to clear
  promiscuous mode which may lead to the tick callout being restarted
  which will trigger a panic once it's actually gone.
- In gem_stop() reset rather than just disable the transmitter and
  receiver in order to ensure we're not unloading DMA maps still in
  use by the hardware. [1]
- The blanking time is specified in PCI clocks so we should use twice
  the value when operating at 66MHz.
- Spell some 2 as ETHER_ALIGN and a 19 as GEM_STATUS_TX_COMPLETION_SHFT
  to make the actual intentions clear.
- As we don't unload the peak attempts counter ignore its overflow
  interrupts.
- Remove a stale setting of a variable to GEM_TD_INTERRUPT_ME which
  isn't used afterwards.
- For optimum performance increment the TX kick register in multiples
  of 4 if possible as suggested by the documentation.
- Partially revert r164931; drivers should only clear the watchdog
  timer if all outstanding TX descriptors are done.
- Fix some debugging strings.
- Add a missing BUS_DMASYNC_POSTWRITE in gem_rint().
- As the error paths in the interrupt handler are generally unlikely
  predict them as false.
- Add support for the SBus version of the GEM controller. [2]
- Add some lock assertions.
- Improve some comments.
- Fix some more or less cosmetic issues in the code of the PCI front-end.
- Change some softc members to be unsigned where more appropriate and
  remove unused ones.

Approved by: re (kib)
Obtained from: NetBSD (partially) [2], OpenBSD [1]
MFC after: 2 weeks

15 years agoAdd a limit for child jails via the "children.cur" and "children.max"
jamie [Tue, 23 Jun 2009 20:35:51 +0000 (20:35 +0000)]
Add a limit for child jails via the "children.cur" and "children.max"
parameters.  This replaces the simple "allow.jails" permission.

Approved by: bz (mentor)

15 years ago- Fix bug where device would loose promisc setting when reset.
gallatin [Tue, 23 Jun 2009 20:22:34 +0000 (20:22 +0000)]
- Fix bug where device would loose promisc setting when reset.
- Allow all rss hash modes to be chosen

15 years agoModify most routines returning 'struct ifaddr *' to return references
rwatson [Tue, 23 Jun 2009 20:19:09 +0000 (20:19 +0000)]
Modify most routines returning 'struct ifaddr *' to return references
rather than pointers, requiring callers to properly dispose of those
references.  The following routines now return references:

  ifaddr_byindex
  ifa_ifwithaddr
  ifa_ifwithbroadaddr
  ifa_ifwithdstaddr
  ifa_ifwithnet
  ifaof_ifpforaddr
  ifa_ifwithroute
  ifa_ifwithroute_fib
  rt_getifa
  rt_getifa_fib
  IFP_TO_IA
  ip_rtaddr
  in6_ifawithifp
  in6ifa_ifpforlinklocal
  in6ifa_ifpwithaddr
  in6_ifadd
  carp_iamatch6
  ip6_getdstifaddr

Remove unused macro which didn't have required referencing:

  IFP_TO_IA6

This closes many small races in which changes to interface
or address lists while an ifaddr was in use could lead to use of freed
memory (etc).  In a few cases, add missing if_addr_list locking
required to safely acquire references.

Because of a lack of deep copying support, we accept a race in which
an in6_ifaddr pointed to by mbuf tags and extracted with
ip6_getdstifaddr() doesn't hold a reference while in transmit.  Once
we have mbuf tag deep copy support, this can be fixed.

Reviewed by: bz
Obtained from: Apple, Inc. (portions)
MFC after: 6 weeks (portions)

15 years agoAdd some sysctl info so that we can see what is going on with vblanks.
rnoland [Tue, 23 Jun 2009 20:19:02 +0000 (20:19 +0000)]
Add some sysctl info so that we can see what is going on with vblanks.

MFC after: 3 days

15 years agoNow that we have UARTs running with fast interrupt handlers the ata
sam [Tue, 23 Jun 2009 19:29:23 +0000 (19:29 +0000)]
Now that we have UARTs running with fast interrupt handlers the ata
driver's i/o ops must be locked to avoid chaos.  Extend the cambria
bus tag to support ata and add a spin lock.  The ata driver is
hacked to use that instead of it's builtin hack for ixp425.  Once
the ata driver is fixed to not be confused about byte order we can
generalize the cambria bus tag code and make it generally useful.

While here take advantage of our being ixp435-specific to remove
delays when switching between byte+word accesses and to eliminate
the 2us delay for the uarts (the spin lock overhead looks to do
this for us).

15 years agouse consistent style
sam [Tue, 23 Jun 2009 19:05:02 +0000 (19:05 +0000)]
use consistent style

15 years agoRevert most of 193311 so as to track mxge transmit stats
gallatin [Tue, 23 Jun 2009 19:04:25 +0000 (19:04 +0000)]
Revert most of 193311 so as to track mxge transmit stats
on a per-ring basis and avoid racy (and costly) updates
to the ifp stats via drbr by defining NO_SLOW_STATS

Discussed with: kmacy

15 years agoInclude sys/lock.h before sys/rwlock.h. If anything used to bring it for us
cognet [Tue, 23 Jun 2009 18:36:42 +0000 (18:36 +0000)]
Include sys/lock.h before sys/rwlock.h. If anything used to bring it for us
before, it does not anymore.

15 years agoOnly release irq resources if we were actually using them.
rnoland [Tue, 23 Jun 2009 18:24:09 +0000 (18:24 +0000)]
Only release irq resources if we were actually using them.

MFC after: 3 days

15 years agoUsing signals for vblank events is prone to issues. There have never
rnoland [Tue, 23 Jun 2009 18:09:35 +0000 (18:09 +0000)]
Using signals for vblank events is prone to issues.  There have never
been any consumers and likely will never be.  Furthermore, we have
never enabled the code for it, so just get rid of it.

MFC after: 3 days

15 years agoUpdate mxge firmware from 1.4.39 to 1.4.43. Changes include:
gallatin [Tue, 23 Jun 2009 18:00:43 +0000 (18:00 +0000)]
Update mxge firmware from 1.4.39 to 1.4.43.  Changes include:

- Support for 10G-PCIE*-8B*-C (dual-port CX4)  NICs
- For dual-port NICs, f/w failover is now a few microsecs
    instead of a few millisecs.
-  On failover, f/w sends RARP broadcast to make the change
   immediately known to the network
- Fixed a bug observed on IBM X3 architecture where
   some spurious ecrc errors would be reported when OS enabled
   ecrc support.

Sponsored by: Myricom Inc.

15 years agoGiven that vblanks generally occur 60 times a second, waiting 3 seconds
rnoland [Tue, 23 Jun 2009 17:52:41 +0000 (17:52 +0000)]
Given that vblanks generally occur 60 times a second, waiting 3 seconds
seems rather excessive.

MFC after: 3 days

15 years agovblank[crtc].last represents the hardware counter while request.sequence
rnoland [Tue, 23 Jun 2009 17:50:35 +0000 (17:50 +0000)]
vblank[crtc].last represents the hardware counter while request.sequence
represents the software counter.  Don't currupt things here.

MFC after: 3 days

15 years agoImplement minimal set of changes suggested by bz to make
gallatin [Tue, 23 Jun 2009 17:42:06 +0000 (17:42 +0000)]
Implement minimal set of changes suggested by bz to make
mxge no longer depend on INET.

15 years agoHold the lock while we save/restore register for suspend/resume.
rnoland [Tue, 23 Jun 2009 17:38:28 +0000 (17:38 +0000)]
Hold the lock while we save/restore register for suspend/resume.

MFC after: 3 days

15 years agoAfter cleaning up rt_tables from vnet.h and cleaning up opt_route.h
bz [Tue, 23 Jun 2009 17:03:45 +0000 (17:03 +0000)]
After cleaning up rt_tables from vnet.h and cleaning up opt_route.h
a lot of files no longer need route.h either. Garbage collect them.
While here remove now unneeded vnet.h #includes as well.