Commit Graph

123067 Commits

Author SHA1 Message Date
Wojciech A. Koszek
4bfd989f3e Keep proper order of includes. Additionally, sort them. Make functions used
in that file static.

Approved by:	cognet (mentor)
2006-03-26 22:52:36 +00:00
Robert Watson
63b01ffd34 Add a sysctl, regression.sonewconn_earlytest, which when options
REGRESSION is enabled, allows user space to dictate that sonewconn()
should skip it's "skip the hard work" check to see if the listen
queue is full, and instead proceed with allocation of a socket and
trimming of the overflowed queue.  This makes it easier to test the
queue overflow logic.

MFC after:	1 month
2006-03-26 22:44:37 +00:00
Robert Watson
d9949cb211 Declare regression subtree in sysctl.h so that components outside of
kern_mib.c can easily add regression sysctls.

MFC after:	1 month
2006-03-26 22:29:45 +00:00
Olivier Houchard
ac2bfec884 Implement pmap_object_init_pt() the way it is on sparc64/alpha, by doing
nothing except asserting the vm object is locked, and a device object,
instead of a useless printf.
2006-03-26 22:03:43 +00:00
Andrew Thompson
64cb85059e Assert that the mbuf is not shared to ensure problems like the last commit are
not reintroduced.
2006-03-26 20:52:47 +00:00
Robert Watson
0f5650dbf9 In spx_accept, assert ipxp != NULL, not == NULL.
MFC after:	1 month
2006-03-26 19:51:44 +00:00
Robert Watson
46589e7054 In various SPX protocol entry points from the socket layer, check
IPXP_DROPPED before continuing, and return EINVAL or ECONNRESET if
it is flagged.  It's unclear why each situation should be one or
the other, but it is copied from netinet which has the same bugs.

MFC after:	1 month
2006-03-26 19:37:37 +00:00
Robert Watson
d70f997e49 Add simple regression test to ping pong a data packet over SPX in stream
mode.  Support both connection via connect() and sendto(), but don't
compile in sendto() for now, since netipx doesn't appear to actually
implement that (doh).
2006-03-26 19:10:27 +00:00
Robert Watson
c0bb7e6a97 Add a simple IPX datagram regression test, which opens two IPX datagram
sockets, binds a local port, sends a datagram, and confirms that it is
received.
2006-03-26 18:25:53 +00:00
Robert Watson
8403b3d7cc Add a short README with configuration hints to get the netipx regression
tests up and running.  This is likely a message to myself in six months
when I've completely forgotten how.
2006-03-26 17:42:04 +00:00
Simon L. B. Nielsen
f4aac5a410 Use tr(1) to lowercase strings in a way which works with all locales.
Approved by:	cperciva (mentor)
2006-03-26 17:17:10 +00:00
Robert Watson
94fdcc2ee8 Modify ipxsocket regression test to create and close sockets several
times, with variable length sleeps between socket() and close().  This
will help to ensure that IPX/SPX timers fire while the sockets are
open, and hence have PCB's on the IPX pcb list, so that if timers are
going to stumble over PCB types they don't expect, it will happen as
part of this test.
2006-03-26 15:49:35 +00:00
Robert Watson
722542bc34 Add a new ipxpcb flag, IPXP_SPX, which is set on ipxpcb's to mark them
as belonging to SPX.  This replaces the implicit assumption that the cb
pointer for non-SPX pcb's will be NULL.  This isn't required in TCP/IP
as different pcb lists are maintained for different IP protocols; IPX
stores all pcbs on the same global ipxpcb_list.

Foot provided by:	gnn
MFC after:		1 month
2006-03-26 15:41:44 +00:00
Joseph Koshy
49874f6ea3 MFP4: Support for profiling dynamically loaded objects.
Kernel changes:

  Inform hwpmc of executable objects brought into the system by
  kldload() and mmap(), and of their removal by kldunload() and
  munmap().  A helper function linker_hwpmc_list_objects() has been
  added to "sys/kern/kern_linker.c" and is used by hwpmc to retrieve
  the list of currently loaded kernel modules.

  The unused `MAPPINGCHANGE' event has been deprecated in favour
  of separate `MAP_IN' and `MAP_OUT' events; this change reduces
  space wastage in the log.

  Bump the hwpmc's ABI version to "2.0.00".  Teach hwpmc(4) to
  handle the map change callbacks.

  Change the default per-cpu sample buffer size to hold
  32 samples (up from 16).

  Increment __FreeBSD_version.

