Commit Graph

29362 Commits

Author SHA1 Message Date
Matthew N. Dodd
47676b530c Don't put variable declarations in header files, put prototypes.
'pci_devq' provides useful information now.
2001-12-19 08:49:11 +00:00
Jonathan Lemon
a9c9684163 Extend the SYN DoS defense by adding syncookies to the syncache.
All TCP ISNs that are sent out are valid cookies, which allows entries
in the syncache to be dropped and still have the ACK accepted later.
As all entries pass through the syncache, there is no sudden switchover
from cache -> cookies when the cache is full; instead, syncache entries
simply have a reduced lifetime.  More details may be found in the
"Resisting DoS attacks with a SYN cache" paper in the Usenix BSDCon 2002
conference proceedings.

Sponsored by: DARPA, NAI Labs
2001-12-19 06:12:14 +00:00
John Baldwin
4db62c69c2 Display the right message for the SiS 645 chipset.
Submitted by:	Kent Stewart <kstewart@owt.com>
2001-12-19 01:53:11 +00:00
Peter Wemm
9f2f52d695 Do not initialize static/global variables to 0. Use bss instead of
taking up space in the data section.
2001-12-19 01:35:18 +00:00
Peter Wemm
8f0d41d324 Use a different mechanism to get the vnlru process to wake up and notice
the shutdown request at reboot/halt time.
Disable the printf 'vnlru process getting nowhere, pausing...' and instead
export the count to the debug.vnlru_nowhere sysctl.
2001-12-19 01:31:12 +00:00
John Baldwin
c8e555ec14 Fix comment for the SiS 645 chipset to be 645 instead of 635. 2001-12-19 01:23:32 +00:00
John Baldwin
a3ac299561 Make RFPPWAIT a kernel-only flag. Programs desiring this feature should
use vfork() rather than manually invoking rfork().
2001-12-19 00:55:13 +00:00
Luigi Rizzo
d105c784d5 Complete the device polling support by adding a thread in charge
of polling interfaces at the lowest possible priority
(this might result in softnetisr being scheduled, but there is
no risk of livelock because they have a higher priority than
this thread).
2001-12-19 00:53:24 +00:00
John Baldwin
885ccc61f2 Return EINVAL if kernel only flags are passed to the rfork syscall rather
than silently masking them.
2001-12-19 00:53:23 +00:00
John Baldwin
7235f2b1e9 Axe stale extern for a non-existent variable. 2001-12-18 22:42:09 +00:00
Joerg Wunsch
038d1bbd1a Change the test for _MACHINE_ARCH == i386 into #ifdef __i386__ since it
otherwise breaks on the Alpha arch.  I think this is wrong since i'd
actually like to probe for a PC architecture, not for a particular CPU
type.  Anyway, now it's again the way it used to be.
2001-12-18 22:16:33 +00:00
Matthew Dillon
fdb33f08ef This is a forward port of Peter's vlrureclaim() fix, with some minor mods
by me to make it more efficient.  The original code had serious balancing
problems and could also deadlock easily.  This code relegates the vnode
reclamation to its own kproc and relaxes the vnode reclamation requirements
to better maintain kern.maxvnodes.  This code still doesn't balance as well
as it could, but it does a much better job then the original code.

Approved by:	re@freebsd.org
Obtained from:	ps, peter, dillon
MFS Assuming:	Assuming no problems crop up in Yahoo testing
MFC after:	7 days
2001-12-18 20:48:54 +00:00
John Baldwin
acec0a5867 Merge part of revision 1.18 of sys/i386/linux/linux_machdep.c: don't use
RFTHREAD in linux_clone().
2001-12-18 18:50:02 +00:00
Julian Elischer
45449f8432 In a couple of places, we recalculated addresses we already had in local
pointer variables.
2001-12-18 18:46:32 +00:00
John Baldwin
d961068fba Don't use RFTHREAD when creating a kernel process. 2001-12-18 18:42:02 +00:00
Kirk McKusick
f305c5d199 Change the atomic_set_char to atomic_set_int and atomic_clear_char
to atomic_clear_int to ease the implementation for the sparc64.

