Commit Graph

87 Commits

Author SHA1 Message Date
tanimura
e6fa9b9e92 Back out my lats commit of locking down a socket, it conflicts with hsu's work.
Requested by:	hsu
2002-05-31 11:52:35 +00:00
peter
ccccf52bbe Pacify gcc by preinitializing a variable. 2002-05-24 06:17:42 +00:00
peter
962a6ce9c8 Fix a few warnings by adding a missing prototype 2002-05-24 06:17:17 +00:00
arr
0239286d2c - Remove a few storage pools and replace them with UMA zones. The spans
code is now storage pool free, so I believe this only leaves the uni
  base not cleaned.
2002-05-24 00:39:58 +00:00
arr
d756e3ff88 - Turn a couple of storage pools into UMA zones and their associated calls
to the appropriate UMA api calls.
2002-05-24 00:38:25 +00:00
arr
13ab9fa614 - Fix uma_zcreate parameters -- don't pass M_* flags here, doh. 2002-05-23 23:21:00 +00:00
arr
4fe0504ac9 - Turn two more storage pools into UMA zones and make the related memory
allocations and frees use the UMA api.
2002-05-23 00:34:12 +00:00
tanimura
92d8381dd5 Lock down a socket, milestone 1.
o Add a mutex (sb_mtx) to struct sockbuf. This protects the data in a
  socket buffer. The mutex in the receive buffer also protects the data
  in struct socket.

o Determine the lock strategy for each members in struct socket.

o Lock down the following members:

  - so_count
  - so_options
  - so_linger
  - so_state

o Remove *_locked() socket APIs.  Make the following socket APIs
  touching the members above now require a locked socket:

 - sodisconnect()
 - soisconnected()
 - soisconnecting()
 - soisdisconnected()
 - soisdisconnecting()
 - sofree()
 - soref()
 - sorele()
 - sorwakeup()
 - sotryfree()
 - sowakeup()
 - sowwakeup()

Reviewed by:	alfred
2002-05-20 05:41:09 +00:00
arr
51bcef4eb2 - Remove the init routine for loop -- it broke something and I don't have
the time to fix it properly at the moment.
2002-05-07 20:50:10 +00:00
arr
e98eeb7929 - Use an array of init functions to be used in a for loop in our
initialization routine.
2002-05-07 20:37:40 +00:00
arr
3ee655b971 - Add atm_init_fn 2002-05-07 20:36:35 +00:00
arr
a4e47caebb - Add atm_sock_init()
- Move the Atm_pcb storage pool (atm_pcb_pool) to be an UMA zone.
2002-05-07 20:13:55 +00:00
arr
c73ea9d79b - Change the atm_cm_init function to take no argument. 2002-05-07 20:12:29 +00:00
arr
de0c0b47fe - Replaced the Atm_connection storage pool with an uma_zone of
Atm_connection items.
- Replaced the Atm_connvc storage pool with an uma_zone of Atm_connvc
  items.
- Created void atm_cm_init(void *) and added it to the netatm init code.
  I'm thinking that there will definetly be more ``subsystem'' init
  functions to be added so I'll probably change these calls to be a for
  loop through init routines (or something).
2002-05-02 07:27:29 +00:00
arr
009ce05bfe - Take advantage of the M_ZERO flag that can now be passed to uma_zalloc.
- Remove atm_uma_ctor() as the M_ZERO will zero out the memory for us.
2002-04-30 07:41:59 +00:00
tanimura
89ec521d91 Revert the change of #includes in sys/filedesc.h and sys/socketvar.h.
Requested by:	bde

Since locking sigio_lock is usually followed by calling pgsigio(),
move the declaration of sigio_lock and the definitions of SIGIO_*() to
sys/signalvar.h.