libpmc(3) changes:

  Update libpmc(3) to deal with the new events in the log file; bring
  the pmclog(3) manual page in sync with the code.

pmcstat(8) changes:

  Introduce new options to pmcstat(8): "-r" (root fs path), "-M"
  (mapfile name), "-q"/"-v" (verbosity control).  Option "-k" now
  takes a kernel directory as its argument but will also work with
  the older invocation syntax.

  Rework string handling in pmcstat(8) to use an opaque type for
  interned strings.  Clean up ELF parsing code and add support for
  tracking dynamic object mappings reported by a v2.0.00 hwpmc(4).

  Report statistics at the end of a log conversion run depending
  on the requested verbosity level.

Reviewed by:	jhb, dds (kernel parts of an earlier patch)
Tested by:	gallatin (earlier patch)
2006-03-26 12:20:54 +00:00
Robert Watson
6882aa2c03 Define two new inpcb flags in the inp_vflag field, which for whatever
reason, seems to be where new flags are getting defined:

INP_DROPPED - The protocol has terminated this connection and the socket
              is not reusable: when the socket code enters the protocol,
              an error is immediately returned.  This will substitute for
              NULLing the so_pcb socket field, helping to implement the
              invariant that all valid sockets have valid pcb's in TCP.

INP_SOCKREF - The protocol has become the owner of the socket reference,
              and will need to free it when freeing the pcb, which will
              be used when a TCP socket is closed but still has queued
              data.

MFC after:	1 month
2006-03-26 11:30:31 +00:00
Robert Watson
a07b8fd178 Minor style tweak: tab after #define, not space.
MFC after:	1 month
2006-03-26 11:26:12 +00:00
Matt Jacob
a529c6a2dc Correct bad format args. Interesting- the lines that generated
the error on sparc64 hadn't changed since the last checkin, pass
LINT on other platforms and mpt doesn't work on sparc64 anyway
and the tinderbox build didn't work for me in a cross build case
on my main build machine (which runs RELENG_6). Sigh. Still
need to try harder.
2006-03-26 07:16:17 +00:00
Robert Watson
0597c8cf73 Restore original formulation of SPX segment queue draining during SPX
PCB detach.

MFC after:	1 month
2006-03-26 02:33:44 +00:00
Robert Watson
f4cda13bed Add simple ipxsocket regression test: open, and close, various IPX socket
types supported by the FreeBSD netipx implementation.
2006-03-26 01:58:39 +00:00
David Xu
d448272d3c Check cancellation state carefully to see we really need to call
_pthread_testcancel(). Preserve errno in _thr_suspend_check().
2006-03-26 01:57:03 +00:00
Robert Watson
e61dc6cac4 Take contrib/openbsm/etc configuration files off the vendor branch in
order to add $FreeBSD$ tags, which helps mergemaster better manage
updating them.

Requested by:	several
Obtained from:	TrustedBSD Project
2006-03-26 01:44:35 +00:00
Robert Watson
1c53f80637 Explicitly assert socket pointer is non-NULL in tcp_input() so as to
provide better debugging information.

Prefer explicit comparison to NULL for tcpcb pointers rather than
treating them as booleans.

MFC after:	1 month
2006-03-26 01:33:41 +00:00
Pawel Jakub Dawidek
d7fad9f651 Increase debug level for "Thread exiting." message. It's not that important
and is 0 by accident.

MFC after:	3 days
2006-03-25 23:30:36 +00:00
Ed Maste
d5fd66e17d The removal of CIRCLEQ left four queue macros. One sentence was missed
in the man page update.