Requested by:	Jake Burkholder <jake@locore.ca>
2001-12-18 18:05:17 +00:00
John Baldwin
1857e7825f Whitespace fix. 2001-12-18 18:03:48 +00:00
Ruslan Ermilov
4aa5d00e3d Fixed the bug in transparent TCP proxying with the "encode_ip_hdr"
option -- TcpAliasOut() did not catch the IP header length change.

Submitted by:	Stepachev Andrey <aka50@mail.ru>
2001-12-18 16:13:45 +00:00
John Baldwin
48fd1f38ee - Change all callers of addupc_task() to check PS_PROFIL explicitly and
remove the check from addupc_task().  It would need sched_lock while
  testing the flag anyways.
- Always read sticks while holding sched_lock using a temporary variable
  where needed.
- Always init prticks to 0 in ast() to quiet a warning.
2001-12-18 09:06:10 +00:00
John Baldwin
3f9a462fb9 Various assembly fixes mostly in the form of using the "+" modifier for
output operands to mark them as both input and output rather than listing
operands twice.

Reviewed by:	bde
2001-12-18 08:54:39 +00:00
John Baldwin
e4e991e117 Allow the ATOMIC_ASM() macro to pass in the constraints on the V parameter
since the char versions need to use either ax, bx, cx, or dx.

