andre [Tue, 19 Oct 2004 15:45:57 +0000 (15:45 +0000)]
Support for dynamically loadable and unloadable IP protocols in the ipmux.
With pr_proto_register() it has become possible to dynamically load protocols
within the PF_INET domain. However the PF_INET domain has a second important
structure called ip_protox[] that is derived from the 'struct protosw inetsw[]'
and takes care of the de-multiplexing of the various protocols that ride on
top of IP packets.
The functions ipproto_[un]register() allow to dynamically adjust the ip_protox[]
array mux in a consistent and easy way. To register a protocol within
ip_protox[] the existence of a corresponding and matching protocol definition
in inetsw[] is required. The function does not allow to overwrite an already
registered protocol. The unregister function simply replaces the mux slot with
the default index pointer to IPPROTO_RAW as it was previously.
bms [Tue, 19 Oct 2004 15:30:47 +0000 (15:30 +0000)]
Detach the Rhine completely on shutdown, rather than merely stopping it
as the original logic did. This fixes a race with vr_intr() which was
masked on UP systems and manifested on SMP systems.
andre [Tue, 19 Oct 2004 15:13:30 +0000 (15:13 +0000)]
Support for dynamically loadable and unloadable protocols within existing protocol
families.
The protosw[] array of any particular protocol family ("domain") is of fixed size
defined at compile time. This made it impossible to dynamically add or remove any
protocols to or from it. We work around this by introducing so called SPACER's
which are embedded into the protosw[] array at compile time. The SPACER's have
a special protocol number (32767) to indicate the fact that they are SPACER's but
are otherwise NULL. Only as many protocols can be dynamically loaded as SPACER's
are provided in the protosw[] structure.
The pr_usrreqs structure is treated more special and contains pointers to dummy
functions only returning EOPNOTSUPP. This is needed because the use of those
functions pointers is usually not checked within the kernel because until now it
was assumed to be a valid function pointer. Instead of fixing all potential
callers we just return a proper error code.
Two new functions provide a clean API to register and unregister a protocol. The
register function expects a pointer to a valid and complete struct protosw including
a pointer to struct pru_usrreqs provided by the caller. Upon successful registration
the pr_init() function will be called to finish initialization of the protocol. The
unregister function restores the SPACER in place of the protocol again. It is the
responseability of the caller to ensure proper closing of all sockets and freeing
of memory allocation by the unloading protocol.
sys/protosw.h
o Define generic PROTO_SPACER to be 32767
o Prototypes for all pru_*_notsupp() functions
o Prototypes for pf_proto_[un]register() functions
kern/uipc_domain.c
o Global struct pr_usrreqs nousrreqs containing valid pointers to the
pru_*_notsupp() functions
o New functions pf_proto_[un]register()
kern/uipc_socket2.c
o New functions bodies for all pru_*_notsupp() functions
le [Tue, 19 Oct 2004 10:29:00 +0000 (10:29 +0000)]
Return the unit number of a channel instead of a hardcoded '1' from
the ATA pccard locking function. This makes pccard devices like
Compact Flash cards work again.
PR: kern/72805
Submitted by: James E. Flemer <jflemer@alum.rpi.edu>
MFC in: 2 days
scottl [Tue, 19 Oct 2004 02:44:38 +0000 (02:44 +0000)]
Forced commit to note that the previous change also elimates calls to
bus_dmamap_create|destroy for the rx and tx descriptor buffers. Since these
buffers are created with bus_dmamem_alloc(), there is no reason to also
create a map, and doing so just wastes memory.
scottl [Tue, 19 Oct 2004 02:42:49 +0000 (02:42 +0000)]
Use and alignment of 1 instead of ETHER_ALIGN for rx and tx buffers and jumbo
frames. BGE hardware with the rx alignment bug will still be handled by the
calls to m_adj() that already exist. m_adj() is probably better suited for
this task anyways. Just as with if_em, this saves a malloc + several locks
per packet and prevents unneeded data copying within busdma.
scottl [Tue, 19 Oct 2004 02:39:27 +0000 (02:39 +0000)]
Use an alignment of 1 instead of PAGE_SIZE for the rx and tx buffer tags.
Since the e1000 DMA engines hava no constraints on the alignment of buffer
transfers, there is no reason to tell busdma that there is. This save a
minimum of 1 malloc call per packet, which translates to eliminating 4 locks.
It also means that buffers are not needlessly bounced when transfered. The
end result is a 38% improvement in pps in a 4 way bridging environment.
thomas [Mon, 18 Oct 2004 23:40:13 +0000 (23:40 +0000)]
When dumpdev is set to 'auto', and a suitable swap device is found,
create a symbolic link /dev/dumpdev designating that device so
savecore can find and save a previous kernel dump.
jmg [Mon, 18 Oct 2004 23:06:12 +0000 (23:06 +0000)]
fix (for me) the problems where if_de gets really slow after time
(usually taking 20 seconds to transmit a packet).. no longer fall back
to only transmitting one packet (instead of the entire queue) after we
have processed the entire send queue... I have no idea why we didn't
start seeing this problem ~6 years ago when this code was introduced...
rwatson [Mon, 18 Oct 2004 22:19:43 +0000 (22:19 +0000)]
Push acquisition of the accept mutex out of sofree() into the caller
(sorele()/sotryfree()):
- This permits the caller to acquire the accept mutex before the socket
mutex, avoiding sofree() having to drop the socket mutex and re-order,
which could lead to races permitting more than one thread to enter
sofree() after a socket is ready to be free'd.
- This also covers clearing of the so_pcb weak socket reference from
the protocol to the socket, preventing races in clearing and
evaluation of the reference such that sofree() might be called more
than once on the same socket.
This appears to close a race I was able to easily trigger by repeatedly
opening and resetting TCP connections to a host, in which the
tcp_close() code called as a result of the RST raced with the close()
of the accepted socket in the user process resulting in simultaneous
attempts to de-allocate the same socket. The new locking increases
the overhead for operations that may potentially free the socket, so we
will want to revise the synchronization strategy here as we normalize
the reference counting model for sockets. The use of the accept mutex
in freeing of sockets that are not listen sockets is primarily
motivated by the potential need to remove the socket from the
incomplete connection queue on its parent (listen) socket, so cleaning
up the reference model here may allow us to substantially weaken the
synchronization requirements.
RELENG_5_3 candidate.
MFC after: 3 days
Reviewed by: dwhite
Discussed with: gnn, dwhite, green
Reported by: Marc UBM Bocklet <ubm at u-boot-man dot de>
Reported by: Vlad <marchenko at gmail dot com>
phk [Mon, 18 Oct 2004 21:51:27 +0000 (21:51 +0000)]
Add new function ttyinitmode() which sets our systemwide default
modes on a tty structure.
Both the ".init" and the current settings are initialized allowing
the function to be used both at attach and open time.
The function takes an argument to decide if echoing should be enabled.
Echoing should not be enabled for regular physical serial ports
unless they are consoles, in which case they should be configured
by ttyconsolemode() instead.
ru [Mon, 18 Oct 2004 21:42:15 +0000 (21:42 +0000)]
Utilize FILES, SCRIPTS, and SYMLINKS. While here, fixed a bug in
the implementation of the following feature in revision 1.4:
- Install Makefile.yp as /var/yp/Makefile.dist and link it to
/var/yp/Makefile only if /var/yp/Makefile doesn't already exist.
Suggested by Peter Wemm.
The actual code was only symlinking when no /var/yp/Makefile.dist
existed, i.e., never.
glebius [Mon, 18 Oct 2004 20:13:57 +0000 (20:13 +0000)]
Major overhaul.
List of functional changes:
- Make a single device per single node with a single hook.
This gives us parrallelizm, which can't be achieved on a single
node with many devices/hooks. This also gives us flexibility - we
can play with a particular device node, not affecting others.
- Remove read queue as it is. Use struct ifqueue instead. This change
removes a lot of extra memcpy()ing, m_devget()ting and m_copymem()ming.
In ng_device_receivedata() we enqueue an mbuf and wake readers.
In ngdread() we take one mbuf from qeueue and uiomove() it to
userspace. If no mbuf is present we optionally block. [1]
- In ngdwrite() we create an mbuf from uio using m_uiotombuf().
This is faster then uiomove() into buffer, and then m_copydata(),
and this is much better than huge m_pullup().
- Perform locking of device
- Perform locking of connection list.
- Clear out _rcvmsg method, since it does nothing good yet.
- Implement NGM_DEVICE_GET_DEVNAME message.
- #if 0 ioctl method, while nothing is done here yet.
- Return immediately from ngdwrite() if uio_resid == 0.
List of tidyness changes:
- Introduce device2priv(), to remove cut'n'paste.
- Use MALLOC/FREE, instead of malloc/free.
- Use unit2minor().
- Use UID_ROOT/GID_WHEEL instead of 0/0.
- Define NGD_DEVICE_DEVNAME, use it.
- Use more nice macros for debugging. [2]
- Return Exxx, not -1.
style(9) changes:
- No "#endif" after short block.
- Break long lines.
- Remove extra spaces, add needed spaces.
rwatson [Mon, 18 Oct 2004 19:29:13 +0000 (19:29 +0000)]
Annotate that get_cyclecount() can be expensive on some platforms,
which juxtaposes nicely with the comment just above on how the
harvest function must be cheap.
cperciva [Mon, 18 Oct 2004 15:40:47 +0000 (15:40 +0000)]
Modify behaviour of `xargs -I` in order to:
1. Conform to IEEE Std 1003.1-2004, which state that "Constructed
arguments cannot grow larger than 255 bytes", and
2. Avoid a buffer overflow.
Unfortunately the standard doesn't indicate how xargs is supposed to
handle arguments which (with the appropriate substitutions) would grow
larger than 255 bytes; this solution handles those by making as many
substitutions as possible without overflowing the buffer.
OpenBSD's xargs resolves this in a different direction, by making
all the substitutions and then silently truncating the resulting string.
Since this change may break existing scripts which rely upon the buffer
overflow (255 bytes isn't really all that long...) it will not be MFCed.
rwatson [Mon, 18 Oct 2004 11:23:11 +0000 (11:23 +0000)]
Correct several instances where calls to vfs_getvfs() resulting in
failure in the NFS server would result in a leaked instance of the NFS
server subsystem lock. Liberally sprinkle assertions in all target
labels for error unwinding to assert the desired locking state.
RELENG_5_3 candidate.
MFC after: 3 days
Reported by: Wilkinson, Alex <alex dot wilkinson at dsto dot defence dot gov dot au>
alc [Mon, 18 Oct 2004 08:11:59 +0000 (08:11 +0000)]
Correct two errors in PG_BUSY management by vm_page_cowfault(). Both
errors are in rarely executed paths.
1. Each time the retry_alloc path is taken, the PG_BUSY must be set again.
Otherwise vm_page_remove() panics.
2. There is no need to set PG_BUSY on the newly allocated page before
freeing it. The page already has PG_BUSY set by vm_page_alloc().
Setting it again could cause an assertion failure.
kientzle [Mon, 18 Oct 2004 05:31:01 +0000 (05:31 +0000)]
Revert 1.18: It broke Athlon64 builds, which
probably means it also requires a .so version
bump. Defer it until I finish some related
work on cleaning up error returns throughout
the library.
wollman [Sun, 17 Oct 2004 23:55:07 +0000 (23:55 +0000)]
Latest timezone database from Arthur Olson. Updates in this round:
Current or prospective timestamps: Georgia, Uruguay, Argentina, and Brazil
Historial timestamps and/or commentary: Malaysia, Mongolia, Singapore,
Peru, Russua, Israel, United States, Canada
Changes in Argentina and Brazil have created several new time zone regions.
Users are encouraged to rerun tzsetup(8), even if current times appear
correct, to ensure that future times will be interepreted correctly.
Obtained from: Arthur Olson, ftp://elsie.nci.nih.gov/pub/tzdata2004e.tar.gz
alc [Sun, 17 Oct 2004 22:33:40 +0000 (22:33 +0000)]
Assert that the containing object is locked in vm_page_io_start() and
vm_page_io_finish(). The motivation being to transition synchronization of
the vm_page's busy field from the global page queues lock to the per-object
lock.
marcel [Sun, 17 Oct 2004 22:20:39 +0000 (22:20 +0000)]
turn off getty(8) on ttyv[0-7]. We don't support syscons on ia64 and
do not have these device special files. Where this previously failed
quietly, it now emits annoying but complete messages at best and
incomprehensible prefixes on average. During all of October, this is
a string of 16 O's, as in:
:
Starting inetd.
Sun Oct 17 15:09:09 PDT 2004
OOOOOOOOOOOOOOOO
FreeBSD/ia64 (itanium.pn.xcllnt.net) (ttyu2)
obrien [Sun, 17 Oct 2004 14:59:18 +0000 (14:59 +0000)]
Remove the suggestion to use libmap.conf to deal with the version bump.
People have a tendency to add things to libmap.conf and forget about them
(as we've seen in the mailing lists before).
The compat4x port should be used instead.
schweikh [Sun, 17 Oct 2004 13:39:42 +0000 (13:39 +0000)]
Fix a bogus variable assignment. You can't expect
_msg="a" \
" b"
to concat the strings. Use
_msg="a"
_msg="$_msg b"
instead (intent is to not exceed 80 chars per line).
obrien [Sun, 17 Oct 2004 05:08:29 +0000 (05:08 +0000)]
+ Simplify by treating the standard x86 CPU names as the CPUTYPE vs.
treating them as an alias. Treat the shorthand versions as aliases.
+ Separate the x86 GCC CPU CFLAGS from the ICC CFLAGS. This greatly
simplifies the GCC section. It also makes it more clear which CPU's
have the same ICC CPU CFLAGS.
+ Remove redundancy in the alpha section.
+ Add forgotten ICC CPU CFLAGS for the mobile Intel CPU's added in rev. 1.42.
alc [Sat, 16 Oct 2004 22:32:50 +0000 (22:32 +0000)]
When sf_buf_alloc() replaces a virtual-to-physical mapping, it needn't
invalidate the TLB(s) if the old mapping wasn't used by the CPU. With
network interfaces that implement checksum off-loading, the old mapping is
almost never used by the CPU, only by the device driver for setting up the
DMA operation.
yar [Sat, 16 Oct 2004 09:53:35 +0000 (09:53 +0000)]
Explain it is a negative offset that EINVAL may indicate.
Now readers won't get an impression that pointing to beyond
the current end of file will result in EINVAL.
yar [Sat, 16 Oct 2004 08:36:28 +0000 (08:36 +0000)]
Fix an ancient typo: `sc' usually equals `ns*nt', not `nc*nt'
(the latter is actually the total number of tracks on the disk,
which has no field in disktab(5).)
scottl [Sat, 16 Oct 2004 06:38:22 +0000 (06:38 +0000)]
If a process needs to be swapped in, wakeup the swapper from within
critical_exit as the process is getting scheduled to run. This is subotimal
but for now avoid the LOR between the scheduler and the sleepq systems.
This is a 5.3 candidate.
obrien [Sat, 16 Oct 2004 06:11:35 +0000 (06:11 +0000)]
Try to bring some sanity to the SCM ID's.
+ spell LIBC_SCCS consistently
+ enable builds with LIBC_SCCS defined to not syntax error
+ minor SCM reformatting to try to have some consistency