PR:		docs/94938
Submitted by:	Ed Schouten <ed@fxq.nl>
MFC After:	3 days
2006-03-25 23:11:10 +00:00
Poul-Henning Kamp
29ed18f45e Get the MK_FOO column right 2006-03-25 21:51:46 +00:00
Max Laier
94f2dfdd76 Loopback pf_norm.c rev. 1.106 from OpenBSD:
fixup IP checksum when modifying IP header fields

PR:		kern/93849
Obtained from:	OpenBSD
MFC after:	3 days
2006-03-25 21:15:25 +00:00
Robert Watson
3c09bd01d8 In at_setsockaddr(), assert that ddp != NULL, rather than returning an
error if it's NULL, as so_pcb != NULL is now an invariant.
2006-03-25 18:54:17 +00:00
Matt Jacob
441201ce65 Move the check for non-ATIO_CMD ahead of the cache chech so that
completion for unsupported commands doesn't abort.

Reviewed by:	nate
MFC after:	2 weeks
2006-03-25 18:18:26 +00:00
Robert Watson
818812244b Rework IPX/SPX socket and pcb reference model:
- Introduce invariant that all IPX/SPX sockets will have valid so_pcb
  pointers to ipxpcb structures, and that for SPX, the control block
  pointer will always be valid.  Don't attempt to free the socket or
  pcb at various odd points, such as disconnect.

- Add a new ipxpcb flag, IPXP_DROPPED, which will be set in place of
  freeing PCB's so that this invariant can be maintained.  This flag
  is now checked instead of a NULL check in various socket protocol
  calls.

- Introduce many assertions that this invariant holds.

- Various pieces of code, such as the SPX timer code, no longer needs
  to jump through hoops in case it frees a PCB while running.

- Break out ipx_pcbfree() from ipx_pcbdetach().  Likewise
  spx_pcbdetach().

- Comment on some SMP-related limitations to the SPX code.

- Update copyrights.

MFC after:	1 month
2006-03-25 17:28:42 +00:00
Robert Watson
92676aa962 Restructure spx_attach() to properly free memory in the event that one
of its allocations fails.  Allocate the ipxp last so as to avoid having
to free it if another allocation goes wrong.

Normalize retrieval of ipxp and cb from socket in spx_sp_attach(), and
add assertions.

MFC after:	1 month
2006-03-25 15:03:29 +00:00
Robert Watson
e7b7fc0ecd Don't bother restoring host byte order of mbuf fields when we're just
about to free the mbuf in the spx_input() error path.

MFC after:	1 month
2006-03-25 14:45:08 +00:00
Robert Watson
3945bca516 In spx_ctloutput(), acquire the ipxp lock around read operations,
especially reads of spx header structures, which will now be cached
in the stack until they can be copied out after releasing the lock.
Panic if a bad socket option direction is passed in by the caller.

MFC after:	1 month
2006-03-25 14:44:05 +00:00
Robert Watson
6d3d51f03e Slight style reformatting of spx_timers() comments; panic if an
unrecognized timer is passed into the function.

MFC after:	1 month
2006-03-25 14:29:03 +00:00
George V. Neville-Neil
a0196c3c89 First steps towards IPSec cleanup.
Make the kernel side of FAST_IPSEC not depend on the shared
structures defined in /usr/include/net/pfkeyv2.h  The kernel now
defines all the necessary in kernel structures in sys/netipsec/keydb.h
and does the proper massaging when moving messages around.

Sponsored By: Secure Computing
2006-03-25 13:38:52 +00:00
Hajimu UMEMOTO
90d1d883e9 - Use ANSI C prototype.
- Remove trailing space.
2006-03-25 11:46:37 +00:00
Poul-Henning Kamp
f5ce64b924 Update build survey scripts 2006-03-25 10:50:40 +00:00
Matt Jacob
c87e3f833c Some fairly major changes to this driver.
A) Fibre Channel Target Mode support mostly works
(SAS/SPI won't be too far behind). I'd say that
this probably works just about as well as isp(4)
does right now. Still, it and isp(4) and the whole
target mode stack need a bit of tightening.

B) The startup sequence has been changed so that
after all attaches are done, a set of enable functions
are called. The idea here is that the attaches do
whatever needs to be done *prior* to a port being
enabled and the enables do what need to be done for
enabling stuff for a port after it's been enabled.

