dragonfly.git
15 years agoThe cam_sim structure was being deallocated unconditionally by device
Matthew Dillon [Mon, 15 Mar 2004 01:10:45 +0000 (01:10 +0000)]
The cam_sim structure was being deallocated unconditionally by device
driver detach routines.  The problem with this is that part of the CAM
bus structure may still be active (for example, with pending timeout()'s),
and even though the bus, target, and device is freed, since the sim IS
freed any accesses through the sim will hit 0xdeadc0de.  This case most often
occurs with USB UMASS devices.

The CAM_XPT and CAM_SIM layer has been revamped.  CAM_DEV_UNCONFIGURED is now
accounted for in the device->refcount, and the cam_sim structure is now
ref-counted as well.  Additionally, the cam_simq* code which handles the
device queues has been revamped to refcount as well, so shared device queues
(raid and multi-channel devices) are not free()'d before all references have
gone away.

scsi_low free'd its cam_sim twice.  Fixed.

USB was improperly using M_NOWAIT.  All M_NOWAIT instances have been renamed
to M_INTWAIT.

15 years agoTurn TDF_SYSTHREAD into TDF_RESERVED0100 since the flag is never used
Hiten Pandya [Sun, 14 Mar 2004 20:54:02 +0000 (20:54 +0000)]
Turn TDF_SYSTHREAD into TDF_RESERVED0100 since the flag is never used
and such a flag is not required.

Discussed with:  Matt Dillon

15 years agoRemove BPF_MTAP definition
Joerg Sonnenberger [Sun, 14 Mar 2004 17:12:05 +0000 (17:12 +0000)]
Remove BPF_MTAP definition

15 years agoBPF has been in the kernel for ages and is supported by all NICs but I4B.
Joerg Sonnenberger [Sun, 14 Mar 2004 15:36:54 +0000 (15:36 +0000)]
BPF has been in the kernel for ages and is supported by all NICs but I4B.

This removes the second argument of ether_ifattach and ether_ifdetach as
done by sam in FreeBSD's rev. 1.130 of net/if_ethersubr.c.

Add an argument for the link layer address to ether_ifattach as done by
is in NetBSD's rev 1.21.4.1 of the same file.

Adjust if_ef.c based on FreeBSD's version of that file.

Remove the now unused ETHER_BPF_[UN]SUPPORTED define from ethernet.h.

15 years agoRemove unused BSDI I4B interface
Joerg Sonnenberger [Sun, 14 Mar 2004 15:19:54 +0000 (15:19 +0000)]
Remove unused BSDI I4B interface

15 years agoRemove macro definitions for BPF_MTAP
Joerg Sonnenberger [Sun, 14 Mar 2004 14:37:39 +0000 (14:37 +0000)]
Remove macro definitions for BPF_MTAP

15 years agoFix warning about missing prototyp for psignal
Joerg Sonnenberger [Sun, 14 Mar 2004 14:35:23 +0000 (14:35 +0000)]
Fix warning about missing prototyp for psignal

15 years agoDe-perlify.
Eirik Nygaard [Sun, 14 Mar 2004 13:47:12 +0000 (13:47 +0000)]
De-perlify.

Submitted by: Dheeraj Reddy <dheerajr@comcast.net>
Obtained from: FreeBSD

15 years agoCorrect typo in comment.
Hiten Pandya [Sun, 14 Mar 2004 11:04:12 +0000 (11:04 +0000)]
Correct typo in comment.

15 years agoIfdef out unused variable.
Jeffrey Hsu [Sun, 14 Mar 2004 08:26:31 +0000 (08:26 +0000)]
Ifdef out unused variable.

15 years agoMake tcp_drain() per-cpu.
Jeffrey Hsu [Sun, 14 Mar 2004 08:21:53 +0000 (08:21 +0000)]
Make tcp_drain() per-cpu.

15 years agoMake tcp_drain() per-cpu.
Jeffrey Hsu [Sun, 14 Mar 2004 07:57:26 +0000 (07:57 +0000)]
Make tcp_drain() per-cpu.

15 years ago * Remove ``register'' keywords.
Eirik Nygaard [Sat, 13 Mar 2004 21:08:39 +0000 (21:08 +0000)]
 * Remove ``register'' keywords.
 * Convert K&R-style function declarations to ANSI-style.

Submitted by: Chris Pressey <cpressey@catseye.mine.nu>

15 years agoUpdate libcr with recent libc updates.
Eirik Nygaard [Sat, 13 Mar 2004 19:46:56 +0000 (19:46 +0000)]
Update libcr with recent libc updates.

15 years agoAdd BPF_TAP and BPF_MTAB macros from FreeBSD
Joerg Sonnenberger [Sat, 13 Mar 2004 19:18:56 +0000 (19:18 +0000)]
Add BPF_TAP and BPF_MTAB macros from FreeBSD

15 years agoAdd convient functions for the bus interface: child_present,
Joerg Sonnenberger [Sat, 13 Mar 2004 14:38:22 +0000 (14:38 +0000)]
Add convient functions for the bus interface: child_present,
child_pnpinfo_str, child_location_str.

From FreeBSD.

15 years agoMerge from FreeBSD 5:
Joerg Sonnenberger [Sat, 13 Mar 2004 12:39:56 +0000 (12:39 +0000)]
Merge from FreeBSD 5:

Add some handy macros to remove e.g. const from a pointer.

15 years agoFix a bunch of NFS races. These races existed in FreeBSD 4.x but are more
Matthew Dillon [Sat, 13 Mar 2004 03:13:53 +0000 (03:13 +0000)]
Fix a bunch of NFS races.  These races existed in FreeBSD 4.x but are more
likely to occur now due to the additional thread switching that DragonFly
performs when doing things like sending UDP packets.  Three bugs are
being fixed:

* nfs_request() adds the request to the nfs_timer queue before doing initial
  processing (e.g. transmission) of the request.  The initial transmission of
  the request will race between nfs_request and nfs_timer, potentially causing
  the congestion window calculation (nm_sent) to be bumped twice instead of
  once.  This eventually closes the congestion window permanently and
  causes the NFS mount to freeze.  (Additionally the request could be
  transmitted twice unnecessarily, also fixed).

* Updates to rep->r_flags and nmp->nm_sent were not being properly protected
  against nfs_timer due to splsoftclock() being released too early.  All
  such accesses are now protected.

* nfs_reply() depends on nfs_rcvlock to do an interlock check to see if the
  request has already been replied, but nfs_rcvlock() only does this if it
  cannot immediately get the receiver lock.  The problem is that the NFS
  code in between request transmission and nfs_reply() can block, potentially
  allowing a reply to be returned to another nfsiod.  The NFS receiver winds
  up getting stuck waiting for a reply that has already been returned.
  nfs_rcvlock() now unconditionally checks to see if the reply has already
  occured before entering the loop.

15 years agoIn an rfork'd or vfork'd situation where multiple processes are sharing
Matthew Dillon [Fri, 12 Mar 2004 23:09:37 +0000 (23:09 +0000)]
In an rfork'd or vfork'd situation where multiple processes are sharing
the same vmspace, and one process goes zombie, the vmspace's vm_exitingcnt
will be non-zero.  If another process then forks or execs the exitingcnt will
be improperly inherited by the new vmspace.  The solution is to not copy
exitingcnt when copying to a new vmspace.

Additionally, for DragonFly, I also had to fix a few cases where the upcall
list was also being improperly inherited.

Heads-up-by: Xin LI <delphij@frontfree.net>
Obtained-From: Peter Wemm <peter@wemm.org> (FreeBSD-5)

15 years agoAdd userland UDF support based on mount_cd9660
Joerg Sonnenberger [Fri, 12 Mar 2004 22:46:25 +0000 (22:46 +0000)]
Add userland UDF support based on mount_cd9660

15 years agoMerge the kernel part of UDF support from FreeBSD 5.
Joerg Sonnenberger [Fri, 12 Mar 2004 22:38:15 +0000 (22:38 +0000)]
Merge the kernel part of UDF support from FreeBSD 5.

This doesn't include the iconv hocks and makes use of M_WAITOK everywhere.

15 years agoThe free(9) implementation based on the slab allocator doesn't handle
Joerg Sonnenberger [Fri, 12 Mar 2004 22:29:21 +0000 (22:29 +0000)]
The free(9) implementation based on the slab allocator doesn't handle
the special case of freeing NULL anymore. Make this behaviour explicit
by adding a panic and adjusting the man page.

15 years agoThink before commit and remove some more cruft
Joerg Sonnenberger [Fri, 12 Mar 2004 22:21:12 +0000 (22:21 +0000)]
Think before commit and remove some more cruft

15 years agoAdd a short cut for DVD_INVALIDATE_AGID to simplify the rest
Joerg Sonnenberger [Fri, 12 Mar 2004 22:19:08 +0000 (22:19 +0000)]
Add a short cut for DVD_INVALIDATE_AGID to simplify the rest

15 years agoInitialize all fields in MALLOC_DEFINE and VFS_SET to fix warnings.
Joerg Sonnenberger [Fri, 12 Mar 2004 22:05:53 +0000 (22:05 +0000)]
Initialize all fields in MALLOC_DEFINE and VFS_SET to fix warnings.

15 years agoInitialize the interface name for if_de
Joerg Sonnenberger [Fri, 12 Mar 2004 15:42:49 +0000 (15:42 +0000)]
Initialize the interface name for if_de

15 years agoCollapse the if(...) block in pim_stats added by my previous commit
Hiten Pandya [Fri, 12 Mar 2004 11:29:51 +0000 (11:29 +0000)]
Collapse the if(...) block in pim_stats added by my previous commit
and nuke an `error' variable.

Discussed with: Dag-Erling Smorgrav <des at freebsd.org>

15 years agoUse M_INTWAIT and M_WAITOK instead of M_NOWAIT within the USB bus
Matthew Dillon [Fri, 12 Mar 2004 03:43:06 +0000 (03:43 +0000)]
Use M_INTWAIT and M_WAITOK instead of M_NOWAIT within the USB bus
infrastructure.  For the system to operate as expected, allocations
done in this layer have to be reliable.

15 years agoChange M_NOWAIT to M_INTWAIT or M_WAITOK. CAM does a mediocre job checking
Matthew Dillon [Fri, 12 Mar 2004 03:24:43 +0000 (03:24 +0000)]
Change M_NOWAIT to M_INTWAIT or M_WAITOK.  CAM does a mediocre job checking
for NULL returns from malloc() and even when it does it generally causes
the device operation to fail instead of retrying, resulting in unacceptable
behavior.  M_NOWAIT semantics allow NULL to be returned during normal system
operation.  This is especially true in DragonFly.

Also remove much of the code that previously checked for NULL.  By using
M_INTWAIT or M_WAITOK, malloc() will panic rather then return NULL.  Only
the addition of M_NULLOK allows a blocking malloc() to return NULL, and we
do not use that flag in CAM.

Add M_ZERO to a number of malloc()'s and remove subsequent bzero()'s, and
add M_ZERO to a few mallocs (primarily for the read capacity data structure)
that did not bother zeroing out the structure before.  While the data is
supposed to be overwritten read-capacity is often quite fragile due to the
SCSI simulation layer, so we do not take any chances.

15 years agoUse info->td instead of curthread in ffs_reload_scan1(); although
Hiten Pandya [Thu, 11 Mar 2004 20:17:36 +0000 (20:17 +0000)]
Use info->td instead of curthread in ffs_reload_scan1(); although
info->td will be curthread in this case anyway, but purely for
uniformity.

Discussed with:  Matthew Dillon

15 years agoReplace a manual check for a VMIO candidate with vn_canvmio() under
Hiten Pandya [Thu, 11 Mar 2004 20:14:46 +0000 (20:14 +0000)]
Replace a manual check for a VMIO candidate with vn_canvmio() under
VFS_BIO_DEBUG.

This silences an annoying warning in getblk() when VMIO'ing on a
VDIR (directory) vnode; this happens due to vmiodirenable sysctl
being set to `1'.

Discussed with:  Matthew Dillon

15 years agoUse local cpu tcbinfo
Joerg Sonnenberger [Thu, 11 Mar 2004 17:22:52 +0000 (17:22 +0000)]
Use local cpu tcbinfo

15 years agoMega mdoc(7) update:
Hiten Pandya [Thu, 11 Mar 2004 12:29:00 +0000 (12:29 +0000)]
Mega mdoc(7) update:

* Introduce a .Dx macro, for meaning `DragonFly'.

* Use the .Dx macro where we mean `DragonFly' and
  revert to using .Fx where we mean `FreeBSD'.

* Update various sentences, paragraphs to be in
  context with DragonFly, and mention FreeBSD as
  required in HISTORY sections.

* Fix mdoc(7) markup wherever possible.

* Use .Fx wherever possible, and minimize the use
  of FreeBSD in favour of .Fx.  Do the same for
  `OpenBSD' and `NetBSD' by using `.Ox' and `.Nx'
  respectively.

* Correct a confusion of `FreeBSD' is `DragonFly'
  left by a previous commit to some of the manual
  pages, by using the appropriate .Dx/.Fx entities.

NOTE: contrib/ and other manual pages such as sysintall(8)
manual pages are left untouched, because the former should
not be modified directly and the latter has reached
'End of Life' stage.

Submitted by:
Aaron Malone <aaron@munge.net>, Hiten Pandya <hmp@backplane.com>

15 years agoLinux emulation system call update.
Hiten Pandya [Thu, 11 Mar 2004 09:53:19 +0000 (09:53 +0000)]
Linux emulation system call update.

Implement exit group of system calls needed for newer glibc binaries.
The system calls are just wired to exit(2) right now, because we do
not support Linux threading semantics very well.

The update actually originated from OpenBSD, which then went into
FreeBSD -HEAD CVS branch.

Obtained from: Rahul Siddharthan and Kip Macy (old version)

15 years agoConvert the code to ANSI style, and remove 'register' keywords.
Hiten Pandya [Thu, 11 Mar 2004 09:38:59 +0000 (09:38 +0000)]
Convert the code to ANSI style, and remove 'register' keywords.

No functional changes.

Submitted by: Chris Pressey <cpressey@catseye.mine.nu>
              (cpressey->commit_count++)

15 years agogdb was unable to obtain backtraces of pure threads. Change the 'proc'
Matthew Dillon [Wed, 10 Mar 2004 23:26:45 +0000 (23:26 +0000)]
gdb was unable to obtain backtraces of pure threads.  Change the 'proc'
command to take either a pid or a thread pointer (no longer a proc pointer),
and add hacks to calculate the stack pointer and frame pointer for switched
out pure threads (which do not use the PCB structure).

15 years agoANSIfication, remove 'register' and 'auto' use, convert K&R procedure decls.
Matthew Dillon [Wed, 10 Mar 2004 18:27:28 +0000 (18:27 +0000)]
ANSIfication, remove 'register' and 'auto' use, convert K&R procedure decls.
Fix one bug where getc() was being called on a FILE returned by fdopen()
before the a FILE was checked for NULL.

Submitted-by: Chris Pressey <cpressey@catseye.mine.nu>
15 years agoAllow %e, %E, %f, %g, %G formats to work without producing an error code.
Matthew Dillon [Wed, 10 Mar 2004 18:19:23 +0000 (18:19 +0000)]
Allow %e, %E, %f, %g, %G formats to work without producing an error code.

Taken-from: FreeBSD printf.c/1.27
Submitted-by: Chris Pressey <cpressey@catseye.mine.nu>
15 years agoMinor documentation adjustments.
Matthew Dillon [Wed, 10 Mar 2004 18:18:13 +0000 (18:18 +0000)]
Minor documentation adjustments.

Submitted-by: Chris Pressey <cpressey@catseye.mine.nu>
15 years agodislabel -> 16 partitions work addendum: MAKEDEV now understands and
Matthew Dillon [Wed, 10 Mar 2004 18:16:14 +0000 (18:16 +0000)]
dislabel -> 16 partitions work addendum: MAKEDEV now understands and
generates the new partition names, and now understands the bit we stole
from the slice in order to expand the number of paritions in the minor
number generation.

15 years agoANSIfication, convert K&R procedure declarations and remove 'register'.
Matthew Dillon [Wed, 10 Mar 2004 17:54:16 +0000 (17:54 +0000)]
ANSIfication, convert K&R procedure declarations and remove 'register'.
No operational changes.

Submitted-by: Chris Pressey <cpressey@catseye.mine.nu>
15 years agoFix spelling mistake, s/itnerrupts/interrupts/.
Hiten Pandya [Wed, 10 Mar 2004 13:04:40 +0000 (13:04 +0000)]
Fix spelling mistake, s/itnerrupts/interrupts/.

15 years agoExplain some of the instruction details in more depth.
Matthew Dillon [Wed, 10 Mar 2004 06:35:22 +0000 (06:35 +0000)]
Explain some of the instruction details in more depth.

Submitted-by: Rahul Siddharthan <rsidd@online.fr>
Additional-edits-by: Matthew Dillon
15 years agoAllow the nominal NFS io block size to be set with a sysctl vfs.nfs.nfs_io_size
Matthew Dillon [Wed, 10 Mar 2004 02:07:52 +0000 (02:07 +0000)]
Allow the nominal NFS io block size to be set with a sysctl vfs.nfs.nfs_io_size
and default it to the largest possible block size (32K), regardless of the
network transfer size settings.  nfs_iosize() is no longer based on the
network transfer size but is matched against the maximum data block size
for the protocol and transport (8K for NFSv2, 16K for NFSv3/UDP, 32K for
NFSv3/TCP).  Adjust statfs() reporting to suit.

This should improve performance over high bandwidth connections, primarily
by causing the client to use larger buffer cache buffers (16K or 32K instead
of 8K prior to this commit), and also improving read-ahead (which goes by
blocks).  In particular, while the largest network transfer size over UDP
is 16K, the largest transfer size of TCP is 32K, so TCP ought to reap the
largest reward w/ this commit.

Delay retrieval of mountpoint attributes until the mountpoint is actually
accessed or a df() occurs.

Submitted-by: Hiten Pandya <hmp@backplane.com>, and Matthew Dillon
15 years agoRemove a debug printf added with the last commit.
Joerg Sonnenberger [Tue, 9 Mar 2004 21:39:59 +0000 (21:39 +0000)]
Remove a debug printf added with the last commit.

15 years agoWhile converting ATA to use MPIPE allocations, ata_dmaalloc was changed
Joerg Sonnenberger [Tue, 9 Mar 2004 21:38:05 +0000 (21:38 +0000)]
While converting ATA to use MPIPE allocations, ata_dmaalloc was changed
to allocate the DMA buffer directly without checking if it already is.
Since atapi_queue_cmd and ad_start doesn't check this and the DMA buffer
is only freed from ad_free, ad_detach and atapi_detach, the MPIPE was
exhausted very soon. The calls the ata_dmafree has been removed in revision
1.9.

This adds an additional check wether a DMA buffer is already allocated and
reuses that instead.

15 years agoClarify strange ipfw byte ordering convention.
Jeffrey Hsu [Tue, 9 Mar 2004 21:21:54 +0000 (21:21 +0000)]
Clarify strange ipfw byte ordering convention.

Consulted with: Luigi Rizzo <rizzo@icir.org>

15 years agoncpus2 must be initialized to 1 in the UP case. ncpus2_mask and ncpus2_shift
Matthew Dillon [Tue, 9 Mar 2004 18:05:27 +0000 (18:05 +0000)]
ncpus2 must be initialized to 1 in the UP case.  ncpus2_mask and ncpus2_shift
remain 0 in the UP case (cpu selection mask for one cpu always selects cpu #0).
This fixes a bug introduced by recent network commits, correcting a boot-time
panic on UP systems in in_pcblookup_hash().

15 years agoAdjust IPFW to use M_WAITOK instead of M_NOWAIT. The M_NOWAIT flag on
Hiten Pandya [Tue, 9 Mar 2004 15:00:06 +0000 (15:00 +0000)]
Adjust IPFW to use M_WAITOK instead of M_NOWAIT.  The M_NOWAIT flag on
DragonFly is very explicit about its behavior, which can result in a
panic.

Only spl protected calls are using M_NOWAIT.

Submitted by: Craig Dooley <craig@xlnx-x.net>

15 years agoFix violating usage of M_DONTWAIT in calls to malloc() by replacing
Hiten Pandya [Tue, 9 Mar 2004 14:57:18 +0000 (14:57 +0000)]
Fix violating usage of M_DONTWAIT in calls to malloc() by replacing
them with M_NOWAIT.

Submitted by: Craig Dooley <craig@xlnx-x.net>

15 years agoAddendum comment to last commit. Jeffrey Hsu reminded me that kernel writes
Matthew Dillon [Tue, 9 Mar 2004 02:52:10 +0000 (02:52 +0000)]
Addendum comment to last commit.  Jeffrey Hsu reminded me that kernel writes
are not subject to socket buffer limitations, so the Linux bug referenced
in the last commit should not occur even without this commit.  However,
the larger socket buffers should have a positive effect on our ability to
stream received data, especially over GigE links.

15 years agoIncrease the default socket buffer for NFS to deal with linux bugs and to
Matthew Dillon [Mon, 8 Mar 2004 23:52:53 +0000 (23:52 +0000)]
Increase the default socket buffer for NFS to deal with linux bugs and to
improve performance.   The default nfs socket buffer is now 65535 bytes,
settable with a sysctl (vfs.nfs.soreserve).

It is my belief that when large data block sizes (32K) are negotiated,
the larger socket buff should improve read-ahead performance and reduce
nfs socket buffer lock contention that occurs with multiple nfsd's.  I
was able to do some testing over GigE and it did seem to help, but problems
with one of the machines made the tests less then reliable.

Credits: Richard Sharpe originally encountered issues with linux NFS
clients that were traced to linux doing a bad job in its delayed-ack code.
David Rhodus created an initial patch which I used as a partial basis for
this commit (circa October 2003).

15 years agoAdd -B to display buffer limits instead of current buffer usage.
Matthew Dillon [Mon, 8 Mar 2004 22:41:05 +0000 (22:41 +0000)]
Add -B to display buffer limits instead of current buffer usage.

15 years agoPartition the TCP connection table.
Jeffrey Hsu [Mon, 8 Mar 2004 19:44:32 +0000 (19:44 +0000)]
Partition the TCP connection table.

15 years agoHandle failure in atapi_queue_cmd correctly
Joerg Sonnenberger [Mon, 8 Mar 2004 15:13:56 +0000 (15:13 +0000)]
Handle failure in atapi_queue_cmd correctly

15 years agoFix panic in acd_report_key when ai->format==DVD_INVALIDATE_AGID.
Joerg Sonnenberger [Mon, 8 Mar 2004 13:31:57 +0000 (13:31 +0000)]
Fix panic in acd_report_key when ai->format==DVD_INVALIDATE_AGID.

15 years agoDocument that kldload(2) can also return EEXIST.
Hiten Pandya [Mon, 8 Mar 2004 12:46:12 +0000 (12:46 +0000)]
Document that kldload(2) can also return EEXIST.

15 years agoMerge from FreeBSD:
Hiten Pandya [Mon, 8 Mar 2004 07:55:57 +0000 (07:55 +0000)]
Merge from FreeBSD:

Fix handling of negative hexadecimal integers.
(originally from NetBSD)

Submitted by: Chris Pressey <cpressey@catseye.mine.nu>

15 years agoMerge from FreeBSD:
Hiten Pandya [Mon, 8 Mar 2004 07:50:03 +0000 (07:50 +0000)]
Merge from FreeBSD:

Add more partition types.

Submitted by: Chris Pressey <cpressey@catseye.mine.nu>

15 years agoMerge from FreeBSD:
Hiten Pandya [Mon, 8 Mar 2004 07:47:25 +0000 (07:47 +0000)]
Merge from FreeBSD:

Clarify a sentence.

Submitted by: Chris Pressey <cpressey@catseye.mine.nu>

15 years agoTo comply with the spec, do not copy the TOS from the outer IP
Jeffrey Hsu [Mon, 8 Mar 2004 07:43:44 +0000 (07:43 +0000)]
To comply with the spec, do not copy the TOS from the outer IP
header to the inner IP header of the PIM Register if this is a PIM
Null-Register message.

Submitted by: Pavlin Radoslavov <pavlin@icir.org>

15 years agoInclude <sys/types.h> for autoconf/automake detection.
Jeffrey Hsu [Mon, 8 Mar 2004 07:38:20 +0000 (07:38 +0000)]
Include <sys/types.h> for autoconf/automake detection.

Submitted by: Pavlin Radoslavov <pavlin@icir.org>

15 years agoThe "Don't forget to do a ``make depend''" warning no longer serves any
Matthew Dillon [Mon, 8 Mar 2004 06:13:17 +0000 (06:13 +0000)]
The "Don't forget to do a ``make depend''" warning no longer serves any
useful purpose, remove it.

From discussions with:  Chris Pressey <cpressey@catseye.mine.nu>

15 years agoConfig cleanup part 3/3: Remove the ns() and twisty eq() macros and replace
Matthew Dillon [Mon, 8 Mar 2004 03:28:02 +0000 (03:28 +0000)]
Config cleanup part 3/3: Remove the ns() and twisty eq() macros and replace
their use in the codebase with their contents (strdup() and !strcmp()).

Submitted-by: Chris Pressey <cpressey@catseye.mine.nu>
15 years agoConfig cleanup part 2/3: Remove old style C cruft.
Matthew Dillon [Mon, 8 Mar 2004 03:24:27 +0000 (03:24 +0000)]
Config cleanup part 2/3: Remove old style C cruft.

Submitted-by: Chris Pressey <cpressey@catseye.mine.nu>
15 years agoConfig cleanup part 1/3: Remove old style C cruft and cleanup some variable
Matthew Dillon [Mon, 8 Mar 2004 03:22:46 +0000 (03:22 +0000)]
Config cleanup part 1/3: Remove old style C cruft and cleanup some variable
names.

Submitted-by: Chris Pressey <cpressey@catseye.mine.nu>

15 years agoANSIfy the tsleep() and sched_setup() procedure definitions.
Matthew Dillon [Mon, 8 Mar 2004 03:05:27 +0000 (03:05 +0000)]
ANSIfy the tsleep() and sched_setup() procedure definitions.

Submitted-by: Peter Kadau <peter.kadau@tuebingen.mpg.de>
15 years agolibcaps now compiles ipiq and token in userland, make those files compile
Matthew Dillon [Mon, 8 Mar 2004 03:03:54 +0000 (03:03 +0000)]
libcaps now compiles ipiq and token in userland, make those files compile
properly in userland.

15 years agoPrint out Early Retransmit statistics.
Jeffrey Hsu [Mon, 8 Mar 2004 00:44:36 +0000 (00:44 +0000)]
Print out Early Retransmit statistics.

15 years agoImplement Early Retransmit.
Jeffrey Hsu [Mon, 8 Mar 2004 00:39:00 +0000 (00:39 +0000)]
Implement Early Retransmit.

15 years agoCosmetic changes.
Jeffrey Hsu [Mon, 8 Mar 2004 00:36:30 +0000 (00:36 +0000)]
Cosmetic changes.

15 years agoInitial CAPS IPC structural encoding and decoding support. Note that the
Matthew Dillon [Sun, 7 Mar 2004 23:36:45 +0000 (23:36 +0000)]
Initial CAPS IPC structural encoding and decoding support.  Note that the
kernel is uninvolved (other then in supplying the IPC mechanism).  After
careful consideration I decided that XML was just too much overkill but that
a human-readable format is still desireable.  The encoding format supports
integers, strings, opaque data, arrays, and is extensible and structural.

An example encoding of the struct passwd record for user 'nobody':

    Spasswd{F1D"nobody",F2D"%2a",F3Dfffe,F4Dfffe,F5D0,F6D"",F7D"Unprivileged%20user",F8D"/nonexistent",F9D"/sbin/nologin",FaD0}

Class elements include (S)tructure, (F)ield, (D)ata, (A)rray.  Data types are
free-form numeric (stored as hex), with the source responsible for encoding
negative numbers with a '-', and quoted opaque data (e.g. strings).  Any
class element may recurse using {}.  Structures and Arrays always recurse.
Unknown recursions are ignored by the decoder (for future backwards
compatibility).  Whitespace is allowed but most non-alpha-numeric characters
must be %-hex-escaped.

The decoder understands simple integer types, arrays, buffers, embedded
sub-structures, and string pointer structural elements.  It does not (yet)
understand multi-dimensional arrays, sparse element notation, or ** pointers.

This is a nice, compact encoding format that can be used for both packetized
messages and persistently-connected streams.  The initial commit only supports
full-messages, however.

15 years agoFrom FreeBSD:
Joerg Sonnenberger [Sun, 7 Mar 2004 21:35:27 +0000 (21:35 +0000)]
From FreeBSD:
When we get a packet error, move on, don't go into an infinite loop
looking at it.

fixes at least one cause of "hanging" due to this driver.

15 years agoSend UDP packets out without a temporary connect.
Jeffrey Hsu [Sun, 7 Mar 2004 18:38:38 +0000 (18:38 +0000)]
Send UDP packets out without a temporary connect.

15 years agoRemove perl from the i386 kernel build.
Eirik Nygaard [Sun, 7 Mar 2004 12:48:34 +0000 (12:48 +0000)]
Remove perl from the i386 kernel build.

15 years agoMove the ASSERT_VOP_LOCKED and ASSERT_VOP_UNLOCKED macros into its own
Eirik Nygaard [Sun, 7 Mar 2004 12:09:04 +0000 (12:09 +0000)]
Move the ASSERT_VOP_LOCKED and ASSERT_VOP_UNLOCKED macros into its own
functions.

Idea taken from: FreeBSD

15 years agoget rid of thr{1,2,3}, which are obsolete at the moment. Keep the
Matthew Dillon [Sun, 7 Mar 2004 01:13:43 +0000 (01:13 +0000)]
get rid of thr{1,2,3}, which are obsolete at the moment.  Keep the
caps system call tests.

15 years agoThe sys/xxx2.h files are supposed to be included after all the normal
Matthew Dillon [Sat, 6 Mar 2004 23:19:01 +0000 (23:19 +0000)]
The sys/xxx2.h files are supposed to be included after all the normal
sys/*.h files, not before.

Reported-by: David Rhodus <drhodus@machdep.com>
15 years agoAdjust the caps client/server test code to match new CAPS features. The
Matthew Dillon [Sat, 6 Mar 2004 22:15:00 +0000 (22:15 +0000)]
Adjust the caps client/server test code to match new CAPS features.  The
code also tests fork() handling and disconnect detection.

15 years agoAdditional CAPS IPC work. Add additional system calls to allow a CAPS
Matthew Dillon [Sat, 6 Mar 2004 22:14:16 +0000 (22:14 +0000)]
Additional CAPS IPC work.  Add additional system calls to allow a CAPS
server to set a generation number and a CAPS client to query it, which can
be used for any purpose but which is intended to allow a server to tell its
clients to invalidate their caches.

Add missing fork-handling code.  CAPS links are only good on a thread-by-thread
basis.  When a process forks/rforks/clones any active CAPS links will be
created as dummy entries in the forked process, causing CAPS syscalls to
return ENOTCONN.   This allows code based on CAPS to detect when it has been
forked so it can re-connect to the service.

Make a slight change to the API.  caps_sys_put() now returns an immediate
ENOTCONN if it forked.  Note that userland CAPS code must still deal with
the case where a message has been sent and the connection is lost before the
reply is returned.  The kernel automatically replies unreplied messages
with 0-length data in these cases.

Add additional flags to the API, including one that allows a client to
block when connecting to a non-existant service.

15 years agoBring libcaps in line with recent LWKT changes.
Matthew Dillon [Sat, 6 Mar 2004 19:48:22 +0000 (19:48 +0000)]
Bring libcaps in line with recent LWKT changes.

15 years agoSimplify LWKT message initialization semantics to reduce API confusion.
Matthew Dillon [Sat, 6 Mar 2004 19:40:32 +0000 (19:40 +0000)]
Simplify LWKT message initialization semantics to reduce API confusion.

Cleanup netisr messaging to provide more uniform error handling and to use
lwkt_replymsg() unconditionally for both async/auto-free and sync messages
as the abstraction intended.  This also fixes a reply/free race.

15 years agoRemove unused second argument to ip_stripoptions().
Jeffrey Hsu [Sat, 6 Mar 2004 07:30:44 +0000 (07:30 +0000)]
Remove unused second argument to ip_stripoptions().

15 years agoEliminate the use of curproc in route_output() by passing down the process id
Jeffrey Hsu [Sat, 6 Mar 2004 05:20:31 +0000 (05:20 +0000)]
Eliminate the use of curproc in route_output() by passing down the process id
it needs.

15 years agoChange the "struct inpcbhead *listhead" field in "struct inpcbinfo"
Jeffrey Hsu [Sat, 6 Mar 2004 05:00:41 +0000 (05:00 +0000)]
Change the "struct inpcbhead *listhead" field in "struct inpcbinfo"
to "struct inpcbhead listhead" so we can have a separate list per
"struct inpcbinfo" when it becomes per-cpu.

15 years agoUse 0 for integer value rather than NULL.
Jeffrey Hsu [Sat, 6 Mar 2004 03:26:57 +0000 (03:26 +0000)]
Use 0 for integer value rather than NULL.

15 years agoCorrect double increment of the inp generation count.
Jeffrey Hsu [Sat, 6 Mar 2004 03:20:02 +0000 (03:20 +0000)]
Correct double increment of the inp generation count.

15 years agoDispatch upper-half protocol request handling.
Jeffrey Hsu [Sat, 6 Mar 2004 02:36:25 +0000 (02:36 +0000)]
Dispatch upper-half protocol request handling.

15 years agoDispatch upper-half protocol request handling.
Jeffrey Hsu [Sat, 6 Mar 2004 01:59:52 +0000 (01:59 +0000)]
Dispatch upper-half protocol request handling.

15 years agoPropolice for GCC 3.3 based on:
Joerg Sonnenberger [Fri, 5 Mar 2004 21:38:44 +0000 (21:38 +0000)]
Propolice for GCC 3.3 based on:
http://www.trl.ibm.com/projects/security/ssp/gcc3_3/protector-3.3-7.tar.gz

protector.[ch] has been in integrated into cc3/cc_int and the protector.dif
has been splitted and integrated into cc3/cc_int/patches using the new
patch infrastructure. The old bsd-format.patch has been moved there as well.

The build order in gnu/ has been adjusted since lib/gcc3/libgcc depends on
"make depend" in usr.bin/cc3/cc_int for inclusion of the patched files.

The second stage loader has been adjusted to link when parts are compiled
using -fstack-protector.

15 years agoVerify code assumption on number of processors with a kernel assertion.
Jeffrey Hsu [Fri, 5 Mar 2004 20:00:03 +0000 (20:00 +0000)]
Verify code assumption on number of processors with a kernel assertion.

15 years agoUse power of 2 masking to make packet hash function fast.
Jeffrey Hsu [Fri, 5 Mar 2004 19:47:28 +0000 (19:47 +0000)]
Use power of 2 masking to make packet hash function fast.

15 years agoRemember the next lowest power of 2 of "npus" in "ncpus2".
Jeffrey Hsu [Fri, 5 Mar 2004 19:29:17 +0000 (19:29 +0000)]
Remember the next lowest power of 2 of "npus" in "ncpus2".

15 years agoPropagate curproc removal changes to files compiled by LINT.
Jeffrey Hsu [Fri, 5 Mar 2004 19:17:25 +0000 (19:17 +0000)]
Propagate curproc removal changes to files compiled by LINT.

15 years agoOnce we distribute socket protocol processing requests to different
Jeffrey Hsu [Fri, 5 Mar 2004 16:57:16 +0000 (16:57 +0000)]
Once we distribute socket protocol processing requests to different
processors, we no longer have a process context to refer to, so
eliminate the use of curproc in soreserve() by passing the sockbuf
resource limit all the down from the system call code to sbreserve().

Eliminate the use of curproc in unp_attach() by passing down the
fields it needs from the proc structure.  Define a pru_attach_info
structure to hold the information the attach usrreq function requires.

The thread argument to in_pcballoc() is unused, so we don't need
to pass a thread structure down to in_pcballoc().

15 years agoBring the BFE(4) manual page up-to-date with FreeBSD RELENG_4.
Hiten Pandya [Fri, 5 Mar 2004 13:07:02 +0000 (13:07 +0000)]
Bring the BFE(4) manual page up-to-date with FreeBSD RELENG_4.

Submitted by: Christian Brueffer <chris@unixpages.org>

15 years agoCorrect bug introduced in last commit.
Matthew Dillon [Fri, 5 Mar 2004 08:03:31 +0000 (08:03 +0000)]
Correct bug introduced in last commit.

Submitted-by: Chris Pressey <cpressey@catseye.mine.nu>
15 years agoAdd patch infrastructure for contrib/ and similiar directories.
Joerg Sonnenberger [Fri, 5 Mar 2004 01:06:50 +0000 (01:06 +0000)]
Add patch infrastructure for contrib/ and similiar directories.

This allows the inclusion of patches in SRCS in the following form:
this,is,the,source.c.patch
This will create ${.OBJDIR}/this/is/the/source.c by applying above patch
to ${CONTRIBDIR}/this/is/the/source.c. The patched files are deleted on
"make clean" and created by "make depend".

15 years agoI just scored a few duh-points for myself. I committed an older version
Hiten Pandya [Fri, 5 Mar 2004 00:10:31 +0000 (00:10 +0000)]
I just scored a few duh-points for myself.  I committed an older version
of the patch, because the patch file name got me confused.

Correct revision 1.7 of this file by using a proper conditional block.

15 years agothis -> the fix in comment.
Eirik Nygaard [Thu, 4 Mar 2004 20:52:27 +0000 (20:52 +0000)]
this -> the fix in comment.
Remove extra space in comment while I am here.

Submitted by: Chris Pressey <cpressey@catseye.mine.nu>