Submitted by:	Peter Jeremy (mostly)
Recommended by:	bde
2001-12-18 08:51:34 +00:00
Peter Wemm
1b4a3b2ffd Fix warnings: the bge_bpd_read*() functions are not used (#ifdef notdef) 2001-12-18 08:03:25 +00:00
Peter Wemm
6197ca159f Fix warning; line 1640: ciss_abort_request defined but not used. 2001-12-18 08:01:48 +00:00
John Baldwin
810ffc1e83 - Add a function to convert 6 byte SCSI commands for read, write, mode
sense, and mode select into their 10 byte equivalents.  Eventually the
  da(4) driver will become more intelligent about this, or at least allow
  umass(4) to pass quirks in directly.  However, this is a functional
  workaround until a better fix is implemented.
- Use the 6 to 10 conversion function to allow the ATAPI and UFI command
  sets to emulate 6 byte commands with 10 byte commands.
- Use the ATAPI command set rather than UFI for the ScanLogic SL11R-IDE
  as it supports the SYNCH_CACHE command.
- Enable ATAPI command set support.
- Pass READ/WRITE_12 commands through for UFI support as the UFI spec
  says they should be supported.
- Update a comment in the UFI translation function since we handle
  MODE_SELECT.
2001-12-18 07:55:17 +00:00
Orion Hodson
0225c5ac86 Add calibration test to determine extent of AC97 overclocking (if any). 2001-12-18 03:29:31 +00:00
David E. O'Brien
99364715f7 With GCC 3, we *must* use the GCC stdarg.h. We can no longer just make
_BSD_VA_LIST_ match what we think the compiler is doing.
2001-12-18 03:28:08 +00:00
Ian Dowse
9669bb479a Avoid passing the variable `tl' to functions that just use it for
temporary storage. In the old NFS code it wasn't at all clear if
the value of `tl' was used across or after macro calls, but I'm
fairly confident that the convention was to keep its use local.
Each ex-macro function now uses a local version of this variable,
so all of the double-indirection goes away.

The only exception to the `local use' rule for `tl' is nfsm_clget(),
which is left unchanged by this commit.

Reviewed by:	peter
2001-12-18 01:22:09 +00:00
John Baldwin
7e1f6dfe9d Modify the critical section API as follows:
- The MD functions critical_enter/exit are renamed to start with a cpu_
  prefix.
- MI wrapper functions critical_enter/exit maintain a per-thread nesting
  count and a per-thread critical section saved state set when entering
  a critical section while at nesting level 0 and restored when exiting
  to nesting level 0.  This moves the saved state out of spin mutexes so
  that interlocking spin mutexes works properly.
- Most low-level MD code that used critical_enter/exit now use
  cpu_critical_enter/exit.  MI code such as device drivers and spin
  mutexes use the MI wrappers.  Note that since the MI wrappers store
  the state in the current thread, they do not have any return values or
  arguments.
- mtx_intr_enable() is replaced with a constant CRITICAL_FORK which is
  assigned to curthread->td_savecrit during fork_exit().

Tested on:	i386, alpha
2001-12-18 00:27:18 +00:00
John Baldwin
1ecf0d56c8 Small cleanups to the SMP code:
- Axe inlvtlb_ok as it was completely redundant with smp_active.
- Remove references to non-existent variable and non-existent file
  in i386/include/smp.h.
- Don't perform initializations local to each CPU while holding the
  ap boot lock on i386 while an AP bootstraps itself.
- Reorganize the AP startup code some to unify the latter half of the
  functions to bring an AP up.  Eventually this might be broken out into
  a MI function in subr_smp.c.
2001-12-17 23:14:35 +00:00
Mike Silbersack
dcf11ee64e Fix a problem where stats overflow interrupts would cause
a major slowdown, and re-enable stats overflow interrupts.

For future reference, the bug was in our code, and not
some bug in the 3com chips.

Reviewed by:	wpaul
MFC after:	2 days
2001-12-17 22:24:19 +00:00
Munechika SUMIKAWA
29529b7cc4 Back out cometic changes. This is for easily syncing with KAME in other BSDs. 2001-12-17 18:13:12 +00:00
Brooks Davis
29410449c1 Initalize ifq_maxlen to prevent a harmless warning message.
MFC After:	1 day
Pointed out by:	jacks@sage-american.com, bmah
2001-12-17 07:49:34 +00:00
Orion Hodson
2ae4ee833d Added a sysctl control variable "ac97rate" to allow manual tuning of
the link rate - some ich motherboards overclock ac97 out of the box.

Will hopefully replace this with a callibration loop in time for 4.5R
freeze.

Problem reported by Luigi Rizzo and fix derived from his code (put
diff in ich.c rather than ac97.c).

MFC after:	3 days
2001-12-17 01:57:42 +00:00
Orion Hodson
1abb0234c3 Addition of sysctl variable to enable spdif. By default spdif is disabled.
MFC after:	3 days
2001-12-17 01:39:36 +00:00
Ian Dowse
143a5346c9 Make sure we ignore the value of `fs_active' when reloading the
superblock, and move the initialisation of it to beside where other
pointer fields are initialised.
2001-12-16 18:54:09 +00:00
Ian Dowse
3fa4044e34 Move the new superblock field `fs_active' into the region of the
superblock that is already set up to handle pointer types. This
fixes an accidental change in the superblock size on 64-bit platforms
caused by revision 1.24.
2001-12-16 18:51:11 +00:00
Justin T. Gibbs
786b4a3132 Remove reliance on i++ in multiple arguments to a function. C does not
guarantee the order of increment.

Noticed by: GCC 3.0 use by the Linux community and jhb
2001-12-16 17:38:30 +00:00
Mark Peek
bf43c504c9 Remove whitespace at end of line. 2001-12-16 17:21:16 +00:00
Luigi Rizzo
af1408e33f Add/correct description for some sysctl variables where it was missing.
The description field is unused in -stable, so the MFC there is equivalent
to a comment. It can be done at any time, i am just setting a reminder
in 45 days when hopefully we are past 4.5-release.

MFC after: 45 days
2001-12-16 16:07:20 +00:00
Yoshihiro Takahashi
b4db911dc6 MFi386: options.i386 revision 1.162 2001-12-16 09:04:08 +00:00
Yoshihiro Takahashi
d8b0c29b30 MFi386: files.i386 revision 1.385 2001-12-16 09:03:41 +00:00
Yoshihiro Takahashi
26f891b327 Merged from sys/isa/{fd.c,fdreg.h} revisions 1.222 and 1.15, respectively. 2001-12-16 09:00:03 +00:00
Joerg Wunsch
94896f7b05 Oops, forgot to commit one file in the fd driver mega update. Here it
is, some more constants for NE765 & Co.

Pointed out by: silby, Dave Cornejo <dave@dogwood.com>
2001-12-16 07:52:13 +00:00
Yoshihiro Takahashi
5229d0a11d Remove PC98 code. This file is not used by PC98. 2001-12-16 05:37:22 +00:00
Luigi Rizzo
6105f81565 Add code to export and print the description associated to sysctl
variables. Use the -d flag in sysctl(8) to see this information.

Possible extensions to sysctl:
 + report variables that do not have a description
 + given a name, report the oid it maps to.

Note to developers: have a look at your code, there are a number of
	variables which do not have a description.

Note to developers: do we want this in 4.5 ? It is a very small change
	and very useful for documentation purposes.

Suggested by: Orion Hodson
2001-12-16 02:55:41 +00:00
Archie Cobbs
b9bc94b33f Typo. 2001-12-15 20:53:15 +00:00
Archie Cobbs
6c12c2b195 Don't free a structure containing a 'struct callout' structure while that
callout is still pending.

MFC after:	3 days
2001-12-15 20:48:53 +00:00
Archie Cobbs
5c2c21f4a9 Fix access-after-free bug added in revision 1.31.
Detected by:	INVARIANTS
MFC after:	2 days
2001-12-15 19:59:28 +00:00
Joerg Wunsch
1a6bed6863 Long promised major enhancement set for the floppy disk driver:
. The main device node now supports automatic density selection for
  commonly used media densities.  So you can stuff your 1.44 MB and
  720 KB media into your drive and just access /dev/fd0, no questions
  asked.  It's all that easy, isn't it? :)