This means that we also have events handled by their
proper handlers as we start up.

C) Conditional code that means that this driver goes
back all the way to RELENG_4 in terms of support.

D) Quite a lot of little nitty bug fixes- some discovered
by doing RELENG_4 support. We've been living under Giant
*waaaayyyyy* too long and it's made some of us (me) sloppy.

E) Some shutdown hook stuff that makes sure we don't blow
up during a reboot (like by the arrival of a new command
from an initiator).

There's been some testing and LINT checking, but not as
complete as would be liked. Regression testing with Fusion
RAID instances has not been possible. Caveat Emptor.

Sponsored by: LSI-Logic.
2006-03-25 07:08:27 +00:00
David Xu
efe33769b9 Don't cancel thread if it is in critical region. 2006-03-25 07:03:13 +00:00
Ruslan Ermilov
0472dafab4 Revert last delta, it breaks cross-compiles. 2006-03-25 06:37:36 +00:00
Scott Long
2e21a3ef7e Add a driver for the new LSI MegaRAID SAS controller family. The 'MFI' name
is derived from the phrase 'MegaRAID Firmware Interface' used by LSI.  This
driver provides a block interface to logical disks on the card and a minimal
management device.  It is MPSAFE, INTR_FAST, and 64-bit capable.

Thanks to Dell for providing hardware to test with and IronPort for
sponsoring the work.

Sponsored by: Dell, Ironport
MFC After: 3 days
2006-03-25 06:14:32 +00:00
David Xu
f656ae703e Only wake up writer if the lock is free. 2006-03-25 05:14:21 +00:00
David Xu
07c7c80074 Compile thr_rtld.c 2006-03-25 05:00:54 +00:00
David Xu
b6b894f66b Add locking support for rtld. 2006-03-25 04:49:07 +00:00
Peter Wemm
045b6fdaf6 Make gcore(1) 64 bit safe. It was trying to parse the /proc/*/map file
using sscanf and truncating the start/end entries by writing them with a
32 bit int descriptor (%x).  The upper bytes of the 64 bit vm_offset_t
variables (for little endian machines) were uninitialized.  For big endian
machines, things would have been worse because it was storing the 32 bit
value in the upper half of the 64 bit variable.  I've changed it to use
%lx and long types.  That should work on all our platforms.
2006-03-25 01:14:20 +00:00
SUZUKI Shinsuke
4b8b545e4b fixed a potential memory leak
Obtained from: KAME
MFC after: 1 day
2006-03-24 23:59:51 +00:00
Colin Percival
256c62e23f Only set the size of /usr to whatever-is-left is whatever-is-left is
greater than the size we autosized.  Without this fix, systems with
drives under 10GB can end up with very small /usr partitions...

Broken since:	January 2002
Tripped over by: simon
2006-03-24 22:45:24 +00:00
Jason Evans
0c21f9eda7 Convert TINY_MIN_2POW from a cpp macro to tiny_min_2pow (a variable), and
determine its value at run time according to other relevant values.  This
avoids the creation of runs that are incompletely utilized, as long as
pagesize isn't too large (>32kB, given the current RUN_MIN_REGS_2POW
setting).

Increase the size of several structure bitfields in arena_run_t in order
to avoid integer overflow in the case that a run's header does not overlap
with the space that is usable as application allocation regions.  Given
the tiny_min_2pow change, this fix has no additional impact unless
pagesize is >32kB.

Reported by:	kris
2006-03-24 22:13:49 +00:00
Robert Watson
a52526165e Include kernel.h to get NET_NEEDS_GIANT() definition, which for some
reason compiled fine here.  I may be running with other include file
changes locally.

MFC after:	3 days
2006-03-24 20:08:48 +00:00
Sam Leffler
512537d1a4 stop device so we don't panic on card removal when active
MFC after:	3 days
2006-03-24 19:11:26 +00:00
John Baldwin
93a5035fd7 Change the -S and -t options to override each other so that the last one
specified wins to make their interaction less confusing.
2006-03-24 17:09:03 +00:00