Commit Graph

110 Commits

Author SHA1 Message Date
christos
cb70a32776 Coverity CID 848: Protect against NULL deref. 2006-04-15 04:58:14 +00:00
yamt
bd149b4812 m_copyback0:
- unify two copies of code to extend a chain.
- when extending a chain,
	- use trailing space of the last mbuf if any.
	- use mbuf cluster if appropriate.
2006-03-19 10:07:19 +00:00
yamt
3aa5cee09f m_print: fix the previous correctly. 2006-03-18 18:17:19 +00:00
chris
3b6dcb2526 Fix Coverity CID 1473: Static buffer overrun.
Add a counter for the number of pages, so that we print out the ext_pgs
values.
2006-03-18 17:37:17 +00:00
yamt
2ff5a7c85c m_copyback0: add comments and assertions. 2006-03-15 10:40:30 +00:00
yamt
e8a3b3eb83 add ddb "sh mbuf" command. 2006-01-24 13:02:57 +00:00
perry
144515ce1a u_intN_t -> uintN_t 2005-12-26 18:41:36 +00:00
thorpej
b99f870719 Sprinkle static. 2005-12-08 03:11:14 +00:00
skrll
261d102fbb Typo in comment. 2005-11-09 17:54:12 +00:00
yamt
2e85eff671 - introduce M_MOVE_PKTHDR and use it where appropriate.
intended to be mostly API compatible with openbsd/freebsd.
- remove a glue #define in netipsec/ipsec_osdep.h.
2005-08-18 00:30:58 +00:00
martin
71d020f371 Since we decided "const struct mbuf *" would not do the right thing (tm),
remove ~all const from mbuf pointers.
2005-06-06 06:06:50 +00:00
martin
36c7f61f8f Constify the source arg of m_copydata 2005-06-06 04:50:28 +00:00
explorer
48c9742722 restore NetBSD RCS tag in __KERNEL_RCSID() macro 2005-06-02 15:48:11 +00:00
tron
a40b37b948 Change first argument of m_copydata() back to "struct mbuf *" because
m_copydata() might eventually modify the "mbuf" structure to support
lazy mbuf mapping as pointed out by YAMAMOTO Takashi on "tech-net".
2005-06-02 15:19:28 +00:00
tron
c4f68c0d95 Add missing RCS id. Problem pointed out by Jukka Salmi. 2005-06-02 12:58:16 +00:00
tron
f0abca45e5 Fix bad botch invented in last change. 2005-06-02 12:42:10 +00:00
tron
c54394a240 Change the first argument of m_copydata() to "const struct mbuf *" (which
doesn't require any implementation changes). This will allow us to get
rid off a lot of nasty type casts.
2005-06-02 10:34:59 +00:00
yamt
6b2d8b66a4 merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
  save some resources like pv_entry.  also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
2005-04-01 11:59:21 +00:00
matt
027c11539b Add IFNET_FOREACH and IFADDR_FOREACH macros and start using them. 2005-01-24 21:25:09 +00:00
matt
d341be30f4 Change initialzie of domains to use link sets. Switch to using STAILQ.
Add a convenience macro DOMAIN_FOREACH to interate through the domain.
2005-01-23 18:41:56 +00:00
matt
2fefa174c9 Make panic messages print out what condition they though was panic-worthy
instead of a 1 word message.
2004-10-20 22:10:31 +00:00
is
b5016b1bb3 Some code likes to mix MT_HEADER and MT_DATA. Revert this assertion until
the usage of MT_HEADER vs. MT_DATA is better defined and implemented.
2004-10-05 12:19:29 +00:00
enami
23114636eb Delete m_tag from a mbuf being non-pkthdr mbuf rather than newly becoming
pkthdr mbuf.
2004-09-17 23:24:03 +00:00
yamt
1304a56139 m_split: restore a behaviour on M_PKTHDR, which was unintentionaly
changed when i added m_copyback_cow.
2004-09-11 19:55:19 +00:00
yamt
7b09a1e089 m_copyback, m_copyback_cow, m_copydata:
- caddr_t -> void *
- constify.
partly from openbsd.
2004-09-08 12:00:28 +00:00
yamt
e2139bcdc8 add m_copyback_cow and m_makewritable. 2004-09-06 09:43:29 +00:00
yamt
7af0699fdd m_copyback: add an assertion to detect write attempts to a read-only mbuf. 2004-07-21 12:06:46 +00:00
jonathan
5249b5a2a5 Rename MBUFTRACE helper function m_claim() to m_claimm(),
for consistency with M_FREE() and m_freem().  Affected files:

sys/mbuf.h
kern/uipc_socket2.c
kern/uipc_mbuf.c
net/if_ethersubr.c
netatalk/ddp_input.c
nfs/nfs_socket.c
2004-06-24 04:15:50 +00:00
atatat
5b22e79ada Remaining sysctl descriptions under kern subtree 2004-05-25 04:30:32 +00:00
matt
e50668c7fa Constify protosw arrays. This can reduce the kernel .data section by
over 4K (if all the network protocols) are loaded.
2004-04-22 01:01:40 +00:00
atatat
19af35fd0d Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.
2004-03-24 15:34:46 +00:00
junyoung
a222c81884 Nuke __P(). 2004-03-23 13:22:03 +00:00
yamt
cd9b5b72f5 m_cat: assert mbuf types only when coalescing them by copying.
mbuf n often have 0-sized "headers" and their types don't matter much.

PR/24713 from Darrin B. Jewell.
2004-03-09 06:37:59 +00:00
itojun
efcd57f822 m_cat() - if it is safe, copy data portion into 1st mbuf even if 1st mbuf
is M_EXT mbuf.
2004-02-26 02:30:04 +00:00
atatat
4fe5b245f9 Fix the kern.mbuf tunables. 2004-01-21 02:11:20 +00:00
atatat
13f8d2ce5f Dynamic sysctl.
Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al.  Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded.  Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment.  I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.
2003-12-04 19:38:21 +00:00
itojun
98d5598feb when dropping M_PKTHDR, need to free m_tag associated with it. 2003-10-03 20:56:11 +00:00
yamt
02b67863b8 assert mbuf chains m_cat'ed are of the same type. 2003-09-07 12:04:13 +00:00
itojun
119a24cbdd clarify comment on m_cat(). 2003-09-04 04:10:32 +00:00
simonb
bc73aa40f5 Return NULL instead of 0 for functions that return pointers.
Sprinkle some KNF whitespace.
2003-08-15 02:59:32 +00:00
agc
aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
martin
d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
simonb
2a2748044b Fix tyop in a comment. 2003-05-27 09:03:46 +00:00
simonb
3a00c85d38 Add a KASSERT to make sure that "sizeof(struct mbuf)" is MSIZE.
Extra insurance for Steve Woodford's recent <sys/mbuf.h> patch.
2003-04-18 01:24:20 +00:00
thorpej
9b3ce45b2a Add two new mbuf routines:
* m_apply(), which applies a function to each mbuf in chain
  starting at a specified offset, for a specified length.
* m_getptr(), which returns a pointer to the mbuf, as well as
  the offset into that mbuf, corresponding to an offset from
  the beginning of an mbuf chain.

From OpenBSD, cleaned up slightly by me.
2003-04-12 02:49:25 +00:00
thorpej
f775de9f61 * Use a pool_cache constructor to record the physical address of mbufs
in the mbuf header.
* Use the new cached paddr feature of the pool_cache API to record
  the physical address of mbuf clusters.  (We cannot use a ctor for
  clusters, since clusters have no constructed form; they are merely
  buffers).

Bus_dma back-ends may use the cached physical addresses to save having to
extract the physical address from virtual.

* Provide space in m_ext recording the vm_page *'s for an SOSEND_LOAN_CHUNK-
  sized non-cluster external buffer.  Use this in the sosend_loan code to
  save having to extract the physical address from virtual and then look
  up the vm_page *'s.

* Provide an indication that an external buffer is mapped read-only at
  the MMU.  Set this flag for the external buffer in the sosend_loan
  case, since loaned pages are always mapped read-only.  Bus_dma back-ends
  may use this information to save cache flushing, since a cache flush of
  a read-only mapping is redundant on some architectures (the cache would
  have already been flushed when making the mapping read-only).

Part 2 in a series of simple patches contributed by Wasabi Systems
to improve network performance.
2003-04-09 18:38:01 +00:00
matt
65e5548a17 Add MBUFTRACE kernel option.
Do a little mbuf rework while here.  Change all uses of MGET*(*, M_WAIT, *)
to m_get*(M_WAIT, *).  These are not performance critical and making them
call m_get saves considerable space.  Add m_clget analogue of MCLGET and
make corresponding change for M_WAIT uses.
Modify netinet, gem, fxp, tulip, nfs to support MBUFTRACE.
Begin to change netstat to use sysctl.
2003-02-26 06:31:08 +00:00
thorpej
b193480908 Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant.  Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.
2003-02-01 06:23:35 +00:00
thorpej
e5e7fae215 ANSI'ify. 2003-01-31 04:55:52 +00:00
thorpej
71404bb533 Don't include <sys/map.h>. 2002-09-25 22:21:01 +00:00