Commit Graph

38813 Commits

Author SHA1 Message Date
Mike Silbersack
cb3b23ef1e Fix up the long mbuf chain recovery code to use m_defrag; the old
code messed up on B & C chipsets because it lost the packet header
and therefore the flag indicating the need for hardware checksums.

MFC after:	2 weeks
2003-03-29 06:34:25 +00:00
Alan Cox
9f6d45b1a4 Pass the vm_page's address to sf_buf_alloc(); map the vm_page as part
of sf_buf_alloc() instead of expecting sf_buf_alloc()'s caller to map it.

The ultimate reason for this change is to enable two optimizations:
(1) that there never be more than one sf_buf mapping a vm_page at a time
and (2) 64-bit architectures can transparently use their 1-1 virtual
to physical mapping (e.g., "K0SEG") avoiding the overhead of pmap_qenter()
and pmap_qremove().
2003-03-29 06:14:14 +00:00
Mike Silbersack
55e9f80d76 Add the m_defrag routine, as discussed on committers@. This
incarnation should address the concerns of all in the discussion,
and keeps statistics which show how much it is used.

MFC after:	2 weeks
2003-03-29 05:48:36 +00:00
Mike Silbersack
4a5ccac770 Add MBUF_FRAG_TEST to NOTES.
Submitted by:	Hiten Pandya <hiten@unixdaemons.com>
2003-03-29 05:46:34 +00:00
Matthew N. Dodd
d1b27132c9 Text formatting changes. 2003-03-29 01:53:13 +00:00
Matthew N. Dodd
c040a3e16e Don't panic if we aren't plugged into a hub. 2003-03-29 01:40:42 +00:00
Sam Leffler
aaea26ef3f add missing copyright notices
Noticed by:	Robert Watson
2003-03-28 20:28:05 +00:00
John Baldwin
16088e4a88 Check for the PS_NEEDSIGCHK flag in the right flags field. 2003-03-28 18:08:57 +00:00
Orion Hodson
6084370fe4 Perform warm reset if codec reports ready on attach.
Move AC97 link control power up poke so it is always performed on attach.
2003-03-28 16:33:15 +00:00
Mike Barcroft
a54ec1d233 Move details of dev_t (and udev_t) to <sys/_types.h>. 2003-03-28 15:27:30 +00:00
Robert Drehmel
be23103061 Sysctl treats long' and unsigned long' differently - fix a comment. 2003-03-28 14:17:17 +00:00
Max Khon
01114bfc94 bump __FreeBSD_version for thread-safe realpath(3) 2003-03-28 09:50:26 +00:00
Poul-Henning Kamp
10c665ef8f Fix an XXX: and implement LINUX_BLKGETSIZE correctly. 2003-03-28 08:58:11 +00:00
Warner Losh
129edde443 pccarddevs_data.h no longer generated 2003-03-28 06:44:57 +00:00
Warner Losh
2983138955 MFp4:
Don't generate the data file.
Use 0xffffffff rather than -1 for sign safety as these fields are uint32_t.
2003-03-28 06:43:50 +00:00
Matthew N. Dodd
0e91b7d532 - Clean up function calling conventions.
- Be consistent about what we call our softc.
- Minor formatting.
- Add some register definitions gleaned from NetBSD/Linux.
2003-03-28 06:27:08 +00:00
Mike Silbersack
df8c7fc96e Allow m_dup_pkthdr to accept mbufs with attached clusters as
targets.

Submitted by:	bmilekic
2003-03-28 05:57:48 +00:00
Ian Dowse
6205bf3107 Add a checksum to the kernel message buffer, and update it every
time a character is written. Use this at boot time to reject the
existing buffer contents if they are corrupt. This fixes a problem
seen on some hardware (especially laptops) where the message buffer
gets partially corrupted during a short power cycle or reset, but
the msgbuf structure is left intact so it gets reused, resulting
in random junk and control characters appearing in dmesg and
/var/log/messages.

PR:		kern/28497
2003-03-28 02:50:10 +00:00
Matthew N. Dodd
c591e5ebee Multicast support, gleaned from NetBSD's if_iy driver.
Submitted by:	 Craig Boston <craig@xfoil.gank.org>
2003-03-28 02:15:01 +00:00
Tor Egge
5e2e6a67c4 Check return value from vmapbuf instead of the function address. 2003-03-27 20:48:34 +00:00
David Schultz
8ee63f6eae Correct LDBL_* constants based on values from i386. 2003-03-27 20:38:22 +00:00
Matthew N. Dodd
aa5d693129 - Rely on ether_ifattach() to initialize part of our struct ifnet
rather than doing it ourself.
- Set ifq_maxlen.
- Include the size of the ethernet header when we allocate
  our mbuf chain in ieget().
