Commit Graph

123080 Commits

Author SHA1 Message Date
Sam Leffler
42568791f9 implement set(IEEE80211_IOC_STA_STATS) for hostapd; for
now just make it clear station statistics (could read
a stat block and assign to caller can do partial changes)

Reviewed by:	avatar (previous version)
MFC after:	1 week
2006-03-27 05:22:35 +00:00
Alan Cox
7c8dcf2def Use NET_LOCK_GIANT() and VFS_LOCK_GIANT() instead of unconditionally
acquiring Giant in kern_sendfile().

Guard against the forced reclamation of a vnode in kern_sendfile().

Discussed with: jeff
Reviewed by: tegge
MFC after: 3 weeks
2006-03-27 04:23:16 +00:00
Robert Watson
1322b45c3d Canonicalize copyright order in one more file that contains my
copyright.

MFC after:	1 month
2006-03-27 01:12:58 +00:00
Pav Lucistnik
8a50f51b1b - Document LD_32_* environment variables
- Mention 32-bit files in FILES section

MFC after:	1 week
2006-03-27 00:53:58 +00:00
Pav Lucistnik
e351e2aada - Document libmap32.conf
MFC after:	1 week
2006-03-27 00:53:11 +00:00
Robert Watson
c3784d3460 In spx_output(), use M_DONTWAIT instead of M_TRYWAIT, as we hold the
ipxpcb mutex.  Contrary to the comment, even in 4.x this was unsafe,
as parallel use of the socket by another process would result in pcb
corruption if the mbuf allocation slept.

MFC after:	1 month
2006-03-27 00:48:21 +00:00
Wojciech A. Koszek
ea3d97ae67 For now, bring back some of the old bits as a fix for specifying md(4)
device number at creation time with -u option. Together with XMLizing
mdconfig(8), I broke this functionality.

This change is temporary. Complete fix will be commited soon.

Approved by:	cognet (mentor)
2006-03-27 00:46:22 +00:00
Olivier Houchard
8f2937b824 Erm don't use -mno-apcs-frame if we're going to do profiling either, it's not
exactly compatible.
2006-03-27 00:32:46 +00:00
Robert Watson
dc6519ce4c In spx_input(), change a '&&' to a '||', as the spx trace code is able
to handle a NULL 'cb' here.

MFC after:	1 month
2006-03-27 00:08:32 +00:00
Robert Watson
416c476c47 Add spxabort, a simple netipx/spx regression test that triggers
pru_abort() by closing a listen socket while completed connections are
presenting in its listen queue.  Unfortunately, it's difficult to
trigger the other two pru_abort() cases using user APIs, so they are
not covered by this test.
2006-03-27 00:03:37 +00:00
Jason Evans
9f9bc9367c Allow the 'n' option to decrease the number of arenas below the default,
to as little as one arena.  Also, limit the number of arenas to avoid a
potential invariant violation in base_alloc().
2006-03-26 23:41:35 +00:00
Jason Evans
4328edf534 Add comments and reformat/rearrange code. There are no significant
functional changes in this commit.
2006-03-26 23:37:25 +00:00
Wojciech A. Koszek
c27a895433 Teach md(4) and mdconfig(8) how to understand XML. Right now there won't be
a problem with listing large number of md(4) devices. Either 'list' or
'query' mode uses XML.

Additionally, new functionality was introduced. It's possible to pass
multiple devices to -u:

	# ./mdconfig -l -u md0,md1

Approved by:	cognet (mentor)
2006-03-26 23:21:11 +00:00
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