While I am here, sort include files alphabetically, where possible.
2002-04-30 01:54:54 +00:00
arr
d2d3484465 - Tweak wording of panic message to make more sense. 2002-04-24 22:32:48 +00:00
arr
34c9517fb0 - Turn the atm_stackq_pool into a uma_zone (and change it's name to
atm_stackq_zone).
- Change the related atm_allocate() and atm_free() calls into uma_zalloc()
  and uma_zfree() calls.
2002-04-24 20:56:23 +00:00
arr
35e5b8d0de - Remove atm_attributes_pool and the relating atm_allocate() and atm_free()
calls associated with the pool and the objects allocated out from the
  pool.
- Insert atm_attributes_zone which is a uma_zone that is used just as the
  atm_attributes_pool was (including the max objects value).  Also, used
  the appropriate zalloc and zfree's where necesary.
2002-04-24 18:06:18 +00:00
arr
b148c4db98 - Revert previous change of atm storage pools -> uma_zones until a solution
to atm_free() is written.
2002-04-22 18:26:05 +00:00
arr
9570c296c3 - Change the atm_attributes_pool and atm_stackq_pool to be uma_zone's
(with the appropriate set_max) rather than using the HARP storage pool
  code.
2002-04-22 05:11:44 +00:00
arr
ab6fdd245b - Nuke some more not needed #ifdef cruft. 2002-04-21 01:41:05 +00:00
arr
6fd993af4d - Create a ``zero fill'' constructor for uma_zcreate's ctor argument.
Inspired by: jake@
2002-04-20 09:04:58 +00:00
arr
d5c7cd00fd - Nuke small sgi ifdef bits. 2002-04-20 00:39:32 +00:00
arr
96e8895af5 - Nuke some more #ifdef sun related sections. 2002-04-19 21:38:43 +00:00
arr
40a938fb61 - Nuke some #ifdef sun4m code; it hasn't been updated in 4 years and is not
being used.
2002-04-19 20:02:03 +00:00
arr
122c24db48 - Change KM_ macro calls to the appropriate function call.
- Nuke KM_ macros from port.h

  This is a leadin step towards cleaning up this code as I wait for some
  ATM cards and a ATM switch to arrive.