2003-03-27 20:38:00 +00:00
Tor Egge
10dccf8ff2 Eliminate a buffer sleep/wakeup race. 2003-03-27 19:28:11 +00:00
Robert Watson
78183ac2d2 Trim "trustedbsd_" from the front of the policy module "short names";
the vendor is only included in the long name currently, reducing
verbosity when modules are registered and unregistered.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-03-27 19:26:39 +00:00
John Baldwin
0f9d6538bb Add missing includes from previous commit.
Reported by:	des
2003-03-27 18:18:35 +00:00
Maxim Konovalov
7778283b40 Fix indentation. 2003-03-27 15:00:10 +00:00
Maxim Konovalov
be1e4c5162 o Protect set_fs_param() by splimp(9).
Quote from kern/37573:

	There is an obvious race in netinet/ip_dummynet.c:config_pipe().
	Interrupts are not blocked when changing the params of an
	existing pipe.  The specific crash observed:

	... -> config_pipe -> set_fs_parms -> config_red

	malloc a new w_q_lookup table but take an interrupt before
	intializing it, interrupt handler does:

	... -> dummynet_io -> red_drops

	red_drops dereferences the uninitialized (zeroed) w_q_lookup
	table.

o Flush accumulated credits for idle pipes.
o Flush accumulated credits when change pipe characteristics.
o Change dn_flow_queue.numbytes type to unsigned long.

	Overlapping dn_flow_queue->numbytes in ready_event() leads to
	numbytes becomes negative and SET_TICKS() macro returns a very
	big value.  heap_insert() overlaps dn_key again and inserts a
	queue to a ready heap with a sched_time points to the past.
	That leads to an "infinity" loop.

PR:		kern/33234, kern/37573, misc/42459, kern/43133,
		kern/44045, kern/48099
Submitted by:	Mike Hibler <mike@cs.utah.edu> (kern/37573)
MFC after:	6 weeks
2003-03-27 14:56:36 +00:00
Poul-Henning Kamp
63728c47e8 Run a revision on the OAM api.
Use prefix gctl_ systematically.
Add flag with access perms for each argument.
Add ro/rw versions of argument building functions.
General cleanup.
2003-03-27 14:35:00 +00:00
Poul-Henning Kamp
5e52756d9d Check return value of g_call_me() 2003-03-27 14:32:52 +00:00
Maxim Konovalov
7102717ac1 o netisr_queue() returns 1 on success and 0 on failure,
fix a typo (?) in rev. 1.90.

PR:		kern/50163
2003-03-27 12:52:57 +00:00
Tim J. Robbins
cd6d3a03c8 Deregister the dev_clone event handler we registered - don't touch the
handlers installed by other devices.
2003-03-27 12:47:53 +00:00
Maxim Konovalov
089f4427b4 o Fix a comment.
o GC an unused macro.

PR:		kern/49083
Submitted by:	Bjoern A. Zeeb <bzeeb+freebsd@zabbadoz.net>
Not objected by: rwatson
2003-03-27 11:35:45 +00:00
Søren Schmidt
c7f547fde8 Biofinish the request if we cannot malloc in ad_start. 2003-03-27 10:48:21 +00:00
Poul-Henning Kamp
83e13864c3 Allocate the toplevel indir with M_WAITOK to avoid complicating things
needlessly.

Detected by:	rwatsons EvilMalloc(9)
2003-03-27 10:14:36 +00:00
Matthew N. Dodd
618095ccef Catch up with recent events. 2003-03-27 07:37:02 +00:00
Matthew N. Dodd
7736233b36 Add missing COMPAT_ISA_DRIVER().
Oops.
2003-03-27 05:40:40 +00:00
Jake Burkholder
0f0dfee4d5 Handle the fictitious pages created by the device pager. For fictitious
pages which represent actual physical memory we must strip off the fake
page in order to allow illegal aliases to be detected.  Otherwise we map
uncacheable in the virtual and physical caches and set the side effect bit,
as is required for mapping device memory.

This fixes gstat on sparc64, which wants to mmap kernel memory through a
character device.
2003-03-27 02:16:31 +00:00
Jake Burkholder
868aaa93bc Set the cache line size for subordinate pci bridges as well as for their
child devices.  This fixes dma timeouts for devices behind the bridge.