. Device density handling has been completely overhauled.  The old way
  of hardwired kernel density knowledge is no longer there.  Instead,
  the kernel now implements 16 subdevices per drive.  The first
  subdevice uses automatic density selection, while the remaining 15
  devices are freely programmable.  They can be assigned an arbitrary
  name of the form /dev/fd[:digit]+.[:digit:]{1,4}, where the second
  number is meant to either implement device names that are mnemonic
  for their raw capacity (as it used to be), or they can alternatively
  be created as "anonymous" devices like fd0.1 through fd0.15,
  depending on the taste of the administrator.  After creating a
  subdevice, it is initialized to the maximal native density of the
  respective drive type, so it needs to be customized for other
  densities by using fdcontrol(8).  Pseudo-partition devices (fd0a
  through fd0h) are still supported as symlinks.

. The old hack to use flags 0x1 to always assume drive 0 were there is
  no longer supported; this is now supposed to be done by wiring the
  devices down from the loader via device flags.  On IA32
  architectures, the first two drives are looked up in the CMOS
  configuration records though.  On PCMCIA (i. e., the Y-E Data
  controller of the Toshiba Libretto), a single drive is always
  assumed.

. Other specialities like disabling the FIFO and not probing the drive
  at boot-time are selected by per-controller or per-drive flags, too.

. Unit attentions (media has been changed) are supposed to be detected
  now; density autoselection only occurs after a unit attention.  (Can
  be turned off by a per-drive flag, this will cause each Fdopen() to
  perform the autoselection.)

. FM floppies can be handled now (on controllers that actually support
  it -- not all do these days).

. Fdopen() can be told to avoid density selection by setting
  O_NONBLOCK; this leaves the descriptor in a half-opened state where
  only a few ioctls are accepted.  This is necessary to run fdformat
  on a device that uses automatic density selection (since you cannot
  autoselect on an unformatted medium, obviously).

. Just differentiate between a plain old NE765 and the enhanced chips,
  but don't try more; the existing code was wrong and only misdetected
  the chips anyway.

BUGS and TODOs:

. All documentation update still needs to be done.

. Formatting not-so-standard format yields unpredictable results; i
  have yet to figure out why this happens.  "Standard" formats like
  720 and 1440 KB do work, however.

. rc scripts are needed to setup device nodes with nonstandard
  densities (like the old /dev/fdN.MMM we used to have).

. Obtaining device flags from the kernel environment doesn't work yet,
  thus currently only drives that are present in (IA32) CMOS are
  really detected.  Someone who knows the odds and ends about device
  flags is needed here, i can't figure out what i'm doing wrong.

. 2.88 MB still needs to be done.
2001-12-15 19:09:04 +00:00
Noriaki Mitsunaga
1e83e65c8b Add modules of scsi_low based SCSI drivers ncv, nsp, stg, and common
part scsi_low.

Submitted-by: takawata
2001-12-15 12:44:38 +00:00