2002-04-19 17:45:22 +00:00
mdodd
ada2b95a74 Fix missing commas. 2002-04-17 16:12:24 +00:00
mdodd
22ef639eab Remove a stray comment terminator that was hiding beyond 80 columns. 2002-04-17 07:04:58 +00:00
mdodd
27dbe32723 - Add defines for ABR and UBR traffic types.
- Add IDT bits to vendor/vendorapi/device enums.
- Add EISA to atm_bus enum.
2002-04-17 07:00:56 +00:00
mdodd
8296d838e2 Wrap function in #ifdef DIAGNOSTIC to compile with -Werror. 2002-04-17 00:30:38 +00:00
mdodd
5a47ea7645 Add ESA200 to enum atm_device. 2002-04-17 00:30:06 +00:00
jhb
db9aa81e23 Change callers of mtx_init() to pass in an appropriate lock type name. In
most cases NULL is passed, but in some cases such as network driver locks
(which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.

Tested on:	i386, alpha, sparc64
2002-04-04 21:03:38 +00:00
jhb
dc2e474f79 Change the suser() API to take advantage of td_ucred as well as do a
general cleanup of the API.  The entire API now consists of two functions
similar to the pre-KSE API.  The suser() function takes a thread pointer
as its only argument.  The td_ucred member of this thread must be valid
so the only valid thread pointers are curthread and a few kernel threads
such as thread0.  The suser_cred() function takes a pointer to a struct
ucred as its first argument and an integer flag as its second argument.
The flag is currently only used for the PRISON_ROOT flag.

Discussed on:	smp@
2002-04-01 21:31:13 +00:00
alfred
c61e01af35 Remove __P. 2002-03-20 08:00:54 +00:00
alfred
8c4c86de23 Remove __P. 2002-03-20 02:39:27 +00:00
julian
92a8c56dd6 Unbreak fore adapters from POV of warnings.
Define the atm_dev_free() routine so that its OK to free stuff that is defined
as volatile. Note this doesn't FORCE the arguemnts to be volatile,
just says that it's not an error if it is..
2002-02-27 21:12:44 +00:00
mjacob
f5604f2085 Replace a few more lines of code orphaned by MFREE going away.
MFC after:	1 day
2002-02-07 22:08:32 +00:00
julian
6019ad8c57 Allow this to compile again
not tested under LINT by: msmith
2002-01-30 23:38:31 +00:00
msmith
ea9c5a8d4c Initialise the intrq_present fields at runtime, not link time. This allows
us to load protocols at runtime, and avoids the use of common variables.

Also fix the ip6_intrq assignment so that it works at all.
2002-01-08 10:34:03 +00:00
dillon
86ed17d675 Give struct socket structures a ref counting interface similar to
vnodes.  This will hopefully serve as a base from which we can
expand the MP code.  We currently do not attempt to obtain any
mutex or SX locks, but the door is open to add them when we nail
down exactly how that part of it is going to work.
2001-11-17 03:07:11 +00:00
julian
5596676e6c KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
kris
7d13aa56bf Don't call log() without a format string.
MFC after:	2 weeks
2001-09-10 12:00:47 +00:00
jlemon
f729fe0a4a Wrap array accesses in macros, which also happen to be lvalues:
ifnet_addrs[i - 1]  -> ifaddr_byindex(i)
        ifindex2ifnet[i]    -> ifnet_byindex(i)

This is intended to ease the conversion to SMPng.
2001-09-06 02:40:43 +00:00
pirzyk
1b460ef2a3 Commited patch for uni signaling fix.
PR:		kern/28748
Submitted by:	Richard Hodges <rh@matriplex.com>
MFC after:	2 weeks
2001-07-11 16:31:50 +00:00
alfred
b4e56ebf76 Silence some warnings
Submitted by: LINT
2001-03-20 10:42:49 +00:00
asmodai
3065478332 Preceed/preceeding are not english words. Use precede and preceding. 2001-02-18 10:43:53 +00:00
bmilekic
4b6a7bddad * Rename M_WAIT mbuf subsystem flag to M_TRYWAIT.
This is because calls with M_WAIT (now M_TRYWAIT) may not wait
  forever when nothing is available for allocation, and may end up
  returning NULL. Hopefully we now communicate more of the right thing
  to developers and make it very clear that it's necessary to check whether
  calls with M_(TRY)WAIT also resulted in a failed allocation.
  M_TRYWAIT basically means "try harder, block if necessary, but don't
  necessarily wait forever." The time spent blocking is tunable with
  the kern.ipc.mbuf_wait sysctl.
  M_WAIT is now deprecated but still defined for the next little while.

* Fix a typo in a comment in mbuf.h

* Fix some code that was actually passing the mbuf subsystem's M_WAIT to
  malloc(). Made it pass M_WAITOK instead. If we were ever to redefine the
  value of the M_WAIT flag, this could have became a big problem.
2000-12-21 21:44:31 +00:00
phk
8ae10410a6 Add back some now needed #include <sys/systm.h>
Fix various warnings while here anyway.
2000-12-07 22:19:06 +00:00
jlemon
954e1d2ccd Lock down the network interface queues. The queue mutex must be obtained
before adding/removing packets from the queue.  Also, the if_obytes and
if_omcasts fields should only be manipulated under protection of the mutex.

IF_ENQUEUE, IF_PREPEND, and IF_DEQUEUE perform all necessary locking on
the queue.  An IF_LOCK macro is provided, as well as the old (mutex-less)
versions of the macros in the form _IF_ENQUEUE, _IF_QFULL, for code which
needs them, but their use is discouraged.

Two new macros are introduced: IF_DRAIN() to drain a queue, and IF_HANDOFF,
which takes care of locking/enqueue, and also statistics updating/start
if necessary.
2000-11-25 07:35:38 +00:00