Reported by:	simokawa
Tested by:	simokawa
2003-03-27 02:01:59 +00:00
Tor Egge
5bbb806004 Add support for reading directly from file to userland buffer when the
O_DIRECT descriptor status flag is set and both offset and length is a
multiple of the physical media sector size.
2003-03-26 23:40:42 +00:00
Tor Egge
6b08046175 Adjust the number of vnodes scanned by vlrureclaim() according to the
size of the vnode list.
2003-03-26 22:15:58 +00:00
Robert Watson
f2538508f6 Permit debug.malloc.failure_rate to be specified using a tunable so
that the feature can be enabled during the boot process.  Note the
continued limitation that FreeBSD fails so rapidly with this setting
enabled that it's hard to narrow down particular failures for
correction; we really need per-malloc type failure rates.
2003-03-26 20:44:29 +00:00
Robert Watson
c26adbe322 Add MBTOM(), a macro that converts from an mbuf blocking disposition
flag (M_DONTWAIT / M_TRYWAIT) to a malloc(9) blocking disposition flag
(M_NOWAIT, M_WAITOK).  The semantic match isn't perfect, but for
scenarios where malloc data is used in the network stack, such as for
MAC labeling or for m_tags, we sometimes need to map from one to the
other to get the right blocking behavior.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-03-26 20:29:15 +00:00
Robert Watson
eae870cdb4 Add a new kernel option, MALLOC_MAKE_FAILURES, which compiles
in a debugging feature causing M_NOWAIT allocations to fail at
a specified rate.  This can be useful for detecting poor
handling of M_NOWAIT: the most frequent problems I've bumped
into are unconditional deference of the pointer even though
it's NULL, and hangs as a result of a lost event where memory
for the event couldn't be allocated.  Two sysctls are added:

debug.malloc.failure_rate

  How often to generate a failure: if set to 0 (default), this
  feature is disabled.  Otherwise, the frequency of failures --
  I've been using 10 (one in ten mallocs fails), but other
  popular settings might be much lower or much higher.

debug.malloc.failure_count

  Number of times a coerced malloc failure has occurred as a
  result of this feature.  Useful for tracking what might have
  happened and whether failures are being generated.

Useful possible additions: tying failure rate to malloc type,
printfs indicating the thread that experienced the coerced
failure.

Reviewed by:	jeffr, jhb
2003-03-26 20:18:40 +00:00
Paul Saab
90836fcf7d Nuke HTT from here too.
Spotted by:	jhb
2003-03-26 19:55:03 +00:00
Paul Saab
87437b0b89 Nuke options HTT infavor of machdep.hlt_logical_cpus tunable/sysctl.
This keeps the logical cpu's halted in the idle loop.  By default
the logical cpu's are halted at startup.  It is also possible to
halt any cpu in the idle loop now using machdep.hlt_cpus.

Examples of how to use this:
machdep.hlt_cpus=1	halt cpu0
machdep.hlt_cpus=2	halt cpu1
machdep.hlt_cpus=4	halt cpu2
machdep.hlt_cpus=3	halt cpu0,cpu1

Reviewed by:	jhb, peter
2003-03-26 19:49:34 +00:00
Peter Wemm
bb9cca1c2f Halt the cpus in the idle loop for SMP as well for several reasons:
1) Its critical for HTT.  There's less foot-shooting opportunity.
2) I've seen significant improvements in interactive response to commands
over ssh sessions.  I assume this is less lock contention.
3) As incentive to finish the idle cpu IPI wakeup stuff.
4) The machine on my desk was blowing hot air in my general direction
because somebody forgot to turn the hlt on, and it saves 50 watts per
cpu..

The machdep.cpu_idle_hlt sysctl is still available, but now the default
is the same as on UP kernels.
2003-03-26 19:40:29 +00:00
Robert Watson
847b14bd3c Add O_NONBLOCK to the vn_open_cred() flags for NFS client locking when
opening the POSIX fifo; convert ENXIO error returns to EOPNOTSUPP.

This improves handling of the case where the /var/run/lock fifo exists
but there is no listener: we immediately return EOPNOTSUPP rather
than blocking until a listener turns up.  This could occur during a
diskless boot before rpc.lockd is loaded, or if the lock file persists
across a reboot following the disabling of rpc.lockd.  This may have
suddenly started to occur due to fifo blocking fixes--previously it
looks like attempts to read on a fifo with no listener would time out
due to insufficient resources.

Reviewed by:	alfred
2003-03-26 19:21:34 +00:00
Tor Egge
128a0bb7e9 fp->f_offset doesn't need any protection when it isn't accessed. 2003-03-26 19:21:12 +00:00
Tor Egge
125ee0d161 Obtain Giant before calling kmem_alloc without M_NOWAIT and before calling
kmem_free if Giant isn't already held.
2003-03-26 18:44:53 +00:00
John Baldwin
35eb8c5aa2 Add a cleanup function to destroy the osname_lock and call it on module
unload.

Submitted by:	gallatin
Reported by:	Martin Karlsson <mk-freebsd@bredband.net>
2003-03-26 18:29:44 +00:00