rwatson [Thu, 24 Jun 2004 01:37:04 +0000 (01:37 +0000)]
Introduce sbreserve_locked(), which asserts the socket buffer lock on
the socket buffer having its limits adjusted. sbreserve() now acquires
the lock before calling sbreserve_locked(). In soreserve(), acquire
socket buffer locks across read-modify-writes of socket buffer fields,
and calls into sbreserve/sbrelease; make sure to acquire in keeping
with the socket buffer lock order. In tcp_mss(), acquire the socket
buffer lock in the calling context so that we have atomic read-modify
-write on buffer sizes.
rwatson [Thu, 24 Jun 2004 00:54:26 +0000 (00:54 +0000)]
Slide socket buffer lock earlier in sopoll() to cover the call into
selrecord(), setting up select and flagging the socker buffers as SB_SEL
and setting up select under the lock.
njl [Thu, 24 Jun 2004 00:48:45 +0000 (00:48 +0000)]
Run the power off code directly instead of using indirection through
smp_rendezvous() to ensure we run on the BSP. This reverts rev 1.128.
Add a comment indicating that MI code should be the one that runs all
shutdown functions on the BSP with the APs halted. This should work
around problems in power off while waiting for the MI code to be improved.
rwatson [Thu, 24 Jun 2004 00:47:23 +0000 (00:47 +0000)]
Remove spls from portal_open(). Acquire socket lock while sleeping
waiting for the socket to connect and use msleep() on the socket
mute rather than tsleep(). Acquire socket buffer mutexes around
read-modify-write of socket buffer flags.
bmilekic [Wed, 23 Jun 2004 21:59:03 +0000 (21:59 +0000)]
Make uma_mtx MTX_RECURSE. Here's why:
The general UMA lock is a recursion-allowed lock because
there is a code path where, while we're still configured
to use startup_alloc() for backend page allocations, we
may end up in uma_reclaim() which calls zone_foreach(zone_drain),
which grabs uma_mtx, only to later call into startup_alloc()
because while freeing we needed to allocate a bucket. Since
startup_alloc() also takes uma_mtx, we need to be able to
recurse on it.
This exact explanation also added as comment above mtx_init().
Trace showing recursion reported by: Peter Holm <peter-at-holm.cc>
gad [Wed, 23 Jun 2004 21:17:25 +0000 (21:17 +0000)]
Add a check for defunct processes in saveuser(), so the output for "args"
(aka "command") will display "<defunct>", as does the output from "comm"
for those processes. Also do better checking for malloc() failures.
ps [Wed, 23 Jun 2004 21:04:37 +0000 (21:04 +0000)]
Add support for TCP Selective Acknowledgements. The work for this
originated on RELENG_4 and was ported to -CURRENT.
The scoreboarding code was obtained from OpenBSD, and many
of the remaining changes were inspired by OpenBSD, but not
taken directly from there.
You can enable/disable sack using net.inet.tcp.do_sack. You can
also limit the number of sack holes that all senders can have in
the scoreboard with net.inet.tcp.sackhole_limit.
jhb [Wed, 23 Jun 2004 18:11:33 +0000 (18:11 +0000)]
Finally implement bus_config_intr() support for I/O APIC interrupt sources.
This should fix problems with older SMP systems that only have ISA/EISA
IRQs when routing virgin PCI interrupts as well as on other boxes whose
MADT does not have any interrupt override entries for ISA IRQs that are
used to route PCI interrupts even in APIC mode.
jhb [Wed, 23 Jun 2004 17:21:02 +0000 (17:21 +0000)]
- Defer BUS_CONFIG_INTR() on ACPI IRQ resources until the resources are
actually used. For most ACPI devices this means deferring the call
until bus_alloc_resource().
- Add a function acpi_config_intr() to call BUS_CONFIG_INTR() for an
ACPI IRQ resource using the trigger mode and polarity information
stored in the ACPI resource object.
- Add a function acpi_lookup_irq_resource() to lookup the ACPI IRQ
resource that corresponds to a specified rid and new-bus resource.
- Have the ACPI PCI bridge driver call BUS_CONFIG_INTR() on interrupts
that it routes through link devices.
- Remove needactivate variable from acpi_alloc_resource() by changing the
function not modify the flags variable but just mask off RF_ACTIVE when
calling rman_reserve_resource().
jhb [Wed, 23 Jun 2004 15:29:20 +0000 (15:29 +0000)]
Various cleanups in support of a future ioapic_config_intr() function:
- Allow ioapic_set_{nmi,smi,extint}() to be called multiple times on the
same pin so long as the pin's mode is the same as the mode being
requested.
- Add a notion of bus type for the interrupt associated with interrupt pin.
This is needed so that we can force all EISA interrupts to be active high
in the forthcoming ioapic_config_intr().
- Fix a bug for EISA systems that didn't remap IRQs. This would have broken
EISA systems that tried to disable mixed mode for IRQ 0.
jhb [Wed, 23 Jun 2004 15:08:40 +0000 (15:08 +0000)]
Now that we associate a device_t with ACPI device handles, lookup the
device associated with any PCI devices that are enumerated in the ACPI
tree when adding children to an ACPI PCI bus and remove the duplicate
ACPI-only device_t and replace the device_t associated with the handle with
the ACPI and PCI aware device_t.
imp [Wed, 23 Jun 2004 13:49:46 +0000 (13:49 +0000)]
Improve the kludge assignment of sub-bus numbers a little by fixing an
off by one error. subbus must be > than pribus, so the right test is
<= not just <.
le [Wed, 23 Jun 2004 11:16:12 +0000 (11:16 +0000)]
MFNetBSD 1.60, author: augustss
Several changes:
* Implement read for ulpt.
* If the device is not opened for reading, occasionally drain any
data the printer might have (but don't hammer the printer with reads).
* Lower the buffer size to one page.
The driver seems to work with more printers now.
tjr [Wed, 23 Jun 2004 07:01:44 +0000 (07:01 +0000)]
Prefix the names of members of _RuneLocale and its sub-structures
with ``__'' to avoid polluting the namespace. This doesn't change the
documented rune interface at all, but breaks applications that accessed
_RuneLocale directly.
bde [Wed, 23 Jun 2004 06:47:49 +0000 (06:47 +0000)]
Include <sys/mutex.h> and its prerequisite <sys/lock.h> instead of
depending on namespace pollution in <sys/vnode.h> for the definition
of mutex interfaces used in SOCKBUF_*LOCK().
bde [Wed, 23 Jun 2004 06:35:43 +0000 (06:35 +0000)]
Include <sys/mutex.h> and its prerequisite <sys/lock.h> instead of
depending on namespace pollution in <sys/vnode.h> for the definition
of GIANT_REQUIRED.
mlaier [Wed, 23 Jun 2004 01:32:28 +0000 (01:32 +0000)]
Add "privsep" user/group _pflogd:_pflogd (64:64) to make pflogd(8) work
again. This user/group is not required for install* targets, hence do not
add them to CHECK_UIDS/CHECK_GIDS in Makefile.inc1 (no need to annoy
people).
bms [Tue, 22 Jun 2004 23:58:09 +0000 (23:58 +0000)]
Fix an inconsistency in socket option propagation on accept(). Propagate
the SS_NBIO flag from the parent socket to the child socket during an
accept() operation.
The file descriptor O_NONBLOCK flag would have been propagated already
by the fflag assignment, and therefore would have been inconsistent
with the underlying socket's so_state member.
This makes accept() more closely adhere to the API contract we effectively
outline in the manual page. Note also that Linux continues to differ here;
O_NONBLOCK is not propagated. The other BSDs do propagate the flag, as
does Solaris. The Single UNIX Specification does not offer specific
advice on this issue.
jhb [Tue, 22 Jun 2004 21:52:20 +0000 (21:52 +0000)]
Remove a bogus increment of %di when scanning the list of loader paths.
%di will already point to the character after the nul char when the
'repnz scasb' terminates.
Submitted by: Tom Cosgrove tom dot cosgrove at arches-consulting dot com
brooks [Tue, 22 Jun 2004 20:13:25 +0000 (20:13 +0000)]
Major overhaul of pseudo-interface cloning. Highlights include:
- Split the code out into if_clone.[ch].
- Locked struct if_clone. [1]
- Add a per-cloner match function rather then simply matching names of
the form <name><unit> and <name>.
- Use the match function to allow creation of <interface>.<tag>
vlan interfaces. The old way is preserved unchanged!
- Also the match function to allow creation of stf(4) interfaces named
stf0, stf, or 6to4. This is the only major user visible change in
that "ifconfig stf" creates the interface stf rather then stf0 and
does not print "stf0" to stdout.
- Allow destroy functions to fail so they can refuse to delete
interfaces. Currently, we forbid the deletion of interfaces which
were created in the init function, particularly lo0, pflog0, and
pfsync0. In the case of lo0 this was a panic implementation so it
does not count as a user visiable change. :-)
- Since most interfaces do not need the new functionality, an family of
wrapper functions, ifc_simple_*(), were created to wrap old style
cloner functions.
- The IF_CLONE_INITIALIZER macro is replaced with a new incompatible
IFC_CLONE_INITIALIZER and ifc_simple consumers use IFC_SIMPLE_DECLARE
instead.
Submitted by: Maurycy Pawlowski-Wieronski <maurycy at fouk.org> [1]
Reviewed by: andre, mlaier
Discussed on: net
green [Tue, 22 Jun 2004 18:56:47 +0000 (18:56 +0000)]
Fix a problem with multiple-delivery (i.e. broadcast) in ng_bridge.
Only the first link0..link$NLINKS hooks would be utilized, whereas
the link hooks may be connected sparsely.
Add a counter variable so that the link hook array is only traversed
while there is still work to do, but that it continues up to the end
if it has to.
dwmalone [Tue, 22 Jun 2004 16:02:29 +0000 (16:02 +0000)]
Use nanoseconds and then lexicographic ordering when the seconds of
the [acm]time are the same. I was going to use Scott's patch, but I
couldn't get the style quite right, so I used a patch of my own.
Submitted by: Scott Mitchell <scott+freebsd at fishballoon.org>
MFC after: 3 weeks
rwatson [Tue, 22 Jun 2004 04:34:05 +0000 (04:34 +0000)]
Acquire Giant in link() so that the system call can be marked
MPSAFE. Don't want to acquire Giant in kern_link() sync linux
compat code performs actions requiring Giant prior to calling
kern_link().